diff options
-rw-r--r-- | perly.act | 4 | ||||
-rw-r--r-- | perly.c | 10 | ||||
-rw-r--r-- | perly.h | 14 | ||||
-rw-r--r-- | perly.tab | 4 | ||||
-rw-r--r-- | perly.y | 2 | ||||
-rw-r--r-- | regen_perly.pl | 27 |
6 files changed, 41 insertions, 20 deletions
@@ -1536,6 +1536,6 @@ case 2: /* Generated from: - * f6b41138394461b75dff7cc97a55c3e6682571cf7e66b977351d30f1534831b2 perly.y - * d1d4df7b8e30ac9dede664af9179e6e5e7ddc7f2ad9c4eff9e2e5b32c9e16a6e regen_perly.pl + * 703ebd267cf8ca45f9dee9bc0f4b21511117a0c1dca1c8bc9438ce91950217ae perly.y + * 258328847738b63dfad498af43ecda9c62aba1c740d5c821d8ac1290391a9489 regen_perly.pl * ex: set ro: */ @@ -48,6 +48,10 @@ typedef signed char yysigned_char; # define YY_NULL 0 #endif +#ifndef YY_NULLPTR +# define YY_NULLPTR NULL +#endif + /* contains all the parser state tables; auto-generated from perly.y */ #include "perly.tab" @@ -169,8 +173,14 @@ yy_reduce_print (pTHX_ int yyrule) YYFPRINTF (Perl_debug_log, "Reducing stack by rule %d (line %u), ", yyrule - 1, yylineno); /* Print the symbols being reduced, and their result. */ +#if PERL_BISON_VERSION >= 30000 /* 3.0+ */ + for (yyi = 0; yyi < yyr2[yyrule]; yyi++) + YYFPRINTF (Perl_debug_log, "%s ", + yytname [yystos[(PL_parser->ps)[yyi + 1 - yyr2[yyrule]].state]]); +#else for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++) YYFPRINTF (Perl_debug_log, "%s ", yytname [yyrhs[yyi]]); +#endif YYFPRINTF (Perl_debug_log, "-> %s\n", yytname [yyr1[yyrule]]); } @@ -4,12 +4,14 @@ Any changes made here will be lost! */ +#define PERL_BISON_VERSION 20007 + #ifdef PERL_CORE -/* A Bison parser, made by GNU Bison 2.7.12-4996. */ +/* A Bison parser, made by GNU Bison 2.7. */ /* Bison interface for Yacc-like parsers in C - Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc. + Copyright (C) 1984, 1989-1990, 2000-2012 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -243,7 +245,7 @@ S_is_opval_token(int type) { #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE { -/* Line 2053 of yacc.c */ +/* Line 2058 of yacc.c */ I32 ival; /* __DEFAULT__ (marker for regen_perly.pl; must always be 1st union member) */ @@ -252,7 +254,7 @@ typedef union YYSTYPE GV *gvval; -/* Line 2053 of yacc.c */ +/* Line 2058 of yacc.c */ } YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ @@ -276,6 +278,6 @@ int yyparse (); /* Generated from: - * f6b41138394461b75dff7cc97a55c3e6682571cf7e66b977351d30f1534831b2 perly.y - * d1d4df7b8e30ac9dede664af9179e6e5e7ddc7f2ad9c4eff9e2e5b32c9e16a6e regen_perly.pl + * 703ebd267cf8ca45f9dee9bc0f4b21511117a0c1dca1c8bc9438ce91950217ae perly.y + * 258328847738b63dfad498af43ecda9c62aba1c740d5c821d8ac1290391a9489 regen_perly.pl * ex: set ro: */ @@ -1176,6 +1176,6 @@ static const toketypes yy_type_tab[] = }; /* Generated from: - * f6b41138394461b75dff7cc97a55c3e6682571cf7e66b977351d30f1534831b2 perly.y - * d1d4df7b8e30ac9dede664af9179e6e5e7ddc7f2ad9c4eff9e2e5b32c9e16a6e regen_perly.pl + * 703ebd267cf8ca45f9dee9bc0f4b21511117a0c1dca1c8bc9438ce91950217ae perly.y + * 258328847738b63dfad498af43ecda9c62aba1c740d5c821d8ac1290391a9489 regen_perly.pl * ex: set ro: */ @@ -31,7 +31,7 @@ /* Make the parser re-entrant. */ -%pure_parser +%pure-parser %start grammar diff --git a/regen_perly.pl b/regen_perly.pl index bf484bbed6..3b94093993 100644 --- a/regen_perly.pl +++ b/regen_perly.pl @@ -75,10 +75,10 @@ EOF # Don't change this to add new bison versions without testing that the generated # files actually work :-) Win32 in particular may not like them. :-( -unless ($version =~ /\b(1\.875[a-z]?|2\.[0134567])\b/) { die <<EOF; } +unless ($version =~ /\b(1\.875[a-z]?|2\.[0134567]|3\.[0])\b/) { die <<EOF; } -You have the wrong version of bison in your path; currently 1.875 -2.0, 2.1, 2.3, 2.4, 2.5, 2.6 or 2.7 is required. Try installing +You have the wrong version of bison in your path; currently versions +1.875, 2.0-2.7 or 3.0 are known toi work. Try installing http://ftp.gnu.org/gnu/bison/bison-2.5.1.tar.gz or similar. Your bison identifies itself as: @@ -119,6 +119,18 @@ unlink $tmpc_file; open my $tmph_fh, '<', $tmph_file or die "Can't open $tmph_file: $!\n"; +# add integer-encoded #def of the bison version + +{ + $version =~ /^(\d+)\.(\d+)/ + or die "Can't handle bison version format: '$version'"; + my ($v1,$v2) = ($1,$2); + die "Unexpectedly large bison version '$v1'" if $v1 > 99; + die "Unexpectedly large bison subversion '$v2'" if $v2 > 9999; + + printf $h_fh "#define PERL_BISON_VERSION %2d%04d\n\n", $v1, $v2; +} + my $endcore_done = 0; # Token macros need to be generated manually from bison 2.4 on my $gather_tokens = $version >= 2.4 ? undef : 0; @@ -180,13 +192,14 @@ sub extract { my $tablines; my $actlines; + my $last_table = $version >= 3 ? 'yyr2' : 'yystos'; $clines =~ m@ (?: ^/* YYFINAL[^\n]+\n #optional comment )? \# \s* define \s* YYFINAL # first #define .*? # other defines + most tables - yystos\[\]\s*= # start of last table + $last_table\[\]\s*= # start of last table .*? }\s*; # end of last table @xms @@ -209,10 +222,6 @@ sub extract { (?: \s* /\* .*? \*/ \s* )* # optional C-comments \s* ( - \#line[^\n]+\.c" - | - \#line[^\n]+\.simple" - | YY_SYMBOL_PRINT ) @xms @@ -311,7 +320,7 @@ sub make_type_tab { { "toketype_" . (defined $tokens{$1} ? $tokens{$1} : $default_token) }ge; - $fields =~ s/, \s* (?:0|YY_NULL) \s* $//x + $fields =~ s/, \s* (?:0|YY_NULL|YY_NULLPTR) \s* $//x or die "make_type_tab: couldn't delete trailing ',0'\n"; return |