aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/lex
diff options
context:
space:
mode:
authorwkj <devnull@localhost>2004-05-16 07:59:27 +0000
committerwkj <devnull@localhost>2004-05-16 07:59:27 +0000
commiteb43e9ba97471912f3338750198951ca4f5eec82 (patch)
treee6a6cf4182ae7e7c31cd67fc5c22e91f27d2dad5 /src/cmd/lex
parenta87f4771c76a15ef4dd422b1eb83fc9e1ffde036 (diff)
downloadplan9port-eb43e9ba97471912f3338750198951ca4f5eec82.tar.gz
plan9port-eb43e9ba97471912f3338750198951ca4f5eec82.tar.bz2
plan9port-eb43e9ba97471912f3338750198951ca4f5eec82.zip
Make lex more pedant friendly.
Diffstat (limited to 'src/cmd/lex')
-rw-r--r--src/cmd/lex/header.c2
-rw-r--r--src/cmd/lex/ncform3
-rw-r--r--src/cmd/lex/parser.y2
3 files changed, 5 insertions, 2 deletions
diff --git a/src/cmd/lex/header.c b/src/cmd/lex/header.c
index 8fa63d62..53345beb 100644
--- a/src/cmd/lex/header.c
+++ b/src/cmd/lex/header.c
@@ -85,7 +85,7 @@ void
phead2(void)
{
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,"if(yywrap()) return(0); break;\n");
}
diff --git a/src/cmd/lex/ncform b/src/cmd/lex/ncform
index dd7a1ea6..6571735b 100644
--- a/src/cmd/lex/ncform
+++ b/src/cmd/lex/ncform
@@ -11,6 +11,7 @@ int yyprevious = YYNEWLINE;
# ifdef LEXDEBUG
extern void allprint(char);
# endif
+int
yylook(void){
struct yysvf *yystate, **lsp;
struct yywork *yyt;
@@ -158,6 +159,7 @@ yylook(void){
}
return(0); /* shut up the compiler; i have no idea what should be returned */
}
+int
yyback(int *p, int m)
{
if (p==0) return(0);
@@ -169,6 +171,7 @@ while (*p)
return(0);
}
/* the following are only used in the lex library */
+int
yyinput(void){
if(yyin == ((void*)0))
yyin = stdin;
diff --git a/src/cmd/lex/parser.y b/src/cmd/lex/parser.y
index 5ac33a28..8e7285d0 100644
--- a/src/cmd/lex/parser.y
+++ b/src/cmd/lex/parser.y
@@ -240,7 +240,7 @@ yylex(void)
case '%':
lgate();
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;
i = treesize*(sizeof(*name)+sizeof(*left)+
sizeof(*right)+sizeof(*nullstr)+sizeof(*parent))+ALITTLEEXTRA;