X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=tests%2Fmeta.g;h=5b4cf6af5199b123339d89e161177b3a21f40351;hb=f886ddc95036b4fdb55a02ad566303f9bf1829d1;hp=138ec62a9c7ef708b6ea747c502a94c241e95500;hpb=f491592fb43d4fd68221db2b893baaede4cfdaca;p=sbp.git diff --git a/tests/meta.g b/tests/meta.g index 138ec62..5b4cf6a 100644 --- a/tests/meta.g +++ b/tests/meta.g @@ -10,9 +10,9 @@ alternatives ::= equiAlt +/ (ws ">" ws) equiAlt ::= conjuncts +/ (ws "|" ws) => "alternatives" sequence ::= Es - > Es ^"/" E /ws -Es ::= E+ -//es ::= E+/ws + > Es ^"/" e /ws +Es ::= e+ +es ::= e+/ws conjuncts ::= rewrite | rewrite ^"&" sequence /ws @@ -23,29 +23,31 @@ rewrite ::= sequence /ws => "rewrite" | sequence ^"=>" quoted /ws | sequence "=>" "()" /ws => "wrap" -range ::= ec => "range0" | ec ^"-" ec => "range0" -E ::= word => "nonTerminalY" +range ::= ec => "range0" + | ec ^"-" ec => "range0" + +e ::= word => "nonTerminalY" | [(][)] => "epsilon" - | ^"{" alternatives "}" + | ^"{" alternatives "}" /ws | "[" [\~]? range* "]" => "range" - | E ^"*/" E - | E ^"+/" E - | E ^"?" - | E ^"~/~" + | e ^"*/" e /ws + | e ^"+/" e /ws + | e ^"?" /ws + | e ^"~/~" /ws - | E ^"-" E + | e ^"-" e /ws - | ^"!" E - | "^" quoted => "care" - | ^"`" E - | E ^"#" + | ^"!" e /ws + | "^" quoted /ws => "care" + | ^"`" e /ws + | e ^"#" /ws | quoted => "literal" - | (E ^"**" > E ^"*") - | (E ^"++" > E ^"+") + | (e ws ^"**" > e ws ^"*") + | (e ws ^"++" > e ws ^"+") - | "(" word ^")" - > ^"(" alternatives ")" + | "(" word ^")" /ws + > ^"(" alternatives ")" /ws w !::= " " | "//" [~\n]* "\n" @@ -57,3 +59,5 @@ quoted ::= "\"" ([~\"\\] | escaped)* "\"" => "sify" escaped ::= "\\n" => "\n" | "\\r" => "\r" | "\\" [~nr] + +