Implement a dead simple pseudo-EBNF to Pest translator, which works on Conlang's EBNF
This commit is contained in:
18
test.grammatical
Normal file
18
test.grammatical
Normal file
@@ -0,0 +1,18 @@
|
||||
(* Grammatical EBNF *)
|
||||
Ruleset = (COMMENT? Rule)* EOI ;
|
||||
Rule = ident '=' Either? ';' ;
|
||||
Either = Follow ('|' Follow)* ;
|
||||
Follow = (Any | Many | Maybe | Not)+ ;
|
||||
Any = Not '*' ;
|
||||
Many = Not '+' ;
|
||||
Maybe = Not '?' ;
|
||||
Not = '!'? Prime ;
|
||||
Prime = Group | chr | str | ident ;
|
||||
Group = '(' Either ')' ;
|
||||
|
||||
ident = XID_START XID_CONTINUE* ;
|
||||
str = '"' (!'"' ANY)* '"' ;
|
||||
chr = "'" (!"'" ANY)* "'" ;
|
||||
|
||||
WHITESPACE = WHITE_SPACE ;
|
||||
COMMENT = "(*" (COMMENT | !"*)" ANY)* "*)" ;
|
||||
Reference in New Issue
Block a user