#else
#define yylex Perl_yylex
#endif
+#define syylex S_syylex
#define yyparse Perl_yyparse
#define yywarn Perl_yywarn
#if defined(MYMALLOC)
#else
#define yylex() Perl_yylex(aTHX)
#endif
+#define syylex() S_syylex(aTHX)
#define yyparse() Perl_yyparse(aTHX)
#define yywarn(a) Perl_yywarn(aTHX_ a)
#if defined(MYMALLOC)
#define Perl_yylex CPerlObj::Perl_yylex
#define yylex Perl_yylex
#endif
+#define S_syylex CPerlObj::S_syylex
+#define syylex S_syylex
#define Perl_yyparse CPerlObj::Perl_yyparse
#define yyparse Perl_yyparse
#define Perl_yywarn CPerlObj::Perl_yywarn
#else
PERL_CALLCONV int Perl_yylex(pTHX);
#endif
+STATIC int S_syylex(pTHX);
PERL_CALLCONV int Perl_yyparse(pTHX);
PERL_CALLCONV int Perl_yywarn(pTHX_ char* s);
#if defined(MYMALLOC)
#endif
#ifdef USE_PURE_BISON
-YYSTYPE* yylval_pointer = NULL;
-int* yychar_pointer = NULL;
+#ifndef YYMAXLEVEL
+#define YYMAXLEVEL 100
+#endif
+YYSTYPE* yylval_pointer[YYMAXLEVEL];
+int* yychar_pointer[YYMAXLEVEL];
+int yyactlevel = 0;
# undef yylval
# undef yychar
-# define yylval (*yylval_pointer)
-# define yychar (*yychar_pointer)
-# define PERL_YYLEX_PARAM yylval_pointer,yychar_pointer
-# undef yylex
-# define yylex() Perl_yylex(aTHX_ yylval_pointer, yychar_pointer)
+# define yylval (*yylval_pointer[yyactlevel])
+# define yychar (*yychar_pointer[yyactlevel])
+# define PERL_YYLEX_PARAM yylval_pointer[yyactlevel],yychar_pointer[yyactlevel]
+# undef yylex
+# define yylex() Perl_yylex(aTHX_ yylval_pointer[yyactlevel],yychar_pointer[yyactlevel])
#endif
#include "keywords.h"
Perl_yylex(pTHX)
#endif
{
+
+ int r;
+
+#ifdef USE_PURE_BISON
+/* increment level and store the argument pointers */
+ yyactlevel++;
+ if (yyactlevel >= YYMAXLEVEL) {
+/* What to do ??? */
+ }
+ yylval_pointer[yyactlevel] = lvalp;
+ yychar_pointer[yyactlevel] = lcharp;
+ /* Save last pointer at the bottom */
+ yylval_pointer[0] = lvalp;
+ yychar_pointer[0] = lcharp;
+#endif
+
+ r = S_syylex(aTHX);
+
+#ifdef USE_PURE_BISON
+ yyactlevel--;
+#endif
+
+ return r;
+}
+
+STATIC int
+S_syylex(pTHX) /* need to be separate from yylex for reentrancy */
+{
dTHR;
register char *s;
register char *d;
GV *gv = Nullgv;
GV **gvp = 0;
-#ifdef USE_PURE_BISON
- yylval_pointer = lvalp;
- yychar_pointer = lcharp;
-#endif
-
/* check if there's an identifier for us to look at */
if (PL_pending_ident) {
/* pit holds the identifier we read and pending_ident is reset */