Example #1
0
 public void match(int t) throws IOException, SyntaxError {
   if (t == lookahead) { // Progress the lookahead
     lookahead = reader.read();
   } else throw new SyntaxError("syntax error");
 }
Example #2
0
 public Parser(String filePath, String outputPath) throws IOException {
   reader = new BufferedReader(new FileReader(filePath));
   writer = new WriterFactory(outputPath).create();
   lookahead = reader.read();
 }