summaryrefslogtreecommitdiff
path: root/parse.c
diff options
context:
space:
mode:
authorManoj Srivastava <srivasta@golden-gryphon.com>2014-04-09 00:15:48 -0700
committerManoj Srivastava <srivasta@golden-gryphon.com>2014-04-09 00:15:48 -0700
commit26bb2525c89ecda0b0bc7b597ec8d1b792fc8662 (patch)
treeb2ecc519218e259a4fb5e5f0a72b7e00bc3a2b43 /parse.c
parentada7779d8b7a39d01dd70d733883db2383e61a6e (diff)
Imported Upstream version 2.5.39
Diffstat (limited to 'parse.c')
-rw-r--r--parse.c1751
1 files changed, 1071 insertions, 680 deletions
diff --git a/parse.c b/parse.c
index fc128f9..2b454f3 100644
--- a/parse.c
+++ b/parse.c
@@ -1,30 +1,37 @@
-/* A Bison parser, made by GNU Bison 2.1. */
+/* A Bison parser, made by GNU Bison 2.5. */
-/* Skeleton parser for Yacc-like parsing with Bison,
- Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
+/* Bison implementation for Yacc-like parsers in C
+
+ Copyright (C) 1984, 1989-1990, 2000-2011 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 2, or (at your option)
- any later version.
-
+ 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, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA. */
-
-/* As a special exception, when this file is copied by Bison into a
- Bison output file, you may use that output file without restriction.
- This special exception was added by the Free Software Foundation
- in version 1.24 of Bison. */
-
-/* Written by Richard Stallman by simplifying the original so called
- ``semantic'' parser. */
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* As a special exception, you may create a larger work that contains
+ part or all of the Bison parser skeleton and distribute that work
+ under terms of your choice, so long as that work isn't itself a
+ parser generator using the skeleton or a modified version thereof
+ as a parser skeleton. Alternatively, if you modify or redistribute
+ the parser skeleton itself, you may (at your option) remove this
+ 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. */
+
+/* C LALR(1) parser skeleton written by Richard Stallman, by
+ simplifying the original so-called "semantic" parser. */
/* All symbols defined below should begin with yy or YY, to avoid
infringing on user name space. This should be done even for local
@@ -37,7 +44,7 @@
#define YYBISON 1
/* Bison version. */
-#define YYBISON_VERSION "2.1"
+#define YYBISON_VERSION "2.5"
/* Skeleton name. */
#define YYSKELETON_NAME "yacc.c"
@@ -45,11 +52,126 @@
/* Pure parsers. */
#define YYPURE 0
+/* Push parsers. */
+#define YYPUSH 0
+
+/* Pull parsers. */
+#define YYPULL 1
+
/* Using locations. */
#define YYLSP_NEEDED 0
+/* Copy the first part of user declarations. */
+
+/* Line 268 of yacc.c */
+#line 34 "parse.y"
+
+/* Copyright (c) 1990 The Regents of the University of California. */
+/* All rights reserved. */
+
+/* This code is derived from software contributed to Berkeley by */
+/* Vern Paxson. */
+
+/* The United States Government has rights in this work pursuant */
+/* to contract no. DE-AC03-76SF00098 between the United States */
+/* Department of Energy and the University of California. */
+
+/* This file is part of flex. */
+
+/* Redistribution and use in source and binary forms, with or without */
+/* modification, are permitted provided that the following conditions */
+/* are met: */
+
+/* 1. Redistributions of source code must retain the above copyright */
+/* notice, this list of conditions and the following disclaimer. */
+/* 2. Redistributions in binary form must reproduce the above copyright */
+/* notice, this list of conditions and the following disclaimer in the */
+/* documentation and/or other materials provided with the distribution. */
+
+/* Neither the name of the University nor the names of its contributors */
+/* may be used to endorse or promote products derived from this software */
+/* without specific prior written permission. */
+
+/* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR */
+/* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED */
+/* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR */
+/* PURPOSE. */
+
+#include "flexdef.h"
+#include "tables.h"
+
+int pat, scnum, eps, headcnt, trailcnt, lastchar, i, rulelen;
+int trlcontxt, xcluflg, currccl, cclsorted, varlength, variable_trail_rule;
+
+int *scon_stk;
+int scon_stk_ptr;
+
+static int madeany = false; /* whether we've made the '.' character class */
+static int ccldot, cclany;
+int previous_continued_action; /* whether the previous rule's action was '|' */
+
+#define format_warn3(fmt, a1, a2) \
+ do{ \
+ char fw3_msg[MAXLINE];\
+ snprintf( fw3_msg, MAXLINE,(fmt), (a1), (a2) );\
+ warn( fw3_msg );\
+ }while(0)
+
+/* Expand a POSIX character class expression. */
+#define CCL_EXPR(func) \
+ do{ \
+ int c; \
+ for ( c = 0; c < csize; ++c ) \
+ if ( isascii(c) && func(c) ) \
+ ccladd( currccl, c ); \
+ }while(0)
+
+/* negated class */
+#define CCL_NEG_EXPR(func) \
+ do{ \
+ int c; \
+ for ( c = 0; c < csize; ++c ) \
+ if ( !func(c) ) \
+ ccladd( currccl, c ); \
+ }while(0)
+
+/* While POSIX defines isblank(), it's not ANSI C. */
+#define IS_BLANK(c) ((c) == ' ' || (c) == '\t')
+
+/* On some over-ambitious machines, such as DEC Alpha's, the default
+ * token type is "long" instead of "int"; this leads to problems with
+ * declaring yylval in flexdef.h. But so far, all the yacc's I've seen
+ * wrap their definitions of YYSTYPE with "#ifndef YYSTYPE"'s, so the
+ * following should ensure that the default token type is "int".
+ */
+#define YYSTYPE int
+
+
+
+/* Line 268 of yacc.c */
+#line 155 "parse.c"
+
+/* Enabling traces. */
+#ifndef YYDEBUG
+# define YYDEBUG 0
+#endif
+
+/* Enabling verbose error messages. */
+#ifdef YYERROR_VERBOSE
+# undef YYERROR_VERBOSE
+# define YYERROR_VERBOSE 1
+#else
+# define YYERROR_VERBOSE 0
+#endif
+
+/* Enabling the token table. */
+#ifndef YYTOKEN_TABLE
+# define YYTOKEN_TABLE 0
+#endif
+
+
/* Tokens. */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
@@ -153,140 +275,69 @@
-/* Copy the first part of user declarations. */
-#line 34 "parse.y"
-
-/* Copyright (c) 1990 The Regents of the University of California. */
-/* All rights reserved. */
-
-/* This code is derived from software contributed to Berkeley by */
-/* Vern Paxson. */
-
-/* The United States Government has rights in this work pursuant */
-/* to contract no. DE-AC03-76SF00098 between the United States */
-/* Department of Energy and the University of California. */
-
-/* This file is part of flex. */
-
-/* Redistribution and use in source and binary forms, with or without */
-/* modification, are permitted provided that the following conditions */
-/* are met: */
-
-/* 1. Redistributions of source code must retain the above copyright */
-/* notice, this list of conditions and the following disclaimer. */
-/* 2. Redistributions in binary form must reproduce the above copyright */
-/* notice, this list of conditions and the following disclaimer in the */
-/* documentation and/or other materials provided with the distribution. */
-
-/* Neither the name of the University nor the names of its contributors */
-/* may be used to endorse or promote products derived from this software */
-/* without specific prior written permission. */
-
-/* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR */
-/* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED */
-/* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR */
-/* PURPOSE. */
-
-#include "flexdef.h"
-#include "tables.h"
-
-int pat, scnum, eps, headcnt, trailcnt, lastchar, i, rulelen;
-int trlcontxt, xcluflg, currccl, cclsorted, varlength, variable_trail_rule;
-
-int *scon_stk;
-int scon_stk_ptr;
-
-static int madeany = false; /* whether we've made the '.' character class */
-static int ccldot, cclany;
-int previous_continued_action; /* whether the previous rule's action was '|' */
-
-#define format_warn3(fmt, a1, a2) \
- do{ \
- char fw3_msg[MAXLINE];\
- snprintf( fw3_msg, MAXLINE,(fmt), (a1), (a2) );\
- warn( fw3_msg );\
- }while(0)
-
-/* Expand a POSIX character class expression. */
-#define CCL_EXPR(func) \
- do{ \
- int c; \
- for ( c = 0; c < csize; ++c ) \
- if ( isascii(c) && func(c) ) \
- ccladd( currccl, c ); \
- }while(0)
-
-/* negated class */
-#define CCL_NEG_EXPR(func) \
- do{ \
- int c; \
- for ( c = 0; c < csize; ++c ) \
- if ( !func(c) ) \
- ccladd( currccl, c ); \
- }while(0)
+#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
+typedef int YYSTYPE;
+# define YYSTYPE_IS_TRIVIAL 1
+# define yystype YYSTYPE /* obsolescent; will be withdrawn */
+# define YYSTYPE_IS_DECLARED 1
+#endif
-/* While POSIX defines isblank(), it's not ANSI C. */
-#define IS_BLANK(c) ((c) == ' ' || (c) == '\t')
-/* On some over-ambitious machines, such as DEC Alpha's, the default
- * token type is "long" instead of "int"; this leads to problems with
- * declaring yylval in flexdef.h. But so far, all the yacc's I've seen
- * wrap their definitions of YYSTYPE with "#ifndef YYSTYPE"'s, so the
- * following should ensure that the default token type is "int".
- */
-#define YYSTYPE int
+/* Copy the second part of user declarations. */
+/* Line 343 of yacc.c */
+#line 291 "parse.c"
-/* Enabling traces. */
-#ifndef YYDEBUG
-# define YYDEBUG 0
+#ifdef short
+# undef short
#endif
-/* Enabling verbose error messages. */
-#ifdef YYERROR_VERBOSE
-# undef YYERROR_VERBOSE
-# define YYERROR_VERBOSE 1
+#ifdef YYTYPE_UINT8
+typedef YYTYPE_UINT8 yytype_uint8;
#else
-# define YYERROR_VERBOSE 0
+typedef unsigned char yytype_uint8;
#endif
-/* Enabling the token table. */
-#ifndef YYTOKEN_TABLE
-# define YYTOKEN_TABLE 0
+#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;
#endif
-#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
-typedef int YYSTYPE;
-# define yystype YYSTYPE /* obsolescent; will be withdrawn */
-# define YYSTYPE_IS_DECLARED 1
-# define YYSTYPE_IS_TRIVIAL 1
+#ifdef YYTYPE_UINT16
+typedef YYTYPE_UINT16 yytype_uint16;
+#else
+typedef unsigned short int yytype_uint16;
#endif
-
-
-/* Copy the second part of user declarations. */
-
-
-/* Line 219 of yacc.c. */
-#line 273 "parse.c"
-
-#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
-# define YYSIZE_T __SIZE_TYPE__
-#endif
-#if ! defined (YYSIZE_T) && defined (size_t)
-# define YYSIZE_T size_t
-#endif
-#if ! defined (YYSIZE_T) && (defined (__STDC__) || defined (__cplusplus))
-# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
-# define YYSIZE_T size_t
+#ifdef YYTYPE_INT16
+typedef YYTYPE_INT16 yytype_int16;
+#else
+typedef short int yytype_int16;
#endif
-#if ! defined (YYSIZE_T)
-# define YYSIZE_T unsigned int
+
+#ifndef YYSIZE_T
+# ifdef __SIZE_TYPE__
+# 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)
+# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
+# define YYSIZE_T size_t
+# else
+# define YYSIZE_T unsigned int
+# endif
#endif
+#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)
@@ -297,7 +348,32 @@ typedef int YYSTYPE;
# endif
#endif
-#if ! defined (yyoverflow) || YYERROR_VERBOSE
+/* Suppress unused-variable warnings by "using" E. */
+#if ! defined lint || defined __GNUC__
+# define YYUSE(e) ((void) (e))
+#else
+# define YYUSE(e) /* empty */
+#endif
+
+/* Identity function, used to suppress warnings about constant conditions. */
+#ifndef lint
+# define YYID(n) (n)
+#else
+#if (defined __STDC__ || defined __C99__FUNC__ \
+ || defined __cplusplus || defined _MSC_VER)
+static int
+YYID (int yyi)
+#else
+static int
+YYID (yyi)
+ int yyi;
+#endif
+{
+ return yyi;
+}
+#endif
+
+#if ! defined yyoverflow || YYERROR_VERBOSE
/* The parser invokes alloca or malloc; define the necessary symbols. */
@@ -305,66 +381,78 @@ typedef int YYSTYPE;
# if YYSTACK_USE_ALLOCA
# ifdef __GNUC__
# define YYSTACK_ALLOC __builtin_alloca
+# elif defined __BUILTIN_VA_ARG_INCR
+# include <alloca.h> /* INFRINGES ON USER NAME SPACE */
+# elif defined _AIX
+# define YYSTACK_ALLOC __alloca
+# elif defined _MSC_VER
+# include <malloc.h> /* INFRINGES ON USER NAME SPACE */
+# define alloca _alloca
# else
# define YYSTACK_ALLOC alloca
-# if defined (__STDC__) || defined (__cplusplus)
+# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
+ || defined __cplusplus || defined _MSC_VER)
# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
-# define YYINCLUDED_STDLIB_H
+# ifndef EXIT_SUCCESS
+# define EXIT_SUCCESS 0
+# endif
# endif
# endif
# endif
# endif
# ifdef YYSTACK_ALLOC
- /* Pacify GCC's `empty if-body' warning. */
-# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
+ /* Pacify GCC's `empty if-body' warning. */
+# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (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
invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
to allow for a few compiler-allocated temporary stack slots. */
-# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2005 */
+# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
# endif
# else
# define YYSTACK_ALLOC YYMALLOC
# define YYSTACK_FREE YYFREE
# ifndef YYSTACK_ALLOC_MAXIMUM
-# define YYSTACK_ALLOC_MAXIMUM ((YYSIZE_T) -1)
+# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
# endif
-# ifdef __cplusplus
-extern "C" {
+# if (defined __cplusplus && ! defined EXIT_SUCCESS \
+ && ! ((defined YYMALLOC || defined malloc) \
+ && (defined YYFREE || defined free)))
+# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
+# ifndef EXIT_SUCCESS
+# define EXIT_SUCCESS 0
+# endif
# endif
# ifndef YYMALLOC
# define YYMALLOC malloc
-# if (! defined (malloc) && ! defined (YYINCLUDED_STDLIB_H) \
- && (defined (__STDC__) || defined (__cplusplus)))
+# if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
+ || defined __cplusplus || defined _MSC_VER)
void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
# endif
# endif
# ifndef YYFREE
# define YYFREE free
-# if (! defined (free) && ! defined (YYINCLUDED_STDLIB_H) \
- && (defined (__STDC__) || defined (__cplusplus)))
+# if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
+ || defined __cplusplus || defined _MSC_VER)
void free (void *); /* INFRINGES ON USER NAME SPACE */
# endif
# endif
-# ifdef __cplusplus
-}
-# endif
# endif
-#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
+#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
-#if (! defined (yyoverflow) \
- && (! defined (__cplusplus) \
- || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL)))
+#if (! defined yyoverflow \
+ && (! defined __cplusplus \
+ || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
/* A type that is properly aligned for any stack member. */
union yyalloc
{
- short int yyss;
- YYSTYPE yyvs;
- };
+ yytype_int16 yyss_alloc;
+ YYSTYPE yyvs_alloc;
+};
/* The size of the maximum gap between one aligned stack and the next. */
# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
@@ -372,63 +460,61 @@ union yyalloc
/* The size of an array large to enough to hold all stacks, each with
N elements. */
# define YYSTACK_BYTES(N) \
- ((N) * (sizeof (short int) + sizeof (YYSTYPE)) \
+ ((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 (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) \
+# define YYSTACK_RELOCATE(Stack_alloc, Stack) \
do \
{ \
YYSIZE_T yynewbytes; \
- YYCOPY (&yyptr->Stack, Stack, yysize); \
- Stack = &yyptr->Stack; \
+ YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
+ Stack = &yyptr->Stack_alloc; \
yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
yyptr += yynewbytes / sizeof (*yyptr); \
} \
- while (0)
+ while (YYID (0))
#endif
-#if defined (__STDC__) || defined (__cplusplus)
- typedef signed char yysigned_char;
-#else
- typedef short int yysigned_char;
-#endif
+#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
+/* 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
+#endif /* !YYCOPY_NEEDED */
-/* YYFINAL -- State number of the termination state. */
+/* YYFINAL -- State number of the termination state. */
#define YYFINAL 3
/* YYLAST -- Last index in YYTABLE. */
#define YYLAST 161
-/* YYNTOKENS -- Number of terminals. */
+/* YYNTOKENS -- Number of terminals. */
#define YYNTOKENS 69
-/* YYNNTS -- Number of nonterminals. */
+/* YYNNTS -- Number of nonterminals. */
#define YYNNTS 27
-/* YYNRULES -- Number of rules. */
+/* YYNRULES -- Number of rules. */
#define YYNRULES 97
-/* YYNRULES -- Number of states. */
+/* YYNRULES -- Number of states. */
#define YYNSTATES 140
/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
@@ -439,7 +525,7 @@ union yyalloc
((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
-static const unsigned char yytranslate[] =
+static const yytype_uint8 yytranslate[] =
{
0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
49, 2, 2, 2, 2, 2, 2, 2, 2, 2,
@@ -477,7 +563,7 @@ static const unsigned char yytranslate[] =
#if YYDEBUG
/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
YYRHS. */
-static const unsigned short int yyprhs[] =
+static const yytype_uint16 yyprhs[] =
{
0, 0, 3, 9, 10, 14, 17, 18, 20, 22,
24, 26, 29, 31, 33, 36, 39, 40, 44, 48,
@@ -491,8 +577,8 @@ static const unsigned short int yyprhs[] =
262, 264, 266, 268, 270, 272, 274, 277
};
-/* YYRHS -- A `-1'-separated list of the rules' RHS. */
-static const yysigned_char yyrhs[] =
+/* YYRHS -- A `-1'-separated list of the rules' RHS. */
+static const yytype_int8 yyrhs[] =
{
70, 0, -1, 71, 72, 73, 79, 80, -1, -1,
72, 74, 75, -1, 72, 76, -1, -1, 1, -1,
@@ -525,24 +611,24 @@ static const yysigned_char yyrhs[] =
};
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
-static const unsigned short int yyrline[] =
+static const yytype_uint16 yyrline[] =
{
0, 118, 118, 148, 155, 156, 157, 158, 162, 170,
173, 177, 180, 183, 187, 190, 191, 194, 199, 201,
203, 205, 207, 211, 213, 215, 219, 231, 267, 291,
314, 319, 322, 325, 343, 346, 348, 350, 354, 377,
433, 436, 479, 497, 503, 508, 535, 543, 546, 574,
- 588, 610, 617, 623, 629, 657, 671, 690, 724, 744,
- 754, 757, 760, 775, 776, 777, 782, 784, 791, 851,
- 869, 877, 885, 886, 887, 888, 889, 890, 891, 896,
- 897, 898, 899, 900, 906, 907, 908, 909, 910, 911,
- 912, 913, 914, 915, 916, 922, 930, 946
+ 588, 610, 617, 623, 629, 657, 671, 690, 724, 742,
+ 752, 755, 758, 773, 774, 775, 780, 782, 789, 849,
+ 867, 875, 883, 884, 885, 886, 887, 888, 889, 894,
+ 895, 896, 897, 898, 904, 905, 906, 907, 908, 909,
+ 910, 911, 912, 913, 914, 920, 928, 944
};
#endif
#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
- First, the terminals, then, starting at YYNTOKENS, nonterminals. */
+ First, the terminals, then, starting at YYNTOKENS, nonterminals. */
static const char *const yytname[] =
{
"$end", "error", "$undefined", "CHAR", "NUMBER", "SECTEND", "SCDECL",
@@ -568,7 +654,7 @@ static const char *const yytname[] =
# ifdef YYPRINT
/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
token YYLEX-NUM. */
-static const unsigned short int yytoknum[] =
+static const yytype_uint16 yytoknum[] =
{
0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
@@ -581,7 +667,7 @@ static const unsigned short int yytoknum[] =
# endif
/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
-static const unsigned char yyr1[] =
+static const yytype_uint8 yyr1[] =
{
0, 69, 70, 71, 72, 72, 72, 72, 73, 74,
74, 75, 75, 75, 76, 77, 77, 78, 78, 78,
@@ -596,7 +682,7 @@ static const unsigned char yyr1[] =
};
/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
-static const unsigned char yyr2[] =
+static const yytype_uint8 yyr2[] =
{
0, 2, 5, 0, 3, 2, 0, 1, 1, 1,
1, 2, 1, 1, 2, 2, 0, 3, 3, 3,
@@ -610,10 +696,10 @@ static const unsigned char yyr2[] =
1, 1, 1, 1, 1, 1, 2, 0
};
-/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
- STATE-NUM when YYTABLE doesn't specify something else to do. Zero
+/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM.
+ Performed when YYTABLE doesn't specify something else to do. Zero
means the default is an error. */
-static const unsigned char yydefact[] =
+static const yytype_uint8 yydefact[] =
{
3, 0, 0, 1, 7, 0, 8, 9, 10, 16,
25, 0, 5, 14, 34, 13, 12, 4, 0, 0,
@@ -631,8 +717,8 @@ static const unsigned char yydefact[] =
0, 56, 0, 68, 0, 49, 0, 55, 48, 54
};
-/* YYDEFGOTO[NTERM-NUM]. */
-static const yysigned_char yydefgoto[] =
+/* YYDEFGOTO[NTERM-NUM]. */
+static const yytype_int8 yydefgoto[] =
{
-1, 1, 2, 5, 10, 11, 17, 12, 13, 24,
14, 26, 60, 36, 27, 48, 49, 61, 62, 63,
@@ -642,7 +728,7 @@ static const yysigned_char yydefgoto[] =
/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
STATE-NUM. */
#define YYPACT_NINF -52
-static const short int yypact[] =
+static const yytype_int16 yypact[] =
{
-52, 17, 103, -52, -52, 113, -52, -52, -52, -52,
-52, 48, -52, 114, 6, -52, -52, 42, 7, 12,
@@ -661,7 +747,7 @@ static const short int yypact[] =
};
/* YYPGOTO[NTERM-NUM]. */
-static const short int yypgoto[] =
+static const yytype_int16 yypgoto[] =
{
-52, -52, -52, -52, -52, -52, -52, -52, -52, -52,
118, 129, -52, -52, -52, -52, 92, 102, -48, -52,
@@ -670,10 +756,9 @@ static const short int yypgoto[] =
/* 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. */
+ number is the opposite. If YYTABLE_NINF, syntax error. */
#define YYTABLE_NINF -27
-static const short int yytable[] =
+static const yytype_int16 yytable[] =
{
51, 136, 52, 94, 90, 129, -26, 78, 53, 54,
73, 87, 88, 134, 92, 80, 130, 3, 95, 96,
@@ -694,7 +779,13 @@ static const short int yytable[] =
0, 89
};
-static const yysigned_char yycheck[] =
+#define yypact_value_is_default(yystate) \
+ ((yystate) == (-52))
+
+#define yytable_value_is_error(yytable_value) \
+ YYID (0)
+
+static const yytype_int8 yycheck[] =
{
1, 4, 3, 3, 3, 45, 0, 58, 9, 10,
58, 42, 43, 4, 65, 63, 56, 0, 18, 19,
@@ -717,7 +808,7 @@ static const yysigned_char yycheck[] =
/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
symbol of state STATE-NUM. */
-static const unsigned char yystos[] =
+static const yytype_uint8 yystos[] =
{
0, 70, 71, 0, 1, 72, 5, 6, 7, 11,
73, 74, 76, 77, 79, 1, 8, 75, 12, 13,
@@ -747,9 +838,18 @@ static const unsigned char yystos[] =
/* 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. */
+ Once GCC version 2 has supplanted version 1, this can go. However,
+ YYFAIL appears to be in use. Nevertheless, it is formally deprecated
+ in Bison 2.4.2's NEWS entry, where a plan to phase it out is
+ discussed. */
#define YYFAIL goto yyerrlab
+#if defined YYFAIL
+ /* This is here to suppress warnings from the GCC cpp's
+ -Wunused-macros. Normally we don't worry about that warning, but
+ some users do, and we want to make it easy for users to remove
+ YYFAIL uses, which will produce warnings from Bison 2.5. */
+#endif
#define YYRECOVERING() (!!yyerrstatus)
@@ -759,8 +859,7 @@ do \
{ \
yychar = (Token); \
yylval = (Value); \
- yytoken = YYTRANSLATE (yychar); \
- YYPOPSTACK; \
+ YYPOPSTACK (1); \
goto yybackup; \
} \
else \
@@ -768,7 +867,7 @@ do \
yyerror (YY_("syntax error: cannot back up")); \
YYERROR; \
} \
-while (0)
+while (YYID (0))
#define YYTERROR 1
@@ -783,7 +882,7 @@ while (0)
#ifndef YYLLOC_DEFAULT
# define YYLLOC_DEFAULT(Current, Rhs, N) \
do \
- if (N) \
+ if (YYID (N)) \
{ \
(Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
(Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
@@ -797,23 +896,14 @@ while (0)
(Current).first_column = (Current).last_column = \
YYRHSLOC (Rhs, 0).last_column; \
} \
- while (0)
+ while (YYID (0))
#endif
-/* 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. */
+/* This macro is provided for backward compatibility. */
#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
+# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
#endif
@@ -837,37 +927,100 @@ while (0)
do { \
if (yydebug) \
YYFPRINTF Args; \
-} while (0)
+} while (YYID (0))
-# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
-do { \
- if (yydebug) \
- { \
- YYFPRINTF (stderr, "%s ", Title); \
- yysymprint (stderr, \
- Type, Value); \
- YYFPRINTF (stderr, "\n"); \
- } \
-} while (0)
+# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
+do { \
+ if (yydebug) \
+ { \
+ YYFPRINTF (stderr, "%s ", Title); \
+ yy_symbol_print (stderr, \
+ Type, Value); \
+ YYFPRINTF (stderr, "\n"); \
+ } \
+} while (YYID (0))
+
+
+/*--------------------------------.
+| Print this symbol 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)
+#else
+static void
+yy_symbol_value_print (yyoutput, yytype, yyvaluep)
+ FILE *yyoutput;
+ int yytype;
+ YYSTYPE const * const yyvaluep;
+#endif
+{
+ if (!yyvaluep)
+ return;
+# ifdef YYPRINT
+ if (yytype < YYNTOKENS)
+ YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
+# else
+ YYUSE (yyoutput);
+# endif
+ switch (yytype)
+ {
+ default:
+ break;
+ }
+}
+
+
+/*--------------------------------.
+| 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)
+#else
+static void
+yy_symbol_print (yyoutput, yytype, yyvaluep)
+ FILE *yyoutput;
+ int yytype;
+ YYSTYPE const * const yyvaluep;
+#endif
+{
+ if (yytype < YYNTOKENS)
+ YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
+ else
+ YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
+
+ yy_symbol_value_print (yyoutput, yytype, yyvaluep);
+ YYFPRINTF (yyoutput, ")");
+}
/*------------------------------------------------------------------.
| yy_stack_print -- Print the state stack from its BOTTOM up to its |
| TOP (included). |
`------------------------------------------------------------------*/
-#if defined (__STDC__) || defined (__cplusplus)
+#if (defined __STDC__ || defined __C99__FUNC__ \
+ || defined __cplusplus || defined _MSC_VER)
static void
-yy_stack_print (short int *bottom, short int *top)
+yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
#else
static void
-yy_stack_print (bottom, top)
- short int *bottom;
- short int *top;
+yy_stack_print (yybottom, yytop)
+ yytype_int16 *yybottom;
+ yytype_int16 *yytop;
#endif
{
YYFPRINTF (stderr, "Stack now");
- for (/* Nothing. */; bottom <= top; ++bottom)
- YYFPRINTF (stderr, " %d", *bottom);
+ for (; yybottom <= yytop; yybottom++)
+ {
+ int yybot = *yybottom;
+ YYFPRINTF (stderr, " %d", yybot);
+ }
YYFPRINTF (stderr, "\n");
}
@@ -875,37 +1028,45 @@ yy_stack_print (bottom, top)
do { \
if (yydebug) \
yy_stack_print ((Bottom), (Top)); \
-} while (0)
+} while (YYID (0))
/*------------------------------------------------.
| Report that the YYRULE is going to be reduced. |
`------------------------------------------------*/
-#if defined (__STDC__) || defined (__cplusplus)
+#if (defined __STDC__ || defined __C99__FUNC__ \
+ || defined __cplusplus || defined _MSC_VER)
static void
-yy_reduce_print (int yyrule)
+yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
#else
static void
-yy_reduce_print (yyrule)
+yy_reduce_print (yyvsp, yyrule)
+ YYSTYPE *yyvsp;
int yyrule;
#endif
{
+ int yynrhs = yyr2[yyrule];
int yyi;
unsigned long int yylno = yyrline[yyrule];
- YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu), ",
- yyrule - 1, yylno);
- /* Print the symbols being reduced, and their result. */
- for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
- YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]);
- YYFPRINTF (stderr, "-> %s\n", yytname[yyr1[yyrule]]);
+ YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
+ 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)])
+ );
+ YYFPRINTF (stderr, "\n");
+ }
}
# define YY_REDUCE_PRINT(Rule) \
do { \
if (yydebug) \
- yy_reduce_print (Rule); \
-} while (0)
+ yy_reduce_print (yyvsp, Rule); \
+} while (YYID (0))
/* Nonzero means print parse trace. It is left uninitialized so that
multiple parsers can coexist. */
@@ -934,47 +1095,48 @@ int yydebug;
# define YYMAXDEPTH 10000
#endif
-
#if YYERROR_VERBOSE
# ifndef yystrlen
-# if defined (__GLIBC__) && defined (_STRING_H)
+# if defined __GLIBC__ && defined _STRING_H
# define yystrlen strlen
# else
/* Return the length of YYSTR. */
+#if (defined __STDC__ || defined __C99__FUNC__ \
+ || defined __cplusplus || defined _MSC_VER)
static YYSIZE_T
-# if defined (__STDC__) || defined (__cplusplus)
yystrlen (const char *yystr)
-# else
+#else
+static YYSIZE_T
yystrlen (yystr)
- const char *yystr;
-# endif
+ const char *yystr;
+#endif
{
- const char *yys = yystr;
-
- while (*yys++ != '\0')
+ YYSIZE_T yylen;
+ for (yylen = 0; yystr[yylen]; yylen++)
continue;
-
- return yys - yystr - 1;
+ return yylen;
}
# endif
# endif
# ifndef yystpcpy
-# if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
+# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
# define yystpcpy stpcpy
# 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 *
-# if defined (__STDC__) || defined (__cplusplus)
yystpcpy (char *yydest, const char *yysrc)
-# else
+#else
+static char *
yystpcpy (yydest, yysrc)
- char *yydest;
- const char *yysrc;
-# endif
+ char *yydest;
+ const char *yysrc;
+#endif
{
char *yyd = yydest;
const char *yys = yysrc;
@@ -1000,7 +1162,7 @@ yytnamerr (char *yyres, const char *yystr)
{
if (*yystr == '"')
{
- size_t yyn = 0;
+ YYSIZE_T yyn = 0;
char const *yyp = yystr;
for (;;)
@@ -1035,53 +1197,150 @@ yytnamerr (char *yyres, const char *yystr)
}
# endif
-#endif /* YYERROR_VERBOSE */
-
-
-
-#if YYDEBUG
-/*--------------------------------.
-| Print this symbol on YYOUTPUT. |
-`--------------------------------*/
-
-#if defined (__STDC__) || defined (__cplusplus)
-static void
-yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
-#else
-static void
-yysymprint (yyoutput, yytype, yyvaluep)
- FILE *yyoutput;
- int yytype;
- YYSTYPE *yyvaluep;
-#endif
+/* 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)
{
- /* Pacify ``unused variable'' warnings. */
- (void) yyvaluep;
+ YYSIZE_T yysize0 = yytnamerr (0, yytname[yytoken]);
+ YYSIZE_T yysize = yysize0;
+ YYSIZE_T yysize1;
+ enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
+ /* Internationalized format string. */
+ const char *yyformat = 0;
+ /* 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:
+ - Assume YYFAIL is not used. It's too flawed to consider. See
+ <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>
+ for details. YYERROR is fine as it does not invoke this
+ function.
+ - 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];
+ yysize1 = yysize + yytnamerr (0, yytname[yyx]);
+ if (! (yysize <= yysize1
+ && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
+ return 2;
+ yysize = yysize1;
+ }
+ }
+ }
- if (yytype < YYNTOKENS)
- YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
- else
- YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
+ switch (yycount)
+ {
+# define YYCASE_(N, S) \
+ case N: \
+ yyformat = S; \
+ break
+ 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_
+ }
+ yysize1 = yysize + yystrlen (yyformat);
+ if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
+ return 2;
+ yysize = yysize1;
-# ifdef YYPRINT
- if (yytype < YYNTOKENS)
- YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
-# endif
- switch (yytype)
+ if (*yymsg_alloc < yysize)
{
- default:
- break;
+ *yymsg_alloc = 2 * yysize;
+ if (! (yysize <= *yymsg_alloc
+ && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
+ *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
+ return 1;
}
- YYFPRINTF (yyoutput, ")");
+
+ /* 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 */
-#endif /* ! YYDEBUG */
/*-----------------------------------------------.
| Release the memory associated to this symbol. |
`-----------------------------------------------*/
-#if defined (__STDC__) || defined (__cplusplus)
+/*ARGSUSED*/
+#if (defined __STDC__ || defined __C99__FUNC__ \
+ || defined __cplusplus || defined _MSC_VER)
static void
yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
#else
@@ -1092,8 +1351,7 @@ yydestruct (yymsg, yytype, yyvaluep)
YYSTYPE *yyvaluep;
#endif
{
- /* Pacify ``unused variable'' warnings. */
- (void) yyvaluep;
+ YYUSE (yyvaluep);
if (!yymsg)
yymsg = "Deleting";
@@ -1103,21 +1361,20 @@ yydestruct (yymsg, yytype, yyvaluep)
{
default:
- break;
+ break;
}
}
-
-/* Prevent warnings from -Wmissing-prototypes. */
+/* Prevent warnings from -Wmissing-prototypes. */
#ifdef YYPARSE_PARAM
-# if defined (__STDC__) || defined (__cplusplus)
+#if defined __STDC__ || defined __cplusplus
int yyparse (void *YYPARSE_PARAM);
-# else
+#else
int yyparse ();
-# endif
+#endif
#else /* ! YYPARSE_PARAM */
-#if defined (__STDC__) || defined (__cplusplus)
+#if defined __STDC__ || defined __cplusplus
int yyparse (void);
#else
int yyparse ();
@@ -1125,94 +1382,102 @@ int yyparse ();
#endif /* ! YYPARSE_PARAM */
-
-/* The look-ahead symbol. */
+/* The lookahead symbol. */
int yychar;
-/* The semantic value of the look-ahead symbol. */
+/* The semantic value of the lookahead symbol. */
YYSTYPE yylval;
/* Number of syntax errors so far. */
int yynerrs;
-
/*----------.
| yyparse. |
`----------*/
#ifdef YYPARSE_PARAM
-# if defined (__STDC__) || defined (__cplusplus)
-int yyparse (void *YYPARSE_PARAM)
-# else
-int yyparse (YYPARSE_PARAM)
- void *YYPARSE_PARAM;
-# endif
+#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 (__cplusplus)
+#if (defined __STDC__ || defined __C99__FUNC__ \
+ || defined __cplusplus || defined _MSC_VER)
int
yyparse (void)
#else
int
yyparse ()
- ;
+
#endif
#endif
{
-
- int yystate;
- int yyn;
- int yyresult;
- /* Number of tokens to shift before error messages enabled. */
- int yyerrstatus;
- /* Look-ahead token as an internal (translated) token number. */
- int yytoken = 0;
-
- /* Three stacks and their tools:
- `yyss': related to states,
- `yyvs': related to semantic values,
- `yyls': related to locations.
-
- Refer to the stacks thru separate pointers, to allow yyoverflow
- to reallocate them elsewhere. */
-
- /* The state stack. */
- short int yyssa[YYINITDEPTH];
- short int *yyss = yyssa;
- short int *yyssp;
+ int yystate;
+ /* Number of tokens to shift before error messages enabled. */
+ int yyerrstatus;
- /* The semantic value stack. */
- YYSTYPE yyvsa[YYINITDEPTH];
- YYSTYPE *yyvs = yyvsa;
- YYSTYPE *yyvsp;
+ /* The stacks and their tools:
+ `yyss': related to states.
+ `yyvs': related to semantic values.
+ Refer to the stacks thru separate pointers, to allow yyoverflow
+ to reallocate them elsewhere. */
+ /* The state stack. */
+ yytype_int16 yyssa[YYINITDEPTH];
+ yytype_int16 *yyss;
+ yytype_int16 *yyssp;
-#define YYPOPSTACK (yyvsp--, yyssp--)
+ /* The semantic value stack. */
+ YYSTYPE yyvsa[YYINITDEPTH];
+ YYSTYPE *yyvs;
+ YYSTYPE *yyvsp;
- YYSIZE_T yystacksize = YYINITDEPTH;
+ YYSIZE_T yystacksize;
+ int yyn;
+ int yyresult;
+ /* Lookahead token as an internal (translated) token number. */
+ int yytoken;
/* The variables used to return semantic value and location from the
action routines. */
YYSTYPE yyval;
+#if YYERROR_VERBOSE
+ /* Buffer for error messages, and its allocated size. */
+ char yymsgbuf[128];
+ char *yymsg = yymsgbuf;
+ YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
+#endif
- /* When reducing, the number of symbols on the RHS of the reduced
- rule. */
- int yylen;
+#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
+
+ /* The number of symbols on the RHS of the reduced rule.
+ Keep to zero when no symbol should be popped. */
+ int yylen = 0;
+
+ yytoken = 0;
+ yyss = yyssa;
+ yyvs = yyvsa;
+ yystacksize = YYINITDEPTH;
YYDPRINTF ((stderr, "Starting parse\n"));
yystate = 0;
yyerrstatus = 0;
yynerrs = 0;
- yychar = YYEMPTY; /* Cause a token to be read. */
+ 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;
@@ -1223,8 +1488,7 @@ yyparse ()
`------------------------------------------------------------*/
yynewstate:
/* In all cases, when you get here, the value and location stacks
- have just been pushed. so pushing a state here evens the stacks.
- */
+ have just been pushed. So pushing a state here evens the stacks. */
yyssp++;
yysetstate:
@@ -1237,12 +1501,11 @@ yyparse ()
#ifdef yyoverflow
{
- /* Give user a chance to reallocate the stack. Use copies of
+ /* 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;
- short int *yyss1 = yyss;
-
+ 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
@@ -1251,7 +1514,6 @@ yyparse ()
yyoverflow (YY_("memory exhausted"),
&yyss1, yysize * sizeof (*yyssp),
&yyvs1, yysize * sizeof (*yyvsp),
-
&yystacksize);
yyss = yyss1;
@@ -1269,14 +1531,13 @@ yyparse ()
yystacksize = YYMAXDEPTH;
{
- short int *yyss1 = yyss;
+ yytype_int16 *yyss1 = yyss;
union yyalloc *yyptr =
(union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
if (! yyptr)
goto yyexhaustedlab;
- YYSTACK_RELOCATE (yyss);
- YYSTACK_RELOCATE (yyvs);
-
+ YYSTACK_RELOCATE (yyss_alloc, yyss);
+ YYSTACK_RELOCATE (yyvs_alloc, yyvs);
# undef YYSTACK_RELOCATE
if (yyss1 != yyssa)
YYSTACK_FREE (yyss1);
@@ -1287,7 +1548,6 @@ yyparse ()
yyssp = yyss + yysize - 1;
yyvsp = yyvs + yysize - 1;
-
YYDPRINTF ((stderr, "Stack size increased to %lu\n",
(unsigned long int) yystacksize));
@@ -1297,6 +1557,9 @@ yyparse ()
YYDPRINTF ((stderr, "Entering state %d\n", yystate));
+ if (yystate == YYFINAL)
+ YYACCEPT;
+
goto yybackup;
/*-----------.
@@ -1304,19 +1567,17 @@ yyparse ()
`-----------*/
yybackup:
-/* Do appropriate processing given the current state. */
-/* Read a look-ahead token if we need one and don't already have one. */
-/* yyresume: */
-
- /* First try to decide what to do without reference to look-ahead token. */
+ /* Do appropriate processing given the current state. Read a
+ lookahead token if we need one and don't already have one. */
+ /* 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 look-ahead token if don't already have one. */
+ /* Not known => get a lookahead token if don't already have one. */
- /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
+ /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
if (yychar == YYEMPTY)
{
YYDPRINTF ((stderr, "Reading a token: "));
@@ -1342,31 +1603,26 @@ 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;
}
- if (yyn == YYFINAL)
- YYACCEPT;
-
- /* Shift the look-ahead token. */
- YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
-
- /* Discard the token being shifted unless it is eof. */
- if (yychar != YYEOF)
- yychar = YYEMPTY;
-
- *++yyvsp = yylval;
-
-
/* Count tokens shifted since error; after three, turn off error
status. */
if (yyerrstatus)
yyerrstatus--;
+ /* Shift the lookahead token. */
+ YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
+
+ /* Discard the shifted token. */
+ yychar = YYEMPTY;
+
yystate = yyn;
+ *++yyvsp = yylval;
+
goto yynewstate;
@@ -1402,6 +1658,8 @@ yyreduce:
switch (yyn)
{
case 2:
+
+/* Line 1806 of yacc.c */
#line 119 "parse.y"
{ /* add default rule */
int def_rule;
@@ -1432,6 +1690,8 @@ yyreduce:
break;
case 3:
+
+/* Line 1806 of yacc.c */
#line 148 "parse.y"
{ /* initialize for processing rules */
@@ -1441,11 +1701,15 @@ yyreduce:
break;
case 7:
+
+/* Line 1806 of yacc.c */
#line 159 "parse.y"
{ synerr( _("unknown error processing section 1") ); }
break;
case 8:
+
+/* Line 1806 of yacc.c */
#line 163 "parse.y"
{
check_options();
@@ -1455,31 +1719,43 @@ yyreduce:
break;
case 9:
+
+/* Line 1806 of yacc.c */
#line 171 "parse.y"
{ xcluflg = false; }
break;
case 10:
+
+/* Line 1806 of yacc.c */
#line 174 "parse.y"
{ xcluflg = true; }
break;
case 11:
+
+/* Line 1806 of yacc.c */
#line 178 "parse.y"
{ scinstal( nmstr, xcluflg ); }
break;
case 12:
+
+/* Line 1806 of yacc.c */
#line 181 "parse.y"
{ scinstal( nmstr, xcluflg ); }
break;
case 13:
+
+/* Line 1806 of yacc.c */
#line 184 "parse.y"
{ synerr( _("bad start condition list") ); }
break;
case 17:
+
+/* Line 1806 of yacc.c */
#line 195 "parse.y"
{
outfilename = copy_string( nmstr );
@@ -1488,41 +1764,57 @@ yyreduce:
break;
case 18:
+
+/* Line 1806 of yacc.c */
#line 200 "parse.y"
{ extra_type = copy_string( nmstr ); }
break;
case 19:
+
+/* Line 1806 of yacc.c */
#line 202 "parse.y"
{ prefix = copy_string( nmstr ); }
break;
case 20:
+
+/* Line 1806 of yacc.c */
#line 204 "parse.y"
{ yyclass = copy_string( nmstr ); }
break;
case 21:
+
+/* Line 1806 of yacc.c */
#line 206 "parse.y"
{ headerfilename = copy_string( nmstr ); }
break;
case 22:
+
+/* Line 1806 of yacc.c */
#line 208 "parse.y"
{ tablesext = true; tablesfilename = copy_string( nmstr ); }
break;
case 23:
+
+/* Line 1806 of yacc.c */
#line 212 "parse.y"
- { scon_stk_ptr = (yyvsp[-3]); }
+ { scon_stk_ptr = (yyvsp[(2) - (5)]); }
break;
case 24:
+
+/* Line 1806 of yacc.c */
#line 214 "parse.y"
- { scon_stk_ptr = (yyvsp[-3]); }
+ { scon_stk_ptr = (yyvsp[(2) - (5)]); }
break;
case 26:
+
+/* Line 1806 of yacc.c */
#line 219 "parse.y"
{
/* Initialize for a parse of one rule. */
@@ -1537,9 +1829,11 @@ yyreduce:
break;
case 27:
+
+/* Line 1806 of yacc.c */
#line 232 "parse.y"
{
- pat = (yyvsp[0]);
+ pat = (yyvsp[(2) - (2)]);
finish_rule( pat, variable_trail_rule,
headcnt, trailcnt , previous_continued_action);
@@ -1575,9 +1869,11 @@ yyreduce:
break;
case 28:
+
+/* Line 1806 of yacc.c */
#line 268 "parse.y"
{
- pat = (yyvsp[0]);
+ pat = (yyvsp[(1) - (1)]);
finish_rule( pat, variable_trail_rule,
headcnt, trailcnt , previous_continued_action);
@@ -1601,6 +1897,8 @@ yyreduce:
break;
case 29:
+
+/* Line 1806 of yacc.c */
#line 292 "parse.y"
{
if ( scon_stk_ptr > 0 )
@@ -1626,21 +1924,29 @@ yyreduce:
break;
case 30:
+
+/* Line 1806 of yacc.c */
#line 315 "parse.y"
{ synerr( _("unrecognized rule") ); }
break;
case 31:
+
+/* Line 1806 of yacc.c */
#line 319 "parse.y"
{ (yyval) = scon_stk_ptr; }
break;
case 32:
+
+/* Line 1806 of yacc.c */
#line 323 "parse.y"
- { (yyval) = (yyvsp[-2]); }
+ { (yyval) = (yyvsp[(2) - (4)]); }
break;
case 33:
+
+/* Line 1806 of yacc.c */
#line 326 "parse.y"
{
(yyval) = scon_stk_ptr;
@@ -1660,16 +1966,22 @@ yyreduce:
break;
case 34:
+
+/* Line 1806 of yacc.c */
#line 343 "parse.y"
{ (yyval) = scon_stk_ptr; }
break;
case 37:
+
+/* Line 1806 of yacc.c */
#line 351 "parse.y"
{ synerr( _("bad start condition list") ); }
break;
case 38:
+
+/* Line 1806 of yacc.c */
#line 355 "parse.y"
{
if ( (scnum = sclookup( nmstr )) == 0 )
@@ -1694,17 +2006,19 @@ yyreduce:
break;
case 39:
+
+/* Line 1806 of yacc.c */
#line 378 "parse.y"
{
- if ( transchar[lastst[(yyvsp[0])]] != SYM_EPSILON )
+ if ( transchar[lastst[(yyvsp[(2) - (2)])]] != SYM_EPSILON )
/* Provide final transition \now/ so it
* will be marked as a trailing context
* state.
*/
- (yyvsp[0]) = link_machines( (yyvsp[0]),
+ (yyvsp[(2) - (2)]) = link_machines( (yyvsp[(2) - (2)]),
mkstate( SYM_EPSILON ) );
- mark_beginning_as_normal( (yyvsp[0]) );
+ mark_beginning_as_normal( (yyvsp[(2) - (2)]) );
current_state_type = STATE_NORMAL;
if ( previous_continued_action )
@@ -1739,7 +2053,7 @@ yyreduce:
* trail rule, and add_accept() can create
* a new state ...
*/
- add_accept( (yyvsp[-1]),
+ add_accept( (yyvsp[(1) - (2)]),
num_rules | YY_TRAILING_HEAD_MASK );
variable_trail_rule = true;
}
@@ -1747,16 +2061,20 @@ yyreduce:
else
trailcnt = rulelen;
- (yyval) = link_machines( (yyvsp[-1]), (yyvsp[0]) );
+ (yyval) = link_machines( (yyvsp[(1) - (2)]), (yyvsp[(2) - (2)]) );
}
break;
case 40:
+
+/* Line 1806 of yacc.c */
#line 434 "parse.y"
{ synerr( _("trailing context used twice") ); }
break;
case 41:
+
+/* Line 1806 of yacc.c */
#line 437 "parse.y"
{
headcnt = 0;
@@ -1788,7 +2106,7 @@ yyreduce:
/* Again, see the comment in the rule for
* "re2 re" above.
*/
- add_accept( (yyvsp[-1]),
+ add_accept( (yyvsp[(1) - (2)]),
num_rules | YY_TRAILING_HEAD_MASK );
variable_trail_rule = true;
}
@@ -1796,15 +2114,17 @@ yyreduce:
trlcontxt = true;
eps = mkstate( SYM_EPSILON );
- (yyval) = link_machines( (yyvsp[-1]),
+ (yyval) = link_machines( (yyvsp[(1) - (2)]),
link_machines( eps, mkstate( '\n' ) ) );
}
break;
case 42:
+
+/* Line 1806 of yacc.c */
#line 480 "parse.y"
{
- (yyval) = (yyvsp[0]);
+ (yyval) = (yyvsp[(1) - (1)]);
if ( trlcontxt )
{
@@ -1820,19 +2140,25 @@ yyreduce:
break;
case 43:
+
+/* Line 1806 of yacc.c */
#line 498 "parse.y"
{
varlength = true;
- (yyval) = mkor( (yyvsp[-2]), (yyvsp[0]) );
+ (yyval) = mkor( (yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]) );
}
break;
case 44:
+
+/* Line 1806 of yacc.c */
#line 504 "parse.y"
- { (yyval) = (yyvsp[0]); }
+ { (yyval) = (yyvsp[(1) - (1)]); }
break;
case 45:
+
+/* Line 1806 of yacc.c */
#line 509 "parse.y"
{
/* This rule is written separately so the
@@ -1856,72 +2182,82 @@ yyreduce:
rulelen = 0;
current_state_type = STATE_TRAILING_CONTEXT;
- (yyval) = (yyvsp[-1]);
+ (yyval) = (yyvsp[(1) - (2)]);
}
break;
case 46:
+
+/* Line 1806 of yacc.c */
#line 536 "parse.y"
{
/* This is where concatenation of adjacent patterns
* gets done.
*/
- (yyval) = link_machines( (yyvsp[-1]), (yyvsp[0]) );
+ (yyval) = link_machines( (yyvsp[(1) - (2)]), (yyvsp[(2) - (2)]) );
}
break;
case 47:
+
+/* Line 1806 of yacc.c */
#line 544 "parse.y"
- { (yyval) = (yyvsp[0]); }
+ { (yyval) = (yyvsp[(1) - (1)]); }
break;
case 48:
+
+/* Line 1806 of yacc.c */
#line 547 "parse.y"
{
varlength = true;
- if ( (yyvsp[-3]) > (yyvsp[-1]) || (yyvsp[-3]) < 0 )
+ if ( (yyvsp[(3) - (6)]) > (yyvsp[(5) - (6)]) || (yyvsp[(3) - (6)]) < 0 )
{
synerr( _("bad iteration values") );
- (yyval) = (yyvsp[-5]);
+ (yyval) = (yyvsp[(1) - (6)]);
}
else
{
- if ( (yyvsp[-3]) == 0 )
+ if ( (yyvsp[(3) - (6)]) == 0 )
{
- if ( (yyvsp[-1]) <= 0 )
+ if ( (yyvsp[(5) - (6)]) <= 0 )
{
synerr(
_("bad iteration values") );
- (yyval) = (yyvsp[-5]);
+ (yyval) = (yyvsp[(1) - (6)]);
}
else
(yyval) = mkopt(
- mkrep( (yyvsp[-5]), 1, (yyvsp[-1]) ) );
+ mkrep( (yyvsp[(1) - (6)]), 1, (yyvsp[(5) - (6)]) ) );
}
else
- (yyval) = mkrep( (yyvsp[-5]), (yyvsp[-3]), (yyvsp[-1]) );
+ (yyval) = mkrep( (yyvsp[(1) - (6)]), (yyvsp[(3) - (6)]), (yyvsp[(5) - (6)]) );
}
}
break;
case 49:
+
+/* Line 1806 of yacc.c */
#line 575 "parse.y"
{
varlength = true;
- if ( (yyvsp[-2]) <= 0 )
+ if ( (yyvsp[(3) - (5)]) <= 0 )
{
synerr( _("iteration value must be positive") );
- (yyval) = (yyvsp[-4]);
+ (yyval) = (yyvsp[(1) - (5)]);
}
else
- (yyval) = mkrep( (yyvsp[-4]), (yyvsp[-2]), INFINITE_REPEAT );
+ (yyval) = mkrep( (yyvsp[(1) - (5)]), (yyvsp[(3) - (5)]), INFINITE_REPEAT );
}
break;
case 50:
+
+/* Line 1806 of yacc.c */
#line 589 "parse.y"
{
/* The series could be something like "(foo)",
@@ -1930,91 +2266,103 @@ yyreduce:
*/
varlength = true;
- if ( (yyvsp[-1]) <= 0 )
+ if ( (yyvsp[(3) - (4)]) <= 0 )
{
synerr( _("iteration value must be positive")
);
- (yyval) = (yyvsp[-3]);
+ (yyval) = (yyvsp[(1) - (4)]);
}
else
- (yyval) = link_machines( (yyvsp[-3]),
- copysingl( (yyvsp[-3]), (yyvsp[-1]) - 1 ) );
+ (yyval) = link_machines( (yyvsp[(1) - (4)]),
+ copysingl( (yyvsp[(1) - (4)]), (yyvsp[(3) - (4)]) - 1 ) );
}
break;
case 51:
+
+/* Line 1806 of yacc.c */
#line 611 "parse.y"
{
varlength = true;
- (yyval) = mkclos( (yyvsp[-1]) );
+ (yyval) = mkclos( (yyvsp[(1) - (2)]) );
}
break;
case 52:
+
+/* Line 1806 of yacc.c */
#line 618 "parse.y"
{
varlength = true;
- (yyval) = mkposcl( (yyvsp[-1]) );
+ (yyval) = mkposcl( (yyvsp[(1) - (2)]) );
}
break;
case 53:
+
+/* Line 1806 of yacc.c */
#line 624 "parse.y"
{
varlength = true;
- (yyval) = mkopt( (yyvsp[-1]) );
+ (yyval) = mkopt( (yyvsp[(1) - (2)]) );
}
break;
case 54:
+
+/* Line 1806 of yacc.c */
#line 630 "parse.y"
{
varlength = true;
- if ( (yyvsp[-3]) > (yyvsp[-1]) || (yyvsp[-3]) < 0 )
+ if ( (yyvsp[(3) - (6)]) > (yyvsp[(5) - (6)]) || (yyvsp[(3) - (6)]) < 0 )
{
synerr( _("bad iteration values") );
- (yyval) = (yyvsp[-5]);
+ (yyval) = (yyvsp[(1) - (6)]);
}
else
{
- if ( (yyvsp[-3]) == 0 )
+ if ( (yyvsp[(3) - (6)]) == 0 )
{
- if ( (yyvsp[-1]) <= 0 )
+ if ( (yyvsp[(5) - (6)]) <= 0 )
{
synerr(
_("bad iteration values") );
- (yyval) = (yyvsp[-5]);
+ (yyval) = (yyvsp[(1) - (6)]);
}
else
(yyval) = mkopt(
- mkrep( (yyvsp[-5]), 1, (yyvsp[-1]) ) );
+ mkrep( (yyvsp[(1) - (6)]), 1, (yyvsp[(5) - (6)]) ) );
}
else
- (yyval) = mkrep( (yyvsp[-5]), (yyvsp[-3]), (yyvsp[-1]) );
+ (yyval) = mkrep( (yyvsp[(1) - (6)]), (yyvsp[(3) - (6)]), (yyvsp[(5) - (6)]) );
}
}
break;
case 55:
+
+/* Line 1806 of yacc.c */
#line 658 "parse.y"
{
varlength = true;
- if ( (yyvsp[-2]) <= 0 )
+ if ( (yyvsp[(3) - (5)]) <= 0 )
{
synerr( _("iteration value must be positive") );
- (yyval) = (yyvsp[-4]);
+ (yyval) = (yyvsp[(1) - (5)]);
}
else
- (yyval) = mkrep( (yyvsp[-4]), (yyvsp[-2]), INFINITE_REPEAT );
+ (yyval) = mkrep( (yyvsp[(1) - (5)]), (yyvsp[(3) - (5)]), INFINITE_REPEAT );
}
break;
case 56:
+
+/* Line 1806 of yacc.c */
#line 672 "parse.y"
{
/* The singleton could be something like "(foo)",
@@ -2023,19 +2371,21 @@ yyreduce:
*/
varlength = true;
- if ( (yyvsp[-1]) <= 0 )
+ if ( (yyvsp[(3) - (4)]) <= 0 )
{
synerr( _("iteration value must be positive") );
- (yyval) = (yyvsp[-3]);
+ (yyval) = (yyvsp[(1) - (4)]);
}
else
- (yyval) = link_machines( (yyvsp[-3]),
- copysingl( (yyvsp[-3]), (yyvsp[-1]) - 1 ) );
+ (yyval) = link_machines( (yyvsp[(1) - (4)]),
+ copysingl( (yyvsp[(1) - (4)]), (yyvsp[(3) - (4)]) - 1 ) );
}
break;
case 57:
+
+/* Line 1806 of yacc.c */
#line 691 "parse.y"
{
if ( ! madeany )
@@ -2072,90 +2422,108 @@ yyreduce:
break;
case 58:
+
+/* Line 1806 of yacc.c */
#line 725 "parse.y"
{
- /* Sort characters for fast searching. We
- * use a shell sort since this list could
- * be large.
+ /* Sort characters for fast searching.
*/
- cshell( ccltbl + cclmap[(yyvsp[0])], ccllen[(yyvsp[0])], true );
+ qsort( ccltbl + cclmap[(yyvsp[(1) - (1)])], ccllen[(yyvsp[(1) - (1)])], sizeof (*ccltbl), cclcmp );
if ( useecs )
- mkeccl( ccltbl + cclmap[(yyvsp[0])], ccllen[(yyvsp[0])],
+ mkeccl( ccltbl + cclmap[(yyvsp[(1) - (1)])], ccllen[(yyvsp[(1) - (1)])],
nextecm, ecgroup, csize, csize );
++rulelen;
- if (ccl_has_nl[(yyvsp[0])])
+ if (ccl_has_nl[(yyvsp[(1) - (1)])])
rule_has_nl[num_rules] = true;
- (yyval) = mkstate( -(yyvsp[0]) );
+ (yyval) = mkstate( -(yyvsp[(1) - (1)]) );
}
break;
case 59:
-#line 745 "parse.y"
+
+/* Line 1806 of yacc.c */
+#line 743 "parse.y"
{
++rulelen;
- if (ccl_has_nl[(yyvsp[0])])
+ if (ccl_has_nl[(yyvsp[(1) - (1)])])
rule_has_nl[num_rules] = true;
- (yyval) = mkstate( -(yyvsp[0]) );
+ (yyval) = mkstate( -(yyvsp[(1) - (1)]) );
}
break;
case 60:
-#line 755 "parse.y"
- { (yyval) = (yyvsp[-1]); }
+
+/* Line 1806 of yacc.c */
+#line 753 "parse.y"
+ { (yyval) = (yyvsp[(2) - (3)]); }
break;
case 61:
-#line 758 "parse.y"
- { (yyval) = (yyvsp[-1]); }
+
+/* Line 1806 of yacc.c */
+#line 756 "parse.y"
+ { (yyval) = (yyvsp[(2) - (3)]); }
break;
case 62:
-#line 761 "parse.y"
+
+/* Line 1806 of yacc.c */
+#line 759 "parse.y"
{
++rulelen;
- if ((yyvsp[0]) == nlch)
+ if ((yyvsp[(1) - (1)]) == nlch)
rule_has_nl[num_rules] = true;
- if (sf_case_ins() && has_case((yyvsp[0])))
+ if (sf_case_ins() && has_case((yyvsp[(1) - (1)])))
/* create an alternation, as in (a|A) */
- (yyval) = mkor (mkstate((yyvsp[0])), mkstate(reverse_case((yyvsp[0]))));
+ (yyval) = mkor (mkstate((yyvsp[(1) - (1)])), mkstate(reverse_case((yyvsp[(1) - (1)]))));
else
- (yyval) = mkstate( (yyvsp[0]) );
+ (yyval) = mkstate( (yyvsp[(1) - (1)]) );
}
break;
case 63:
-#line 775 "parse.y"
- { (yyval) = ccl_set_diff ((yyvsp[-2]), (yyvsp[0])); }
+
+/* Line 1806 of yacc.c */
+#line 773 "parse.y"
+ { (yyval) = ccl_set_diff ((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)])); }
break;
case 64:
-#line 776 "parse.y"
- { (yyval) = ccl_set_union ((yyvsp[-2]), (yyvsp[0])); }
+
+/* Line 1806 of yacc.c */
+#line 774 "parse.y"
+ { (yyval) = ccl_set_union ((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)])); }
break;
case 66:
-#line 782 "parse.y"
- { (yyval) = (yyvsp[-1]); }
+
+/* Line 1806 of yacc.c */
+#line 780 "parse.y"
+ { (yyval) = (yyvsp[(2) - (3)]); }
break;
case 67:
-#line 785 "parse.y"
+
+/* Line 1806 of yacc.c */
+#line 783 "parse.y"
{
- cclnegate( (yyvsp[-1]) );
- (yyval) = (yyvsp[-1]);
+ cclnegate( (yyvsp[(3) - (4)]) );
+ (yyval) = (yyvsp[(3) - (4)]);
}
break;
case 68:
-#line 792 "parse.y"
+
+/* Line 1806 of yacc.c */
+#line 790 "parse.y"
{
if (sf_case_ins())
@@ -2166,87 +2534,93 @@ yyreduce:
* sure what range the user is trying to express.
* Examples: [@-z] or [S-t]
*/
- if (has_case ((yyvsp[-2])) != has_case ((yyvsp[0]))
- || (has_case ((yyvsp[-2])) && (b_islower ((yyvsp[-2])) != b_islower ((yyvsp[0]))))
- || (has_case ((yyvsp[-2])) && (b_isupper ((yyvsp[-2])) != b_isupper ((yyvsp[0])))))
+ if (has_case ((yyvsp[(2) - (4)])) != has_case ((yyvsp[(4) - (4)]))
+ || (has_case ((yyvsp[(2) - (4)])) && (b_islower ((yyvsp[(2) - (4)])) != b_islower ((yyvsp[(4) - (4)]))))
+ || (has_case ((yyvsp[(2) - (4)])) && (b_isupper ((yyvsp[(2) - (4)])) != b_isupper ((yyvsp[(4) - (4)])))))
format_warn3 (
_("the character range [%c-%c] is ambiguous in a case-insensitive scanner"),
- (yyvsp[-2]), (yyvsp[0]));
+ (yyvsp[(2) - (4)]), (yyvsp[(4) - (4)]));
/* If the range spans uppercase characters but not
* lowercase (or vice-versa), then should we automatically
* include lowercase characters in the range?
* Example: [@-_] spans [a-z] but not [A-Z]
*/
- else if (!has_case ((yyvsp[-2])) && !has_case ((yyvsp[0])) && !range_covers_case ((yyvsp[-2]), (yyvsp[0])))
+ else if (!has_case ((yyvsp[(2) - (4)])) && !has_case ((yyvsp[(4) - (4)])) && !range_covers_case ((yyvsp[(2) - (4)]), (yyvsp[(4) - (4)])))
format_warn3 (
_("the character range [%c-%c] is ambiguous in a case-insensitive scanner"),
- (yyvsp[-2]), (yyvsp[0]));
+ (yyvsp[(2) - (4)]), (yyvsp[(4) - (4)]));
}
- if ( (yyvsp[-2]) > (yyvsp[0]) )
+ if ( (yyvsp[(2) - (4)]) > (yyvsp[(4) - (4)]) )
synerr( _("negative range in character class") );
else
{
- for ( i = (yyvsp[-2]); i <= (yyvsp[0]); ++i )
- ccladd( (yyvsp[-3]), i );
+ for ( i = (yyvsp[(2) - (4)]); i <= (yyvsp[(4) - (4)]); ++i )
+ ccladd( (yyvsp[(1) - (4)]), i );
/* Keep track if this ccl is staying in
* alphabetical order.
*/
- cclsorted = cclsorted && ((yyvsp[-2]) > lastchar);
- lastchar = (yyvsp[0]);
+ cclsorted = cclsorted && ((yyvsp[(2) - (4)]) > lastchar);
+ lastchar = (yyvsp[(4) - (4)]);
/* Do it again for upper/lowercase */
- if (sf_case_ins() && has_case((yyvsp[-2])) && has_case((yyvsp[0]))){
- (yyvsp[-2]) = reverse_case ((yyvsp[-2]));
- (yyvsp[0]) = reverse_case ((yyvsp[0]));
+ if (sf_case_ins() && has_case((yyvsp[(2) - (4)])) && has_case((yyvsp[(4) - (4)]))){
+ (yyvsp[(2) - (4)]) = reverse_case ((yyvsp[(2) - (4)]));
+ (yyvsp[(4) - (4)]) = reverse_case ((yyvsp[(4) - (4)]));
- for ( i = (yyvsp[-2]); i <= (yyvsp[0]); ++i )
- ccladd( (yyvsp[-3]), i );
+ for ( i = (yyvsp[(2) - (4)]); i <= (yyvsp[(4) - (4)]); ++i )
+ ccladd( (yyvsp[(1) - (4)]), i );
- cclsorted = cclsorted && ((yyvsp[-2]) > lastchar);
- lastchar = (yyvsp[0]);
+ cclsorted = cclsorted && ((yyvsp[(2) - (4)]) > lastchar);
+ lastchar = (yyvsp[(4) - (4)]);
}
}
- (yyval) = (yyvsp[-3]);
+ (yyval) = (yyvsp[(1) - (4)]);
}
break;
case 69:
-#line 852 "parse.y"
+
+/* Line 1806 of yacc.c */
+#line 850 "parse.y"
{
- ccladd( (yyvsp[-1]), (yyvsp[0]) );
- cclsorted = cclsorted && ((yyvsp[0]) > lastchar);
- lastchar = (yyvsp[0]);
+ ccladd( (yyvsp[(1) - (2)]), (yyvsp[(2) - (2)]) );
+ cclsorted = cclsorted && ((yyvsp[(2) - (2)]) > lastchar);
+ lastchar = (yyvsp[(2) - (2)]);
/* Do it again for upper/lowercase */
- if (sf_case_ins() && has_case((yyvsp[0]))){
- (yyvsp[0]) = reverse_case ((yyvsp[0]));
- ccladd ((yyvsp[-1]), (yyvsp[0]));
+ if (sf_case_ins() && has_case((yyvsp[(2) - (2)]))){
+ (yyvsp[(2) - (2)]) = reverse_case ((yyvsp[(2) - (2)]));
+ ccladd ((yyvsp[(1) - (2)]), (yyvsp[(2) - (2)]));
- cclsorted = cclsorted && ((yyvsp[0]) > lastchar);
- lastchar = (yyvsp[0]);
+ cclsorted = cclsorted && ((yyvsp[(2) - (2)]) > lastchar);
+ lastchar = (yyvsp[(2) - (2)]);
}
- (yyval) = (yyvsp[-1]);
+ (yyval) = (yyvsp[(1) - (2)]);
}
break;
case 70:
-#line 870 "parse.y"
+
+/* Line 1806 of yacc.c */
+#line 868 "parse.y"
{
/* Too hard to properly maintain cclsorted. */
cclsorted = false;
- (yyval) = (yyvsp[-1]);
+ (yyval) = (yyvsp[(1) - (2)]);
}
break;
case 71:
-#line 877 "parse.y"
+
+/* Line 1806 of yacc.c */
+#line 875 "parse.y"
{
cclsorted = true;
lastchar = 0;
@@ -2255,37 +2629,51 @@ yyreduce:
break;
case 72:
-#line 885 "parse.y"
+
+/* Line 1806 of yacc.c */
+#line 883 "parse.y"
{ CCL_EXPR(isalnum); }
break;
case 73:
-#line 886 "parse.y"
+
+/* Line 1806 of yacc.c */
+#line 884 "parse.y"
{ CCL_EXPR(isalpha); }
break;
case 74:
-#line 887 "parse.y"
+
+/* Line 1806 of yacc.c */
+#line 885 "parse.y"
{ CCL_EXPR(IS_BLANK); }
break;
case 75:
-#line 888 "parse.y"
+
+/* Line 1806 of yacc.c */
+#line 886 "parse.y"
{ CCL_EXPR(iscntrl); }
break;
case 76:
-#line 889 "parse.y"
+
+/* Line 1806 of yacc.c */
+#line 887 "parse.y"
{ CCL_EXPR(isdigit); }
break;
case 77:
-#line 890 "parse.y"
+
+/* Line 1806 of yacc.c */
+#line 888 "parse.y"
{ CCL_EXPR(isgraph); }
break;
case 78:
-#line 891 "parse.y"
+
+/* Line 1806 of yacc.c */
+#line 889 "parse.y"
{
CCL_EXPR(islower);
if (sf_case_ins())
@@ -2294,27 +2682,37 @@ yyreduce:
break;
case 79:
-#line 896 "parse.y"
+
+/* Line 1806 of yacc.c */
+#line 894 "parse.y"
{ CCL_EXPR(isprint); }
break;
case 80:
-#line 897 "parse.y"
+
+/* Line 1806 of yacc.c */
+#line 895 "parse.y"
{ CCL_EXPR(ispunct); }
break;
case 81:
-#line 898 "parse.y"
+
+/* Line 1806 of yacc.c */
+#line 896 "parse.y"
{ CCL_EXPR(isspace); }
break;
case 82:
-#line 899 "parse.y"
+
+/* Line 1806 of yacc.c */
+#line 897 "parse.y"
{ CCL_EXPR(isxdigit); }
break;
case 83:
-#line 900 "parse.y"
+
+/* Line 1806 of yacc.c */
+#line 898 "parse.y"
{
CCL_EXPR(isupper);
if (sf_case_ins())
@@ -2323,57 +2721,79 @@ yyreduce:
break;
case 84:
-#line 906 "parse.y"
+
+/* Line 1806 of yacc.c */
+#line 904 "parse.y"
{ CCL_NEG_EXPR(isalnum); }
break;
case 85:
-#line 907 "parse.y"
+
+/* Line 1806 of yacc.c */
+#line 905 "parse.y"
{ CCL_NEG_EXPR(isalpha); }
break;
case 86:
-#line 908 "parse.y"
+
+/* Line 1806 of yacc.c */
+#line 906 "parse.y"
{ CCL_NEG_EXPR(IS_BLANK); }
break;
case 87:
-#line 909 "parse.y"
+
+/* Line 1806 of yacc.c */
+#line 907 "parse.y"
{ CCL_NEG_EXPR(iscntrl); }
break;
case 88:
-#line 910 "parse.y"
+
+/* Line 1806 of yacc.c */
+#line 908 "parse.y"
{ CCL_NEG_EXPR(isdigit); }
break;
case 89:
-#line 911 "parse.y"
+
+/* Line 1806 of yacc.c */
+#line 909 "parse.y"
{ CCL_NEG_EXPR(isgraph); }
break;
case 90:
-#line 912 "parse.y"
+
+/* Line 1806 of yacc.c */
+#line 910 "parse.y"
{ CCL_NEG_EXPR(isprint); }
break;
case 91:
-#line 913 "parse.y"
+
+/* Line 1806 of yacc.c */
+#line 911 "parse.y"
{ CCL_NEG_EXPR(ispunct); }
break;
case 92:
-#line 914 "parse.y"
+
+/* Line 1806 of yacc.c */
+#line 912 "parse.y"
{ CCL_NEG_EXPR(isspace); }
break;
case 93:
-#line 915 "parse.y"
+
+/* Line 1806 of yacc.c */
+#line 913 "parse.y"
{ CCL_NEG_EXPR(isxdigit); }
break;
case 94:
-#line 916 "parse.y"
+
+/* Line 1806 of yacc.c */
+#line 914 "parse.y"
{
if ( sf_case_ins() )
warn(_("[:^lower:] is ambiguous in case insensitive scanner"));
@@ -2383,7 +2803,9 @@ yyreduce:
break;
case 95:
-#line 922 "parse.y"
+
+/* Line 1806 of yacc.c */
+#line 920 "parse.y"
{
if ( sf_case_ins() )
warn(_("[:^upper:] ambiguous in case insensitive scanner"));
@@ -2393,43 +2815,56 @@ yyreduce:
break;
case 96:
-#line 931 "parse.y"
+
+/* Line 1806 of yacc.c */
+#line 929 "parse.y"
{
- if ( (yyvsp[0]) == nlch )
+ if ( (yyvsp[(2) - (2)]) == nlch )
rule_has_nl[num_rules] = true;
++rulelen;
- if (sf_case_ins() && has_case((yyvsp[0])))
- (yyval) = mkor (mkstate((yyvsp[0])), mkstate(reverse_case((yyvsp[0]))));
+ if (sf_case_ins() && has_case((yyvsp[(2) - (2)])))
+ (yyval) = mkor (mkstate((yyvsp[(2) - (2)])), mkstate(reverse_case((yyvsp[(2) - (2)]))));
else
- (yyval) = mkstate ((yyvsp[0]));
+ (yyval) = mkstate ((yyvsp[(2) - (2)]));
- (yyval) = link_machines( (yyvsp[-1]), (yyval));
+ (yyval) = link_machines( (yyvsp[(1) - (2)]), (yyval));
}
break;
case 97:
-#line 946 "parse.y"
+
+/* Line 1806 of yacc.c */
+#line 944 "parse.y"
{ (yyval) = mkstate( SYM_EPSILON ); }
break;
+
+/* Line 1806 of yacc.c */
+#line 2847 "parse.c"
default: break;
}
-
-/* Line 1126 of yacc.c. */
-#line 2423 "parse.c"
-
- yyvsp -= yylen;
- yyssp -= yylen;
-
-
+ /* 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);
+ yylen = 0;
YY_STACK_PRINT (yyss, yyssp);
*++yyvsp = yyval;
-
/* 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. */
@@ -2449,137 +2884,72 @@ yyreduce:
| 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)
{
++yynerrs;
-#if YYERROR_VERBOSE
- yyn = yypact[yystate];
-
- if (YYPACT_NINF < yyn && yyn < YYLAST)
- {
- int yytype = YYTRANSLATE (yychar);
- YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
- YYSIZE_T yysize = yysize0;
- YYSIZE_T yysize1;
- int yysize_overflow = 0;
- char *yymsg = 0;
-# define 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");
+#if ! YYERROR_VERBOSE
+ yyerror (YY_("syntax error"));
+#else
+# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
+ yyssp, yytoken)
+ {
+ 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 (yymsgp);
+ if (yysyntax_error_status == 2)
+ goto yyexhaustedlab;
+ }
+# undef YYSYNTAX_ERROR
#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;
- 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 && yysize <= YYSTACK_ALLOC_MAXIMUM)
- yymsg = (char *) YYSTACK_ALLOC (yysize);
- if (yymsg)
- {
- /* 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 = *yyf))
- {
- if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
- {
- yyp += yytnamerr (yyp, yyarg[yyi++]);
- yyf += 2;
- }
- else
- {
- yyp++;
- yyf++;
- }
- }
- yyerror (yymsg);
- YYSTACK_FREE (yymsg);
- }
- else
- {
- yyerror (YY_("syntax error"));
- goto yyexhaustedlab;
- }
- }
- else
-#endif /* YYERROR_VERBOSE */
- yyerror (YY_("syntax error"));
}
if (yyerrstatus == 3)
{
- /* If just tried and failed to reuse look-ahead token after an
+ /* If just tried and failed to reuse lookahead token after an
error, discard it. */
if (yychar <= YYEOF)
- {
+ {
/* Return failure if at end of input. */
if (yychar == YYEOF)
YYABORT;
- }
+ }
else
{
- yydestruct ("Error: discarding", yytoken, &yylval);
+ yydestruct ("Error: discarding",
+ yytoken, &yylval);
yychar = YYEMPTY;
}
}
- /* Else will try to reuse look-ahead token after shifting the error
+ /* Else will try to reuse lookahead token after shifting the error
token. */
goto yyerrlab1;
@@ -2592,11 +2962,14 @@ yyerrorlab:
/* Pacify compilers like GCC when the user code never invokes
YYERROR and the label yyerrorlab therefore never appears in user
code. */
- if (0)
+ if (/*CONSTCOND*/ 0)
goto yyerrorlab;
-yyvsp -= yylen;
- yyssp -= yylen;
+ /* Do not reclaim the symbols of the rule which action triggered
+ this YYERROR. */
+ YYPOPSTACK (yylen);
+ yylen = 0;
+ YY_STACK_PRINT (yyss, yyssp);
yystate = *yyssp;
goto yyerrlab1;
@@ -2610,7 +2983,7 @@ yyerrlab1:
for (;;)
{
yyn = yypact[yystate];
- if (yyn != YYPACT_NINF)
+ if (!yypact_value_is_default (yyn))
{
yyn += YYTERROR;
if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
@@ -2626,19 +2999,17 @@ yyerrlab1:
YYABORT;
- yydestruct ("Error: popping", yystos[yystate], yyvsp);
- YYPOPSTACK;
+ yydestruct ("Error: popping",
+ yystos[yystate], yyvsp);
+ YYPOPSTACK (1);
yystate = *yyssp;
YY_STACK_PRINT (yyss, yyssp);
}
- if (yyn == YYFINAL)
- YYACCEPT;
-
*++yyvsp = yylval;
- /* Shift the error token. */
+ /* Shift the error token. */
YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
yystate = yyn;
@@ -2659,7 +3030,7 @@ yyabortlab:
yyresult = 1;
goto yyreturn;
-#ifndef yyoverflow
+#if !defined(yyoverflow) || YYERROR_VERBOSE
/*-------------------------------------------------.
| yyexhaustedlab -- memory exhaustion comes here. |
`-------------------------------------------------*/
@@ -2670,24 +3041,40 @@ yyexhaustedlab:
#endif
yyreturn:
- if (yychar != YYEOF && yychar != YYEMPTY)
- yydestruct ("Cleanup: discarding lookahead",
- yytoken, &yylval);
+ if (yychar != YYEMPTY)
+ {
+ /* 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);
+ }
+ /* Do not reclaim the symbols of the rule which action triggered
+ this YYABORT or YYACCEPT. */
+ YYPOPSTACK (yylen);
+ YY_STACK_PRINT (yyss, yyssp);
while (yyssp != yyss)
{
yydestruct ("Cleanup: popping",
yystos[*yyssp], yyvsp);
- YYPOPSTACK;
+ YYPOPSTACK (1);
}
#ifndef yyoverflow
if (yyss != yyssa)
YYSTACK_FREE (yyss);
#endif
- return yyresult;
+#if YYERROR_VERBOSE
+ if (yymsg != yymsgbuf)
+ YYSTACK_FREE (yymsg);
+#endif
+ /* Make sure YYID is used. */
+ return YYID (yyresult);
}
-#line 949 "parse.y"
+
+/* Line 2067 of yacc.c */
+#line 947 "parse.y"
@@ -2710,6 +3097,10 @@ void build_eof_action()
else
{
sceof[scon_stk[i]] = true;
+
+ if (previous_continued_action /* && previous action was regular */)
+ add_action("YY_RULE_SETUP\n");
+
snprintf( action_text, sizeof(action_text), "case YY_STATE_EOF(%s):\n",
scname[scon_stk[i]] );
add_action( action_text );