mirror of
https://github.com/9fans/plan9port.git
synced 2025-01-27 11:52:03 +00:00
Make lex more pedant friendly.
This commit is contained in:
parent
a87f4771c7
commit
eb43e9ba97
3 changed files with 5 additions and 2 deletions
|
@ -85,7 +85,7 @@ void
|
||||||
phead2(void)
|
phead2(void)
|
||||||
{
|
{
|
||||||
Bprint(&fout,"while((nstr = yylook()) >= 0)\n");
|
Bprint(&fout,"while((nstr = yylook()) >= 0)\n");
|
||||||
Bprint(&fout,"yyfussy: switch(nstr){\n");
|
Bprint(&fout,"goto yyfussy;\nyyfussy: switch(nstr){\n");
|
||||||
Bprint(&fout,"case 0:\n");
|
Bprint(&fout,"case 0:\n");
|
||||||
Bprint(&fout,"if(yywrap()) return(0); break;\n");
|
Bprint(&fout,"if(yywrap()) return(0); break;\n");
|
||||||
}
|
}
|
||||||
|
|
|
@ -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,6 +171,7 @@ 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))
|
if(yyin == ((void*)0))
|
||||||
yyin = stdin;
|
yyin = stdin;
|
||||||
|
|
|
@ -240,7 +240,7 @@ yylex(void)
|
||||||
case '%':
|
case '%':
|
||||||
lgate();
|
lgate();
|
||||||
Bprint(&fout,"#define YYNEWLINE %d\n",'\n');
|
Bprint(&fout,"#define YYNEWLINE %d\n",'\n');
|
||||||
Bprint(&fout,"yylex(void){\nint nstr; extern int yyprevious;\n");
|
Bprint(&fout,"int\nyylex(void){\nint nstr; extern int yyprevious;\nif(yyprevious){}\n");
|
||||||
sectbegin = TRUE;
|
sectbegin = TRUE;
|
||||||
i = treesize*(sizeof(*name)+sizeof(*left)+
|
i = treesize*(sizeof(*name)+sizeof(*left)+
|
||||||
sizeof(*right)+sizeof(*nullstr)+sizeof(*parent))+ALITTLEEXTRA;
|
sizeof(*right)+sizeof(*nullstr)+sizeof(*parent))+ALITTLEEXTRA;
|
||||||
|
|
Loading…
Reference in a new issue