Last active
December 12, 2015 01:18
-
-
Save PollRobots/4689701 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| hexDigit <- [0123456789abcdefABCDEF] | |
| escapedCharacter <- '\\' ([abfnrtv0\\"'[\]] / ('u' hexDigit hexDigit hexDigit hexDigit)) | |
| safeCharacter <- escapedCharacter / (!["\\\n] <anychar>) | |
| oneofCharacter <- escapedCharacter / (![\\\]] <anychar>) | |
| terminalUnicode <- '{' ( "Lu" / "Ll" / "Lt" / "Lm" / "Lo" / "Mn" / "Mc" / "Me" / "Nd" / "Nl" / "No" / "Pc" / "Pd" / | |
| "Ps" / "Pe" / "Pi" / "Pf" / "Po" / "Sm" / "Sc" / "Sk" / "So" / "Zs" / "Zl" / "Zp" / "Cc" / | |
| "Cf" / "Cs" / "Co" / "Cn" ) '}' | |
| terminalOneOf <- '[' oneofCharacter+ ']' | |
| terminalCharacter <- '\'' safeCharacter '\'' | |
| terminalWord <- '\"' safeCharacter+ '\"' | |
| terminal <- terminalWord / terminalCharacter / terminalOneOf / terminalUnicode / "<anychar>" / "<epsilon>" | |
| space <- [ \t\r\n]+ | |
| name <- ({Lu} / {Ll} / '-') ({Lu} / {Ll} / {Nd} / [_-])* | |
| nonterminal <- name | |
| atom <- terminal / nonterminal / ('(' space? expr space? ')') | |
| unary <- ([!&] unary) / (atom [*+?])? | |
| sequence <- unary (space unary)* | |
| choice <- sequence (space? '/' space? sequence)* | |
| expr <- choice | |
| codechar <- (![{}\] <anychar>) / ('\\' [{}\\]) / ('{' codechar* '}') | |
| codeblock <- '{' codechar* '}' | |
| rule <- name space? "<-" space? expr space? codeblock? space? <epsilon> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment