- Lay down the law on the different kinds of Sequence productions
and how they work.
+ => mydrop
+ => mylift
+
+ - whitespace-in-braces?
+ - Deal with the problem of zero-rep productions and whitespace insertion
+
- switch maximal to not-followed-by (~/~)
- should Union.add() be there?
return new TestCase(input, output, grammar, false); }
public TestCase testcase(String input, Union grammar) throws IOException {
return new TestCase(input, new String[0], grammar, false); }
+ public TestCase tibcase(String input, String[] output, Union grammar) throws IOException {
+ return new TestCase(input, output, grammar, true); }
public TestCase tibcase(String input, Union grammar) throws IOException {
return new TestCase(input, new String[0], grammar, true); }
public MetaGrammar grammar(Object[] o) { return this; }
public Object walk(String tag, Object[] args) {
if ("grammar".equals(tag)) {
- System.out.println("\n" + this + "\n");
+ //System.out.println("\n" + this + "\n");
return done("s");
}
else return super.walk(tag, args);
r ::= word ^"::=" alternatives /ws
| word ^"!::=" alternatives /ws
-alternatives ::= equiAlt +/ (ws ">" ws)
-equiAlt ::= conjuncts +/ (ws "|" ws)
+alternatives ::= (conjuncts +/ (ws "|" ws)) +/ (ws ">" ws)
conjuncts ::= sequence
| sequence ^"&" e*/ws /ws
range ::= ec => "range"
| ec ^"-" ec
-e ::= word => "nonTerminal"
+e ::= word => "nonTerminal"
| quoted => "literal"
| ^"()"
- | ^"{" sequence "}" /ws
+ | ^"{" sequence "}" /ws
| ^"[" (range*) "]"
| ^"[~" (range*) "]"
| ^"^" quoted /ws
how
{ are }
";
+ output "yep";
- s ::= { Hello }
+ s ::= { Hello } => "yep"
w ::= " " | "\n"
ws !::= w**
Hello ::= "hello" ws { ws "there" ws "how" ws { { "are" } ws } }
ws !::= w*
test ::= ^"testcase" "{" input output +/ ws grammar "}" /ws
| ^"testcase" "{" input grammar "}" /ws
+ | ^"tibcase" "{" input output +/ ws grammar "}" /ws
| ^"tibcase" "{" input grammar "}" /ws
output ::= "output" quoted ";" /ws
input ::= "input" quoted ";" /ws