if (g != null)
switch(tok) {
case BITOR: return new Grammar.Alternative(g, parseGrammar(null));
- case ADD: return new Grammar.Repetition(g, 1, Integer.MAX_VALUE);
- case MUL: return new Grammar.Repetition(g, 0, Integer.MAX_VALUE);
- case HOOK: return new Grammar.Repetition(g, 0, 1);
+ case ADD: return parseGrammar(new Grammar.Repetition(g, 1, Integer.MAX_VALUE));
+ case MUL: return parseGrammar(new Grammar.Repetition(g, 0, Integer.MAX_VALUE));
+ case HOOK: return parseGrammar(new Grammar.Repetition(g, 0, 1));
}
Grammar g0 = null;
switch(tok) {
default: pushBackToken(); return g;
}
if (g == null) return parseGrammar(g0);
- return new Grammar.Juxtaposition(g, g0);
+ return parseGrammar(new Grammar.Juxtaposition(g, g0));
}
/**