X-Git-Url: http://git.megacz.com/?p=sbp.git;a=blobdiff_plain;f=tests%2Fmeta.g;h=807f15f080c93a0453c3a452db883844f3ec69ae;hp=5dafc7d42224140d1ce4c37eb70a2b79e360d0a0;hb=5964a1161340a16d7dea471372737f2474576ceb;hpb=8991d0265d2d0ded4b7a680fcc2a6794c95d9f01 diff --git a/tests/meta.g b/tests/meta.g index 5dafc7d..807f15f 100644 --- a/tests/meta.g +++ b/tests/meta.g @@ -1,4 +1,4 @@ -s ::= Grammar ws => "gram" +s ::= !ws Grammar ws => "gram" Grammar ::= NonTerminal +/ ws => "grammar" NonTerminal ::= word ^"::=" RHS /ws @@ -9,16 +9,12 @@ Conjuncts ::= Sequence | Sequence ^"&~" Elements /ws Elements ::= e*/ws -ps ::= Elements => "ps" - | (e+/ws !ws)? ^"^" Quoted (!ws e+/ws)? -psy ::= ps - | ps !wp ^"/" !ws e -psx ::= psy => "psy" - | psy ^"->" e /ws -Sequence ::= Quoted => "qprod" - > psx => "psx" - | psx "=>" ^"[]" /ws - | psx ^"=>" ("()"|word|Quoted) /ws +PreSequence ::= Elements => "ps" + | PreSequence !wp ^"/" !ws e + | PreSequence ^"->" e /ws + | (Quoted|word) ^"::" PreSequence /ws + | PreSequence ^"=>" ("[]"|"()"|word|Quoted) /ws +Sequence ::= PreSequence => "psx" ec ::= ~[\-\]\\] | escaped @@ -26,12 +22,13 @@ ec ::= ~[\-\]\\] Range ::= ec => "range" | ec ^"-" ec -e ::= word => "nonTerminal" +e ::= + (Quoted|word) ^":" e + > word => "nonTerminal" | Quoted => "literal" | ^"()" | ^"{" Sequence "}" /ws | ^"[" Range* "]" - | e ^"++" /ws -> ~[/] | e ^"+" /ws -> ~[+] | e ^"++/" e /ws @@ -42,6 +39,7 @@ e ::= word => "nonTerminal" | e ^"*/" e /ws | ^"!" e /ws | e ^"?" /ws + | ^"^" Quoted /ws | "(" word ^")" /ws > ^"(" RHS ")" /ws