diff options
author | wkj <devnull@localhost> | 2004-05-16 08:08:13 +0000 |
---|---|---|
committer | wkj <devnull@localhost> | 2004-05-16 08:08:13 +0000 |
commit | 787a5a559bfe44f61fb52e90873cfb6096eb9f65 (patch) | |
tree | d287bcff8223cb1d5ab9fd323930da3497b586c1 /lib | |
parent | 7bda1456a83b25adde0b2415b997766bfeca6f12 (diff) | |
download | plan9port-787a5a559bfe44f61fb52e90873cfb6096eb9f65.tar.gz plan9port-787a5a559bfe44f61fb52e90873cfb6096eb9f65.tar.bz2 plan9port-787a5a559bfe44f61fb52e90873cfb6096eb9f65.zip |
Make yacc and lex more pedant friendly.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/lex/ncform | 7 | ||||
-rw-r--r-- | lib/yaccpars | 1 |
2 files changed, 8 insertions, 0 deletions
diff --git a/lib/lex/ncform b/lib/lex/ncform index a87030b3..6571735b 100644 --- a/lib/lex/ncform +++ b/lib/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,12 +171,17 @@ while (*p) return(0); } /* the following are only used in the lex library */ +int yyinput(void){ + if(yyin == ((void*)0)) + yyin = stdin; return(input()); } void yyoutput(int c) { + if(yyout == ((void*)0)) + yyout = stdin; output(c); } void diff --git a/lib/yaccpars b/lib/yaccpars index 6e96a206..be83835e 100644 --- a/lib/yaccpars +++ b/lib/yaccpars @@ -184,6 +184,7 @@ yydefault: printf("%s", yystatname(yystate)); printf("saw %s\n", yytokname(yychar)); } + goto yyerrlab; yyerrlab: yynerrs++; |