Type:
Class
Constants:
PUBIDCHAR
:
"\x20\x0D\x0Aa-zA-Z0-9\\-()+,./:=?;!*@$_%#"
SYSTEMLITERAL
:
%Q{((?:"[^"]*")|(?:'[^']*'))}
PUBIDLITERAL
:
%Q{("[#{PUBIDCHAR}']*"|'[#{PUBIDCHAR}]*')}
EXTERNALID
:
"(?:(?:(SYSTEM)\\s+#{SYSTEMLITERAL})|(?:(PUBLIC)\\s+#{PUBIDLITERAL}\\s+#{SYSTEMLITERAL}))"
NDATADECL
:
"\\s+NDATA\\s+#{NAME}"
PEREFERENCE
:
"%#{NAME};"
ENTITYVALUE
:
%Q{((?:"(?:[^%&"]|#{PEREFERENCE}|#{REFERENCE})*")|(?:'([^%&']|#{PEREFERENCE}|#{REFERENCE})*'))}
PEDEF
:
"(?:#{ENTITYVALUE}|#{EXTERNALID})"
ENTITYDEF
:
"(?:#{ENTITYVALUE}|(?:#{EXTERNALID}(#{NDATADECL})?))"
PEDECL
:
"<!ENTITY\\s+(%)\\s+#{NAME}\\s+#{PEDEF}\\s*>"
GEDECL
:
"<!ENTITY\\s+#{NAME}\\s+#{ENTITYDEF}\\s*>"
ENTITYDECL
:
/\s*(?:#{GEDECL})|(?:#{PEDECL})/um
PEREFERENCE_RE
:
/#{PEREFERENCE}/um
God, I hate DTDs. I really do. Why this idiot standard still plagues us is beyond me.