Created
July 24, 2016 06:03
-
-
Save anonymous/c4a468029e0a137fbe53c08ee0a9b6b5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
grammar ML { | |
rule TOP { <tag> } | |
token identifier { \w <[\w\d]>* } | |
token quote { <!after \\> '"' } | |
token quoted { <.quote>} ~ <.quote> .* } | |
token tag { | |
<btag> | |
~ | |
<etag($<btag><name>)> | |
$<children> = [[<!after '<'> .*] | <tag>]* | |
} | |
token la { <!after '\'> '<' } | |
token ra { <!after '\'> '>' } | |
token btag { [<.la> \s* <name=.identifier> \s* [<attribute>*% \s] <.ra>] } | |
token etag($name) { <.la> '/' \s* $name \s* <.ra> } | |
token attribute { <identifier> [\s* '=' \s* <quoted>]? } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment