(Lexer lexer, List<ASTree> res)
| 34 | protected Parser[] parsers; |
| 35 | protected OrTree(Parser[] p) { parsers = p; } |
| 36 | protected void parse(Lexer lexer, List<ASTree> res) |
| 37 | throws ParseException |
| 38 | { |
| 39 | Parser p = choose(lexer); |
| 40 | if (p == null) |
| 41 | throw new ParseException(lexer.peek(0)); |
| 42 | else |
| 43 | res.add(p.parse(lexer)); |
| 44 | } |
| 45 | protected boolean match(Lexer lexer) throws ParseException { |
| 46 | return choose(lexer) != null; |
| 47 | } |