mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-21 10:13:03 +00:00
(Badly Collapsed GLR States): Avoid //
comments, since they're not portable. Use GNU coding style.
This commit is contained in:
@@ -25,7 +25,7 @@ AT_DATA([glr-regr1.y],
|
|||||||
/* Reported by Scott McPeak */
|
/* Reported by Scott McPeak */
|
||||||
|
|
||||||
%{
|
%{
|
||||||
#include <stdio.h> // fgetc, printf
|
#include <stdio.h>
|
||||||
|
|
||||||
#define YYSTYPE int
|
#define YYSTYPE int
|
||||||
static YYSTYPE exprMerge (YYSTYPE x0, YYSTYPE x1);
|
static YYSTYPE exprMerge (YYSTYPE x0, YYSTYPE x1);
|
||||||
@@ -63,29 +63,29 @@ static YYSTYPE exprMerge (YYSTYPE x0, YYSTYPE x1)
|
|||||||
int
|
int
|
||||||
main (void)
|
main (void)
|
||||||
{
|
{
|
||||||
yyparse();
|
yyparse ();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
yyerror (char const *msg)
|
yyerror (char const *msg)
|
||||||
{
|
{
|
||||||
printf("%s\n", msg);
|
fprintf (stderr, "%s\n", msg);
|
||||||
exit(4);
|
exit (4);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
yylex (void)
|
yylex (void)
|
||||||
{
|
{
|
||||||
while (1) {
|
for (;;)
|
||||||
int ch = fgetc(stdin);
|
{
|
||||||
if (ch == EOF) {
|
int ch = getchar ();
|
||||||
return 0; // bison's EOF
|
if (ch == EOF)
|
||||||
} else if (ch == 'B' || ch == 'P') {
|
return 0;
|
||||||
return ch;
|
else if (ch == 'B' || ch == 'P')
|
||||||
|
return ch;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
]])
|
]])
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user