summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore21
-rw-r--r--Changes8
-rw-r--r--MANIFEST3
-rw-r--r--META.json45
-rw-r--r--META.yml45
-rw-r--r--Makefile.PL49
-rw-r--r--README14
-rw-r--r--debian/changelog11
-rw-r--r--debian/control1
-rw-r--r--debian/copyright4
-rw-r--r--debian/patches/auto-gitignore35
-rw-r--r--debian/patches/optint.patch8
-rw-r--r--debian/patches/series1
-rwxr-xr-xdebian/rules3
-rw-r--r--expr.c1799
-rw-r--r--expr.y6
-rw-r--r--exprpstr.inc60
-rw-r--r--lib/HTML/Template/Pro.pm2
-rw-r--r--perl-HTML-Template-Pro.spec42
-rw-r--r--procore.c9
-rw-r--r--prostate.inc2
-rw-r--r--pstrutils.inc8
-rw-r--r--templates-Pro/test_esc2.out2
-rw-r--r--templates-Pro/test_var3.out2
24 files changed, 1099 insertions, 1081 deletions
diff --git a/.gitignore b/.gitignore
deleted file mode 100644
index 18c5404..0000000
--- a/.gitignore
+++ /dev/null
@@ -1,21 +0,0 @@
-# git-ls-files --others --exclude-from=.git/info/exclude
-# Lines that start with '#' are comments.
-# For a project mostly in C, the following would be a good set of
-# exclude patterns (uncomment them if you want to use them):
-# *.[oa]
-# *~
-*.o
-*~
-Makefile
-Pro.bs
-Pro.c
-blib
-pm_to_blib
-Makefile.old
-semantic.cache
-templates-Pro/json
-templates-Pro/json-cs
-getoptint.re2c.inc
-resetopt0.inc
-resetoptnot0.inc
-setoptint.re2c.inc
diff --git a/Changes b/Changes
index 50ce08d..3535b41 100644
--- a/Changes
+++ b/Changes
@@ -324,3 +324,11 @@ Revision history for Perl extension HTML::Template::Pro.
0.9510 Mon May 13 11:30:15 EEST 2013
- rt.cpan.org #85211 - pod fix
+ - misc bugfixes
+
+0.9520 Mon Nov 29 22:01:58 EET 2021
+ - added pcre2 support (old pcre support stil exists)
+ - closed rt.cpan.org #140119 - pcre2 support
+
+0.9521 Thu Dec 2 09:09:51 EET 2021
+ - closed rt.cpan.org #109255 - urlencode shouldn't encode '\'.
diff --git a/MANIFEST b/MANIFEST
index 8294930..d0fa8a4 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -223,4 +223,5 @@ tmpllog.c
tmpllog.h
tmplpro.h
tmplpro_version.c
-META.yml Module meta-data (added by MakeMaker)
+META.yml Module YAML meta-data (added by MakeMaker)
+META.json Module JSON meta-data (added by MakeMaker)
diff --git a/META.json b/META.json
new file mode 100644
index 0000000..637d3f8
--- /dev/null
+++ b/META.json
@@ -0,0 +1,45 @@
+{
+ "abstract" : "Perl/XS module to use HTML Templates from CGI scripts",
+ "author" : [
+ "I. Yu. Vlasenko <viy@altlinux.org>"
+ ],
+ "dynamic_config" : 1,
+ "generated_by" : "ExtUtils::MakeMaker version 7.34, CPAN::Meta::Converter version 2.150010",
+ "license" : [
+ "perl_5"
+ ],
+ "meta-spec" : {
+ "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec",
+ "version" : 2
+ },
+ "name" : "HTML-Template-Pro",
+ "no_index" : {
+ "directory" : [
+ "t",
+ "inc"
+ ]
+ },
+ "prereqs" : {
+ "build" : {
+ "requires" : {
+ "ExtUtils::MakeMaker" : "0"
+ }
+ },
+ "configure" : {
+ "requires" : {
+ "ExtUtils::MakeMaker" : "0"
+ }
+ },
+ "runtime" : {
+ "requires" : {
+ "File::Path" : "2",
+ "File::Spec" : "0",
+ "JSON" : "2",
+ "Test::More" : "0"
+ }
+ }
+ },
+ "release_status" : "stable",
+ "version" : "0.9521",
+ "x_serialization_backend" : "JSON::PP version 4.02"
+}
diff --git a/META.yml b/META.yml
index 832b620..88b16f2 100644
--- a/META.yml
+++ b/META.yml
@@ -1,25 +1,26 @@
---- #YAML:1.0
-name: HTML-Template-Pro
-version: 0.9510
-abstract: Perl/XS module to use HTML Templates from CGI scripts
+---
+abstract: 'Perl/XS module to use HTML Templates from CGI scripts'
author:
- - I. Yu. Vlasenko <viy@altlinux.org>
-license: perl
-distribution_type: module
-configure_requires:
- ExtUtils::MakeMaker: 0
+ - 'I. Yu. Vlasenko <viy@altlinux.org>'
build_requires:
- ExtUtils::MakeMaker: 0
-requires:
- File::Path: 2
- File::Spec: 0
- JSON: 2
- Test::More: 0
-no_index:
- directory:
- - t
- - inc
-generated_by: ExtUtils::MakeMaker version 6.56
+ ExtUtils::MakeMaker: '0'
+configure_requires:
+ ExtUtils::MakeMaker: '0'
+dynamic_config: 1
+generated_by: 'ExtUtils::MakeMaker version 7.34, CPAN::Meta::Converter version 2.150010'
+license: perl
meta-spec:
- url: http://module-build.sourceforge.net/META-spec-v1.4.html
- version: 1.4
+ url: http://module-build.sourceforge.net/META-spec-v1.4.html
+ version: '1.4'
+name: HTML-Template-Pro
+no_index:
+ directory:
+ - t
+ - inc
+requires:
+ File::Path: '2'
+ File::Spec: '0'
+ JSON: '2'
+ Test::More: '0'
+version: '0.9521'
+x_serialization_backend: 'CPAN::Meta::YAML version 0.018'
diff --git a/Makefile.PL b/Makefile.PL
index f110494..d6d991e 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -28,7 +28,8 @@ if (grep {/^DYNAMIC=1/} @ARGV) {
my %DEF=(
MAINTAINER => $^O eq 'linux' && -d '.git' ? 1 : 0,
- PCRE => 1,
+ PCRE => 0,
+ PCRE2 => 1,
DEBUG => 0,
MMAP => 1,
IMITATE=>0,
@@ -200,6 +201,27 @@ sub has_header {
return 0;
}
+sub has_pcre2 {
+ print "looking for pcre2...\n";
+ if (try_compile_and_link('
+#define PCRE2_CODE_UNIT_WIDTH 8
+#include <pcre2.h>
+ static int foo()
+ {
+ return 0;
+ }
+ int main (int argc, char** argv)
+ {
+ foo();
+ }
+',undef, '-I/usr/include/pcre2 -lpcre2-8')){
+ print "pcre2 found.\n";
+ return 1;
+ }
+ print "pcre2 not found.\n";
+ return 0;
+}
+
sub has_pcre {
print "looking for pcre...\n";
if (try_compile_and_link('
@@ -298,7 +320,8 @@ sub try_as_int64 {
}
sub configure {
- $DEF{PCRE}=has_pcre();
+ $DEF{PCRE2}=has_pcre2();
+ $DEF{PCRE}=has_pcre() unless $DEF{PCRE2};
if ($^O eq 'os2' or $^O eq 'dos') {
$DEF{MMAP}=0;
} elsif ($^O eq 'MSWin32') {
@@ -316,7 +339,7 @@ sub configure {
my $i;
for ($i=0; $i<@ARGV; $i++) {
- if ($ARGV[$i]=~/^(PCRE|PEDANTIC|DEBUG|MMAP|IMITATE)=(.+)/) {
+ if ($ARGV[$i]=~/^(PCRE2?|PEDANTIC|DEBUG|MMAP|IMITATE)=(.+)/) {
$DEF{$1}=$2;
} else {
next;
@@ -333,7 +356,7 @@ sub configure {
$DEFINE.=' -DHAVE_INTTYPES_H ' if has_header('inttypes.h');
$DEFINE.=' -DHAVE_STRDUP' if has_func('strdup("str")');
$DEFINE.=' -DHAVE__STRDUP' if has_func('_strdup("str")');
-
+
$DEFINE.=' -DHAVE_SYS_MMAN_H -DHAVE_SYS_STAT_H' if ($DEF{HAS_MMAP});
$DEFINE.=' -DCOMPAT_ON_BROKEN_QUOTE -DCOMPAT_ALLOW_NAME_IN_CLOSING_TAG' if ($DEF{'IMITATE'});
$DEFINE.=' -pedantic -DPEDANTIC' if ($DEF{'PEDANTIC'});
@@ -346,7 +369,19 @@ sub configure {
}
}
- if ($DEF{PCRE}) {
+ if ($DEF{PCRE2}) {
+ $INC.=' -I/usr/include/pcre2';
+ $DEFINE.=' -DHAVE_PCRE2';
+ $LIBS.=' -lpcre2-8';
+ print "
+=====================================================================
+build with libpcre2 (Stanislav Yadykin's regexp extension) is enabled.
+=====================================================================
+if you have not installed libpcre2, you still can build the module
+without libpcre2 using
+perl Makefile.PL PCRE2=0
+";
+ } elsif ($DEF{PCRE}) {
$INC.=' -I/usr/include/pcre';
$DEFINE.=' -DHAVE_PCRE';
$LIBS.=' -lpcre';
@@ -354,8 +389,8 @@ sub configure {
=====================================================================
build with libpcre (Stanislav Yadykin's regexp extension) is enabled.
=====================================================================
-if you have not installed libpcre, you still can build the module
-without libpcre (with this extension disabled) using
+if you have not installed libpcre, you still can build the module
+without libpcre (with this extension disabled) using
perl Makefile.PL PCRE=0
";
} else {
diff --git a/README b/README
index 3ab367d..39a745f 100644
--- a/README
+++ b/README
@@ -1,4 +1,4 @@
-HTML-Template-Pro version 0.9509
+HTML-Template-Pro version 0.9521
==============================
DESCRIPTION
@@ -50,7 +50,10 @@ To install this module type the following:
make test
make install
-If you have libpcre installed try
+If you have libpcre2 installed try
+ perl Makefile.PL PCRE2=1
+
+If you have old libpcre installed try instead
perl Makefile.PL PCRE=1
other optional parameters include DEBUG (build with extra debug level)
@@ -58,7 +61,7 @@ and IMITATE (imitate behavior of HTML::Template in all circumstances,
even on broken templates, for a little cost of perfomance).
So a fully fledged build is
- perl Makefile.PL PCRE=1 DEBUG=1 IMITATE=1
+ perl Makefile.PL PCRE2=1 DEBUG=1 IMITATE=1
DEPENDENCIES
@@ -68,7 +71,8 @@ modules:
File::Spec
libraries:
- libpcre (optional)
+ libpcre2 (optional)
+ libpcre (fallback,optional)
TODO
@@ -91,7 +95,7 @@ Original HTML::Template and other related modules are located at:
COPYRIGHT AND LICENCE
-Copyright (C) 2005-2009 by I. Yu. Vlasenko.
+Copyright (C) 2005-2021 by I. Yu. Vlasenko.
Pieces of code in Pro.pm and documentation of HTML::Template are
copyright (C) 2000-2009 Sam Tregar (sam@tregar.com)
Other contributors to the code base are listed in Changes.
diff --git a/debian/changelog b/debian/changelog
index fcde3b1..e8db767 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,14 @@
+libhtml-template-pro-perl (0.9521-1) unstable; urgency=medium
+
+ * Import upstream version 0.9521.
+ - added pcre2 support (cf. #1000095)
+ * Add build dependency on libpcre2-dev, and don't disable PCRE support in
+ debian/rules any longer.
+ * Update years of upstream andthird-party copyright.
+ * Refresh optint.patch (offset).
+
+ -- gregor herrmann <gregoa@debian.org> Thu, 02 Dec 2021 17:45:04 +0100
+
libhtml-template-pro-perl (0.9510-3) unstable; urgency=medium
* Build without PCRE support.
diff --git a/debian/control b/debian/control
index 6c2025a..f7894ba 100644
--- a/debian/control
+++ b/debian/control
@@ -8,6 +8,7 @@ Testsuite: autopkgtest-pkg-perl
Priority: optional
Build-Depends: debhelper-compat (= 13),
libjson-perl <!nocheck>,
+ libpcre2-dev,
libtest-pod-perl <!nocheck>,
perl-xs-dev,
perl:native
diff --git a/debian/copyright b/debian/copyright
index ccf1fe7..432d864 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -5,12 +5,12 @@ Upstream-Name: HTML-Template-Pro
Files: *
Copyright:
- 2005-2009, Igor Yu. Vlasenko <viy@altlinux.org>
+ 2005-2021, Igor Yu. Vlasenko <viy@altlinux.org>
2000-2009, Sam Tregar <sam@tregar.com>
License: Artistic or GPL-2+
Files: expr.c
-Copyright: 1984, 1989-1990, 2000-2006, Free Software Foundation, Inc.
+Copyright: 1984-2018, Free Software Foundation, Inc.
License: GPL-3+ with Bison exception
Files: ppport.h
diff --git a/debian/patches/auto-gitignore b/debian/patches/auto-gitignore
new file mode 100644
index 0000000..c0f72f7
--- /dev/null
+++ b/debian/patches/auto-gitignore
@@ -0,0 +1,35 @@
+Subject: Update .gitignore from Debian packaging branch
+
+The Debian packaging git branch contains these updates to the upstream
+.gitignore file(s). This patch is autogenerated, to provide these
+updates to users of the official Debian archive view of the package.
+
+[dgit (9.14) update-gitignore]
+---
+diff --git a/.gitignore b/.gitignore
+deleted file mode 100644
+index 18c5404..0000000
+--- a/.gitignore
++++ /dev/null
+@@ -1,21 +0,0 @@
+-# git-ls-files --others --exclude-from=.git/info/exclude
+-# Lines that start with '#' are comments.
+-# For a project mostly in C, the following would be a good set of
+-# exclude patterns (uncomment them if you want to use them):
+-# *.[oa]
+-# *~
+-*.o
+-*~
+-Makefile
+-Pro.bs
+-Pro.c
+-blib
+-pm_to_blib
+-Makefile.old
+-semantic.cache
+-templates-Pro/json
+-templates-Pro/json-cs
+-getoptint.re2c.inc
+-resetopt0.inc
+-resetoptnot0.inc
+-setoptint.re2c.inc
diff --git a/debian/patches/optint.patch b/debian/patches/optint.patch
index 3aad78a..9bcc330 100644
--- a/debian/patches/optint.patch
+++ b/debian/patches/optint.patch
@@ -1,12 +1,14 @@
-Author: Nicholas Bamber <nicholas@periapt.co.uk>
Subject: Makefile was trying to rebuild optint.c
Don't understand why this is necessary,
but it builds cleanly straqight off CPAN.
-Last-Update: 2012-03-04
Forwarded: not-needed
+Author: Nicholas Bamber <nicholas@periapt.co.uk>
+Reviewed-by: gregor herrmann <gregoa@debian.org>
+Last-Update: 2021-12-02
+
--- a/Makefile.PL
+++ b/Makefile.PL
-@@ -91,7 +91,10 @@
+@@ -95,7 +95,10 @@
return <<'MAKE_FRAG';
expr.c: calc.inc exprtool.inc exprpstr.inc
procore\$(OBJ_EXT): loadfile.inc tagstack.inc
diff --git a/debian/patches/series b/debian/patches/series
index 0186cc3..5e171b7 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
optint.patch
+auto-gitignore
diff --git a/debian/rules b/debian/rules
index 4b054ca..6c1f6c4 100755
--- a/debian/rules
+++ b/debian/rules
@@ -7,9 +7,6 @@ export DEB_BUILD_MAINT_OPTIONS = hardening=+all
%:
dh $@
-override_dh_auto_configure:
- dh_auto_configure -- PCRE=0
-
override_dh_auto_build:
dh_auto_build
iconv -f CP1251 -t UTF-8 README.ru >debian/README.ru
diff --git a/expr.c b/expr.c
index 0acd593..d3a8cdc 100644
--- a/expr.c
+++ b/expr.c
@@ -1,21 +1,19 @@
+/* A Bison parser, made by GNU Bison 3.0.5. */
-/* A Bison parser, made by GNU Bison 2.4.1. */
+/* Bison implementation for Yacc-like parsers in C
+
+ Copyright (C) 1984, 1989-1990, 2000-2015, 2018 Free Software Foundation, Inc.
-/* Skeleton implementation for Bison's Yacc-like parsers in C
-
- Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
- 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
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
-
+
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
-
+
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
@@ -28,7 +26,7 @@
special exception, which will cause the skeleton and the resulting
Bison output files to be licensed under the GNU General Public
License without this special exception.
-
+
This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */
@@ -46,7 +44,7 @@
#define YYBISON 1
/* Bison version. */
-#define YYBISON_VERSION "2.4.1"
+#define YYBISON_VERSION "3.0.5"
/* Skeleton name. */
#define YYSKELETON_NAME "yacc.c"
@@ -60,15 +58,11 @@
/* Pull parsers. */
#define YYPULL 1
-/* Using locations. */
-#define YYLSP_NEEDED 0
/* Copy the first part of user declarations. */
-
-/* Line 189 of yacc.c */
-#line 7 "expr.y"
+#line 7 "expr.y" /* yacc.c:339 */
#include <math.h> /* For math functions, cos(), sin(), etc. */
#include <stdio.h> /* for printf */
@@ -90,13 +84,15 @@ Debug Assertion Failed! f:\dd\vctools\crt_bld\self_x86\crt\src \isctype.c Expres
*/
-/* Line 189 of yacc.c */
-#line 95 "y.tab.c"
+#line 88 "y.tab.c" /* yacc.c:339 */
-/* Enabling traces. */
-#ifndef YYDEBUG
-# define YYDEBUG 0
-#endif
+# ifndef YY_NULLPTR
+# if defined __cplusplus && 201103L <= __cplusplus
+# define YY_NULLPTR nullptr
+# else
+# define YY_NULLPTR 0
+# endif
+# endif
/* Enabling verbose error messages. */
#ifdef YYERROR_VERBOSE
@@ -106,45 +102,47 @@ Debug Assertion Failed! f:\dd\vctools\crt_bld\self_x86\crt\src \isctype.c Expres
# define YYERROR_VERBOSE 0
#endif
-/* Enabling the token table. */
-#ifndef YYTOKEN_TABLE
-# define YYTOKEN_TABLE 0
-#endif
+/* Debug traces. */
+#ifndef YYDEBUG
+# define YYDEBUG 0
+#endif
+#if YYDEBUG
+extern int yydebug;
+#endif
-/* Tokens. */
+/* Token type. */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
- /* Put the tokens into the symbol table, so that GDB and other debuggers
- know about them. */
- enum yytokentype {
- NUM = 258,
- EXTFUNC = 259,
- BUILTIN_VAR = 260,
- BUILTIN_FNC_DD = 261,
- BUILTIN_FNC_DDD = 262,
- BUILTIN_FNC_EE = 263,
- VAR = 264,
- OR = 265,
- AND = 266,
- strCMP = 267,
- strNE = 268,
- strEQ = 269,
- strLE = 270,
- strLT = 271,
- strGE = 272,
- strGT = 273,
- numNE = 274,
- numEQ = 275,
- numLE = 276,
- numLT = 277,
- numGE = 278,
- numGT = 279,
- reNOTLIKE = 280,
- reLIKE = 281,
- NEG = 282,
- NOT = 283
- };
+ enum yytokentype
+ {
+ NUM = 258,
+ EXTFUNC = 259,
+ BUILTIN_VAR = 260,
+ BUILTIN_FNC_DD = 261,
+ BUILTIN_FNC_DDD = 262,
+ BUILTIN_FNC_EE = 263,
+ VAR = 264,
+ OR = 265,
+ AND = 266,
+ strGT = 267,
+ strGE = 268,
+ strLT = 269,
+ strLE = 270,
+ strEQ = 271,
+ strNE = 272,
+ strCMP = 273,
+ numGT = 274,
+ numGE = 275,
+ numLT = 276,
+ numLE = 277,
+ numEQ = 278,
+ numNE = 279,
+ reLIKE = 280,
+ reNOTLIKE = 281,
+ NOT = 282,
+ NEG = 283
+ };
#endif
/* Tokens. */
#define NUM 258
@@ -156,62 +154,58 @@ Debug Assertion Failed! f:\dd\vctools\crt_bld\self_x86\crt\src \isctype.c Expres
#define VAR 264
#define OR 265
#define AND 266
-#define strCMP 267
-#define strNE 268
-#define strEQ 269
+#define strGT 267
+#define strGE 268
+#define strLT 269
#define strLE 270
-#define strLT 271
-#define strGE 272
-#define strGT 273
-#define numNE 274
-#define numEQ 275
-#define numLE 276
-#define numLT 277
-#define numGE 278
-#define numGT 279
-#define reNOTLIKE 280
-#define reLIKE 281
-#define NEG 282
-#define NOT 283
-
-
-
-
+#define strEQ 271
+#define strNE 272
+#define strCMP 273
+#define numGT 274
+#define numGE 275
+#define numLT 276
+#define numLE 277
+#define numEQ 278
+#define numNE 279
+#define reLIKE 280
+#define reNOTLIKE 281
+#define NOT 282
+#define NEG 283
+
+/* Value type. */
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
-typedef union YYSTYPE
-{
-/* Line 214 of yacc.c */
-#line 27 "expr.y"
+union YYSTYPE
+{
+#line 27 "expr.y" /* yacc.c:355 */
struct exprval numval; /* For returning numbers. */
const symrec_const *tptr; /* For returning symbol-table pointers. */
struct user_func_call extfunc; /* for user-defined function name */
PSTRING uservar;
+#line 188 "y.tab.c" /* yacc.c:355 */
+};
-
-/* Line 214 of yacc.c */
-#line 196 "y.tab.c"
-} YYSTYPE;
+typedef union YYSTYPE YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
-# define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1
#endif
-/* Copy the second part of user declarations. */
-/* Line 264 of yacc.c */
-#line 33 "expr.y"
+int yyparse (struct tmplpro_state* state, struct expr_parser* exprobj, PSTRING* expr_retval_ptr);
+
+
+
+/* Copy the second part of user declarations. */
+#line 33 "expr.y" /* yacc.c:358 */
/* the second section is required as we use YYSTYPE here */
static void yyerror (struct tmplpro_state* state, struct expr_parser* exprobj, PSTRING* expr_retval_ptr, char const *);
static int yylex (YYSTYPE *lvalp, struct tmplpro_state* state, struct expr_parser* exprobj);
-
-/* Line 264 of yacc.c */
-#line 215 "y.tab.c"
+#line 209 "y.tab.c" /* yacc.c:358 */
#ifdef short
# undef short
@@ -225,11 +219,8 @@ typedef unsigned char yytype_uint8;
#ifdef YYTYPE_INT8
typedef YYTYPE_INT8 yytype_int8;
-#elif (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
-typedef signed char yytype_int8;
#else
-typedef short int yytype_int8;
+typedef signed char yytype_int8;
#endif
#ifdef YYTYPE_UINT16
@@ -249,8 +240,7 @@ typedef short int yytype_int16;
# define YYSIZE_T __SIZE_TYPE__
# elif defined size_t
# define YYSIZE_T size_t
-# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
+# elif ! defined YYSIZE_T
# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
# define YYSIZE_T size_t
# else
@@ -261,41 +251,70 @@ typedef short int yytype_int16;
#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
#ifndef YY_
-# if YYENABLE_NLS
+# if defined YYENABLE_NLS && YYENABLE_NLS
# if ENABLE_NLS
# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
-# define YY_(msgid) dgettext ("bison-runtime", msgid)
+# define YY_(Msgid) dgettext ("bison-runtime", Msgid)
# endif
# endif
# ifndef YY_
-# define YY_(msgid) msgid
+# define YY_(Msgid) Msgid
+# endif
+#endif
+
+#ifndef YY_ATTRIBUTE
+# if (defined __GNUC__ \
+ && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \
+ || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
+# define YY_ATTRIBUTE(Spec) __attribute__(Spec)
+# else
+# define YY_ATTRIBUTE(Spec) /* empty */
+# endif
+#endif
+
+#ifndef YY_ATTRIBUTE_PURE
+# define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__))
+#endif
+
+#ifndef YY_ATTRIBUTE_UNUSED
+# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
+#endif
+
+#if !defined _Noreturn \
+ && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
+# if defined _MSC_VER && 1200 <= _MSC_VER
+# define _Noreturn __declspec (noreturn)
+# else
+# define _Noreturn YY_ATTRIBUTE ((__noreturn__))
# endif
#endif
/* Suppress unused-variable warnings by "using" E. */
#if ! defined lint || defined __GNUC__
-# define YYUSE(e) ((void) (e))
+# define YYUSE(E) ((void) (E))
#else
-# define YYUSE(e) /* empty */
+# define YYUSE(E) /* empty */
#endif
-/* Identity function, used to suppress warnings about constant conditions. */
-#ifndef lint
-# define YYID(n) (n)
+#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
+/* Suppress an incorrect diagnostic about yylval being uninitialized. */
+# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
+ _Pragma ("GCC diagnostic push") \
+ _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
+ _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
+# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
+ _Pragma ("GCC diagnostic pop")
#else
-#if (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
-static int
-YYID (int yyi)
-#else
-static int
-YYID (yyi)
- int yyi;
+# define YY_INITIAL_VALUE(Value) Value
#endif
-{
- return yyi;
-}
+#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
+# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
+# define YY_IGNORE_MAYBE_UNINITIALIZED_END
#endif
+#ifndef YY_INITIAL_VALUE
+# define YY_INITIAL_VALUE(Value) /* Nothing. */
+#endif
+
#if ! defined yyoverflow || YYERROR_VERBOSE
@@ -314,11 +333,11 @@ YYID (yyi)
# define alloca _alloca
# else
# define YYSTACK_ALLOC alloca
-# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
+# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
-# ifndef _STDLIB_H
-# define _STDLIB_H 1
+ /* Use EXIT_SUCCESS as a witness for stdlib.h. */
+# ifndef EXIT_SUCCESS
+# define EXIT_SUCCESS 0
# endif
# endif
# endif
@@ -326,8 +345,8 @@ YYID (yyi)
# endif
# ifdef YYSTACK_ALLOC
- /* Pacify GCC's `empty if-body' warning. */
-# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
+ /* Pacify GCC's 'empty if-body' warning. */
+# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
# ifndef YYSTACK_ALLOC_MAXIMUM
/* The OS might guarantee only one guard page at the bottom of the stack,
and a page size can be as small as 4096 bytes. So we cannot safely
@@ -341,25 +360,23 @@ YYID (yyi)
# ifndef YYSTACK_ALLOC_MAXIMUM
# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
# endif
-# if (defined __cplusplus && ! defined _STDLIB_H \
+# if (defined __cplusplus && ! defined EXIT_SUCCESS \
&& ! ((defined YYMALLOC || defined malloc) \
- && (defined YYFREE || defined free)))
+ && (defined YYFREE || defined free)))
# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
-# ifndef _STDLIB_H
-# define _STDLIB_H 1
+# ifndef EXIT_SUCCESS
+# define EXIT_SUCCESS 0
# endif
# endif
# ifndef YYMALLOC
# define YYMALLOC malloc
-# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
+# if ! defined malloc && ! defined EXIT_SUCCESS
void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
# endif
# endif
# ifndef YYFREE
# define YYFREE free
-# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
+# if ! defined free && ! defined EXIT_SUCCESS
void free (void *); /* INFRINGES ON USER NAME SPACE */
# endif
# endif
@@ -369,7 +386,7 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */
#if (! defined yyoverflow \
&& (! defined __cplusplus \
- || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
+ || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
/* A type that is properly aligned for any stack member. */
union yyalloc
@@ -387,46 +404,50 @@ union yyalloc
((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
+ YYSTACK_GAP_MAXIMUM)
-/* Copy COUNT objects from FROM to TO. The source and destination do
- not overlap. */
-# ifndef YYCOPY
-# if defined __GNUC__ && 1 < __GNUC__
-# define YYCOPY(To, From, Count) \
- __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
-# else
-# define YYCOPY(To, From, Count) \
- do \
- { \
- YYSIZE_T yyi; \
- for (yyi = 0; yyi < (Count); yyi++) \
- (To)[yyi] = (From)[yyi]; \
- } \
- while (YYID (0))
-# endif
-# endif
+# define YYCOPY_NEEDED 1
/* Relocate STACK from its old location to the new one. The
local variables YYSIZE and YYSTACKSIZE give the old and new number of
elements in the stack, and YYPTR gives the new location of the
stack. Advance YYPTR to a properly aligned location for the next
stack. */
-# define YYSTACK_RELOCATE(Stack_alloc, Stack) \
- do \
- { \
- YYSIZE_T yynewbytes; \
- YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
- Stack = &yyptr->Stack_alloc; \
- yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
- yyptr += yynewbytes / sizeof (*yyptr); \
- } \
- while (YYID (0))
+# define YYSTACK_RELOCATE(Stack_alloc, Stack) \
+ do \
+ { \
+ YYSIZE_T yynewbytes; \
+ YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
+ Stack = &yyptr->Stack_alloc; \
+ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
+ yyptr += yynewbytes / sizeof (*yyptr); \
+ } \
+ while (0)
#endif
+#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
+/* Copy COUNT objects from SRC to DST. The source and destination do
+ not overlap. */
+# ifndef YYCOPY
+# if defined __GNUC__ && 1 < __GNUC__
+# define YYCOPY(Dst, Src, Count) \
+ __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
+# else
+# define YYCOPY(Dst, Src, Count) \
+ do \
+ { \
+ YYSIZE_T yyi; \
+ for (yyi = 0; yyi < (Count); yyi++) \
+ (Dst)[yyi] = (Src)[yyi]; \
+ } \
+ while (0)
+# endif
+# endif
+#endif /* !YYCOPY_NEEDED */
+
/* YYFINAL -- State number of the termination state. */
#define YYFINAL 23
/* YYLAST -- Last index in YYTABLE. */
-#define YYLAST 377
+#define YYLAST 374
/* YYNTOKENS -- Number of terminals. */
#define YYNTOKENS 41
@@ -434,17 +455,19 @@ union yyalloc
#define YYNNTS 4
/* YYNRULES -- Number of rules. */
#define YYNRULES 40
-/* YYNRULES -- Number of states. */
+/* YYNSTATES -- Number of states. */
#define YYNSTATES 85
-/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
+/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
+ by yylex, with out-of-bounds checking. */
#define YYUNDEFTOK 2
#define YYMAXUTOK 283
-#define YYTRANSLATE(YYX) \
+#define YYTRANSLATE(YYX) \
((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
-/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
+/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
+ as returned by yylex, without out-of-bounds checking. */
static const yytype_uint8 yytranslate[] =
{
0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
@@ -453,7 +476,7 @@ static const yytype_uint8 yytranslate[] =
2, 2, 2, 34, 2, 2, 2, 33, 2, 2,
39, 38, 31, 30, 40, 29, 2, 32, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 19, 2, 20, 2, 2, 2, 2, 2, 2, 2,
+ 25, 2, 26, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 37, 2, 2, 2, 2, 2,
@@ -474,44 +497,12 @@ static const yytype_uint8 yytranslate[] =
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
- 15, 16, 17, 18, 21, 22, 23, 24, 25, 26,
+ 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
27, 28, 35, 36
};
#if YYDEBUG
-/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
- YYRHS. */
-static const yytype_uint8 yyprhs[] =
-{
- 0, 0, 3, 5, 7, 9, 11, 14, 18, 22,
- 27, 34, 39, 43, 47, 51, 55, 59, 62, 66,
- 70, 74, 78, 82, 86, 90, 94, 98, 101, 104,
- 108, 112, 116, 120, 124, 128, 132, 136, 140, 144,
- 148
-};
-
-/* YYRHS -- A `-1'-separated list of the rules' RHS. */
-static const yytype_int8 yyrhs[] =
-{
- 42, 0, -1, 43, -1, 3, -1, 5, -1, 9,
- -1, 44, 38, -1, 4, 39, 38, -1, 8, 39,
- 38, -1, 6, 39, 43, 38, -1, 7, 39, 43,
- 40, 43, 38, -1, 8, 39, 43, 38, -1, 43,
- 30, 43, -1, 43, 29, 43, -1, 43, 31, 43,
- -1, 43, 33, 43, -1, 43, 32, 43, -1, 29,
- 43, -1, 43, 37, 43, -1, 43, 10, 43, -1,
- 43, 11, 43, -1, 43, 25, 43, -1, 43, 23,
- 43, -1, 43, 21, 43, -1, 43, 22, 43, -1,
- 43, 20, 43, -1, 43, 19, 43, -1, 34, 43,
- -1, 36, 43, -1, 39, 43, 38, -1, 43, 12,
- 43, -1, 43, 17, 43, -1, 43, 15, 43, -1,
- 43, 13, 43, -1, 43, 14, 43, -1, 43, 18,
- 43, -1, 43, 16, 43, -1, 43, 28, 43, -1,
- 43, 27, 43, -1, 4, 39, 43, -1, 44, 40,
- 43, -1
-};
-
-/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
+ /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
static const yytype_uint8 yyrline[] =
{
0, 61, 61, 69, 70, 72, 81, 85, 90, 97,
@@ -522,57 +513,62 @@ static const yytype_uint8 yyrline[] =
};
#endif
-#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
+#if YYDEBUG || YYERROR_VERBOSE || 0
/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
First, the terminals, then, starting at YYNTOKENS, nonterminals. */
static const char *const yytname[] =
{
"$end", "error", "$undefined", "NUM", "EXTFUNC", "BUILTIN_VAR",
"BUILTIN_FNC_DD", "BUILTIN_FNC_DDD", "BUILTIN_FNC_EE", "VAR", "OR",
- "AND", "strCMP", "strNE", "strEQ", "strLE", "strLT", "strGE", "strGT",
- "'<'", "'>'", "numNE", "numEQ", "numLE", "numLT", "numGE", "numGT",
- "reNOTLIKE", "reLIKE", "'-'", "'+'", "'*'", "'/'", "'%'", "'!'", "NEG",
- "NOT", "'^'", "')'", "'('", "','", "$accept", "line", "numEXP",
- "arglist", 0
+ "AND", "strGT", "strGE", "strLT", "strLE", "strEQ", "strNE", "strCMP",
+ "numGT", "numGE", "numLT", "numLE", "numEQ", "numNE", "'<'", "'>'",
+ "reLIKE", "reNOTLIKE", "'-'", "'+'", "'*'", "'/'", "'%'", "'!'", "NOT",
+ "NEG", "'^'", "')'", "'('", "','", "$accept", "line", "numEXP",
+ "arglist", YY_NULLPTR
};
#endif
# ifdef YYPRINT
-/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
- token YYLEX-NUM. */
+/* YYTOKNUM[NUM] -- (External) token number corresponding to the
+ (internal) symbol number NUM (which must be that of a token). */
static const yytype_uint16 yytoknum[] =
{
0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
- 265, 266, 267, 268, 269, 270, 271, 272, 273, 60,
- 62, 274, 275, 276, 277, 278, 279, 280, 281, 45,
+ 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
+ 275, 276, 277, 278, 279, 60, 62, 280, 281, 45,
43, 42, 47, 37, 33, 282, 283, 94, 41, 40,
44
};
# endif
-/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
-static const yytype_uint8 yyr1[] =
-{
- 0, 41, 42, 43, 43, 43, 43, 43, 43, 43,
- 43, 43, 43, 43, 43, 43, 43, 43, 43, 43,
- 43, 43, 43, 43, 43, 43, 43, 43, 43, 43,
- 43, 43, 43, 43, 43, 43, 43, 43, 43, 44,
- 44
-};
+#define YYPACT_NINF -35
-/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
-static const yytype_uint8 yyr2[] =
+#define yypact_value_is_default(Yystate) \
+ (!!((Yystate) == (-35)))
+
+#define YYTABLE_NINF -1
+
+#define yytable_value_is_error(Yytable_value) \
+ (!!((Yytable_value) == (-1)))
+
+ /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
+ STATE-NUM. */
+static const yytype_int16 yypact[] =
{
- 0, 2, 1, 1, 1, 1, 2, 3, 3, 4,
- 6, 4, 3, 3, 3, 3, 3, 2, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 2, 2, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3
+ 54, -35, -28, -35, -27, -26, -25, -35, 54, 54,
+ 54, 54, 5, 231, -34, 40, 54, 54, 47, -22,
+ -22, -22, 115, -35, 54, 54, 54, 54, 54, 54,
+ 54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
+ 54, 54, 54, 54, 54, 54, 54, -35, 54, -35,
+ 231, 144, 84, -35, 173, -35, 258, 284, 310, 310,
+ 310, 310, 310, 310, 310, 326, 326, 326, 326, 326,
+ 326, 337, 337, 33, 33, -22, -22, -22, -22, 231,
+ -35, 54, -35, 202, -35
};
-/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
- STATE-NUM when YYTABLE doesn't specify something else to do. Zero
- means the default is an error. */
+ /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
+ Performed when YYTABLE does not specify something else to do. Zero
+ means the default is an error. */
static const yytype_uint8 yydefact[] =
{
0, 3, 0, 4, 0, 0, 0, 5, 0, 0,
@@ -580,85 +576,67 @@ static const yytype_uint8 yydefact[] =
27, 28, 0, 1, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 6, 0, 7,
- 39, 0, 0, 8, 0, 29, 19, 20, 30, 33,
- 34, 32, 36, 31, 35, 26, 25, 23, 24, 22,
- 21, 38, 37, 13, 12, 14, 16, 15, 18, 40,
+ 39, 0, 0, 8, 0, 29, 19, 20, 35, 31,
+ 36, 32, 34, 33, 30, 21, 22, 24, 23, 26,
+ 25, 37, 38, 13, 12, 14, 16, 15, 18, 40,
9, 0, 11, 0, 10
};
-/* YYDEFGOTO[NTERM-NUM]. */
-static const yytype_int8 yydefgoto[] =
-{
- -1, 12, 13, 14
-};
-
-/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
- STATE-NUM. */
-#define YYPACT_NINF -35
-static const yytype_int16 yypact[] =
+ /* YYPGOTO[NTERM-NUM]. */
+static const yytype_int8 yypgoto[] =
{
- 54, -35, -28, -35, -27, -26, -25, -35, 54, 54,
- 54, 54, 5, 231, -34, 38, 54, 54, 46, -22,
- -22, -22, 115, -35, 54, 54, 54, 54, 54, 54,
- 54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
- 54, 54, 54, 54, 54, 54, 54, -35, 54, -35,
- 231, 144, 84, -35, 173, -35, 258, 284, 310, 310,
- 310, 310, 310, 310, 310, 329, 329, 329, 329, 329,
- 329, 340, 340, 33, 33, -22, -22, -22, -22, 231,
- -35, 54, -35, 202, -35
+ -35, -35, -8, -35
};
-/* YYPGOTO[NTERM-NUM]. */
-static const yytype_int8 yypgoto[] =
+ /* YYDEFGOTO[NTERM-NUM]. */
+static const yytype_int8 yydefgoto[] =
{
- -35, -35, -8, -35
+ -1, 12, 13, 14
};
-/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
- positive, shift that token. If negative, reduce the rule which
- number is the opposite. If zero, do what YYDEFACT says.
- If YYTABLE_NINF, syntax error. */
-#define YYTABLE_NINF -1
+ /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
+ positive, shift that token. If negative, reduce the rule whose
+ number is the opposite. If YYTABLE_NINF, syntax error. */
static const yytype_int8 yytable[] =
{
19, 20, 21, 22, 47, 23, 48, 50, 51, 52,
54, 15, 16, 17, 18, 46, 56, 57, 58, 59,
60, 61, 62, 63, 64, 65, 66, 67, 68, 69,
70, 71, 72, 73, 74, 75, 76, 77, 78, 0,
- 79, 1, 2, 3, 4, 5, 6, 7, 0, 1,
- 2, 3, 4, 5, 6, 7, 0, 1, 2, 3,
- 4, 5, 6, 7, 43, 44, 45, 8, 0, 0,
- 46, 0, 9, 83, 10, 8, 49, 11, 0, 0,
- 9, 0, 10, 8, 53, 11, 0, 0, 9, 0,
- 10, 0, 0, 11, 24, 25, 26, 27, 28, 29,
- 30, 31, 32, 33, 34, 35, 36, 37, 0, 38,
- 0, 39, 40, 41, 42, 43, 44, 45, 0, 0,
+ 79, 0, 0, 1, 2, 3, 4, 5, 6, 7,
+ 1, 2, 3, 4, 5, 6, 7, 1, 2, 3,
+ 4, 5, 6, 7, 43, 44, 45, 0, 0, 8,
+ 46, 0, 0, 83, 9, 10, 8, 0, 49, 11,
+ 0, 9, 10, 8, 0, 53, 11, 0, 9, 10,
+ 0, 0, 0, 11, 24, 25, 26, 27, 28, 29,
+ 30, 31, 32, 0, 33, 0, 34, 35, 36, 37,
+ 38, 39, 40, 41, 42, 43, 44, 45, 0, 0,
0, 46, 0, 0, 81, 24, 25, 26, 27, 28,
- 29, 30, 31, 32, 33, 34, 35, 36, 37, 0,
- 38, 0, 39, 40, 41, 42, 43, 44, 45, 0,
+ 29, 30, 31, 32, 0, 33, 0, 34, 35, 36,
+ 37, 38, 39, 40, 41, 42, 43, 44, 45, 0,
0, 0, 46, 55, 24, 25, 26, 27, 28, 29,
- 30, 31, 32, 33, 34, 35, 36, 37, 0, 38,
- 0, 39, 40, 41, 42, 43, 44, 45, 0, 0,
+ 30, 31, 32, 0, 33, 0, 34, 35, 36, 37,
+ 38, 39, 40, 41, 42, 43, 44, 45, 0, 0,
0, 46, 80, 24, 25, 26, 27, 28, 29, 30,
- 31, 32, 33, 34, 35, 36, 37, 0, 38, 0,
+ 31, 32, 0, 33, 0, 34, 35, 36, 37, 38,
39, 40, 41, 42, 43, 44, 45, 0, 0, 0,
46, 82, 24, 25, 26, 27, 28, 29, 30, 31,
- 32, 33, 34, 35, 36, 37, 0, 38, 0, 39,
+ 32, 0, 33, 0, 34, 35, 36, 37, 38, 39,
40, 41, 42, 43, 44, 45, 0, 0, 0, 46,
84, 24, 25, 26, 27, 28, 29, 30, 31, 32,
- 33, 34, 35, 36, 37, 0, 38, 0, 39, 40,
+ 0, 33, 0, 34, 35, 36, 37, 38, 39, 40,
41, 42, 43, 44, 45, 0, 0, 0, 46, 25,
- 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
- 36, 37, 0, 38, 0, 39, 40, 41, 42, 43,
+ 26, 27, 28, 29, 30, 31, 32, 0, 33, 0,
+ 34, 35, 36, 37, 38, 39, 40, 41, 42, 43,
44, 45, 0, 0, 0, 46, 26, 27, 28, 29,
- 30, 31, 32, 33, 34, 35, 36, 37, 0, 38,
- 0, 39, 40, 41, 42, 43, 44, 45, 0, 0,
- 0, 46, -1, -1, -1, -1, -1, -1, -1, 33,
- 34, 35, 36, 37, 0, 38, 0, 39, 40, 41,
- 42, 43, 44, 45, 0, 0, 0, 46, -1, -1,
- -1, -1, -1, 0, -1, 0, 39, 40, 41, 42,
- 43, 44, 45, 0, 0, 0, 46, -1, -1, 41,
- 42, 43, 44, 45, 0, 0, 0, 46
+ 30, 31, 32, 0, 33, 0, 34, 35, 36, 37,
+ 38, 39, 40, 41, 42, 43, 44, 45, 0, 0,
+ 0, 46, -1, -1, -1, -1, -1, -1, -1, 0,
+ 33, 0, 34, 35, 36, 37, 38, 39, 40, 41,
+ 42, 43, 44, 45, 0, 0, -1, 46, -1, -1,
+ -1, -1, -1, 39, 40, 41, 42, 43, 44, 45,
+ 0, 0, 0, 46, -1, -1, 41, 42, 43, 44,
+ 45, 0, 0, 0, 46
};
static const yytype_int8 yycheck[] =
@@ -667,50 +645,50 @@ static const yytype_int8 yycheck[] =
18, 39, 39, 39, 39, 37, 24, 25, 26, 27,
28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
38, 39, 40, 41, 42, 43, 44, 45, 46, -1,
- 48, 3, 4, 5, 6, 7, 8, 9, -1, 3,
- 4, 5, 6, 7, 8, 9, -1, 3, 4, 5,
- 6, 7, 8, 9, 31, 32, 33, 29, -1, -1,
- 37, -1, 34, 81, 36, 29, 38, 39, -1, -1,
- 34, -1, 36, 29, 38, 39, -1, -1, 34, -1,
- 36, -1, -1, 39, 10, 11, 12, 13, 14, 15,
- 16, 17, 18, 19, 20, 21, 22, 23, -1, 25,
- -1, 27, 28, 29, 30, 31, 32, 33, -1, -1,
+ 48, -1, -1, 3, 4, 5, 6, 7, 8, 9,
+ 3, 4, 5, 6, 7, 8, 9, 3, 4, 5,
+ 6, 7, 8, 9, 31, 32, 33, -1, -1, 29,
+ 37, -1, -1, 81, 34, 35, 29, -1, 38, 39,
+ -1, 34, 35, 29, -1, 38, 39, -1, 34, 35,
+ -1, -1, -1, 39, 10, 11, 12, 13, 14, 15,
+ 16, 17, 18, -1, 20, -1, 22, 23, 24, 25,
+ 26, 27, 28, 29, 30, 31, 32, 33, -1, -1,
-1, 37, -1, -1, 40, 10, 11, 12, 13, 14,
- 15, 16, 17, 18, 19, 20, 21, 22, 23, -1,
- 25, -1, 27, 28, 29, 30, 31, 32, 33, -1,
+ 15, 16, 17, 18, -1, 20, -1, 22, 23, 24,
+ 25, 26, 27, 28, 29, 30, 31, 32, 33, -1,
-1, -1, 37, 38, 10, 11, 12, 13, 14, 15,
- 16, 17, 18, 19, 20, 21, 22, 23, -1, 25,
- -1, 27, 28, 29, 30, 31, 32, 33, -1, -1,
+ 16, 17, 18, -1, 20, -1, 22, 23, 24, 25,
+ 26, 27, 28, 29, 30, 31, 32, 33, -1, -1,
-1, 37, 38, 10, 11, 12, 13, 14, 15, 16,
- 17, 18, 19, 20, 21, 22, 23, -1, 25, -1,
+ 17, 18, -1, 20, -1, 22, 23, 24, 25, 26,
27, 28, 29, 30, 31, 32, 33, -1, -1, -1,
37, 38, 10, 11, 12, 13, 14, 15, 16, 17,
- 18, 19, 20, 21, 22, 23, -1, 25, -1, 27,
+ 18, -1, 20, -1, 22, 23, 24, 25, 26, 27,
28, 29, 30, 31, 32, 33, -1, -1, -1, 37,
38, 10, 11, 12, 13, 14, 15, 16, 17, 18,
- 19, 20, 21, 22, 23, -1, 25, -1, 27, 28,
+ -1, 20, -1, 22, 23, 24, 25, 26, 27, 28,
29, 30, 31, 32, 33, -1, -1, -1, 37, 11,
- 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
- 22, 23, -1, 25, -1, 27, 28, 29, 30, 31,
+ 12, 13, 14, 15, 16, 17, 18, -1, 20, -1,
+ 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
32, 33, -1, -1, -1, 37, 12, 13, 14, 15,
- 16, 17, 18, 19, 20, 21, 22, 23, -1, 25,
- -1, 27, 28, 29, 30, 31, 32, 33, -1, -1,
- -1, 37, 12, 13, 14, 15, 16, 17, 18, 19,
- 20, 21, 22, 23, -1, 25, -1, 27, 28, 29,
- 30, 31, 32, 33, -1, -1, -1, 37, 19, 20,
- 21, 22, 23, -1, 25, -1, 27, 28, 29, 30,
- 31, 32, 33, -1, -1, -1, 37, 27, 28, 29,
- 30, 31, 32, 33, -1, -1, -1, 37
+ 16, 17, 18, -1, 20, -1, 22, 23, 24, 25,
+ 26, 27, 28, 29, 30, 31, 32, 33, -1, -1,
+ -1, 37, 12, 13, 14, 15, 16, 17, 18, -1,
+ 20, -1, 22, 23, 24, 25, 26, 27, 28, 29,
+ 30, 31, 32, 33, -1, -1, 20, 37, 22, 23,
+ 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
+ -1, -1, -1, 37, 27, 28, 29, 30, 31, 32,
+ 33, -1, -1, -1, 37
};
-/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
- symbol of state STATE-NUM. */
+ /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
+ symbol of state STATE-NUM. */
static const yytype_uint8 yystos[] =
{
0, 3, 4, 5, 6, 7, 8, 9, 29, 34,
- 36, 39, 42, 43, 44, 39, 39, 39, 39, 43,
+ 35, 39, 42, 43, 44, 39, 39, 39, 39, 43,
43, 43, 43, 0, 10, 11, 12, 13, 14, 15,
- 16, 17, 18, 19, 20, 21, 22, 23, 25, 27,
+ 16, 17, 18, 20, 22, 23, 24, 25, 26, 27,
28, 29, 30, 31, 32, 33, 37, 38, 40, 38,
43, 43, 43, 38, 43, 38, 43, 43, 43, 43,
43, 43, 43, 43, 43, 43, 43, 43, 43, 43,
@@ -718,96 +696,62 @@ static const yytype_uint8 yystos[] =
38, 40, 38, 43, 38
};
-#define yyerrok (yyerrstatus = 0)
-#define yyclearin (yychar = YYEMPTY)
-#define YYEMPTY (-2)
-#define YYEOF 0
+ /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
+static const yytype_uint8 yyr1[] =
+{
+ 0, 41, 42, 43, 43, 43, 43, 43, 43, 43,
+ 43, 43, 43, 43, 43, 43, 43, 43, 43, 43,
+ 43, 43, 43, 43, 43, 43, 43, 43, 43, 43,
+ 43, 43, 43, 43, 43, 43, 43, 43, 43, 44,
+ 44
+};
-#define YYACCEPT goto yyacceptlab
-#define YYABORT goto yyabortlab
-#define YYERROR goto yyerrorlab
+ /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
+static const yytype_uint8 yyr2[] =
+{
+ 0, 2, 1, 1, 1, 1, 2, 3, 3, 4,
+ 6, 4, 3, 3, 3, 3, 3, 2, 3, 3,
+ 3, 3, 3, 3, 3, 3, 3, 2, 2, 3,
+ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
+ 3
+};
-/* Like YYERROR except do call yyerror. This remains here temporarily
- to ease the transition to the new meaning of YYERROR, for GCC.
- Once GCC version 2 has supplanted version 1, this can go. */
+#define yyerrok (yyerrstatus = 0)
+#define yyclearin (yychar = YYEMPTY)
+#define YYEMPTY (-2)
+#define YYEOF 0
+
+#define YYACCEPT goto yyacceptlab
+#define YYABORT goto yyabortlab
+#define YYERROR goto yyerrorlab
-#define YYFAIL goto yyerrlab
#define YYRECOVERING() (!!yyerrstatus)
-#define YYBACKUP(Token, Value) \
-do \
- if (yychar == YYEMPTY && yylen == 1) \
- { \
- yychar = (Token); \
- yylval = (Value); \
- yytoken = YYTRANSLATE (yychar); \
- YYPOPSTACK (1); \
- goto yybackup; \
- } \
- else \
- { \
+#define YYBACKUP(Token, Value) \
+do \
+ if (yychar == YYEMPTY) \
+ { \
+ yychar = (Token); \
+ yylval = (Value); \
+ YYPOPSTACK (yylen); \
+ yystate = *yyssp; \
+ goto yybackup; \
+ } \
+ else \
+ { \
yyerror (state, exprobj, expr_retval_ptr, YY_("syntax error: cannot back up")); \
- YYERROR; \
- } \
-while (YYID (0))
-
-
-#define YYTERROR 1
-#define YYERRCODE 256
-
-
-/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
- If N is 0, then set CURRENT to the empty location which ends
- the previous symbol: RHS[0] (always defined). */
-
-#define YYRHSLOC(Rhs, K) ((Rhs)[K])
-#ifndef YYLLOC_DEFAULT
-# define YYLLOC_DEFAULT(Current, Rhs, N) \
- do \
- if (YYID (N)) \
- { \
- (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
- (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
- (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
- (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
- } \
- else \
- { \
- (Current).first_line = (Current).last_line = \
- YYRHSLOC (Rhs, 0).last_line; \
- (Current).first_column = (Current).last_column = \
- YYRHSLOC (Rhs, 0).last_column; \
- } \
- while (YYID (0))
-#endif
+ YYERROR; \
+ } \
+while (0)
+/* Error token number */
+#define YYTERROR 1
+#define YYERRCODE 256
-/* YY_LOCATION_PRINT -- Print the location on the stream.
- This macro was not mandated originally: define only if we know
- we won't break user code: when these are the locations we know. */
-
-#ifndef YY_LOCATION_PRINT
-# if YYLTYPE_IS_TRIVIAL
-# define YY_LOCATION_PRINT(File, Loc) \
- fprintf (File, "%d.%d-%d.%d", \
- (Loc).first_line, (Loc).first_column, \
- (Loc).last_line, (Loc).last_column)
-# else
-# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
-# endif
-#endif
-/* YYLEX -- calling `yylex' with the right arguments. */
-
-#ifdef YYLEX_PARAM
-# define YYLEX yylex (&yylval, YYLEX_PARAM)
-#else
-# define YYLEX yylex (&yylval, state, exprobj)
-#endif
-
/* Enable debugging if requested. */
#if YYDEBUG
@@ -816,60 +760,49 @@ while (YYID (0))
# define YYFPRINTF fprintf
# endif
-# define YYDPRINTF(Args) \
-do { \
- if (yydebug) \
- YYFPRINTF Args; \
-} while (YYID (0))
+# define YYDPRINTF(Args) \
+do { \
+ if (yydebug) \
+ YYFPRINTF Args; \
+} while (0)
+
+/* This macro is provided for backward compatibility. */
+#ifndef YY_LOCATION_PRINT
+# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
+#endif
+
-# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
-do { \
- if (yydebug) \
- { \
- YYFPRINTF (stderr, "%s ", Title); \
- yy_symbol_print (stderr, \
- Type, Value, state, exprobj, expr_retval_ptr); \
- YYFPRINTF (stderr, "\n"); \
- } \
-} while (YYID (0))
+# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
+do { \
+ if (yydebug) \
+ { \
+ YYFPRINTF (stderr, "%s ", Title); \
+ yy_symbol_print (stderr, \
+ Type, Value, state, exprobj, expr_retval_ptr); \
+ YYFPRINTF (stderr, "\n"); \
+ } \
+} while (0)
-/*--------------------------------.
-| Print this symbol on YYOUTPUT. |
-`--------------------------------*/
+/*----------------------------------------.
+| Print this symbol's value on YYOUTPUT. |
+`----------------------------------------*/
-/*ARGSUSED*/
-#if (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
static void
yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, struct tmplpro_state* state, struct expr_parser* exprobj, PSTRING* expr_retval_ptr)
-#else
-static void
-yy_symbol_value_print (yyoutput, yytype, yyvaluep, state, exprobj, expr_retval_ptr)
- FILE *yyoutput;
- int yytype;
- YYSTYPE const * const yyvaluep;
- struct tmplpro_state* state;
- struct expr_parser* exprobj;
- PSTRING* expr_retval_ptr;
-#endif
{
- if (!yyvaluep)
- return;
+ FILE *yyo = yyoutput;
+ YYUSE (yyo);
YYUSE (state);
YYUSE (exprobj);
YYUSE (expr_retval_ptr);
+ if (!yyvaluep)
+ return;
# ifdef YYPRINT
if (yytype < YYNTOKENS)
YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
-# else
- YYUSE (yyoutput);
# endif
- switch (yytype)
- {
- default:
- break;
- }
+ YYUSE (yytype);
}
@@ -877,25 +810,11 @@ yy_symbol_value_print (yyoutput, yytype, yyvaluep, state, exprobj, expr_retval_p
| Print this symbol on YYOUTPUT. |
`--------------------------------*/
-#if (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
static void
yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, struct tmplpro_state* state, struct expr_parser* exprobj, PSTRING* expr_retval_ptr)
-#else
-static void
-yy_symbol_print (yyoutput, yytype, yyvaluep, state, exprobj, expr_retval_ptr)
- FILE *yyoutput;
- int yytype;
- YYSTYPE const * const yyvaluep;
- struct tmplpro_state* state;
- struct expr_parser* exprobj;
- PSTRING* expr_retval_ptr;
-#endif
{
- if (yytype < YYNTOKENS)
- YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
- else
- YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
+ YYFPRINTF (yyoutput, "%s %s (",
+ yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
yy_symbol_value_print (yyoutput, yytype, yyvaluep, state, exprobj, expr_retval_ptr);
YYFPRINTF (yyoutput, ")");
@@ -906,16 +825,8 @@ yy_symbol_print (yyoutput, yytype, yyvaluep, state, exprobj, expr_retval_ptr)
| TOP (included). |
`------------------------------------------------------------------*/
-#if (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
static void
yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
-#else
-static void
-yy_stack_print (yybottom, yytop)
- yytype_int16 *yybottom;
- yytype_int16 *yytop;
-#endif
{
YYFPRINTF (stderr, "Stack now");
for (; yybottom <= yytop; yybottom++)
@@ -926,52 +837,42 @@ yy_stack_print (yybottom, yytop)
YYFPRINTF (stderr, "\n");
}
-# define YY_STACK_PRINT(Bottom, Top) \
-do { \
- if (yydebug) \
- yy_stack_print ((Bottom), (Top)); \
-} while (YYID (0))
+# define YY_STACK_PRINT(Bottom, Top) \
+do { \
+ if (yydebug) \
+ yy_stack_print ((Bottom), (Top)); \
+} while (0)
/*------------------------------------------------.
| Report that the YYRULE is going to be reduced. |
`------------------------------------------------*/
-#if (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
-static void
-yy_reduce_print (YYSTYPE *yyvsp, int yyrule, struct tmplpro_state* state, struct expr_parser* exprobj, PSTRING* expr_retval_ptr)
-#else
static void
-yy_reduce_print (yyvsp, yyrule, state, exprobj, expr_retval_ptr)
- YYSTYPE *yyvsp;
- int yyrule;
- struct tmplpro_state* state;
- struct expr_parser* exprobj;
- PSTRING* expr_retval_ptr;
-#endif
+yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule, struct tmplpro_state* state, struct expr_parser* exprobj, PSTRING* expr_retval_ptr)
{
+ unsigned long int yylno = yyrline[yyrule];
int yynrhs = yyr2[yyrule];
int yyi;
- unsigned long int yylno = yyrline[yyrule];
YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
- yyrule - 1, yylno);
+ yyrule - 1, yylno);
/* The symbols being reduced. */
for (yyi = 0; yyi < yynrhs; yyi++)
{
YYFPRINTF (stderr, " $%d = ", yyi + 1);
- yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
- &(yyvsp[(yyi + 1) - (yynrhs)])
- , state, exprobj, expr_retval_ptr);
+ yy_symbol_print (stderr,
+ yystos[yyssp[yyi + 1 - yynrhs]],
+ &(yyvsp[(yyi + 1) - (yynrhs)])
+ , state, exprobj, expr_retval_ptr);
YYFPRINTF (stderr, "\n");
}
}
-# define YY_REDUCE_PRINT(Rule) \
-do { \
- if (yydebug) \
- yy_reduce_print (yyvsp, Rule, state, exprobj, expr_retval_ptr); \
-} while (YYID (0))
+# define YY_REDUCE_PRINT(Rule) \
+do { \
+ if (yydebug) \
+ yy_reduce_print (yyssp, yyvsp, Rule, state, exprobj, expr_retval_ptr); \
+} while (0)
/* Nonzero means print parse trace. It is left uninitialized so that
multiple parsers can coexist. */
@@ -985,7 +886,7 @@ int yydebug;
/* YYINITDEPTH -- initial size of the parser's stacks. */
-#ifndef YYINITDEPTH
+#ifndef YYINITDEPTH
# define YYINITDEPTH 200
#endif
@@ -1000,7 +901,6 @@ int yydebug;
# define YYMAXDEPTH 10000
#endif
-
#if YYERROR_VERBOSE
@@ -1009,15 +909,8 @@ int yydebug;
# define yystrlen strlen
# else
/* Return the length of YYSTR. */
-#if (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
static YYSIZE_T
yystrlen (const char *yystr)
-#else
-static YYSIZE_T
-yystrlen (yystr)
- const char *yystr;
-#endif
{
YYSIZE_T yylen;
for (yylen = 0; yystr[yylen]; yylen++)
@@ -1033,16 +926,8 @@ yystrlen (yystr)
# else
/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
YYDEST. */
-#if (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
static char *
yystpcpy (char *yydest, const char *yysrc)
-#else
-static char *
-yystpcpy (yydest, yysrc)
- char *yydest;
- const char *yysrc;
-#endif
{
char *yyd = yydest;
const char *yys = yysrc;
@@ -1072,27 +957,27 @@ yytnamerr (char *yyres, const char *yystr)
char const *yyp = yystr;
for (;;)
- switch (*++yyp)
- {
- case '\'':
- case ',':
- goto do_not_strip_quotes;
-
- case '\\':
- if (*++yyp != '\\')
- goto do_not_strip_quotes;
- /* Fall through. */
- default:
- if (yyres)
- yyres[yyn] = *yyp;
- yyn++;
- break;
-
- case '"':
- if (yyres)
- yyres[yyn] = '\0';
- return yyn;
- }
+ switch (*++yyp)
+ {
+ case '\'':
+ case ',':
+ goto do_not_strip_quotes;
+
+ case '\\':
+ if (*++yyp != '\\')
+ goto do_not_strip_quotes;
+ /* Fall through. */
+ default:
+ if (yyres)
+ yyres[yyn] = *yyp;
+ yyn++;
+ break;
+
+ case '"':
+ if (yyres)
+ yyres[yyn] = '\0';
+ return yyn;
+ }
do_not_strip_quotes: ;
}
@@ -1103,205 +988,182 @@ yytnamerr (char *yyres, const char *yystr)
}
# endif
-/* Copy into YYRESULT an error message about the unexpected token
- YYCHAR while in state YYSTATE. Return the number of bytes copied,
- including the terminating null byte. If YYRESULT is null, do not
- copy anything; just return the number of bytes that would be
- copied. As a special case, return 0 if an ordinary "syntax error"
- message will do. Return YYSIZE_MAXIMUM if overflow occurs during
- size calculation. */
-static YYSIZE_T
-yysyntax_error (char *yyresult, int yystate, int yychar)
+/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
+ about the unexpected token YYTOKEN for the state stack whose top is
+ YYSSP.
+
+ Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
+ not large enough to hold the message. In that case, also set
+ *YYMSG_ALLOC to the required number of bytes. Return 2 if the
+ required number of bytes is too large to store. */
+static int
+yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
+ yytype_int16 *yyssp, int yytoken)
{
- int yyn = yypact[yystate];
+ YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
+ YYSIZE_T yysize = yysize0;
+ enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
+ /* Internationalized format string. */
+ const char *yyformat = YY_NULLPTR;
+ /* Arguments of yyformat. */
+ char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
+ /* Number of reported tokens (one for the "unexpected", one per
+ "expected"). */
+ int yycount = 0;
+
+ /* There are many possibilities here to consider:
+ - If this state is a consistent state with a default action, then
+ the only way this function was invoked is if the default action
+ is an error action. In that case, don't check for expected
+ tokens because there are none.
+ - The only way there can be no lookahead present (in yychar) is if
+ this state is a consistent state with a default action. Thus,
+ detecting the absence of a lookahead is sufficient to determine
+ that there is no unexpected or expected token to report. In that
+ case, just report a simple "syntax error".
+ - Don't assume there isn't a lookahead just because this state is a
+ consistent state with a default action. There might have been a
+ previous inconsistent state, consistent state with a non-default
+ action, or user semantic action that manipulated yychar.
+ - Of course, the expected token list depends on states to have
+ correct lookahead information, and it depends on the parser not
+ to perform extra reductions after fetching a lookahead from the
+ scanner and before detecting a syntax error. Thus, state merging
+ (from LALR or IELR) and default reductions corrupt the expected
+ token list. However, the list is correct for canonical LR with
+ one exception: it will still contain any token that will not be
+ accepted due to an error action in a later state.
+ */
+ if (yytoken != YYEMPTY)
+ {
+ int yyn = yypact[*yyssp];
+ yyarg[yycount++] = yytname[yytoken];
+ if (!yypact_value_is_default (yyn))
+ {
+ /* Start YYX at -YYN if negative to avoid negative indexes in
+ YYCHECK. In other words, skip the first -YYN actions for
+ this state because they are default actions. */
+ int yyxbegin = yyn < 0 ? -yyn : 0;
+ /* Stay within bounds of both yycheck and yytname. */
+ int yychecklim = YYLAST - yyn + 1;
+ int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
+ int yyx;
+
+ for (yyx = yyxbegin; yyx < yyxend; ++yyx)
+ if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
+ && !yytable_value_is_error (yytable[yyx + yyn]))
+ {
+ if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
+ {
+ yycount = 1;
+ yysize = yysize0;
+ break;
+ }
+ yyarg[yycount++] = yytname[yyx];
+ {
+ YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
+ if (! (yysize <= yysize1
+ && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
+ return 2;
+ yysize = yysize1;
+ }
+ }
+ }
+ }
- if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
- return 0;
- else
+ switch (yycount)
{
- int yytype = YYTRANSLATE (yychar);
- YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
- YYSIZE_T yysize = yysize0;
- YYSIZE_T yysize1;
- int yysize_overflow = 0;
- enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
- char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
- int yyx;
-
-# if 0
- /* This is so xgettext sees the translatable formats that are
- constructed on the fly. */
- YY_("syntax error, unexpected %s");
- YY_("syntax error, unexpected %s, expecting %s");
- YY_("syntax error, unexpected %s, expecting %s or %s");
- YY_("syntax error, unexpected %s, expecting %s or %s or %s");
- YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
-# endif
- char *yyfmt;
- char const *yyf;
- static char const yyunexpected[] = "syntax error, unexpected %s";
- static char const yyexpecting[] = ", expecting %s";
- static char const yyor[] = " or %s";
- char yyformat[sizeof yyunexpected
- + sizeof yyexpecting - 1
- + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
- * (sizeof yyor - 1))];
- char const *yyprefix = yyexpecting;
-
- /* Start YYX at -YYN if negative to avoid negative indexes in
- YYCHECK. */
- int yyxbegin = yyn < 0 ? -yyn : 0;
-
- /* Stay within bounds of both yycheck and yytname. */
- int yychecklim = YYLAST - yyn + 1;
- int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
- int yycount = 1;
-
- yyarg[0] = yytname[yytype];
- yyfmt = yystpcpy (yyformat, yyunexpected);
-
- for (yyx = yyxbegin; yyx < yyxend; ++yyx)
- if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
- {
- if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
- {
- yycount = 1;
- yysize = yysize0;
- yyformat[sizeof yyunexpected - 1] = '\0';
- break;
- }
- yyarg[yycount++] = yytname[yyx];
- yysize1 = yysize + yytnamerr (0, yytname[yyx]);
- yysize_overflow |= (yysize1 < yysize);
- yysize = yysize1;
- yyfmt = yystpcpy (yyfmt, yyprefix);
- yyprefix = yyor;
- }
-
- yyf = YY_(yyformat);
- yysize1 = yysize + yystrlen (yyf);
- yysize_overflow |= (yysize1 < yysize);
- yysize = yysize1;
-
- if (yysize_overflow)
- return YYSIZE_MAXIMUM;
-
- if (yyresult)
- {
- /* Avoid sprintf, as that infringes on the user's name space.
- Don't have undefined behavior even if the translation
- produced a string with the wrong number of "%s"s. */
- char *yyp = yyresult;
- int yyi = 0;
- while ((*yyp = *yyf) != '\0')
- {
- if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
- {
- yyp += yytnamerr (yyp, yyarg[yyi++]);
- yyf += 2;
- }
- else
- {
- yyp++;
- yyf++;
- }
- }
- }
- return yysize;
+# define YYCASE_(N, S) \
+ case N: \
+ yyformat = S; \
+ break
+ default: /* Avoid compiler warnings. */
+ YYCASE_(0, YY_("syntax error"));
+ YYCASE_(1, YY_("syntax error, unexpected %s"));
+ YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
+ YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
+ YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
+ YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
+# undef YYCASE_
}
+
+ {
+ YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
+ if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
+ return 2;
+ yysize = yysize1;
+ }
+
+ if (*yymsg_alloc < yysize)
+ {
+ *yymsg_alloc = 2 * yysize;
+ if (! (yysize <= *yymsg_alloc
+ && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
+ *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
+ return 1;
+ }
+
+ /* Avoid sprintf, as that infringes on the user's name space.
+ Don't have undefined behavior even if the translation
+ produced a string with the wrong number of "%s"s. */
+ {
+ char *yyp = *yymsg;
+ int yyi = 0;
+ while ((*yyp = *yyformat) != '\0')
+ if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
+ {
+ yyp += yytnamerr (yyp, yyarg[yyi++]);
+ yyformat += 2;
+ }
+ else
+ {
+ yyp++;
+ yyformat++;
+ }
+ }
+ return 0;
}
#endif /* YYERROR_VERBOSE */
-
/*-----------------------------------------------.
| Release the memory associated to this symbol. |
`-----------------------------------------------*/
-/*ARGSUSED*/
-#if (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
static void
yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, struct tmplpro_state* state, struct expr_parser* exprobj, PSTRING* expr_retval_ptr)
-#else
-static void
-yydestruct (yymsg, yytype, yyvaluep, state, exprobj, expr_retval_ptr)
- const char *yymsg;
- int yytype;
- YYSTYPE *yyvaluep;
- struct tmplpro_state* state;
- struct expr_parser* exprobj;
- PSTRING* expr_retval_ptr;
-#endif
{
YYUSE (yyvaluep);
YYUSE (state);
YYUSE (exprobj);
YYUSE (expr_retval_ptr);
-
if (!yymsg)
yymsg = "Deleting";
YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
- switch (yytype)
- {
-
- default:
- break;
- }
+ YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
+ YYUSE (yytype);
+ YY_IGNORE_MAYBE_UNINITIALIZED_END
}
-/* Prevent warnings from -Wmissing-prototypes. */
-#ifdef YYPARSE_PARAM
-#if defined __STDC__ || defined __cplusplus
-int yyparse (void *YYPARSE_PARAM);
-#else
-int yyparse ();
-#endif
-#else /* ! YYPARSE_PARAM */
-#if defined __STDC__ || defined __cplusplus
-int yyparse (struct tmplpro_state* state, struct expr_parser* exprobj, PSTRING* expr_retval_ptr);
-#else
-int yyparse ();
-#endif
-#endif /* ! YYPARSE_PARAM */
-
+/*----------.
+| yyparse. |
+`----------*/
-/*-------------------------.
-| yyparse or yypush_parse. |
-`-------------------------*/
-
-#ifdef YYPARSE_PARAM
-#if (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
-int
-yyparse (void *YYPARSE_PARAM)
-#else
-int
-yyparse (YYPARSE_PARAM)
- void *YYPARSE_PARAM;
-#endif
-#else /* ! YYPARSE_PARAM */
-#if (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
int
yyparse (struct tmplpro_state* state, struct expr_parser* exprobj, PSTRING* expr_retval_ptr)
-#else
-int
-yyparse (state, exprobj, expr_retval_ptr)
- struct tmplpro_state* state;
- struct expr_parser* exprobj;
- PSTRING* expr_retval_ptr;
-#endif
-#endif
{
/* The lookahead symbol. */
int yychar;
+
/* The semantic value of the lookahead symbol. */
-YYSTYPE yylval;
+/* Default value used for initialization, for pacifying older GCCs
+ or non-GCC compilers. */
+YY_INITIAL_VALUE (static YYSTYPE yyval_default;)
+YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default);
/* Number of syntax errors so far. */
int yynerrs;
@@ -1311,10 +1173,10 @@ YYSTYPE yylval;
int yyerrstatus;
/* The stacks and their tools:
- `yyss': related to states.
- `yyvs': related to semantic values.
+ 'yyss': related to states.
+ 'yyvs': related to semantic values.
- Refer to the stacks thru separate pointers, to allow yyoverflow
+ Refer to the stacks through separate pointers, to allow yyoverflow
to reallocate them elsewhere. */
/* The state stack. */
@@ -1332,7 +1194,7 @@ YYSTYPE yylval;
int yyn;
int yyresult;
/* Lookahead token as an internal (translated) token number. */
- int yytoken;
+ int yytoken = 0;
/* The variables used to return semantic value and location from the
action routines. */
YYSTYPE yyval;
@@ -1350,9 +1212,8 @@ YYSTYPE yylval;
Keep to zero when no symbol should be popped. */
int yylen = 0;
- yytoken = 0;
- yyss = yyssa;
- yyvs = yyvsa;
+ yyssp = yyss = yyssa;
+ yyvsp = yyvs = yyvsa;
yystacksize = YYINITDEPTH;
YYDPRINTF ((stderr, "Starting parse\n"));
@@ -1361,14 +1222,6 @@ YYSTYPE yylval;
yyerrstatus = 0;
yynerrs = 0;
yychar = YYEMPTY; /* Cause a token to be read. */
-
- /* Initialize stack pointers.
- Waste one element of value and location stack
- so that they stay on the same level as the state stack.
- The wasted elements are never initialized. */
- yyssp = yyss;
- yyvsp = yyvs;
-
goto yysetstate;
/*------------------------------------------------------------.
@@ -1389,23 +1242,23 @@ YYSTYPE yylval;
#ifdef yyoverflow
{
- /* Give user a chance to reallocate the stack. Use copies of
- these so that the &'s don't force the real ones into
- memory. */
- YYSTYPE *yyvs1 = yyvs;
- yytype_int16 *yyss1 = yyss;
-
- /* Each stack pointer address is followed by the size of the
- data in use in that stack, in bytes. This used to be a
- conditional around just the two extra args, but that might
- be undefined if yyoverflow is a macro. */
- yyoverflow (YY_("memory exhausted"),
- &yyss1, yysize * sizeof (*yyssp),
- &yyvs1, yysize * sizeof (*yyvsp),
- &yystacksize);
-
- yyss = yyss1;
- yyvs = yyvs1;
+ /* Give user a chance to reallocate the stack. Use copies of
+ these so that the &'s don't force the real ones into
+ memory. */
+ YYSTYPE *yyvs1 = yyvs;
+ yytype_int16 *yyss1 = yyss;
+
+ /* Each stack pointer address is followed by the size of the
+ data in use in that stack, in bytes. This used to be a
+ conditional around just the two extra args, but that might
+ be undefined if yyoverflow is a macro. */
+ yyoverflow (YY_("memory exhausted"),
+ &yyss1, yysize * sizeof (*yyssp),
+ &yyvs1, yysize * sizeof (*yyvsp),
+ &yystacksize);
+
+ yyss = yyss1;
+ yyvs = yyvs1;
}
#else /* no yyoverflow */
# ifndef YYSTACK_RELOCATE
@@ -1413,22 +1266,22 @@ YYSTYPE yylval;
# else
/* Extend the stack our own way. */
if (YYMAXDEPTH <= yystacksize)
- goto yyexhaustedlab;
+ goto yyexhaustedlab;
yystacksize *= 2;
if (YYMAXDEPTH < yystacksize)
- yystacksize = YYMAXDEPTH;
+ yystacksize = YYMAXDEPTH;
{
- yytype_int16 *yyss1 = yyss;
- union yyalloc *yyptr =
- (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
- if (! yyptr)
- goto yyexhaustedlab;
- YYSTACK_RELOCATE (yyss_alloc, yyss);
- YYSTACK_RELOCATE (yyvs_alloc, yyvs);
+ yytype_int16 *yyss1 = yyss;
+ union yyalloc *yyptr =
+ (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
+ if (! yyptr)
+ goto yyexhaustedlab;
+ YYSTACK_RELOCATE (yyss_alloc, yyss);
+ YYSTACK_RELOCATE (yyvs_alloc, yyvs);
# undef YYSTACK_RELOCATE
- if (yyss1 != yyssa)
- YYSTACK_FREE (yyss1);
+ if (yyss1 != yyssa)
+ YYSTACK_FREE (yyss1);
}
# endif
#endif /* no yyoverflow */
@@ -1437,10 +1290,10 @@ YYSTYPE yylval;
yyvsp = yyvs + yysize - 1;
YYDPRINTF ((stderr, "Stack size increased to %lu\n",
- (unsigned long int) yystacksize));
+ (unsigned long int) yystacksize));
if (yyss + yystacksize - 1 <= yyssp)
- YYABORT;
+ YYABORT;
}
YYDPRINTF ((stderr, "Entering state %d\n", yystate));
@@ -1460,7 +1313,7 @@ yybackup:
/* First try to decide what to do without reference to lookahead token. */
yyn = yypact[yystate];
- if (yyn == YYPACT_NINF)
+ if (yypact_value_is_default (yyn))
goto yydefault;
/* Not known => get a lookahead token if don't already have one. */
@@ -1469,7 +1322,7 @@ yybackup:
if (yychar == YYEMPTY)
{
YYDPRINTF ((stderr, "Reading a token: "));
- yychar = YYLEX;
+ yychar = yylex (&yylval, state, exprobj);
}
if (yychar <= YYEOF)
@@ -1491,8 +1344,8 @@ yybackup:
yyn = yytable[yyn];
if (yyn <= 0)
{
- if (yyn == 0 || yyn == YYTABLE_NINF)
- goto yyerrlab;
+ if (yytable_value_is_error (yyn))
+ goto yyerrlab;
yyn = -yyn;
goto yyreduce;
}
@@ -1509,7 +1362,9 @@ yybackup:
yychar = YYEMPTY;
yystate = yyn;
+ YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
*++yyvsp = yylval;
+ YY_IGNORE_MAYBE_UNINITIALIZED_END
goto yynewstate;
@@ -1532,7 +1387,7 @@ yyreduce:
yylen = yyr2[yyn];
/* If YYLEN is nonzero, implement the default value of the action:
- `$$ = $1'.
+ '$$ = $1'.
Otherwise, the following line sets YYVAL to garbage.
This behavior is undocumented and Bison
@@ -1546,369 +1401,339 @@ yyreduce:
switch (yyn)
{
case 2:
-
-/* Line 1455 of yacc.c */
-#line 62 "expr.y"
+#line 62 "expr.y" /* yacc.c:1648 */
{
- expr_to_str1(state, &(yyvsp[(1) - (1)].numval));
- *expr_retval_ptr=(yyvsp[(1) - (1)].numval).val.strval;
+ expr_to_str1(state, &(yyvsp[0].numval));
+ *expr_retval_ptr=(yyvsp[0].numval).val.strval;
}
+#line 1410 "y.tab.c" /* yacc.c:1648 */
break;
case 3:
-
-/* Line 1455 of yacc.c */
-#line 69 "expr.y"
- { (yyval.numval) = (yyvsp[(1) - (1)].numval); }
+#line 69 "expr.y" /* yacc.c:1648 */
+ { (yyval.numval) = (yyvsp[0].numval); }
+#line 1416 "y.tab.c" /* yacc.c:1648 */
break;
case 4:
-
-/* Line 1455 of yacc.c */
-#line 70 "expr.y"
- { (yyval.numval).type=EXPR_TYPE_DBL; (yyval.numval).val.dblval = (yyvsp[(1) - (1)].tptr)->var; }
+#line 70 "expr.y" /* yacc.c:1648 */
+ { (yyval.numval).type=EXPR_TYPE_DBL; (yyval.numval).val.dblval = (yyvsp[0].tptr)->var; }
+#line 1422 "y.tab.c" /* yacc.c:1648 */
break;
case 5:
-
-/* Line 1455 of yacc.c */
-#line 72 "expr.y"
+#line 72 "expr.y" /* yacc.c:1648 */
{
- PSTRING varvalue=_get_variable_value(state->param, (yyvsp[(1) - (1)].uservar));
+ PSTRING varvalue=_get_variable_value(state->param, (yyvsp[0].uservar));
if (varvalue.begin==NULL) {
int loglevel = state->param->warn_unused ? TMPL_LOG_ERROR : TMPL_LOG_INFO;
- log_expr(exprobj,loglevel, "non-initialized variable %.*s\n",(int)((yyvsp[(1) - (1)].uservar).endnext-(yyvsp[(1) - (1)].uservar).begin),(yyvsp[(1) - (1)].uservar).begin);
+ log_expr(exprobj,loglevel, "non-initialized variable %.*s\n",(int)((yyvsp[0].uservar).endnext-(yyvsp[0].uservar).begin),(yyvsp[0].uservar).begin);
}
(yyval.numval).type=EXPR_TYPE_PSTR;
(yyval.numval).val.strval=varvalue;
}
+#line 1436 "y.tab.c" /* yacc.c:1648 */
break;
case 6:
-
-/* Line 1455 of yacc.c */
-#line 82 "expr.y"
+#line 82 "expr.y" /* yacc.c:1648 */
{
- (yyval.numval) = call_expr_userfunc(exprobj, state->param, (yyvsp[(1) - (2)].extfunc));
+ (yyval.numval) = call_expr_userfunc(exprobj, state->param, (yyvsp[-1].extfunc));
}
+#line 1444 "y.tab.c" /* yacc.c:1648 */
break;
case 7:
-
-/* Line 1455 of yacc.c */
-#line 86 "expr.y"
+#line 86 "expr.y" /* yacc.c:1648 */
{
- (yyvsp[(1) - (3)].extfunc).arglist=state->param->InitExprArglistFuncPtr(state->param->ext_calluserfunc_state);
- (yyval.numval) = call_expr_userfunc(exprobj, state->param, (yyvsp[(1) - (3)].extfunc));
+ (yyvsp[-2].extfunc).arglist=state->param->InitExprArglistFuncPtr(state->param->ext_calluserfunc_state);
+ (yyval.numval) = call_expr_userfunc(exprobj, state->param, (yyvsp[-2].extfunc));
}
+#line 1453 "y.tab.c" /* yacc.c:1648 */
break;
case 8:
-
-/* Line 1455 of yacc.c */
-#line 91 "expr.y"
+#line 91 "expr.y" /* yacc.c:1648 */
{
struct exprval e = NEW_EXPRVAL(EXPR_TYPE_PSTR);
e.val.strval.begin = NULL;
e.val.strval.endnext = NULL;
- (yyval.numval) = (*((func_t_ee)(yyvsp[(1) - (3)].tptr)->fnctptr))(exprobj, e);
+ (yyval.numval) = (*((func_t_ee)(yyvsp[-2].tptr)->fnctptr))(exprobj, e);
}
+#line 1464 "y.tab.c" /* yacc.c:1648 */
break;
case 9:
-
-/* Line 1455 of yacc.c */
-#line 98 "expr.y"
+#line 98 "expr.y" /* yacc.c:1648 */
{
(yyval.numval).type=EXPR_TYPE_DBL;
- expr_to_dbl1(exprobj, &(yyvsp[(3) - (4)].numval));
- (yyval.numval).val.dblval = (*((func_t_dd)(yyvsp[(1) - (4)].tptr)->fnctptr))((yyvsp[(3) - (4)].numval).val.dblval);
+ expr_to_dbl1(exprobj, &(yyvsp[-1].numval));
+ (yyval.numval).val.dblval = (*((func_t_dd)(yyvsp[-3].tptr)->fnctptr))((yyvsp[-1].numval).val.dblval);
}
+#line 1474 "y.tab.c" /* yacc.c:1648 */
break;
case 10:
-
-/* Line 1455 of yacc.c */
-#line 104 "expr.y"
+#line 104 "expr.y" /* yacc.c:1648 */
{
(yyval.numval).type=EXPR_TYPE_DBL;
- expr_to_dbl(exprobj, &(yyvsp[(3) - (6)].numval), &(yyvsp[(5) - (6)].numval));
- (yyval.numval).val.dblval = (*((func_t_ddd)(yyvsp[(1) - (6)].tptr)->fnctptr))((yyvsp[(3) - (6)].numval).val.dblval,(yyvsp[(5) - (6)].numval).val.dblval);
+ expr_to_dbl(exprobj, &(yyvsp[-3].numval), &(yyvsp[-1].numval));
+ (yyval.numval).val.dblval = (*((func_t_ddd)(yyvsp[-5].tptr)->fnctptr))((yyvsp[-3].numval).val.dblval,(yyvsp[-1].numval).val.dblval);
}
+#line 1484 "y.tab.c" /* yacc.c:1648 */
break;
case 11:
-
-/* Line 1455 of yacc.c */
-#line 110 "expr.y"
+#line 110 "expr.y" /* yacc.c:1648 */
{
- (yyval.numval) = (*((func_t_ee)(yyvsp[(1) - (4)].tptr)->fnctptr))(exprobj,(yyvsp[(3) - (4)].numval));
+ (yyval.numval) = (*((func_t_ee)(yyvsp[-3].tptr)->fnctptr))(exprobj,(yyvsp[-1].numval));
}
+#line 1492 "y.tab.c" /* yacc.c:1648 */
break;
case 12:
-
-/* Line 1455 of yacc.c */
-#line 113 "expr.y"
- { DO_MATHOP(exprobj, (yyval.numval),+,(yyvsp[(1) - (3)].numval),(yyvsp[(3) - (3)].numval)); }
+#line 113 "expr.y" /* yacc.c:1648 */
+ { DO_MATHOP(exprobj, (yyval.numval),+,(yyvsp[-2].numval),(yyvsp[0].numval)); }
+#line 1498 "y.tab.c" /* yacc.c:1648 */
break;
case 13:
-
-/* Line 1455 of yacc.c */
-#line 114 "expr.y"
- { DO_MATHOP(exprobj, (yyval.numval),-,(yyvsp[(1) - (3)].numval),(yyvsp[(3) - (3)].numval)); }
+#line 114 "expr.y" /* yacc.c:1648 */
+ { DO_MATHOP(exprobj, (yyval.numval),-,(yyvsp[-2].numval),(yyvsp[0].numval)); }
+#line 1504 "y.tab.c" /* yacc.c:1648 */
break;
case 14:
-
-/* Line 1455 of yacc.c */
-#line 115 "expr.y"
- { DO_MATHOP(exprobj, (yyval.numval),*,(yyvsp[(1) - (3)].numval),(yyvsp[(3) - (3)].numval)); }
+#line 115 "expr.y" /* yacc.c:1648 */
+ { DO_MATHOP(exprobj, (yyval.numval),*,(yyvsp[-2].numval),(yyvsp[0].numval)); }
+#line 1510 "y.tab.c" /* yacc.c:1648 */
break;
case 15:
-
-/* Line 1455 of yacc.c */
-#line 117 "expr.y"
+#line 117 "expr.y" /* yacc.c:1648 */
{
(yyval.numval).type=EXPR_TYPE_INT;
- expr_to_int(exprobj, &(yyvsp[(1) - (3)].numval),&(yyvsp[(3) - (3)].numval));
- (yyval.numval).val.intval = (yyvsp[(1) - (3)].numval).val.intval % (yyvsp[(3) - (3)].numval).val.intval;
+ expr_to_int(exprobj, &(yyvsp[-2].numval),&(yyvsp[0].numval));
+ (yyval.numval).val.intval = (yyvsp[-2].numval).val.intval % (yyvsp[0].numval).val.intval;
}
+#line 1520 "y.tab.c" /* yacc.c:1648 */
break;
case 16:
-
-/* Line 1455 of yacc.c */
-#line 148 "expr.y"
+#line 148 "expr.y" /* yacc.c:1648 */
{
(yyval.numval).type=EXPR_TYPE_DBL;
- expr_to_dbl(exprobj, &(yyvsp[(1) - (3)].numval),&(yyvsp[(3) - (3)].numval));
- if ((yyvsp[(3) - (3)].numval).val.dblval)
- (yyval.numval).val.dblval = (yyvsp[(1) - (3)].numval).val.dblval / (yyvsp[(3) - (3)].numval).val.dblval;
+ expr_to_dbl(exprobj, &(yyvsp[-2].numval),&(yyvsp[0].numval));
+ if ((yyvsp[0].numval).val.dblval)
+ (yyval.numval).val.dblval = (yyvsp[-2].numval).val.dblval / (yyvsp[0].numval).val.dblval;
else
{
(yyval.numval).val.dblval = 0;
log_expr(exprobj, TMPL_LOG_ERROR, "%s\n", "division by zero");
}
}
+#line 1536 "y.tab.c" /* yacc.c:1648 */
break;
case 17:
-
-/* Line 1455 of yacc.c */
-#line 160 "expr.y"
+#line 160 "expr.y" /* yacc.c:1648 */
{
- switch ((yyval.numval).type=(yyvsp[(2) - (2)].numval).type) {
+ switch ((yyval.numval).type=(yyvsp[0].numval).type) {
case EXPR_TYPE_INT:
- (yyval.numval).val.intval = -(yyvsp[(2) - (2)].numval).val.intval;
+ (yyval.numval).val.intval = -(yyvsp[0].numval).val.intval;
;break;
case EXPR_TYPE_DBL:
- (yyval.numval).val.dblval = -(yyvsp[(2) - (2)].numval).val.dblval;
+ (yyval.numval).val.dblval = -(yyvsp[0].numval).val.dblval;
;break;
}
}
+#line 1551 "y.tab.c" /* yacc.c:1648 */
break;
case 18:
-
-/* Line 1455 of yacc.c */
-#line 171 "expr.y"
+#line 171 "expr.y" /* yacc.c:1648 */
{
(yyval.numval).type=EXPR_TYPE_DBL;
- expr_to_dbl(exprobj, &(yyvsp[(1) - (3)].numval),&(yyvsp[(3) - (3)].numval));
- (yyval.numval).val.dblval = pow ((yyvsp[(1) - (3)].numval).val.dblval, (yyvsp[(3) - (3)].numval).val.dblval);
+ expr_to_dbl(exprobj, &(yyvsp[-2].numval),&(yyvsp[0].numval));
+ (yyval.numval).val.dblval = pow ((yyvsp[-2].numval).val.dblval, (yyvsp[0].numval).val.dblval);
}
+#line 1561 "y.tab.c" /* yacc.c:1648 */
break;
case 19:
-
-/* Line 1455 of yacc.c */
-#line 177 "expr.y"
+#line 177 "expr.y" /* yacc.c:1648 */
{
if (exprobj->is_tt_like_logical) {
- (yyval.numval)=(yyvsp[(1) - (3)].numval);
+ (yyval.numval)=(yyvsp[-2].numval);
switch (expr_to_int_or_dbl_logop1(exprobj, &(yyval.numval))) {
- case EXPR_TYPE_INT: (yyval.numval)= ((yyvsp[(1) - (3)].numval).val.intval ? (yyvsp[(1) - (3)].numval) : (yyvsp[(3) - (3)].numval)); break;
- case EXPR_TYPE_DBL: (yyval.numval)= ((yyvsp[(1) - (3)].numval).val.dblval ? (yyvsp[(1) - (3)].numval) : (yyvsp[(3) - (3)].numval)); break;
+ case EXPR_TYPE_INT: (yyval.numval)= ((yyvsp[-2].numval).val.intval ? (yyvsp[-2].numval) : (yyvsp[0].numval)); break;
+ case EXPR_TYPE_DBL: (yyval.numval)= ((yyvsp[-2].numval).val.dblval ? (yyvsp[-2].numval) : (yyvsp[0].numval)); break;
}
} else {
- DO_LOGOP(exprobj, (yyval.numval),||,(yyvsp[(1) - (3)].numval),(yyvsp[(3) - (3)].numval));
+ DO_LOGOP(exprobj, (yyval.numval),||,(yyvsp[-2].numval),(yyvsp[0].numval));
}
}
+#line 1577 "y.tab.c" /* yacc.c:1648 */
break;
case 20:
-
-/* Line 1455 of yacc.c */
-#line 189 "expr.y"
+#line 189 "expr.y" /* yacc.c:1648 */
{
if (exprobj->is_tt_like_logical) {
- (yyval.numval)=(yyvsp[(1) - (3)].numval);
+ (yyval.numval)=(yyvsp[-2].numval);
switch (expr_to_int_or_dbl_logop1(exprobj, &(yyval.numval))) {
- case EXPR_TYPE_INT: (yyval.numval)= ((yyvsp[(1) - (3)].numval).val.intval ? (yyvsp[(3) - (3)].numval) : (yyvsp[(1) - (3)].numval)); break;
- case EXPR_TYPE_DBL: (yyval.numval)= ((yyvsp[(1) - (3)].numval).val.dblval ? (yyvsp[(3) - (3)].numval) : (yyvsp[(1) - (3)].numval)); break;
+ case EXPR_TYPE_INT: (yyval.numval)= ((yyvsp[-2].numval).val.intval ? (yyvsp[0].numval) : (yyvsp[-2].numval)); break;
+ case EXPR_TYPE_DBL: (yyval.numval)= ((yyvsp[-2].numval).val.dblval ? (yyvsp[0].numval) : (yyvsp[-2].numval)); break;
}
} else {
- DO_LOGOP(exprobj, (yyval.numval),&&,(yyvsp[(1) - (3)].numval),(yyvsp[(3) - (3)].numval));
+ DO_LOGOP(exprobj, (yyval.numval),&&,(yyvsp[-2].numval),(yyvsp[0].numval));
}
}
+#line 1593 "y.tab.c" /* yacc.c:1648 */
break;
case 21:
-
-/* Line 1455 of yacc.c */
-#line 200 "expr.y"
- { DO_CMPOP(exprobj, (yyval.numval),>=,(yyvsp[(1) - (3)].numval),(yyvsp[(3) - (3)].numval)); }
+#line 200 "expr.y" /* yacc.c:1648 */
+ { DO_CMPOP(exprobj, (yyval.numval),>=,(yyvsp[-2].numval),(yyvsp[0].numval)); }
+#line 1599 "y.tab.c" /* yacc.c:1648 */
break;
case 22:
-
-/* Line 1455 of yacc.c */
-#line 201 "expr.y"
- { DO_CMPOP(exprobj, (yyval.numval),<=,(yyvsp[(1) - (3)].numval),(yyvsp[(3) - (3)].numval)); }
+#line 201 "expr.y" /* yacc.c:1648 */
+ { DO_CMPOP(exprobj, (yyval.numval),<=,(yyvsp[-2].numval),(yyvsp[0].numval)); }
+#line 1605 "y.tab.c" /* yacc.c:1648 */
break;
case 23:
-
-/* Line 1455 of yacc.c */
-#line 202 "expr.y"
- { DO_CMPOP(exprobj, (yyval.numval),!=,(yyvsp[(1) - (3)].numval),(yyvsp[(3) - (3)].numval)); }
+#line 202 "expr.y" /* yacc.c:1648 */
+ { DO_CMPOP(exprobj, (yyval.numval),!=,(yyvsp[-2].numval),(yyvsp[0].numval)); }
+#line 1611 "y.tab.c" /* yacc.c:1648 */
break;
case 24:
-
-/* Line 1455 of yacc.c */
-#line 203 "expr.y"
- { DO_CMPOP(exprobj, (yyval.numval),==,(yyvsp[(1) - (3)].numval),(yyvsp[(3) - (3)].numval)); }
+#line 203 "expr.y" /* yacc.c:1648 */
+ { DO_CMPOP(exprobj, (yyval.numval),==,(yyvsp[-2].numval),(yyvsp[0].numval)); }
+#line 1617 "y.tab.c" /* yacc.c:1648 */
break;
case 25:
-
-/* Line 1455 of yacc.c */
-#line 204 "expr.y"
- { DO_CMPOP(exprobj, (yyval.numval),>,(yyvsp[(1) - (3)].numval),(yyvsp[(3) - (3)].numval)); }
+#line 204 "expr.y" /* yacc.c:1648 */
+ { DO_CMPOP(exprobj, (yyval.numval),>,(yyvsp[-2].numval),(yyvsp[0].numval)); }
+#line 1623 "y.tab.c" /* yacc.c:1648 */
break;
case 26:
-
-/* Line 1455 of yacc.c */
-#line 205 "expr.y"
- { DO_CMPOP(exprobj, (yyval.numval),<,(yyvsp[(1) - (3)].numval),(yyvsp[(3) - (3)].numval)); }
+#line 205 "expr.y" /* yacc.c:1648 */
+ { DO_CMPOP(exprobj, (yyval.numval),<,(yyvsp[-2].numval),(yyvsp[0].numval)); }
+#line 1629 "y.tab.c" /* yacc.c:1648 */
break;
case 27:
-
-/* Line 1455 of yacc.c */
-#line 206 "expr.y"
- { DO_LOGOP1(exprobj, (yyval.numval),!,(yyvsp[(2) - (2)].numval)); }
+#line 206 "expr.y" /* yacc.c:1648 */
+ { DO_LOGOP1(exprobj, (yyval.numval),!,(yyvsp[0].numval)); }
+#line 1635 "y.tab.c" /* yacc.c:1648 */
break;
case 28:
-
-/* Line 1455 of yacc.c */
-#line 207 "expr.y"
- { DO_LOGOP1(exprobj, (yyval.numval),!,(yyvsp[(2) - (2)].numval)); }
+#line 207 "expr.y" /* yacc.c:1648 */
+ { DO_LOGOP1(exprobj, (yyval.numval),!,(yyvsp[0].numval)); }
+#line 1641 "y.tab.c" /* yacc.c:1648 */
break;
case 29:
-
-/* Line 1455 of yacc.c */
-#line 208 "expr.y"
- { (yyval.numval) = (yyvsp[(2) - (3)].numval); }
+#line 208 "expr.y" /* yacc.c:1648 */
+ { (yyval.numval) = (yyvsp[-1].numval); }
+#line 1647 "y.tab.c" /* yacc.c:1648 */
break;
case 30:
-
-/* Line 1455 of yacc.c */
-#line 209 "expr.y"
+#line 209 "expr.y" /* yacc.c:1648 */
{
- expr_to_str(state, &(yyvsp[(1) - (3)].numval),&(yyvsp[(3) - (3)].numval));
- (yyval.numval).type=EXPR_TYPE_INT; (yyval.numval).val.intval = pstring_ge ((yyvsp[(1) - (3)].numval).val.strval,(yyvsp[(3) - (3)].numval).val.strval)-pstring_le ((yyvsp[(1) - (3)].numval).val.strval,(yyvsp[(3) - (3)].numval).val.strval);
+ expr_to_str(state, &(yyvsp[-2].numval),&(yyvsp[0].numval));
+ (yyval.numval).type=EXPR_TYPE_INT; (yyval.numval).val.intval = pstring_ge ((yyvsp[-2].numval).val.strval,(yyvsp[0].numval).val.strval)-pstring_le ((yyvsp[-2].numval).val.strval,(yyvsp[0].numval).val.strval);
}
+#line 1656 "y.tab.c" /* yacc.c:1648 */
break;
case 31:
-
-/* Line 1455 of yacc.c */
-#line 213 "expr.y"
- { DO_TXTOP((yyval.numval),pstring_ge,(yyvsp[(1) - (3)].numval),(yyvsp[(3) - (3)].numval),state);}
+#line 213 "expr.y" /* yacc.c:1648 */
+ { DO_TXTOP((yyval.numval),pstring_ge,(yyvsp[-2].numval),(yyvsp[0].numval),state);}
+#line 1662 "y.tab.c" /* yacc.c:1648 */
break;
case 32:
-
-/* Line 1455 of yacc.c */
-#line 214 "expr.y"
- { DO_TXTOP((yyval.numval),pstring_le,(yyvsp[(1) - (3)].numval),(yyvsp[(3) - (3)].numval),state);}
+#line 214 "expr.y" /* yacc.c:1648 */
+ { DO_TXTOP((yyval.numval),pstring_le,(yyvsp[-2].numval),(yyvsp[0].numval),state);}
+#line 1668 "y.tab.c" /* yacc.c:1648 */
break;
case 33:
-
-/* Line 1455 of yacc.c */
-#line 215 "expr.y"
- { DO_TXTOP((yyval.numval),pstring_ne,(yyvsp[(1) - (3)].numval),(yyvsp[(3) - (3)].numval),state);}
+#line 215 "expr.y" /* yacc.c:1648 */
+ { DO_TXTOP((yyval.numval),pstring_ne,(yyvsp[-2].numval),(yyvsp[0].numval),state);}
+#line 1674 "y.tab.c" /* yacc.c:1648 */
break;
case 34:
-
-/* Line 1455 of yacc.c */
-#line 216 "expr.y"
- { DO_TXTOP((yyval.numval),pstring_eq,(yyvsp[(1) - (3)].numval),(yyvsp[(3) - (3)].numval),state);}
+#line 216 "expr.y" /* yacc.c:1648 */
+ { DO_TXTOP((yyval.numval),pstring_eq,(yyvsp[-2].numval),(yyvsp[0].numval),state);}
+#line 1680 "y.tab.c" /* yacc.c:1648 */
break;
case 35:
-
-/* Line 1455 of yacc.c */
-#line 217 "expr.y"
- { DO_TXTOP((yyval.numval),pstring_gt,(yyvsp[(1) - (3)].numval),(yyvsp[(3) - (3)].numval),state);}
+#line 217 "expr.y" /* yacc.c:1648 */
+ { DO_TXTOP((yyval.numval),pstring_gt,(yyvsp[-2].numval),(yyvsp[0].numval),state);}
+#line 1686 "y.tab.c" /* yacc.c:1648 */
break;
case 36:
-
-/* Line 1455 of yacc.c */
-#line 218 "expr.y"
- { DO_TXTOP((yyval.numval),pstring_lt,(yyvsp[(1) - (3)].numval),(yyvsp[(3) - (3)].numval),state);}
+#line 218 "expr.y" /* yacc.c:1648 */
+ { DO_TXTOP((yyval.numval),pstring_lt,(yyvsp[-2].numval),(yyvsp[0].numval),state);}
+#line 1692 "y.tab.c" /* yacc.c:1648 */
break;
case 37:
-
-/* Line 1455 of yacc.c */
-#line 219 "expr.y"
- { DO_TXTOPLOG((yyval.numval),re_like,(yyvsp[(1) - (3)].numval),(yyvsp[(3) - (3)].numval),exprobj);}
+#line 219 "expr.y" /* yacc.c:1648 */
+ { DO_TXTOPLOG((yyval.numval),re_like,(yyvsp[-2].numval),(yyvsp[0].numval),exprobj);}
+#line 1698 "y.tab.c" /* yacc.c:1648 */
break;
case 38:
-
-/* Line 1455 of yacc.c */
-#line 220 "expr.y"
- { DO_TXTOPLOG((yyval.numval),re_notlike,(yyvsp[(1) - (3)].numval),(yyvsp[(3) - (3)].numval),exprobj);}
+#line 220 "expr.y" /* yacc.c:1648 */
+ { DO_TXTOPLOG((yyval.numval),re_notlike,(yyvsp[-2].numval),(yyvsp[0].numval),exprobj);}
+#line 1704 "y.tab.c" /* yacc.c:1648 */
break;
case 39:
-
-/* Line 1455 of yacc.c */
-#line 223 "expr.y"
+#line 223 "expr.y" /* yacc.c:1648 */
{
- (yyvsp[(1) - (3)].extfunc).arglist=state->param->InitExprArglistFuncPtr(state->param->expr_func_map);
- pusharg_expr_userfunc(exprobj,state->param,(yyvsp[(1) - (3)].extfunc),(yyvsp[(3) - (3)].numval));
- (yyval.extfunc) = (yyvsp[(1) - (3)].extfunc);
+ (yyvsp[-2].extfunc).arglist=state->param->InitExprArglistFuncPtr(state->param->expr_func_map);
+ pusharg_expr_userfunc(exprobj,state->param,(yyvsp[-2].extfunc),(yyvsp[0].numval));
+ (yyval.extfunc) = (yyvsp[-2].extfunc);
}
+#line 1714 "y.tab.c" /* yacc.c:1648 */
break;
case 40:
-
-/* Line 1455 of yacc.c */
-#line 228 "expr.y"
- { pusharg_expr_userfunc(exprobj,state->param,(yyvsp[(1) - (3)].extfunc),(yyvsp[(3) - (3)].numval)); (yyval.extfunc) = (yyvsp[(1) - (3)].extfunc); }
+#line 228 "expr.y" /* yacc.c:1648 */
+ { pusharg_expr_userfunc(exprobj,state->param,(yyvsp[-2].extfunc),(yyvsp[0].numval)); (yyval.extfunc) = (yyvsp[-2].extfunc); }
+#line 1720 "y.tab.c" /* yacc.c:1648 */
break;
-
-/* Line 1455 of yacc.c */
-#line 1910 "y.tab.c"
+#line 1724 "y.tab.c" /* yacc.c:1648 */
default: break;
}
+ /* User semantic actions sometimes alter yychar, and that requires
+ that yytoken be updated with the new translation. We take the
+ approach of translating immediately before every use of yytoken.
+ One alternative is translating here after every semantic action,
+ but that translation would be missed if the semantic action invokes
+ YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
+ if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
+ incorrect destructor might then be invoked immediately. In the
+ case of YYERROR or YYBACKUP, subsequent parser actions might lead
+ to an incorrect destructor call or verbose syntax error message
+ before the lookahead is translated. */
YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
YYPOPSTACK (yylen);
@@ -1917,7 +1742,7 @@ yyreduce:
*++yyvsp = yyval;
- /* Now `shift' the result of the reduction. Determine what state
+ /* Now 'shift' the result of the reduction. Determine what state
that goes to, based on the state we popped back to and the rule
number reduced by. */
@@ -1932,10 +1757,14 @@ yyreduce:
goto yynewstate;
-/*------------------------------------.
-| yyerrlab -- here on detecting error |
-`------------------------------------*/
+/*--------------------------------------.
+| yyerrlab -- here on detecting error. |
+`--------------------------------------*/
yyerrlab:
+ /* Make sure we have latest lookahead translation. See comments at
+ user semantic actions for why this is necessary. */
+ yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
+
/* If not already recovering from an error, report this error. */
if (!yyerrstatus)
{
@@ -1943,37 +1772,36 @@ yyerrlab:
#if ! YYERROR_VERBOSE
yyerror (state, exprobj, expr_retval_ptr, YY_("syntax error"));
#else
+# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
+ yyssp, yytoken)
{
- YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
- if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
- {
- YYSIZE_T yyalloc = 2 * yysize;
- if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
- yyalloc = YYSTACK_ALLOC_MAXIMUM;
- if (yymsg != yymsgbuf)
- YYSTACK_FREE (yymsg);
- yymsg = (char *) YYSTACK_ALLOC (yyalloc);
- if (yymsg)
- yymsg_alloc = yyalloc;
- else
- {
- yymsg = yymsgbuf;
- yymsg_alloc = sizeof yymsgbuf;
- }
- }
-
- if (0 < yysize && yysize <= yymsg_alloc)
- {
- (void) yysyntax_error (yymsg, yystate, yychar);
- yyerror (state, exprobj, expr_retval_ptr, yymsg);
- }
- else
- {
- yyerror (state, exprobj, expr_retval_ptr, YY_("syntax error"));
- if (yysize != 0)
- goto yyexhaustedlab;
- }
+ char const *yymsgp = YY_("syntax error");
+ int yysyntax_error_status;
+ yysyntax_error_status = YYSYNTAX_ERROR;
+ if (yysyntax_error_status == 0)
+ yymsgp = yymsg;
+ else if (yysyntax_error_status == 1)
+ {
+ if (yymsg != yymsgbuf)
+ YYSTACK_FREE (yymsg);
+ yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
+ if (!yymsg)
+ {
+ yymsg = yymsgbuf;
+ yymsg_alloc = sizeof yymsgbuf;
+ yysyntax_error_status = 2;
+ }
+ else
+ {
+ yysyntax_error_status = YYSYNTAX_ERROR;
+ yymsgp = yymsg;
+ }
+ }
+ yyerror (state, exprobj, expr_retval_ptr, yymsgp);
+ if (yysyntax_error_status == 2)
+ goto yyexhaustedlab;
}
+# undef YYSYNTAX_ERROR
#endif
}
@@ -1982,20 +1810,20 @@ yyerrlab:
if (yyerrstatus == 3)
{
/* If just tried and failed to reuse lookahead token after an
- error, discard it. */
+ error, discard it. */
if (yychar <= YYEOF)
- {
- /* Return failure if at end of input. */
- if (yychar == YYEOF)
- YYABORT;
- }
+ {
+ /* Return failure if at end of input. */
+ if (yychar == YYEOF)
+ YYABORT;
+ }
else
- {
- yydestruct ("Error: discarding",
- yytoken, &yylval, state, exprobj, expr_retval_ptr);
- yychar = YYEMPTY;
- }
+ {
+ yydestruct ("Error: discarding",
+ yytoken, &yylval, state, exprobj, expr_retval_ptr);
+ yychar = YYEMPTY;
+ }
}
/* Else will try to reuse lookahead token after shifting the error
@@ -2014,7 +1842,7 @@ yyerrorlab:
if (/*CONSTCOND*/ 0)
goto yyerrorlab;
- /* Do not reclaim the symbols of the rule which action triggered
+ /* Do not reclaim the symbols of the rule whose action triggered
this YYERROR. */
YYPOPSTACK (yylen);
yylen = 0;
@@ -2027,35 +1855,37 @@ yyerrorlab:
| yyerrlab1 -- common code for both syntax error and YYERROR. |
`-------------------------------------------------------------*/
yyerrlab1:
- yyerrstatus = 3; /* Each real token shifted decrements this. */
+ yyerrstatus = 3; /* Each real token shifted decrements this. */
for (;;)
{
yyn = yypact[yystate];
- if (yyn != YYPACT_NINF)
- {
- yyn += YYTERROR;
- if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
- {
- yyn = yytable[yyn];
- if (0 < yyn)
- break;
- }
- }
+ if (!yypact_value_is_default (yyn))
+ {
+ yyn += YYTERROR;
+ if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
+ {
+ yyn = yytable[yyn];
+ if (0 < yyn)
+ break;
+ }
+ }
/* Pop the current state because it cannot handle the error token. */
if (yyssp == yyss)
- YYABORT;
+ YYABORT;
yydestruct ("Error: popping",
- yystos[yystate], yyvsp, state, exprobj, expr_retval_ptr);
+ yystos[yystate], yyvsp, state, exprobj, expr_retval_ptr);
YYPOPSTACK (1);
yystate = *yyssp;
YY_STACK_PRINT (yyss, yyssp);
}
+ YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
*++yyvsp = yylval;
+ YY_IGNORE_MAYBE_UNINITIALIZED_END
/* Shift the error token. */
@@ -2079,7 +1909,7 @@ yyabortlab:
yyresult = 1;
goto yyreturn;
-#if !defined(yyoverflow) || YYERROR_VERBOSE
+#if !defined yyoverflow || YYERROR_VERBOSE
/*-------------------------------------------------.
| yyexhaustedlab -- memory exhaustion comes here. |
`-------------------------------------------------*/
@@ -2091,16 +1921,21 @@ yyexhaustedlab:
yyreturn:
if (yychar != YYEMPTY)
- yydestruct ("Cleanup: discarding lookahead",
- yytoken, &yylval, state, exprobj, expr_retval_ptr);
- /* Do not reclaim the symbols of the rule which action triggered
+ {
+ /* Make sure we have latest lookahead translation. See comments at
+ user semantic actions for why this is necessary. */
+ yytoken = YYTRANSLATE (yychar);
+ yydestruct ("Cleanup: discarding lookahead",
+ yytoken, &yylval, state, exprobj, expr_retval_ptr);
+ }
+ /* Do not reclaim the symbols of the rule whose action triggered
this YYABORT or YYACCEPT. */
YYPOPSTACK (yylen);
YY_STACK_PRINT (yyss, yyssp);
while (yyssp != yyss)
{
yydestruct ("Cleanup: popping",
- yystos[*yyssp], yyvsp, state, exprobj, expr_retval_ptr);
+ yystos[*yyssp], yyvsp, state, exprobj, expr_retval_ptr);
YYPOPSTACK (1);
}
#ifndef yyoverflow
@@ -2111,14 +1946,9 @@ yyreturn:
if (yymsg != yymsgbuf)
YYSTACK_FREE (yymsg);
#endif
- /* Make sure YYID is used. */
- return YYID (yyresult);
+ return yyresult;
}
-
-
-
-/* Line 1675 of yacc.c */
-#line 232 "expr.y"
+#line 232 "expr.y" /* yacc.c:1907 */
/* Called by yyparse on error. */
@@ -2132,9 +1962,6 @@ yyerror (struct tmplpro_state* state, struct expr_parser* exprobj, PSTRING* expr
static
const symrec_const
-#ifndef __cplusplus
-const
-#endif
builtin_funcs_symrec[] =
{
/* built-in funcs */
@@ -2160,9 +1987,6 @@ builtin_funcs_symrec[] =
static
const symrec_const
-#ifndef __cplusplus
-const
-#endif
builtin_ops_symrec[] =
{
/* built-in ops */
@@ -2393,4 +2217,3 @@ pusharg_expr_userfunc(struct expr_parser* exprobj, struct tmplpro_param* param,
#include "exprtool.inc"
#include "exprpstr.inc"
-
diff --git a/expr.y b/expr.y
index 4619c4d..e5f8e9f 100644
--- a/expr.y
+++ b/expr.y
@@ -242,9 +242,6 @@ yyerror (struct tmplpro_state* state, struct expr_parser* exprobj, PSTRING* expr
static
const symrec_const
-#ifndef __cplusplus
-const
-#endif
builtin_funcs_symrec[] =
{
/* built-in funcs */
@@ -270,9 +267,6 @@ builtin_funcs_symrec[] =
static
const symrec_const
-#ifndef __cplusplus
-const
-#endif
builtin_ops_symrec[] =
{
/* built-in ops */
diff --git a/exprpstr.inc b/exprpstr.inc
index 6ada94a..d5a0ad8 100644
--- a/exprpstr.inc
+++ b/exprpstr.inc
@@ -121,14 +121,58 @@ re_notlike(struct expr_parser* exprobj, PSTRING a, PSTRING b) {
return ! re_like(exprobj, a,b);
}
-#ifndef HAVE_PCRE
+#ifdef HAVE_PCRE2
+/* https://github.com/luvit/pcre2/blob/master/src/pcre2demo.c */
+#define PCRE2_CODE_UNIT_WIDTH 8
+#include <pcre2.h>
static
-int
+int
re_like(struct expr_parser* exprobj, PSTRING a, PSTRING b) {
- log_expr(exprobj,TMPL_LOG_ERROR,"can't parse the regular expression (sorry, Stanislav Yadykin regexp extension is disabled at compile time) \n");
- return 0;
+ pcre2_code* re;
+ int rc, errornumber;
+ PCRE2_SIZE erroroffset;
+ PCRE2_SPTR subject=(PCRE2_SPTR)a.begin;
+ size_t subject_length=(a.endnext-a.begin);
+ char* pattern;
+ pcre2_match_data *match_data;
+ if (subject==NULL) {
+ log_expr(exprobj,TMPL_LOG_INFO, "regular expression: applied to undefined value.\n");
+ return 0;
+ }
+ if (b.begin==NULL || (b.endnext-b.begin)==0) {
+ log_expr(exprobj,TMPL_LOG_INFO, "regular expression: the pattern is empty or undefined.\n");
+ return 1;
+ }
+ pattern=(char*)malloc(b.endnext-b.begin);
+ if (pattern==NULL) {
+ log_expr(exprobj,TMPL_LOG_ERROR, "regular expression: memory allocation failed.\n");
+ return 0;
+ }
+ strncpy(pattern, b.begin, (b.endnext-b.begin));
+ *(pattern+(b.endnext-b.begin))=0;
+ re = pcre2_compile((PCRE2_SPTR)pattern,PCRE2_ZERO_TERMINATED,0,&errornumber,&erroroffset,NULL);
+ free(pattern);
+ if (re==NULL) {
+ PCRE2_UCHAR buffer[256];
+ pcre2_get_error_message(errornumber, buffer, sizeof(buffer));
+ log_expr(exprobj,TMPL_LOG_ERROR, "regular expression: PCRE2 compilation failed at offset %zd: %s\n",
+ erroroffset, buffer);
+ return 0;
+ }
+ match_data = pcre2_match_data_create_from_pattern(re, NULL);
+ rc = pcre2_match(re,subject,subject_length,0,0,match_data,NULL);
+ /* Matching failed: handle error cases */
+ if(rc<0 && PCRE2_ERROR_NOMATCH != rc) {
+ PCRE2_UCHAR buffer[256];
+ pcre2_get_error_message(errornumber, buffer, sizeof(buffer));
+ log_expr(exprobj,TMPL_LOG_ERROR, "regular expression: PCRE2 reported run error %d: %s\n",errornumber, buffer);
+ }
+ pcre2_match_data_free(match_data); /* Release memory used for the match */
+ pcre2_code_free(re); /* data and the compiled pattern. */
+ return (rc<0)?0:1;
}
#else
+#ifdef HAVE_PCRE
#include <pcre.h>
static
int
@@ -165,4 +209,12 @@ re_like(struct expr_parser* exprobj, PSTRING a, PSTRING b) {
rc=pcre_exec(re, NULL, subject, subject_length, 0, 0, ovector, 30);
return (rc<0)?0:1;
}
+#else
+static
+int
+re_like(struct expr_parser* exprobj, PSTRING a, PSTRING b) {
+ log_expr(exprobj,TMPL_LOG_ERROR,"can't parse the regular expression (sorry, Stanislav Yadykin regexp extension is disabled at compile time) \n");
+ return 0;
+}
+#endif
#endif
diff --git a/lib/HTML/Template/Pro.pm b/lib/HTML/Template/Pro.pm
index 06ccce8..9dce5c2 100644
--- a/lib/HTML/Template/Pro.pm
+++ b/lib/HTML/Template/Pro.pm
@@ -12,7 +12,7 @@ require Exporter;
use vars qw($VERSION @ISA @EXPORT_OK %EXPORT_TAGS);
@ISA = qw(DynaLoader Exporter);
-$VERSION = '0.9510';
+$VERSION = '0.9521';
@EXPORT_OK = qw/ASK_NAME_DEFAULT ASK_NAME_AS_IS ASK_NAME_LOWERCASE ASK_NAME_UPPERCASE ASK_NAME_MASK/;
%EXPORT_TAGS = (const => [qw/ASK_NAME_DEFAULT ASK_NAME_AS_IS ASK_NAME_LOWERCASE ASK_NAME_UPPERCASE ASK_NAME_MASK/]);
diff --git a/perl-HTML-Template-Pro.spec b/perl-HTML-Template-Pro.spec
index 5b0774d..77da5cf 100644
--- a/perl-HTML-Template-Pro.spec
+++ b/perl-HTML-Template-Pro.spec
@@ -6,30 +6,29 @@
%define module HTML-Template-Pro
Name: perl-%module
-Version: 0.9510
+Version: 0.9521
Release: alt1
Packager: Igor Yu. Vlasenko <viy@altlinux.org>
Summary: Perl+C/XS module to produce HTML from HTML Template files.
Group: Development/Perl
-License: LGPL2+ or Artistic
+License: LGPLv2+ or Artistic-2.0
#Source: http://www.cpan.org/modules/by-module/HTML/%module-%version.tar.gz
Source: %module-%version.tar.gz
Url: http://sourceforge.net/projects/html-tmpl-pro/
-# Automatically added by buildreq on Wed Nov 06 2002
-BuildRequires: perl-devel pcre libpcre-devel perl-JSON perl-JSON-XS perl-Test-Pod
+BuildRequires: perl-devel libpcre2-devel perl-JSON perl-JSON-XS perl-Test-Pod
%description
HTML::Template::Pro is a fast lightweight C/Perl+XS reimplementation
-of HTML::Template and HTML::Template::Expr. It is not intended
-to be a complete replacement, but to be a fast implementation
+of HTML::Template and HTML::Template::Expr. It is not intended
+to be a complete replacement, but to be a fast implementation
of HTML::Template if you don't need quering, the extended facility
-of HTML::Template.
+of HTML::Template.
Designed for heavy upload, resource limitations, abcence of mod_perl.
-HTML::Template module attempts make using HTML templates simple and natural.
+HTML::Template module attempts make using HTML templates simple and natural.
It extends standard HTML with a few new HTML-esque tags - <TMPL_VAR>,
<TMPL_LOOP>, <TMPL_INCLUDE>, <TMPL_IF> and <TMPL_ELSE>. The file
written with HTML and these new tags is called a template. It is
@@ -54,9 +53,36 @@ in the Perl script.
#perl_vendor_man3dir/*
%changelog
+* Thu Dec 02 2021 Igor Vlasenko <viy@altlinux.org> 0.9521-alt1
+- new version; see Changes
+
+* Wed Dec 01 2021 Igor Vlasenko <viy@altlinux.org> 0.9520-alt1
+- new version; see Changes
+
+* Thu Jan 24 2019 Igor Vlasenko <viy@altlinux.ru> 0.9510-alt2.2
+- rebuild with new perl 5.28.1
+
+* Fri Dec 15 2017 Igor Vlasenko <viy@altlinux.ru> 0.9510-alt2.1.1.1.1
+- rebuild with new perl 5.26.1
+
+* Fri Feb 03 2017 Igor Vlasenko <viy@altlinux.ru> 0.9510-alt2.1.1.1
+- rebuild with new perl 5.24.1
+
+* Wed Nov 25 2015 Igor Vlasenko <viy@altlinux.ru> 0.9510-alt2.1.1
+- rebuild with new perl 5.22.0
+
+* Tue Dec 09 2014 Igor Vlasenko <viy@altlinux.ru> 0.9510-alt2.1
+- rebuild with new perl 5.20.1
+
+* Thu Aug 29 2013 Vladimir Lettiev <crux@altlinux.ru> 0.9510-alt2
+- built for perl 5.18
+
* Mon May 13 2013 Igor Vlasenko <viy@altlinux.ru> 0.9510-alt1
- new version; see Changes
+* Sun Sep 02 2012 Vladimir Lettiev <crux@altlinux.ru> 0.9509-alt2
+- rebuilt for perl-5.16
+
* Tue Feb 28 2012 Igor Vlasenko <viy@altlinux.ru> 0.9509-alt1
- new version; see Changes
diff --git a/procore.c b/procore.c
index 19c1ea9..72a9c7a 100644
--- a/procore.c
+++ b/procore.c
@@ -60,7 +60,7 @@ static const char* const TAGOPT[]={"NAME", "EXPR", "ESCAPE", "DEFAULT" };
#include "prostate.inc"
#include "tags.inc"
-static const char const tag_can_be_closed[]={
+static const char tag_can_be_closed[]={
1 /*Bad or unsupported tag*/,
0 /*VAR*/,
0 /*INCLUDE*/,
@@ -72,7 +72,7 @@ static const char const tag_can_be_closed[]={
0 /**/,
};
-static const char const tag_has_opt[][6]={
+static const char tag_has_opt[][6]={
/* "name", "expr", "escape", "default", todo, todo */
{ 0, 0, 0, 0, 0, 0 }, /*Bad or unsupported tag*/
@@ -88,7 +88,7 @@ static const char const tag_has_opt[][6]={
typedef void (*tag_handler_func)(struct tmplpro_state *state, const PSTRING* const TagOptVal);
-static const tag_handler_func const output_closetag_handler[]={
+static const tag_handler_func output_closetag_handler[]={
tag_handler_unknown, /*Bad or unsupported tag*/
tag_handler_unknown, /*VAR*/
tag_handler_unknown, /*INCLUDE*/
@@ -99,7 +99,7 @@ static const tag_handler_func const output_closetag_handler[]={
tag_handler_unknown, /*ELSIF*/
tag_handler_unknown, /**/
};
-static const tag_handler_func const output_opentag_handler[]={
+static const tag_handler_func output_opentag_handler[]={
tag_handler_unknown, /*Bad or unsupported tag*/
tag_handler_var, /*VAR*/
tag_handler_include, /*INCLUDE*/
@@ -460,6 +460,7 @@ tmplpro_exec_tmpl_filename (struct tmplpro_param *param, const char* filename)
/* destroying */
if (param->filters) mmapstatus=(param->UnloadFileFuncPtr)(param->ext_filter_state,memarea);
else mmapstatus=mmap_unload_file(memarea);
+ if (mmapstatus && debuglevel) log_state(&state,TMPL_LOG_DEBUG, "exec_tmpl: unloading %s caused munmap error\n",filename);
cleanup_filepath:
if (filepath!=NULL) free((void*) filepath);
param->masterpath=saved_masterpath;
diff --git a/prostate.inc b/prostate.inc
index 18d316e..9ade626 100644
--- a/prostate.inc
+++ b/prostate.inc
@@ -4,7 +4,7 @@
TMPLPRO_LOCAL void log_state(struct tmplpro_state* state, int level, const char *fmt, ...)
{
va_list vl;
- char* masterpath=state->param->masterpath;
+ const char* masterpath=state->param->masterpath;
va_start(vl, fmt);
tmpl_log(level, "HTML::Template::Pro:");
if (masterpath != NULL) {
diff --git a/pstrutils.inc b/pstrutils.inc
index 1f53ef7..d9eb77f 100644
--- a/pstrutils.inc
+++ b/pstrutils.inc
@@ -155,15 +155,17 @@ urlencode_pstring (pbuffer* StrBuffer, PSTRING pstring) {
buf=pbuffer_resize(StrBuffer, 2*(offset+MAX_ESCAPE_SEQ));
buflen=pbuffer_size(StrBuffer);
}
- /*
+ /*
* # do the translation (RFC 2396 ^uric)
* s!([^a-zA-Z0-9_.\-])!sprintf('%%%02X', $_)
+ * note that \- above means -, not '\\' + '-', and '\\' should not be urlencoded.
+ * https://rt.cpan.org/Ticket/Display.html?id=109255
*/
if ((curchar>='a' && curchar<='z') ||
(curchar>='A' && curchar<='Z') ||
(curchar>='0' && curchar<='9') ||
- curchar=='_' || curchar=='.' || curchar=='\\' || curchar=='-'
- )
+ curchar=='_' || curchar=='.' || curchar=='-'
+ )
*(buf+offset)=curchar;
else {
bufdelta=3; sprintf(buf+offset,"%%%.2X",(int) curchar);
diff --git a/templates-Pro/test_esc2.out b/templates-Pro/test_esc2.out
index 5cf7f02..7c2d38b 100644
--- a/templates-Pro/test_esc2.out
+++ b/templates-Pro/test_esc2.out
@@ -1,5 +1,5 @@
<H1> test_esc2 </H1>
- %26foo%22bar%27%3C%2Fscript%3E%3D-%3B%2B%20\%3C%3E%22%3B%20%25FAhidden%3A%0D%0Aend
+ %26foo%22bar%27%3C%2Fscript%3E%3D-%3B%2B%20%5C%3C%3E%22%3B%20%25FAhidden%3A%0D%0Aend
Some%22%27%20Txt%27
diff --git a/templates-Pro/test_var3.out b/templates-Pro/test_var3.out
index 44f9519..2f912af 100644
--- a/templates-Pro/test_var3.out
+++ b/templates-Pro/test_var3.out
@@ -3,7 +3,7 @@
&foo"bar'</script>=-;+ \<>"; %FAhidden:
end
- %26foo%22bar%27%3C%2Fscript%3E%3D-%3B%2B%20\%3C%3E%22%3B%20%25FAhidden%3A%0D%0Aend
+ %26foo%22bar%27%3C%2Fscript%3E%3D-%3B%2B%20%5C%3C%3E%22%3B%20%25FAhidden%3A%0D%0Aend
&amp;foo&quot;bar&#39;&lt;/script&gt;=-;+ \&lt;&gt;&quot;; %FAhidden:
end