Make yacc and lex more pedant friendly.
This commit is contained in:
parent
7bda1456a8
commit
787a5a559b
2 changed files with 8 additions and 0 deletions
|
|
@ -11,6 +11,7 @@ int yyprevious = YYNEWLINE;
|
||||||
# ifdef LEXDEBUG
|
# ifdef LEXDEBUG
|
||||||
extern void allprint(char);
|
extern void allprint(char);
|
||||||
# endif
|
# endif
|
||||||
|
int
|
||||||
yylook(void){
|
yylook(void){
|
||||||
struct yysvf *yystate, **lsp;
|
struct yysvf *yystate, **lsp;
|
||||||
struct yywork *yyt;
|
struct yywork *yyt;
|
||||||
|
|
@ -158,6 +159,7 @@ yylook(void){
|
||||||
}
|
}
|
||||||
return(0); /* shut up the compiler; i have no idea what should be returned */
|
return(0); /* shut up the compiler; i have no idea what should be returned */
|
||||||
}
|
}
|
||||||
|
int
|
||||||
yyback(int *p, int m)
|
yyback(int *p, int m)
|
||||||
{
|
{
|
||||||
if (p==0) return(0);
|
if (p==0) return(0);
|
||||||
|
|
@ -169,12 +171,17 @@ while (*p)
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
/* the following are only used in the lex library */
|
/* the following are only used in the lex library */
|
||||||
|
int
|
||||||
yyinput(void){
|
yyinput(void){
|
||||||
|
if(yyin == ((void*)0))
|
||||||
|
yyin = stdin;
|
||||||
return(input());
|
return(input());
|
||||||
}
|
}
|
||||||
void
|
void
|
||||||
yyoutput(int c)
|
yyoutput(int c)
|
||||||
{
|
{
|
||||||
|
if(yyout == ((void*)0))
|
||||||
|
yyout = stdin;
|
||||||
output(c);
|
output(c);
|
||||||
}
|
}
|
||||||
void
|
void
|
||||||
|
|
|
||||||
|
|
@ -184,6 +184,7 @@ yydefault:
|
||||||
printf("%s", yystatname(yystate));
|
printf("%s", yystatname(yystate));
|
||||||
printf("saw %s\n", yytokname(yychar));
|
printf("saw %s\n", yytokname(yychar));
|
||||||
}
|
}
|
||||||
|
goto yyerrlab;
|
||||||
yyerrlab:
|
yyerrlab:
|
||||||
yynerrs++;
|
yynerrs++;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue