X-Git-Url: http://git.megacz.com/?p=sbp.git;a=blobdiff_plain;f=tests%2Fmeta.g;h=713383a8ad1a88543c56d5cf14eb96d441ef5962;hp=9755cfc18f8adb23deb5f63a1bf7d3beb07a0ec6;hb=241b14cc03dae98e9a5805b6bef2ecf008508ae0;hpb=2fae767715346f7d7e708b63f00a2f40ec26d3de diff --git a/tests/meta.g b/tests/meta.g index 9755cfc..713383a 100644 --- a/tests/meta.g +++ b/tests/meta.g @@ -1,39 +1,41 @@ s ::= ws grammar ws => "gram" ws !::= w** -grammar ::= r+/ws => "grammar" +grammar ::= r $$ ws => "grammar" r ::= word ^"::=" alternatives /ws | word ^"!::=" alternatives /ws -ec ::= [~\]\\\-\~] | escaped - -alternatives ::= equiAlt +/ (ws ">" ws) -equiAlt ::= conjuncts +/ (ws "|" ws) => "alternatives" +alternatives ::= equiAlt $$ (ws ">" ws) +equiAlt ::= conjuncts $$ (ws "|" ws) => "alternatives" sequence ::= Es - > Es ^"/" e /ws + > Es ws ^"/" e Es ::= e+ -//es ::= e+/ws +es ::= e %% ws +ss ::= es | es ^"/" e /ws conjuncts ::= rewrite - | rewrite ^"&" sequence /ws - | rewrite ^"&~" sequence /ws + | rewrite ^"&" e%%ws /ws + | rewrite ^"&~" e%%ws /ws rewrite ::= sequence /ws => "rewrite" | sequence ^"=>" word /ws | sequence ^"=>" quoted /ws | sequence "=>" "()" /ws => "wrap" +ec ::= [~\-\]\\\~] + | escaped + range ::= ec => "range0" - | ec ^"-" ec => "range0" + | ec ^"-" ec => "range1" e ::= word => "nonTerminalY" | [(][)] => "epsilon" | ^"{" alternatives "}" /ws - | "[" [\~]? range* "]" => "range" - | e ^"*/" e /ws + | "[" ranges "]" => "range" + | "[~" ranges "]" => "rangex" | e ^"%%" e /ws - | e ^"+/" e /ws + | e ^"$$" e /ws | e ^"?" /ws | e ^"~/~" /ws @@ -51,6 +53,8 @@ e ::= word => "nonTerminalY" | "(" word ^")" /ws > ^"(" alternatives ")" /ws +ranges ::= range* + w !::= " " | "//" [~\n]* "\n" | "\n"