X-Git-Url: http://git.megacz.com/?p=sbp.git;a=blobdiff_plain;f=tests%2Fmeta.g;h=d05ee8fc273103d40587ce332c461f6dfa3cb102;hp=f709a77bddf1564ba243bb56a6f4a23d185cef8e;hb=ae49c84428d77798ddeedf4c7e6329799f0633e7;hpb=be24ec463cd9a9a4f907c5a6167d8029726753ea diff --git a/tests/meta.g b/tests/meta.g index f709a77..d05ee8f 100644 --- a/tests/meta.g +++ b/tests/meta.g @@ -1,11 +1,11 @@ s ::= ws grammar ws => "gram" ws !::= w** -grammar ::= r +/ ws => "grammar" +grammar ::= r +/ ws => "grammar" r ::= word ^"::=" alternatives /ws | word ^"!::=" alternatives /ws alternatives ::= equiAlt +/ (ws ">" ws) -equiAlt ::= conjuncts +/ (ws "|" ws) => "alternatives" +equiAlt ::= conjuncts +/ (ws "|" ws) sequence ::= es > es ws ^"/" e @@ -28,26 +28,25 @@ ec ::= [~\-\]\\\~] range ::= ec => "range" | ec ^"-" ec -e ::= word => "nonTerminalY" - | [(][)] => "epsilon" +e ::= word => "nonTerminal" + | [(][)] => "epsilon" | ^"{" alternatives "}" /ws - | "[" (range*) "]" => "ranges" - | "[~" (range*) "]" => "rangesx" - | e ^"+/" e /ws - | e ^"*/" e /ws - | e ^"?" /ws + | ^"[" (range*) "]" + | ^"[~" (range*) "]" + | ^"^" quoted /ws | e ^"~/~" /ws - - | e ^"-" e /ws - | ^"!" e /ws - | "^" quoted /ws => "care" + | ^"`" e /ws | e ^"#" /ws - | quoted => "literal" | (e ws ^"**" > e ws ^"*") + | e ^"*/" e /ws | (e ws ^"++" > e ws ^"+") + | e ^"+/" e /ws + | e ^"?" /ws + + | quoted => "literal" | "(" word ^")" /ws > ^"(" alternatives ")" /ws @@ -57,8 +56,9 @@ w !::= " " | "\n" | "\r" an ::= [a-zA-Z0-9_] -word ::= an++ => "sify" -quoted ::= "\"" (([~\"\\] | escaped)*) "\"" => "sify" +word ::= an++ +quoted ::= "\"" (([~\"\\] | escaped)+) "\"" + | "\"\"" => "" escaped ::= "\\n" => "\n" | "\\r" => "\r" | "\\" [~nr]