"Fossies" - the Fresh Open Source Software Archive

Member "gawk-5.1.0/awkgram.c" (14 Apr 2020, 259683 Bytes) of package /linux/misc/gawk-5.1.0.tar.xz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "awkgram.c" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes report: 5.0.1_vs_5.1.0.

    1 /* A Bison parser, made by GNU Bison 3.5.4.  */
    2 
    3 /* Bison implementation for Yacc-like parsers in C
    4 
    5    Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2020 Free Software Foundation,
    6    Inc.
    7 
    8    This program is free software: you can redistribute it and/or modify
    9    it under the terms of the GNU General Public License as published by
   10    the Free Software Foundation, either version 3 of the License, or
   11    (at your option) any later version.
   12 
   13    This program is distributed in the hope that it will be useful,
   14    but WITHOUT ANY WARRANTY; without even the implied warranty of
   15    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   16    GNU General Public License for more details.
   17 
   18    You should have received a copy of the GNU General Public License
   19    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
   20 
   21 /* As a special exception, you may create a larger work that contains
   22    part or all of the Bison parser skeleton and distribute that work
   23    under terms of your choice, so long as that work isn't itself a
   24    parser generator using the skeleton or a modified version thereof
   25    as a parser skeleton.  Alternatively, if you modify or redistribute
   26    the parser skeleton itself, you may (at your option) remove this
   27    special exception, which will cause the skeleton and the resulting
   28    Bison output files to be licensed under the GNU General Public
   29    License without this special exception.
   30 
   31    This special exception was added by the Free Software Foundation in
   32    version 2.2 of Bison.  */
   33 
   34 /* C LALR(1) parser skeleton written by Richard Stallman, by
   35    simplifying the original so-called "semantic" parser.  */
   36 
   37 /* All symbols defined below should begin with yy or YY, to avoid
   38    infringing on user name space.  This should be done even for local
   39    variables, as they might otherwise be expanded by user macros.
   40    There are some unavoidable exceptions within include files to
   41    define necessary library symbols; they are noted "INFRINGES ON
   42    USER NAME SPACE" below.  */
   43 
   44 /* Undocumented macros, especially those whose name start with YY_,
   45    are private implementation details.  Do not rely on them.  */
   46 
   47 /* Identify Bison output.  */
   48 #define YYBISON 1
   49 
   50 /* Bison version.  */
   51 #define YYBISON_VERSION "3.5.4"
   52 
   53 /* Skeleton name.  */
   54 #define YYSKELETON_NAME "yacc.c"
   55 
   56 /* Pure parsers.  */
   57 #define YYPURE 0
   58 
   59 /* Push parsers.  */
   60 #define YYPUSH 0
   61 
   62 /* Pull parsers.  */
   63 #define YYPULL 1
   64 
   65 
   66 
   67 
   68 /* First part of user prologue.  */
   69 #line 26 "awkgram.y"
   70 
   71 #ifdef GAWKDEBUG
   72 #define YYDEBUG 12
   73 #endif
   74 
   75 #include "awk.h"
   76 
   77 #if defined(__STDC__) && __STDC__ < 1   /* VMS weirdness, maybe elsewhere */
   78 #define signed /**/
   79 #endif
   80 
   81 static void yyerror(const char *m, ...) ATTRIBUTE_PRINTF_1;
   82 static void error_ln(int line, const char *m, ...) ATTRIBUTE_PRINTF_2;
   83 static void lintwarn_ln(int line, const char *m, ...) ATTRIBUTE_PRINTF_2;
   84 static void warning_ln(int line, const char *m, ...) ATTRIBUTE_PRINTF_2;
   85 static char *get_src_buf(void);
   86 static int yylex(void);
   87 int yyparse(void);
   88 static INSTRUCTION *snode(INSTRUCTION *subn, INSTRUCTION *op);
   89 static char **check_params(char *fname, int pcount, INSTRUCTION *list);
   90 static int install_function(char *fname, INSTRUCTION *fi, INSTRUCTION *plist);
   91 static NODE *mk_rexp(INSTRUCTION *exp);
   92 static void param_sanity(INSTRUCTION *arglist);
   93 static int parms_shadow(INSTRUCTION *pc, bool *shadow);
   94 #ifndef NO_LINT
   95 static int isnoeffect(OPCODE type);
   96 #endif
   97 static INSTRUCTION *make_assignable(INSTRUCTION *ip);
   98 static void dumpintlstr(const char *str, size_t len);
   99 static void dumpintlstr2(const char *str1, size_t len1, const char *str2, size_t len2);
  100 static bool include_source(INSTRUCTION *file, void **srcfile_p);
  101 static bool load_library(INSTRUCTION *file, void **srcfile_p);
  102 static void set_namespace(INSTRUCTION *ns, INSTRUCTION *comment);
  103 static void next_sourcefile(void);
  104 static char *tokexpand(void);
  105 static NODE *set_profile_text(NODE *n, const char *str, size_t len);
  106 static int check_qualified_special(char *token);
  107 static char *qualify_name(const char *name, size_t len);
  108 static INSTRUCTION *trailing_comment;
  109 static INSTRUCTION *outer_comment;
  110 static INSTRUCTION *interblock_comment;
  111 static INSTRUCTION *pending_comment;
  112 static INSTRUCTION *namespace_chain;
  113 
  114 #ifdef DEBUG_COMMENTS
  115 static void
  116 debug_print_comment_s(const char *name, INSTRUCTION *comment, int line)
  117 {
  118     if (comment != NULL)
  119         fprintf(stderr, "%d: %s: <%.*s>\n", line, name,
  120                 (int) (comment->memory->stlen - 1),
  121                 comment->memory->stptr);
  122 }
  123 #define debug_print_comment(comment) \
  124      debug_print_comment_s(# comment, comment, __LINE__)
  125 #endif
  126 
  127 #define instruction(t)  bcalloc(t, 1, 0)
  128 
  129 static INSTRUCTION *mk_program(void);
  130 static INSTRUCTION *append_rule(INSTRUCTION *pattern, INSTRUCTION *action);
  131 static INSTRUCTION *mk_function(INSTRUCTION *fi, INSTRUCTION *def);
  132 static INSTRUCTION *mk_condition(INSTRUCTION *cond, INSTRUCTION *ifp, INSTRUCTION *true_branch,
  133         INSTRUCTION *elsep, INSTRUCTION *false_branch);
  134 static INSTRUCTION *mk_expression_list(INSTRUCTION *list, INSTRUCTION *s1);
  135 static INSTRUCTION *mk_for_loop(INSTRUCTION *forp, INSTRUCTION *init, INSTRUCTION *cond,
  136         INSTRUCTION *incr, INSTRUCTION *body);
  137 static void fix_break_continue(INSTRUCTION *list, INSTRUCTION *b_target, INSTRUCTION *c_target);
  138 static INSTRUCTION *mk_binary(INSTRUCTION *s1, INSTRUCTION *s2, INSTRUCTION *op);
  139 static INSTRUCTION *mk_boolean(INSTRUCTION *left, INSTRUCTION *right, INSTRUCTION *op);
  140 static INSTRUCTION *mk_assignment(INSTRUCTION *lhs, INSTRUCTION *rhs, INSTRUCTION *op);
  141 static INSTRUCTION *mk_getline(INSTRUCTION *op, INSTRUCTION *opt_var, INSTRUCTION *redir, int redirtype);
  142 static int count_expressions(INSTRUCTION **list, bool isarg);
  143 static INSTRUCTION *optimize_assignment(INSTRUCTION *exp);
  144 static void add_lint(INSTRUCTION *list, LINTTYPE linttype);
  145 
  146 enum defref { FUNC_DEFINE, FUNC_USE, FUNC_EXT };
  147 static void func_use(const char *name, enum defref how);
  148 static void check_funcs(void);
  149 
  150 static ssize_t read_one_line(int fd, void *buffer, size_t count);
  151 static int one_line_close(int fd);
  152 static void merge_comments(INSTRUCTION *c1, INSTRUCTION *c2);
  153 static INSTRUCTION *make_braced_statements(INSTRUCTION *lbrace, INSTRUCTION *stmts, INSTRUCTION *rbrace);
  154 static void add_sign_to_num(NODE *n, char sign);
  155 
  156 static bool at_seen = false;
  157 static bool want_source = false;
  158 static bool want_regexp = false;    /* lexical scanning kludge */
  159 static enum {
  160     FUNC_HEADER,
  161     FUNC_BODY,
  162     DONT_CHECK
  163 } want_param_names = DONT_CHECK;    /* ditto */
  164 static bool in_function;        /* parsing kludge */
  165 static int rule = 0;
  166 
  167 const char *const ruletab[] = {
  168     "?",
  169     "BEGIN",
  170     "Rule",
  171     "END",
  172     "BEGINFILE",
  173     "ENDFILE",
  174 };
  175 
  176 static bool in_print = false;   /* lexical scanning kludge for print */
  177 static int in_parens = 0;   /* lexical scanning kludge for print */
  178 static int sub_counter = 0; /* array dimension counter for use in delete */
  179 static char *lexptr;        /* pointer to next char during parsing */
  180 static char *lexend;        /* end of buffer */
  181 static char *lexptr_begin;  /* keep track of where we were for error msgs */
  182 static char *lexeme;        /* beginning of lexeme for debugging */
  183 static bool lexeof;     /* seen EOF for current source? */
  184 static char *thisline = NULL;
  185 static int in_braces = 0;   /* count braces for firstline, lastline in an 'action' */
  186 static int lastline = 0;
  187 static int firstline = 0;
  188 static SRCFILE *sourcefile = NULL;  /* current program source */
  189 static int lasttok = 0;
  190 static bool eof_warned = false; /* GLOBAL: want warning for each file */
  191 static int break_allowed;   /* kludge for break */
  192 static int continue_allowed;    /* kludge for continue */
  193 
  194 #define END_FILE    -1000
  195 #define END_SRC     -2000
  196 
  197 #define YYDEBUG_LEXER_TEXT (lexeme)
  198 static char *tokstart = NULL;
  199 static char *tok = NULL;
  200 static char *tokend;
  201 int errcount = 0;
  202 
  203 extern char *source;
  204 extern int sourceline;
  205 extern SRCFILE *srcfiles;
  206 extern INSTRUCTION *rule_list;
  207 extern int max_args;
  208 extern NODE **args_array;
  209 
  210 const char awk_namespace[] = "awk";
  211 const char *current_namespace = awk_namespace;
  212 bool namespace_changed = false;
  213 
  214 static INSTRUCTION *rule_block[sizeof(ruletab)];
  215 
  216 static INSTRUCTION *ip_rec;
  217 static INSTRUCTION *ip_newfile;
  218 static INSTRUCTION *ip_atexit = NULL;
  219 static INSTRUCTION *ip_end;
  220 static INSTRUCTION *ip_endfile;
  221 static INSTRUCTION *ip_beginfile;
  222 INSTRUCTION *main_beginfile;
  223 static bool called_from_eval = false;
  224 
  225 static inline INSTRUCTION *list_create(INSTRUCTION *x);
  226 static inline INSTRUCTION *list_append(INSTRUCTION *l, INSTRUCTION *x);
  227 static inline INSTRUCTION *list_prepend(INSTRUCTION *l, INSTRUCTION *x);
  228 static inline INSTRUCTION *list_merge(INSTRUCTION *l1, INSTRUCTION *l2);
  229 
  230 extern double fmod(double x, double y);
  231 
  232 #define YYSTYPE INSTRUCTION *
  233 
  234 #line 235 "awkgram.c"
  235 
  236 # ifndef YY_CAST
  237 #  ifdef __cplusplus
  238 #   define YY_CAST(Type, Val) static_cast<Type> (Val)
  239 #   define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type> (Val)
  240 #  else
  241 #   define YY_CAST(Type, Val) ((Type) (Val))
  242 #   define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val))
  243 #  endif
  244 # endif
  245 # ifndef YY_NULLPTR
  246 #  if defined __cplusplus
  247 #   if 201103L <= __cplusplus
  248 #    define YY_NULLPTR nullptr
  249 #   else
  250 #    define YY_NULLPTR 0
  251 #   endif
  252 #  else
  253 #   define YY_NULLPTR ((void*)0)
  254 #  endif
  255 # endif
  256 
  257 /* Enabling verbose error messages.  */
  258 #ifdef YYERROR_VERBOSE
  259 # undef YYERROR_VERBOSE
  260 # define YYERROR_VERBOSE 1
  261 #else
  262 # define YYERROR_VERBOSE 0
  263 #endif
  264 
  265 
  266 /* Debug traces.  */
  267 #ifndef YYDEBUG
  268 # define YYDEBUG 0
  269 #endif
  270 #if YYDEBUG
  271 extern int yydebug;
  272 #endif
  273 
  274 /* Token type.  */
  275 #ifndef YYTOKENTYPE
  276 # define YYTOKENTYPE
  277   enum yytokentype
  278   {
  279     FUNC_CALL = 258,
  280     NAME = 259,
  281     REGEXP = 260,
  282     FILENAME = 261,
  283     YNUMBER = 262,
  284     YSTRING = 263,
  285     TYPED_REGEXP = 264,
  286     RELOP = 265,
  287     IO_OUT = 266,
  288     IO_IN = 267,
  289     ASSIGNOP = 268,
  290     ASSIGN = 269,
  291     MATCHOP = 270,
  292     CONCAT_OP = 271,
  293     SUBSCRIPT = 272,
  294     LEX_BEGIN = 273,
  295     LEX_END = 274,
  296     LEX_IF = 275,
  297     LEX_ELSE = 276,
  298     LEX_RETURN = 277,
  299     LEX_DELETE = 278,
  300     LEX_SWITCH = 279,
  301     LEX_CASE = 280,
  302     LEX_DEFAULT = 281,
  303     LEX_WHILE = 282,
  304     LEX_DO = 283,
  305     LEX_FOR = 284,
  306     LEX_BREAK = 285,
  307     LEX_CONTINUE = 286,
  308     LEX_PRINT = 287,
  309     LEX_PRINTF = 288,
  310     LEX_NEXT = 289,
  311     LEX_EXIT = 290,
  312     LEX_FUNCTION = 291,
  313     LEX_BEGINFILE = 292,
  314     LEX_ENDFILE = 293,
  315     LEX_GETLINE = 294,
  316     LEX_NEXTFILE = 295,
  317     LEX_IN = 296,
  318     LEX_AND = 297,
  319     LEX_OR = 298,
  320     INCREMENT = 299,
  321     DECREMENT = 300,
  322     LEX_BUILTIN = 301,
  323     LEX_LENGTH = 302,
  324     LEX_EOF = 303,
  325     LEX_INCLUDE = 304,
  326     LEX_EVAL = 305,
  327     LEX_LOAD = 306,
  328     LEX_NAMESPACE = 307,
  329     NEWLINE = 308,
  330     SLASH_BEFORE_EQUAL = 309,
  331     UNARY = 310
  332   };
  333 #endif
  334 /* Tokens.  */
  335 #define FUNC_CALL 258
  336 #define NAME 259
  337 #define REGEXP 260
  338 #define FILENAME 261
  339 #define YNUMBER 262
  340 #define YSTRING 263
  341 #define TYPED_REGEXP 264
  342 #define RELOP 265
  343 #define IO_OUT 266
  344 #define IO_IN 267
  345 #define ASSIGNOP 268
  346 #define ASSIGN 269
  347 #define MATCHOP 270
  348 #define CONCAT_OP 271
  349 #define SUBSCRIPT 272
  350 #define LEX_BEGIN 273
  351 #define LEX_END 274
  352 #define LEX_IF 275
  353 #define LEX_ELSE 276
  354 #define LEX_RETURN 277
  355 #define LEX_DELETE 278
  356 #define LEX_SWITCH 279
  357 #define LEX_CASE 280
  358 #define LEX_DEFAULT 281
  359 #define LEX_WHILE 282
  360 #define LEX_DO 283
  361 #define LEX_FOR 284
  362 #define LEX_BREAK 285
  363 #define LEX_CONTINUE 286
  364 #define LEX_PRINT 287
  365 #define LEX_PRINTF 288
  366 #define LEX_NEXT 289
  367 #define LEX_EXIT 290
  368 #define LEX_FUNCTION 291
  369 #define LEX_BEGINFILE 292
  370 #define LEX_ENDFILE 293
  371 #define LEX_GETLINE 294
  372 #define LEX_NEXTFILE 295
  373 #define LEX_IN 296
  374 #define LEX_AND 297
  375 #define LEX_OR 298
  376 #define INCREMENT 299
  377 #define DECREMENT 300
  378 #define LEX_BUILTIN 301
  379 #define LEX_LENGTH 302
  380 #define LEX_EOF 303
  381 #define LEX_INCLUDE 304
  382 #define LEX_EVAL 305
  383 #define LEX_LOAD 306
  384 #define LEX_NAMESPACE 307
  385 #define NEWLINE 308
  386 #define SLASH_BEFORE_EQUAL 309
  387 #define UNARY 310
  388 
  389 /* Value type.  */
  390 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
  391 typedef int YYSTYPE;
  392 # define YYSTYPE_IS_TRIVIAL 1
  393 # define YYSTYPE_IS_DECLARED 1
  394 #endif
  395 
  396 
  397 extern YYSTYPE yylval;
  398 
  399 int yyparse (void);
  400 
  401 
  402 
  403 
  404 
  405 #ifdef short
  406 # undef short
  407 #endif
  408 
  409 /* On compilers that do not define __PTRDIFF_MAX__ etc., make sure
  410    <limits.h> and (if available) <stdint.h> are included
  411    so that the code can choose integer types of a good width.  */
  412 
  413 #ifndef __PTRDIFF_MAX__
  414 # include <limits.h> /* INFRINGES ON USER NAME SPACE */
  415 # if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
  416 #  include <stdint.h> /* INFRINGES ON USER NAME SPACE */
  417 #  define YY_STDINT_H
  418 # endif
  419 #endif
  420 
  421 /* Narrow types that promote to a signed type and that can represent a
  422    signed or unsigned integer of at least N bits.  In tables they can
  423    save space and decrease cache pressure.  Promoting to a signed type
  424    helps avoid bugs in integer arithmetic.  */
  425 
  426 #ifdef __INT_LEAST8_MAX__
  427 typedef __INT_LEAST8_TYPE__ yytype_int8;
  428 #elif defined YY_STDINT_H
  429 typedef int_least8_t yytype_int8;
  430 #else
  431 typedef signed char yytype_int8;
  432 #endif
  433 
  434 #ifdef __INT_LEAST16_MAX__
  435 typedef __INT_LEAST16_TYPE__ yytype_int16;
  436 #elif defined YY_STDINT_H
  437 typedef int_least16_t yytype_int16;
  438 #else
  439 typedef short yytype_int16;
  440 #endif
  441 
  442 #if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__
  443 typedef __UINT_LEAST8_TYPE__ yytype_uint8;
  444 #elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \
  445        && UINT_LEAST8_MAX <= INT_MAX)
  446 typedef uint_least8_t yytype_uint8;
  447 #elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX
  448 typedef unsigned char yytype_uint8;
  449 #else
  450 typedef short yytype_uint8;
  451 #endif
  452 
  453 #if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__
  454 typedef __UINT_LEAST16_TYPE__ yytype_uint16;
  455 #elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \
  456        && UINT_LEAST16_MAX <= INT_MAX)
  457 typedef uint_least16_t yytype_uint16;
  458 #elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX
  459 typedef unsigned short yytype_uint16;
  460 #else
  461 typedef int yytype_uint16;
  462 #endif
  463 
  464 #ifndef YYPTRDIFF_T
  465 # if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__
  466 #  define YYPTRDIFF_T __PTRDIFF_TYPE__
  467 #  define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__
  468 # elif defined PTRDIFF_MAX
  469 #  ifndef ptrdiff_t
  470 #   include <stddef.h> /* INFRINGES ON USER NAME SPACE */
  471 #  endif
  472 #  define YYPTRDIFF_T ptrdiff_t
  473 #  define YYPTRDIFF_MAXIMUM PTRDIFF_MAX
  474 # else
  475 #  define YYPTRDIFF_T long
  476 #  define YYPTRDIFF_MAXIMUM LONG_MAX
  477 # endif
  478 #endif
  479 
  480 #ifndef YYSIZE_T
  481 # ifdef __SIZE_TYPE__
  482 #  define YYSIZE_T __SIZE_TYPE__
  483 # elif defined size_t
  484 #  define YYSIZE_T size_t
  485 # elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
  486 #  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
  487 #  define YYSIZE_T size_t
  488 # else
  489 #  define YYSIZE_T unsigned
  490 # endif
  491 #endif
  492 
  493 #define YYSIZE_MAXIMUM                                  \
  494   YY_CAST (YYPTRDIFF_T,                                 \
  495            (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1)  \
  496             ? YYPTRDIFF_MAXIMUM                         \
  497             : YY_CAST (YYSIZE_T, -1)))
  498 
  499 #define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X))
  500 
  501 /* Stored state numbers (used for stacks). */
  502 typedef yytype_int16 yy_state_t;
  503 
  504 /* State numbers in computations.  */
  505 typedef int yy_state_fast_t;
  506 
  507 #ifndef YY_
  508 # if defined YYENABLE_NLS && YYENABLE_NLS
  509 #  if ENABLE_NLS
  510 #   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
  511 #   define YY_(Msgid) dgettext ("bison-runtime", Msgid)
  512 #  endif
  513 # endif
  514 # ifndef YY_
  515 #  define YY_(Msgid) Msgid
  516 # endif
  517 #endif
  518 
  519 #ifndef YY_ATTRIBUTE_PURE
  520 # if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__)
  521 #  define YY_ATTRIBUTE_PURE __attribute__ ((__pure__))
  522 # else
  523 #  define YY_ATTRIBUTE_PURE
  524 # endif
  525 #endif
  526 
  527 #ifndef YY_ATTRIBUTE_UNUSED
  528 # if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
  529 #  define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
  530 # else
  531 #  define YY_ATTRIBUTE_UNUSED
  532 # endif
  533 #endif
  534 
  535 /* Suppress unused-variable warnings by "using" E.  */
  536 #if ! defined lint || defined __GNUC__
  537 # define YYUSE(E) ((void) (E))
  538 #else
  539 # define YYUSE(E) /* empty */
  540 #endif
  541 
  542 #if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
  543 /* Suppress an incorrect diagnostic about yylval being uninitialized.  */
  544 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN                            \
  545     _Pragma ("GCC diagnostic push")                                     \
  546     _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")              \
  547     _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
  548 # define YY_IGNORE_MAYBE_UNINITIALIZED_END      \
  549     _Pragma ("GCC diagnostic pop")
  550 #else
  551 # define YY_INITIAL_VALUE(Value) Value
  552 #endif
  553 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
  554 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
  555 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
  556 #endif
  557 #ifndef YY_INITIAL_VALUE
  558 # define YY_INITIAL_VALUE(Value) /* Nothing. */
  559 #endif
  560 
  561 #if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__
  562 # define YY_IGNORE_USELESS_CAST_BEGIN                          \
  563     _Pragma ("GCC diagnostic push")                            \
  564     _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"")
  565 # define YY_IGNORE_USELESS_CAST_END            \
  566     _Pragma ("GCC diagnostic pop")
  567 #endif
  568 #ifndef YY_IGNORE_USELESS_CAST_BEGIN
  569 # define YY_IGNORE_USELESS_CAST_BEGIN
  570 # define YY_IGNORE_USELESS_CAST_END
  571 #endif
  572 
  573 
  574 #define YY_ASSERT(E) ((void) (0 && (E)))
  575 
  576 #if ! defined yyoverflow || YYERROR_VERBOSE
  577 
  578 /* The parser invokes alloca or malloc; define the necessary symbols.  */
  579 
  580 # ifdef YYSTACK_USE_ALLOCA
  581 #  if YYSTACK_USE_ALLOCA
  582 #   ifdef __GNUC__
  583 #    define YYSTACK_ALLOC __builtin_alloca
  584 #   elif defined __BUILTIN_VA_ARG_INCR
  585 #    include <alloca.h> /* INFRINGES ON USER NAME SPACE */
  586 #   elif defined _AIX
  587 #    define YYSTACK_ALLOC __alloca
  588 #   elif defined _MSC_VER
  589 #    include <malloc.h> /* INFRINGES ON USER NAME SPACE */
  590 #    define alloca _alloca
  591 #   else
  592 #    define YYSTACK_ALLOC alloca
  593 #    if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
  594 #     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
  595       /* Use EXIT_SUCCESS as a witness for stdlib.h.  */
  596 #     ifndef EXIT_SUCCESS
  597 #      define EXIT_SUCCESS 0
  598 #     endif
  599 #    endif
  600 #   endif
  601 #  endif
  602 # endif
  603 
  604 # ifdef YYSTACK_ALLOC
  605    /* Pacify GCC's 'empty if-body' warning.  */
  606 #  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
  607 #  ifndef YYSTACK_ALLOC_MAXIMUM
  608     /* The OS might guarantee only one guard page at the bottom of the stack,
  609        and a page size can be as small as 4096 bytes.  So we cannot safely
  610        invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number
  611        to allow for a few compiler-allocated temporary stack slots.  */
  612 #   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
  613 #  endif
  614 # else
  615 #  define YYSTACK_ALLOC YYMALLOC
  616 #  define YYSTACK_FREE YYFREE
  617 #  ifndef YYSTACK_ALLOC_MAXIMUM
  618 #   define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
  619 #  endif
  620 #  if (defined __cplusplus && ! defined EXIT_SUCCESS \
  621        && ! ((defined YYMALLOC || defined malloc) \
  622              && (defined YYFREE || defined free)))
  623 #   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
  624 #   ifndef EXIT_SUCCESS
  625 #    define EXIT_SUCCESS 0
  626 #   endif
  627 #  endif
  628 #  ifndef YYMALLOC
  629 #   define YYMALLOC malloc
  630 #   if ! defined malloc && ! defined EXIT_SUCCESS
  631 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
  632 #   endif
  633 #  endif
  634 #  ifndef YYFREE
  635 #   define YYFREE free
  636 #   if ! defined free && ! defined EXIT_SUCCESS
  637 void free (void *); /* INFRINGES ON USER NAME SPACE */
  638 #   endif
  639 #  endif
  640 # endif
  641 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
  642 
  643 
  644 #if (! defined yyoverflow \
  645      && (! defined __cplusplus \
  646          || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
  647 
  648 /* A type that is properly aligned for any stack member.  */
  649 union yyalloc
  650 {
  651   yy_state_t yyss_alloc;
  652   YYSTYPE yyvs_alloc;
  653 };
  654 
  655 /* The size of the maximum gap between one aligned stack and the next.  */
  656 # define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1)
  657 
  658 /* The size of an array large to enough to hold all stacks, each with
  659    N elements.  */
  660 # define YYSTACK_BYTES(N) \
  661      ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE)) \
  662       + YYSTACK_GAP_MAXIMUM)
  663 
  664 # define YYCOPY_NEEDED 1
  665 
  666 /* Relocate STACK from its old location to the new one.  The
  667    local variables YYSIZE and YYSTACKSIZE give the old and new number of
  668    elements in the stack, and YYPTR gives the new location of the
  669    stack.  Advance YYPTR to a properly aligned location for the next
  670    stack.  */
  671 # define YYSTACK_RELOCATE(Stack_alloc, Stack)                           \
  672     do                                                                  \
  673       {                                                                 \
  674         YYPTRDIFF_T yynewbytes;                                         \
  675         YYCOPY (&yyptr->Stack_alloc, Stack, yysize);                    \
  676         Stack = &yyptr->Stack_alloc;                                    \
  677         yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \
  678         yyptr += yynewbytes / YYSIZEOF (*yyptr);                        \
  679       }                                                                 \
  680     while (0)
  681 
  682 #endif
  683 
  684 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
  685 /* Copy COUNT objects from SRC to DST.  The source and destination do
  686    not overlap.  */
  687 # ifndef YYCOPY
  688 #  if defined __GNUC__ && 1 < __GNUC__
  689 #   define YYCOPY(Dst, Src, Count) \
  690       __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src)))
  691 #  else
  692 #   define YYCOPY(Dst, Src, Count)              \
  693       do                                        \
  694         {                                       \
  695           YYPTRDIFF_T yyi;                      \
  696           for (yyi = 0; yyi < (Count); yyi++)   \
  697             (Dst)[yyi] = (Src)[yyi];            \
  698         }                                       \
  699       while (0)
  700 #  endif
  701 # endif
  702 #endif /* !YYCOPY_NEEDED */
  703 
  704 /* YYFINAL -- State number of the termination state.  */
  705 #define YYFINAL  2
  706 /* YYLAST -- Last index in YYTABLE.  */
  707 #define YYLAST   1191
  708 
  709 /* YYNTOKENS -- Number of terminals.  */
  710 #define YYNTOKENS  77
  711 /* YYNNTS -- Number of nonterminals.  */
  712 #define YYNNTS  71
  713 /* YYNRULES -- Number of rules.  */
  714 #define YYNRULES  207
  715 /* YYNSTATES -- Number of states.  */
  716 #define YYNSTATES  355
  717 
  718 #define YYUNDEFTOK  2
  719 #define YYMAXUTOK   310
  720 
  721 
  722 /* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
  723    as returned by yylex, with out-of-bounds checking.  */
  724 #define YYTRANSLATE(YYX)                                                \
  725   (0 <= (YYX) && (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
  726 
  727 /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
  728    as returned by yylex.  */
  729 static const yytype_int8 yytranslate[] =
  730 {
  731        0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  732        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  733        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  734        2,     2,     2,    65,     2,     2,    68,    64,     2,     2,
  735       69,    70,    62,    60,    57,    61,     2,    63,     2,     2,
  736        2,     2,     2,     2,     2,     2,     2,     2,    56,    76,
  737       58,     2,    59,    55,    71,     2,     2,     2,     2,     2,
  738        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  739        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  740        2,    72,     2,    73,    67,     2,     2,     2,     2,     2,
  741        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  742        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  743        2,     2,     2,    74,     2,    75,     2,     2,     2,     2,
  744        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  745        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  746        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  747        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  748        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  749        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  750        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  751        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  752        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  753        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  754        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  755        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  756        2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
  757        5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
  758       15,    16,    17,    18,    19,    20,    21,    22,    23,    24,
  759       25,    26,    27,    28,    29,    30,    31,    32,    33,    34,
  760       35,    36,    37,    38,    39,    40,    41,    42,    43,    44,
  761       45,    46,    47,    48,    49,    50,    51,    52,    53,    54,
  762       66
  763 };
  764 
  765 #if YYDEBUG
  766   /* YYRLINE[YYN] -- Source line where rule number YYN was defined.  */
  767 static const yytype_int16 yyrline[] =
  768 {
  769        0,   232,   232,   233,   238,   248,   252,   264,   272,   286,
  770      297,   307,   317,   330,   340,   342,   347,   357,   359,   364,
  771      366,   368,   374,   378,   383,   413,   425,   437,   443,   452,
  772      470,   471,   482,   488,   496,   497,   501,   501,   535,   534,
  773      568,   583,   585,   590,   591,   611,   616,   617,   621,   632,
  774      637,   644,   752,   803,   853,   979,  1001,  1022,  1032,  1042,
  775     1052,  1063,  1076,  1094,  1093,  1110,  1128,  1128,  1230,  1230,
  776     1263,  1293,  1301,  1302,  1308,  1309,  1316,  1321,  1334,  1349,
  777     1351,  1359,  1366,  1368,  1376,  1385,  1387,  1396,  1397,  1405,
  778     1410,  1410,  1423,  1430,  1443,  1447,  1469,  1470,  1476,  1477,
  779     1486,  1487,  1492,  1497,  1514,  1516,  1518,  1525,  1526,  1532,
  780     1533,  1538,  1540,  1547,  1549,  1557,  1562,  1573,  1574,  1579,
  781     1581,  1588,  1590,  1598,  1603,  1613,  1614,  1619,  1626,  1630,
  782     1632,  1634,  1647,  1664,  1674,  1681,  1683,  1688,  1690,  1692,
  783     1700,  1702,  1707,  1709,  1714,  1716,  1718,  1775,  1777,  1779,
  784     1781,  1783,  1785,  1787,  1789,  1803,  1808,  1813,  1839,  1845,
  785     1847,  1849,  1851,  1853,  1855,  1860,  1864,  1896,  1904,  1910,
  786     1916,  1929,  1930,  1931,  1936,  1941,  1945,  1949,  1964,  1985,
  787     1990,  2027,  2064,  2065,  2071,  2072,  2077,  2079,  2086,  2103,
  788     2120,  2122,  2129,  2134,  2140,  2151,  2163,  2172,  2176,  2181,
  789     2185,  2189,  2193,  2198,  2199,  2203,  2207,  2211
  790 };
  791 #endif
  792 
  793 #if YYDEBUG || YYERROR_VERBOSE || 0
  794 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
  795    First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
  796 static const char *const yytname[] =
  797 {
  798   "$end", "error", "$undefined", "FUNC_CALL", "NAME", "REGEXP",
  799   "FILENAME", "YNUMBER", "YSTRING", "TYPED_REGEXP", "RELOP", "IO_OUT",
  800   "IO_IN", "ASSIGNOP", "ASSIGN", "MATCHOP", "CONCAT_OP", "SUBSCRIPT",
  801   "LEX_BEGIN", "LEX_END", "LEX_IF", "LEX_ELSE", "LEX_RETURN", "LEX_DELETE",
  802   "LEX_SWITCH", "LEX_CASE", "LEX_DEFAULT", "LEX_WHILE", "LEX_DO",
  803   "LEX_FOR", "LEX_BREAK", "LEX_CONTINUE", "LEX_PRINT", "LEX_PRINTF",
  804   "LEX_NEXT", "LEX_EXIT", "LEX_FUNCTION", "LEX_BEGINFILE", "LEX_ENDFILE",
  805   "LEX_GETLINE", "LEX_NEXTFILE", "LEX_IN", "LEX_AND", "LEX_OR",
  806   "INCREMENT", "DECREMENT", "LEX_BUILTIN", "LEX_LENGTH", "LEX_EOF",
  807   "LEX_INCLUDE", "LEX_EVAL", "LEX_LOAD", "LEX_NAMESPACE", "NEWLINE",
  808   "SLASH_BEFORE_EQUAL", "'?'", "':'", "','", "'<'", "'>'", "'+'", "'-'",
  809   "'*'", "'/'", "'%'", "'!'", "UNARY", "'^'", "'$'", "'('", "')'", "'@'",
  810   "'['", "']'", "'{'", "'}'", "';'", "$accept", "program", "rule",
  811   "source", "library", "namespace", "pattern", "action", "func_name",
  812   "lex_builtin", "function_prologue", "$@1", "regexp", "$@2",
  813   "typed_regexp", "a_slash", "statements", "statement_term", "statement",
  814   "non_compound_stmt", "$@3", "simple_stmt", "$@4", "$@5",
  815   "opt_simple_stmt", "case_statements", "case_statement", "case_value",
  816   "print", "print_expression_list", "output_redir", "$@6", "if_statement",
  817   "nls", "opt_nls", "input_redir", "opt_param_list", "param_list",
  818   "opt_exp", "opt_expression_list", "expression_list",
  819   "opt_fcall_expression_list", "fcall_expression_list", "fcall_exp", "exp",
  820   "assign_operator", "relop_or_less", "a_relop", "common_exp", "simp_exp",
  821   "simp_exp_nc", "non_post_simp_exp", "func_call", "direct_func_call",
  822   "opt_variable", "delete_subscript_list", "delete_subscript",
  823   "delete_exp_list", "bracketed_exp_list", "subscript", "subscript_list",
  824   "simple_variable", "variable", "opt_incdec", "l_brace", "r_brace",
  825   "r_paren", "opt_semi", "semi", "colon", "comma", YY_NULLPTR
  826 };
  827 #endif
  828 
  829 # ifdef YYPRINT
  830 /* YYTOKNUM[NUM] -- (External) token number corresponding to the
  831    (internal) symbol number NUM (which must be that of a token).  */
  832 static const yytype_int16 yytoknum[] =
  833 {
  834        0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
  835      265,   266,   267,   268,   269,   270,   271,   272,   273,   274,
  836      275,   276,   277,   278,   279,   280,   281,   282,   283,   284,
  837      285,   286,   287,   288,   289,   290,   291,   292,   293,   294,
  838      295,   296,   297,   298,   299,   300,   301,   302,   303,   304,
  839      305,   306,   307,   308,   309,    63,    58,    44,    60,    62,
  840       43,    45,    42,    47,    37,    33,   310,    94,    36,    40,
  841       41,    64,    91,    93,   123,   125,    59
  842 };
  843 # endif
  844 
  845 #define YYPACT_NINF (-283)
  846 
  847 #define yypact_value_is_default(Yyn) \
  848   ((Yyn) == YYPACT_NINF)
  849 
  850 #define YYTABLE_NINF (-119)
  851 
  852 #define yytable_value_is_error(Yyn) \
  853   ((Yyn) == YYTABLE_NINF)
  854 
  855   /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
  856      STATE-NUM.  */
  857 static const yytype_int16 yypact[] =
  858 {
  859     -283,   316,  -283,  -283,   -45,   -28,  -283,  -283,  -283,  -283,
  860      160,  -283,  -283,    23,    23,    23,   -39,   -18,  -283,  -283,
  861     -283,  1047,  1047,  -283,  1047,  1075,   818,   257,  -283,    99,
  862      -20,  -283,  -283,    11,  1017,   974,   378,   415,  -283,  -283,
  863     -283,  -283,   329,   742,   818,  -283,     0,  -283,  -283,  -283,
  864     -283,  -283,    25,     9,  -283,    22,  -283,  -283,  -283,   742,
  865      742,    79,    46,    18,    46,    46,  1047,   114,  -283,  -283,
  866       13,   286,    44,    47,    60,  -283,    94,  -283,  -283,  -283,
  867       11,  -283,    94,  -283,   151,  -283,  -283,  1002,   162,  1047,
  868     1047,  1047,    94,  -283,  -283,  -283,  1047,  1047,   132,   378,
  869     1047,  1047,  1047,  1047,  1047,  1047,  1047,  1047,  1047,  1047,
  870     1047,  1047,  -283,   170,  -283,  -283,   168,  1047,  -283,  -283,
  871     -283,   116,    14,  -283,  1132,    76,  1132,  -283,  -283,  -283,
  872     -283,  1047,  -283,   116,   116,   286,  -283,  -283,  -283,  1047,
  873     -283,   144,   846,  -283,  -283,    34,    91,  -283,    39,    91,
  874     -283,    59,    91,    11,  -283,   542,  -283,  -283,  -283,   145,
  875     -283,   135,   580,  1113,  -283,   189,  1132,    23,   230,   230,
  876       46,    46,    46,    46,   230,   230,    46,    46,    46,    46,
  877     -283,  -283,  1132,  -283,  1002,   770,  -283,    27,   378,  -283,
  878     -283,  1132,   162,  -283,  1132,  -283,  -283,  -283,  -283,  -283,
  879     -283,  -283,   119,  -283,    12,   123,   126,    94,   128,    91,
  880       91,  -283,  -283,    91,  1047,    91,    94,  -283,  -283,    91,
  881     -283,  -283,  1132,  -283,   122,    94,  1047,  -283,  -283,  -283,
  882     -283,  -283,  -283,   116,    73,  -283,  1047,  1047,  -283,   198,
  883     1047,  1047,   660,   895,  -283,  -283,  -283,    91,  1132,  -283,
  884     -283,  -283,   590,   542,    94,  -283,  -283,  1132,    94,  -283,
  885       28,   286,    91,   -28,   141,   286,   286,   190,   -23,  -283,
  886      122,  -283,   818,   205,  -283,   325,  -283,  -283,  -283,  -283,
  887     -283,    94,  -283,  -283,   115,  -283,  -283,  -283,    94,    94,
  888      153,   162,    94,    13,  -283,  -283,   660,  -283,  -283,   -20,
  889      660,  1047,   116,   694,   144,  1047,   209,  -283,  -283,   286,
  890       94,  1090,    94,   974,    94,   152,    94,   660,    94,   929,
  891      660,  -283,   342,   176,  -283,   158,  -283,  -283,   929,   116,
  892     -283,  -283,  -283,   236,   243,  -283,  -283,   176,  -283,    94,
  893     -283,   116,    94,  -283,  -283,    94,  -283,    94,   660,  -283,
  894      390,   660,  -283,   466,  -283
  895 };
  896 
  897   /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
  898      Performed when YYTABLE does not specify something else to do.  Zero
  899      means the default is an error.  */
  900 static const yytype_uint8 yydefact[] =
  901 {
  902        2,     0,     1,     6,     0,   193,   175,   176,    25,    26,
  903        0,    27,    28,   182,     0,     0,     0,   170,     5,    94,
  904       42,     0,     0,    41,     0,     0,     0,     0,     3,     0,
  905        0,   165,    38,     4,    23,   136,   144,   145,   147,   171,
  906      179,   195,   172,     0,     0,   190,     0,   194,    31,    30,
  907       34,    35,     0,     0,    32,    98,   183,   173,   174,     0,
  908        0,     0,   178,   172,   177,   166,     0,   199,   172,   113,
  909        0,   111,     0,     0,     0,   180,    96,   205,     7,     8,
  910       46,    43,    96,     9,     0,    95,   140,     0,     0,     0,
  911        0,     0,    96,   141,   143,   142,     0,     0,     0,   146,
  912        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
  913        0,     0,   138,   137,   155,   156,     0,     0,   121,    40,
  914      126,     0,     0,   119,   125,     0,   111,   192,   191,    33,
  915       36,     0,   154,     0,     0,     0,   197,   198,   196,   114,
  916      202,     0,     0,   167,    15,     0,     0,    18,     0,     0,
  917       21,     0,     0,    97,   200,     0,    47,    39,   131,   132,
  918      133,   129,   130,     0,   207,   134,    24,   182,   152,   153,
  919      149,   150,   151,   148,   163,   164,   160,   161,   162,   159,
  920      128,   139,   127,   181,   122,     0,   189,     0,    99,   168,
  921      169,   115,     0,   116,   112,    14,    10,    17,    11,    20,
  922       12,    45,     0,    63,     0,     0,     0,    96,     0,     0,
  923        0,    85,    86,     0,   107,     0,    96,    44,    57,     0,
  924       66,    50,    71,    43,   203,    96,     0,   158,   123,   124,
  925      120,   104,   102,     0,     0,   157,     0,   107,    68,     0,
  926        0,     0,     0,    72,    58,    59,    60,     0,   108,    61,
  927      201,    65,     0,     0,    96,   204,    48,   135,    96,   105,
  928        0,     0,     0,   184,     0,     0,     0,     0,   193,    73,
  929        0,    62,     0,    89,    87,     0,    49,    29,    37,   106,
  930      103,    96,    64,    69,     0,   186,   188,    70,    96,    96,
  931        0,     0,    96,     0,    90,    67,     0,   185,   187,     0,
  932        0,     0,     0,     0,    88,     0,    92,    74,    52,     0,
  933       96,     0,    96,    91,    96,     0,    96,     0,    96,    72,
  934        0,    76,     0,     0,    75,     0,    53,    54,    72,     0,
  935       93,    79,    82,     0,     0,    83,    84,     0,   206,    96,
  936       51,     0,    96,    81,    80,    96,    43,    96,     0,    43,
  937        0,     0,    56,     0,    55
  938 };
  939 
  940   /* YYPGOTO[NTERM-NUM].  */
  941 static const yytype_int16 yypgoto[] =
  942 {
  943     -283,  -283,  -283,  -283,  -283,  -283,  -283,   226,  -283,  -283,
  944     -283,  -283,   -63,  -283,   -77,  -283,  -215,   -73,   -30,  -283,
  945     -283,  -234,  -283,  -283,  -282,  -283,  -283,  -283,  -283,  -283,
  946     -283,  -283,  -283,     5,   -35,  -283,  -283,  -283,    24,  -283,
  947      -43,   101,  -283,   -15,    -1,  -283,  -283,  -283,   -40,    17,
  948     -283,   237,  -283,    -6,    96,  -283,  -283,   -16,   -42,  -283,
  949     -283,   -81,    -2,  -283,   -27,  -186,   -65,  -283,   -62,   -68,
  950       -8
  951 };
  952 
  953   /* YYDEFGOTO[NTERM-NUM].  */
  954 static const yytype_int16 yydefgoto[] =
  955 {
  956       -1,     1,    28,   146,   149,   152,    29,    78,    53,    54,
  957       30,   187,    31,    84,   120,    32,   155,    79,   217,   218,
  958      237,   219,   252,   263,   270,   315,   324,   337,   220,   273,
  959      295,   305,   221,   153,   154,   132,   233,   234,   247,   274,
  960       70,   121,   122,   123,   222,   117,    95,    96,    35,    36,
  961       37,    38,    39,    40,    55,   283,   284,   285,    45,    46,
  962       47,    41,    42,   138,   223,   224,   143,   254,    82,   339,
  963      142
  964 };
  965 
  966   /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM.  If
  967      positive, shift that token.  If negative, reduce the rule whose
  968      number is the opposite.  If YYTABLE_NINF, syntax error.  */
  969 static const yytype_int16 yytable[] =
  970 {
  971       34,   125,    81,    81,   128,   141,    33,   160,   253,   269,
  972      158,    56,    57,    58,   139,   184,   238,   127,   291,    63,
  973       63,    75,    63,    68,    43,    71,    97,     5,   231,   279,
  974       59,   232,   280,    63,    80,   195,   180,   329,    62,    64,
  975      197,    65,   124,   126,    44,   144,   341,   156,   147,    44,
  976      145,    60,    99,   148,    76,    75,   183,   164,   124,   124,
  977      199,   150,   114,   115,    85,   135,   151,   276,   189,   190,
  978       92,    92,    44,   196,   259,   129,   198,   139,   130,   200,
  979      131,   239,     4,   140,  -118,   269,   159,   -13,   161,   162,
  980      163,    25,   -16,   225,   269,   165,   166,  -100,    63,    63,
  981       63,    63,    63,    63,    63,    63,    63,    63,    63,    63,
  982      -13,   235,   -19,   105,   185,   -16,   182,   168,   169,   170,
  983      171,   172,   173,   174,   175,   176,   177,   178,   179,    63,
  984       92,   350,   297,    92,   353,   -19,   244,   245,   191,   340,
  985      246,   194,   249,  -101,    19,    86,   251,    19,   188,   186,
  986       87,    80,    19,   321,    80,    86,   157,    80,   136,   137,
  987      133,   134,   255,    48,    49,    56,     5,    77,   258,   228,
  988      230,   167,   242,    76,   271,    77,    88,   322,   323,   119,
  989      225,   250,   181,   124,   124,   192,   140,    44,   236,   282,
  990      256,   225,   240,    93,    94,   241,   281,   243,    77,  -119,
  991      288,   289,   264,    93,    94,    19,    50,    51,   292,   275,
  992      302,   287,   267,   248,    80,    80,   294,   290,    80,   277,
  993       80,   286,   301,   278,    80,   257,   260,   -96,   304,   293,
  994      314,    52,   338,   216,   225,   261,   248,   310,   225,   265,
  995      266,   312,   286,   343,   316,   336,   296,  -119,  -119,   318,
  996      344,   126,    80,   299,   300,   225,    83,   303,   225,   335,
  997        4,   262,    67,   227,   342,   313,   306,    80,   298,   345,
  998      308,    71,   307,     0,     0,   317,   347,   319,     0,   320,
  999      325,   326,     0,   328,     0,     0,   225,   327,   225,   225,
 1000      330,   225,   102,   103,   104,     0,    86,   105,     0,     0,
 1001      309,    87,   311,    63,   346,     0,    72,   348,    73,    74,
 1002      349,    63,   351,     0,     0,     0,     2,     3,   352,     4,
 1003        5,   354,     0,     6,     7,     0,   139,    88,    89,    90,
 1004       99,     0,     0,     0,     8,     9,  -110,     0,     0,     0,
 1005        0,    91,   112,   113,    93,    94,     0,     0,     0,   331,
 1006      332,   119,    10,    11,    12,    13,   140,     0,     0,     0,
 1007       14,    15,    16,    17,    18,     0,     0,     0,     0,    19,
 1008       20,     0,     0,   114,   115,     0,    21,    22,  -110,    23,
 1009        0,    24,    92,   116,    25,    26,     0,    27,     0,     0,
 1010      -22,   201,   -22,     4,     5,  -110,    20,     6,     7,     0,
 1011        0,  -110,   333,   334,     0,    23,     0,     0,     0,     0,
 1012      202,     0,   203,   204,   205,   -78,   -78,   206,   207,   208,
 1013      209,   210,   211,   212,   213,   214,     0,     0,     0,    13,
 1014      215,     0,     0,     0,    14,    15,    16,    17,   100,   101,
 1015      102,   103,   104,   -78,    20,   105,     0,     0,     0,     0,
 1016       21,    22,     0,    23,     0,    24,     0,     0,    25,    26,
 1017        0,    61,     0,     0,    76,   -78,    77,   201,     0,     4,
 1018        5,     0,     0,     6,     7,   106,   107,   108,   109,   110,
 1019        0,     0,   111,     0,     0,     0,   202,     0,   203,   204,
 1020      205,   -77,   -77,   206,   207,   208,   209,   210,   211,   212,
 1021      213,   214,     0,     0,     0,    13,   215,     0,     0,     0,
 1022       14,    15,    16,    17,     0,     0,     0,     0,     0,   -77,
 1023       20,     0,     0,     0,     0,     0,    21,    22,     0,    23,
 1024        0,    24,     0,     0,    25,    26,     0,    61,     0,     0,
 1025       76,   -77,    77,   201,     0,     4,     5,     0,     0,     6,
 1026        7,     0,     0,     0,     0,     0,     0,     0,     0,     0,
 1027        0,     0,   202,     0,   203,   204,   205,     0,     0,   206,
 1028      207,   208,   209,   210,   211,   212,   213,   214,     0,     0,
 1029        0,    13,   215,     0,     0,     0,    14,    15,    16,    17,
 1030       86,    69,     0,     4,     5,    87,    20,     6,     7,     0,
 1031        0,  -109,    21,    22,     0,    23,     0,    24,     0,     0,
 1032       25,    26,     0,    61,     0,     0,    76,   216,    77,     0,
 1033        0,    88,    89,     0,     0,     0,     0,     0,     0,    13,
 1034        0,     0,     0,     0,    14,    15,    16,    17,    93,    94,
 1035        0,     0,     0,  -109,    20,     0,     0,     0,     0,     0,
 1036       21,    22,     0,    23,     0,    24,     0,     0,    25,   272,
 1037     -109,    61,     0,     4,     5,     0,  -109,     6,     7,     0,
 1038        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
 1039      202,     0,   203,   204,   205,     0,     0,   206,   207,   208,
 1040      209,   210,   211,   212,   213,   214,     0,     4,     5,    13,
 1041      215,     6,     7,     0,    14,    15,    16,    17,     0,     0,
 1042        0,     0,     0,     0,    20,     0,     0,     0,     0,     0,
 1043       21,    22,     0,    23,     0,    24,     0,     0,    25,    26,
 1044        0,    61,     0,    13,    76,     0,    77,     0,    14,    15,
 1045       16,    17,     0,   118,     0,     4,     5,     0,    20,     6,
 1046        7,   119,     0,     0,    21,    22,     0,    23,     0,    24,
 1047        0,     0,    25,    26,     0,    61,     0,     0,     0,     0,
 1048       77,   229,     0,     4,     5,     0,     0,     6,     7,   119,
 1049        0,    13,     0,     0,     0,     0,    14,    15,    16,    17,
 1050        0,     0,     0,     0,     0,     0,    20,     0,     0,     0,
 1051        0,     0,    21,    22,     0,    23,     0,    24,     0,    13,
 1052       25,    26,  -117,    61,    14,    15,    16,    17,     0,    69,
 1053        0,     4,     5,     0,    20,     6,     7,     0,     0,     0,
 1054       21,    22,     0,    23,     0,    24,     0,     0,    25,    26,
 1055        0,    61,     0,     0,     0,     0,     0,   193,     0,     4,
 1056        5,     0,     0,     6,     7,     0,     0,    13,     0,     0,
 1057        0,     0,    14,    15,    16,    17,     0,     0,     0,     0,
 1058        0,     0,    20,     0,     0,     0,     0,     0,    21,    22,
 1059        0,    23,     0,    24,     0,    13,    25,    26,     0,    61,
 1060       14,    15,    16,    17,     0,     0,     0,     0,     4,   268,
 1061       20,     0,     6,     7,     0,     0,    21,    22,     0,    23,
 1062        0,    24,     0,     0,    25,    26,     0,    61,   204,     0,
 1063        0,     0,     0,     0,     0,     0,     0,   211,   212,     0,
 1064        0,     0,     4,     5,    13,     0,     6,     7,     0,    14,
 1065       15,    16,    17,     0,     0,     0,     0,     0,     0,    20,
 1066        0,     0,   204,     0,     0,    21,    22,     0,    23,     0,
 1067       24,   211,   212,    25,    26,     0,    61,     0,    13,     0,
 1068        0,     0,     0,    14,    15,    16,    17,     4,     5,     0,
 1069        0,     6,     7,    20,     0,     0,    98,     0,     0,    21,
 1070       22,     0,    23,     0,    24,     0,     0,    25,    26,     0,
 1071       61,     0,     0,     0,     0,     4,     5,     0,     0,     6,
 1072        7,   119,     0,    13,     0,     0,     0,     0,    14,    15,
 1073       16,    17,     0,     0,     0,     0,     0,    86,    20,     0,
 1074        0,     0,    87,     0,    21,    22,     0,    23,     0,    24,
 1075        0,    13,    25,    26,     0,    61,    14,    15,    16,    17,
 1076        4,     5,     0,     0,     6,     7,    20,     0,    88,    89,
 1077       90,     0,    21,    22,     0,    23,     0,    24,     0,     0,
 1078       25,    26,    91,    61,    92,    93,    94,     0,     4,     5,
 1079        0,     0,     6,     7,     0,     0,    13,     0,     0,     0,
 1080        0,    14,    15,    16,    17,     0,     0,     0,     0,     0,
 1081       86,    20,     0,     0,     0,    87,     0,    21,    22,     0,
 1082       23,     0,    24,     0,     0,    25,    26,     0,    61,    14,
 1083       15,    16,    17,    86,     0,     0,     0,     0,    87,    20,
 1084        0,    88,    89,    90,     0,    21,    22,     0,    23,     0,
 1085       24,     0,    86,    25,    66,    91,    61,    87,    93,    94,
 1086        0,     0,     0,     0,    88,    89,    90,     0,     0,     0,
 1087        0,     0,     0,     0,     0,     0,    77,     0,    91,   226,
 1088        0,    93,    94,    88,    89,    90,     0,     0,     0,     0,
 1089        0,     0,     0,     0,     0,     0,     0,    91,     0,     0,
 1090       93,    94
 1091 };
 1092 
 1093 static const yytype_int16 yycheck[] =
 1094 {
 1095        1,    44,    29,    30,    46,    70,     1,    88,   223,   243,
 1096       87,    13,    14,    15,     1,     1,     4,    17,    41,    21,
 1097       22,    27,    24,    25,    69,    26,    34,     4,     1,     1,
 1098       69,     4,     4,    35,    29,     1,   113,   319,    21,    22,
 1099        1,    24,    43,    44,    72,     1,   328,    82,     1,    72,
 1100        6,    69,    35,     6,    74,    61,   121,    92,    59,    60,
 1101        1,     1,    44,    45,    53,    66,     6,   253,   133,   134,
 1102       57,    57,    72,   146,     1,    50,   149,     1,    69,   152,
 1103       58,    69,     3,    70,    70,   319,    87,    53,    89,    90,
 1104       91,    68,    53,   155,   328,    96,    97,    70,   100,   101,
 1105      102,   103,   104,   105,   106,   107,   108,   109,   110,   111,
 1106       76,   192,    53,    67,   122,    76,   117,   100,   101,   102,
 1107      103,   104,   105,   106,   107,   108,   109,   110,   111,   131,
 1108       57,   346,    17,    57,   349,    76,   209,   210,   139,   325,
 1109      213,   142,   215,    70,    53,    10,   219,    53,   131,    73,
 1110       15,   146,    53,     1,   149,    10,     5,   152,    44,    45,
 1111       59,    60,   224,     3,     4,   167,     4,    76,   233,   184,
 1112      185,    39,   207,    74,   247,    76,    41,    25,    26,     9,
 1113      242,   216,    14,   184,   185,    41,    70,    72,    69,   262,
 1114      225,   253,    69,    58,    59,    69,   261,    69,    76,    10,
 1115      265,   266,     4,    58,    59,    53,    46,    47,   270,   252,
 1116      291,    70,   242,   214,   209,   210,    11,    27,   213,   254,
 1117      215,   263,    69,   258,   219,   226,   234,    75,   293,   272,
 1118       21,    71,    56,    75,   296,   236,   237,   302,   300,   240,
 1119      241,   303,   284,     7,   309,   322,   281,    58,    59,   311,
 1120        7,   252,   247,   288,   289,   317,    30,   292,   320,   322,
 1121        3,   237,    25,   167,   329,   305,   296,   262,   284,   337,
 1122      300,   272,   299,    -1,    -1,   310,   341,   312,    -1,   314,
 1123      315,   316,    -1,   318,    -1,    -1,   348,   317,   350,   351,
 1124      320,   353,    62,    63,    64,    -1,    10,    67,    -1,    -1,
 1125      301,    15,   303,   305,   339,    -1,    49,   342,    51,    52,
 1126      345,   313,   347,    -1,    -1,    -1,     0,     1,   348,     3,
 1127        4,   351,    -1,     7,     8,    -1,     1,    41,    42,    43,
 1128      313,    -1,    -1,    -1,    18,    19,    11,    -1,    -1,    -1,
 1129       -1,    55,    13,    14,    58,    59,    -1,    -1,    -1,     7,
 1130        8,     9,    36,    37,    38,    39,    70,    -1,    -1,    -1,
 1131       44,    45,    46,    47,    48,    -1,    -1,    -1,    -1,    53,
 1132       54,    -1,    -1,    44,    45,    -1,    60,    61,    53,    63,
 1133       -1,    65,    57,    54,    68,    69,    -1,    71,    -1,    -1,
 1134       74,     1,    76,     3,     4,    70,    54,     7,     8,    -1,
 1135       -1,    76,    60,    61,    -1,    63,    -1,    -1,    -1,    -1,
 1136       20,    -1,    22,    23,    24,    25,    26,    27,    28,    29,
 1137       30,    31,    32,    33,    34,    35,    -1,    -1,    -1,    39,
 1138       40,    -1,    -1,    -1,    44,    45,    46,    47,    60,    61,
 1139       62,    63,    64,    53,    54,    67,    -1,    -1,    -1,    -1,
 1140       60,    61,    -1,    63,    -1,    65,    -1,    -1,    68,    69,
 1141       -1,    71,    -1,    -1,    74,    75,    76,     1,    -1,     3,
 1142        4,    -1,    -1,     7,     8,    60,    61,    62,    63,    64,
 1143       -1,    -1,    67,    -1,    -1,    -1,    20,    -1,    22,    23,
 1144       24,    25,    26,    27,    28,    29,    30,    31,    32,    33,
 1145       34,    35,    -1,    -1,    -1,    39,    40,    -1,    -1,    -1,
 1146       44,    45,    46,    47,    -1,    -1,    -1,    -1,    -1,    53,
 1147       54,    -1,    -1,    -1,    -1,    -1,    60,    61,    -1,    63,
 1148       -1,    65,    -1,    -1,    68,    69,    -1,    71,    -1,    -1,
 1149       74,    75,    76,     1,    -1,     3,     4,    -1,    -1,     7,
 1150        8,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
 1151       -1,    -1,    20,    -1,    22,    23,    24,    -1,    -1,    27,
 1152       28,    29,    30,    31,    32,    33,    34,    35,    -1,    -1,
 1153       -1,    39,    40,    -1,    -1,    -1,    44,    45,    46,    47,
 1154       10,     1,    -1,     3,     4,    15,    54,     7,     8,    -1,
 1155       -1,    11,    60,    61,    -1,    63,    -1,    65,    -1,    -1,
 1156       68,    69,    -1,    71,    -1,    -1,    74,    75,    76,    -1,
 1157       -1,    41,    42,    -1,    -1,    -1,    -1,    -1,    -1,    39,
 1158       -1,    -1,    -1,    -1,    44,    45,    46,    47,    58,    59,
 1159       -1,    -1,    -1,    53,    54,    -1,    -1,    -1,    -1,    -1,
 1160       60,    61,    -1,    63,    -1,    65,    -1,    -1,    68,    69,
 1161       70,    71,    -1,     3,     4,    -1,    76,     7,     8,    -1,
 1162       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
 1163       20,    -1,    22,    23,    24,    -1,    -1,    27,    28,    29,
 1164       30,    31,    32,    33,    34,    35,    -1,     3,     4,    39,
 1165       40,     7,     8,    -1,    44,    45,    46,    47,    -1,    -1,
 1166       -1,    -1,    -1,    -1,    54,    -1,    -1,    -1,    -1,    -1,
 1167       60,    61,    -1,    63,    -1,    65,    -1,    -1,    68,    69,
 1168       -1,    71,    -1,    39,    74,    -1,    76,    -1,    44,    45,
 1169       46,    47,    -1,     1,    -1,     3,     4,    -1,    54,     7,
 1170        8,     9,    -1,    -1,    60,    61,    -1,    63,    -1,    65,
 1171       -1,    -1,    68,    69,    -1,    71,    -1,    -1,    -1,    -1,
 1172       76,     1,    -1,     3,     4,    -1,    -1,     7,     8,     9,
 1173       -1,    39,    -1,    -1,    -1,    -1,    44,    45,    46,    47,
 1174       -1,    -1,    -1,    -1,    -1,    -1,    54,    -1,    -1,    -1,
 1175       -1,    -1,    60,    61,    -1,    63,    -1,    65,    -1,    39,
 1176       68,    69,    70,    71,    44,    45,    46,    47,    -1,     1,
 1177       -1,     3,     4,    -1,    54,     7,     8,    -1,    -1,    -1,
 1178       60,    61,    -1,    63,    -1,    65,    -1,    -1,    68,    69,
 1179       -1,    71,    -1,    -1,    -1,    -1,    -1,     1,    -1,     3,
 1180        4,    -1,    -1,     7,     8,    -1,    -1,    39,    -1,    -1,
 1181       -1,    -1,    44,    45,    46,    47,    -1,    -1,    -1,    -1,
 1182       -1,    -1,    54,    -1,    -1,    -1,    -1,    -1,    60,    61,
 1183       -1,    63,    -1,    65,    -1,    39,    68,    69,    -1,    71,
 1184       44,    45,    46,    47,    -1,    -1,    -1,    -1,     3,     4,
 1185       54,    -1,     7,     8,    -1,    -1,    60,    61,    -1,    63,
 1186       -1,    65,    -1,    -1,    68,    69,    -1,    71,    23,    -1,
 1187       -1,    -1,    -1,    -1,    -1,    -1,    -1,    32,    33,    -1,
 1188       -1,    -1,     3,     4,    39,    -1,     7,     8,    -1,    44,
 1189       45,    46,    47,    -1,    -1,    -1,    -1,    -1,    -1,    54,
 1190       -1,    -1,    23,    -1,    -1,    60,    61,    -1,    63,    -1,
 1191       65,    32,    33,    68,    69,    -1,    71,    -1,    39,    -1,
 1192       -1,    -1,    -1,    44,    45,    46,    47,     3,     4,    -1,
 1193       -1,     7,     8,    54,    -1,    -1,    12,    -1,    -1,    60,
 1194       61,    -1,    63,    -1,    65,    -1,    -1,    68,    69,    -1,
 1195       71,    -1,    -1,    -1,    -1,     3,     4,    -1,    -1,     7,
 1196        8,     9,    -1,    39,    -1,    -1,    -1,    -1,    44,    45,
 1197       46,    47,    -1,    -1,    -1,    -1,    -1,    10,    54,    -1,
 1198       -1,    -1,    15,    -1,    60,    61,    -1,    63,    -1,    65,
 1199       -1,    39,    68,    69,    -1,    71,    44,    45,    46,    47,
 1200        3,     4,    -1,    -1,     7,     8,    54,    -1,    41,    42,
 1201       43,    -1,    60,    61,    -1,    63,    -1,    65,    -1,    -1,
 1202       68,    69,    55,    71,    57,    58,    59,    -1,     3,     4,
 1203       -1,    -1,     7,     8,    -1,    -1,    39,    -1,    -1,    -1,
 1204       -1,    44,    45,    46,    47,    -1,    -1,    -1,    -1,    -1,
 1205       10,    54,    -1,    -1,    -1,    15,    -1,    60,    61,    -1,
 1206       63,    -1,    65,    -1,    -1,    68,    69,    -1,    71,    44,
 1207       45,    46,    47,    10,    -1,    -1,    -1,    -1,    15,    54,
 1208       -1,    41,    42,    43,    -1,    60,    61,    -1,    63,    -1,
 1209       65,    -1,    10,    68,    69,    55,    71,    15,    58,    59,
 1210       -1,    -1,    -1,    -1,    41,    42,    43,    -1,    -1,    -1,
 1211       -1,    -1,    -1,    -1,    -1,    -1,    76,    -1,    55,    56,
 1212       -1,    58,    59,    41,    42,    43,    -1,    -1,    -1,    -1,
 1213       -1,    -1,    -1,    -1,    -1,    -1,    -1,    55,    -1,    -1,
 1214       58,    59
 1215 };
 1216 
 1217   /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
 1218      symbol of state STATE-NUM.  */
 1219 static const yytype_uint8 yystos[] =
 1220 {
 1221        0,    78,     0,     1,     3,     4,     7,     8,    18,    19,
 1222       36,    37,    38,    39,    44,    45,    46,    47,    48,    53,
 1223       54,    60,    61,    63,    65,    68,    69,    71,    79,    83,
 1224       87,    89,    92,   110,   121,   125,   126,   127,   128,   129,
 1225      130,   138,   139,    69,    72,   135,   136,   137,     3,     4,
 1226       46,    47,    71,    85,    86,   131,   139,   139,   139,    69,
 1227       69,    71,   126,   139,   126,   126,    69,   128,   139,     1,
 1228      117,   121,    49,    51,    52,   130,    74,    76,    84,    94,
 1229      110,   141,   145,    84,    90,    53,    10,    15,    41,    42,
 1230       43,    55,    57,    58,    59,   123,   124,   147,    12,   126,
 1231       60,    61,    62,    63,    64,    67,    60,    61,    62,    63,
 1232       64,    67,    13,    14,    44,    45,    54,   122,     1,     9,
 1233       91,   118,   119,   120,   121,   117,   121,    17,   135,    50,
 1234       69,    58,   112,   118,   118,   121,    44,    45,   140,     1,
 1235       70,   143,   147,   143,     1,     6,    80,     1,     6,    81,
 1236        1,     6,    82,   110,   111,    93,   111,     5,    91,   121,
 1237      138,   121,   121,   121,   111,   121,   121,    39,   126,   126,
 1238      126,   126,   126,   126,   126,   126,   126,   126,   126,   126,
 1239       91,    14,   121,   143,     1,   147,    73,    88,   126,   143,
 1240      143,   121,    41,     1,   121,     1,    94,     1,    94,     1,
 1241       94,     1,    20,    22,    23,    24,    27,    28,    29,    30,
 1242       31,    32,    33,    34,    35,    40,    75,    95,    96,    98,
 1243      105,   109,   121,   141,   142,   145,    56,   131,   120,     1,
 1244      120,     1,     4,   113,   114,   138,    69,    97,     4,    69,
 1245       69,    69,   111,    69,    94,    94,    94,   115,   121,    94,
 1246      111,    94,    99,    93,   144,   145,   111,   121,   143,     1,
 1247      147,   121,   115,   100,     4,   121,   121,    95,     4,    98,
 1248      101,    94,    69,   106,   116,   117,   142,   111,   111,     1,
 1249        4,   143,    94,   132,   133,   134,   135,    70,   143,   143,
 1250       27,    41,   145,   117,    11,   107,   111,    17,   134,   111,
 1251      111,    69,   138,   111,   143,   108,    95,   141,    95,   121,
 1252      143,   121,   145,   125,    21,   102,   143,   111,   145,   111,
 1253      111,     1,    25,    26,   103,   111,   111,    95,   111,   101,
 1254       95,     7,     8,    60,    61,    89,    91,   104,    56,   146,
 1255      142,   101,   143,     7,     7,   146,   111,   143,   111,   111,
 1256       93,   111,    95,    93,    95
 1257 };
 1258 
 1259   /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
 1260 static const yytype_uint8 yyr1[] =
 1261 {
 1262        0,    77,    78,    78,    78,    78,    78,    79,    79,    79,
 1263       79,    79,    79,    80,    80,    80,    81,    81,    81,    82,
 1264       82,    82,    83,    83,    83,    83,    83,    83,    83,    84,
 1265       85,    85,    85,    85,    86,    86,    88,    87,    90,    89,
 1266       91,    92,    92,    93,    93,    93,    94,    94,    95,    95,
 1267       95,    95,    95,    95,    95,    95,    95,    95,    96,    96,
 1268       96,    96,    96,    97,    96,    96,    99,    98,   100,    98,
 1269       98,    98,   101,   101,   102,   102,   102,   103,   103,   104,
 1270      104,   104,   104,   104,   104,   105,   105,   106,   106,   107,
 1271      108,   107,   109,   109,   110,   110,   111,   111,   112,   112,
 1272      113,   113,   114,   114,   114,   114,   114,   115,   115,   116,
 1273      116,   117,   117,   117,   117,   117,   117,   118,   118,   119,
 1274      119,   119,   119,   119,   119,   120,   120,   121,   121,   121,
 1275      121,   121,   121,   121,   121,   121,   121,   122,   122,   122,
 1276      123,   123,   124,   124,   125,   125,   125,   126,   126,   126,
 1277      126,   126,   126,   126,   126,   126,   126,   126,   127,   127,
 1278      127,   127,   127,   127,   127,   128,   128,   128,   128,   128,
 1279      128,   128,   128,   128,   128,   128,   128,   128,   128,   129,
 1280      129,   130,   131,   131,   132,   132,   133,   133,   134,   135,
 1281      136,   136,   137,   138,   138,   139,   139,   140,   140,   140,
 1282      141,   142,   143,   144,   144,   145,   146,   147
 1283 };
 1284 
 1285   /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN.  */
 1286 static const yytype_int8 yyr2[] =
 1287 {
 1288        0,     2,     0,     2,     2,     2,     2,     2,     2,     2,
 1289        4,     4,     4,     1,     2,     1,     1,     2,     1,     1,
 1290        2,     1,     0,     1,     3,     1,     1,     1,     1,     5,
 1291        1,     1,     1,     2,     1,     1,     0,     7,     0,     3,
 1292        1,     1,     1,     0,     2,     2,     1,     2,     2,     3,
 1293        1,     9,     6,     8,     8,    12,    11,     1,     2,     2,
 1294        2,     2,     3,     0,     4,     2,     0,     4,     0,     4,
 1295        4,     1,     0,     1,     0,     2,     2,     5,     4,     1,
 1296        2,     2,     1,     1,     1,     1,     1,     1,     3,     0,
 1297        0,     3,     6,     9,     1,     2,     0,     1,     0,     2,
 1298        0,     1,     1,     3,     1,     2,     3,     0,     1,     0,
 1299        1,     1,     3,     1,     2,     3,     3,     0,     1,     1,
 1300        3,     1,     2,     3,     3,     1,     1,     3,     3,     3,
 1301        3,     3,     3,     3,     3,     5,     1,     1,     1,     2,
 1302        1,     1,     1,     1,     1,     1,     2,     1,     3,     3,
 1303        3,     3,     3,     3,     3,     2,     2,     5,     4,     3,
 1304        3,     3,     3,     3,     3,     1,     2,     3,     4,     4,
 1305        1,     1,     1,     2,     2,     1,     1,     2,     2,     1,
 1306        2,     4,     0,     1,     0,     2,     1,     2,     1,     3,
 1307        1,     2,     2,     1,     2,     1,     3,     1,     1,     0,
 1308        2,     2,     1,     0,     1,     1,     1,     2
 1309 };
 1310 
 1311 
 1312 #define yyerrok         (yyerrstatus = 0)
 1313 #define yyclearin       (yychar = YYEMPTY)
 1314 #define YYEMPTY         (-2)
 1315 #define YYEOF           0
 1316 
 1317 #define YYACCEPT        goto yyacceptlab
 1318 #define YYABORT         goto yyabortlab
 1319 #define YYERROR         goto yyerrorlab
 1320 
 1321 
 1322 #define YYRECOVERING()  (!!yyerrstatus)
 1323 
 1324 #define YYBACKUP(Token, Value)                                    \
 1325   do                                                              \
 1326     if (yychar == YYEMPTY)                                        \
 1327       {                                                           \
 1328         yychar = (Token);                                         \
 1329         yylval = (Value);                                         \
 1330         YYPOPSTACK (yylen);                                       \
 1331         yystate = *yyssp;                                         \
 1332         goto yybackup;                                            \
 1333       }                                                           \
 1334     else                                                          \
 1335       {                                                           \
 1336         yyerror (YY_("syntax error: cannot back up")); \
 1337         YYERROR;                                                  \
 1338       }                                                           \
 1339   while (0)
 1340 
 1341 /* Error token number */
 1342 #define YYTERROR        1
 1343 #define YYERRCODE       256
 1344 
 1345 
 1346 
 1347 /* Enable debugging if requested.  */
 1348 #if YYDEBUG
 1349 
 1350 # ifndef YYFPRINTF
 1351 #  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
 1352 #  define YYFPRINTF fprintf
 1353 # endif
 1354 
 1355 # define YYDPRINTF(Args)                        \
 1356 do {                                            \
 1357   if (yydebug)                                  \
 1358     YYFPRINTF Args;                             \
 1359 } while (0)
 1360 
 1361 /* This macro is provided for backward compatibility. */
 1362 #ifndef YY_LOCATION_PRINT
 1363 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
 1364 #endif
 1365 
 1366 
 1367 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)                    \
 1368 do {                                                                      \
 1369   if (yydebug)                                                            \
 1370     {                                                                     \
 1371       YYFPRINTF (stderr, "%s ", Title);                                   \
 1372       yy_symbol_print (stderr,                                            \
 1373                   Type, Value); \
 1374       YYFPRINTF (stderr, "\n");                                           \
 1375     }                                                                     \
 1376 } while (0)
 1377 
 1378 
 1379 /*-----------------------------------.
 1380 | Print this symbol's value on YYO.  |
 1381 `-----------------------------------*/
 1382 
 1383 static void
 1384 yy_symbol_value_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep)
 1385 {
 1386   FILE *yyoutput = yyo;
 1387   YYUSE (yyoutput);
 1388   if (!yyvaluep)
 1389     return;
 1390 # ifdef YYPRINT
 1391   if (yytype < YYNTOKENS)
 1392     YYPRINT (yyo, yytoknum[yytype], *yyvaluep);
 1393 # endif
 1394   YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
 1395   YYUSE (yytype);
 1396   YY_IGNORE_MAYBE_UNINITIALIZED_END
 1397 }
 1398 
 1399 
 1400 /*---------------------------.
 1401 | Print this symbol on YYO.  |
 1402 `---------------------------*/
 1403 
 1404 static void
 1405 yy_symbol_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep)
 1406 {
 1407   YYFPRINTF (yyo, "%s %s (",
 1408              yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
 1409 
 1410   yy_symbol_value_print (yyo, yytype, yyvaluep);
 1411   YYFPRINTF (yyo, ")");
 1412 }
 1413 
 1414 /*------------------------------------------------------------------.
 1415 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
 1416 | TOP (included).                                                   |
 1417 `------------------------------------------------------------------*/
 1418 
 1419 static void
 1420 yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop)
 1421 {
 1422   YYFPRINTF (stderr, "Stack now");
 1423   for (; yybottom <= yytop; yybottom++)
 1424     {
 1425       int yybot = *yybottom;
 1426       YYFPRINTF (stderr, " %d", yybot);
 1427     }
 1428   YYFPRINTF (stderr, "\n");
 1429 }
 1430 
 1431 # define YY_STACK_PRINT(Bottom, Top)                            \
 1432 do {                                                            \
 1433   if (yydebug)                                                  \
 1434     yy_stack_print ((Bottom), (Top));                           \
 1435 } while (0)
 1436 
 1437 
 1438 /*------------------------------------------------.
 1439 | Report that the YYRULE is going to be reduced.  |
 1440 `------------------------------------------------*/
 1441 
 1442 static void
 1443 yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp, int yyrule)
 1444 {
 1445   int yylno = yyrline[yyrule];
 1446   int yynrhs = yyr2[yyrule];
 1447   int yyi;
 1448   YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n",
 1449              yyrule - 1, yylno);
 1450   /* The symbols being reduced.  */
 1451   for (yyi = 0; yyi < yynrhs; yyi++)
 1452     {
 1453       YYFPRINTF (stderr, "   $%d = ", yyi + 1);
 1454       yy_symbol_print (stderr,
 1455                        yystos[+yyssp[yyi + 1 - yynrhs]],
 1456                        &yyvsp[(yyi + 1) - (yynrhs)]
 1457                                               );
 1458       YYFPRINTF (stderr, "\n");
 1459     }
 1460 }
 1461 
 1462 # define YY_REDUCE_PRINT(Rule)          \
 1463 do {                                    \
 1464   if (yydebug)                          \
 1465     yy_reduce_print (yyssp, yyvsp, Rule); \
 1466 } while (0)
 1467 
 1468 /* Nonzero means print parse trace.  It is left uninitialized so that
 1469    multiple parsers can coexist.  */
 1470 int yydebug;
 1471 #else /* !YYDEBUG */
 1472 # define YYDPRINTF(Args)
 1473 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
 1474 # define YY_STACK_PRINT(Bottom, Top)
 1475 # define YY_REDUCE_PRINT(Rule)
 1476 #endif /* !YYDEBUG */
 1477 
 1478 
 1479 /* YYINITDEPTH -- initial size of the parser's stacks.  */
 1480 #ifndef YYINITDEPTH
 1481 # define YYINITDEPTH 200
 1482 #endif
 1483 
 1484 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
 1485    if the built-in stack extension method is used).
 1486 
 1487    Do not make this value too large; the results are undefined if
 1488    YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
 1489    evaluated with infinite-precision integer arithmetic.  */
 1490 
 1491 #ifndef YYMAXDEPTH
 1492 # define YYMAXDEPTH 10000
 1493 #endif
 1494 
 1495 
 1496 #if YYERROR_VERBOSE
 1497 
 1498 # ifndef yystrlen
 1499 #  if defined __GLIBC__ && defined _STRING_H
 1500 #   define yystrlen(S) (YY_CAST (YYPTRDIFF_T, strlen (S)))
 1501 #  else
 1502 /* Return the length of YYSTR.  */
 1503 static YYPTRDIFF_T
 1504 yystrlen (const char *yystr)
 1505 {
 1506   YYPTRDIFF_T yylen;
 1507   for (yylen = 0; yystr[yylen]; yylen++)
 1508     continue;
 1509   return yylen;
 1510 }
 1511 #  endif
 1512 # endif
 1513 
 1514 # ifndef yystpcpy
 1515 #  if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
 1516 #   define yystpcpy stpcpy
 1517 #  else
 1518 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
 1519    YYDEST.  */
 1520 static char *
 1521 yystpcpy (char *yydest, const char *yysrc)
 1522 {
 1523   char *yyd = yydest;
 1524   const char *yys = yysrc;
 1525 
 1526   while ((*yyd++ = *yys++) != '\0')
 1527     continue;
 1528 
 1529   return yyd - 1;
 1530 }
 1531 #  endif
 1532 # endif
 1533 
 1534 # ifndef yytnamerr
 1535 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
 1536    quotes and backslashes, so that it's suitable for yyerror.  The
 1537    heuristic is that double-quoting is unnecessary unless the string
 1538    contains an apostrophe, a comma, or backslash (other than
 1539    backslash-backslash).  YYSTR is taken from yytname.  If YYRES is
 1540    null, do not copy; instead, return the length of what the result
 1541    would have been.  */
 1542 static YYPTRDIFF_T
 1543 yytnamerr (char *yyres, const char *yystr)
 1544 {
 1545   if (*yystr == '"')
 1546     {
 1547       YYPTRDIFF_T yyn = 0;
 1548       char const *yyp = yystr;
 1549 
 1550       for (;;)
 1551         switch (*++yyp)
 1552           {
 1553           case '\'':
 1554           case ',':
 1555             goto do_not_strip_quotes;
 1556 
 1557           case '\\':
 1558             if (*++yyp != '\\')
 1559               goto do_not_strip_quotes;
 1560             else
 1561               goto append;
 1562 
 1563           append:
 1564           default:
 1565             if (yyres)
 1566               yyres[yyn] = *yyp;
 1567             yyn++;
 1568             break;
 1569 
 1570           case '"':
 1571             if (yyres)
 1572               yyres[yyn] = '\0';
 1573             return yyn;
 1574           }
 1575     do_not_strip_quotes: ;
 1576     }
 1577 
 1578   if (yyres)
 1579     return yystpcpy (yyres, yystr) - yyres;
 1580   else
 1581     return yystrlen (yystr);
 1582 }
 1583 # endif
 1584 
 1585 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
 1586    about the unexpected token YYTOKEN for the state stack whose top is
 1587    YYSSP.
 1588 
 1589    Return 0 if *YYMSG was successfully written.  Return 1 if *YYMSG is
 1590    not large enough to hold the message.  In that case, also set
 1591    *YYMSG_ALLOC to the required number of bytes.  Return 2 if the
 1592    required number of bytes is too large to store.  */
 1593 static int
 1594 yysyntax_error (YYPTRDIFF_T *yymsg_alloc, char **yymsg,
 1595                 yy_state_t *yyssp, int yytoken)
 1596 {
 1597   enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
 1598   /* Internationalized format string. */
 1599   const char *yyformat = YY_NULLPTR;
 1600   /* Arguments of yyformat: reported tokens (one for the "unexpected",
 1601      one per "expected"). */
 1602   char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
 1603   /* Actual size of YYARG. */
 1604   int yycount = 0;
 1605   /* Cumulated lengths of YYARG.  */
 1606   YYPTRDIFF_T yysize = 0;
 1607 
 1608   /* There are many possibilities here to consider:
 1609      - If this state is a consistent state with a default action, then
 1610        the only way this function was invoked is if the default action
 1611        is an error action.  In that case, don't check for expected
 1612        tokens because there are none.
 1613      - The only way there can be no lookahead present (in yychar) is if
 1614        this state is a consistent state with a default action.  Thus,
 1615        detecting the absence of a lookahead is sufficient to determine
 1616        that there is no unexpected or expected token to report.  In that
 1617        case, just report a simple "syntax error".
 1618      - Don't assume there isn't a lookahead just because this state is a
 1619        consistent state with a default action.  There might have been a
 1620        previous inconsistent state, consistent state with a non-default
 1621        action, or user semantic action that manipulated yychar.
 1622      - Of course, the expected token list depends on states to have
 1623        correct lookahead information, and it depends on the parser not
 1624        to perform extra reductions after fetching a lookahead from the
 1625        scanner and before detecting a syntax error.  Thus, state merging
 1626        (from LALR or IELR) and default reductions corrupt the expected
 1627        token list.  However, the list is correct for canonical LR with
 1628        one exception: it will still contain any token that will not be
 1629        accepted due to an error action in a later state.
 1630   */
 1631   if (yytoken != YYEMPTY)
 1632     {
 1633       int yyn = yypact[+*yyssp];
 1634       YYPTRDIFF_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
 1635       yysize = yysize0;
 1636       yyarg[yycount++] = yytname[yytoken];
 1637       if (!yypact_value_is_default (yyn))
 1638         {
 1639           /* Start YYX at -YYN if negative to avoid negative indexes in
 1640              YYCHECK.  In other words, skip the first -YYN actions for
 1641              this state because they are default actions.  */
 1642           int yyxbegin = yyn < 0 ? -yyn : 0;
 1643           /* Stay within bounds of both yycheck and yytname.  */
 1644           int yychecklim = YYLAST - yyn + 1;
 1645           int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
 1646           int yyx;
 1647 
 1648           for (yyx = yyxbegin; yyx < yyxend; ++yyx)
 1649             if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
 1650                 && !yytable_value_is_error (yytable[yyx + yyn]))
 1651               {
 1652                 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
 1653                   {
 1654                     yycount = 1;
 1655                     yysize = yysize0;
 1656                     break;
 1657                   }
 1658                 yyarg[yycount++] = yytname[yyx];
 1659                 {
 1660                   YYPTRDIFF_T yysize1
 1661                     = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
 1662                   if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)
 1663                     yysize = yysize1;
 1664                   else
 1665                     return 2;
 1666                 }
 1667               }
 1668         }
 1669     }
 1670 
 1671   switch (yycount)
 1672     {
 1673 # define YYCASE_(N, S)                      \
 1674       case N:                               \
 1675         yyformat = S;                       \
 1676       break
 1677     default: /* Avoid compiler warnings. */
 1678       YYCASE_(0, YY_("syntax error"));
 1679       YYCASE_(1, YY_("syntax error, unexpected %s"));
 1680       YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
 1681       YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
 1682       YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
 1683       YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
 1684 # undef YYCASE_
 1685     }
 1686 
 1687   {
 1688     /* Don't count the "%s"s in the final size, but reserve room for
 1689        the terminator.  */
 1690     YYPTRDIFF_T yysize1 = yysize + (yystrlen (yyformat) - 2 * yycount) + 1;
 1691     if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)
 1692       yysize = yysize1;
 1693     else
 1694       return 2;
 1695   }
 1696 
 1697   if (*yymsg_alloc < yysize)
 1698     {
 1699       *yymsg_alloc = 2 * yysize;
 1700       if (! (yysize <= *yymsg_alloc
 1701              && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
 1702         *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
 1703       return 1;
 1704     }
 1705 
 1706   /* Avoid sprintf, as that infringes on the user's name space.
 1707      Don't have undefined behavior even if the translation
 1708      produced a string with the wrong number of "%s"s.  */
 1709   {
 1710     char *yyp = *yymsg;
 1711     int yyi = 0;
 1712     while ((*yyp = *yyformat) != '\0')
 1713       if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
 1714         {
 1715           yyp += yytnamerr (yyp, yyarg[yyi++]);
 1716           yyformat += 2;
 1717         }
 1718       else
 1719         {
 1720           ++yyp;
 1721           ++yyformat;
 1722         }
 1723   }
 1724   return 0;
 1725 }
 1726 #endif /* YYERROR_VERBOSE */
 1727 
 1728 /*-----------------------------------------------.
 1729 | Release the memory associated to this symbol.  |
 1730 `-----------------------------------------------*/
 1731 
 1732 static void
 1733 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
 1734 {
 1735   YYUSE (yyvaluep);
 1736   if (!yymsg)
 1737     yymsg = "Deleting";
 1738   YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
 1739 
 1740   YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
 1741   YYUSE (yytype);
 1742   YY_IGNORE_MAYBE_UNINITIALIZED_END
 1743 }
 1744 
 1745 
 1746 
 1747 
 1748 /* The lookahead symbol.  */
 1749 int yychar;
 1750 
 1751 /* The semantic value of the lookahead symbol.  */
 1752 YYSTYPE yylval;
 1753 /* Number of syntax errors so far.  */
 1754 int yynerrs;
 1755 
 1756 
 1757 /*----------.
 1758 | yyparse.  |
 1759 `----------*/
 1760 
 1761 int
 1762 yyparse (void)
 1763 {
 1764     yy_state_fast_t yystate;
 1765     /* Number of tokens to shift before error messages enabled.  */
 1766     int yyerrstatus;
 1767 
 1768     /* The stacks and their tools:
 1769        'yyss': related to states.
 1770        'yyvs': related to semantic values.
 1771 
 1772        Refer to the stacks through separate pointers, to allow yyoverflow
 1773        to reallocate them elsewhere.  */
 1774 
 1775     /* The state stack.  */
 1776     yy_state_t yyssa[YYINITDEPTH];
 1777     yy_state_t *yyss;
 1778     yy_state_t *yyssp;
 1779 
 1780     /* The semantic value stack.  */
 1781     YYSTYPE yyvsa[YYINITDEPTH];
 1782     YYSTYPE *yyvs;
 1783     YYSTYPE *yyvsp;
 1784 
 1785     YYPTRDIFF_T yystacksize;
 1786 
 1787   int yyn;
 1788   int yyresult;
 1789   /* Lookahead token as an internal (translated) token number.  */
 1790   int yytoken = 0;
 1791   /* The variables used to return semantic value and location from the
 1792      action routines.  */
 1793   YYSTYPE yyval;
 1794 
 1795 #if YYERROR_VERBOSE
 1796   /* Buffer for error messages, and its allocated size.  */
 1797   char yymsgbuf[128];
 1798   char *yymsg = yymsgbuf;
 1799   YYPTRDIFF_T yymsg_alloc = sizeof yymsgbuf;
 1800 #endif
 1801 
 1802 #define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))
 1803 
 1804   /* The number of symbols on the RHS of the reduced rule.
 1805      Keep to zero when no symbol should be popped.  */
 1806   int yylen = 0;
 1807 
 1808   yyssp = yyss = yyssa;
 1809   yyvsp = yyvs = yyvsa;
 1810   yystacksize = YYINITDEPTH;
 1811 
 1812   YYDPRINTF ((stderr, "Starting parse\n"));
 1813 
 1814   yystate = 0;
 1815   yyerrstatus = 0;
 1816   yynerrs = 0;
 1817   yychar = YYEMPTY; /* Cause a token to be read.  */
 1818   goto yysetstate;
 1819 
 1820 
 1821 /*------------------------------------------------------------.
 1822 | yynewstate -- push a new state, which is found in yystate.  |
 1823 `------------------------------------------------------------*/
 1824 yynewstate:
 1825   /* In all cases, when you get here, the value and location stacks
 1826      have just been pushed.  So pushing a state here evens the stacks.  */
 1827   yyssp++;
 1828 
 1829 
 1830 /*--------------------------------------------------------------------.
 1831 | yysetstate -- set current state (the top of the stack) to yystate.  |
 1832 `--------------------------------------------------------------------*/
 1833 yysetstate:
 1834   YYDPRINTF ((stderr, "Entering state %d\n", yystate));
 1835   YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
 1836   YY_IGNORE_USELESS_CAST_BEGIN
 1837   *yyssp = YY_CAST (yy_state_t, yystate);
 1838   YY_IGNORE_USELESS_CAST_END
 1839 
 1840   if (yyss + yystacksize - 1 <= yyssp)
 1841 #if !defined yyoverflow && !defined YYSTACK_RELOCATE
 1842     goto yyexhaustedlab;
 1843 #else
 1844     {
 1845       /* Get the current used size of the three stacks, in elements.  */
 1846       YYPTRDIFF_T yysize = yyssp - yyss + 1;
 1847 
 1848 # if defined yyoverflow
 1849       {
 1850         /* Give user a chance to reallocate the stack.  Use copies of
 1851            these so that the &'s don't force the real ones into
 1852            memory.  */
 1853         yy_state_t *yyss1 = yyss;
 1854         YYSTYPE *yyvs1 = yyvs;
 1855 
 1856         /* Each stack pointer address is followed by the size of the
 1857            data in use in that stack, in bytes.  This used to be a
 1858            conditional around just the two extra args, but that might
 1859            be undefined if yyoverflow is a macro.  */
 1860         yyoverflow (YY_("memory exhausted"),
 1861                     &yyss1, yysize * YYSIZEOF (*yyssp),
 1862                     &yyvs1, yysize * YYSIZEOF (*yyvsp),
 1863                     &yystacksize);
 1864         yyss = yyss1;
 1865         yyvs = yyvs1;
 1866       }
 1867 # else /* defined YYSTACK_RELOCATE */
 1868       /* Extend the stack our own way.  */
 1869       if (YYMAXDEPTH <= yystacksize)
 1870         goto yyexhaustedlab;
 1871       yystacksize *= 2;
 1872       if (YYMAXDEPTH < yystacksize)
 1873         yystacksize = YYMAXDEPTH;
 1874 
 1875       {
 1876         yy_state_t *yyss1 = yyss;
 1877         union yyalloc *yyptr =
 1878           YY_CAST (union yyalloc *,
 1879                    YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize))));
 1880         if (! yyptr)
 1881           goto yyexhaustedlab;
 1882         YYSTACK_RELOCATE (yyss_alloc, yyss);
 1883         YYSTACK_RELOCATE (yyvs_alloc, yyvs);
 1884 # undef YYSTACK_RELOCATE
 1885         if (yyss1 != yyssa)
 1886           YYSTACK_FREE (yyss1);
 1887       }
 1888 # endif
 1889 
 1890       yyssp = yyss + yysize - 1;
 1891       yyvsp = yyvs + yysize - 1;
 1892 
 1893       YY_IGNORE_USELESS_CAST_BEGIN
 1894       YYDPRINTF ((stderr, "Stack size increased to %ld\n",
 1895                   YY_CAST (long, yystacksize)));
 1896       YY_IGNORE_USELESS_CAST_END
 1897 
 1898       if (yyss + yystacksize - 1 <= yyssp)
 1899         YYABORT;
 1900     }
 1901 #endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
 1902 
 1903   if (yystate == YYFINAL)
 1904     YYACCEPT;
 1905 
 1906   goto yybackup;
 1907 
 1908 
 1909 /*-----------.
 1910 | yybackup.  |
 1911 `-----------*/
 1912 yybackup:
 1913   /* Do appropriate processing given the current state.  Read a
 1914      lookahead token if we need one and don't already have one.  */
 1915 
 1916   /* First try to decide what to do without reference to lookahead token.  */
 1917   yyn = yypact[yystate];
 1918   if (yypact_value_is_default (yyn))
 1919     goto yydefault;
 1920 
 1921   /* Not known => get a lookahead token if don't already have one.  */
 1922 
 1923   /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol.  */
 1924   if (yychar == YYEMPTY)
 1925     {
 1926       YYDPRINTF ((stderr, "Reading a token: "));
 1927       yychar = yylex ();
 1928     }
 1929 
 1930   if (yychar <= YYEOF)
 1931     {
 1932       yychar = yytoken = YYEOF;
 1933       YYDPRINTF ((stderr, "Now at end of input.\n"));
 1934     }
 1935   else
 1936     {
 1937       yytoken = YYTRANSLATE (yychar);
 1938       YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
 1939     }
 1940 
 1941   /* If the proper action on seeing token YYTOKEN is to reduce or to
 1942      detect an error, take that action.  */
 1943   yyn += yytoken;
 1944   if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
 1945     goto yydefault;
 1946   yyn = yytable[yyn];
 1947   if (yyn <= 0)
 1948     {
 1949       if (yytable_value_is_error (yyn))
 1950         goto yyerrlab;
 1951       yyn = -yyn;
 1952       goto yyreduce;
 1953     }
 1954 
 1955   /* Count tokens shifted since error; after three, turn off error
 1956      status.  */
 1957   if (yyerrstatus)
 1958     yyerrstatus--;
 1959 
 1960   /* Shift the lookahead token.  */
 1961   YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
 1962   yystate = yyn;
 1963   YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
 1964   *++yyvsp = yylval;
 1965   YY_IGNORE_MAYBE_UNINITIALIZED_END
 1966 
 1967   /* Discard the shifted token.  */
 1968   yychar = YYEMPTY;
 1969   goto yynewstate;
 1970 
 1971 
 1972 /*-----------------------------------------------------------.
 1973 | yydefault -- do the default action for the current state.  |
 1974 `-----------------------------------------------------------*/
 1975 yydefault:
 1976   yyn = yydefact[yystate];
 1977   if (yyn == 0)
 1978     goto yyerrlab;
 1979   goto yyreduce;
 1980 
 1981 
 1982 /*-----------------------------.
 1983 | yyreduce -- do a reduction.  |
 1984 `-----------------------------*/
 1985 yyreduce:
 1986   /* yyn is the number of a rule to reduce with.  */
 1987   yylen = yyr2[yyn];
 1988 
 1989   /* If YYLEN is nonzero, implement the default value of the action:
 1990      '$$ = $1'.
 1991 
 1992      Otherwise, the following line sets YYVAL to garbage.
 1993      This behavior is undocumented and Bison
 1994      users should not rely upon it.  Assigning to YYVAL
 1995      unconditionally makes the parser a bit smaller, and it avoids a
 1996      GCC warning that YYVAL may be used uninitialized.  */
 1997   yyval = yyvsp[1-yylen];
 1998 
 1999 
 2000   YY_REDUCE_PRINT (yyn);
 2001   switch (yyn)
 2002     {
 2003   case 2:
 2004 #line 232 "awkgram.y"
 2005           { yyval = NULL; }
 2006 #line 2007 "awkgram.c"
 2007     break;
 2008 
 2009   case 3:
 2010 #line 234 "awkgram.y"
 2011           {
 2012         rule = 0;
 2013         yyerrok;
 2014       }
 2015 #line 2016 "awkgram.c"
 2016     break;
 2017 
 2018   case 4:
 2019 #line 239 "awkgram.y"
 2020           {
 2021         if (yyvsp[0] != NULL) {
 2022             if (yyvsp[-1] == NULL)
 2023                 outer_comment = yyvsp[0];
 2024             else
 2025                 interblock_comment = yyvsp[0];
 2026         }
 2027         yyval = yyvsp[-1];
 2028       }
 2029 #line 2030 "awkgram.c"
 2030     break;
 2031 
 2032   case 5:
 2033 #line 249 "awkgram.y"
 2034           {
 2035         next_sourcefile();
 2036       }
 2037 #line 2038 "awkgram.c"
 2038     break;
 2039 
 2040   case 6:
 2041 #line 253 "awkgram.y"
 2042           {
 2043         rule = 0;
 2044         /*
 2045          * If errors, give up, don't produce an infinite
 2046          * stream of syntax error messages.
 2047          */
 2048         /* yyerrok; */
 2049       }
 2050 #line 2051 "awkgram.c"
 2051     break;
 2052 
 2053   case 7:
 2054 #line 265 "awkgram.y"
 2055           {
 2056         (void) append_rule(yyvsp[-1], yyvsp[0]);
 2057         if (pending_comment != NULL) {
 2058             interblock_comment = pending_comment;
 2059             pending_comment = NULL;
 2060         }
 2061       }
 2062 #line 2063 "awkgram.c"
 2063     break;
 2064 
 2065   case 8:
 2066 #line 273 "awkgram.y"
 2067           {
 2068         if (rule != Rule) {
 2069             msg(_("%s blocks must have an action part"), ruletab[rule]);
 2070             errcount++;
 2071         } else if (yyvsp[-1] == NULL) {
 2072             msg(_("each rule must have a pattern or an action part"));
 2073             errcount++;
 2074         } else {    /* pattern rule with non-empty pattern */
 2075             if (yyvsp[0] != NULL)
 2076                 list_append(yyvsp[-1], yyvsp[0]);
 2077             (void) append_rule(yyvsp[-1], NULL);
 2078         }
 2079       }
 2080 #line 2081 "awkgram.c"
 2081     break;
 2082 
 2083   case 9:
 2084 #line 287 "awkgram.y"
 2085           {
 2086         in_function = false;
 2087         (void) mk_function(yyvsp[-1], yyvsp[0]);
 2088         want_param_names = DONT_CHECK;
 2089         if (pending_comment != NULL) {
 2090             interblock_comment = pending_comment;
 2091             pending_comment = NULL;
 2092         }
 2093         yyerrok;
 2094       }
 2095 #line 2096 "awkgram.c"
 2096     break;
 2097 
 2098   case 10:
 2099 #line 298 "awkgram.y"
 2100           {
 2101         want_source = false;
 2102         at_seen = false;
 2103         if (yyvsp[-1] != NULL && yyvsp[0] != NULL) {
 2104             SRCFILE *s = (SRCFILE *) yyvsp[-1];
 2105             s->comment = yyvsp[0];
 2106         }
 2107         yyerrok;
 2108       }
 2109 #line 2110 "awkgram.c"
 2110     break;
 2111 
 2112   case 11:
 2113 #line 308 "awkgram.y"
 2114           {
 2115         want_source = false;
 2116         at_seen = false;
 2117         if (yyvsp[-1] != NULL && yyvsp[0] != NULL) {
 2118             SRCFILE *s = (SRCFILE *) yyvsp[-1];
 2119             s->comment = yyvsp[0];
 2120         }
 2121         yyerrok;
 2122       }
 2123 #line 2124 "awkgram.c"
 2124     break;
 2125 
 2126   case 12:
 2127 #line 318 "awkgram.y"
 2128           {
 2129         want_source = false;
 2130         at_seen = false;
 2131 
 2132         // this frees $3 storage in all cases
 2133         set_namespace(yyvsp[-1], yyvsp[0]);
 2134 
 2135         yyerrok;
 2136       }
 2137 #line 2138 "awkgram.c"
 2138     break;
 2139 
 2140   case 13:
 2141 #line 331 "awkgram.y"
 2142           {
 2143         void *srcfile = NULL;
 2144 
 2145         if (! include_source(yyvsp[0], & srcfile))
 2146             YYABORT;
 2147         efree(yyvsp[0]->lextok);
 2148         bcfree(yyvsp[0]);
 2149         yyval = (INSTRUCTION *) srcfile;
 2150       }
 2151 #line 2152 "awkgram.c"
 2152     break;
 2153 
 2154   case 14:
 2155 #line 341 "awkgram.y"
 2156           { yyval = NULL; }
 2157 #line 2158 "awkgram.c"
 2158     break;
 2159 
 2160   case 15:
 2161 #line 343 "awkgram.y"
 2162           { yyval = NULL; }
 2163 #line 2164 "awkgram.c"
 2164     break;
 2165 
 2166   case 16:
 2167 #line 348 "awkgram.y"
 2168           {
 2169         void *srcfile;
 2170 
 2171         if (! load_library(yyvsp[0], & srcfile))
 2172             YYABORT;
 2173         efree(yyvsp[0]->lextok);
 2174         bcfree(yyvsp[0]);
 2175         yyval = (INSTRUCTION *) srcfile;
 2176       }
 2177 #line 2178 "awkgram.c"
 2178     break;
 2179 
 2180   case 17:
 2181 #line 358 "awkgram.y"
 2182           { yyval = NULL; }
 2183 #line 2184 "awkgram.c"
 2184     break;
 2185 
 2186   case 18:
 2187 #line 360 "awkgram.y"
 2188           { yyval = NULL; }
 2189 #line 2190 "awkgram.c"
 2190     break;
 2191 
 2192   case 19:
 2193 #line 365 "awkgram.y"
 2194           { yyval = yyvsp[0]; }
 2195 #line 2196 "awkgram.c"
 2196     break;
 2197 
 2198   case 20:
 2199 #line 367 "awkgram.y"
 2200           { yyval = NULL; }
 2201 #line 2202 "awkgram.c"
 2202     break;
 2203 
 2204   case 21:
 2205 #line 369 "awkgram.y"
 2206           { yyval = NULL; }
 2207 #line 2208 "awkgram.c"
 2208     break;
 2209 
 2210   case 22:
 2211 #line 374 "awkgram.y"
 2212           {
 2213         rule = Rule;
 2214         yyval = NULL;
 2215       }
 2216 #line 2217 "awkgram.c"
 2217     break;
 2218 
 2219   case 23:
 2220 #line 379 "awkgram.y"
 2221           {
 2222         rule = Rule;
 2223       }
 2224 #line 2225 "awkgram.c"
 2225     break;
 2226 
 2227   case 24:
 2228 #line 384 "awkgram.y"
 2229           {
 2230         INSTRUCTION *tp;
 2231 
 2232         add_lint(yyvsp[-2], LINT_assign_in_cond);
 2233         add_lint(yyvsp[0], LINT_assign_in_cond);
 2234 
 2235         tp = instruction(Op_no_op);
 2236         list_prepend(yyvsp[-2], bcalloc(Op_line_range, !!do_pretty_print + 1, 0));
 2237         yyvsp[-2]->nexti->triggered = false;
 2238         yyvsp[-2]->nexti->target_jmp = yyvsp[0]->nexti;
 2239 
 2240         list_append(yyvsp[-2], instruction(Op_cond_pair));
 2241         yyvsp[-2]->lasti->line_range = yyvsp[-2]->nexti;
 2242         yyvsp[-2]->lasti->target_jmp = tp;
 2243 
 2244         list_append(yyvsp[0], instruction(Op_cond_pair));
 2245         yyvsp[0]->lasti->line_range = yyvsp[-2]->nexti;
 2246         yyvsp[0]->lasti->target_jmp = tp;
 2247         if (do_pretty_print) {
 2248             (yyvsp[-2]->nexti + 1)->condpair_left = yyvsp[-2]->lasti;
 2249             (yyvsp[-2]->nexti + 1)->condpair_right = yyvsp[0]->lasti;
 2250         }
 2251         /* Put any comments in front of the range expression */
 2252         if (yyvsp[-1] != NULL)
 2253             yyval = list_append(list_merge(list_prepend(yyvsp[-2], yyvsp[-1]), yyvsp[0]), tp);
 2254         else
 2255             yyval = list_append(list_merge(yyvsp[-2], yyvsp[0]), tp);
 2256         rule = Rule;
 2257       }
 2258 #line 2259 "awkgram.c"
 2259     break;
 2260 
 2261   case 25:
 2262 #line 414 "awkgram.y"
 2263           {
 2264         static int begin_seen = 0;
 2265 
 2266         if (do_lint_old && ++begin_seen == 2)
 2267             lintwarn_ln(yyvsp[0]->source_line,
 2268                 _("old awk does not support multiple `BEGIN' or `END' rules"));
 2269 
 2270         yyvsp[0]->in_rule = rule = BEGIN;
 2271         yyvsp[0]->source_file = source;
 2272         yyval = yyvsp[0];
 2273       }
 2274 #line 2275 "awkgram.c"
 2275     break;
 2276 
 2277   case 26:
 2278 #line 426 "awkgram.y"
 2279           {
 2280         static int end_seen = 0;
 2281 
 2282         if (do_lint_old && ++end_seen == 2)
 2283             lintwarn_ln(yyvsp[0]->source_line,
 2284                 _("old awk does not support multiple `BEGIN' or `END' rules"));
 2285 
 2286         yyvsp[0]->in_rule = rule = END;
 2287         yyvsp[0]->source_file = source;
 2288         yyval = yyvsp[0];
 2289       }
 2290 #line 2291 "awkgram.c"
 2291     break;
 2292 
 2293   case 27:
 2294 #line 438 "awkgram.y"
 2295           {
 2296         yyvsp[0]->in_rule = rule = BEGINFILE;
 2297         yyvsp[0]->source_file = source;
 2298         yyval = yyvsp[0];
 2299       }
 2300 #line 2301 "awkgram.c"
 2301     break;
 2302 
 2303   case 28:
 2304 #line 444 "awkgram.y"
 2305           {
 2306         yyvsp[0]->in_rule = rule = ENDFILE;
 2307         yyvsp[0]->source_file = source;
 2308         yyval = yyvsp[0];
 2309       }
 2310 #line 2311 "awkgram.c"
 2311     break;
 2312 
 2313   case 29:
 2314 #line 453 "awkgram.y"
 2315           {
 2316         INSTRUCTION *ip = make_braced_statements(yyvsp[-4], yyvsp[-3], yyvsp[-2]);
 2317 
 2318         if (yyvsp[-2] != NULL && yyvsp[0] != NULL) {
 2319             merge_comments(yyvsp[-2], yyvsp[0]);
 2320             pending_comment = yyvsp[-2];
 2321         } else if (yyvsp[-2] != NULL) {
 2322             pending_comment = yyvsp[-2];
 2323         } else if (yyvsp[0] != NULL) {
 2324             pending_comment = yyvsp[0];
 2325         }
 2326 
 2327         yyval = ip;
 2328       }
 2329 #line 2330 "awkgram.c"
 2330     break;
 2331 
 2332   case 31:
 2333 #line 472 "awkgram.y"
 2334           {
 2335         const char *name = yyvsp[0]->lextok;
 2336         char *qname = qualify_name(name, strlen(name));
 2337 
 2338         if (qname != name) {
 2339             efree((void *)name);
 2340             yyvsp[0]->lextok = qname;
 2341         }
 2342         yyval = yyvsp[0];
 2343       }
 2344 #line 2345 "awkgram.c"
 2345     break;
 2346 
 2347   case 32:
 2348 #line 483 "awkgram.y"
 2349           {
 2350         yyerror(_("`%s' is a built-in function, it cannot be redefined"),
 2351                     tokstart);
 2352         YYABORT;
 2353       }
 2354 #line 2355 "awkgram.c"
 2355     break;
 2356 
 2357   case 33:
 2358 #line 489 "awkgram.y"
 2359           {
 2360         yyval = yyvsp[0];
 2361         at_seen = false;
 2362       }
 2363 #line 2364 "awkgram.c"
 2364     break;
 2365 
 2366   case 36:
 2367 #line 501 "awkgram.y"
 2368                                      { want_param_names = FUNC_HEADER; }
 2369 #line 2370 "awkgram.c"
 2370     break;
 2371 
 2372   case 37:
 2373 #line 502 "awkgram.y"
 2374           {
 2375         INSTRUCTION *func_comment = NULL;
 2376         // Merge any comments found in the parameter list with those
 2377         // following the function header, associate the whole shebang
 2378         // with the function as one block comment.
 2379         if (yyvsp[-2] != NULL && yyvsp[-2]->comment != NULL) {
 2380             if (yyvsp[0] != NULL) {
 2381                 merge_comments(yyvsp[-2]->comment, yyvsp[0]);
 2382             }
 2383             func_comment = yyvsp[-2]->comment;
 2384         } else if (yyvsp[0] != NULL) {
 2385             func_comment = yyvsp[0];
 2386         }
 2387 
 2388         yyvsp[-6]->source_file = source;
 2389         yyvsp[-6]->comment = func_comment;
 2390         if (install_function(yyvsp[-5]->lextok, yyvsp[-6], yyvsp[-2]) < 0)
 2391             YYABORT;
 2392         in_function = true;
 2393         yyvsp[-5]->lextok = NULL;
 2394         bcfree(yyvsp[-5]);
 2395         /* $5 already free'd in install_function */
 2396         yyval = yyvsp[-6];
 2397         want_param_names = FUNC_BODY;
 2398       }
 2399 #line 2400 "awkgram.c"
 2400     break;
 2401 
 2402   case 38:
 2403 #line 535 "awkgram.y"
 2404                 { want_regexp = true; }
 2405 #line 2406 "awkgram.c"
 2406     break;
 2407 
 2408   case 39:
 2409 #line 537 "awkgram.y"
 2410                 {
 2411           NODE *n, *exp;
 2412           char *re;
 2413           size_t len;
 2414 
 2415           re = yyvsp[0]->lextok;
 2416           yyvsp[0]->lextok = NULL;
 2417           len = strlen(re);
 2418           if (do_lint) {
 2419             if (len == 0)
 2420                 lintwarn_ln(yyvsp[0]->source_line,
 2421                     _("regexp constant `//' looks like a C++ comment, but is not"));
 2422             else if (re[0] == '*' && re[len-1] == '*')
 2423                 /* possible C comment */
 2424                 lintwarn_ln(yyvsp[0]->source_line,
 2425                     _("regexp constant `/%s/' looks like a C comment, but is not"), re);
 2426           }
 2427 
 2428           exp = make_str_node(re, len, ALREADY_MALLOCED);
 2429           n = make_regnode(Node_regex, exp);
 2430           if (n == NULL) {
 2431             unref(exp);
 2432             YYABORT;
 2433           }
 2434           yyval = yyvsp[0];
 2435           yyval->opcode = Op_match_rec;
 2436           yyval->memory = n;
 2437         }
 2438 #line 2439 "awkgram.c"
 2439     break;
 2440 
 2441   case 40:
 2442 #line 569 "awkgram.y"
 2443                 {
 2444           char *re;
 2445           size_t len;
 2446 
 2447           re = yyvsp[0]->lextok;
 2448           yyvsp[0]->lextok = NULL;
 2449           len = strlen(re);
 2450 
 2451           yyval = yyvsp[0];
 2452           yyval->opcode = Op_push_re;
 2453           yyval->memory = make_typed_regex(re, len);
 2454         }
 2455 #line 2456 "awkgram.c"
 2456     break;
 2457 
 2458   case 41:
 2459 #line 584 "awkgram.y"
 2460           { bcfree(yyvsp[0]); }
 2461 #line 2462 "awkgram.c"
 2462     break;
 2463 
 2464   case 43:
 2465 #line 590 "awkgram.y"
 2466           { yyval = NULL; }
 2467 #line 2468 "awkgram.c"
 2468     break;
 2469 
 2470   case 44:
 2471 #line 592 "awkgram.y"
 2472           {
 2473         if (yyvsp[0] == NULL) {
 2474             yyval = yyvsp[-1];
 2475         } else {
 2476             add_lint(yyvsp[0], LINT_no_effect);
 2477             if (yyvsp[-1] == NULL) {
 2478                 yyval = yyvsp[0];
 2479             } else {
 2480                 yyval = list_merge(yyvsp[-1], yyvsp[0]);
 2481             }
 2482         }
 2483 
 2484         if (trailing_comment != NULL) {
 2485             yyval = list_append(yyval, trailing_comment);
 2486             trailing_comment = NULL;
 2487         }
 2488 
 2489         yyerrok;
 2490       }
 2491 #line 2492 "awkgram.c"
 2492     break;
 2493 
 2494   case 45:
 2495 #line 612 "awkgram.y"
 2496           { yyval = NULL; }
 2497 #line 2498 "awkgram.c"
 2498     break;
 2499 
 2500   case 46:
 2501 #line 616 "awkgram.y"
 2502                         { yyval = yyvsp[0]; }
 2503 #line 2504 "awkgram.c"
 2504     break;
 2505 
 2506   case 47:
 2507 #line 617 "awkgram.y"
 2508                         { yyval = yyvsp[0]; }
 2509 #line 2510 "awkgram.c"
 2510     break;
 2511 
 2512   case 48:
 2513 #line 622 "awkgram.y"
 2514           {
 2515         if (yyvsp[0] != NULL) {
 2516             INSTRUCTION *ip;
 2517 
 2518             merge_comments(yyvsp[0], NULL);
 2519             ip = list_create(instruction(Op_no_op));
 2520             yyval = list_append(ip, yyvsp[0]); 
 2521         } else
 2522             yyval = NULL;
 2523       }
 2524 #line 2525 "awkgram.c"
 2525     break;
 2526 
 2527   case 49:
 2528 #line 633 "awkgram.y"
 2529           {
 2530         trailing_comment = yyvsp[0];    // NULL or comment
 2531         yyval = make_braced_statements(yyvsp[-2], yyvsp[-1], yyvsp[0]);
 2532       }
 2533 #line 2534 "awkgram.c"
 2534     break;
 2535 
 2536   case 50:
 2537 #line 638 "awkgram.y"
 2538           {
 2539         if (do_pretty_print)
 2540             yyval = list_prepend(yyvsp[0], instruction(Op_exec_count));
 2541         else
 2542             yyval = yyvsp[0];
 2543       }
 2544 #line 2545 "awkgram.c"
 2545     break;
 2546 
 2547   case 51:
 2548 #line 645 "awkgram.y"
 2549           {
 2550         INSTRUCTION *dflt, *curr = NULL, *cexp, *cstmt;
 2551         INSTRUCTION *ip, *nextc, *tbreak;
 2552         const char **case_values = NULL;
 2553         int maxcount = 128;
 2554         int case_count = 0;
 2555         int i;
 2556 
 2557         tbreak = instruction(Op_no_op);
 2558         cstmt = list_create(tbreak);
 2559         cexp = list_create(instruction(Op_pop));
 2560         dflt = instruction(Op_jmp);
 2561         dflt->target_jmp = tbreak;  /* if no case match and no explicit default */
 2562 
 2563         if (yyvsp[-2] != NULL) {
 2564             curr = yyvsp[-2]->nexti;
 2565             bcfree(yyvsp[-2]);  /* Op_list */
 2566         }
 2567         /*  else
 2568             curr = NULL; */
 2569 
 2570         for (; curr != NULL; curr = nextc) {
 2571             INSTRUCTION *caseexp = curr->case_exp;
 2572             INSTRUCTION *casestmt = curr->case_stmt;
 2573 
 2574             nextc = curr->nexti;
 2575             if (curr->opcode == Op_K_case) {
 2576                 if (caseexp->opcode == Op_push_i) {
 2577                     /* a constant scalar */
 2578                     char *caseval;
 2579                     caseval = force_string(caseexp->memory)->stptr;
 2580                     for (i = 0; i < case_count; i++) {
 2581                         if (strcmp(caseval, case_values[i]) == 0)
 2582                             error_ln(curr->source_line,
 2583                                 _("duplicate case values in switch body: %s"), caseval);
 2584                     }
 2585 
 2586                     if (case_values == NULL)
 2587                         emalloc(case_values, const char **, sizeof(char *) * maxcount, "statement");
 2588                     else if (case_count >= maxcount) {
 2589                         maxcount += 128;
 2590                         erealloc(case_values, const char **, sizeof(char*) * maxcount, "statement");
 2591                     }
 2592                     case_values[case_count++] = caseval;
 2593                 } else {
 2594                     /* match a constant regex against switch expression. */
 2595                     (curr + 1)->match_exp = true;
 2596                 }
 2597                 curr->stmt_start = casestmt->nexti;
 2598                 curr->stmt_end  = casestmt->lasti;
 2599                 (void) list_prepend(cexp, curr);
 2600                 (void) list_prepend(cexp, caseexp);
 2601             } else {
 2602                 if (dflt->target_jmp != tbreak)
 2603                     error_ln(curr->source_line,
 2604                         _("duplicate `default' detected in switch body"));
 2605                 else
 2606                     dflt->target_jmp = casestmt->nexti;
 2607 
 2608                 if (do_pretty_print) {
 2609                     curr->stmt_start = casestmt->nexti;
 2610                     curr->stmt_end = casestmt->lasti;
 2611                     (void) list_prepend(cexp, curr);
 2612                 } else
 2613                     bcfree(curr);
 2614             }
 2615 
 2616             cstmt = list_merge(casestmt, cstmt);
 2617         }
 2618 
 2619         if (case_values != NULL)
 2620             efree(case_values);
 2621 
 2622         ip = yyvsp[-6];
 2623         if (do_pretty_print) {
 2624             // first merge comments
 2625             INSTRUCTION *head_comment = NULL;
 2626 
 2627             if (yyvsp[-4] != NULL && yyvsp[-3] != NULL) {
 2628                 merge_comments(yyvsp[-4], yyvsp[-3]);
 2629                 head_comment = yyvsp[-4];
 2630             } else if (yyvsp[-4] != NULL)
 2631                 head_comment = yyvsp[-4];
 2632             else
 2633                 head_comment = yyvsp[-3];
 2634 
 2635             yyvsp[-8]->comment = head_comment;
 2636 
 2637             (void) list_prepend(ip, yyvsp[-8]);
 2638             (void) list_prepend(ip, instruction(Op_exec_count));
 2639             yyvsp[-8]->target_break = tbreak;
 2640             (yyvsp[-8] + 1)->switch_start = cexp->nexti;
 2641             (yyvsp[-8] + 1)->switch_end = cexp->lasti;
 2642             (yyvsp[-8] + 1)->switch_end->comment = yyvsp[0];
 2643         }
 2644         /* else
 2645             $1 is NULL */
 2646 
 2647         (void) list_append(cexp, dflt);
 2648         (void) list_merge(ip, cexp);
 2649         if (yyvsp[-1] != NULL)
 2650             (void) list_append(cstmt, yyvsp[-1]);
 2651         yyval = list_merge(ip, cstmt);
 2652 
 2653         break_allowed--;
 2654         fix_break_continue(ip, tbreak, NULL);
 2655       }
 2656 #line 2657 "awkgram.c"
 2657     break;
 2658 
 2659   case 52:
 2660 #line 753 "awkgram.y"
 2661           {
 2662         /*
 2663          *    -----------------
 2664          * tc:
 2665          *         cond
 2666          *    -----------------
 2667          *    [Op_jmp_false tb   ]
 2668          *    -----------------
 2669          *         body
 2670          *    -----------------
 2671          *    [Op_jmp      tc    ]
 2672          * tb:[Op_no_op          ]
 2673          */
 2674 
 2675         INSTRUCTION *ip, *tbreak, *tcont;
 2676 
 2677         tbreak = instruction(Op_no_op);
 2678         add_lint(yyvsp[-3], LINT_assign_in_cond);
 2679         tcont = yyvsp[-3]->nexti;
 2680         ip = list_append(yyvsp[-3], instruction(Op_jmp_false));
 2681         ip->lasti->target_jmp = tbreak;
 2682 
 2683         if (do_pretty_print) {
 2684             (void) list_append(ip, instruction(Op_exec_count));
 2685             yyvsp[-5]->target_break = tbreak;
 2686             yyvsp[-5]->target_continue = tcont;
 2687             (yyvsp[-5] + 1)->while_body = ip->lasti;
 2688             (void) list_prepend(ip, yyvsp[-5]);
 2689         }
 2690         /* else
 2691             $1 is NULL */
 2692 
 2693         if (yyvsp[-1] != NULL) {
 2694             if (yyvsp[0] == NULL)
 2695                 yyvsp[0] = list_create(instruction(Op_no_op));
 2696 
 2697             yyvsp[-1]->memory->comment_type = BLOCK_COMMENT;
 2698             yyvsp[0] = list_prepend(yyvsp[0], yyvsp[-1]);
 2699         }
 2700 
 2701         if (yyvsp[0] != NULL)
 2702             (void) list_merge(ip, yyvsp[0]);
 2703         (void) list_append(ip, instruction(Op_jmp));
 2704         ip->lasti->target_jmp = tcont;
 2705         yyval = list_append(ip, tbreak);
 2706 
 2707         break_allowed--;
 2708         continue_allowed--;
 2709         fix_break_continue(ip, tbreak, tcont);
 2710       }
 2711 #line 2712 "awkgram.c"
 2712     break;
 2713 
 2714   case 53:
 2715 #line 804 "awkgram.y"
 2716           {
 2717         /*
 2718          *    -----------------
 2719          * z:
 2720          *         body
 2721          *    -----------------
 2722          * tc:
 2723          *         cond
 2724          *    -----------------
 2725          *    [Op_jmp_true | z  ]
 2726          * tb:[Op_no_op         ]
 2727          */
 2728 
 2729         INSTRUCTION *ip, *tbreak, *tcont;
 2730 
 2731         tbreak = instruction(Op_no_op);
 2732         tcont = yyvsp[-2]->nexti;
 2733         add_lint(yyvsp[-2], LINT_assign_in_cond);
 2734         if (yyvsp[-5] != NULL)
 2735             ip = list_merge(yyvsp[-5], yyvsp[-2]);
 2736         else
 2737             ip = list_prepend(yyvsp[-2], instruction(Op_no_op));
 2738 
 2739         if (yyvsp[-6] != NULL)
 2740             (void) list_prepend(ip, yyvsp[-6]);
 2741 
 2742         if (do_pretty_print)
 2743             (void) list_prepend(ip, instruction(Op_exec_count));
 2744 
 2745         (void) list_append(ip, instruction(Op_jmp_true));
 2746         ip->lasti->target_jmp = ip->nexti;
 2747         yyval = list_append(ip, tbreak);
 2748 
 2749         break_allowed--;
 2750         continue_allowed--;
 2751         fix_break_continue(ip, tbreak, tcont);
 2752 
 2753         if (do_pretty_print) {
 2754             yyvsp[-7]->target_break = tbreak;
 2755             yyvsp[-7]->target_continue = tcont;
 2756             (yyvsp[-7] + 1)->doloop_cond = tcont;
 2757             yyval = list_prepend(ip, yyvsp[-7]);
 2758             bcfree(yyvsp[-4]);
 2759             if (yyvsp[0] != NULL)
 2760                 yyvsp[-7]->comment = yyvsp[0];
 2761         }
 2762         /* else
 2763             $1 and $4 are NULLs */
 2764       }
 2765 #line 2766 "awkgram.c"
 2766     break;
 2767 
 2768   case 54:
 2769 #line 854 "awkgram.y"
 2770           {
 2771         INSTRUCTION *ip;
 2772         char *var_name = yyvsp[-5]->lextok;
 2773 
 2774         if (yyvsp[0] != NULL
 2775                 && yyvsp[0]->lasti->opcode == Op_K_delete
 2776                 && yyvsp[0]->lasti->expr_count == 1
 2777                 && yyvsp[0]->nexti->opcode == Op_push
 2778                 && (yyvsp[0]->nexti->memory->type != Node_var || !(yyvsp[0]->nexti->memory->var_update))
 2779                 && strcmp(yyvsp[0]->nexti->memory->vname, var_name) == 0
 2780         ) {
 2781 
 2782         /*
 2783          * Efficiency hack.  Recognize the special case of
 2784          *
 2785          *  for (iggy in foo)
 2786          *      delete foo[iggy]
 2787          *
 2788          * and treat it as if it were
 2789          *
 2790          *  delete foo
 2791          *
 2792          * Check that the body is a `delete a[i]' statement,
 2793          * and that both the loop var and array names match.
 2794          */
 2795             NODE *arr = NULL;
 2796 
 2797             ip = yyvsp[0]->nexti->nexti;
 2798             if (yyvsp[-3]->nexti->opcode == Op_push && yyvsp[-3]->lasti == yyvsp[-3]->nexti)
 2799                 arr = yyvsp[-3]->nexti->memory;
 2800             if (arr != NULL
 2801                     && ip->opcode == Op_no_op
 2802                     && ip->nexti->opcode == Op_push_array
 2803                     && strcmp(ip->nexti->memory->vname, arr->vname) == 0
 2804                     && ip->nexti->nexti == yyvsp[0]->lasti
 2805             ) {
 2806                 (void) make_assignable(yyvsp[0]->nexti);
 2807                 yyvsp[0]->lasti->opcode = Op_K_delete_loop;
 2808                 yyvsp[0]->lasti->expr_count = 0;
 2809                 if (yyvsp[-7] != NULL)
 2810                     bcfree(yyvsp[-7]);
 2811                 efree(var_name);
 2812                 bcfree(yyvsp[-5]);
 2813                 bcfree(yyvsp[-4]);
 2814                 bcfree(yyvsp[-3]);
 2815                 if (yyvsp[-1] != NULL) {
 2816                     merge_comments(yyvsp[-1], NULL);
 2817                     yyvsp[0] = list_prepend(yyvsp[0], yyvsp[-1]);
 2818                 }
 2819                 yyval = yyvsp[0];
 2820             } else
 2821                 goto regular_loop;
 2822         } else {
 2823             INSTRUCTION *tbreak, *tcont;
 2824 
 2825             /*    [ Op_push_array a       ]
 2826              *    [ Op_arrayfor_init | ib ]
 2827              * ic:[ Op_arrayfor_incr | ib ]
 2828              *    [ Op_var_assign if any  ]
 2829              *
 2830              *              body
 2831              *
 2832              *    [Op_jmp | ic            ]
 2833              * ib:[Op_arrayfor_final      ]
 2834              */
 2835 regular_loop:
 2836             ip = yyvsp[-3];
 2837             ip->nexti->opcode = Op_push_array;
 2838 
 2839             tbreak = instruction(Op_arrayfor_final);
 2840             yyvsp[-4]->opcode = Op_arrayfor_incr;
 2841             yyvsp[-4]->array_var = variable(yyvsp[-5]->source_line, var_name, Node_var);
 2842             yyvsp[-4]->target_jmp = tbreak;
 2843             tcont = yyvsp[-4];
 2844             yyvsp[-5]->opcode = Op_arrayfor_init;
 2845             yyvsp[-5]->target_jmp = tbreak;
 2846             (void) list_append(ip, yyvsp[-5]);
 2847 
 2848             if (do_pretty_print) {
 2849                 yyvsp[-7]->opcode = Op_K_arrayfor;
 2850                 yyvsp[-7]->target_continue = tcont;
 2851                 yyvsp[-7]->target_break = tbreak;
 2852                 (void) list_append(ip, yyvsp[-7]);
 2853             }
 2854             /* else
 2855                 $1 is NULL */
 2856 
 2857             /* add update_FOO instruction if necessary */
 2858             if (yyvsp[-4]->array_var->type == Node_var && yyvsp[-4]->array_var->var_update) {
 2859                 (void) list_append(ip, instruction(Op_var_update));
 2860                 ip->lasti->update_var = yyvsp[-4]->array_var->var_update;
 2861             }
 2862             (void) list_append(ip, yyvsp[-4]);
 2863 
 2864             /* add set_FOO instruction if necessary */
 2865             if (yyvsp[-4]->array_var->type == Node_var && yyvsp[-4]->array_var->var_assign) {
 2866                 (void) list_append(ip, instruction(Op_var_assign));
 2867                 ip->lasti->assign_var = yyvsp[-4]->array_var->var_assign;
 2868             }
 2869 
 2870             if (do_pretty_print) {
 2871                 (void) list_append(ip, instruction(Op_exec_count));
 2872                 (yyvsp[-7] + 1)->forloop_cond = yyvsp[-4];
 2873                 (yyvsp[-7] + 1)->forloop_body = ip->lasti;
 2874             }
 2875 
 2876             if (yyvsp[-1] != NULL)
 2877                 merge_comments(yyvsp[-1], NULL);
 2878 
 2879             if (yyvsp[0] != NULL) {
 2880                 if (yyvsp[-1] != NULL)
 2881                     yyvsp[0] = list_prepend(yyvsp[0], yyvsp[-1]);
 2882                 (void) list_merge(ip, yyvsp[0]);
 2883             } else if (yyvsp[-1] != NULL)
 2884                 (void) list_append(ip, yyvsp[-1]);
 2885 
 2886             (void) list_append(ip, instruction(Op_jmp));
 2887             ip->lasti->target_jmp = yyvsp[-4];
 2888             yyval = list_append(ip, tbreak);
 2889             fix_break_continue(ip, tbreak, tcont);
 2890         }
 2891 
 2892         break_allowed--;
 2893         continue_allowed--;
 2894       }
 2895 #line 2896 "awkgram.c"
 2896     break;
 2897 
 2898   case 55:
 2899 #line 980 "awkgram.y"
 2900           {
 2901         if (yyvsp[-7] != NULL) {
 2902             merge_comments(yyvsp[-7], NULL);
 2903             yyvsp[-11]->comment = yyvsp[-7];
 2904         }
 2905         if (yyvsp[-4] != NULL) {
 2906             merge_comments(yyvsp[-4], NULL);
 2907             if (yyvsp[-11]->comment == NULL) {
 2908                 yyvsp[-4]->memory->comment_type = FOR_COMMENT;
 2909                 yyvsp[-11]->comment = yyvsp[-4];
 2910             } else
 2911                 yyvsp[-11]->comment->comment = yyvsp[-4];
 2912         }
 2913         if (yyvsp[-1] != NULL)
 2914             yyvsp[0] = list_prepend(yyvsp[0], yyvsp[-1]);
 2915         add_lint(yyvsp[-6], LINT_assign_in_cond);
 2916         yyval = mk_for_loop(yyvsp[-11], yyvsp[-9], yyvsp[-6], yyvsp[-3], yyvsp[0]);
 2917 
 2918         break_allowed--;
 2919         continue_allowed--;
 2920       }
 2921 #line 2922 "awkgram.c"
 2922     break;
 2923 
 2924   case 56:
 2925 #line 1002 "awkgram.y"
 2926           {
 2927         if (yyvsp[-6] != NULL) {
 2928             merge_comments(yyvsp[-6], NULL);
 2929             yyvsp[-10]->comment = yyvsp[-6];
 2930         }
 2931         if (yyvsp[-4] != NULL) {
 2932             merge_comments(yyvsp[-4], NULL);
 2933             if (yyvsp[-10]->comment == NULL) {
 2934                 yyvsp[-4]->memory->comment_type = FOR_COMMENT;
 2935                 yyvsp[-10]->comment = yyvsp[-4];
 2936             } else
 2937                 yyvsp[-10]->comment->comment = yyvsp[-4];
 2938         }
 2939         if (yyvsp[-1] != NULL)
 2940             yyvsp[0] = list_prepend(yyvsp[0], yyvsp[-1]);
 2941         yyval = mk_for_loop(yyvsp[-10], yyvsp[-8], (INSTRUCTION *) NULL, yyvsp[-3], yyvsp[0]);
 2942 
 2943         break_allowed--;
 2944         continue_allowed--;
 2945       }
 2946 #line 2947 "awkgram.c"
 2947     break;
 2948 
 2949   case 57:
 2950 #line 1023 "awkgram.y"
 2951           {
 2952         if (do_pretty_print)
 2953             yyval = list_prepend(yyvsp[0], instruction(Op_exec_count));
 2954         else
 2955             yyval = yyvsp[0];
 2956       }
 2957 #line 2958 "awkgram.c"
 2958     break;
 2959 
 2960   case 58:
 2961 #line 1033 "awkgram.y"
 2962           {
 2963         if (! break_allowed)
 2964             error_ln(yyvsp[-1]->source_line,
 2965                 _("`break' is not allowed outside a loop or switch"));
 2966         yyvsp[-1]->target_jmp = NULL;
 2967         yyval = list_create(yyvsp[-1]);
 2968         if (yyvsp[0] != NULL)
 2969             yyval = list_append(yyval, yyvsp[0]);
 2970       }
 2971 #line 2972 "awkgram.c"
 2972     break;
 2973 
 2974   case 59:
 2975 #line 1043 "awkgram.y"
 2976           {
 2977         if (! continue_allowed)
 2978             error_ln(yyvsp[-1]->source_line,
 2979                 _("`continue' is not allowed outside a loop"));
 2980         yyvsp[-1]->target_jmp = NULL;
 2981         yyval = list_create(yyvsp[-1]);
 2982         if (yyvsp[0] != NULL)
 2983             yyval = list_append(yyval, yyvsp[0]);
 2984       }
 2985 #line 2986 "awkgram.c"
 2986     break;
 2987 
 2988   case 60:
 2989 #line 1053 "awkgram.y"
 2990           {
 2991         /* if inside function (rule = 0), resolve context at run-time */
 2992         if (rule && rule != Rule)
 2993             error_ln(yyvsp[-1]->source_line,
 2994                 _("`next' used in %s action"), ruletab[rule]);
 2995         yyvsp[-1]->target_jmp = ip_rec;
 2996         yyval = list_create(yyvsp[-1]);
 2997         if (yyvsp[0] != NULL)
 2998             yyval = list_append(yyval, yyvsp[0]);
 2999       }
 3000 #line 3001 "awkgram.c"
 3001     break;
 3002 
 3003   case 61:
 3004 #line 1064 "awkgram.y"
 3005           {
 3006         /* if inside function (rule = 0), resolve context at run-time */
 3007         if (rule == BEGIN || rule == END || rule == ENDFILE)
 3008             error_ln(yyvsp[-1]->source_line,
 3009                 _("`nextfile' used in %s action"), ruletab[rule]);
 3010 
 3011         yyvsp[-1]->target_newfile = ip_newfile;
 3012         yyvsp[-1]->target_endfile = ip_endfile;
 3013         yyval = list_create(yyvsp[-1]);
 3014         if (yyvsp[0] != NULL)
 3015             yyval = list_append(yyval, yyvsp[0]);
 3016       }
 3017 #line 3018 "awkgram.c"
 3018     break;
 3019 
 3020   case 62:
 3021 #line 1077 "awkgram.y"
 3022           {
 3023         /* Initialize the two possible jump targets, the actual target
 3024          * is resolved at run-time.
 3025          */
 3026         yyvsp[-2]->target_end = ip_end; /* first instruction in end_block */
 3027         yyvsp[-2]->target_atexit = ip_atexit;   /* cleanup and go home */
 3028 
 3029         if (yyvsp[-1] == NULL) {
 3030             yyval = list_create(yyvsp[-2]);
 3031             (void) list_prepend(yyval, instruction(Op_push_i));
 3032             yyval->nexti->memory = dupnode(Nnull_string);
 3033         } else
 3034             yyval = list_append(yyvsp[-1], yyvsp[-2]);
 3035         if (yyvsp[0] != NULL)
 3036             yyval = list_append(yyval, yyvsp[0]);
 3037       }
 3038 #line 3039 "awkgram.c"
 3039     break;
 3040 
 3041   case 63:
 3042 #line 1094 "awkgram.y"
 3043           {
 3044         if (! in_function)
 3045             yyerror(_("`return' used outside function context"));
 3046       }
 3047 #line 3048 "awkgram.c"
 3048     break;
 3049 
 3050   case 64:
 3051 #line 1097 "awkgram.y"
 3052                                    {
 3053         if (called_from_eval)
 3054             yyvsp[-3]->opcode = Op_K_return_from_eval;
 3055 
 3056         if (yyvsp[-1] == NULL) {
 3057             yyval = list_create(yyvsp[-3]);
 3058             (void) list_prepend(yyval, instruction(Op_push_i));
 3059             yyval->nexti->memory = dupnode(Nnull_string);
 3060         } else
 3061             yyval = list_append(yyvsp[-1], yyvsp[-3]);
 3062         if (yyvsp[0] != NULL)
 3063             yyval = list_append(yyval, yyvsp[0]);
 3064       }
 3065 #line 3066 "awkgram.c"
 3066     break;
 3067 
 3068   case 65:
 3069 #line 1111 "awkgram.y"
 3070           {
 3071         if (yyvsp[0] != NULL)
 3072             yyval = list_append(yyvsp[-1], yyvsp[0]);
 3073         else
 3074             yyval = yyvsp[-1];
 3075       }
 3076 #line 3077 "awkgram.c"
 3077     break;
 3078 
 3079   case 66:
 3080 #line 1128 "awkgram.y"
 3081                 { in_print = true; in_parens = 0; }
 3082 #line 3083 "awkgram.c"
 3083     break;
 3084 
 3085   case 67:
 3086 #line 1129 "awkgram.y"
 3087           {
 3088         /*
 3089          * Optimization: plain `print' has no expression list, so $3 is null.
 3090          * If $3 is NULL or is a bytecode list for $0 use Op_K_print_rec,
 3091          * which is faster for these two cases.
 3092          */
 3093 
 3094         if (do_optimize && yyvsp[-3]->opcode == Op_K_print &&
 3095             (yyvsp[-1] == NULL
 3096                 || (yyvsp[-1]->lasti->opcode == Op_field_spec
 3097                     && yyvsp[-1]->nexti->nexti->nexti == yyvsp[-1]->lasti
 3098                     && yyvsp[-1]->nexti->nexti->opcode == Op_push_i
 3099                     && yyvsp[-1]->nexti->nexti->memory->type == Node_val)
 3100             )
 3101         ) {
 3102             static bool warned = false;
 3103             /*   -----------------
 3104              *      output_redir
 3105              *    [ redirect exp ]
 3106              *   -----------------
 3107              *     expression_list
 3108              *   ------------------
 3109              *    [Op_K_print_rec | NULL | redir_type | expr_count]
 3110              */
 3111 
 3112             if (yyvsp[-1] != NULL) {
 3113                 NODE *n = yyvsp[-1]->nexti->nexti->memory;
 3114 
 3115                 if (! iszero(n))
 3116                     goto regular_print;
 3117 
 3118                 bcfree(yyvsp[-1]->lasti);           /* Op_field_spec */
 3119                 unref(n);               /* Node_val */
 3120                 bcfree(yyvsp[-1]->nexti->nexti);        /* Op_push_i */
 3121                 bcfree(yyvsp[-1]->nexti);           /* Op_list */
 3122                 bcfree(yyvsp[-1]);              /* Op_list */
 3123             } else {
 3124                 if (do_lint && (rule == BEGIN || rule == END) && ! warned) {
 3125                     warned = true;
 3126                     lintwarn_ln(yyvsp[-3]->source_line,
 3127         _("plain `print' in BEGIN or END rule should probably be `print \"\"'"));
 3128                 }
 3129             }
 3130 
 3131             yyvsp[-3]->expr_count = 0;
 3132             yyvsp[-3]->opcode = Op_K_print_rec;
 3133             if (yyvsp[0] == NULL) {    /* no redircetion */
 3134                 yyvsp[-3]->redir_type = redirect_none;
 3135                 yyval = list_create(yyvsp[-3]);
 3136             } else {
 3137                 INSTRUCTION *ip;
 3138                 ip = yyvsp[0]->nexti;
 3139                 yyvsp[-3]->redir_type = ip->redir_type;
 3140                 yyvsp[0]->nexti = ip->nexti;
 3141                 bcfree(ip);
 3142                 yyval = list_append(yyvsp[0], yyvsp[-3]);
 3143             }
 3144         } else {
 3145             /*   -----------------
 3146              *    [ output_redir    ]
 3147              *    [ redirect exp    ]
 3148              *   -----------------
 3149              *    [ expression_list ]
 3150              *   ------------------
 3151              *    [$1 | NULL | redir_type | expr_count]
 3152              *
 3153              */
 3154 regular_print:
 3155             if (yyvsp[0] == NULL) {     /* no redirection */
 3156                 if (yyvsp[-1] == NULL)  {   /* print/printf without arg */
 3157                     yyvsp[-3]->expr_count = 0;
 3158                     if (yyvsp[-3]->opcode == Op_K_print)
 3159                         yyvsp[-3]->opcode = Op_K_print_rec;
 3160                     yyvsp[-3]->redir_type = redirect_none;
 3161                     yyval = list_create(yyvsp[-3]);
 3162                 } else {
 3163                     INSTRUCTION *t = yyvsp[-1];
 3164                     yyvsp[-3]->expr_count = count_expressions(&t, false);
 3165                     yyvsp[-3]->redir_type = redirect_none;
 3166                     yyval = list_append(t, yyvsp[-3]);
 3167                 }
 3168             } else {
 3169                 INSTRUCTION *ip;
 3170                 ip = yyvsp[0]->nexti;
 3171                 yyvsp[-3]->redir_type = ip->redir_type;
 3172                 yyvsp[0]->nexti = ip->nexti;
 3173                 bcfree(ip);
 3174                 if (yyvsp[-1] == NULL) {
 3175                     yyvsp[-3]->expr_count = 0;
 3176                     if (yyvsp[-3]->opcode == Op_K_print)
 3177                         yyvsp[-3]->opcode = Op_K_print_rec;
 3178                     yyval = list_append(yyvsp[0], yyvsp[-3]);
 3179                 } else {
 3180                     INSTRUCTION *t = yyvsp[-1];
 3181                     yyvsp[-3]->expr_count = count_expressions(&t, false);
 3182                     yyval = list_append(list_merge(yyvsp[0], t), yyvsp[-3]);
 3183                 }
 3184             }
 3185         }
 3186       }
 3187 #line 3188 "awkgram.c"
 3188     break;
 3189 
 3190   case 68:
 3191 #line 1230 "awkgram.y"
 3192                           { sub_counter = 0; }
 3193 #line 3194 "awkgram.c"
 3194     break;
 3195 
 3196   case 69:
 3197 #line 1231 "awkgram.y"
 3198           {
 3199         char *arr = yyvsp[-2]->lextok;
 3200 
 3201         yyvsp[-2]->opcode = Op_push_array;
 3202         yyvsp[-2]->memory = variable(yyvsp[-2]->source_line, arr, Node_var_new);
 3203 
 3204         if (! do_posix && ! do_traditional) {
 3205             if (yyvsp[-2]->memory == symbol_table)
 3206                 fatal(_("`delete' is not allowed with SYMTAB"));
 3207             else if (yyvsp[-2]->memory == func_table)
 3208                 fatal(_("`delete' is not allowed with FUNCTAB"));
 3209         }
 3210 
 3211         if (yyvsp[0] == NULL) {
 3212             /*
 3213              * As of September 2012, POSIX has added support
 3214              * for `delete array'. See:
 3215              * http://austingroupbugs.net/view.php?id=544
 3216              *
 3217              * Thanks to Nathan Weeks for the initiative.
 3218              *
 3219              * Thus we no longer warn or check do_posix.
 3220              * Also, since BWK awk supports it, we don't have to
 3221              * check do_traditional either.
 3222              */
 3223             yyvsp[-3]->expr_count = 0;
 3224             yyval = list_append(list_create(yyvsp[-2]), yyvsp[-3]);
 3225         } else {
 3226             yyvsp[-3]->expr_count = sub_counter;
 3227             yyval = list_append(list_append(yyvsp[0], yyvsp[-2]), yyvsp[-3]);
 3228         }
 3229       }
 3230 #line 3231 "awkgram.c"
 3231     break;
 3232 
 3233   case 70:
 3234 #line 1268 "awkgram.y"
 3235           {
 3236         static bool warned = false;
 3237         char *arr = yyvsp[-1]->lextok;
 3238 
 3239         if (do_lint && ! warned) {
 3240             warned = true;
 3241             lintwarn_ln(yyvsp[-3]->source_line,
 3242                 _("`delete(array)' is a non-portable tawk extension"));
 3243         }
 3244         if (do_traditional) {
 3245             error_ln(yyvsp[-3]->source_line,
 3246                 _("`delete(array)' is a non-portable tawk extension"));
 3247         }
 3248         yyvsp[-1]->memory = variable(yyvsp[-1]->source_line, arr, Node_var_new);
 3249         yyvsp[-1]->opcode = Op_push_array;
 3250         yyvsp[-3]->expr_count = 0;
 3251         yyval = list_append(list_create(yyvsp[-1]), yyvsp[-3]);
 3252 
 3253         if (! do_posix && ! do_traditional) {
 3254             if (yyvsp[-1]->memory == symbol_table)
 3255                 fatal(_("`delete' is not allowed with SYMTAB"));
 3256             else if (yyvsp[-1]->memory == func_table)
 3257                 fatal(_("`delete' is not allowed with FUNCTAB"));
 3258         }
 3259       }
 3260 #line 3261 "awkgram.c"
 3261     break;
 3262 
 3263   case 71:
 3264 #line 1294 "awkgram.y"
 3265           {
 3266         yyval = optimize_assignment(yyvsp[0]);
 3267       }
 3268 #line 3269 "awkgram.c"
 3269     break;
 3270 
 3271   case 72:
 3272 #line 1301 "awkgram.y"
 3273           { yyval = NULL; }
 3274 #line 3275 "awkgram.c"
 3275     break;
 3276 
 3277   case 73:
 3278 #line 1303 "awkgram.y"
 3279           { yyval = yyvsp[0]; }
 3280 #line 3281 "awkgram.c"
 3281     break;
 3282 
 3283   case 74:
 3284 #line 1308 "awkgram.y"
 3285           { yyval = NULL; }
 3286 #line 3287 "awkgram.c"
 3287     break;
 3288 
 3289   case 75:
 3290 #line 1310 "awkgram.y"
 3291           {
 3292         if (yyvsp[-1] == NULL)
 3293             yyval = list_create(yyvsp[0]);
 3294         else
 3295             yyval = list_prepend(yyvsp[-1], yyvsp[0]);
 3296       }
 3297 #line 3298 "awkgram.c"
 3298     break;
 3299 
 3300   case 76:
 3301 #line 1317 "awkgram.y"
 3302           { yyval = NULL; }
 3303 #line 3304 "awkgram.c"
 3304     break;
 3305 
 3306   case 77:
 3307 #line 1322 "awkgram.y"
 3308           {
 3309         INSTRUCTION *casestmt = yyvsp[0];
 3310         if (yyvsp[0] == NULL)
 3311             casestmt = list_create(instruction(Op_no_op));
 3312         if (do_pretty_print)
 3313             (void) list_prepend(casestmt, instruction(Op_exec_count));
 3314         yyvsp[-4]->case_exp = yyvsp[-3];
 3315         yyvsp[-4]->case_stmt = casestmt;
 3316         yyvsp[-4]->comment = yyvsp[-1];
 3317         bcfree(yyvsp[-2]);
 3318         yyval = yyvsp[-4];
 3319       }
 3320 #line 3321 "awkgram.c"
 3321     break;
 3322 
 3323   case 78:
 3324 #line 1335 "awkgram.y"
 3325           {
 3326         INSTRUCTION *casestmt = yyvsp[0];
 3327         if (yyvsp[0] == NULL)
 3328             casestmt = list_create(instruction(Op_no_op));
 3329         if (do_pretty_print)
 3330             (void) list_prepend(casestmt, instruction(Op_exec_count));
 3331         bcfree(yyvsp[-2]);
 3332         yyvsp[-3]->case_stmt = casestmt;
 3333         yyvsp[-3]->comment = yyvsp[-1];
 3334         yyval = yyvsp[-3];
 3335       }
 3336 #line 3337 "awkgram.c"
 3337     break;
 3338 
 3339   case 79:
 3340 #line 1350 "awkgram.y"
 3341           { yyval = yyvsp[0]; }
 3342 #line 3343 "awkgram.c"
 3343     break;
 3344 
 3345   case 80:
 3346 #line 1352 "awkgram.y"
 3347           {
 3348         NODE *n = yyvsp[0]->memory;
 3349         (void) force_number(n);
 3350         negate_num(n);
 3351         bcfree(yyvsp[-1]);
 3352         yyval = yyvsp[0];
 3353       }
 3354 #line 3355 "awkgram.c"
 3355     break;
 3356 
 3357   case 81:
 3358 #line 1360 "awkgram.y"
 3359           {
 3360         NODE *n = yyvsp[0]->lasti->memory;
 3361         bcfree(yyvsp[-1]);
 3362         add_sign_to_num(n, '+');
 3363         yyval = yyvsp[0];
 3364       }
 3365 #line 3366 "awkgram.c"
 3366     break;
 3367 
 3368   case 82:
 3369 #line 1367 "awkgram.y"
 3370           { yyval = yyvsp[0]; }
 3371 #line 3372 "awkgram.c"
 3372     break;
 3373 
 3374   case 83:
 3375 #line 1369 "awkgram.y"
 3376           {
 3377         if (yyvsp[0]->memory->type == Node_regex)
 3378             yyvsp[0]->opcode = Op_push_re;
 3379         else
 3380             yyvsp[0]->opcode = Op_push;
 3381         yyval = yyvsp[0];
 3382       }
 3383 #line 3384 "awkgram.c"
 3384     break;
 3385 
 3386   case 84:
 3387 #line 1377 "awkgram.y"
 3388           {
 3389         assert((yyvsp[0]->memory->flags & REGEX) == REGEX);
 3390         yyvsp[0]->opcode = Op_push_re;
 3391         yyval = yyvsp[0];
 3392       }
 3393 #line 3394 "awkgram.c"
 3394     break;
 3395 
 3396   case 85:
 3397 #line 1386 "awkgram.y"
 3398           { yyval = yyvsp[0]; }
 3399 #line 3400 "awkgram.c"
 3400     break;
 3401 
 3402   case 86:
 3403 #line 1388 "awkgram.y"
 3404           { yyval = yyvsp[0]; }
 3405 #line 3406 "awkgram.c"
 3406     break;
 3407 
 3408   case 88:
 3409 #line 1398 "awkgram.y"
 3410           {
 3411         yyval = yyvsp[-1];
 3412       }
 3413 #line 3414 "awkgram.c"
 3414     break;
 3415 
 3416   case 89:
 3417 #line 1405 "awkgram.y"
 3418           {
 3419         in_print = false;
 3420         in_parens = 0;
 3421         yyval = NULL;
 3422       }
 3423 #line 3424 "awkgram.c"
 3424     break;
 3425 
 3426   case 90:
 3427 #line 1410 "awkgram.y"
 3428                  { in_print = false; in_parens = 0; }
 3429 #line 3430 "awkgram.c"
 3430     break;
 3431 
 3432   case 91:
 3433 #line 1411 "awkgram.y"
 3434           {
 3435         if (yyvsp[-2]->redir_type == redirect_twoway
 3436                 && yyvsp[0]->lasti->opcode == Op_K_getline_redir
 3437                 && yyvsp[0]->lasti->redir_type == redirect_twoway)
 3438             yyerror(_("multistage two-way pipelines don't work"));
 3439         if (do_lint && yyvsp[-2]->redir_type == redirect_output && yyvsp[0]->lasti->opcode == Op_concat)
 3440             lintwarn(_("concatenation as I/O `>' redirection target is ambiguous"));
 3441         yyval = list_prepend(yyvsp[0], yyvsp[-2]);
 3442       }
 3443 #line 3444 "awkgram.c"
 3444     break;
 3445 
 3446   case 92:
 3447 #line 1424 "awkgram.y"
 3448           {
 3449         if (yyvsp[-1] != NULL)
 3450             yyvsp[-5]->comment = yyvsp[-1];
 3451         add_lint(yyvsp[-3], LINT_assign_in_cond);
 3452         yyval = mk_condition(yyvsp[-3], yyvsp[-5], yyvsp[0], NULL, NULL);
 3453       }
 3454 #line 3455 "awkgram.c"
 3455     break;
 3456 
 3457   case 93:
 3458 #line 1432 "awkgram.y"
 3459           {
 3460         if (yyvsp[-4] != NULL)
 3461             yyvsp[-8]->comment = yyvsp[-4];
 3462         if (yyvsp[-1] != NULL)
 3463             yyvsp[-2]->comment = yyvsp[-1];
 3464         add_lint(yyvsp[-6], LINT_assign_in_cond);
 3465         yyval = mk_condition(yyvsp[-6], yyvsp[-8], yyvsp[-3], yyvsp[-2], yyvsp[0]);
 3466       }
 3467 #line 3468 "awkgram.c"
 3468     break;
 3469 
 3470   case 94:
 3471 #line 1444 "awkgram.y"
 3472           {
 3473         yyval = yyvsp[0];
 3474       }
 3475 #line 3476 "awkgram.c"
 3476     break;
 3477 
 3478   case 95:
 3479 #line 1448 "awkgram.y"
 3480           {
 3481         if (yyvsp[-1] != NULL && yyvsp[0] != NULL) {
 3482             if (yyvsp[-1]->memory->comment_type == EOL_COMMENT) {
 3483                 assert(yyvsp[0]->memory->comment_type == BLOCK_COMMENT);
 3484                 yyvsp[-1]->comment = yyvsp[0];  // chain them
 3485             } else {
 3486                 merge_comments(yyvsp[-1], yyvsp[0]);
 3487             }
 3488 
 3489             yyval = yyvsp[-1];
 3490         } else if (yyvsp[-1] != NULL) {
 3491             yyval = yyvsp[-1];
 3492         } else if (yyvsp[0] != NULL) {
 3493             yyval = yyvsp[0];
 3494         } else
 3495             yyval = NULL;
 3496       }
 3497 #line 3498 "awkgram.c"
 3498     break;
 3499 
 3500   case 96:
 3501 #line 1469 "awkgram.y"
 3502           { yyval = NULL; }
 3503 #line 3504 "awkgram.c"
 3504     break;
 3505 
 3506   case 97:
 3507 #line 1471 "awkgram.y"
 3508           { yyval = yyvsp[0]; }
 3509 #line 3510 "awkgram.c"
 3510     break;
 3511 
 3512   case 98:
 3513 #line 1476 "awkgram.y"
 3514           { yyval = NULL; }
 3515 #line 3516 "awkgram.c"
 3516     break;
 3517 
 3518   case 99:
 3519 #line 1478 "awkgram.y"
 3520           {
 3521         bcfree(yyvsp[-1]);
 3522         yyval = yyvsp[0];
 3523       }
 3524 #line 3525 "awkgram.c"
 3525     break;
 3526 
 3527   case 100:
 3528 #line 1486 "awkgram.y"
 3529           { yyval = NULL; }
 3530 #line 3531 "awkgram.c"
 3531     break;
 3532 
 3533   case 101:
 3534 #line 1488 "awkgram.y"
 3535           { yyval = yyvsp[0]; }
 3536 #line 3537 "awkgram.c"
 3537     break;
 3538 
 3539   case 102:
 3540 #line 1493 "awkgram.y"
 3541           {
 3542         yyvsp[0]->param_count = 0;
 3543         yyval = list_create(yyvsp[0]);
 3544       }
 3545 #line 3546 "awkgram.c"
 3546     break;
 3547 
 3548   case 103:
 3549 #line 1498 "awkgram.y"
 3550           {
 3551         if (yyvsp[-2] != NULL && yyvsp[0] != NULL) {
 3552             yyvsp[0]->param_count = yyvsp[-2]->lasti->param_count + 1;
 3553             yyval = list_append(yyvsp[-2], yyvsp[0]);
 3554             yyerrok;
 3555 
 3556             // newlines are allowed after commas, catch any comments
 3557             if (yyvsp[-1] != NULL) {
 3558                 if (yyvsp[-2]->comment != NULL)
 3559                     merge_comments(yyvsp[-2]->comment, yyvsp[-1]);
 3560                 else
 3561                     yyvsp[-2]->comment = yyvsp[-1];
 3562             }
 3563         } else
 3564             yyval = NULL;
 3565       }
 3566 #line 3567 "awkgram.c"
 3567     break;
 3568 
 3569   case 104:
 3570 #line 1515 "awkgram.y"
 3571           { yyval = NULL; }
 3572 #line 3573 "awkgram.c"
 3573     break;
 3574 
 3575   case 105:
 3576 #line 1517 "awkgram.y"
 3577           { yyval = yyvsp[-1]; }
 3578 #line 3579 "awkgram.c"
 3579     break;
 3580 
 3581   case 106:
 3582 #line 1519 "awkgram.y"
 3583           { yyval = yyvsp[-2]; }
 3584 #line 3585 "awkgram.c"
 3585     break;
 3586 
 3587   case 107:
 3588 #line 1525 "awkgram.y"
 3589           { yyval = NULL; }
 3590 #line 3591 "awkgram.c"
 3591     break;
 3592 
 3593   case 108:
 3594 #line 1527 "awkgram.y"
 3595           { yyval = yyvsp[0]; }
 3596 #line 3597 "awkgram.c"
 3597     break;
 3598 
 3599   case 109:
 3600 #line 1532 "awkgram.y"
 3601           { yyval = NULL; }
 3602 #line 3603 "awkgram.c"
 3603     break;
 3604 
 3605   case 110:
 3606 #line 1534 "awkgram.y"
 3607           { yyval = yyvsp[0]; }
 3608 #line 3609 "awkgram.c"
 3609     break;
 3610 
 3611   case 111:
 3612 #line 1539 "awkgram.y"
 3613           { yyval = mk_expression_list(NULL, yyvsp[0]); }
 3614 #line 3615 "awkgram.c"
 3615     break;
 3616 
 3617   case 112:
 3618 #line 1541 "awkgram.y"
 3619           {
 3620         if (yyvsp[-1] != NULL)
 3621             yyvsp[-2]->lasti->comment = yyvsp[-1];
 3622         yyval = mk_expression_list(yyvsp[-2], yyvsp[0]);
 3623         yyerrok;
 3624       }
 3625 #line 3626 "awkgram.c"
 3626     break;
 3627 
 3628   case 113:
 3629 #line 1548 "awkgram.y"
 3630           { yyval = NULL; }
 3631 #line 3632 "awkgram.c"
 3632     break;
 3633 
 3634   case 114:
 3635 #line 1550 "awkgram.y"
 3636           {
 3637         /*
 3638          * Returning the expression list instead of NULL lets
 3639          * snode get a list of arguments that it can count.
 3640          */
 3641         yyval = yyvsp[-1];
 3642       }
 3643 #line 3644 "awkgram.c"
 3644     break;
 3645 
 3646   case 115:
 3647 #line 1558 "awkgram.y"
 3648           {
 3649         /* Ditto */
 3650         yyval = mk_expression_list(yyvsp[-2], yyvsp[0]);
 3651       }
 3652 #line 3653 "awkgram.c"
 3653     break;
 3654 
 3655   case 116:
 3656 #line 1563 "awkgram.y"
 3657           {
 3658         /* Ditto */
 3659         if (yyvsp[-1] != NULL)
 3660             yyvsp[-2]->lasti->comment = yyvsp[-1];
 3661         yyval = yyvsp[-2];
 3662       }
 3663 #line 3664 "awkgram.c"
 3664     break;
 3665 
 3666   case 117:
 3667 #line 1573 "awkgram.y"
 3668           { yyval = NULL; }
 3669 #line 3670 "awkgram.c"
 3670     break;
 3671 
 3672   case 118:
 3673 #line 1575 "awkgram.y"
 3674           { yyval = yyvsp[0]; }
 3675 #line 3676 "awkgram.c"
 3676     break;
 3677 
 3678   case 119:
 3679 #line 1580 "awkgram.y"
 3680           { yyval = mk_expression_list(NULL, yyvsp[0]); }
 3681 #line 3682 "awkgram.c"
 3682     break;
 3683 
 3684   case 120:
 3685 #line 1582 "awkgram.y"
 3686           {
 3687         if (yyvsp[-1] != NULL)
 3688             yyvsp[-2]->lasti->comment = yyvsp[-1];
 3689         yyval = mk_expression_list(yyvsp[-2], yyvsp[0]);
 3690         yyerrok;
 3691       }
 3692 #line 3693 "awkgram.c"
 3693     break;
 3694 
 3695   case 121:
 3696 #line 1589 "awkgram.y"
 3697           { yyval = NULL; }
 3698 #line 3699 "awkgram.c"
 3699     break;
 3700 
 3701   case 122:
 3702 #line 1591 "awkgram.y"
 3703           {
 3704         /*
 3705          * Returning the expression list instead of NULL lets
 3706          * snode get a list of arguments that it can count.
 3707          */
 3708         yyval = yyvsp[-1];
 3709       }
 3710 #line 3711 "awkgram.c"
 3711     break;
 3712 
 3713   case 123:
 3714 #line 1599 "awkgram.y"
 3715           {
 3716         /* Ditto */
 3717         yyval = mk_expression_list(yyvsp[-2], yyvsp[0]);
 3718       }
 3719 #line 3720 "awkgram.c"
 3720     break;
 3721 
 3722   case 124:
 3723 #line 1604 "awkgram.y"
 3724           {
 3725         /* Ditto */
 3726         if (yyvsp[-1] != NULL)
 3727             yyvsp[-2]->comment = yyvsp[-1];
 3728         yyval = yyvsp[-2];
 3729       }
 3730 #line 3731 "awkgram.c"
 3731     break;
 3732 
 3733   case 125:
 3734 #line 1613 "awkgram.y"
 3735               { yyval = yyvsp[0]; }
 3736 #line 3737 "awkgram.c"
 3737     break;
 3738 
 3739   case 126:
 3740 #line 1614 "awkgram.y"
 3741                        { yyval = list_create(yyvsp[0]); }
 3742 #line 3743 "awkgram.c"
 3743     break;
 3744 
 3745   case 127:
 3746 #line 1620 "awkgram.y"
 3747           {
 3748         if (do_lint && yyvsp[0]->lasti->opcode == Op_match_rec)
 3749             lintwarn_ln(yyvsp[-1]->source_line,
 3750                 _("regular expression on right of assignment"));
 3751         yyval = mk_assignment(yyvsp[-2], yyvsp[0], yyvsp[-1]);
 3752       }
 3753 #line 3754 "awkgram.c"
 3754     break;
 3755 
 3756   case 128:
 3757 #line 1627 "awkgram.y"
 3758           {
 3759         yyval = mk_assignment(yyvsp[-2], list_create(yyvsp[0]), yyvsp[-1]);
 3760       }
 3761 #line 3762 "awkgram.c"
 3762     break;
 3763 
 3764   case 129:
 3765 #line 1631 "awkgram.y"
 3766           { yyval = mk_boolean(yyvsp[-2], yyvsp[0], yyvsp[-1]); }
 3767 #line 3768 "awkgram.c"
 3768     break;
 3769 
 3770   case 130:
 3771 #line 1633 "awkgram.y"
 3772           { yyval = mk_boolean(yyvsp[-2], yyvsp[0], yyvsp[-1]); }
 3773 #line 3774 "awkgram.c"
 3774     break;
 3775 
 3776   case 131:
 3777 #line 1635 "awkgram.y"
 3778           {
 3779         if (yyvsp[-2]->lasti->opcode == Op_match_rec)
 3780             warning_ln(yyvsp[-1]->source_line,
 3781                 _("regular expression on left of `~' or `!~' operator"));
 3782 
 3783         assert(yyvsp[0]->opcode == Op_push_re
 3784             && (yyvsp[0]->memory->flags & REGEX) != 0);
 3785         /* RHS is @/.../ */
 3786         yyvsp[-1]->memory = yyvsp[0]->memory;
 3787         bcfree(yyvsp[0]);
 3788         yyval = list_append(yyvsp[-2], yyvsp[-1]);
 3789       }
 3790 #line 3791 "awkgram.c"
 3791     break;
 3792 
 3793   case 132:
 3794 #line 1648 "awkgram.y"
 3795           {
 3796         if (yyvsp[-2]->lasti->opcode == Op_match_rec)
 3797             warning_ln(yyvsp[-1]->source_line,
 3798                 _("regular expression on left of `~' or `!~' operator"));
 3799 
 3800         if (yyvsp[0]->lasti == yyvsp[0]->nexti && yyvsp[0]->nexti->opcode == Op_match_rec) {
 3801             /* RHS is /.../ */
 3802             yyvsp[-1]->memory = yyvsp[0]->nexti->memory;
 3803             bcfree(yyvsp[0]->nexti);    /* Op_match_rec */
 3804             bcfree(yyvsp[0]);           /* Op_list */
 3805             yyval = list_append(yyvsp[-2], yyvsp[-1]);
 3806         } else {
 3807             yyvsp[-1]->memory = make_regnode(Node_dynregex, NULL);
 3808             yyval = list_append(list_merge(yyvsp[-2], yyvsp[0]), yyvsp[-1]);
 3809         }
 3810       }
 3811 #line 3812 "awkgram.c"
 3812     break;
 3813 
 3814   case 133:
 3815 #line 1665 "awkgram.y"
 3816           {
 3817         if (do_lint_old)
 3818             lintwarn_ln(yyvsp[-1]->source_line,
 3819                 _("old awk does not support the keyword `in' except after `for'"));
 3820         yyvsp[0]->nexti->opcode = Op_push_array;
 3821         yyvsp[-1]->opcode = Op_in_array;
 3822         yyvsp[-1]->expr_count = 1;
 3823         yyval = list_append(list_merge(yyvsp[-2], yyvsp[0]), yyvsp[-1]);
 3824       }
 3825 #line 3826 "awkgram.c"
 3826     break;
 3827 
 3828   case 134:
 3829 #line 1675 "awkgram.y"
 3830           {
 3831         if (do_lint && yyvsp[0]->lasti->opcode == Op_match_rec)
 3832             lintwarn_ln(yyvsp[-1]->source_line,
 3833                 _("regular expression on right of comparison"));
 3834         yyval = list_append(list_merge(yyvsp[-2], yyvsp[0]), yyvsp[-1]);
 3835       }
 3836 #line 3837 "awkgram.c"
 3837     break;
 3838 
 3839   case 135:
 3840 #line 1682 "awkgram.y"
 3841           { yyval = mk_condition(yyvsp[-4], yyvsp[-3], yyvsp[-2], yyvsp[-1], yyvsp[0]); }
 3842 #line 3843 "awkgram.c"
 3843     break;
 3844 
 3845   case 136:
 3846 #line 1684 "awkgram.y"
 3847           { yyval = yyvsp[0]; }
 3848 #line 3849 "awkgram.c"
 3849     break;
 3850 
 3851   case 137:
 3852 #line 1689 "awkgram.y"
 3853           { yyval = yyvsp[0]; }
 3854 #line 3855 "awkgram.c"
 3855     break;
 3856 
 3857   case 138:
 3858 #line 1691 "awkgram.y"
 3859           { yyval = yyvsp[0]; }
 3860 #line 3861 "awkgram.c"
 3861     break;
 3862 
 3863   case 139:
 3864 #line 1693 "awkgram.y"
 3865           {
 3866         yyvsp[0]->opcode = Op_assign_quotient;
 3867         yyval = yyvsp[0];
 3868       }
 3869 #line 3870 "awkgram.c"
 3870     break;
 3871 
 3872   case 140:
 3873 #line 1701 "awkgram.y"
 3874           { yyval = yyvsp[0]; }
 3875 #line 3876 "awkgram.c"
 3876     break;
 3877 
 3878   case 141:
 3879 #line 1703 "awkgram.y"
 3880           { yyval = yyvsp[0]; }
 3881 #line 3882 "awkgram.c"
 3882     break;
 3883 
 3884   case 142:
 3885 #line 1708 "awkgram.y"
 3886           { yyval = yyvsp[0]; }
 3887 #line 3888 "awkgram.c"
 3888     break;
 3889 
 3890   case 143:
 3891 #line 1710 "awkgram.y"
 3892           { yyval = yyvsp[0]; }
 3893 #line 3894 "awkgram.c"
 3894     break;
 3895 
 3896   case 144:
 3897 #line 1715 "awkgram.y"
 3898           { yyval = yyvsp[0]; }
 3899 #line 3900 "awkgram.c"
 3900     break;
 3901 
 3902   case 145:
 3903 #line 1717 "awkgram.y"
 3904           { yyval = yyvsp[0]; }
 3905 #line 3906 "awkgram.c"
 3906     break;
 3907 
 3908   case 146:
 3909 #line 1719 "awkgram.y"
 3910           {
 3911         int count = 2;
 3912         bool is_simple_var = false;
 3913 
 3914         if (yyvsp[-1]->lasti->opcode == Op_concat) {
 3915             /* multiple (> 2) adjacent strings optimization */
 3916             is_simple_var = (yyvsp[-1]->lasti->concat_flag & CSVAR) != 0;
 3917             count = yyvsp[-1]->lasti->expr_count + 1;
 3918             yyvsp[-1]->lasti->opcode = Op_no_op;
 3919         } else {
 3920             is_simple_var = (yyvsp[-1]->nexti->opcode == Op_push
 3921                     && yyvsp[-1]->lasti == yyvsp[-1]->nexti); /* first exp. is a simple
 3922                                                  * variable?; kludge for use
 3923                                                  * in Op_assign_concat.
 3924                                                  */
 3925         }
 3926 
 3927         if (do_optimize
 3928             && yyvsp[-1]->nexti == yyvsp[-1]->lasti && yyvsp[-1]->nexti->opcode == Op_push_i
 3929             && yyvsp[0]->nexti == yyvsp[0]->lasti && yyvsp[0]->nexti->opcode == Op_push_i
 3930         ) {
 3931             NODE *n1 = yyvsp[-1]->nexti->memory;
 3932             NODE *n2 = yyvsp[0]->nexti->memory;
 3933             size_t nlen;
 3934 
 3935             // 1.5 ""   # can't fold this if program mucks with CONVFMT.
 3936             // See test #12 in test/posix.awk.
 3937             // Also can't fold if one or the other is translatable.
 3938             if ((n1->flags & (NUMBER|NUMINT|INTLSTR)) != 0 || (n2->flags & (NUMBER|NUMINT|INTLSTR)) != 0)
 3939                 goto plain_concat;
 3940 
 3941             n1 = force_string(n1);
 3942             n2 = force_string(n2);
 3943             nlen = n1->stlen + n2->stlen;
 3944             erealloc(n1->stptr, char *, nlen + 1, "constant fold");
 3945             memcpy(n1->stptr + n1->stlen, n2->stptr, n2->stlen);
 3946             n1->stlen = nlen;
 3947             n1->stptr[nlen] = '\0';
 3948             n1->flags &= ~(NUMCUR|NUMBER|NUMINT);
 3949             n1->flags |= (STRING|STRCUR);
 3950             unref(n2);
 3951             bcfree(yyvsp[0]->nexti);
 3952             bcfree(yyvsp[0]);
 3953             yyval = yyvsp[-1];
 3954         } else {
 3955     plain_concat:
 3956             yyval = list_append(list_merge(yyvsp[-1], yyvsp[0]), instruction(Op_concat));
 3957             yyval->lasti->concat_flag = (is_simple_var ? CSVAR : 0);
 3958             yyval->lasti->expr_count = count;
 3959             if (count > max_args)
 3960                 max_args = count;
 3961         }
 3962       }
 3963 #line 3964 "awkgram.c"
 3964     break;
 3965 
 3966   case 148:
 3967 #line 1778 "awkgram.y"
 3968           { yyval = mk_binary(yyvsp[-2], yyvsp[0], yyvsp[-1]); }
 3969 #line 3970 "awkgram.c"
 3970     break;
 3971 
 3972   case 149:
 3973 #line 1780 "awkgram.y"
 3974           { yyval = mk_binary(yyvsp[-2], yyvsp[0], yyvsp[-1]); }
 3975 #line 3976 "awkgram.c"
 3976     break;
 3977 
 3978   case 150:
 3979 #line 1782 "awkgram.y"
 3980           { yyval = mk_binary(yyvsp[-2], yyvsp[0], yyvsp[-1]); }
 3981 #line 3982 "awkgram.c"
 3982     break;
 3983 
 3984   case 151:
 3985 #line 1784 "awkgram.y"
 3986           { yyval = mk_binary(yyvsp[-2], yyvsp[0], yyvsp[-1]); }
 3987 #line 3988 "awkgram.c"
 3988     break;
 3989 
 3990   case 152:
 3991 #line 1786 "awkgram.y"
 3992           { yyval = mk_binary(yyvsp[-2], yyvsp[0], yyvsp[-1]); }
 3993 #line 3994 "awkgram.c"
 3994     break;
 3995 
 3996   case 153:
 3997 #line 1788 "awkgram.y"
 3998           { yyval = mk_binary(yyvsp[-2], yyvsp[0], yyvsp[-1]); }
 3999 #line 4000 "awkgram.c"
 4000     break;
 4001 
 4002   case 154:
 4003 #line 1790 "awkgram.y"
 4004           {
 4005         /*
 4006          * In BEGINFILE/ENDFILE, allow `getline [var] < file'
 4007          */
 4008 
 4009         if ((rule == BEGINFILE || rule == ENDFILE) && yyvsp[0] == NULL)
 4010             error_ln(yyvsp[-2]->source_line,
 4011                  _("non-redirected `getline' invalid inside `%s' rule"), ruletab[rule]);
 4012         if (do_lint && rule == END && yyvsp[0] == NULL)
 4013             lintwarn_ln(yyvsp[-2]->source_line,
 4014                 _("non-redirected `getline' undefined inside END action"));
 4015         yyval = mk_getline(yyvsp[-2], yyvsp[-1], yyvsp[0], redirect_input);
 4016       }
 4017 #line 4018 "awkgram.c"
 4018     break;
 4019 
 4020   case 155:
 4021 #line 1804 "awkgram.y"
 4022           {
 4023         yyvsp[0]->opcode = Op_postincrement;
 4024         yyval = mk_assignment(yyvsp[-1], NULL, yyvsp[0]);
 4025       }
 4026 #line 4027 "awkgram.c"
 4027     break;
 4028 
 4029   case 156:
 4030 #line 1809 "awkgram.y"
 4031           {
 4032         yyvsp[0]->opcode = Op_postdecrement;
 4033         yyval = mk_assignment(yyvsp[-1], NULL, yyvsp[0]);
 4034       }
 4035 #line 4036 "awkgram.c"
 4036     break;
 4037 
 4038   case 157:
 4039 #line 1814 "awkgram.y"
 4040           {
 4041         if (do_lint_old) {
 4042             /* first one is warning so that second one comes out if warnings are fatal */
 4043             warning_ln(yyvsp[-1]->source_line,
 4044                 _("old awk does not support the keyword `in' except after `for'"));
 4045             lintwarn_ln(yyvsp[-1]->source_line,
 4046                 _("old awk does not support multidimensional arrays"));
 4047         }
 4048         yyvsp[0]->nexti->opcode = Op_push_array;
 4049         yyvsp[-1]->opcode = Op_in_array;
 4050         if (yyvsp[-3] == NULL) {    /* error */
 4051             errcount++;
 4052             yyvsp[-1]->expr_count = 0;
 4053             yyval = list_merge(yyvsp[0], yyvsp[-1]);
 4054         } else {
 4055             INSTRUCTION *t = yyvsp[-3];
 4056             yyvsp[-1]->expr_count = count_expressions(&t, false);
 4057             yyval = list_append(list_merge(t, yyvsp[0]), yyvsp[-1]);
 4058         }
 4059       }
 4060 #line 4061 "awkgram.c"
 4061     break;
 4062 
 4063   case 158:
 4064 #line 1840 "awkgram.y"
 4065                 {
 4066           yyval = mk_getline(yyvsp[-1], yyvsp[0], yyvsp[-3], yyvsp[-2]->redir_type);
 4067           bcfree(yyvsp[-2]);
 4068         }
 4069 #line 4070 "awkgram.c"
 4070     break;
 4071 
 4072   case 159:
 4073 #line 1846 "awkgram.y"
 4074           { yyval = mk_binary(yyvsp[-2], yyvsp[0], yyvsp[-1]); }
 4075 #line 4076 "awkgram.c"
 4076     break;
 4077 
 4078   case 160:
 4079 #line 1848 "awkgram.y"
 4080           { yyval = mk_binary(yyvsp[-2], yyvsp[0], yyvsp[-1]); }
 4081 #line 4082 "awkgram.c"
 4082     break;
 4083 
 4084   case 161:
 4085 #line 1850 "awkgram.y"
 4086           { yyval = mk_binary(yyvsp[-2], yyvsp[0], yyvsp[-1]); }
 4087 #line 4088 "awkgram.c"
 4088     break;
 4089 
 4090   case 162:
 4091 #line 1852 "awkgram.y"
 4092           { yyval = mk_binary(yyvsp[-2], yyvsp[0], yyvsp[-1]); }
 4093 #line 4094 "awkgram.c"
 4094     break;
 4095 
 4096   case 163:
 4097 #line 1854 "awkgram.y"
 4098           { yyval = mk_binary(yyvsp[-2], yyvsp[0], yyvsp[-1]); }
 4099 #line 4100 "awkgram.c"
 4100     break;
 4101 
 4102   case 164:
 4103 #line 1856 "awkgram.y"
 4104           { yyval = mk_binary(yyvsp[-2], yyvsp[0], yyvsp[-1]); }
 4105 #line 4106 "awkgram.c"
 4106     break;
 4107 
 4108   case 165:
 4109 #line 1861 "awkgram.y"
 4110           {
 4111         yyval = list_create(yyvsp[0]);
 4112       }
 4113 #line 4114 "awkgram.c"
 4114     break;
 4115 
 4116   case 166:
 4117 #line 1865 "awkgram.y"
 4118           {
 4119         if (yyvsp[0]->opcode == Op_match_rec) {
 4120             yyvsp[0]->opcode = Op_nomatch;
 4121             yyvsp[-1]->opcode = Op_push_i;
 4122             yyvsp[-1]->memory = set_profile_text(make_number(0.0), "0", 1);
 4123             yyval = list_append(list_append(list_create(yyvsp[-1]),
 4124                         instruction(Op_field_spec)), yyvsp[0]);
 4125         } else {
 4126             if (do_optimize && yyvsp[0]->nexti == yyvsp[0]->lasti
 4127                     && yyvsp[0]->nexti->opcode == Op_push_i
 4128                     && (yyvsp[0]->nexti->memory->flags & (MPFN|MPZN|INTLSTR)) == 0
 4129             ) {
 4130                 NODE *n = yyvsp[0]->nexti->memory;
 4131                 if ((n->flags & STRING) != 0) {
 4132                     n->numbr = (AWKNUM) (n->stlen == 0);
 4133                     n->flags &= ~(STRCUR|STRING);
 4134                     n->flags |= (NUMCUR|NUMBER);
 4135                     efree(n->stptr);
 4136                     n->stptr = NULL;
 4137                     n->stlen = 0;
 4138                 } else
 4139                     n->numbr = (AWKNUM) (n->numbr == 0.0);
 4140                 bcfree(yyvsp[-1]);
 4141                 yyval = yyvsp[0];
 4142             } else {
 4143                 yyvsp[-1]->opcode = Op_not;
 4144                 add_lint(yyvsp[0], LINT_assign_in_cond);
 4145                 yyval = list_append(yyvsp[0], yyvsp[-1]);
 4146             }
 4147         }
 4148        }
 4149 #line 4150 "awkgram.c"
 4150     break;
 4151 
 4152   case 167:
 4153 #line 1897 "awkgram.y"
 4154           {
 4155         // Always include. Allows us to lint warn on
 4156         // print "foo" > "bar" 1
 4157         // but not warn on
 4158         // print "foo" > ("bar" 1)
 4159         yyval = list_append(yyvsp[-1], bcalloc(Op_parens, 1, sourceline));
 4160       }
 4161 #line 4162 "awkgram.c"
 4162     break;
 4163 
 4164   case 168:
 4165 #line 1905 "awkgram.y"
 4166           {
 4167         yyval = snode(yyvsp[-1], yyvsp[-3]);
 4168         if (yyval == NULL)
 4169             YYABORT;
 4170       }
 4171 #line 4172 "awkgram.c"
 4172     break;
 4173 
 4174   case 169:
 4175 #line 1911 "awkgram.y"
 4176           {
 4177         yyval = snode(yyvsp[-1], yyvsp[-3]);
 4178         if (yyval == NULL)
 4179             YYABORT;
 4180       }
 4181 #line 4182 "awkgram.c"
 4182     break;
 4183 
 4184   case 170:
 4185 #line 1917 "awkgram.y"
 4186           {
 4187         static bool warned = false;
 4188 
 4189         if (do_lint && ! warned) {
 4190             warned = true;
 4191             lintwarn_ln(yyvsp[0]->source_line,
 4192                 _("call of `length' without parentheses is not portable"));
 4193         }
 4194         yyval = snode(NULL, yyvsp[0]);
 4195         if (yyval == NULL)
 4196             YYABORT;
 4197       }
 4198 #line 4199 "awkgram.c"
 4199     break;
 4200 
 4201   case 173:
 4202 #line 1932 "awkgram.y"
 4203           {
 4204         yyvsp[-1]->opcode = Op_preincrement;
 4205         yyval = mk_assignment(yyvsp[0], NULL, yyvsp[-1]);
 4206       }
 4207 #line 4208 "awkgram.c"
 4208     break;
 4209 
 4210   case 174:
 4211 #line 1937 "awkgram.y"
 4212           {
 4213         yyvsp[-1]->opcode = Op_predecrement;
 4214         yyval = mk_assignment(yyvsp[0], NULL, yyvsp[-1]);
 4215       }
 4216 #line 4217 "awkgram.c"
 4217     break;
 4218 
 4219   case 175:
 4220 #line 1942 "awkgram.y"
 4221           {
 4222         yyval = list_create(yyvsp[0]);
 4223       }
 4224 #line 4225 "awkgram.c"
 4225     break;
 4226 
 4227   case 176:
 4228 #line 1946 "awkgram.y"
 4229           {
 4230         yyval = list_create(yyvsp[0]);
 4231       }
 4232 #line 4233 "awkgram.c"
 4233     break;
 4234 
 4235   case 177:
 4236 #line 1950 "awkgram.y"
 4237           {
 4238         if (yyvsp[0]->lasti->opcode == Op_push_i
 4239             && (yyvsp[0]->lasti->memory->flags & STRING) == 0
 4240         ) {
 4241             NODE *n = yyvsp[0]->lasti->memory;
 4242             (void) force_number(n);
 4243             negate_num(n);
 4244             yyval = yyvsp[0];
 4245             bcfree(yyvsp[-1]);