#include "muscle_tab.h"
#include "output.h"
#include "reader.h"
+#include "scan-code.h" /* max_left_semantic_context */
#include "scan-skel.h"
#include "symtab.h"
#include "tables.h"
obstack_1grow (&format_obstack, ',');
j += width;
}
- /* Add a NULL entry to list of tokens (well, 0, as NULL might not be
- defined). */
- obstack_sgrow (&format_obstack, " 0");
+ obstack_sgrow (&format_obstack, " ]b4_null[");
/* Finish table and store. */
obstack_1grow (&format_obstack, 0);
{
rule_number r;
- fputs ("m4_define([b4_actions], \n[[", out);
+ fputs ("m4_define([b4_actions], \n[", out);
for (r = 0; r < nrules; ++r)
if (rules[r].action)
{
- fprintf (out, " case %d:\n", r + 1);
-
- fprintf (out, "]b4_syncline(%d, ",
+ fprintf (out, "b4_case(%d, [b4_syncline(%d, ", r + 1,
rules[r].action_location.start.line);
escaped_output (out, rules[r].action_location.start.file);
- fprintf (out, ")[\n");
- fprintf (out, " %s\n break;\n\n",
- rules[r].action);
+ fprintf (out, ")\n[ %s]])\n\n", rules[r].action);
}
- fputs ("]])\n\n", out);
+ fputs ("])\n\n", out);
}
/*--------------------------------------.
fputs ("m4_define([b4_symbol_destructors], \n[", out);
for (i = 0; i < nsyms; ++i)
- if (symbols[i]->destructor)
+ if (symbol_destructor_get (symbols[i]))
{
symbol *sym = symbols[i];
destructor, optional typename. */
fprintf (out, "%s[", sep);
sep = ",\n";
- escaped_output (out, sym->destructor_location.start.file);
- fprintf (out, ", %d, ", sym->destructor_location.start.line);
+ escaped_output (out, symbol_destructor_location_get (sym).start.file);
+ fprintf (out, ", %d, ",
+ symbol_destructor_location_get (sym).start.line);
escaped_output (out, sym->tag);
- fprintf (out, ", %d, [[%s]]", sym->number, sym->destructor);
+ fprintf (out, ", %d, [[%s]]", sym->number,
+ symbol_destructor_get (sym));
if (sym->type_name)
fprintf (out, ", [[%s]]", sym->type_name);
fputc (']', out);
fputs ("m4_define([b4_symbol_printers], \n[", out);
for (i = 0; i < nsyms; ++i)
- if (symbols[i]->printer)
+ if (symbol_printer_get (symbols[i]))
{
symbol *sym = symbols[i];
printer, optional typename. */
fprintf (out, "%s[", sep);
sep = ",\n";
- escaped_output (out, sym->printer_location.start.file);
- fprintf (out, ", %d, ", sym->printer_location.start.line);
+ escaped_output (out, symbol_printer_location_get (sym).start.file);
+ fprintf (out, ", %d, ", symbol_printer_location_get (sym).start.line);
escaped_output (out, sym->tag);
- fprintf (out, ", %d, [[%s]]", sym->number, sym->printer);
+ fprintf (out, ", %d, [[%s]]", sym->number, symbol_printer_get (sym));
if (sym->type_name)
fprintf (out, ", [[%s]]", sym->type_name);
fputc (']', out);
prepare_actions (void)
{
/* Figure out the actions for the specified state, indexed by
- look-ahead token type. */
+ lookahead token type. */
muscle_insert_rule_number_table ("defact", yydefact,
yydefact[0], 1, nstates);
MUSCLE_INSERT_BOOL ("locations_flag", locations_flag);
MUSCLE_INSERT_BOOL ("pure_flag", pure_parser);
MUSCLE_INSERT_BOOL ("synclines_flag", !no_lines_flag);
+ MUSCLE_INSERT_BOOL ("tag_seen_flag", tag_seen);
+ MUSCLE_INSERT_BOOL ("yacc_flag", yacc_flag);
/* File names. */
MUSCLE_INSERT_STRING ("prefix", spec_name_prefix ? spec_name_prefix : "yy");