parser.c
This file
Path
src/parser.c
4,188 lines · 138.6 KiB · C
Last changed by
Fix parser to allow binary operators for binding syntax (#3326)itchynybefore adoptionaaace54
History of this fileTake it
1/* A Bison parser, made by GNU Bison 3.8.2. */23/* Bison implementation for Yacc-like parsers in C45 Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation,6 Inc.78 This program is free software: you can redistribute it and/or modify9 it under the terms of the GNU General Public License as published by10 the Free Software Foundation, either version 3 of the License, or11 (at your option) any later version.1213 This program is distributed in the hope that it will be useful,14 but WITHOUT ANY WARRANTY; without even the implied warranty of15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the16 GNU General Public License for more details.1718 You should have received a copy of the GNU General Public License19 along with this program. If not, see <https://www.gnu.org/licenses/>. */2021/* As a special exception, you may create a larger work that contains22 part or all of the Bison parser skeleton and distribute that work23 under terms of your choice, so long as that work isn't itself a24 parser generator using the skeleton or a modified version thereof25 as a parser skeleton. Alternatively, if you modify or redistribute26 the parser skeleton itself, you may (at your option) remove this27 special exception, which will cause the skeleton and the resulting28 Bison output files to be licensed under the GNU General Public29 License without this special exception.3031 This special exception was added by the Free Software Foundation in32 version 2.2 of Bison. */3334/* C LALR(1) parser skeleton written by Richard Stallman, by35 simplifying the original so-called "semantic" parser. */3637/* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual,38 especially those whose name start with YY_ or yy_. They are39 private implementation details that can be changed or removed. */4041/* All symbols defined below should begin with yy or YY, to avoid42 infringing on user name space. This should be done even for local43 variables, as they might otherwise be expanded by user macros.44 There are some unavoidable exceptions within include files to45 define necessary library symbols; they are noted "INFRINGES ON46 USER NAME SPACE" below. */4748/* Identify Bison output, and Bison version. */49#define YYBISON 308025051/* Bison version string. */52#define YYBISON_VERSION "3.8.2"5354/* Skeleton name. */55#define YYSKELETON_NAME "yacc.c"5657/* Pure parsers. */58#define YYPURE 15960/* Push parsers. */61#define YYPUSH 06263/* Pull parsers. */64#define YYPULL 16566676869/* First part of user prologue. */70#line 1 "src/parser.y"7172#include <assert.h>73#include <math.h>74#include <stdio.h>75#include <string.h>76#include "compile.h"77#include "jv_alloc.h"78#include "builtin.h"79#define YYMALLOC jv_mem_alloc80#define YYFREE jv_mem_free8182#line 83 "src/parser.c"8384# ifndef YY_CAST85# ifdef __cplusplus86# define YY_CAST(Type, Val) static_cast<Type> (Val)87# define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type> (Val)88# else89# define YY_CAST(Type, Val) ((Type) (Val))90# define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val))91# endif92# endif93# ifndef YY_NULLPTR94# if defined __cplusplus95# if 201103L <= __cplusplus96# define YY_NULLPTR nullptr97# else98# define YY_NULLPTR 099# endif100# else101# define YY_NULLPTR ((void*)0)102# endif103# endif104105/* Use api.header.include to #include this header106 instead of duplicating it here. */107#ifndef YY_YY_SRC_PARSER_H_INCLUDED108# define YY_YY_SRC_PARSER_H_INCLUDED109/* Debug traces. */110#ifndef YYDEBUG111# define YYDEBUG 0112#endif113#if YYDEBUG114extern int yydebug;115#endif116/* "%code requires" blocks. */117#line 12 "src/parser.y"118119#include "locfile.h"120struct lexer_param;121122#define YYLTYPE location123#define YYLLOC_DEFAULT(Loc, Rhs, N) \124 do { \125 if (N) { \126 (Loc).start = YYRHSLOC(Rhs, 1).start; \127 (Loc).end = YYRHSLOC(Rhs, N).end; \128 } else { \129 (Loc).start = YYRHSLOC(Rhs, 0).end; \130 (Loc).end = YYRHSLOC(Rhs, 0).end; \131 } \132 } while (0)133134#line 135 "src/parser.c"135136/* Token kinds. */137#ifndef YYTOKENTYPE138# define YYTOKENTYPE139 enum yytokentype140 {141 YYEMPTY = -2,142 YYEOF = 0, /* "end of file" */143 YYerror = 256, /* error */144 YYUNDEF = 257, /* "invalid token" */145 INVALID_CHARACTER = 258, /* INVALID_CHARACTER */146 IDENT = 259, /* IDENT */147 FIELD = 260, /* FIELD */148 BINDING = 261, /* BINDING */149 LITERAL = 262, /* LITERAL */150 FORMAT = 263, /* FORMAT */151 REC = 264, /* ".." */152 SETMOD = 265, /* "%=" */153 EQ = 266, /* "==" */154 NEQ = 267, /* "!=" */155 DEFINEDOR = 268, /* "//" */156 AS = 269, /* "as" */157 DEF = 270, /* "def" */158 MODULE = 271, /* "module" */159 IMPORT = 272, /* "import" */160 INCLUDE = 273, /* "include" */161 IF = 274, /* "if" */162 THEN = 275, /* "then" */163 ELSE = 276, /* "else" */164 ELSE_IF = 277, /* "elif" */165 REDUCE = 278, /* "reduce" */166 FOREACH = 279, /* "foreach" */167 END = 280, /* "end" */168 AND = 281, /* "and" */169 OR = 282, /* "or" */170 TRY = 283, /* "try" */171 CATCH = 284, /* "catch" */172 LABEL = 285, /* "label" */173 BREAK = 286, /* "break" */174 LOC = 287, /* "$__loc__" */175 SETPIPE = 288, /* "|=" */176 SETPLUS = 289, /* "+=" */177 SETMINUS = 290, /* "-=" */178 SETMULT = 291, /* "*=" */179 SETDIV = 292, /* "/=" */180 SETDEFINEDOR = 293, /* "//=" */181 LESSEQ = 294, /* "<=" */182 GREATEREQ = 295, /* ">=" */183 ALTERNATION = 296, /* "?//" */184 QQSTRING_START = 297, /* QQSTRING_START */185 QQSTRING_TEXT = 298, /* QQSTRING_TEXT */186 QQSTRING_INTERP_START = 299, /* QQSTRING_INTERP_START */187 QQSTRING_INTERP_END = 300, /* QQSTRING_INTERP_END */188 QQSTRING_END = 301, /* QQSTRING_END */189 FUNCDEF = 302, /* FUNCDEF */190 NONOPT = 303 /* NONOPT */191 };192 typedef enum yytokentype yytoken_kind_t;193#endif194/* Token kinds. */195#define YYEMPTY -2196#define YYEOF 0197#define YYerror 256198#define YYUNDEF 257199#define INVALID_CHARACTER 258200#define IDENT 259201#define FIELD 260202#define BINDING 261203#define LITERAL 262204#define FORMAT 263205#define REC 264206#define SETMOD 265207#define EQ 266208#define NEQ 267209#define DEFINEDOR 268210#define AS 269211#define DEF 270212#define MODULE 271213#define IMPORT 272214#define INCLUDE 273215#define IF 274216#define THEN 275217#define ELSE 276218#define ELSE_IF 277219#define REDUCE 278220#define FOREACH 279221#define END 280222#define AND 281223#define OR 282224#define TRY 283225#define CATCH 284226#define LABEL 285227#define BREAK 286228#define LOC 287229#define SETPIPE 288230#define SETPLUS 289231#define SETMINUS 290232#define SETMULT 291233#define SETDIV 292234#define SETDEFINEDOR 293235#define LESSEQ 294236#define GREATEREQ 295237#define ALTERNATION 296238#define QQSTRING_START 297239#define QQSTRING_TEXT 298240#define QQSTRING_INTERP_START 299241#define QQSTRING_INTERP_END 300242#define QQSTRING_END 301243#define FUNCDEF 302244#define NONOPT 303245246/* Value type. */247#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED248union YYSTYPE249{250#line 32 "src/parser.y"251252 jv literal;253 block blk;254255#line 256 "src/parser.c"256257};258typedef union YYSTYPE YYSTYPE;259# define YYSTYPE_IS_TRIVIAL 1260# define YYSTYPE_IS_DECLARED 1261#endif262263/* Location type. */264#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED265typedef struct YYLTYPE YYLTYPE;266struct YYLTYPE267{268 int first_line;269 int first_column;270 int last_line;271 int last_column;272};273# define YYLTYPE_IS_DECLARED 1274# define YYLTYPE_IS_TRIVIAL 1275#endif276277278279280int yyparse (block* answer, int* errors, struct locfile* locations, struct lexer_param* lexer_param_ptr);281282283#endif /* !YY_YY_SRC_PARSER_H_INCLUDED */284/* Symbol kind. */285enum yysymbol_kind_t286{287 YYSYMBOL_YYEMPTY = -2,288 YYSYMBOL_YYEOF = 0, /* "end of file" */289 YYSYMBOL_YYerror = 1, /* error */290 YYSYMBOL_YYUNDEF = 2, /* "invalid token" */291 YYSYMBOL_INVALID_CHARACTER = 3, /* INVALID_CHARACTER */292 YYSYMBOL_IDENT = 4, /* IDENT */293 YYSYMBOL_FIELD = 5, /* FIELD */294 YYSYMBOL_BINDING = 6, /* BINDING */295 YYSYMBOL_LITERAL = 7, /* LITERAL */296 YYSYMBOL_FORMAT = 8, /* FORMAT */297 YYSYMBOL_REC = 9, /* ".." */298 YYSYMBOL_SETMOD = 10, /* "%=" */299 YYSYMBOL_EQ = 11, /* "==" */300 YYSYMBOL_NEQ = 12, /* "!=" */301 YYSYMBOL_DEFINEDOR = 13, /* "//" */302 YYSYMBOL_AS = 14, /* "as" */303 YYSYMBOL_DEF = 15, /* "def" */304 YYSYMBOL_MODULE = 16, /* "module" */305 YYSYMBOL_IMPORT = 17, /* "import" */306 YYSYMBOL_INCLUDE = 18, /* "include" */307 YYSYMBOL_IF = 19, /* "if" */308 YYSYMBOL_THEN = 20, /* "then" */309 YYSYMBOL_ELSE = 21, /* "else" */310 YYSYMBOL_ELSE_IF = 22, /* "elif" */311 YYSYMBOL_REDUCE = 23, /* "reduce" */312 YYSYMBOL_FOREACH = 24, /* "foreach" */313 YYSYMBOL_END = 25, /* "end" */314 YYSYMBOL_AND = 26, /* "and" */315 YYSYMBOL_OR = 27, /* "or" */316 YYSYMBOL_TRY = 28, /* "try" */317 YYSYMBOL_CATCH = 29, /* "catch" */318 YYSYMBOL_LABEL = 30, /* "label" */319 YYSYMBOL_BREAK = 31, /* "break" */320 YYSYMBOL_LOC = 32, /* "$__loc__" */321 YYSYMBOL_SETPIPE = 33, /* "|=" */322 YYSYMBOL_SETPLUS = 34, /* "+=" */323 YYSYMBOL_SETMINUS = 35, /* "-=" */324 YYSYMBOL_SETMULT = 36, /* "*=" */325 YYSYMBOL_SETDIV = 37, /* "/=" */326 YYSYMBOL_SETDEFINEDOR = 38, /* "//=" */327 YYSYMBOL_LESSEQ = 39, /* "<=" */328 YYSYMBOL_GREATEREQ = 40, /* ">=" */329 YYSYMBOL_ALTERNATION = 41, /* "?//" */330 YYSYMBOL_QQSTRING_START = 42, /* QQSTRING_START */331 YYSYMBOL_QQSTRING_TEXT = 43, /* QQSTRING_TEXT */332 YYSYMBOL_QQSTRING_INTERP_START = 44, /* QQSTRING_INTERP_START */333 YYSYMBOL_QQSTRING_INTERP_END = 45, /* QQSTRING_INTERP_END */334 YYSYMBOL_QQSTRING_END = 46, /* QQSTRING_END */335 YYSYMBOL_FUNCDEF = 47, /* FUNCDEF */336 YYSYMBOL_48_ = 48, /* '|' */337 YYSYMBOL_49_ = 49, /* ',' */338 YYSYMBOL_50_ = 50, /* '=' */339 YYSYMBOL_51_ = 51, /* '<' */340 YYSYMBOL_52_ = 52, /* '>' */341 YYSYMBOL_53_ = 53, /* '+' */342 YYSYMBOL_54_ = 54, /* '-' */343 YYSYMBOL_55_ = 55, /* '*' */344 YYSYMBOL_56_ = 56, /* '/' */345 YYSYMBOL_57_ = 57, /* '%' */346 YYSYMBOL_NONOPT = 58, /* NONOPT */347 YYSYMBOL_59_ = 59, /* '?' */348 YYSYMBOL_60_ = 60, /* '.' */349 YYSYMBOL_61_ = 61, /* '[' */350 YYSYMBOL_62_ = 62, /* ';' */351 YYSYMBOL_63_ = 63, /* ':' */352 YYSYMBOL_64_ = 64, /* '(' */353 YYSYMBOL_65_ = 65, /* ')' */354 YYSYMBOL_66_ = 66, /* ']' */355 YYSYMBOL_67_ = 67, /* '{' */356 YYSYMBOL_68_ = 68, /* '}' */357 YYSYMBOL_69_ = 69, /* '$' */358 YYSYMBOL_YYACCEPT = 70, /* $accept */359 YYSYMBOL_TopLevel = 71, /* TopLevel */360 YYSYMBOL_Module = 72, /* Module */361 YYSYMBOL_Imports = 73, /* Imports */362 YYSYMBOL_FuncDefs = 74, /* FuncDefs */363 YYSYMBOL_Query = 75, /* Query */364 YYSYMBOL_Expr = 76, /* Expr */365 YYSYMBOL_Import = 77, /* Import */366 YYSYMBOL_ImportWhat = 78, /* ImportWhat */367 YYSYMBOL_ImportFrom = 79, /* ImportFrom */368 YYSYMBOL_FuncDef = 80, /* FuncDef */369 YYSYMBOL_Params = 81, /* Params */370 YYSYMBOL_Param = 82, /* Param */371 YYSYMBOL_StringStart = 83, /* StringStart */372 YYSYMBOL_String = 84, /* String */373 YYSYMBOL_QQString = 85, /* QQString */374 YYSYMBOL_ElseBody = 86, /* ElseBody */375 YYSYMBOL_Term = 87, /* Term */376 YYSYMBOL_Args = 88, /* Args */377 YYSYMBOL_Arg = 89, /* Arg */378 YYSYMBOL_RepPatterns = 90, /* RepPatterns */379 YYSYMBOL_Patterns = 91, /* Patterns */380 YYSYMBOL_Pattern = 92, /* Pattern */381 YYSYMBOL_ArrayPats = 93, /* ArrayPats */382 YYSYMBOL_ObjPats = 94, /* ObjPats */383 YYSYMBOL_ObjPat = 95, /* ObjPat */384 YYSYMBOL_Keyword = 96, /* Keyword */385 YYSYMBOL_DictPairs = 97, /* DictPairs */386 YYSYMBOL_DictPair = 98, /* DictPair */387 YYSYMBOL_DictExpr = 99 /* DictExpr */388};389typedef enum yysymbol_kind_t yysymbol_kind_t;390391392/* Second part of user prologue. */393#line 127 "src/parser.y"394395#include "lexer.h"396struct lexer_param {397 yyscan_t lexer;398};399#define FAIL(loc, msg) \400 do { \401 location l = loc; \402 yyerror(&l, answer, errors, locations, lexer_param_ptr, msg); \403 /*YYERROR*/; \404 } while (0)405406void yyerror(YYLTYPE* loc, block* answer, int* errors,407 struct locfile* locations, struct lexer_param* lexer_param_ptr, const char *s){408 (*errors)++;409 locfile_locate(locations, *loc, "jq: error: %s", s);410}411412int yylex(YYSTYPE* yylval, YYLTYPE* yylloc, block* answer, int* errors,413 struct locfile* locations, struct lexer_param* lexer_param_ptr) {414 yyscan_t lexer = lexer_param_ptr->lexer;415 int tok = jq_yylex(yylval, yylloc, lexer);416 if ((tok == LITERAL || tok == QQSTRING_TEXT) && !jv_is_valid(yylval->literal)) {417 jv msg = jv_invalid_get_msg(jv_copy(yylval->literal));418 if (jv_get_kind(msg) == JV_KIND_STRING) {419 FAIL(*yylloc, jv_string_value(msg));420 } else {421 FAIL(*yylloc, "Invalid literal");422 }423 jv_free(msg);424 jv_free(yylval->literal);425 yylval->literal = jv_null();426 }427 return tok;428}429430/* Returns string message if the block is a constant that is not valid as an431 * object key. */432static jv check_object_key(block k) {433 if (block_is_const(k) && block_const_kind(k) != JV_KIND_STRING) {434 char errbuf[15];435 return jv_string_fmt("Cannot use %s (%s) as object key",436 jv_kind_name(block_const_kind(k)),437 jv_dump_string_trunc(block_const(k), errbuf, sizeof(errbuf)));438 }439 return jv_invalid();440}441442static block gen_index(block obj, block key) {443 return BLOCK(gen_subexp(key), obj, gen_op_simple(INDEX));444}445446static block gen_index_opt(block obj, block key) {447 return BLOCK(gen_subexp(key), obj, gen_op_simple(INDEX_OPT));448}449450static block gen_slice_index(block obj, block start, block end, opcode idx_op) {451 block key = BLOCK(gen_subexp(gen_const(jv_object())),452 gen_subexp(gen_const(jv_string("start"))),453 gen_subexp(start),454 gen_op_simple(INSERT),455 gen_subexp(gen_const(jv_string("end"))),456 gen_subexp(end),457 gen_op_simple(INSERT));458 return BLOCK(key, obj, gen_op_simple(idx_op));459}460461static block constant_fold(block a, block b, int op) {462 if (!block_is_single(a) || !block_is_const(a) ||463 !block_is_single(b) || !block_is_const(b))464 return gen_noop();465466 jv jv_a = block_const(a);467 block_free(a);468 jv jv_b = block_const(b);469 block_free(b);470471 jv res = jv_invalid();472 switch (op) {473 case '+': res = binop_plus(jv_a, jv_b); break;474 case '-': res = binop_minus(jv_a, jv_b); break;475 case '*': res = binop_multiply(jv_a, jv_b); break;476 case '/': res = binop_divide(jv_a, jv_b); break;477 case '%': res = binop_mod(jv_a, jv_b); break;478 case EQ: res = binop_equal(jv_a, jv_b); break;479 case NEQ: res = binop_notequal(jv_a, jv_b); break;480 case '<': res = binop_less(jv_a, jv_b); break;481 case '>': res = binop_greater(jv_a, jv_b); break;482 case LESSEQ: res = binop_lesseq(jv_a, jv_b); break;483 case GREATEREQ: res = binop_greatereq(jv_a, jv_b); break;484 }485486 if (jv_is_valid(res))487 return gen_const(res);488489 return gen_error(jv_invalid_get_msg(res));490}491492static block gen_binop(block a, block b, int op) {493 block folded = constant_fold(a, b, op);494 if (!block_is_noop(folded))495 return folded;496497 const char* funcname = 0;498 switch (op) {499 case '+': funcname = "_plus"; break;500 case '-': funcname = "_minus"; break;501 case '*': funcname = "_multiply"; break;502 case '/': funcname = "_divide"; break;503 case '%': funcname = "_mod"; break;504 case EQ: funcname = "_equal"; break;505 case NEQ: funcname = "_notequal"; break;506 case '<': funcname = "_less"; break;507 case '>': funcname = "_greater"; break;508 case LESSEQ: funcname = "_lesseq"; break;509 case GREATEREQ: funcname = "_greatereq"; break;510 }511 assert(funcname);512513 return gen_call(funcname, BLOCK(gen_lambda(a), gen_lambda(b)));514}515516static block gen_format(block a, jv fmt) {517 return BLOCK(a, gen_call("format", gen_lambda(gen_const(fmt))));518}519520static block gen_definedor_assign(block object, block val) {521 block tmp = gen_op_var_fresh(STOREV, "tmp");522 return BLOCK(gen_op_simple(DUP),523 val, tmp,524 gen_call("_modify", BLOCK(gen_lambda(object),525 gen_lambda(gen_definedor(gen_noop(),526 gen_op_bound(LOADV, tmp))))));527}528529static block gen_update(block object, block val, int optype) {530 block tmp = gen_op_var_fresh(STOREV, "tmp");531 return BLOCK(gen_op_simple(DUP),532 val,533 tmp,534 gen_call("_modify", BLOCK(gen_lambda(object),535 gen_lambda(gen_binop(gen_noop(),536 gen_op_bound(LOADV, tmp),537 optype)))));538}539540static block gen_loc_object(location *loc, struct locfile *locations) {541 return gen_const(JV_OBJECT(jv_string("file"), jv_copy(locations->fname),542 jv_string("line"), jv_number(locfile_get_line(locations, loc->start) + 1)));543}544545546#line 547 "src/parser.c"547548549#ifdef short550# undef short551#endif552553/* On compilers that do not define __PTRDIFF_MAX__ etc., make sure554 <limits.h> and (if available) <stdint.h> are included555 so that the code can choose integer types of a good width. */556557#ifndef __PTRDIFF_MAX__558# include <limits.h> /* INFRINGES ON USER NAME SPACE */559# if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__560# include <stdint.h> /* INFRINGES ON USER NAME SPACE */561# define YY_STDINT_H562# endif563#endif564565/* Narrow types that promote to a signed type and that can represent a566 signed or unsigned integer of at least N bits. In tables they can567 save space and decrease cache pressure. Promoting to a signed type568 helps avoid bugs in integer arithmetic. */569570#ifdef __INT_LEAST8_MAX__571typedef __INT_LEAST8_TYPE__ yytype_int8;572#elif defined YY_STDINT_H573typedef int_least8_t yytype_int8;574#else575typedef signed char yytype_int8;576#endif577578#ifdef __INT_LEAST16_MAX__579typedef __INT_LEAST16_TYPE__ yytype_int16;580#elif defined YY_STDINT_H581typedef int_least16_t yytype_int16;582#else583typedef short yytype_int16;584#endif585586/* Work around bug in HP-UX 11.23, which defines these macros587 incorrectly for preprocessor constants. This workaround can likely588 be removed in 2023, as HPE has promised support for HP-UX 11.23589 (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of590 <https://h20195.www2.hpe.com/V2/getpdf.aspx/4AA4-7673ENW.pdf>. */591#ifdef __hpux592# undef UINT_LEAST8_MAX593# undef UINT_LEAST16_MAX594# define UINT_LEAST8_MAX 255595# define UINT_LEAST16_MAX 65535596#endif597598#if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__599typedef __UINT_LEAST8_TYPE__ yytype_uint8;600#elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \601 && UINT_LEAST8_MAX <= INT_MAX)602typedef uint_least8_t yytype_uint8;603#elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX604typedef unsigned char yytype_uint8;605#else606typedef short yytype_uint8;607#endif608609#if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__610typedef __UINT_LEAST16_TYPE__ yytype_uint16;611#elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \612 && UINT_LEAST16_MAX <= INT_MAX)613typedef uint_least16_t yytype_uint16;614#elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX615typedef unsigned short yytype_uint16;616#else617typedef int yytype_uint16;618#endif619620#ifndef YYPTRDIFF_T621# if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__622# define YYPTRDIFF_T __PTRDIFF_TYPE__623# define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__624# elif defined PTRDIFF_MAX625# ifndef ptrdiff_t626# include <stddef.h> /* INFRINGES ON USER NAME SPACE */627# endif628# define YYPTRDIFF_T ptrdiff_t629# define YYPTRDIFF_MAXIMUM PTRDIFF_MAX630# else631# define YYPTRDIFF_T long632# define YYPTRDIFF_MAXIMUM LONG_MAX633# endif634#endif635636#ifndef YYSIZE_T637# ifdef __SIZE_TYPE__638# define YYSIZE_T __SIZE_TYPE__639# elif defined size_t640# define YYSIZE_T size_t641# elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__642# include <stddef.h> /* INFRINGES ON USER NAME SPACE */643# define YYSIZE_T size_t644# else645# define YYSIZE_T unsigned646# endif647#endif648649#define YYSIZE_MAXIMUM \650 YY_CAST (YYPTRDIFF_T, \651 (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1) \652 ? YYPTRDIFF_MAXIMUM \653 : YY_CAST (YYSIZE_T, -1)))654655#define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X))656657658/* Stored state numbers (used for stacks). */659typedef yytype_int16 yy_state_t;660661/* State numbers in computations. */662typedef int yy_state_fast_t;663664#ifndef YY_665# if defined YYENABLE_NLS && YYENABLE_NLS666# if ENABLE_NLS667# include <libintl.h> /* INFRINGES ON USER NAME SPACE */668# define YY_(Msgid) dgettext ("bison-runtime", Msgid)669# endif670# endif671# ifndef YY_672# define YY_(Msgid) Msgid673# endif674#endif675676677#ifndef YY_ATTRIBUTE_PURE678# if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__)679# define YY_ATTRIBUTE_PURE __attribute__ ((__pure__))680# else681# define YY_ATTRIBUTE_PURE682# endif683#endif684685#ifndef YY_ATTRIBUTE_UNUSED686# if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)687# define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__))688# else689# define YY_ATTRIBUTE_UNUSED690# endif691#endif692693/* Suppress unused-variable warnings by "using" E. */694#if ! defined lint || defined __GNUC__695# define YY_USE(E) ((void) (E))696#else697# define YY_USE(E) /* empty */698#endif699700/* Suppress an incorrect diagnostic about yylval being uninitialized. */701#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__702# if __GNUC__ * 100 + __GNUC_MINOR__ < 407703# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \704 _Pragma ("GCC diagnostic push") \705 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")706# else707# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \708 _Pragma ("GCC diagnostic push") \709 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \710 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")711# endif712# define YY_IGNORE_MAYBE_UNINITIALIZED_END \713 _Pragma ("GCC diagnostic pop")714#else715# define YY_INITIAL_VALUE(Value) Value716#endif717#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN718# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN719# define YY_IGNORE_MAYBE_UNINITIALIZED_END720#endif721#ifndef YY_INITIAL_VALUE722# define YY_INITIAL_VALUE(Value) /* Nothing. */723#endif724725#if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__726# define YY_IGNORE_USELESS_CAST_BEGIN \727 _Pragma ("GCC diagnostic push") \728 _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"")729# define YY_IGNORE_USELESS_CAST_END \730 _Pragma ("GCC diagnostic pop")731#endif732#ifndef YY_IGNORE_USELESS_CAST_BEGIN733# define YY_IGNORE_USELESS_CAST_BEGIN734# define YY_IGNORE_USELESS_CAST_END735#endif736737738#define YY_ASSERT(E) ((void) (0 && (E)))739740#if 1741742/* The parser invokes alloca or malloc; define the necessary symbols. */743744# ifdef YYSTACK_USE_ALLOCA745# if YYSTACK_USE_ALLOCA746# ifdef __GNUC__747# define YYSTACK_ALLOC __builtin_alloca748# elif defined __BUILTIN_VA_ARG_INCR749# include <alloca.h> /* INFRINGES ON USER NAME SPACE */750# elif defined _AIX751# define YYSTACK_ALLOC __alloca752# elif defined _MSC_VER753# include <malloc.h> /* INFRINGES ON USER NAME SPACE */754# define alloca _alloca755# else756# define YYSTACK_ALLOC alloca757# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS758# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */759 /* Use EXIT_SUCCESS as a witness for stdlib.h. */760# ifndef EXIT_SUCCESS761# define EXIT_SUCCESS 0762# endif763# endif764# endif765# endif766# endif767768# ifdef YYSTACK_ALLOC769 /* Pacify GCC's 'empty if-body' warning. */770# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)771# ifndef YYSTACK_ALLOC_MAXIMUM772 /* The OS might guarantee only one guard page at the bottom of the stack,773 and a page size can be as small as 4096 bytes. So we cannot safely774 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number775 to allow for a few compiler-allocated temporary stack slots. */776# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */777# endif778# else779# define YYSTACK_ALLOC YYMALLOC780# define YYSTACK_FREE YYFREE781# ifndef YYSTACK_ALLOC_MAXIMUM782# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM783# endif784# if (defined __cplusplus && ! defined EXIT_SUCCESS \785 && ! ((defined YYMALLOC || defined malloc) \786 && (defined YYFREE || defined free)))787# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */788# ifndef EXIT_SUCCESS789# define EXIT_SUCCESS 0790# endif791# endif792# ifndef YYMALLOC793# define YYMALLOC malloc794# if ! defined malloc && ! defined EXIT_SUCCESS795void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */796# endif797# endif798# ifndef YYFREE799# define YYFREE free800# if ! defined free && ! defined EXIT_SUCCESS801void free (void *); /* INFRINGES ON USER NAME SPACE */802# endif803# endif804# endif805#endif /* 1 */806807#if (! defined yyoverflow \808 && (! defined __cplusplus \809 || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \810 && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))811812/* A type that is properly aligned for any stack member. */813union yyalloc814{815 yy_state_t yyss_alloc;816 YYSTYPE yyvs_alloc;817 YYLTYPE yyls_alloc;818};819820/* The size of the maximum gap between one aligned stack and the next. */821# define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1)822823/* The size of an array large to enough to hold all stacks, each with824 N elements. */825# define YYSTACK_BYTES(N) \826 ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE) \827 + YYSIZEOF (YYLTYPE)) \828 + 2 * YYSTACK_GAP_MAXIMUM)829830# define YYCOPY_NEEDED 1831832/* Relocate STACK from its old location to the new one. The833 local variables YYSIZE and YYSTACKSIZE give the old and new number of834 elements in the stack, and YYPTR gives the new location of the835 stack. Advance YYPTR to a properly aligned location for the next836 stack. */837# define YYSTACK_RELOCATE(Stack_alloc, Stack) \838 do \839 { \840 YYPTRDIFF_T yynewbytes; \841 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \842 Stack = &yyptr->Stack_alloc; \843 yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \844 yyptr += yynewbytes / YYSIZEOF (*yyptr); \845 } \846 while (0)847848#endif849850#if defined YYCOPY_NEEDED && YYCOPY_NEEDED851/* Copy COUNT objects from SRC to DST. The source and destination do852 not overlap. */853# ifndef YYCOPY854# if defined __GNUC__ && 1 < __GNUC__855# define YYCOPY(Dst, Src, Count) \856 __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src)))857# else858# define YYCOPY(Dst, Src, Count) \859 do \860 { \861 YYPTRDIFF_T yyi; \862 for (yyi = 0; yyi < (Count); yyi++) \863 (Dst)[yyi] = (Src)[yyi]; \864 } \865 while (0)866# endif867# endif868#endif /* !YYCOPY_NEEDED */869870/* YYFINAL -- State number of the termination state. */871#define YYFINAL 31872/* YYLAST -- Last index in YYTABLE. */873#define YYLAST 1226874875/* YYNTOKENS -- Number of terminals. */876#define YYNTOKENS 70877/* YYNNTS -- Number of nonterminals. */878#define YYNNTS 30879/* YYNRULES -- Number of rules. */880#define YYNRULES 168881/* YYNSTATES -- Number of states. */882#define YYNSTATES 312883884/* YYMAXUTOK -- Last valid token kind. */885#define YYMAXUTOK 303886887888/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM889 as returned by yylex, with out-of-bounds checking. */890#define YYTRANSLATE(YYX) \891 (0 <= (YYX) && (YYX) <= YYMAXUTOK \892 ? YY_CAST (yysymbol_kind_t, yytranslate[YYX]) \893 : YYSYMBOL_YYUNDEF)894895/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM896 as returned by yylex. */897static const yytype_int8 yytranslate[] =898{899 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,900 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,901 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,902 2, 2, 2, 2, 2, 2, 69, 57, 2, 2,903 64, 65, 55, 53, 49, 54, 60, 56, 2, 2,904 2, 2, 2, 2, 2, 2, 2, 2, 63, 62,905 51, 50, 52, 59, 2, 2, 2, 2, 2, 2,906 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,907 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,908 2, 61, 2, 66, 2, 2, 2, 2, 2, 2,909 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,910 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,911 2, 2, 2, 67, 48, 68, 2, 2, 2, 2,912 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,913 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,914 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,915 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,916 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,917 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,918 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,919 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,920 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,921 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,922 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,923 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,924 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,925 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,926 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,927 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,928 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,929 45, 46, 47, 58930};931932#if YYDEBUG933/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */934static const yytype_int16 yyrline[] =935{936 0, 282, 282, 285, 290, 293, 308, 311, 316, 319,937 325, 328, 331, 337, 340, 343, 349, 352, 355, 358,938 361, 364, 367, 370, 373, 376, 379, 382, 385, 388,939 391, 394, 397, 400, 403, 406, 409, 412, 415, 421,940 424, 441, 450, 457, 465, 476, 481, 487, 490, 495,941 499, 506, 509, 515, 522, 525, 528, 534, 537, 540,942 546, 549, 552, 560, 564, 567, 570, 573, 576, 579,943 582, 585, 588, 592, 598, 601, 604, 607, 610, 613,944 616, 619, 622, 625, 628, 631, 634, 637, 640, 643,945 646, 649, 652, 655, 658, 661, 664, 671, 674, 677,946 680, 683, 687, 690, 694, 712, 716, 720, 723, 735,947 740, 741, 742, 743, 746, 749, 754, 759, 762, 767,948 770, 775, 779, 782, 787, 790, 795, 798, 803, 806,949 809, 812, 815, 818, 826, 832, 835, 838, 841, 844,950 847, 850, 853, 856, 859, 862, 865, 868, 871, 874,951 877, 880, 883, 889, 892, 895, 900, 903, 906, 909,952 913, 918, 922, 926, 930, 934, 942, 948, 951953};954#endif955956/** Accessing symbol of state STATE. */957#define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State])958959#if 1960/* The user-facing name of the symbol whose (internal) number is961 YYSYMBOL. No bounds checking. */962static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED;963964/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.965 First, the terminals, then, starting at YYNTOKENS, nonterminals. */966static const char *const yytname[] =967{968 "\"end of file\"", "error", "\"invalid token\"", "INVALID_CHARACTER",969 "IDENT", "FIELD", "BINDING", "LITERAL", "FORMAT", "\"..\"", "\"%=\"",970 "\"==\"", "\"!=\"", "\"//\"", "\"as\"", "\"def\"", "\"module\"",971 "\"import\"", "\"include\"", "\"if\"", "\"then\"", "\"else\"",972 "\"elif\"", "\"reduce\"", "\"foreach\"", "\"end\"", "\"and\"", "\"or\"",973 "\"try\"", "\"catch\"", "\"label\"", "\"break\"", "\"$__loc__\"",974 "\"|=\"", "\"+=\"", "\"-=\"", "\"*=\"", "\"/=\"", "\"//=\"", "\"<=\"",975 "\">=\"", "\"?//\"", "QQSTRING_START", "QQSTRING_TEXT",976 "QQSTRING_INTERP_START", "QQSTRING_INTERP_END", "QQSTRING_END",977 "FUNCDEF", "'|'", "','", "'='", "'<'", "'>'", "'+'", "'-'", "'*'", "'/'",978 "'%'", "NONOPT", "'?'", "'.'", "'['", "';'", "':'", "'('", "')'", "']'",979 "'{'", "'}'", "'$'", "$accept", "TopLevel", "Module", "Imports",980 "FuncDefs", "Query", "Expr", "Import", "ImportWhat", "ImportFrom",981 "FuncDef", "Params", "Param", "StringStart", "String", "QQString",982 "ElseBody", "Term", "Args", "Arg", "RepPatterns", "Patterns", "Pattern",983 "ArrayPats", "ObjPats", "ObjPat", "Keyword", "DictPairs", "DictPair",984 "DictExpr", YY_NULLPTR985};986987static const char *988yysymbol_name (yysymbol_kind_t yysymbol)989{990 return yytname[yysymbol];991}992#endif993994#define YYPACT_NINF (-146)995996#define yypact_value_is_default(Yyn) \997 ((Yyn) == YYPACT_NINF)998999#define YYTABLE_NINF (-154)10001001#define yytable_value_is_error(Yyn) \1002 ((Yyn) == YYTABLE_NINF)10031004/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing1005 STATE-NUM. */1006static const yytype_int16 yypact[] =1007{1008 31, 890, 44, 35, 11, 9, -146, -146, 38, -146,1009 85, 890, 956, 956, 956, 112, 26, -146, -146, 956,1010 279, 345, 412, 608, 59, 25, 1040, 890, -146, -146,1011 -2, -146, 4, 4, 890, 35, 692, 890, -146, -146,1012 20, -18, 1073, 1105, 131, 86, -146, -146, -2, -146,1013 164, 38, 108, 107, -146, 22, 104, 0, -34, 121,1014 124, -146, -146, -146, -146, -146, -146, -146, -146, -146,1015 -146, -146, -146, -146, -146, -146, -146, -146, -146, -146,1016 890, 135, 137, 134, 126, 141, 890, 890, -146, 956,1017 956, 956, 956, -5, 956, 956, 956, 956, 956, 956,1018 956, 956, 956, 956, 956, 956, 956, 956, 956, 956,1019 956, 956, 84, 177, 147, -146, 3, 173, 199, -146,1020 -146, -146, 84, 890, -146, -146, 114, 84, 77, -146,1021 890, 13, 479, -5, -5, 546, 890, -146, -146, -146,1022 -146, -146, -146, 956, -146, 956, 956, 78, 956, 956,1023 -146, 663, 220, 84, -146, 1169, 505, 505, 1137, -146,1024 -5, 1018, 187, 166, 188, 606, 205, 1169, 1169, 1169,1025 1169, 1169, 1169, 505, 505, 1169, 505, 505, 208, 208,1026 -146, -146, -146, -146, 890, -146, -146, 758, 176, 175,1027 890, 184, 6, 57, -146, -146, 890, -146, 123, -146,1028 -146, 83, -146, -146, 18, 185, 189, -146, -146, 84,1029 1137, 200, 200, 200, 203, 200, 200, 206, -146, -146,1030 -146, -42, 207, 209, 210, 890, 212, -45, -146, 213,1031 -5, 890, 33, 193, 28, -146, -146, 71, -146, 824,1032 218, -146, -146, -146, -146, 13, 215, 890, 890, -146,1033 -146, 890, 890, 956, 956, -5, -146, -5, -5, -5,1034 103, -5, 1018, -146, -5, 227, 84, -146, -146, 222,1035 223, 226, 74, -146, -146, 890, -7, 2, 160, 163,1036 200, 200, -146, -146, -146, -146, 225, -146, -146, -146,1037 -146, -146, -146, 235, 170, -146, 890, 890, 890, -5,1038 -146, -146, 18, 105, 76, -146, -146, -146, 890, -146,1039 142, -1461040};10411042/* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.1043 Performed when YYTABLE does not specify something else to do. Zero1044 means the default is an error. */1045static const yytype_uint8 yydefact[] =1046{1047 4, 0, 0, 6, 108, 69, 106, 89, 91, 61,1048 0, 0, 0, 0, 0, 0, 0, 107, 52, 0,1049 0, 0, 0, 0, 0, 0, 15, 0, 54, 90,1050 38, 1, 0, 0, 8, 6, 0, 0, 65, 51,1051 0, 0, 0, 0, 104, 0, 63, 62, 92, 72,1052 0, 0, 71, 0, 95, 0, 0, 0, 0, 162,1053 161, 135, 136, 137, 138, 139, 140, 141, 142, 143,1054 144, 145, 146, 147, 148, 149, 150, 151, 152, 163,1055 0, 159, 164, 0, 154, 0, 0, 0, 5, 0,1056 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,1057 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,1058 0, 0, 10, 0, 68, 88, 0, 0, 0, 44,1059 43, 3, 2, 8, 7, 39, 0, 116, 0, 114,1060 0, 0, 0, 0, 0, 0, 0, 73, 67, 111,1061 94, 110, 93, 0, 113, 0, 0, 0, 0, 0,1062 96, 0, 0, 13, 14, 31, 32, 33, 16, 121,1063 0, 0, 0, 0, 120, 19, 18, 21, 23, 25,1064 27, 30, 20, 36, 37, 17, 34, 35, 22, 24,1065 26, 28, 29, 55, 0, 53, 64, 0, 70, 0,1066 0, 79, 0, 0, 9, 40, 0, 109, 0, 50,1067 49, 0, 47, 101, 0, 0, 0, 103, 102, 12,1068 168, 166, 156, 160, 0, 158, 157, 0, 155, 105,1069 124, 0, 0, 0, 128, 0, 0, 0, 126, 0,1070 0, 0, 0, 81, 0, 66, 112, 0, 78, 0,1071 75, 42, 41, 115, 45, 0, 0, 0, 0, 59,1072 100, 0, 0, 0, 0, 0, 122, 0, 0, 0,1073 0, 0, 0, 123, 0, 119, 11, 56, 80, 77,1074 87, 86, 0, 74, 48, 0, 0, 0, 0, 0,1075 167, 165, 125, 134, 130, 129, 0, 132, 127, 131,1076 76, 84, 83, 85, 0, 58, 0, 0, 0, 0,1077 82, 46, 0, 0, 0, 133, 57, 97, 0, 99,1078 0, 981079};10801081/* YYPGOTO[NTERM-NUM]. */1082static const yytype_int16 yypgoto[] =1083{1084 -146, -146, -146, 236, 179, -1, 1, -146, -146, 253,1085 -8, -146, 53, -146, 5, -146, 7, 284, -146, 115,1086 -146, 60, -100, -146, -146, 48, -145, 169, -146, -1401087};10881089/* YYDEFGOTO[NTERM-NUM]. */1090static const yytype_uint8 yydefgoto[] =1091{1092 0, 2, 3, 34, 121, 112, 26, 35, 36, 118,1093 27, 201, 202, 28, 29, 113, 250, 30, 128, 129,1094 162, 163, 164, 221, 227, 228, 82, 83, 84, 2111095};10961097/* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If1098 positive, shift that token. If negative, reduce the rule whose1099 number is the opposite. If YYTABLE_NINF, syntax error. */1100static const yytype_int16 yytable[] =1101{1102 25, 159, 132, 114, 262, 212, 213, 255, 215, 216,1103 41, 51, 51, 42, 43, 44, 229, 199, 295, 200,1104 55, 57, 296, 263, 256, 52, 123, 46, 81, 143,1105 86, 87, 47, 122, 144, 126, 127, 119, 119, 247,1106 248, 86, 87, 249, 31, 18, 18, 1, 86, 87,1107 86, 87, 32, 33, 86, 87, 160, 115, 116, 117,1108 220, 241, 161, 242, 187, 142, 86, 87, 38, 239,1109 86, 87, 240, 86, 87, 37, 86, 87, 267, 147,1110 39, 86, 87, 130, 131, 153, 154, 88, 140, 40,1111 155, 156, 157, 158, 269, 165, 166, 167, 168, 169,1112 170, 171, 172, 173, 174, 175, 176, 177, 178, 179,1113 180, 181, 182, 280, 281, 123, 192, 229, 45, 86,1114 87, 188, 86, 87, 86, 87, 86, 87, 85, 198,1115 265, 204, 86, 87, 136, 209, 208, 270, 308, 196,1116 293, 309, 197, 214, 210, 245, 210, 210, 246, 210,1117 210, 86, 87, 86, 87, 282, 81, 283, 284, 285,1118 135, 287, 86, 87, 289, 137, 226, 138, 286, 141,1119 307, 86, 87, 139, 189, 151, 195, 4, 5, 6,1120 7, 8, 9, 232, 145, 244, 234, 146, 10, 237,1121 86, 87, 11, 205, 206, 127, 12, 13, 148, 305,1122 149, 14, 150, 15, 16, 17, 186, 311, 86, 87,1123 152, 86, 87, 193, 231, 18, 90, 91, 86, 87,1124 183, 184, 297, 185, 260, 298, 219, 19, 230, -118,1125 266, 94, 301, 20, 21, 235, 190, 22, 272, 191,1126 23, 236, 24, 238, 102, 103, 276, 277, 253, 251,1127 278, 279, 268, 252, 210, 210, 105, 106, 107, 108,1128 109, 110, 111, 109, 110, 111, 254, 226, -117, 143,1129 257, 124, 258, 259, 294, 261, 264, 273, 275, -60,1130 49, 290, 291, 50, -60, 292, 120, 51, 299, -60,1131 -60, -60, -60, -60, 300, 302, 303, 304, 274, -60,1132 -60, -60, 194, 48, -60, -60, -60, 310, -60, 306,1133 288, 243, -60, -60, -60, -60, -60, -60, -60, -60,1134 218, 18, 0, 0, -60, 0, 0, -60, -60, -60,1135 -60, -60, -60, -60, -60, -60, -60, 0, -60, -60,1136 -60, -60, -60, 0, -60, -60, 53, -60, 0, 4,1137 5, 6, 7, 8, 9, 0, 0, 0, 0, 0,1138 10, 0, 0, 0, 11, 0, 0, 0, 12, 13,1139 0, 0, 0, 14, 0, 15, 16, 17, 0, 0,1140 0, 0, 0, 0, 0, 0, 0, 18, 0, 0,1141 0, 0, 0, 0, 0, 0, 0, 0, 0, 19,1142 0, 0, 0, 0, 0, 20, 21, 0, 0, 22,1143 0, 54, 23, 56, 24, 0, 4, 5, 6, 7,1144 8, 9, 0, 0, 0, 0, 0, 10, 0, 0,1145 0, 11, 0, 0, 0, 12, 13, 0, 0, 0,1146 14, 0, 15, 16, 17, 0, 0, 0, 0, 0,1147 0, 0, 0, 0, 18, 0, 0, 0, 0, 0,1148 0, 0, 0, 0, 0, 0, 19, 0, 0, 0,1149 0, 0, 20, 21, 0, 0, 22, 0, 0, 23,1150 203, 24, 0, 4, 5, 6, 7, 8, 9, 0,1151 0, 0, 0, 0, 10, 0, 0, 0, 11, 0,1152 0, 0, 12, 13, 0, 0, 0, 14, 0, 15,1153 16, 17, 0, 0, 0, 0, -154, -154, 0, 0,1154 0, 18, 0, 0, 0, 0, 0, 0, 0, 0,1155 0, 0, 0, 19, 0, 0, 0, 0, 0, 20,1156 21, 0, 0, 22, -154, -154, 23, 207, 24, 0,1157 4, 5, 6, 7, 8, 9, -154, -154, 107, 108,1158 109, 110, 111, 0, 0, 11, 0, 0, 0, 12,1159 13, 0, 0, 0, 14, 0, 0, 16, 17, 0,1160 0, 0, 0, 0, 0, 0, 0, 0, 18, 0,1161 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,1162 19, 0, 0, 0, 0, 0, 20, 21, 0, 58,1163 22, 0, 59, 23, 60, 24, 51, 90, 91, 0,1164 0, 0, 61, 62, 63, 64, 65, 66, 67, 68,1165 69, 70, 71, 72, 73, 74, 75, 76, 77, 78,1166 79, 0, 0, 0, 0, 102, 103, 0, 0, 0,1167 18, 0, 0, 0, 0, 0, 0, 105, 106, 107,1168 108, 109, 110, 111, 217, 0, 0, 59, 0, 60,1169 0, 51, 80, 0, 0, 0, -153, 61, 62, 63,1170 64, 65, 66, 67, 68, 69, 70, 71, 72, 73,1171 74, 75, 76, 77, 78, 79, 4, 5, 6, 7,1172 8, 9, 0, 0, 0, 18, 0, 10, 0, 0,1173 0, 11, 0, 0, 0, 12, 13, 0, 0, 0,1174 14, 0, 15, 16, 17, 0, 0, 80, 0, 0,1175 0, -153, 0, 0, 18, 0, 0, 0, 0, 0,1176 0, 0, 0, 0, 0, 0, 19, 0, 0, 0,1177 0, 0, 20, 21, 125, 0, 22, 0, 0, 23,1178 0, 24, 4, 5, 6, 7, 8, 9, 0, 0,1179 0, 0, 0, 10, 0, 0, 0, 11, 0, 0,1180 0, 12, 13, 0, 0, 0, 14, 0, 15, 16,1181 17, 0, 0, 0, 0, 0, 0, 0, 0, 0,1182 18, 0, 0, 0, 0, 0, 0, 0, 0, 0,1183 0, 0, 19, 0, 0, 0, 0, 0, 20, 21,1184 0, 0, 22, 0, 233, 23, 0, 24, 4, 5,1185 6, 7, 8, 9, 0, 0, 0, 0, 0, 10,1186 0, 0, 0, 11, 0, 0, 0, 12, 13, 0,1187 0, 0, 14, 0, 15, 16, 17, 0, 0, 0,1188 0, 0, 0, 0, 0, 0, 18, 0, 0, 0,1189 0, 0, 0, 0, 0, 0, 0, 0, 19, 0,1190 0, 0, 0, 0, 20, 21, 0, 0, 22, 0,1191 271, 23, 0, 24, 4, 5, 6, 7, 8, 9,1192 0, 0, 0, 0, 0, 10, 0, 0, 0, 11,1193 0, 0, 0, 12, 13, 0, 0, 0, 14, 0,1194 15, 16, 17, 0, 0, 0, 0, 0, 0, 0,1195 0, 0, 18, 0, 0, 0, 0, 0, 0, 0,1196 0, 0, 0, 0, 19, 0, 0, 0, 0, 0,1197 20, 21, 0, 0, 22, 0, 0, 23, 0, 24,1198 4, 5, 6, 7, 8, 9, 0, 0, 0, 0,1199 0, 0, 0, 0, 0, 11, 0, 0, 0, 12,1200 13, 0, 0, 0, 14, 0, 0, 16, 17, 0,1201 0, 0, 0, 0, 0, 0, 0, 0, 18, 0,1202 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,1203 19, 0, 0, 0, 0, 0, 20, 21, 0, 222,1204 22, 0, 223, 23, 224, 24, 51, 0, 0, 0,1205 0, 0, 61, 62, 63, 64, 65, 66, 67, 68,1206 69, 70, 71, 72, 73, 74, 75, 76, 77, 78,1207 89, 90, 91, 92, 93, 0, 0, 0, 0, 0,1208 18, 0, 0, 0, 0, 0, 94, 95, 0, 0,1209 0, 0, 0, 96, 97, 98, 99, 100, 101, 102,1210 103, 0, 225, 89, 90, 91, 92, 133, 0, 0,1211 104, 105, 106, 107, 108, 109, 110, 111, 0, 94,1212 95, 0, 0, 0, 0, 0, 96, 97, 98, 99,1213 100, 101, 102, 103, 0, 89, 90, 91, 92, 134,1214 0, 0, 0, 104, 105, 106, 107, 108, 109, 110,1215 111, 94, 95, 0, 0, 0, 0, 0, 96, 97,1216 98, 99, 100, 101, 102, 103, 0, 89, 90, 91,1217 92, 0, 0, 0, 0, 104, 105, 106, 107, 108,1218 109, 110, 111, 94, 95, 0, 0, 0, 0, 0,1219 96, 97, 98, 99, 100, 101, 102, 103, 0, -154,1220 90, 91, 0, 0, 0, 0, 0, 104, 105, 106,1221 107, 108, 109, 110, 111, 94, 95, 0, 0, 0,1222 0, 0, -154, -154, -154, -154, -154, -154, 102, 103,1223 0, 0, 0, 0, 0, 0, 0, 0, 0, -154,1224 105, 106, 107, 108, 109, 110, 1111225};12261227static const yytype_int16 yycheck[] =1228{1229 1, 6, 20, 5, 49, 145, 146, 49, 148, 149,1230 11, 8, 8, 12, 13, 14, 161, 4, 25, 6,1231 21, 22, 20, 68, 66, 20, 34, 1, 23, 63,1232 48, 49, 6, 34, 68, 36, 37, 32, 33, 21,1233 22, 48, 49, 25, 0, 42, 42, 16, 48, 49,1234 48, 49, 17, 18, 48, 49, 61, 59, 60, 61,1235 160, 4, 67, 6, 61, 65, 48, 49, 59, 63,1236 48, 49, 66, 48, 49, 64, 48, 49, 45, 80,1237 42, 48, 49, 63, 64, 86, 87, 62, 66, 4,1238 89, 90, 91, 92, 66, 94, 95, 96, 97, 98,1239 99, 100, 101, 102, 103, 104, 105, 106, 107, 108,1240 109, 110, 111, 253, 254, 123, 117, 262, 6, 48,1241 49, 116, 48, 49, 48, 49, 48, 49, 69, 130,1242 230, 132, 48, 49, 48, 136, 135, 66, 62, 62,1243 66, 65, 65, 65, 143, 62, 145, 146, 65, 148,1244 149, 48, 49, 48, 49, 255, 151, 257, 258, 259,1245 29, 261, 48, 49, 264, 1, 161, 59, 65, 65,1246 65, 48, 49, 66, 1, 49, 62, 4, 5, 6,1247 7, 8, 9, 184, 63, 62, 187, 63, 15, 190,1248 48, 49, 19, 133, 134, 196, 23, 24, 63, 299,1249 63, 28, 68, 30, 31, 32, 59, 65, 48, 49,1250 69, 48, 49, 14, 48, 42, 11, 12, 48, 49,1251 43, 44, 62, 46, 225, 62, 6, 54, 41, 41,1252 231, 26, 62, 60, 61, 59, 63, 64, 239, 66,1253 67, 66, 69, 59, 39, 40, 247, 248, 48, 64,1254 251, 252, 59, 64, 253, 254, 51, 52, 53, 54,1255 55, 56, 57, 55, 56, 57, 63, 262, 41, 63,1256 63, 35, 63, 63, 275, 63, 63, 59, 63, 0,1257 1, 59, 59, 4, 5, 59, 33, 8, 63, 10,1258 11, 12, 13, 14, 59, 296, 297, 298, 245, 20,1259 21, 22, 123, 19, 25, 26, 27, 308, 29, 302,1260 262, 196, 33, 34, 35, 36, 37, 38, 39, 40,1261 151, 42, -1, -1, 45, -1, -1, 48, 49, 50,1262 51, 52, 53, 54, 55, 56, 57, -1, 59, 60,1263 61, 62, 63, -1, 65, 66, 1, 68, -1, 4,1264 5, 6, 7, 8, 9, -1, -1, -1, -1, -1,1265 15, -1, -1, -1, 19, -1, -1, -1, 23, 24,1266 -1, -1, -1, 28, -1, 30, 31, 32, -1, -1,1267 -1, -1, -1, -1, -1, -1, -1, 42, -1, -1,1268 -1, -1, -1, -1, -1, -1, -1, -1, -1, 54,1269 -1, -1, -1, -1, -1, 60, 61, -1, -1, 64,1270 -1, 66, 67, 1, 69, -1, 4, 5, 6, 7,1271 8, 9, -1, -1, -1, -1, -1, 15, -1, -1,1272 -1, 19, -1, -1, -1, 23, 24, -1, -1, -1,1273 28, -1, 30, 31, 32, -1, -1, -1, -1, -1,1274 -1, -1, -1, -1, 42, -1, -1, -1, -1, -1,1275 -1, -1, -1, -1, -1, -1, 54, -1, -1, -1,1276 -1, -1, 60, 61, -1, -1, 64, -1, -1, 67,1277 1, 69, -1, 4, 5, 6, 7, 8, 9, -1,1278 -1, -1, -1, -1, 15, -1, -1, -1, 19, -1,1279 -1, -1, 23, 24, -1, -1, -1, 28, -1, 30,1280 31, 32, -1, -1, -1, -1, 11, 12, -1, -1,1281 -1, 42, -1, -1, -1, -1, -1, -1, -1, -1,1282 -1, -1, -1, 54, -1, -1, -1, -1, -1, 60,1283 61, -1, -1, 64, 39, 40, 67, 1, 69, -1,1284 4, 5, 6, 7, 8, 9, 51, 52, 53, 54,1285 55, 56, 57, -1, -1, 19, -1, -1, -1, 23,1286 24, -1, -1, -1, 28, -1, -1, 31, 32, -1,1287 -1, -1, -1, -1, -1, -1, -1, -1, 42, -1,1288 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,1289 54, -1, -1, -1, -1, -1, 60, 61, -1, 1,1290 64, -1, 4, 67, 6, 69, 8, 11, 12, -1,1291 -1, -1, 14, 15, 16, 17, 18, 19, 20, 21,1292 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,1293 32, -1, -1, -1, -1, 39, 40, -1, -1, -1,1294 42, -1, -1, -1, -1, -1, -1, 51, 52, 53,1295 54, 55, 56, 57, 1, -1, -1, 4, -1, 6,1296 -1, 8, 64, -1, -1, -1, 68, 14, 15, 16,1297 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,1298 27, 28, 29, 30, 31, 32, 4, 5, 6, 7,1299 8, 9, -1, -1, -1, 42, -1, 15, -1, -1,1300 -1, 19, -1, -1, -1, 23, 24, -1, -1, -1,1301 28, -1, 30, 31, 32, -1, -1, 64, -1, -1,1302 -1, 68, -1, -1, 42, -1, -1, -1, -1, -1,1303 -1, -1, -1, -1, -1, -1, 54, -1, -1, -1,1304 -1, -1, 60, 61, 62, -1, 64, -1, -1, 67,1305 -1, 69, 4, 5, 6, 7, 8, 9, -1, -1,1306 -1, -1, -1, 15, -1, -1, -1, 19, -1, -1,1307 -1, 23, 24, -1, -1, -1, 28, -1, 30, 31,1308 32, -1, -1, -1, -1, -1, -1, -1, -1, -1,1309 42, -1, -1, -1, -1, -1, -1, -1, -1, -1,1310 -1, -1, 54, -1, -1, -1, -1, -1, 60, 61,1311 -1, -1, 64, -1, 66, 67, -1, 69, 4, 5,1312 6, 7, 8, 9, -1, -1, -1, -1, -1, 15,1313 -1, -1, -1, 19, -1, -1, -1, 23, 24, -1,1314 -1, -1, 28, -1, 30, 31, 32, -1, -1, -1,1315 -1, -1, -1, -1, -1, -1, 42, -1, -1, -1,1316 -1, -1, -1, -1, -1, -1, -1, -1, 54, -1,1317 -1, -1, -1, -1, 60, 61, -1, -1, 64, -1,1318 66, 67, -1, 69, 4, 5, 6, 7, 8, 9,1319 -1, -1, -1, -1, -1, 15, -1, -1, -1, 19,1320 -1, -1, -1, 23, 24, -1, -1, -1, 28, -1,1321 30, 31, 32, -1, -1, -1, -1, -1, -1, -1,1322 -1, -1, 42, -1, -1, -1, -1, -1, -1, -1,1323 -1, -1, -1, -1, 54, -1, -1, -1, -1, -1,1324 60, 61, -1, -1, 64, -1, -1, 67, -1, 69,1325 4, 5, 6, 7, 8, 9, -1, -1, -1, -1,1326 -1, -1, -1, -1, -1, 19, -1, -1, -1, 23,1327 24, -1, -1, -1, 28, -1, -1, 31, 32, -1,1328 -1, -1, -1, -1, -1, -1, -1, -1, 42, -1,1329 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,1330 54, -1, -1, -1, -1, -1, 60, 61, -1, 1,1331 64, -1, 4, 67, 6, 69, 8, -1, -1, -1,1332 -1, -1, 14, 15, 16, 17, 18, 19, 20, 21,1333 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,1334 10, 11, 12, 13, 14, -1, -1, -1, -1, -1,1335 42, -1, -1, -1, -1, -1, 26, 27, -1, -1,1336 -1, -1, -1, 33, 34, 35, 36, 37, 38, 39,1337 40, -1, 64, 10, 11, 12, 13, 14, -1, -1,1338 50, 51, 52, 53, 54, 55, 56, 57, -1, 26,1339 27, -1, -1, -1, -1, -1, 33, 34, 35, 36,1340 37, 38, 39, 40, -1, 10, 11, 12, 13, 14,1341 -1, -1, -1, 50, 51, 52, 53, 54, 55, 56,1342 57, 26, 27, -1, -1, -1, -1, -1, 33, 34,1343 35, 36, 37, 38, 39, 40, -1, 10, 11, 12,1344 13, -1, -1, -1, -1, 50, 51, 52, 53, 54,1345 55, 56, 57, 26, 27, -1, -1, -1, -1, -1,1346 33, 34, 35, 36, 37, 38, 39, 40, -1, 10,1347 11, 12, -1, -1, -1, -1, -1, 50, 51, 52,1348 53, 54, 55, 56, 57, 26, 27, -1, -1, -1,1349 -1, -1, 33, 34, 35, 36, 37, 38, 39, 40,1350 -1, -1, -1, -1, -1, -1, -1, -1, -1, 50,1351 51, 52, 53, 54, 55, 56, 571352};13531354/* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of1355 state STATE-NUM. */1356static const yytype_int8 yystos[] =1357{1358 0, 16, 71, 72, 4, 5, 6, 7, 8, 9,1359 15, 19, 23, 24, 28, 30, 31, 32, 42, 54,1360 60, 61, 64, 67, 69, 75, 76, 80, 83, 84,1361 87, 0, 17, 18, 73, 77, 78, 64, 59, 42,1362 4, 75, 76, 76, 76, 6, 1, 6, 87, 1,1363 4, 8, 84, 1, 66, 75, 1, 75, 1, 4,1364 6, 14, 15, 16, 17, 18, 19, 20, 21, 22,1365 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,1366 64, 84, 96, 97, 98, 69, 48, 49, 62, 10,1367 11, 12, 13, 14, 26, 27, 33, 34, 35, 36,1368 37, 38, 39, 40, 50, 51, 52, 53, 54, 55,1369 56, 57, 75, 85, 5, 59, 60, 61, 79, 84,1370 79, 74, 75, 80, 73, 62, 75, 75, 88, 89,1371 63, 64, 20, 14, 14, 29, 48, 1, 59, 66,1372 66, 65, 65, 63, 68, 63, 63, 75, 63, 63,1373 68, 49, 69, 75, 75, 76, 76, 76, 76, 6,1374 61, 67, 90, 91, 92, 76, 76, 76, 76, 76,1375 76, 76, 76, 76, 76, 76, 76, 76, 76, 76,1376 76, 76, 76, 43, 44, 46, 59, 61, 84, 1,1377 63, 66, 75, 14, 74, 62, 62, 65, 75, 4,1378 6, 81, 82, 1, 75, 91, 91, 1, 76, 75,1379 76, 99, 99, 99, 65, 99, 99, 1, 97, 6,1380 92, 93, 1, 4, 6, 64, 84, 94, 95, 96,1381 41, 48, 75, 66, 75, 59, 66, 75, 59, 63,1382 66, 4, 6, 89, 62, 62, 65, 21, 22, 25,1383 86, 64, 64, 48, 63, 49, 66, 63, 63, 63,1384 75, 63, 49, 68, 63, 92, 75, 45, 59, 66,1385 66, 66, 75, 59, 82, 63, 75, 75, 75, 75,1386 99, 99, 92, 92, 92, 92, 65, 92, 95, 92,1387 59, 59, 59, 66, 75, 25, 20, 62, 62, 63,1388 59, 62, 75, 75, 75, 92, 86, 65, 62, 65,1389 75, 651390};13911392/* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */1393static const yytype_int8 yyr1[] =1394{1395 0, 70, 71, 71, 72, 72, 73, 73, 74, 74,1396 75, 75, 75, 75, 75, 75, 76, 76, 76, 76,1397 76, 76, 76, 76, 76, 76, 76, 76, 76, 76,1398 76, 76, 76, 76, 76, 76, 76, 76, 76, 77,1399 77, 78, 78, 78, 79, 80, 80, 81, 81, 82,1400 82, 83, 83, 84, 85, 85, 85, 86, 86, 86,1401 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,1402 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,1403 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,1404 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,1405 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,1406 87, 87, 87, 87, 88, 88, 89, 90, 90, 91,1407 91, 92, 92, 92, 93, 93, 94, 94, 95, 95,1408 95, 95, 95, 95, 95, 96, 96, 96, 96, 96,1409 96, 96, 96, 96, 96, 96, 96, 96, 96, 96,1410 96, 96, 96, 97, 97, 97, 98, 98, 98, 98,1411 98, 98, 98, 98, 98, 98, 98, 99, 991412};14131414/* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */1415static const yytype_int8 yyr2[] =1416{1417 0, 2, 3, 3, 0, 3, 0, 2, 0, 2,1418 2, 5, 4, 3, 3, 1, 3, 3, 3, 3,1419 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,1420 3, 3, 3, 3, 3, 3, 3, 3, 1, 2,1421 3, 4, 4, 2, 1, 5, 8, 1, 3, 1,1422 1, 2, 1, 3, 0, 2, 4, 5, 3, 1,1423 1, 1, 2, 2, 3, 2, 4, 3, 2, 1,1424 3, 2, 2, 3, 5, 4, 6, 5, 4, 3,1425 5, 4, 7, 6, 6, 6, 5, 5, 2, 1,1426 1, 1, 2, 3, 3, 2, 3, 9, 11, 9,1427 5, 4, 4, 4, 2, 4, 1, 1, 1, 4,1428 3, 3, 4, 3, 1, 3, 1, 3, 1, 3,1429 1, 1, 3, 3, 1, 3, 1, 3, 1, 3,1430 3, 3, 3, 5, 3, 1, 1, 1, 1, 1,1431 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1432 1, 1, 1, 0, 1, 3, 3, 3, 3, 1,1433 3, 1, 1, 1, 1, 5, 3, 3, 11434};143514361437enum { YYENOMEM = -2 };14381439#define yyerrok (yyerrstatus = 0)1440#define yyclearin (yychar = YYEMPTY)14411442#define YYACCEPT goto yyacceptlab1443#define YYABORT goto yyabortlab1444#define YYERROR goto yyerrorlab1445#define YYNOMEM goto yyexhaustedlab144614471448#define YYRECOVERING() (!!yyerrstatus)14491450#define YYBACKUP(Token, Value) \1451 do \1452 if (yychar == YYEMPTY) \1453 { \1454 yychar = (Token); \1455 yylval = (Value); \1456 YYPOPSTACK (yylen); \1457 yystate = *yyssp; \1458 goto yybackup; \1459 } \1460 else \1461 { \1462 yyerror (&yylloc, answer, errors, locations, lexer_param_ptr, YY_("syntax error: cannot back up")); \1463 YYERROR; \1464 } \1465 while (0)14661467/* Backward compatibility with an undocumented macro.1468 Use YYerror or YYUNDEF. */1469#define YYERRCODE YYUNDEF14701471/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].1472 If N is 0, then set CURRENT to the empty location which ends1473 the previous symbol: RHS[0] (always defined). */14741475#ifndef YYLLOC_DEFAULT1476# define YYLLOC_DEFAULT(Current, Rhs, N) \1477 do \1478 if (N) \1479 { \1480 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \1481 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \1482 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \1483 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \1484 } \1485 else \1486 { \1487 (Current).first_line = (Current).last_line = \1488 YYRHSLOC (Rhs, 0).last_line; \1489 (Current).first_column = (Current).last_column = \1490 YYRHSLOC (Rhs, 0).last_column; \1491 } \1492 while (0)1493#endif14941495#define YYRHSLOC(Rhs, K) ((Rhs)[K])149614971498/* Enable debugging if requested. */1499#if YYDEBUG15001501# ifndef YYFPRINTF1502# include <stdio.h> /* INFRINGES ON USER NAME SPACE */1503# define YYFPRINTF fprintf1504# endif15051506# define YYDPRINTF(Args) \1507do { \1508 if (yydebug) \1509 YYFPRINTF Args; \1510} while (0)151115121513/* YYLOCATION_PRINT -- Print the location on the stream.1514 This macro was not mandated originally: define only if we know1515 we won't break user code: when these are the locations we know. */15161517# ifndef YYLOCATION_PRINT15181519# if defined YY_LOCATION_PRINT15201521 /* Temporary convenience wrapper in case some people defined the1522 undocumented and private YY_LOCATION_PRINT macros. */1523# define YYLOCATION_PRINT(File, Loc) YY_LOCATION_PRINT(File, *(Loc))15241525# elif defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL15261527/* Print *YYLOCP on YYO. Private, do not rely on its existence. */15281529YY_ATTRIBUTE_UNUSED1530static int1531yy_location_print_ (FILE *yyo, YYLTYPE const * const yylocp)1532{1533 int res = 0;1534 int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;1535 if (0 <= yylocp->first_line)1536 {1537 res += YYFPRINTF (yyo, "%d", yylocp->first_line);1538 if (0 <= yylocp->first_column)1539 res += YYFPRINTF (yyo, ".%d", yylocp->first_column);1540 }1541 if (0 <= yylocp->last_line)1542 {1543 if (yylocp->first_line < yylocp->last_line)1544 {1545 res += YYFPRINTF (yyo, "-%d", yylocp->last_line);1546 if (0 <= end_col)1547 res += YYFPRINTF (yyo, ".%d", end_col);1548 }1549 else if (0 <= end_col && yylocp->first_column < end_col)1550 res += YYFPRINTF (yyo, "-%d", end_col);1551 }1552 return res;1553}15541555# define YYLOCATION_PRINT yy_location_print_15561557 /* Temporary convenience wrapper in case some people defined the1558 undocumented and private YY_LOCATION_PRINT macros. */1559# define YY_LOCATION_PRINT(File, Loc) YYLOCATION_PRINT(File, &(Loc))15601561# else15621563# define YYLOCATION_PRINT(File, Loc) ((void) 0)1564 /* Temporary convenience wrapper in case some people defined the1565 undocumented and private YY_LOCATION_PRINT macros. */1566# define YY_LOCATION_PRINT YYLOCATION_PRINT15671568# endif1569# endif /* !defined YYLOCATION_PRINT */157015711572# define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \1573do { \1574 if (yydebug) \1575 { \1576 YYFPRINTF (stderr, "%s ", Title); \1577 yy_symbol_print (stderr, \1578 Kind, Value, Location, answer, errors, locations, lexer_param_ptr); \1579 YYFPRINTF (stderr, "\n"); \1580 } \1581} while (0)158215831584/*-----------------------------------.1585| Print this symbol's value on YYO. |1586`-----------------------------------*/15871588static void1589yy_symbol_value_print (FILE *yyo,1590 yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, block* answer, int* errors, struct locfile* locations, struct lexer_param* lexer_param_ptr)1591{1592 FILE *yyoutput = yyo;1593 YY_USE (yyoutput);1594 YY_USE (yylocationp);1595 YY_USE (answer);1596 YY_USE (errors);1597 YY_USE (locations);1598 YY_USE (lexer_param_ptr);1599 if (!yyvaluep)1600 return;1601 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN1602 YY_USE (yykind);1603 YY_IGNORE_MAYBE_UNINITIALIZED_END1604}160516061607/*---------------------------.1608| Print this symbol on YYO. |1609`---------------------------*/16101611static void1612yy_symbol_print (FILE *yyo,1613 yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, block* answer, int* errors, struct locfile* locations, struct lexer_param* lexer_param_ptr)1614{1615 YYFPRINTF (yyo, "%s %s (",1616 yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind));16171618 YYLOCATION_PRINT (yyo, yylocationp);1619 YYFPRINTF (yyo, ": ");1620 yy_symbol_value_print (yyo, yykind, yyvaluep, yylocationp, answer, errors, locations, lexer_param_ptr);1621 YYFPRINTF (yyo, ")");1622}16231624/*------------------------------------------------------------------.1625| yy_stack_print -- Print the state stack from its BOTTOM up to its |1626| TOP (included). |1627`------------------------------------------------------------------*/16281629static void1630yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop)1631{1632 YYFPRINTF (stderr, "Stack now");1633 for (; yybottom <= yytop; yybottom++)1634 {1635 int yybot = *yybottom;1636 YYFPRINTF (stderr, " %d", yybot);1637 }1638 YYFPRINTF (stderr, "\n");1639}16401641# define YY_STACK_PRINT(Bottom, Top) \1642do { \1643 if (yydebug) \1644 yy_stack_print ((Bottom), (Top)); \1645} while (0)164616471648/*------------------------------------------------.1649| Report that the YYRULE is going to be reduced. |1650`------------------------------------------------*/16511652static void1653yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp, YYLTYPE *yylsp,1654 int yyrule, block* answer, int* errors, struct locfile* locations, struct lexer_param* lexer_param_ptr)1655{1656 int yylno = yyrline[yyrule];1657 int yynrhs = yyr2[yyrule];1658 int yyi;1659 YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n",1660 yyrule - 1, yylno);1661 /* The symbols being reduced. */1662 for (yyi = 0; yyi < yynrhs; yyi++)1663 {1664 YYFPRINTF (stderr, " $%d = ", yyi + 1);1665 yy_symbol_print (stderr,1666 YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]),1667 &yyvsp[(yyi + 1) - (yynrhs)],1668 &(yylsp[(yyi + 1) - (yynrhs)]), answer, errors, locations, lexer_param_ptr);1669 YYFPRINTF (stderr, "\n");1670 }1671}16721673# define YY_REDUCE_PRINT(Rule) \1674do { \1675 if (yydebug) \1676 yy_reduce_print (yyssp, yyvsp, yylsp, Rule, answer, errors, locations, lexer_param_ptr); \1677} while (0)16781679/* Nonzero means print parse trace. It is left uninitialized so that1680 multiple parsers can coexist. */1681int yydebug;1682#else /* !YYDEBUG */1683# define YYDPRINTF(Args) ((void) 0)1684# define YY_SYMBOL_PRINT(Title, Kind, Value, Location)1685# define YY_STACK_PRINT(Bottom, Top)1686# define YY_REDUCE_PRINT(Rule)1687#endif /* !YYDEBUG */168816891690/* YYINITDEPTH -- initial size of the parser's stacks. */1691#ifndef YYINITDEPTH1692# define YYINITDEPTH 2001693#endif16941695/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only1696 if the built-in stack extension method is used).16971698 Do not make this value too large; the results are undefined if1699 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)1700 evaluated with infinite-precision integer arithmetic. */17011702#ifndef YYMAXDEPTH1703# define YYMAXDEPTH 100001704#endif170517061707/* Context of a parse error. */1708typedef struct1709{1710 yy_state_t *yyssp;1711 yysymbol_kind_t yytoken;1712 YYLTYPE *yylloc;1713} yypcontext_t;17141715/* Put in YYARG at most YYARGN of the expected tokens given the1716 current YYCTX, and return the number of tokens stored in YYARG. If1717 YYARG is null, return the number of expected tokens (guaranteed to1718 be less than YYNTOKENS). Return YYENOMEM on memory exhaustion.1719 Return 0 if there are more than YYARGN expected tokens, yet fill1720 YYARG up to YYARGN. */1721static int1722yypcontext_expected_tokens (const yypcontext_t *yyctx,1723 yysymbol_kind_t yyarg[], int yyargn)1724{1725 /* Actual size of YYARG. */1726 int yycount = 0;1727 int yyn = yypact[+*yyctx->yyssp];1728 if (!yypact_value_is_default (yyn))1729 {1730 /* Start YYX at -YYN if negative to avoid negative indexes in1731 YYCHECK. In other words, skip the first -YYN actions for1732 this state because they are default actions. */1733 int yyxbegin = yyn < 0 ? -yyn : 0;1734 /* Stay within bounds of both yycheck and yytname. */1735 int yychecklim = YYLAST - yyn + 1;1736 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;1737 int yyx;1738 for (yyx = yyxbegin; yyx < yyxend; ++yyx)1739 if (yycheck[yyx + yyn] == yyx && yyx != YYSYMBOL_YYerror1740 && !yytable_value_is_error (yytable[yyx + yyn]))1741 {1742 if (!yyarg)1743 ++yycount;1744 else if (yycount == yyargn)1745 return 0;1746 else1747 yyarg[yycount++] = YY_CAST (yysymbol_kind_t, yyx);1748 }1749 }1750 if (yyarg && yycount == 0 && 0 < yyargn)1751 yyarg[0] = YYSYMBOL_YYEMPTY;1752 return yycount;1753}17541755175617571758#ifndef yystrlen1759# if defined __GLIBC__ && defined _STRING_H1760# define yystrlen(S) (YY_CAST (YYPTRDIFF_T, strlen (S)))1761# else1762/* Return the length of YYSTR. */1763static YYPTRDIFF_T1764yystrlen (const char *yystr)1765{1766 YYPTRDIFF_T yylen;1767 for (yylen = 0; yystr[yylen]; yylen++)1768 continue;1769 return yylen;1770}1771# endif1772#endif17731774#ifndef yystpcpy1775# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE1776# define yystpcpy stpcpy1777# else1778/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in1779 YYDEST. */1780static char *1781yystpcpy (char *yydest, const char *yysrc)1782{1783 char *yyd = yydest;1784 const char *yys = yysrc;17851786 while ((*yyd++ = *yys++) != '\0')1787 continue;17881789 return yyd - 1;1790}1791# endif1792#endif17931794#ifndef yytnamerr1795/* Copy to YYRES the contents of YYSTR after stripping away unnecessary1796 quotes and backslashes, so that it's suitable for yyerror. The1797 heuristic is that double-quoting is unnecessary unless the string1798 contains an apostrophe, a comma, or backslash (other than1799 backslash-backslash). YYSTR is taken from yytname. If YYRES is1800 null, do not copy; instead, return the length of what the result1801 would have been. */1802static YYPTRDIFF_T1803yytnamerr (char *yyres, const char *yystr)1804{1805 if (*yystr == '"')1806 {1807 YYPTRDIFF_T yyn = 0;1808 char const *yyp = yystr;1809 for (;;)1810 switch (*++yyp)1811 {1812 case '\'':1813 case ',':1814 goto do_not_strip_quotes;18151816 case '\\':1817 if (*++yyp != '\\')1818 goto do_not_strip_quotes;1819 else1820 goto append;18211822 append:1823 default:1824 if (yyres)1825 yyres[yyn] = *yyp;1826 yyn++;1827 break;18281829 case '"':1830 if (yyres)1831 yyres[yyn] = '\0';1832 return yyn;1833 }1834 do_not_strip_quotes: ;1835 }18361837 if (yyres)1838 return yystpcpy (yyres, yystr) - yyres;1839 else1840 return yystrlen (yystr);1841}1842#endif184318441845static int1846yy_syntax_error_arguments (const yypcontext_t *yyctx,1847 yysymbol_kind_t yyarg[], int yyargn)1848{1849 /* Actual size of YYARG. */1850 int yycount = 0;1851 /* There are many possibilities here to consider:1852 - If this state is a consistent state with a default action, then1853 the only way this function was invoked is if the default action1854 is an error action. In that case, don't check for expected1855 tokens because there are none.1856 - The only way there can be no lookahead present (in yychar) is if1857 this state is a consistent state with a default action. Thus,1858 detecting the absence of a lookahead is sufficient to determine1859 that there is no unexpected or expected token to report. In that1860 case, just report a simple "syntax error".1861 - Don't assume there isn't a lookahead just because this state is a1862 consistent state with a default action. There might have been a1863 previous inconsistent state, consistent state with a non-default1864 action, or user semantic action that manipulated yychar.1865 - Of course, the expected token list depends on states to have1866 correct lookahead information, and it depends on the parser not1867 to perform extra reductions after fetching a lookahead from the1868 scanner and before detecting a syntax error. Thus, state merging1869 (from LALR or IELR) and default reductions corrupt the expected1870 token list. However, the list is correct for canonical LR with1871 one exception: it will still contain any token that will not be1872 accepted due to an error action in a later state.1873 */1874 if (yyctx->yytoken != YYSYMBOL_YYEMPTY)1875 {1876 int yyn;1877 if (yyarg)1878 yyarg[yycount] = yyctx->yytoken;1879 ++yycount;1880 yyn = yypcontext_expected_tokens (yyctx,1881 yyarg ? yyarg + 1 : yyarg, yyargn - 1);1882 if (yyn == YYENOMEM)1883 return YYENOMEM;1884 else1885 yycount += yyn;1886 }1887 return yycount;1888}18891890/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message1891 about the unexpected token YYTOKEN for the state stack whose top is1892 YYSSP.18931894 Return 0 if *YYMSG was successfully written. Return -1 if *YYMSG is1895 not large enough to hold the message. In that case, also set1896 *YYMSG_ALLOC to the required number of bytes. Return YYENOMEM if the1897 required number of bytes is too large to store. */1898static int1899yysyntax_error (YYPTRDIFF_T *yymsg_alloc, char **yymsg,1900 const yypcontext_t *yyctx)1901{1902 enum { YYARGS_MAX = 5 };1903 /* Internationalized format string. */1904 const char *yyformat = YY_NULLPTR;1905 /* Arguments of yyformat: reported tokens (one for the "unexpected",1906 one per "expected"). */1907 yysymbol_kind_t yyarg[YYARGS_MAX];1908 /* Cumulated lengths of YYARG. */1909 YYPTRDIFF_T yysize = 0;19101911 /* Actual size of YYARG. */1912 int yycount = yy_syntax_error_arguments (yyctx, yyarg, YYARGS_MAX);1913 if (yycount == YYENOMEM)1914 return YYENOMEM;19151916 switch (yycount)1917 {1918#define YYCASE_(N, S) \1919 case N: \1920 yyformat = S; \1921 break1922 default: /* Avoid compiler warnings. */1923 YYCASE_(0, YY_("syntax error"));1924 YYCASE_(1, YY_("syntax error, unexpected %s"));1925 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));1926 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));1927 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));1928 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));1929#undef YYCASE_1930 }19311932 /* Compute error message size. Don't count the "%s"s, but reserve1933 room for the terminator. */1934 yysize = yystrlen (yyformat) - 2 * yycount + 1;1935 {1936 int yyi;1937 for (yyi = 0; yyi < yycount; ++yyi)1938 {1939 YYPTRDIFF_T yysize11940 = yysize + yytnamerr (YY_NULLPTR, yytname[yyarg[yyi]]);1941 if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)1942 yysize = yysize1;1943 else1944 return YYENOMEM;1945 }1946 }19471948 if (*yymsg_alloc < yysize)1949 {1950 *yymsg_alloc = 2 * yysize;1951 if (! (yysize <= *yymsg_alloc1952 && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))1953 *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;1954 return -1;1955 }19561957 /* Avoid sprintf, as that infringes on the user's name space.1958 Don't have undefined behavior even if the translation1959 produced a string with the wrong number of "%s"s. */1960 {1961 char *yyp = *yymsg;1962 int yyi = 0;1963 while ((*yyp = *yyformat) != '\0')1964 if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)1965 {1966 yyp += yytnamerr (yyp, yytname[yyarg[yyi++]]);1967 yyformat += 2;1968 }1969 else1970 {1971 ++yyp;1972 ++yyformat;1973 }1974 }1975 return 0;1976}197719781979/*-----------------------------------------------.1980| Release the memory associated to this symbol. |1981`-----------------------------------------------*/19821983static void1984yydestruct (const char *yymsg,1985 yysymbol_kind_t yykind, YYSTYPE *yyvaluep, YYLTYPE *yylocationp, block* answer, int* errors, struct locfile* locations, struct lexer_param* lexer_param_ptr)1986{1987 YY_USE (yyvaluep);1988 YY_USE (yylocationp);1989 YY_USE (answer);1990 YY_USE (errors);1991 YY_USE (locations);1992 YY_USE (lexer_param_ptr);1993 if (!yymsg)1994 yymsg = "Deleting";1995 YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp);19961997 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN1998 switch (yykind)1999 {2000 case YYSYMBOL_IDENT: /* IDENT */The first 2,000 of 4,188 lines.