Skip to content

Commit

Permalink
Print more details of terminal symbol
Browse files Browse the repository at this point in the history
  • Loading branch information
romildo committed Oct 7, 2016
1 parent e46e955 commit 6efa251
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main/java/main/Driver.java
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,10 @@ public static void lexicalAnalysis(Reader input) throws IOException {
Symbol tok;
do {
tok = lexer.next_token();
System.out.println(tok);
System.out.printf("%-4s %-8s %s%n",
tok,
SymbolConstants.terminalNames[tok.sym],
tok.value == null ? "" : tok.value);
} while (tok.sym != SymbolConstants.EOF);
}

Expand Down

0 comments on commit 6efa251

Please sign in to comment.