parser.c
This file
Path
src/parser.c
4,162 lines · 137.3 KiB · C
Last changed by
Parse `?//` as `?` and `//` outside destructuring patterns (#3593)A4-Tacksbefore adoptiona19efdd
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 QQSTRING_START = 296, /* QQSTRING_START */184 QQSTRING_TEXT = 297, /* QQSTRING_TEXT */185 QQSTRING_INTERP_START = 298, /* QQSTRING_INTERP_START */186 QQSTRING_INTERP_END = 299, /* QQSTRING_INTERP_END */187 QQSTRING_END = 300, /* QQSTRING_END */188 FUNCDEF = 301, /* FUNCDEF */189 NONOPT = 302 /* NONOPT */190 };191 typedef enum yytokentype yytoken_kind_t;192#endif193/* Token kinds. */194#define YYEMPTY -2195#define YYEOF 0196#define YYerror 256197#define YYUNDEF 257198#define INVALID_CHARACTER 258199#define IDENT 259200#define FIELD 260201#define BINDING 261202#define LITERAL 262203#define FORMAT 263204#define REC 264205#define SETMOD 265206#define EQ 266207#define NEQ 267208#define DEFINEDOR 268209#define AS 269210#define DEF 270211#define MODULE 271212#define IMPORT 272213#define INCLUDE 273214#define IF 274215#define THEN 275216#define ELSE 276217#define ELSE_IF 277218#define REDUCE 278219#define FOREACH 279220#define END 280221#define AND 281222#define OR 282223#define TRY 283224#define CATCH 284225#define LABEL 285226#define BREAK 286227#define LOC 287228#define SETPIPE 288229#define SETPLUS 289230#define SETMINUS 290231#define SETMULT 291232#define SETDIV 292233#define SETDEFINEDOR 293234#define LESSEQ 294235#define GREATEREQ 295236#define QQSTRING_START 296237#define QQSTRING_TEXT 297238#define QQSTRING_INTERP_START 298239#define QQSTRING_INTERP_END 299240#define QQSTRING_END 300241#define FUNCDEF 301242#define NONOPT 302243244/* Value type. */245#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED246union YYSTYPE247{248#line 32 "src/parser.y"249250 jv literal;251 block blk;252253#line 254 "src/parser.c"254255};256typedef union YYSTYPE YYSTYPE;257# define YYSTYPE_IS_TRIVIAL 1258# define YYSTYPE_IS_DECLARED 1259#endif260261/* Location type. */262#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED263typedef struct YYLTYPE YYLTYPE;264struct YYLTYPE265{266 int first_line;267 int first_column;268 int last_line;269 int last_column;270};271# define YYLTYPE_IS_DECLARED 1272# define YYLTYPE_IS_TRIVIAL 1273#endif274275276277278int yyparse (block* answer, int* errors, struct locfile* locations, struct lexer_param* lexer_param_ptr);279280281#endif /* !YY_YY_SRC_PARSER_H_INCLUDED */282/* Symbol kind. */283enum yysymbol_kind_t284{285 YYSYMBOL_YYEMPTY = -2,286 YYSYMBOL_YYEOF = 0, /* "end of file" */287 YYSYMBOL_YYerror = 1, /* error */288 YYSYMBOL_YYUNDEF = 2, /* "invalid token" */289 YYSYMBOL_INVALID_CHARACTER = 3, /* INVALID_CHARACTER */290 YYSYMBOL_IDENT = 4, /* IDENT */291 YYSYMBOL_FIELD = 5, /* FIELD */292 YYSYMBOL_BINDING = 6, /* BINDING */293 YYSYMBOL_LITERAL = 7, /* LITERAL */294 YYSYMBOL_FORMAT = 8, /* FORMAT */295 YYSYMBOL_REC = 9, /* ".." */296 YYSYMBOL_SETMOD = 10, /* "%=" */297 YYSYMBOL_EQ = 11, /* "==" */298 YYSYMBOL_NEQ = 12, /* "!=" */299 YYSYMBOL_DEFINEDOR = 13, /* "//" */300 YYSYMBOL_AS = 14, /* "as" */301 YYSYMBOL_DEF = 15, /* "def" */302 YYSYMBOL_MODULE = 16, /* "module" */303 YYSYMBOL_IMPORT = 17, /* "import" */304 YYSYMBOL_INCLUDE = 18, /* "include" */305 YYSYMBOL_IF = 19, /* "if" */306 YYSYMBOL_THEN = 20, /* "then" */307 YYSYMBOL_ELSE = 21, /* "else" */308 YYSYMBOL_ELSE_IF = 22, /* "elif" */309 YYSYMBOL_REDUCE = 23, /* "reduce" */310 YYSYMBOL_FOREACH = 24, /* "foreach" */311 YYSYMBOL_END = 25, /* "end" */312 YYSYMBOL_AND = 26, /* "and" */313 YYSYMBOL_OR = 27, /* "or" */314 YYSYMBOL_TRY = 28, /* "try" */315 YYSYMBOL_CATCH = 29, /* "catch" */316 YYSYMBOL_LABEL = 30, /* "label" */317 YYSYMBOL_BREAK = 31, /* "break" */318 YYSYMBOL_LOC = 32, /* "$__loc__" */319 YYSYMBOL_SETPIPE = 33, /* "|=" */320 YYSYMBOL_SETPLUS = 34, /* "+=" */321 YYSYMBOL_SETMINUS = 35, /* "-=" */322 YYSYMBOL_SETMULT = 36, /* "*=" */323 YYSYMBOL_SETDIV = 37, /* "/=" */324 YYSYMBOL_SETDEFINEDOR = 38, /* "//=" */325 YYSYMBOL_LESSEQ = 39, /* "<=" */326 YYSYMBOL_GREATEREQ = 40, /* ">=" */327 YYSYMBOL_QQSTRING_START = 41, /* QQSTRING_START */328 YYSYMBOL_QQSTRING_TEXT = 42, /* QQSTRING_TEXT */329 YYSYMBOL_QQSTRING_INTERP_START = 43, /* QQSTRING_INTERP_START */330 YYSYMBOL_QQSTRING_INTERP_END = 44, /* QQSTRING_INTERP_END */331 YYSYMBOL_QQSTRING_END = 45, /* QQSTRING_END */332 YYSYMBOL_FUNCDEF = 46, /* FUNCDEF */333 YYSYMBOL_47_ = 47, /* '|' */334 YYSYMBOL_48_ = 48, /* ',' */335 YYSYMBOL_49_ = 49, /* '=' */336 YYSYMBOL_50_ = 50, /* '<' */337 YYSYMBOL_51_ = 51, /* '>' */338 YYSYMBOL_52_ = 52, /* '+' */339 YYSYMBOL_53_ = 53, /* '-' */340 YYSYMBOL_54_ = 54, /* '*' */341 YYSYMBOL_55_ = 55, /* '/' */342 YYSYMBOL_56_ = 56, /* '%' */343 YYSYMBOL_NONOPT = 57, /* NONOPT */344 YYSYMBOL_58_ = 58, /* '?' */345 YYSYMBOL_59_ = 59, /* '.' */346 YYSYMBOL_60_ = 60, /* '[' */347 YYSYMBOL_61_ = 61, /* ';' */348 YYSYMBOL_62_ = 62, /* ':' */349 YYSYMBOL_63_ = 63, /* '(' */350 YYSYMBOL_64_ = 64, /* ')' */351 YYSYMBOL_65_ = 65, /* ']' */352 YYSYMBOL_66_ = 66, /* '{' */353 YYSYMBOL_67_ = 67, /* '}' */354 YYSYMBOL_68_ = 68, /* '$' */355 YYSYMBOL_YYACCEPT = 69, /* $accept */356 YYSYMBOL_TopLevel = 70, /* TopLevel */357 YYSYMBOL_Module = 71, /* Module */358 YYSYMBOL_Imports = 72, /* Imports */359 YYSYMBOL_FuncDefs = 73, /* FuncDefs */360 YYSYMBOL_Query = 74, /* Query */361 YYSYMBOL_Expr = 75, /* Expr */362 YYSYMBOL_Import = 76, /* Import */363 YYSYMBOL_ImportWhat = 77, /* ImportWhat */364 YYSYMBOL_ImportFrom = 78, /* ImportFrom */365 YYSYMBOL_FuncDef = 79, /* FuncDef */366 YYSYMBOL_Params = 80, /* Params */367 YYSYMBOL_Param = 81, /* Param */368 YYSYMBOL_StringStart = 82, /* StringStart */369 YYSYMBOL_String = 83, /* String */370 YYSYMBOL_QQString = 84, /* QQString */371 YYSYMBOL_ElseBody = 85, /* ElseBody */372 YYSYMBOL_Term = 86, /* Term */373 YYSYMBOL_Args = 87, /* Args */374 YYSYMBOL_Arg = 88, /* Arg */375 YYSYMBOL_RepPatterns = 89, /* RepPatterns */376 YYSYMBOL_Patterns = 90, /* Patterns */377 YYSYMBOL_Pattern = 91, /* Pattern */378 YYSYMBOL_ArrayPats = 92, /* ArrayPats */379 YYSYMBOL_ObjPats = 93, /* ObjPats */380 YYSYMBOL_ObjPat = 94, /* ObjPat */381 YYSYMBOL_Keyword = 95, /* Keyword */382 YYSYMBOL_DictPairs = 96, /* DictPairs */383 YYSYMBOL_DictPair = 97, /* DictPair */384 YYSYMBOL_DictExpr = 98 /* DictExpr */385};386typedef enum yysymbol_kind_t yysymbol_kind_t;387388389/* Second part of user prologue. */390#line 126 "src/parser.y"391392#include "lexer.h"393struct lexer_param {394 yyscan_t lexer;395};396#define FAIL(loc, msg) \397 do { \398 location l = loc; \399 yyerror(&l, answer, errors, locations, lexer_param_ptr, msg); \400 /*YYERROR*/; \401 } while (0)402403void yyerror(YYLTYPE* loc, block* answer, int* errors,404 struct locfile* locations, struct lexer_param* lexer_param_ptr, const char *s){405 (*errors)++;406 locfile_locate(locations, *loc, "jq: error: %s", s);407}408409int yylex(YYSTYPE* yylval, YYLTYPE* yylloc, block* answer, int* errors,410 struct locfile* locations, struct lexer_param* lexer_param_ptr) {411 yyscan_t lexer = lexer_param_ptr->lexer;412 int tok = jq_yylex(yylval, yylloc, lexer);413 if ((tok == LITERAL || tok == QQSTRING_TEXT) && !jv_is_valid(yylval->literal)) {414 jv msg = jv_invalid_get_msg(jv_copy(yylval->literal));415 if (jv_get_kind(msg) == JV_KIND_STRING) {416 FAIL(*yylloc, jv_string_value(msg));417 } else {418 FAIL(*yylloc, "Invalid literal");419 }420 jv_free(msg);421 jv_free(yylval->literal);422 yylval->literal = jv_null();423 }424 return tok;425}426427/* Returns string message if the block is a constant that is not valid as an428 * object key. */429static jv check_object_key(block k) {430 if (block_is_const(k) && block_const_kind(k) != JV_KIND_STRING) {431 char errbuf[30];432 return jv_string_fmt("Cannot use %s (%s) as object key",433 jv_kind_name(block_const_kind(k)),434 jv_dump_string_trunc(block_const(k), errbuf, sizeof(errbuf)));435 }436 return jv_invalid();437}438439static block gen_index(block obj, block key) {440 return BLOCK(gen_subexp(key), obj, gen_op_simple(INDEX));441}442443static block gen_index_opt(block obj, block key) {444 return BLOCK(gen_subexp(key), obj, gen_op_simple(INDEX_OPT));445}446447static block gen_slice_index(block obj, block start, block end, opcode idx_op) {448 block key = BLOCK(gen_subexp(gen_const(jv_object())),449 gen_subexp(gen_const(jv_string("start"))),450 gen_subexp(start),451 gen_op_simple(INSERT),452 gen_subexp(gen_const(jv_string("end"))),453 gen_subexp(end),454 gen_op_simple(INSERT));455 return BLOCK(key, obj, gen_op_simple(idx_op));456}457458static block constant_fold(block a, block b, int op) {459 if (!block_is_single(a) || !block_is_const(a) ||460 !block_is_single(b) || !block_is_const(b))461 return gen_noop();462463 jv jv_a = block_const(a);464 block_free(a);465 jv jv_b = block_const(b);466 block_free(b);467468 jv res = jv_invalid();469 switch (op) {470 case '+': res = binop_plus(jv_a, jv_b); break;471 case '-': res = binop_minus(jv_a, jv_b); break;472 case '*': res = binop_multiply(jv_a, jv_b); break;473 case '/': res = binop_divide(jv_a, jv_b); break;474 case '%': res = binop_mod(jv_a, jv_b); break;475 case EQ: res = binop_equal(jv_a, jv_b); break;476 case NEQ: res = binop_notequal(jv_a, jv_b); break;477 case '<': res = binop_less(jv_a, jv_b); break;478 case '>': res = binop_greater(jv_a, jv_b); break;479 case LESSEQ: res = binop_lesseq(jv_a, jv_b); break;480 case GREATEREQ: res = binop_greatereq(jv_a, jv_b); break;481 }482483 if (jv_is_valid(res))484 return gen_const(res);485486 return gen_error(jv_invalid_get_msg(res));487}488489static block gen_binop(block a, block b, int op) {490 block folded = constant_fold(a, b, op);491 if (!block_is_noop(folded))492 return folded;493494 const char* funcname = 0;495 switch (op) {496 case '+': funcname = "_plus"; break;497 case '-': funcname = "_minus"; break;498 case '*': funcname = "_multiply"; break;499 case '/': funcname = "_divide"; break;500 case '%': funcname = "_mod"; break;501 case EQ: funcname = "_equal"; break;502 case NEQ: funcname = "_notequal"; break;503 case '<': funcname = "_less"; break;504 case '>': funcname = "_greater"; break;505 case LESSEQ: funcname = "_lesseq"; break;506 case GREATEREQ: funcname = "_greatereq"; break;507 }508 assert(funcname);509510 return gen_call(funcname, BLOCK(gen_lambda(a), gen_lambda(b)));511}512513static block gen_format(block a, jv fmt) {514 return BLOCK(a, gen_call("format", gen_lambda(gen_const(fmt))));515}516517static block gen_definedor_assign(block object, block val) {518 block tmp = gen_op_var_fresh(STOREV, "tmp");519 return BLOCK(gen_op_simple(DUP),520 val, tmp,521 gen_call("_modify", BLOCK(gen_lambda(object),522 gen_lambda(gen_definedor(gen_noop(),523 gen_op_bound(LOADV, tmp))))));524}525526static block gen_update(block object, block val, int optype) {527 block tmp = gen_op_var_fresh(STOREV, "tmp");528 return BLOCK(gen_op_simple(DUP),529 val,530 tmp,531 gen_call("_modify", BLOCK(gen_lambda(object),532 gen_lambda(gen_binop(gen_noop(),533 gen_op_bound(LOADV, tmp),534 optype)))));535}536537static block gen_loc_object(location *loc, struct locfile *locations) {538 return gen_const(JV_OBJECT(jv_string("file"), jv_copy(locations->fname),539 jv_string("line"), jv_number(locfile_get_line(locations, loc->start) + 1)));540}541542543#line 544 "src/parser.c"544545546#ifdef short547# undef short548#endif549550/* On compilers that do not define __PTRDIFF_MAX__ etc., make sure551 <limits.h> and (if available) <stdint.h> are included552 so that the code can choose integer types of a good width. */553554#ifndef __PTRDIFF_MAX__555# include <limits.h> /* INFRINGES ON USER NAME SPACE */556# if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__557# include <stdint.h> /* INFRINGES ON USER NAME SPACE */558# define YY_STDINT_H559# endif560#endif561562/* Narrow types that promote to a signed type and that can represent a563 signed or unsigned integer of at least N bits. In tables they can564 save space and decrease cache pressure. Promoting to a signed type565 helps avoid bugs in integer arithmetic. */566567#ifdef __INT_LEAST8_MAX__568typedef __INT_LEAST8_TYPE__ yytype_int8;569#elif defined YY_STDINT_H570typedef int_least8_t yytype_int8;571#else572typedef signed char yytype_int8;573#endif574575#ifdef __INT_LEAST16_MAX__576typedef __INT_LEAST16_TYPE__ yytype_int16;577#elif defined YY_STDINT_H578typedef int_least16_t yytype_int16;579#else580typedef short yytype_int16;581#endif582583/* Work around bug in HP-UX 11.23, which defines these macros584 incorrectly for preprocessor constants. This workaround can likely585 be removed in 2023, as HPE has promised support for HP-UX 11.23586 (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of587 <https://h20195.www2.hpe.com/V2/getpdf.aspx/4AA4-7673ENW.pdf>. */588#ifdef __hpux589# undef UINT_LEAST8_MAX590# undef UINT_LEAST16_MAX591# define UINT_LEAST8_MAX 255592# define UINT_LEAST16_MAX 65535593#endif594595#if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__596typedef __UINT_LEAST8_TYPE__ yytype_uint8;597#elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \598 && UINT_LEAST8_MAX <= INT_MAX)599typedef uint_least8_t yytype_uint8;600#elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX601typedef unsigned char yytype_uint8;602#else603typedef short yytype_uint8;604#endif605606#if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__607typedef __UINT_LEAST16_TYPE__ yytype_uint16;608#elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \609 && UINT_LEAST16_MAX <= INT_MAX)610typedef uint_least16_t yytype_uint16;611#elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX612typedef unsigned short yytype_uint16;613#else614typedef int yytype_uint16;615#endif616617#ifndef YYPTRDIFF_T618# if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__619# define YYPTRDIFF_T __PTRDIFF_TYPE__620# define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__621# elif defined PTRDIFF_MAX622# ifndef ptrdiff_t623# include <stddef.h> /* INFRINGES ON USER NAME SPACE */624# endif625# define YYPTRDIFF_T ptrdiff_t626# define YYPTRDIFF_MAXIMUM PTRDIFF_MAX627# else628# define YYPTRDIFF_T long629# define YYPTRDIFF_MAXIMUM LONG_MAX630# endif631#endif632633#ifndef YYSIZE_T634# ifdef __SIZE_TYPE__635# define YYSIZE_T __SIZE_TYPE__636# elif defined size_t637# define YYSIZE_T size_t638# elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__639# include <stddef.h> /* INFRINGES ON USER NAME SPACE */640# define YYSIZE_T size_t641# else642# define YYSIZE_T unsigned643# endif644#endif645646#define YYSIZE_MAXIMUM \647 YY_CAST (YYPTRDIFF_T, \648 (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1) \649 ? YYPTRDIFF_MAXIMUM \650 : YY_CAST (YYSIZE_T, -1)))651652#define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X))653654655/* Stored state numbers (used for stacks). */656typedef yytype_int16 yy_state_t;657658/* State numbers in computations. */659typedef int yy_state_fast_t;660661#ifndef YY_662# if defined YYENABLE_NLS && YYENABLE_NLS663# if ENABLE_NLS664# include <libintl.h> /* INFRINGES ON USER NAME SPACE */665# define YY_(Msgid) dgettext ("bison-runtime", Msgid)666# endif667# endif668# ifndef YY_669# define YY_(Msgid) Msgid670# endif671#endif672673674#ifndef YY_ATTRIBUTE_PURE675# if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__)676# define YY_ATTRIBUTE_PURE __attribute__ ((__pure__))677# else678# define YY_ATTRIBUTE_PURE679# endif680#endif681682#ifndef YY_ATTRIBUTE_UNUSED683# if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)684# define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__))685# else686# define YY_ATTRIBUTE_UNUSED687# endif688#endif689690/* Suppress unused-variable warnings by "using" E. */691#if ! defined lint || defined __GNUC__692# define YY_USE(E) ((void) (E))693#else694# define YY_USE(E) /* empty */695#endif696697/* Suppress an incorrect diagnostic about yylval being uninitialized. */698#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__699# if __GNUC__ * 100 + __GNUC_MINOR__ < 407700# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \701 _Pragma ("GCC diagnostic push") \702 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")703# else704# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \705 _Pragma ("GCC diagnostic push") \706 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \707 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")708# endif709# define YY_IGNORE_MAYBE_UNINITIALIZED_END \710 _Pragma ("GCC diagnostic pop")711#else712# define YY_INITIAL_VALUE(Value) Value713#endif714#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN715# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN716# define YY_IGNORE_MAYBE_UNINITIALIZED_END717#endif718#ifndef YY_INITIAL_VALUE719# define YY_INITIAL_VALUE(Value) /* Nothing. */720#endif721722#if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__723# define YY_IGNORE_USELESS_CAST_BEGIN \724 _Pragma ("GCC diagnostic push") \725 _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"")726# define YY_IGNORE_USELESS_CAST_END \727 _Pragma ("GCC diagnostic pop")728#endif729#ifndef YY_IGNORE_USELESS_CAST_BEGIN730# define YY_IGNORE_USELESS_CAST_BEGIN731# define YY_IGNORE_USELESS_CAST_END732#endif733734735#define YY_ASSERT(E) ((void) (0 && (E)))736737#if 1738739/* The parser invokes alloca or malloc; define the necessary symbols. */740741# ifdef YYSTACK_USE_ALLOCA742# if YYSTACK_USE_ALLOCA743# ifdef __GNUC__744# define YYSTACK_ALLOC __builtin_alloca745# elif defined __BUILTIN_VA_ARG_INCR746# include <alloca.h> /* INFRINGES ON USER NAME SPACE */747# elif defined _AIX748# define YYSTACK_ALLOC __alloca749# elif defined _MSC_VER750# include <malloc.h> /* INFRINGES ON USER NAME SPACE */751# define alloca _alloca752# else753# define YYSTACK_ALLOC alloca754# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS755# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */756 /* Use EXIT_SUCCESS as a witness for stdlib.h. */757# ifndef EXIT_SUCCESS758# define EXIT_SUCCESS 0759# endif760# endif761# endif762# endif763# endif764765# ifdef YYSTACK_ALLOC766 /* Pacify GCC's 'empty if-body' warning. */767# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)768# ifndef YYSTACK_ALLOC_MAXIMUM769 /* The OS might guarantee only one guard page at the bottom of the stack,770 and a page size can be as small as 4096 bytes. So we cannot safely771 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number772 to allow for a few compiler-allocated temporary stack slots. */773# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */774# endif775# else776# define YYSTACK_ALLOC YYMALLOC777# define YYSTACK_FREE YYFREE778# ifndef YYSTACK_ALLOC_MAXIMUM779# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM780# endif781# if (defined __cplusplus && ! defined EXIT_SUCCESS \782 && ! ((defined YYMALLOC || defined malloc) \783 && (defined YYFREE || defined free)))784# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */785# ifndef EXIT_SUCCESS786# define EXIT_SUCCESS 0787# endif788# endif789# ifndef YYMALLOC790# define YYMALLOC malloc791# if ! defined malloc && ! defined EXIT_SUCCESS792void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */793# endif794# endif795# ifndef YYFREE796# define YYFREE free797# if ! defined free && ! defined EXIT_SUCCESS798void free (void *); /* INFRINGES ON USER NAME SPACE */799# endif800# endif801# endif802#endif /* 1 */803804#if (! defined yyoverflow \805 && (! defined __cplusplus \806 || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \807 && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))808809/* A type that is properly aligned for any stack member. */810union yyalloc811{812 yy_state_t yyss_alloc;813 YYSTYPE yyvs_alloc;814 YYLTYPE yyls_alloc;815};816817/* The size of the maximum gap between one aligned stack and the next. */818# define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1)819820/* The size of an array large to enough to hold all stacks, each with821 N elements. */822# define YYSTACK_BYTES(N) \823 ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE) \824 + YYSIZEOF (YYLTYPE)) \825 + 2 * YYSTACK_GAP_MAXIMUM)826827# define YYCOPY_NEEDED 1828829/* Relocate STACK from its old location to the new one. The830 local variables YYSIZE and YYSTACKSIZE give the old and new number of831 elements in the stack, and YYPTR gives the new location of the832 stack. Advance YYPTR to a properly aligned location for the next833 stack. */834# define YYSTACK_RELOCATE(Stack_alloc, Stack) \835 do \836 { \837 YYPTRDIFF_T yynewbytes; \838 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \839 Stack = &yyptr->Stack_alloc; \840 yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \841 yyptr += yynewbytes / YYSIZEOF (*yyptr); \842 } \843 while (0)844845#endif846847#if defined YYCOPY_NEEDED && YYCOPY_NEEDED848/* Copy COUNT objects from SRC to DST. The source and destination do849 not overlap. */850# ifndef YYCOPY851# if defined __GNUC__ && 1 < __GNUC__852# define YYCOPY(Dst, Src, Count) \853 __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src)))854# else855# define YYCOPY(Dst, Src, Count) \856 do \857 { \858 YYPTRDIFF_T yyi; \859 for (yyi = 0; yyi < (Count); yyi++) \860 (Dst)[yyi] = (Src)[yyi]; \861 } \862 while (0)863# endif864# endif865#endif /* !YYCOPY_NEEDED */866867/* YYFINAL -- State number of the termination state. */868#define YYFINAL 31869/* YYLAST -- Last index in YYTABLE. */870#define YYLAST 1165871872/* YYNTOKENS -- Number of terminals. */873#define YYNTOKENS 69874/* YYNNTS -- Number of nonterminals. */875#define YYNNTS 30876/* YYNRULES -- Number of rules. */877#define YYNRULES 168878/* YYNSTATES -- Number of states. */879#define YYNSTATES 313880881/* YYMAXUTOK -- Last valid token kind. */882#define YYMAXUTOK 302883884885/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM886 as returned by yylex, with out-of-bounds checking. */887#define YYTRANSLATE(YYX) \888 (0 <= (YYX) && (YYX) <= YYMAXUTOK \889 ? YY_CAST (yysymbol_kind_t, yytranslate[YYX]) \890 : YYSYMBOL_YYUNDEF)891892/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM893 as returned by yylex. */894static const yytype_int8 yytranslate[] =895{896 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,897 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,898 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,899 2, 2, 2, 2, 2, 2, 68, 56, 2, 2,900 63, 64, 54, 52, 48, 53, 59, 55, 2, 2,901 2, 2, 2, 2, 2, 2, 2, 2, 62, 61,902 50, 49, 51, 58, 2, 2, 2, 2, 2, 2,903 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,904 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,905 2, 60, 2, 65, 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, 2, 2, 66, 47, 67, 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, 2, 2, 2, 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, 1, 2, 3, 4,922 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,923 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,924 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,925 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,926 45, 46, 57927};928929#if YYDEBUG930/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */931static const yytype_int16 yyrline[] =932{933 0, 281, 281, 284, 289, 292, 307, 310, 315, 318,934 324, 327, 330, 336, 339, 342, 348, 351, 354, 357,935 360, 363, 366, 369, 372, 375, 378, 381, 384, 387,936 390, 393, 396, 399, 402, 405, 408, 411, 414, 420,937 423, 440, 444, 448, 454, 465, 470, 476, 479, 484,938 488, 495, 498, 504, 511, 514, 517, 523, 526, 529,939 535, 538, 541, 549, 553, 556, 559, 562, 565, 568,940 571, 574, 577, 581, 587, 590, 593, 596, 599, 602,941 605, 608, 611, 614, 617, 620, 623, 626, 629, 632,942 635, 638, 641, 644, 647, 650, 653, 660, 663, 666,943 669, 672, 676, 679, 683, 701, 705, 709, 712, 724,944 729, 730, 731, 732, 735, 738, 743, 748, 751, 756,945 759, 764, 768, 771, 776, 779, 784, 787, 792, 795,946 798, 801, 804, 807, 815, 821, 824, 827, 830, 833,947 836, 839, 842, 845, 848, 851, 854, 857, 860, 863,948 866, 869, 872, 878, 881, 884, 889, 892, 895, 898,949 902, 907, 911, 915, 919, 923, 931, 937, 940950};951#endif952953/** Accessing symbol of state STATE. */954#define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State])955956#if 1957/* The user-facing name of the symbol whose (internal) number is958 YYSYMBOL. No bounds checking. */959static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED;960961/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.962 First, the terminals, then, starting at YYNTOKENS, nonterminals. */963static const char *const yytname[] =964{965 "\"end of file\"", "error", "\"invalid token\"", "INVALID_CHARACTER",966 "IDENT", "FIELD", "BINDING", "LITERAL", "FORMAT", "\"..\"", "\"%=\"",967 "\"==\"", "\"!=\"", "\"//\"", "\"as\"", "\"def\"", "\"module\"",968 "\"import\"", "\"include\"", "\"if\"", "\"then\"", "\"else\"",969 "\"elif\"", "\"reduce\"", "\"foreach\"", "\"end\"", "\"and\"", "\"or\"",970 "\"try\"", "\"catch\"", "\"label\"", "\"break\"", "\"$__loc__\"",971 "\"|=\"", "\"+=\"", "\"-=\"", "\"*=\"", "\"/=\"", "\"//=\"", "\"<=\"",972 "\">=\"", "QQSTRING_START", "QQSTRING_TEXT", "QQSTRING_INTERP_START",973 "QQSTRING_INTERP_END", "QQSTRING_END", "FUNCDEF", "'|'", "','", "'='",974 "'<'", "'>'", "'+'", "'-'", "'*'", "'/'", "'%'", "NONOPT", "'?'", "'.'",975 "'['", "';'", "':'", "'('", "')'", "']'", "'{'", "'}'", "'$'", "$accept",976 "TopLevel", "Module", "Imports", "FuncDefs", "Query", "Expr", "Import",977 "ImportWhat", "ImportFrom", "FuncDef", "Params", "Param", "StringStart",978 "String", "QQString", "ElseBody", "Term", "Args", "Arg", "RepPatterns",979 "Patterns", "Pattern", "ArrayPats", "ObjPats", "ObjPat", "Keyword",980 "DictPairs", "DictPair", "DictExpr", YY_NULLPTR981};982983static const char *984yysymbol_name (yysymbol_kind_t yysymbol)985{986 return yytname[yysymbol];987}988#endif989990#define YYPACT_NINF (-146)991992#define yypact_value_is_default(Yyn) \993 ((Yyn) == YYPACT_NINF)994995#define YYTABLE_NINF (-154)996997#define yytable_value_is_error(Yyn) \998 ((Yyn) == YYTABLE_NINF)9991000/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing1001 STATE-NUM. */1002static const yytype_int16 yypact[] =1003{1004 43, 882, 63, -6, 82, 84, -146, -146, 120, -146,1005 147, 882, 947, 947, 947, 188, 72, -146, -146, 947,1006 280, 345, 411, 604, 137, -30, 985, 882, -146, -146,1007 2, -146, 31, 31, 882, -6, 687, 882, -146, -146,1008 12, 105, 1016, 1047, 177, 165, -146, -146, 2, -146,1009 212, 120, 175, 158, -146, 23, 172, 132, 81, 180,1010 190, -146, -146, -146, -146, -146, -146, -146, -146, -146,1011 -146, -146, -146, -146, -146, -146, -146, -146, -146, -146,1012 882, 194, 195, 174, 218, 204, 882, 882, -146, 947,1013 947, 947, 947, -2, 947, 947, 947, 947, 947, 947,1014 947, 947, 947, 947, 947, 947, 947, 947, 947, 947,1015 947, 947, 71, 228, 220, -146, 79, 169, 262, -146,1016 -146, -146, 71, 882, -146, -146, 21, 71, 20, -146,1017 882, 181, 477, -2, -2, 543, 882, -146, -146, -146,1018 -146, -146, -146, 947, -146, 947, 947, 134, 947, 947,1019 -146, 658, 273, 71, -146, 1109, 209, 209, 1078, -146,1020 -2, 26, 225, 239, 229, 602, 907, 1109, 1109, 1109,1021 1109, 1109, 1109, 209, 209, 1109, 209, 209, 162, 162,1022 -146, -146, -146, -146, 882, -146, -146, 752, 231, 230,1023 882, 241, 18, 271, -146, -146, 882, -146, 110, -146,1024 -146, 101, -146, -146, 116, 240, 247, -146, -146, 71,1025 1078, 257, 257, 257, 249, 257, 257, 250, -146, -146,1026 -146, -46, 260, 261, 263, 882, 264, -45, -146, 275,1027 330, 882, 167, 290, 29, -146, -146, 75, -146, 817,1028 297, -146, -146, -146, -146, 181, 294, 882, 882, -146,1029 -146, 882, 882, 947, 947, -2, -146, -2, -2, -2,1030 155, -2, 26, -146, -2, -2, 71, -146, -146, 299,1031 300, 301, 107, -146, -146, 882, -24, 112, 192, 197,1032 257, 257, -146, -146, -146, -146, 303, -146, -146, -146,1033 304, -146, -146, -146, 305, 221, -146, 882, 882, 882,1034 -2, -146, -146, 116, 161, 143, -146, -146, -146, 882,1035 -146, 179, -1461036};10371038/* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.1039 Performed when YYTABLE does not specify something else to do. Zero1040 means the default is an error. */1041static const yytype_uint8 yydefact[] =1042{1043 4, 0, 0, 6, 108, 69, 106, 89, 91, 61,1044 0, 0, 0, 0, 0, 0, 0, 107, 52, 0,1045 0, 0, 0, 0, 0, 0, 15, 0, 54, 90,1046 38, 1, 0, 0, 8, 6, 0, 0, 65, 51,1047 0, 0, 0, 0, 104, 0, 63, 62, 92, 72,1048 0, 0, 71, 0, 95, 0, 0, 0, 0, 162,1049 161, 135, 136, 137, 138, 139, 140, 141, 142, 143,1050 144, 145, 146, 147, 148, 149, 150, 151, 152, 163,1051 0, 159, 164, 0, 154, 0, 0, 0, 5, 0,1052 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,1053 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,1054 0, 0, 10, 0, 68, 88, 0, 0, 0, 44,1055 43, 3, 2, 8, 7, 39, 0, 116, 0, 114,1056 0, 0, 0, 0, 0, 0, 0, 73, 67, 111,1057 94, 110, 93, 0, 113, 0, 0, 0, 0, 0,1058 96, 0, 0, 13, 14, 31, 32, 33, 16, 121,1059 0, 0, 0, 0, 120, 19, 18, 21, 23, 25,1060 27, 30, 20, 36, 37, 17, 34, 35, 22, 24,1061 26, 28, 29, 55, 0, 53, 64, 0, 70, 0,1062 0, 79, 0, 0, 9, 40, 0, 109, 0, 50,1063 49, 0, 47, 101, 0, 0, 0, 103, 102, 12,1064 168, 166, 156, 160, 0, 158, 157, 0, 155, 105,1065 124, 0, 0, 0, 128, 0, 0, 0, 126, 0,1066 0, 0, 0, 81, 0, 66, 112, 0, 78, 0,1067 75, 42, 41, 115, 45, 0, 0, 0, 0, 59,1068 100, 0, 0, 0, 0, 0, 122, 0, 0, 0,1069 0, 0, 0, 123, 0, 0, 11, 56, 80, 77,1070 87, 86, 0, 74, 48, 0, 0, 0, 0, 0,1071 167, 165, 125, 134, 130, 129, 0, 132, 127, 131,1072 119, 76, 84, 83, 85, 0, 58, 0, 0, 0,1073 0, 82, 46, 0, 0, 0, 133, 57, 97, 0,1074 99, 0, 981075};10761077/* YYPGOTO[NTERM-NUM]. */1078static const yytype_int16 yypgoto[] =1079{1080 -146, -146, -146, 326, 243, -1, 1, -146, -146, 334,1081 -8, -146, 125, -146, 5, -146, 68, 353, -146, 178,1082 -146, 34, -131, -146, -146, 117, -145, 227, -146, -1401083};10841085/* YYDEFGOTO[NTERM-NUM]. */1086static const yytype_uint8 yydefgoto[] =1087{1088 0, 2, 3, 34, 121, 112, 26, 35, 36, 118,1089 27, 201, 202, 28, 29, 113, 250, 30, 128, 129,1090 162, 163, 164, 221, 227, 228, 82, 83, 84, 2111091};10921093/* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If1094 positive, shift that token. If negative, reduce the rule whose1095 number is the opposite. If YYTABLE_NINF, syntax error. */1096static const yytype_int16 yytable[] =1097{1098 25, 296, 255, 262, 159, 212, 213, 114, 215, 216,1099 41, 32, 33, 42, 43, 44, 229, 86, 87, 256,1100 55, 57, 263, 86, 87, 52, 123, 222, 81, 220,1101 223, 88, 224, 122, 51, 126, 127, 119, 119, 51,1102 61, 62, 63, 64, 65, 66, 67, 68, 69, 70,1103 71, 72, 73, 74, 75, 76, 77, 78, 160, 1,1104 115, 116, 117, 31, 161, 86, 87, 18, 86, 87,1105 86, 87, 18, 46, 130, 131, 86, 87, 47, 147,1106 239, 196, 195, 240, 197, 153, 154, 51, 140, 225,1107 155, 156, 157, 158, 269, 165, 166, 167, 168, 169,1108 170, 171, 172, 173, 174, 175, 176, 177, 178, 179,1109 180, 181, 182, 280, 281, 123, 192, 229, 86, 87,1110 18, 188, 86, 87, 282, 132, 283, 284, 285, 198,1111 287, 204, 297, 289, 290, 209, 208, 247, 248, 187,1112 270, 249, 38, 143, 210, 37, 210, 210, 144, 210,1113 210, 40, 86, 87, 86, 87, 81, 86, 87, 86,1114 87, 39, 245, 86, 87, 246, 226, 205, 206, 306,1115 189, 244, 294, 4, 5, 6, 7, 8, 9, 86,1116 87, 86, 87, 232, 10, 199, 234, 200, 11, 237,1117 86, 87, 12, 13, 45, 127, 142, 14, 214, 15,1118 16, 17, 86, 87, 309, 85, 135, 310, 86, 87,1119 18, 267, 136, 137, 86, 87, 109, 110, 111, 286,1120 -154, -154, 19, 139, 260, 308, 86, 87, 20, 21,1121 266, 190, 22, 138, 191, 23, 141, 24, 272, 86,1122 87, 150, 145, 312, 86, 87, 276, 277, -154, -154,1123 278, 279, 146, 298, 210, 210, 148, 149, 299, -154,1124 -154, 107, 108, 109, 110, 111, 151, 226, 86, 87,1125 183, 184, 152, 185, 295, 241, 193, 242, 186, 219,1126 -60, 49, 302, 230, 50, -60, 231, -118, 51, 235,1127 -60, -60, -60, -60, -60, 236, 303, 304, 305, 238,1128 -60, -60, -60, 251, 253, -60, -60, -60, 311, -60,1129 252, 254, 143, -60, -60, -60, -60, -60, -60, -60,1130 -60, 18, 257, 258, -60, 259, 261, -60, -60, -60,1131 -60, -60, -60, -60, -60, -60, -60, 264, -60, -60,1132 -60, -60, -60, 265, -60, -60, 53, -60, 268, 4,1133 5, 6, 7, 8, 9, 273, 275, 291, 292, 293,1134 10, 124, -117, 301, 11, 300, 194, 120, 12, 13,1135 274, 307, 48, 14, 243, 15, 16, 17, 218, 288,1136 0, 0, 0, 0, 0, 0, 18, 0, 0, 0,1137 0, 0, 0, 0, 0, 0, 0, 0, 19, 0,1138 0, 0, 0, 0, 20, 21, 0, 0, 22, 0,1139 54, 23, 56, 24, 0, 4, 5, 6, 7, 8,1140 9, 0, 0, 0, 0, 0, 10, 0, 0, 0,1141 11, 0, 0, 0, 12, 13, 0, 0, 0, 14,1142 0, 15, 16, 17, 0, 0, 0, 0, 0, 0,1143 0, 0, 18, 0, 0, 0, 0, 0, 0, 0,1144 0, 0, 0, 0, 19, 0, 0, 0, 0, 0,1145 20, 21, 0, 0, 22, 0, 0, 23, 203, 24,1146 0, 4, 5, 6, 7, 8, 9, 0, 0, 0,1147 0, 0, 10, 0, 0, 0, 11, 0, 0, 0,1148 12, 13, 0, 0, 0, 14, 0, 15, 16, 17,1149 0, 0, 0, 0, 0, 0, 0, 0, 18, 0,1150 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,1151 19, 0, 0, 0, 0, 0, 20, 21, 0, 0,1152 22, 0, 0, 23, 207, 24, 0, 4, 5, 6,1153 7, 8, 9, 0, 0, 0, 0, 0, 0, 0,1154 0, 0, 11, 0, 0, 0, 12, 13, 0, 0,1155 0, 14, 0, 0, 16, 17, 0, 0, 0, 0,1156 0, 0, 0, 0, 18, 0, 0, 0, 0, 0,1157 0, 0, 0, 0, 0, 0, 19, 0, 0, 0,1158 0, 0, 20, 21, 0, 58, 22, 0, 59, 23,1159 60, 24, 51, 90, 91, 0, 0, 0, 61, 62,1160 63, 64, 65, 66, 67, 68, 69, 70, 71, 72,1161 73, 74, 75, 76, 77, 78, 79, 0, 0, 0,1162 0, 102, 103, 0, 0, 18, 0, 0, 0, 0,1163 0, 0, 105, 106, 107, 108, 109, 110, 111, 217,1164 0, 0, 59, 0, 60, 0, 51, 80, 0, 0,1165 0, -153, 61, 62, 63, 64, 65, 66, 67, 68,1166 69, 70, 71, 72, 73, 74, 75, 76, 77, 78,1167 79, 4, 5, 6, 7, 8, 9, 0, 0, 18,1168 0, 0, 10, 0, 0, 0, 11, 0, 0, 0,1169 12, 13, 0, 0, 0, 14, 0, 15, 16, 17,1170 0, 80, 0, 0, 0, -153, 0, 0, 18, 0,1171 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,1172 19, 0, 0, 0, 0, 0, 20, 21, 125, 0,1173 22, 0, 0, 23, 0, 24, 4, 5, 6, 7,1174 8, 9, 0, 0, 0, 0, 0, 10, 0, 0,1175 0, 11, 0, 0, 0, 12, 13, 0, 0, 0,1176 14, 0, 15, 16, 17, 0, 0, 0, 0, 0,1177 0, 0, 0, 18, 0, 0, 0, 0, 0, 0,1178 0, 0, 0, 0, 0, 19, 0, 0, 0, 0,1179 0, 20, 21, 0, 0, 22, 0, 233, 23, 0,1180 24, 4, 5, 6, 7, 8, 9, 0, 0, 0,1181 0, 0, 10, 0, 0, 0, 11, 0, 0, 0,1182 12, 13, 0, 0, 0, 14, 0, 15, 16, 17,1183 0, 0, 0, 0, 0, 0, 0, 0, 18, 0,1184 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,1185 19, 0, 0, 0, 0, 0, 20, 21, 0, 0,1186 22, 0, 271, 23, 0, 24, 4, 5, 6, 7,1187 8, 9, 0, 0, 0, 0, 0, 10, 0, 0,1188 0, 11, 0, 0, 0, 12, 13, 0, 0, 0,1189 14, 0, 15, 16, 17, 0, 0, 0, 90, 91,1190 0, 0, 0, 18, 0, 0, 0, 0, 0, 0,1191 0, 0, 0, 94, 0, 19, 0, 0, 0, 0,1192 0, 20, 21, 0, 0, 22, 102, 103, 23, 0,1193 24, 4, 5, 6, 7, 8, 9, 105, 106, 107,1194 108, 109, 110, 111, 0, 0, 11, 0, 0, 0,1195 12, 13, 0, 0, 0, 14, 0, 0, 16, 17,1196 0, 0, 0, 0, 0, 0, 0, 0, 18, 0,1197 0, 0, 0, 0, 0, 89, 90, 91, 92, 93,1198 19, 0, 0, 0, 0, 0, 20, 21, 0, 0,1199 22, 94, 95, 23, 0, 24, 0, 0, 96, 97,1200 98, 99, 100, 101, 102, 103, 89, 90, 91, 92,1201 133, 0, 0, 0, 104, 105, 106, 107, 108, 109,1202 110, 111, 94, 95, 0, 0, 0, 0, 0, 96,1203 97, 98, 99, 100, 101, 102, 103, 89, 90, 91,1204 92, 134, 0, 0, 0, 104, 105, 106, 107, 108,1205 109, 110, 111, 94, 95, 0, 0, 0, 0, 0,1206 96, 97, 98, 99, 100, 101, 102, 103, 89, 90,1207 91, 92, 0, 0, 0, 0, 104, 105, 106, 107,1208 108, 109, 110, 111, 94, 95, 0, 0, 0, 0,1209 0, 96, 97, 98, 99, 100, 101, 102, 103, -154,1210 90, 91, 0, 0, 0, 0, 0, 104, 105, 106,1211 107, 108, 109, 110, 111, 94, 95, 0, 0, 0,1212 0, 0, -154, -154, -154, -154, -154, -154, 102, 103,1213 0, 0, 0, 0, 0, 0, 0, 0, -154, 105,1214 106, 107, 108, 109, 110, 1111215};12161217static const yytype_int16 yycheck[] =1218{1219 1, 25, 48, 48, 6, 145, 146, 5, 148, 149,1220 11, 17, 18, 12, 13, 14, 161, 47, 48, 65,1221 21, 22, 67, 47, 48, 20, 34, 1, 23, 160,1222 4, 61, 6, 34, 8, 36, 37, 32, 33, 8,1223 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,1224 24, 25, 26, 27, 28, 29, 30, 31, 60, 16,1225 58, 59, 60, 0, 66, 47, 48, 41, 47, 48,1226 47, 48, 41, 1, 62, 63, 47, 48, 6, 80,1227 62, 61, 61, 65, 64, 86, 87, 8, 65, 63,1228 89, 90, 91, 92, 65, 94, 95, 96, 97, 98,1229 99, 100, 101, 102, 103, 104, 105, 106, 107, 108,1230 109, 110, 111, 253, 254, 123, 117, 262, 47, 48,1231 41, 116, 47, 48, 255, 20, 257, 258, 259, 130,1232 261, 132, 20, 264, 265, 136, 135, 21, 22, 60,1233 65, 25, 58, 62, 143, 63, 145, 146, 67, 148,1234 149, 4, 47, 48, 47, 48, 151, 47, 48, 47,1235 48, 41, 61, 47, 48, 64, 161, 133, 134, 300,1236 1, 61, 65, 4, 5, 6, 7, 8, 9, 47,1237 48, 47, 48, 184, 15, 4, 187, 6, 19, 190,1238 47, 48, 23, 24, 6, 196, 64, 28, 64, 30,1239 31, 32, 47, 48, 61, 68, 29, 64, 47, 48,1240 41, 44, 47, 1, 47, 48, 54, 55, 56, 64,1241 11, 12, 53, 65, 225, 64, 47, 48, 59, 60,1242 231, 62, 63, 58, 65, 66, 64, 68, 239, 47,1243 48, 67, 62, 64, 47, 48, 247, 248, 39, 40,1244 251, 252, 62, 61, 253, 254, 62, 62, 61, 50,1245 51, 52, 53, 54, 55, 56, 48, 262, 47, 48,1246 42, 43, 68, 45, 275, 4, 14, 6, 58, 6,1247 0, 1, 61, 58, 4, 5, 47, 58, 8, 58,1248 10, 11, 12, 13, 14, 65, 297, 298, 299, 58,1249 20, 21, 22, 63, 47, 25, 26, 27, 309, 29,1250 63, 62, 62, 33, 34, 35, 36, 37, 38, 39,1251 40, 41, 62, 62, 44, 62, 62, 47, 48, 49,1252 50, 51, 52, 53, 54, 55, 56, 62, 58, 59,1253 60, 61, 62, 13, 64, 65, 1, 67, 58, 4,1254 5, 6, 7, 8, 9, 58, 62, 58, 58, 58,1255 15, 35, 58, 58, 19, 62, 123, 33, 23, 24,1256 245, 303, 19, 28, 196, 30, 31, 32, 151, 262,1257 -1, -1, -1, -1, -1, -1, 41, -1, -1, -1,1258 -1, -1, -1, -1, -1, -1, -1, -1, 53, -1,1259 -1, -1, -1, -1, 59, 60, -1, -1, 63, -1,1260 65, 66, 1, 68, -1, 4, 5, 6, 7, 8,1261 9, -1, -1, -1, -1, -1, 15, -1, -1, -1,1262 19, -1, -1, -1, 23, 24, -1, -1, -1, 28,1263 -1, 30, 31, 32, -1, -1, -1, -1, -1, -1,1264 -1, -1, 41, -1, -1, -1, -1, -1, -1, -1,1265 -1, -1, -1, -1, 53, -1, -1, -1, -1, -1,1266 59, 60, -1, -1, 63, -1, -1, 66, 1, 68,1267 -1, 4, 5, 6, 7, 8, 9, -1, -1, -1,1268 -1, -1, 15, -1, -1, -1, 19, -1, -1, -1,1269 23, 24, -1, -1, -1, 28, -1, 30, 31, 32,1270 -1, -1, -1, -1, -1, -1, -1, -1, 41, -1,1271 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,1272 53, -1, -1, -1, -1, -1, 59, 60, -1, -1,1273 63, -1, -1, 66, 1, 68, -1, 4, 5, 6,1274 7, 8, 9, -1, -1, -1, -1, -1, -1, -1,1275 -1, -1, 19, -1, -1, -1, 23, 24, -1, -1,1276 -1, 28, -1, -1, 31, 32, -1, -1, -1, -1,1277 -1, -1, -1, -1, 41, -1, -1, -1, -1, -1,1278 -1, -1, -1, -1, -1, -1, 53, -1, -1, -1,1279 -1, -1, 59, 60, -1, 1, 63, -1, 4, 66,1280 6, 68, 8, 11, 12, -1, -1, -1, 14, 15,1281 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,1282 26, 27, 28, 29, 30, 31, 32, -1, -1, -1,1283 -1, 39, 40, -1, -1, 41, -1, -1, -1, -1,1284 -1, -1, 50, 51, 52, 53, 54, 55, 56, 1,1285 -1, -1, 4, -1, 6, -1, 8, 63, -1, -1,1286 -1, 67, 14, 15, 16, 17, 18, 19, 20, 21,1287 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,1288 32, 4, 5, 6, 7, 8, 9, -1, -1, 41,1289 -1, -1, 15, -1, -1, -1, 19, -1, -1, -1,1290 23, 24, -1, -1, -1, 28, -1, 30, 31, 32,1291 -1, 63, -1, -1, -1, 67, -1, -1, 41, -1,1292 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,1293 53, -1, -1, -1, -1, -1, 59, 60, 61, -1,1294 63, -1, -1, 66, -1, 68, 4, 5, 6, 7,1295 8, 9, -1, -1, -1, -1, -1, 15, -1, -1,1296 -1, 19, -1, -1, -1, 23, 24, -1, -1, -1,1297 28, -1, 30, 31, 32, -1, -1, -1, -1, -1,1298 -1, -1, -1, 41, -1, -1, -1, -1, -1, -1,1299 -1, -1, -1, -1, -1, 53, -1, -1, -1, -1,1300 -1, 59, 60, -1, -1, 63, -1, 65, 66, -1,1301 68, 4, 5, 6, 7, 8, 9, -1, -1, -1,1302 -1, -1, 15, -1, -1, -1, 19, -1, -1, -1,1303 23, 24, -1, -1, -1, 28, -1, 30, 31, 32,1304 -1, -1, -1, -1, -1, -1, -1, -1, 41, -1,1305 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,1306 53, -1, -1, -1, -1, -1, 59, 60, -1, -1,1307 63, -1, 65, 66, -1, 68, 4, 5, 6, 7,1308 8, 9, -1, -1, -1, -1, -1, 15, -1, -1,1309 -1, 19, -1, -1, -1, 23, 24, -1, -1, -1,1310 28, -1, 30, 31, 32, -1, -1, -1, 11, 12,1311 -1, -1, -1, 41, -1, -1, -1, -1, -1, -1,1312 -1, -1, -1, 26, -1, 53, -1, -1, -1, -1,1313 -1, 59, 60, -1, -1, 63, 39, 40, 66, -1,1314 68, 4, 5, 6, 7, 8, 9, 50, 51, 52,1315 53, 54, 55, 56, -1, -1, 19, -1, -1, -1,1316 23, 24, -1, -1, -1, 28, -1, -1, 31, 32,1317 -1, -1, -1, -1, -1, -1, -1, -1, 41, -1,1318 -1, -1, -1, -1, -1, 10, 11, 12, 13, 14,1319 53, -1, -1, -1, -1, -1, 59, 60, -1, -1,1320 63, 26, 27, 66, -1, 68, -1, -1, 33, 34,1321 35, 36, 37, 38, 39, 40, 10, 11, 12, 13,1322 14, -1, -1, -1, 49, 50, 51, 52, 53, 54,1323 55, 56, 26, 27, -1, -1, -1, -1, -1, 33,1324 34, 35, 36, 37, 38, 39, 40, 10, 11, 12,1325 13, 14, -1, -1, -1, 49, 50, 51, 52, 53,1326 54, 55, 56, 26, 27, -1, -1, -1, -1, -1,1327 33, 34, 35, 36, 37, 38, 39, 40, 10, 11,1328 12, 13, -1, -1, -1, -1, 49, 50, 51, 52,1329 53, 54, 55, 56, 26, 27, -1, -1, -1, -1,1330 -1, 33, 34, 35, 36, 37, 38, 39, 40, 10,1331 11, 12, -1, -1, -1, -1, -1, 49, 50, 51,1332 52, 53, 54, 55, 56, 26, 27, -1, -1, -1,1333 -1, -1, 33, 34, 35, 36, 37, 38, 39, 40,1334 -1, -1, -1, -1, -1, -1, -1, -1, 49, 50,1335 51, 52, 53, 54, 55, 561336};13371338/* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of1339 state STATE-NUM. */1340static const yytype_int8 yystos[] =1341{1342 0, 16, 70, 71, 4, 5, 6, 7, 8, 9,1343 15, 19, 23, 24, 28, 30, 31, 32, 41, 53,1344 59, 60, 63, 66, 68, 74, 75, 79, 82, 83,1345 86, 0, 17, 18, 72, 76, 77, 63, 58, 41,1346 4, 74, 75, 75, 75, 6, 1, 6, 86, 1,1347 4, 8, 83, 1, 65, 74, 1, 74, 1, 4,1348 6, 14, 15, 16, 17, 18, 19, 20, 21, 22,1349 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,1350 63, 83, 95, 96, 97, 68, 47, 48, 61, 10,1351 11, 12, 13, 14, 26, 27, 33, 34, 35, 36,1352 37, 38, 39, 40, 49, 50, 51, 52, 53, 54,1353 55, 56, 74, 84, 5, 58, 59, 60, 78, 83,1354 78, 73, 74, 79, 72, 61, 74, 74, 87, 88,1355 62, 63, 20, 14, 14, 29, 47, 1, 58, 65,1356 65, 64, 64, 62, 67, 62, 62, 74, 62, 62,1357 67, 48, 68, 74, 74, 75, 75, 75, 75, 6,1358 60, 66, 89, 90, 91, 75, 75, 75, 75, 75,1359 75, 75, 75, 75, 75, 75, 75, 75, 75, 75,1360 75, 75, 75, 42, 43, 45, 58, 60, 83, 1,1361 62, 65, 74, 14, 73, 61, 61, 64, 74, 4,1362 6, 80, 81, 1, 74, 90, 90, 1, 75, 74,1363 75, 98, 98, 98, 64, 98, 98, 1, 96, 6,1364 91, 92, 1, 4, 6, 63, 83, 93, 94, 95,1365 58, 47, 74, 65, 74, 58, 65, 74, 58, 62,1366 65, 4, 6, 88, 61, 61, 64, 21, 22, 25,1367 85, 63, 63, 47, 62, 48, 65, 62, 62, 62,1368 74, 62, 48, 67, 62, 13, 74, 44, 58, 65,1369 65, 65, 74, 58, 81, 62, 74, 74, 74, 74,1370 98, 98, 91, 91, 91, 91, 64, 91, 94, 91,1371 91, 58, 58, 58, 65, 74, 25, 20, 61, 61,1372 62, 58, 61, 74, 74, 74, 91, 85, 64, 61,1373 64, 74, 641374};13751376/* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */1377static const yytype_int8 yyr1[] =1378{1379 0, 69, 70, 70, 71, 71, 72, 72, 73, 73,1380 74, 74, 74, 74, 74, 74, 75, 75, 75, 75,1381 75, 75, 75, 75, 75, 75, 75, 75, 75, 75,1382 75, 75, 75, 75, 75, 75, 75, 75, 75, 76,1383 76, 77, 77, 77, 78, 79, 79, 80, 80, 81,1384 81, 82, 82, 83, 84, 84, 84, 85, 85, 85,1385 86, 86, 86, 86, 86, 86, 86, 86, 86, 86,1386 86, 86, 86, 86, 86, 86, 86, 86, 86, 86,1387 86, 86, 86, 86, 86, 86, 86, 86, 86, 86,1388 86, 86, 86, 86, 86, 86, 86, 86, 86, 86,1389 86, 86, 86, 86, 86, 86, 86, 86, 86, 86,1390 86, 86, 86, 86, 87, 87, 88, 89, 89, 90,1391 90, 91, 91, 91, 92, 92, 93, 93, 94, 94,1392 94, 94, 94, 94, 94, 95, 95, 95, 95, 95,1393 95, 95, 95, 95, 95, 95, 95, 95, 95, 95,1394 95, 95, 95, 96, 96, 96, 97, 97, 97, 97,1395 97, 97, 97, 97, 97, 97, 97, 98, 981396};13971398/* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */1399static const yytype_int8 yyr2[] =1400{1401 0, 2, 3, 3, 0, 3, 0, 2, 0, 2,1402 2, 5, 4, 3, 3, 1, 3, 3, 3, 3,1403 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,1404 3, 3, 3, 3, 3, 3, 3, 3, 1, 2,1405 3, 4, 4, 2, 1, 5, 8, 1, 3, 1,1406 1, 2, 1, 3, 0, 2, 4, 5, 3, 1,1407 1, 1, 2, 2, 3, 2, 4, 3, 2, 1,1408 3, 2, 2, 3, 5, 4, 6, 5, 4, 3,1409 5, 4, 7, 6, 6, 6, 5, 5, 2, 1,1410 1, 1, 2, 3, 3, 2, 3, 9, 11, 9,1411 5, 4, 4, 4, 2, 4, 1, 1, 1, 4,1412 3, 3, 4, 3, 1, 3, 1, 4, 1, 4,1413 1, 1, 3, 3, 1, 3, 1, 3, 1, 3,1414 3, 3, 3, 5, 3, 1, 1, 1, 1, 1,1415 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1416 1, 1, 1, 0, 1, 3, 3, 3, 3, 1,1417 3, 1, 1, 1, 1, 5, 3, 3, 11418};141914201421enum { YYENOMEM = -2 };14221423#define yyerrok (yyerrstatus = 0)1424#define yyclearin (yychar = YYEMPTY)14251426#define YYACCEPT goto yyacceptlab1427#define YYABORT goto yyabortlab1428#define YYERROR goto yyerrorlab1429#define YYNOMEM goto yyexhaustedlab143014311432#define YYRECOVERING() (!!yyerrstatus)14331434#define YYBACKUP(Token, Value) \1435 do \1436 if (yychar == YYEMPTY) \1437 { \1438 yychar = (Token); \1439 yylval = (Value); \1440 YYPOPSTACK (yylen); \1441 yystate = *yyssp; \1442 goto yybackup; \1443 } \1444 else \1445 { \1446 yyerror (&yylloc, answer, errors, locations, lexer_param_ptr, YY_("syntax error: cannot back up")); \1447 YYERROR; \1448 } \1449 while (0)14501451/* Backward compatibility with an undocumented macro.1452 Use YYerror or YYUNDEF. */1453#define YYERRCODE YYUNDEF14541455/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].1456 If N is 0, then set CURRENT to the empty location which ends1457 the previous symbol: RHS[0] (always defined). */14581459#ifndef YYLLOC_DEFAULT1460# define YYLLOC_DEFAULT(Current, Rhs, N) \1461 do \1462 if (N) \1463 { \1464 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \1465 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \1466 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \1467 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \1468 } \1469 else \1470 { \1471 (Current).first_line = (Current).last_line = \1472 YYRHSLOC (Rhs, 0).last_line; \1473 (Current).first_column = (Current).last_column = \1474 YYRHSLOC (Rhs, 0).last_column; \1475 } \1476 while (0)1477#endif14781479#define YYRHSLOC(Rhs, K) ((Rhs)[K])148014811482/* Enable debugging if requested. */1483#if YYDEBUG14841485# ifndef YYFPRINTF1486# include <stdio.h> /* INFRINGES ON USER NAME SPACE */1487# define YYFPRINTF fprintf1488# endif14891490# define YYDPRINTF(Args) \1491do { \1492 if (yydebug) \1493 YYFPRINTF Args; \1494} while (0)149514961497/* YYLOCATION_PRINT -- Print the location on the stream.1498 This macro was not mandated originally: define only if we know1499 we won't break user code: when these are the locations we know. */15001501# ifndef YYLOCATION_PRINT15021503# if defined YY_LOCATION_PRINT15041505 /* Temporary convenience wrapper in case some people defined the1506 undocumented and private YY_LOCATION_PRINT macros. */1507# define YYLOCATION_PRINT(File, Loc) YY_LOCATION_PRINT(File, *(Loc))15081509# elif defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL15101511/* Print *YYLOCP on YYO. Private, do not rely on its existence. */15121513YY_ATTRIBUTE_UNUSED1514static int1515yy_location_print_ (FILE *yyo, YYLTYPE const * const yylocp)1516{1517 int res = 0;1518 int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;1519 if (0 <= yylocp->first_line)1520 {1521 res += YYFPRINTF (yyo, "%d", yylocp->first_line);1522 if (0 <= yylocp->first_column)1523 res += YYFPRINTF (yyo, ".%d", yylocp->first_column);1524 }1525 if (0 <= yylocp->last_line)1526 {1527 if (yylocp->first_line < yylocp->last_line)1528 {1529 res += YYFPRINTF (yyo, "-%d", yylocp->last_line);1530 if (0 <= end_col)1531 res += YYFPRINTF (yyo, ".%d", end_col);1532 }1533 else if (0 <= end_col && yylocp->first_column < end_col)1534 res += YYFPRINTF (yyo, "-%d", end_col);1535 }1536 return res;1537}15381539# define YYLOCATION_PRINT yy_location_print_15401541 /* Temporary convenience wrapper in case some people defined the1542 undocumented and private YY_LOCATION_PRINT macros. */1543# define YY_LOCATION_PRINT(File, Loc) YYLOCATION_PRINT(File, &(Loc))15441545# else15461547# define YYLOCATION_PRINT(File, Loc) ((void) 0)1548 /* Temporary convenience wrapper in case some people defined the1549 undocumented and private YY_LOCATION_PRINT macros. */1550# define YY_LOCATION_PRINT YYLOCATION_PRINT15511552# endif1553# endif /* !defined YYLOCATION_PRINT */155415551556# define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \1557do { \1558 if (yydebug) \1559 { \1560 YYFPRINTF (stderr, "%s ", Title); \1561 yy_symbol_print (stderr, \1562 Kind, Value, Location, answer, errors, locations, lexer_param_ptr); \1563 YYFPRINTF (stderr, "\n"); \1564 } \1565} while (0)156615671568/*-----------------------------------.1569| Print this symbol's value on YYO. |1570`-----------------------------------*/15711572static void1573yy_symbol_value_print (FILE *yyo,1574 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)1575{1576 FILE *yyoutput = yyo;1577 YY_USE (yyoutput);1578 YY_USE (yylocationp);1579 YY_USE (answer);1580 YY_USE (errors);1581 YY_USE (locations);1582 YY_USE (lexer_param_ptr);1583 if (!yyvaluep)1584 return;1585 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN1586 YY_USE (yykind);1587 YY_IGNORE_MAYBE_UNINITIALIZED_END1588}158915901591/*---------------------------.1592| Print this symbol on YYO. |1593`---------------------------*/15941595static void1596yy_symbol_print (FILE *yyo,1597 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)1598{1599 YYFPRINTF (yyo, "%s %s (",1600 yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind));16011602 YYLOCATION_PRINT (yyo, yylocationp);1603 YYFPRINTF (yyo, ": ");1604 yy_symbol_value_print (yyo, yykind, yyvaluep, yylocationp, answer, errors, locations, lexer_param_ptr);1605 YYFPRINTF (yyo, ")");1606}16071608/*------------------------------------------------------------------.1609| yy_stack_print -- Print the state stack from its BOTTOM up to its |1610| TOP (included). |1611`------------------------------------------------------------------*/16121613static void1614yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop)1615{1616 YYFPRINTF (stderr, "Stack now");1617 for (; yybottom <= yytop; yybottom++)1618 {1619 int yybot = *yybottom;1620 YYFPRINTF (stderr, " %d", yybot);1621 }1622 YYFPRINTF (stderr, "\n");1623}16241625# define YY_STACK_PRINT(Bottom, Top) \1626do { \1627 if (yydebug) \1628 yy_stack_print ((Bottom), (Top)); \1629} while (0)163016311632/*------------------------------------------------.1633| Report that the YYRULE is going to be reduced. |1634`------------------------------------------------*/16351636static void1637yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp, YYLTYPE *yylsp,1638 int yyrule, block* answer, int* errors, struct locfile* locations, struct lexer_param* lexer_param_ptr)1639{1640 int yylno = yyrline[yyrule];1641 int yynrhs = yyr2[yyrule];1642 int yyi;1643 YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n",1644 yyrule - 1, yylno);1645 /* The symbols being reduced. */1646 for (yyi = 0; yyi < yynrhs; yyi++)1647 {1648 YYFPRINTF (stderr, " $%d = ", yyi + 1);1649 yy_symbol_print (stderr,1650 YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]),1651 &yyvsp[(yyi + 1) - (yynrhs)],1652 &(yylsp[(yyi + 1) - (yynrhs)]), answer, errors, locations, lexer_param_ptr);1653 YYFPRINTF (stderr, "\n");1654 }1655}16561657# define YY_REDUCE_PRINT(Rule) \1658do { \1659 if (yydebug) \1660 yy_reduce_print (yyssp, yyvsp, yylsp, Rule, answer, errors, locations, lexer_param_ptr); \1661} while (0)16621663/* Nonzero means print parse trace. It is left uninitialized so that1664 multiple parsers can coexist. */1665int yydebug;1666#else /* !YYDEBUG */1667# define YYDPRINTF(Args) ((void) 0)1668# define YY_SYMBOL_PRINT(Title, Kind, Value, Location)1669# define YY_STACK_PRINT(Bottom, Top)1670# define YY_REDUCE_PRINT(Rule)1671#endif /* !YYDEBUG */167216731674/* YYINITDEPTH -- initial size of the parser's stacks. */1675#ifndef YYINITDEPTH1676# define YYINITDEPTH 2001677#endif16781679/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only1680 if the built-in stack extension method is used).16811682 Do not make this value too large; the results are undefined if1683 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)1684 evaluated with infinite-precision integer arithmetic. */16851686#ifndef YYMAXDEPTH1687# define YYMAXDEPTH 100001688#endif168916901691/* Context of a parse error. */1692typedef struct1693{1694 yy_state_t *yyssp;1695 yysymbol_kind_t yytoken;1696 YYLTYPE *yylloc;1697} yypcontext_t;16981699/* Put in YYARG at most YYARGN of the expected tokens given the1700 current YYCTX, and return the number of tokens stored in YYARG. If1701 YYARG is null, return the number of expected tokens (guaranteed to1702 be less than YYNTOKENS). Return YYENOMEM on memory exhaustion.1703 Return 0 if there are more than YYARGN expected tokens, yet fill1704 YYARG up to YYARGN. */1705static int1706yypcontext_expected_tokens (const yypcontext_t *yyctx,1707 yysymbol_kind_t yyarg[], int yyargn)1708{1709 /* Actual size of YYARG. */1710 int yycount = 0;1711 int yyn = yypact[+*yyctx->yyssp];1712 if (!yypact_value_is_default (yyn))1713 {1714 /* Start YYX at -YYN if negative to avoid negative indexes in1715 YYCHECK. In other words, skip the first -YYN actions for1716 this state because they are default actions. */1717 int yyxbegin = yyn < 0 ? -yyn : 0;1718 /* Stay within bounds of both yycheck and yytname. */1719 int yychecklim = YYLAST - yyn + 1;1720 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;1721 int yyx;1722 for (yyx = yyxbegin; yyx < yyxend; ++yyx)1723 if (yycheck[yyx + yyn] == yyx && yyx != YYSYMBOL_YYerror1724 && !yytable_value_is_error (yytable[yyx + yyn]))1725 {1726 if (!yyarg)1727 ++yycount;1728 else if (yycount == yyargn)1729 return 0;1730 else1731 yyarg[yycount++] = YY_CAST (yysymbol_kind_t, yyx);1732 }1733 }1734 if (yyarg && yycount == 0 && 0 < yyargn)1735 yyarg[0] = YYSYMBOL_YYEMPTY;1736 return yycount;1737}17381739174017411742#ifndef yystrlen1743# if defined __GLIBC__ && defined _STRING_H1744# define yystrlen(S) (YY_CAST (YYPTRDIFF_T, strlen (S)))1745# else1746/* Return the length of YYSTR. */1747static YYPTRDIFF_T1748yystrlen (const char *yystr)1749{1750 YYPTRDIFF_T yylen;1751 for (yylen = 0; yystr[yylen]; yylen++)1752 continue;1753 return yylen;1754}1755# endif1756#endif17571758#ifndef yystpcpy1759# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE1760# define yystpcpy stpcpy1761# else1762/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in1763 YYDEST. */1764static char *1765yystpcpy (char *yydest, const char *yysrc)1766{1767 char *yyd = yydest;1768 const char *yys = yysrc;17691770 while ((*yyd++ = *yys++) != '\0')1771 continue;17721773 return yyd - 1;1774}1775# endif1776#endif17771778#ifndef yytnamerr1779/* Copy to YYRES the contents of YYSTR after stripping away unnecessary1780 quotes and backslashes, so that it's suitable for yyerror. The1781 heuristic is that double-quoting is unnecessary unless the string1782 contains an apostrophe, a comma, or backslash (other than1783 backslash-backslash). YYSTR is taken from yytname. If YYRES is1784 null, do not copy; instead, return the length of what the result1785 would have been. */1786static YYPTRDIFF_T1787yytnamerr (char *yyres, const char *yystr)1788{1789 if (*yystr == '"')1790 {1791 YYPTRDIFF_T yyn = 0;1792 char const *yyp = yystr;1793 for (;;)1794 switch (*++yyp)1795 {1796 case '\'':1797 case ',':1798 goto do_not_strip_quotes;17991800 case '\\':1801 if (*++yyp != '\\')1802 goto do_not_strip_quotes;1803 else1804 goto append;18051806 append:1807 default:1808 if (yyres)1809 yyres[yyn] = *yyp;1810 yyn++;1811 break;18121813 case '"':1814 if (yyres)1815 yyres[yyn] = '\0';1816 return yyn;1817 }1818 do_not_strip_quotes: ;1819 }18201821 if (yyres)1822 return yystpcpy (yyres, yystr) - yyres;1823 else1824 return yystrlen (yystr);1825}1826#endif182718281829static int1830yy_syntax_error_arguments (const yypcontext_t *yyctx,1831 yysymbol_kind_t yyarg[], int yyargn)1832{1833 /* Actual size of YYARG. */1834 int yycount = 0;1835 /* There are many possibilities here to consider:1836 - If this state is a consistent state with a default action, then1837 the only way this function was invoked is if the default action1838 is an error action. In that case, don't check for expected1839 tokens because there are none.1840 - The only way there can be no lookahead present (in yychar) is if1841 this state is a consistent state with a default action. Thus,1842 detecting the absence of a lookahead is sufficient to determine1843 that there is no unexpected or expected token to report. In that1844 case, just report a simple "syntax error".1845 - Don't assume there isn't a lookahead just because this state is a1846 consistent state with a default action. There might have been a1847 previous inconsistent state, consistent state with a non-default1848 action, or user semantic action that manipulated yychar.1849 - Of course, the expected token list depends on states to have1850 correct lookahead information, and it depends on the parser not1851 to perform extra reductions after fetching a lookahead from the1852 scanner and before detecting a syntax error. Thus, state merging1853 (from LALR or IELR) and default reductions corrupt the expected1854 token list. However, the list is correct for canonical LR with1855 one exception: it will still contain any token that will not be1856 accepted due to an error action in a later state.1857 */1858 if (yyctx->yytoken != YYSYMBOL_YYEMPTY)1859 {1860 int yyn;1861 if (yyarg)1862 yyarg[yycount] = yyctx->yytoken;1863 ++yycount;1864 yyn = yypcontext_expected_tokens (yyctx,1865 yyarg ? yyarg + 1 : yyarg, yyargn - 1);1866 if (yyn == YYENOMEM)1867 return YYENOMEM;1868 else1869 yycount += yyn;1870 }1871 return yycount;1872}18731874/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message1875 about the unexpected token YYTOKEN for the state stack whose top is1876 YYSSP.18771878 Return 0 if *YYMSG was successfully written. Return -1 if *YYMSG is1879 not large enough to hold the message. In that case, also set1880 *YYMSG_ALLOC to the required number of bytes. Return YYENOMEM if the1881 required number of bytes is too large to store. */1882static int1883yysyntax_error (YYPTRDIFF_T *yymsg_alloc, char **yymsg,1884 const yypcontext_t *yyctx)1885{1886 enum { YYARGS_MAX = 5 };1887 /* Internationalized format string. */1888 const char *yyformat = YY_NULLPTR;1889 /* Arguments of yyformat: reported tokens (one for the "unexpected",1890 one per "expected"). */1891 yysymbol_kind_t yyarg[YYARGS_MAX];1892 /* Cumulated lengths of YYARG. */1893 YYPTRDIFF_T yysize = 0;18941895 /* Actual size of YYARG. */1896 int yycount = yy_syntax_error_arguments (yyctx, yyarg, YYARGS_MAX);1897 if (yycount == YYENOMEM)1898 return YYENOMEM;18991900 switch (yycount)1901 {1902#define YYCASE_(N, S) \1903 case N: \1904 yyformat = S; \1905 break1906 default: /* Avoid compiler warnings. */1907 YYCASE_(0, YY_("syntax error"));1908 YYCASE_(1, YY_("syntax error, unexpected %s"));1909 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));1910 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));1911 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));1912 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));1913#undef YYCASE_1914 }19151916 /* Compute error message size. Don't count the "%s"s, but reserve1917 room for the terminator. */1918 yysize = yystrlen (yyformat) - 2 * yycount + 1;1919 {1920 int yyi;1921 for (yyi = 0; yyi < yycount; ++yyi)1922 {1923 YYPTRDIFF_T yysize11924 = yysize + yytnamerr (YY_NULLPTR, yytname[yyarg[yyi]]);1925 if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)1926 yysize = yysize1;1927 else1928 return YYENOMEM;1929 }1930 }19311932 if (*yymsg_alloc < yysize)1933 {1934 *yymsg_alloc = 2 * yysize;1935 if (! (yysize <= *yymsg_alloc1936 && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))1937 *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;1938 return -1;1939 }19401941 /* Avoid sprintf, as that infringes on the user's name space.1942 Don't have undefined behavior even if the translation1943 produced a string with the wrong number of "%s"s. */1944 {1945 char *yyp = *yymsg;1946 int yyi = 0;1947 while ((*yyp = *yyformat) != '\0')1948 if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)1949 {1950 yyp += yytnamerr (yyp, yytname[yyarg[yyi++]]);1951 yyformat += 2;1952 }1953 else1954 {1955 ++yyp;1956 ++yyformat;1957 }1958 }1959 return 0;1960}196119621963/*-----------------------------------------------.1964| Release the memory associated to this symbol. |1965`-----------------------------------------------*/19661967static void1968yydestruct (const char *yymsg,1969 yysymbol_kind_t yykind, YYSTYPE *yyvaluep, YYLTYPE *yylocationp, block* answer, int* errors, struct locfile* locations, struct lexer_param* lexer_param_ptr)1970{1971 YY_USE (yyvaluep);1972 YY_USE (yylocationp);1973 YY_USE (answer);1974 YY_USE (errors);1975 YY_USE (locations);1976 YY_USE (lexer_param_ptr);1977 if (!yymsg)1978 yymsg = "Deleting";1979 YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp);19801981 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN1982 switch (yykind)1983 {1984 case YYSYMBOL_IDENT: /* IDENT */1985#line 37 "src/parser.y"1986 { jv_free(((*yyvaluep).literal)); }1987#line 1988 "src/parser.c"1988 break;19891990 case YYSYMBOL_FIELD: /* FIELD */1991#line 37 "src/parser.y"1992 { jv_free(((*yyvaluep).literal)); }1993#line 1994 "src/parser.c"1994 break;19951996 case YYSYMBOL_BINDING: /* BINDING */1997#line 37 "src/parser.y"1998 { jv_free(((*yyvaluep).literal)); }1999#line 2000 "src/parser.c"2000 break;The first 2,000 of 4,162 lines.