summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/output.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/output.cpp b/src/output.cpp
index 1b4d6d8..4af9a1c 100644
--- a/src/output.cpp
+++ b/src/output.cpp
@@ -34,7 +34,7 @@ namespace solar {
output_t::output_t(const generator_t *generator0, const char *header, const char *source)
: prefix_str("parse_"),
- token_prefix_str("TOKEN_"),
+ token_prefix_str("TOK_"),
stack_size(100),
generator(generator0) {
header_file = std::fopen(header, "w");
@@ -107,7 +107,7 @@ void output_t::emit_state_shift(unsigned i) {
if (token.get_type() == SYMBOL_TYPE_CHAR)
std::fprintf(source_file, "\t\t\tcase '%c':\n", token.get_value()[0]);
else
- std::fprintf(source_file, "\t\t\tcase %u:\n", tokens[token.get_value()]);
+ std::fprintf(source_file, "\t\t\tcase %s%s:\n", token_prefix(), token.get_value().c_str());
std::fprintf(source_file, "\t\t\t\tparser->stack[++parser->top].state = %u;\n", unsigned(it->second));
std::fprintf(source_file, "\t\t\t\treturn 1;\n\n");