]> ocean-lang.org Git - ocean/blobdiff - csrc/parsergen.mdc
parsergen: include virtual symbols in table of non-terminals
[ocean] / csrc / parsergen.mdc
index 478482e0f6b0512b9fc09946b4b1b5ead04fe7fd..d2ff89844d2e616e0f10e470c0a7dbffde9492a7 100644 (file)
@@ -1900,7 +1900,9 @@ pieces of code provided in the grammar file, so they are generated first.
 ### Known words table
 
 The known words table is simply an array of terminal symbols.
-The table of nonterminals used for tracing is a similar array.
+The table of nonterminals used for tracing is a similar array.  We
+include virtual symbols in the table of non_terminals to keep the
+numbers right.
 
 ###### functions
 
@@ -1925,7 +1927,7 @@ The table of nonterminals used for tracing is a similar array.
                for (i = TK_reserved;
                     i < g->num_syms;
                     i++)
-                       if (g->symtab[i]->type == Nonterminal)
+                       if (g->symtab[i]->type != Terminal)
                                fprintf(f, "\t\"%.*s\",\n", g->symtab[i]->name.len,
                                        g->symtab[i]->name.txt);
                fprintf(f, "};\n\n");