Created
July 24, 2016 06:03
Star
You must be signed in to star a gist
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