if (semantic_parser)
fprintf (fguard, GUARDSTR, attrsfile);
- if (noparserflag)
+ if (no_parser_flag)
return;
fprintf (faction, (semantic_parser ? ACTSTR : ACTSTR_SIMPLE), attrsfile);
fprintf (faction, "\n");
- if (noparserflag)
+ if (no_parser_flag)
return;
if (semantic_parser)
/* With the ordinary parser,
yyprhs and yyrhs are needed only for yydebug. */
- /* With the noparser option, all tables are generated */
- if (!semantic_parser && !noparserflag)
+ /* With the no_parser option, all tables are generated */
+ if (!semantic_parser && !no_parser_flag)
fprintf (ftable, "\n#if YYDEBUG != 0\n");
output_short_table (ftable, "yyprhs", rrhs,
fprintf (ftable, "\n};\n");
- if (!semantic_parser && !noparserflag)
+ if (!semantic_parser && !no_parser_flag)
fprintf (ftable, "\n#endif\n");
}
fputs ("#endif\n\n", ftable);
- if (toknumflag || noparserflag)
+ if (token_table_flag || no_parser_flag)
{
fprintf (ftable, "#define YYNTOKENS %d\n", ntokens);
fprintf (ftable, "#define YYNNTS %d\n", nvars);
fprintf (ftable, "#define YYMAXUTOK %d\n\n", max_user_token_number);
}
- if (!toknumflag && !noparserflag)
+ if (!token_table_flag && !no_parser_flag)
fprintf (ftable, "\n#if YYDEBUG != 0 || defined (YYERROR_VERBOSE)\n\n");
/* Output the table of symbol names. */
/* add a NULL entry to list of tokens */
fprintf (ftable, ", NULL\n};\n");
- if (!toknumflag && !noparserflag)
+ if (!token_table_flag && !no_parser_flag)
fprintf (ftable, "#endif\n\n");
/* Output YYTOKNUM. */
- if (toknumflag)
+ if (token_table_flag)
{
output_short_table (ftable, "yytoknum", user_toknums,
0, 1, ntokens + 1);
output_parser (void)
{
int c;
+ static int number_of_dollar_signs = 0;
#ifdef DONTDEF
FILE *fpars;
#else
if (pure_parser)
fprintf (ftable, "#define YYPURE 1\n\n");
-#ifdef DONTDEF /* JF no longer needed 'cuz open_extra_files changes the
- currently open parser from bison.simple to bison.hairy */
+#ifdef DONTDEF
+ /* JF no longer needed 'cuz open_extra_files changes the currently
+ open parser from bison.simple to bison.hairy */
if (semantic_parser)
fpars = fparser;
else
/* See if the line starts with `#line.
If so, set write_line to 0. */
- if (nolinesflag)
+ if (no_lines_flag)
if (c == '#')
{
c = getc (fpars);
{
if (c == '$')
{
+ number_of_dollar_signs++;
+ assert (number_of_dollar_signs == 1);
/* `$' in the parser file indicates where to put the actions.
Copy them in at this point. */
rewind (faction);
for (c = getc (faction); c != EOF; c = getc (faction))
putc (c, ftable);
+ /* Skip the end of the line containing `$'. */
+ write_line = 0;
}
else
putc (c, ftable);
break;
putc (c, ftable);
}
+ assert (number_of_dollar_signs == 1);
}
static void
{
int c;
- if (!nolinesflag)
+ if (!no_lines_flag)
fprintf (ftable, "#line %d \"%s\"\n", lineno, infile);
c = getc (finput);
putc (c, ftable);
}
reader_output_yylsp (ftable);
- if (debugflag)
+ if (debug_flag)
fputs ("\
#ifndef YYDEBUG\n\
-#define YYDEBUG 1\n\
+# define YYDEBUG 1\n\
#endif\n\
\n",
ftable);
if (semantic_parser)
fprintf (ftable, "#include \"%s\"\n", attrsfile);
- if (!noparserflag)
+ if (!no_parser_flag)
fprintf (ftable, "#include <stdio.h>\n\n");
/* Make "const" do nothing if not in ANSI C. */
output_stos ();
output_rule_data ();
output_actions ();
- if (!noparserflag)
+ if (!no_parser_flag)
output_parser ();
output_program ();
}