develooper Front page | perl.perl5.porters | Postings from January 2001

Corrections for Perl_yylex_r (used by a reentrant parser as Bison)

From:
Roca, Ignasi
Date:
January 4, 2001 03:43
Subject:
Corrections for Perl_yylex_r (used by a reentrant parser as Bison)
Message ID:
5930DC161690D2119667009027157547037010FB@madt009a.siemens.es
Here some diff on perl@8269 sources to correct Perl_yylex_r declarations as
well as to correct the stack counter used in Perl_yylex_r function.

==========================================
--- embed.h.orig        Sat Dec 30 18:01:47 2000
+++ embed.h     Thu Jan  4 09:41:38 2001      
@@ -750,8 +750,7 @@
 #define whichsig               Perl_whichsig   
 #define yyerror                        Perl_yyerror
 #ifdef USE_PURE_BISON
-#define yylex_r                        Perl_yylex_r
-#define yylex                  Perl_yylex
+#define yylex                  Perl_yylex_r
 #else
 #define yylex                  Perl_yylex
 #endif
@@ -2219,8 +2218,7 @@
 #define whichsig(a)            Perl_whichsig(aTHX_ a)
 #define yyerror(a)             Perl_yyerror(aTHX_ a)
 #ifdef USE_PURE_BISON
-#define yylex_r(a,b)           Perl_yylex_r(aTHX_ a,b)
-#define yylex(a,b)             Perl_yylex(aTHX_ a,b)
+#define yylex(a,b)             Perl_yylex_r(aTHX_ a,b)
 #else
 #define yylex()                        Perl_yylex(aTHX)
 #endif
@@ -4356,9 +4354,8 @@
 #define yyerror                        Perl_yyerror
 #ifdef USE_PURE_BISON
 #define Perl_yylex_r           CPerlObj::Perl_yylex_r
-#define yylex_r                        Perl_yylex_r
 #define Perl_yylex             CPerlObj::Perl_yylex
-#define yylex                  Perl_yylex
+#define yylex                  Perl_yylex_r
 #else
 #define Perl_yylex             CPerlObj::Perl_yylex
 #define yylex                  Perl_yylex

==========================================
--- proto.h.orig        Sat Dec 30 18:01:46 2000
+++ proto.h     Thu Jan  4 10:25:35 2001
@@ -840,10 +840,8 @@
 PERL_CALLCONV int      Perl_yyerror(pTHX_ char* s);
 #ifdef USE_PURE_BISON
 PERL_CALLCONV int      Perl_yylex_r(pTHX_ YYSTYPE *lvalp, int *lcharp);
-PERL_CALLCONV int      Perl_yylex(pTHX_ YYSTYPE *lvalp, int *lcharp);
-#else
-PERL_CALLCONV int      Perl_yylex(pTHX);
 #endif
+PERL_CALLCONV int      Perl_yylex(pTHX);
 PERL_CALLCONV int      Perl_yyparse(pTHX);
 PERL_CALLCONV int      Perl_yywarn(pTHX_ char* s);
 #if defined(MYMALLOC)

==========================================
--- toke.c.orig Sat Dec 30 17:51:08 2000
+++ toke.c      Thu Jan  4 10:20:43 2001
@@ -79,7 +79,7 @@
 #  endif
 YYSTYPE* yylval_pointer[YYMAXLEVEL];
 int* yychar_pointer[YYMAXLEVEL];
-int yyactlevel = 0;
+int yyactlevel = -1;
 #  undef yylval
 #  undef yychar
 #  define yylval (*yylval_pointer[yyactlevel])
@@ -2068,9 +2068,9 @@
 {
     int r;
      
+    yyactlevel++;
     yylval_pointer[yyactlevel] = lvalp;
     yychar_pointer[yyactlevel] = lcharp;
-    yyactlevel++;
     if (yyactlevel >= YYMAXLEVEL)
        Perl_croak(aTHX_ "panic: YYMAXLEVEL");

@@ -2085,13 +2085,8 @@
 #ifdef __SC__
 #pragma segment Perl_yylex
 #endif
-
 int
-#ifdef USE_PURE_BISON
-Perl_yylex(pTHX_ YYSTYPE *lvalp, int *lcharp)
-#else
 Perl_yylex(pTHX)
-#endif
 {
     register char *s;
     register char *d;



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About