Commit 1808e017 authored by petter's avatar petter

Emit token names

git-svn-id: https://www2.in.tum.de/repos/cup/develop@56 f8377d4f-c7f8-0310-b030-a31f13008fac
parent df9c87fc
......@@ -324,6 +324,19 @@ public class emit {
term.index() + ";");
}
/* Emit names of terminals */
out.println(" public static final String[] terminalNames = new String[] {");
for (int i = 0; i < terminal.number(); i++) {
out.print(" \"");
out.print(terminal.find(i).name());
out.print("\"");
if (i < terminal.number() - 1) {
out.print(",");
}
out.println();
}
out.println(" };");
/* do the non terminals if they want them (parser doesn't need them) */
if (emit_non_terms)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment