From 47da7d8f2fd5c14dc515eecfe4e1c45daee68045 Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Thu, 5 Jan 2012 06:37:36 +1000 Subject: Make the btyacc stuff a little more reentrant to match bison. It's still not reentrant. lol --- LuaSL/src/btyacc-c.ske | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/LuaSL/src/btyacc-c.ske b/LuaSL/src/btyacc-c.ske index ac0fcd5..dc37b17 100644 --- a/LuaSL/src/btyacc-c.ske +++ b/LuaSL/src/btyacc-c.ske @@ -188,7 +188,7 @@ static Yshort *yylexemes = 0; /* Local prototypes. */ int yyparse(void *YYPARSE_PARAM); -static int yyLex1(yyscan_t scanner); +static int yyLex1(YYSTYPE *yylval, yyscan_t scanner); static int yyExpand(); static void yySCopy(YYSTYPE *to, YYSTYPE *from, int size); static void yyPCopy(YYPOSN *to, YYPOSN *from, int size); @@ -264,7 +264,7 @@ int yyparse(void *YYPARSE_PARAM) { /* Read one token */ if (yychar < 0) { - yychar = yyLex1(YYLEX_PARAM); + yychar = yyLex1(&yylval, YYLEX_PARAM); if (yychar < 0) yychar = 0; # if YYDEBUG if (yydebug) { @@ -658,7 +658,7 @@ yyreduce: *++(yyps->psp) = yyps->pos; yyretposn = yyps->pos; /* return value of root position to yyposn */ if (yychar < 0) { - if ((yychar = yyLex1(YYLEX_PARAM)) < 0) { + if ((yychar = yyLex1(&yylval, YYLEX_PARAM)) < 0) { yychar = 0; } # if YYDEBUG @@ -781,24 +781,24 @@ yyaccept: /* Call yylex() unless the token has already been read. */ -static int yyLex1(yyscan_t scanner) { +static int yyLex1(YYSTYPE *yylval, yyscan_t scanner) { if(yylvp < yylve) { /* we're currently re-reading tokens */ - yylval = *yylvp++; + *yylval = *yylvp++; yyposn = *yylpp++; return *yylexp++; } else if(yyps->save) { /* in trial mode; save scanner results for future parse attempts */ if(yylvp == yylvlim) yyExpand(); - *yylexp = yylex(&yylval, scanner); - *yylvp++ = yylval; + *yylexp = yylex(yylval, scanner); + *yylvp++ = *yylval; yylve++; *yylpp++ = yyposn; yylpe++; return *yylexp++; } else { /* normal operation, no conflict encountered */ - return yylex(&yylval, scanner); + return yylex(yylval, scanner); } } -- cgit v1.1