private boolean accept(NonTerminal nt) throws IOException { if (have(nt)) { currentToken = scanner.next(); return true; } return false; }
private boolean accept(Token.Kind kind) throws IOException { if (have(kind)) { currentToken = scanner.next(); return true; } return false; }
public Parser(Scanner scanner) throws IOException { this.scanner = scanner; this.currentToken = scanner.next(); }