X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;ds=sidebyside;f=tests%2Fmeta.g;h=d05ee8fc273103d40587ce332c461f6dfa3cb102;hb=743c3e95b1e541982b104f690a3707e89fc10073;hp=6c4110227835da62ccf17e2bba2c41ed4e5e3b68;hpb=41f3013f707529437b829c8c0e6c447b550749e5;p=sbp.git diff --git a/tests/meta.g b/tests/meta.g index 6c41102..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*) "]" | ^"[~" (range*) "]" - | e ^"+/" e /ws - | e ^"*/" e /ws - | e ^"?" /ws + | ^"^" 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]