diff options
-rw-r--r-- | ChangeLog | 86 | ||||
-rw-r--r-- | README.constants | 44 | ||||
-rw-r--r-- | array.c | 1 | ||||
-rw-r--r-- | awk.h | 6 | ||||
-rw-r--r-- | awkgram.c | 1558 | ||||
-rw-r--r-- | awkgram.y | 27 | ||||
-rw-r--r-- | builtin.c | 2 | ||||
-rw-r--r-- | debug.c | 15 | ||||
-rw-r--r-- | doc/ChangeLog | 6 | ||||
-rw-r--r-- | doc/gawktexi.in | 10 | ||||
-rw-r--r-- | eval.c | 10 | ||||
-rw-r--r-- | extension/ChangeLog | 9 | ||||
-rw-r--r-- | extension/filefuncs.3am | 8 | ||||
-rw-r--r-- | extension/filefuncs.c | 4 | ||||
-rw-r--r-- | extension/fnmatch.3am | 8 | ||||
-rw-r--r-- | extension/fnmatch.c | 2 | ||||
-rw-r--r-- | extension/testext.c | 2 | ||||
-rw-r--r-- | field.c | 5 | ||||
-rw-r--r-- | gawkapi.c | 34 | ||||
-rw-r--r-- | gawkapi.h | 9 | ||||
-rw-r--r-- | interpret.h | 43 | ||||
-rw-r--r-- | io.c | 10 | ||||
-rw-r--r-- | main.c | 19 | ||||
-rw-r--r-- | mpfr.c | 2 | ||||
-rw-r--r-- | node.c | 7 | ||||
-rw-r--r-- | profile.c | 1 | ||||
-rw-r--r-- | test/ChangeLog | 13 | ||||
-rw-r--r-- | test/Makefile.am | 12 | ||||
-rw-r--r-- | test/Makefile.in | 12 | ||||
-rw-r--r-- | test/assignconst.awk | 69 | ||||
-rw-r--r-- | test/assignconst.ok | 51 |
31 files changed, 1281 insertions, 804 deletions
@@ -41,6 +41,29 @@ * awkgram.y (yylex): Allow \r after \\ line continuation everywhere. Thanks to Scott Rush <scott.rush@honeywell.com> for the report. +2015-02-18 Arnold D. Robbins <arnold@skeeve.com> + + * profile.c (pprint): Add case for Op_assign_const. + +2015-02-17 Arnold D. Robbins <arnold@skeeve.com> + + Disallow := to special variables. + + * awk.h (VAR_SPEC): New flag for the value of special variables. + * array.c (set_SUBSEP): Set it. + * eval.c (flags2str): Add an entry for it. + (update_NR, update_NF): Set it. + * field.c (set_NF, set_FS, set_FIELDWIDTHS, set_FPAT): Set it. + * interpret.h (r_interpret): At Op_assign_const, check it. + * io.c (set_FNR, set_NR, set_RS): Set it. + * main.c (init_args): Set it for ARGC. + (init_vars): Set it for the others. + * mpfr.c (set_PREC, set_ROUNDMODE): Set it. + +2015-02-13 Arnold D. Robbins <arnold@skeeve.com> + + * interpet.h (Op_store_var): Handle assignment from a constant. + 2015-02-13 Arnold D. Robbins <arnold@skeeve.com> * awkgram.y (yylex): Be more careful about passing true to @@ -1776,12 +1799,75 @@ * main.c (main): If libc is borked and LC_ALL or LANG exist in the environment and are set to "C" or "c", force gawk_mb_cur_max to one. +2013-03-14 Arnold D. Robbins <arnold@skeeve.com> + + * main.c (arg_assign): Recognize ":=" in a variable assignment to + do a constant assignment. + 2013-03-11 Arnold D. Robbins <arnold@skeeve.com> * re.c (check_bracket_exp): Make handling of embedded ] in regexp smarter. Thanks to Ed Morton <mortoneccc@comcast.net> for reporting the bug. + * eval.c (flags2str): Add entry for VAR_CONST. Duh. + +2013-03-10 Arnold D. Robbins <arnold@skeeve.com> + + Change how constants are handled; use a flag in the value, not + a new node type. Add ":=" assignment operator to create constants + at the awk level. Array elements need work. Still needs documenting. + + * awk.h (Node_var_const): Removed. + (VAR_CONST): New flag. + (Op_assign_const): New op code. + (dupnode): If value is a constant, call r_dupnode. + * awkgram.y (ASSIGN_CONST): New token. + (statement): Don't check Node_var_const. + (assign): Allow ASSIGN_CONST. + (yylex): Return ASSIGN_CONST for ":=". + (valinfo): Enhance for constant values. + (mk_assignment): Check for Op_assign_const. + * builtin.c (do_sub): Disallow assignment in sub/gsub to constants. + * debug.c (print_symbol, do_set_var, watchpoint_triggered, + initialize_watch, print_memory, do_print_f): Remove use of + Node_var_const. + * eval.c (nodetypes, setup_frame): Remove Node_var_const. + (optypetab): Add Op_assign_const; + (r_get_lhs, op_assign): Check value for VAR_CONST instead of node type. + * gawkapi.c (sym_update_real): Update value with flag, not node type. + * interpret.h (r_interpret): Check for flag value where appropriate + instead of checking node type. Add op_assign_const. + * io.c (do_getline_redir, do_getline): Check for constant. + * node.c (r_dupnode): If a constant, copy the value, don't up the + reference count. + * profile.c (pprint): Remove Node_var_const. + * symbol.c (destroy_symbol, make_symbol, print_vars): Remove + Node_var_const. + +2013-03-04 Arnold D. Robbins <arnold@skeeve.com> + + Provide the API with the ability to create true constants. + + * awk.h (Node_var_const): New nodetype. + * awkgram.y (statement): Don't allow a constant as the for loop + control variable. + * debug.c (print_symbol, do_set_var, watchpoint_triggered): Handle + Node_var_const. + (initialize_watch_item, print_memory, do_print_f): Ditto. + * eval.c (nodetypes, setup_frame): Add Node_var_const. + (r_get_lhs, op_assign): Assigning to constant is fatal error. + * gawkapi.c (sym_update_real): Renamed from api_sym_update_real, + add is_const parameter. Handle it. + (api_sym_update, api_sym_constant): Call sym_update_real. + (api_impl): Add new element. + * gawk_api.h: Add new function pointer for sym_constant. + (sym_constant): New macro. + * interpret.h: Support Node_var_const. + * profile.c (pprint): Support Node_var_const. + * symbol.c (destroy_symbol, make_symbol, print_vars): Support + Node_var_const. + 2013-03-01 Arnold D. Robbins <arnold@skeeve.com> Don't build extensions if API isn't supported: diff --git a/README.constants b/README.constants new file mode 100644 index 00000000..badb748e --- /dev/null +++ b/README.constants @@ -0,0 +1,44 @@ +Wed Feb 18 20:46:22 IST 2015 +============================ + +I have managed to fix the problems outlined below. The only work remaining +is to document := in the manual, man page, and reference card. + +I am leaving this work as unmerged. Brian Kernighan recommends against +adding more features to awk, pointing out that Python also doesn't have +constants.... + +Fri Mar 15 14:03:02 IST 2013 +============================ + +This branch represents a failed experiment, which was to add defined +constants to gawk. + +It started from the extension facility, where adding constants analogous +to those of C header files for library routines (like fts(3)) seemed like +a good idea. + +Then the question was raised: extensions can do something that awk code +cannot? So this facility was removed. During the discussion though, +the ":=" operator was suggested as an alternative method for creating +constants. + +I tried to add the extension facility back, and then add code for ":=". +But there were too many weirdnesses, like what should happen for special +variables, and should ":=" only work for undefined variables? Also, +simple code like this didn't work: + + BEGIN { + x := 5 + print x + y = x # constness came across here + print y + y++ # this blows up + print y + } + +Since it's a lot of weird code for not very much benefit, I am +abandoning further development of this idea. + +Arnold Robbins +arnold@skeeve.com @@ -375,6 +375,7 @@ void set_SUBSEP() { SUBSEP_node->var_value = force_string(SUBSEP_node->var_value); + SUBSEP_node->var_value->flags |= VAR_SPEC; SUBSEP = SUBSEP_node->var_value->stptr; SUBSEPlen = SUBSEP_node->var_value->stlen; } @@ -427,6 +427,8 @@ typedef struct exp_node { # define HALFHAT 0x10000 /* half-capacity Hashed Array Tree; * See cint_array.c */ # define XARRAY 0x20000 +# define VAR_CONST 0x40000 /* value is for a const */ +# define VAR_SPEC 0x80000 /* value belongs to a special var */ } NODE; #define vname sub.nodep.name @@ -583,6 +585,7 @@ typedef enum opcodeval { /* assignments */ Op_assign, + Op_assign_const, Op_store_var, /* simple variable assignment optimization */ Op_store_sub, /* array[subscript] assignment optimization */ Op_store_field, /* $n assignment optimization */ @@ -1742,6 +1745,9 @@ in_array(NODE *a, NODE *s) static inline NODE * dupnode(NODE *n) { + if ((n->flags & VAR_CONST) != 0) + return r_dupnode(n); + if ((n->flags & MALLOC) != 0) { n->valref++; return n; @@ -245,46 +245,47 @@ extern int yydebug; IO_IN = 266, ASSIGNOP = 267, ASSIGN = 268, - MATCHOP = 269, - CONCAT_OP = 270, - SUBSCRIPT = 271, - LEX_BEGIN = 272, - LEX_END = 273, - LEX_IF = 274, - LEX_ELSE = 275, - LEX_RETURN = 276, - LEX_DELETE = 277, - LEX_SWITCH = 278, - LEX_CASE = 279, - LEX_DEFAULT = 280, - LEX_WHILE = 281, - LEX_DO = 282, - LEX_FOR = 283, - LEX_BREAK = 284, - LEX_CONTINUE = 285, - LEX_PRINT = 286, - LEX_PRINTF = 287, - LEX_NEXT = 288, - LEX_EXIT = 289, - LEX_FUNCTION = 290, - LEX_BEGINFILE = 291, - LEX_ENDFILE = 292, - LEX_GETLINE = 293, - LEX_NEXTFILE = 294, - LEX_IN = 295, - LEX_AND = 296, - LEX_OR = 297, - INCREMENT = 298, - DECREMENT = 299, - LEX_BUILTIN = 300, - LEX_LENGTH = 301, - LEX_EOF = 302, - LEX_INCLUDE = 303, - LEX_EVAL = 304, - LEX_LOAD = 305, - NEWLINE = 306, - SLASH_BEFORE_EQUAL = 307, - UNARY = 308 + ASSIGN_CONST = 269, + MATCHOP = 270, + CONCAT_OP = 271, + SUBSCRIPT = 272, + LEX_BEGIN = 273, + LEX_END = 274, + LEX_IF = 275, + LEX_ELSE = 276, + LEX_RETURN = 277, + LEX_DELETE = 278, + LEX_SWITCH = 279, + LEX_CASE = 280, + LEX_DEFAULT = 281, + LEX_WHILE = 282, + LEX_DO = 283, + LEX_FOR = 284, + LEX_BREAK = 285, + LEX_CONTINUE = 286, + LEX_PRINT = 287, + LEX_PRINTF = 288, + LEX_NEXT = 289, + LEX_EXIT = 290, + LEX_FUNCTION = 291, + LEX_BEGINFILE = 292, + LEX_ENDFILE = 293, + LEX_GETLINE = 294, + LEX_NEXTFILE = 295, + LEX_IN = 296, + LEX_AND = 297, + LEX_OR = 298, + INCREMENT = 299, + DECREMENT = 300, + LEX_BUILTIN = 301, + LEX_LENGTH = 302, + LEX_EOF = 303, + LEX_INCLUDE = 304, + LEX_EVAL = 305, + LEX_LOAD = 306, + NEWLINE = 307, + SLASH_BEFORE_EQUAL = 308, + UNARY = 309 }; #endif /* Tokens. */ @@ -299,46 +300,47 @@ extern int yydebug; #define IO_IN 266 #define ASSIGNOP 267 #define ASSIGN 268 -#define MATCHOP 269 -#define CONCAT_OP 270 -#define SUBSCRIPT 271 -#define LEX_BEGIN 272 -#define LEX_END 273 -#define LEX_IF 274 -#define LEX_ELSE 275 -#define LEX_RETURN 276 -#define LEX_DELETE 277 -#define LEX_SWITCH 278 -#define LEX_CASE 279 -#define LEX_DEFAULT 280 -#define LEX_WHILE 281 -#define LEX_DO 282 -#define LEX_FOR 283 -#define LEX_BREAK 284 -#define LEX_CONTINUE 285 -#define LEX_PRINT 286 -#define LEX_PRINTF 287 -#define LEX_NEXT 288 -#define LEX_EXIT 289 -#define LEX_FUNCTION 290 -#define LEX_BEGINFILE 291 -#define LEX_ENDFILE 292 -#define LEX_GETLINE 293 -#define LEX_NEXTFILE 294 -#define LEX_IN 295 -#define LEX_AND 296 -#define LEX_OR 297 -#define INCREMENT 298 -#define DECREMENT 299 -#define LEX_BUILTIN 300 -#define LEX_LENGTH 301 -#define LEX_EOF 302 -#define LEX_INCLUDE 303 -#define LEX_EVAL 304 -#define LEX_LOAD 305 -#define NEWLINE 306 -#define SLASH_BEFORE_EQUAL 307 -#define UNARY 308 +#define ASSIGN_CONST 269 +#define MATCHOP 270 +#define CONCAT_OP 271 +#define SUBSCRIPT 272 +#define LEX_BEGIN 273 +#define LEX_END 274 +#define LEX_IF 275 +#define LEX_ELSE 276 +#define LEX_RETURN 277 +#define LEX_DELETE 278 +#define LEX_SWITCH 279 +#define LEX_CASE 280 +#define LEX_DEFAULT 281 +#define LEX_WHILE 282 +#define LEX_DO 283 +#define LEX_FOR 284 +#define LEX_BREAK 285 +#define LEX_CONTINUE 286 +#define LEX_PRINT 287 +#define LEX_PRINTF 288 +#define LEX_NEXT 289 +#define LEX_EXIT 290 +#define LEX_FUNCTION 291 +#define LEX_BEGINFILE 292 +#define LEX_ENDFILE 293 +#define LEX_GETLINE 294 +#define LEX_NEXTFILE 295 +#define LEX_IN 296 +#define LEX_AND 297 +#define LEX_OR 298 +#define INCREMENT 299 +#define DECREMENT 300 +#define LEX_BUILTIN 301 +#define LEX_LENGTH 302 +#define LEX_EOF 303 +#define LEX_INCLUDE 304 +#define LEX_EVAL 305 +#define LEX_LOAD 306 +#define NEWLINE 307 +#define SLASH_BEFORE_EQUAL 308 +#define UNARY 309 /* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED @@ -356,7 +358,7 @@ int yyparse (void); /* Copy the second part of user declarations. */ -#line 360 "awkgram.c" /* yacc.c:358 */ +#line 362 "awkgram.c" /* yacc.c:358 */ #ifdef short # undef short @@ -598,21 +600,21 @@ union yyalloc /* YYFINAL -- State number of the termination state. */ #define YYFINAL 2 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 1155 +#define YYLAST 1122 /* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 75 +#define YYNTOKENS 76 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 65 /* YYNRULES -- Number of rules. */ -#define YYNRULES 188 +#define YYNRULES 189 /* YYNSTATES -- Number of states. */ -#define YYNSTATES 335 +#define YYNSTATES 336 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned by yylex, with out-of-bounds checking. */ #define YYUNDEFTOK 2 -#define YYMAXUTOK 308 +#define YYMAXUTOK 309 #define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) @@ -624,16 +626,16 @@ static const yytype_uint8 yytranslate[] = 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 63, 2, 2, 66, 62, 2, 2, - 67, 68, 60, 58, 55, 59, 2, 61, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 54, 74, - 56, 2, 57, 53, 69, 2, 2, 2, 2, 2, + 2, 2, 2, 64, 2, 2, 67, 63, 2, 2, + 68, 69, 61, 59, 56, 60, 2, 62, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 55, 75, + 57, 2, 58, 54, 70, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 70, 2, 71, 65, 2, 2, 2, 2, 2, + 2, 71, 2, 72, 66, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 72, 2, 73, 2, 2, 2, 2, + 2, 2, 2, 73, 2, 74, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -651,7 +653,7 @@ static const yytype_uint8 yytranslate[] = 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 64 + 45, 46, 47, 48, 49, 50, 51, 52, 53, 65 }; #if YYDEBUG @@ -670,13 +672,13 @@ static const yytype_uint16 yyrline[] = 1249, 1254, 1255, 1264, 1265, 1270, 1275, 1281, 1283, 1285, 1292, 1293, 1299, 1300, 1305, 1307, 1312, 1314, 1322, 1327, 1336, 1343, 1345, 1347, 1363, 1373, 1380, 1382, 1387, 1389, - 1391, 1399, 1401, 1406, 1408, 1413, 1415, 1417, 1467, 1469, - 1471, 1473, 1475, 1477, 1479, 1481, 1495, 1500, 1505, 1530, - 1536, 1538, 1540, 1542, 1544, 1546, 1551, 1555, 1587, 1589, - 1595, 1601, 1614, 1615, 1616, 1621, 1626, 1630, 1634, 1649, - 1662, 1667, 1704, 1733, 1734, 1740, 1741, 1746, 1748, 1755, - 1772, 1789, 1791, 1798, 1803, 1811, 1821, 1833, 1842, 1846, - 1850, 1854, 1858, 1862, 1865, 1867, 1871, 1875, 1879 + 1391, 1393, 1401, 1403, 1408, 1410, 1415, 1417, 1419, 1469, + 1471, 1473, 1475, 1477, 1479, 1481, 1483, 1497, 1502, 1507, + 1532, 1538, 1540, 1542, 1544, 1546, 1548, 1553, 1557, 1589, + 1591, 1597, 1603, 1616, 1617, 1618, 1623, 1628, 1632, 1636, + 1651, 1664, 1669, 1706, 1735, 1736, 1742, 1743, 1748, 1750, + 1757, 1774, 1791, 1793, 1800, 1805, 1813, 1823, 1835, 1844, + 1848, 1852, 1856, 1860, 1864, 1867, 1869, 1873, 1877, 1881 }; #endif @@ -687,29 +689,30 @@ static const char *const yytname[] = { "$end", "error", "$undefined", "FUNC_CALL", "NAME", "REGEXP", "FILENAME", "YNUMBER", "YSTRING", "RELOP", "IO_OUT", "IO_IN", "ASSIGNOP", - "ASSIGN", "MATCHOP", "CONCAT_OP", "SUBSCRIPT", "LEX_BEGIN", "LEX_END", - "LEX_IF", "LEX_ELSE", "LEX_RETURN", "LEX_DELETE", "LEX_SWITCH", - "LEX_CASE", "LEX_DEFAULT", "LEX_WHILE", "LEX_DO", "LEX_FOR", "LEX_BREAK", - "LEX_CONTINUE", "LEX_PRINT", "LEX_PRINTF", "LEX_NEXT", "LEX_EXIT", - "LEX_FUNCTION", "LEX_BEGINFILE", "LEX_ENDFILE", "LEX_GETLINE", - "LEX_NEXTFILE", "LEX_IN", "LEX_AND", "LEX_OR", "INCREMENT", "DECREMENT", - "LEX_BUILTIN", "LEX_LENGTH", "LEX_EOF", "LEX_INCLUDE", "LEX_EVAL", - "LEX_LOAD", "NEWLINE", "SLASH_BEFORE_EQUAL", "'?'", "':'", "','", "'<'", - "'>'", "'+'", "'-'", "'*'", "'/'", "'%'", "'!'", "UNARY", "'^'", "'$'", - "'('", "')'", "'@'", "'['", "']'", "'{'", "'}'", "';'", "$accept", - "program", "rule", "source", "library", "pattern", "action", "func_name", - "lex_builtin", "function_prologue", "regexp", "$@1", "a_slash", - "statements", "statement_term", "statement", "non_compound_stmt", "$@2", - "simple_stmt", "$@3", "$@4", "opt_simple_stmt", "case_statements", - "case_statement", "case_value", "print", "print_expression_list", - "output_redir", "$@5", "if_statement", "nls", "opt_nls", "input_redir", - "opt_param_list", "param_list", "opt_exp", "opt_expression_list", - "expression_list", "exp", "assign_operator", "relop_or_less", "a_relop", - "common_exp", "simp_exp", "simp_exp_nc", "non_post_simp_exp", - "func_call", "direct_func_call", "opt_variable", "delete_subscript_list", - "delete_subscript", "delete_exp_list", "bracketed_exp_list", "subscript", - "subscript_list", "simple_variable", "variable", "opt_incdec", "l_brace", - "r_brace", "r_paren", "opt_semi", "semi", "colon", "comma", YY_NULLPTR + "ASSIGN", "ASSIGN_CONST", "MATCHOP", "CONCAT_OP", "SUBSCRIPT", + "LEX_BEGIN", "LEX_END", "LEX_IF", "LEX_ELSE", "LEX_RETURN", "LEX_DELETE", + "LEX_SWITCH", "LEX_CASE", "LEX_DEFAULT", "LEX_WHILE", "LEX_DO", + "LEX_FOR", "LEX_BREAK", "LEX_CONTINUE", "LEX_PRINT", "LEX_PRINTF", + "LEX_NEXT", "LEX_EXIT", "LEX_FUNCTION", "LEX_BEGINFILE", "LEX_ENDFILE", + "LEX_GETLINE", "LEX_NEXTFILE", "LEX_IN", "LEX_AND", "LEX_OR", + "INCREMENT", "DECREMENT", "LEX_BUILTIN", "LEX_LENGTH", "LEX_EOF", + "LEX_INCLUDE", "LEX_EVAL", "LEX_LOAD", "NEWLINE", "SLASH_BEFORE_EQUAL", + "'?'", "':'", "','", "'<'", "'>'", "'+'", "'-'", "'*'", "'/'", "'%'", + "'!'", "UNARY", "'^'", "'$'", "'('", "')'", "'@'", "'['", "']'", "'{'", + "'}'", "';'", "$accept", "program", "rule", "source", "library", + "pattern", "action", "func_name", "lex_builtin", "function_prologue", + "regexp", "$@1", "a_slash", "statements", "statement_term", "statement", + "non_compound_stmt", "$@2", "simple_stmt", "$@3", "$@4", + "opt_simple_stmt", "case_statements", "case_statement", "case_value", + "print", "print_expression_list", "output_redir", "$@5", "if_statement", + "nls", "opt_nls", "input_redir", "opt_param_list", "param_list", + "opt_exp", "opt_expression_list", "expression_list", "exp", + "assign_operator", "relop_or_less", "a_relop", "common_exp", "simp_exp", + "simp_exp_nc", "non_post_simp_exp", "func_call", "direct_func_call", + "opt_variable", "delete_subscript_list", "delete_subscript", + "delete_exp_list", "bracketed_exp_list", "subscript", "subscript_list", + "simple_variable", "variable", "opt_incdec", "l_brace", "r_brace", + "r_paren", "opt_semi", "semi", "colon", "comma", YY_NULLPTR }; #endif @@ -723,16 +726,16 @@ static const yytype_uint16 yytoknum[] = 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, - 305, 306, 307, 63, 58, 44, 60, 62, 43, 45, - 42, 47, 37, 33, 308, 94, 36, 40, 41, 64, - 91, 93, 123, 125, 59 + 305, 306, 307, 308, 63, 58, 44, 60, 62, 43, + 45, 42, 47, 37, 33, 309, 94, 36, 40, 41, + 64, 91, 93, 123, 125, 59 }; # endif -#define YYPACT_NINF -273 +#define YYPACT_NINF -267 #define yypact_value_is_default(Yystate) \ - (!!((Yystate) == (-273))) + (!!((Yystate) == (-267))) #define YYTABLE_NINF -104 @@ -743,40 +746,40 @@ static const yytype_uint16 yytoknum[] = STATE-NUM. */ static const yytype_int16 yypact[] = { - -273, 376, -273, -273, -27, -21, -273, -273, -273, -273, - 157, -273, -273, 11, 11, 11, -5, -3, -273, -273, - -273, 1019, 1019, -273, 1019, 1065, 821, 116, -273, -20, - 1, -273, -273, 35, 758, 992, 252, 296, -273, -273, - -273, -273, 233, 789, 821, -273, 2, -273, -273, -273, - -273, -273, 63, 54, -273, 69, -273, -273, -273, 789, - 789, 127, 87, 115, 87, 87, 1019, 131, -273, -273, - 55, 295, 40, 47, -273, 83, -273, -273, -273, 35, - -273, 83, -273, 151, -273, -273, 1019, 132, 1019, 1019, - 1019, 83, -273, -273, -273, 1019, 124, 252, 1019, 1019, - 1019, 1019, 1019, 1019, 1019, 1019, 1019, 1019, 1019, 1019, - -273, -273, -273, -273, 152, 1019, 100, 16, 1034, 37, - -273, -273, -273, 43, 1019, -273, 100, 100, 295, -273, - -273, -273, 1019, 83, -273, 137, 867, -273, -273, 75, - -19, -273, 77, -19, 35, -273, 596, -273, -273, 123, - -273, 141, 175, 1098, 1019, 161, 11, -26, -26, 87, - 87, 87, 87, -26, -26, 87, 87, 87, 87, -273, - 1034, -273, -273, -273, -273, 100, 65, 252, -273, -273, - 1034, -273, 132, -273, 1034, -273, -273, -273, -273, -273, - 104, -273, 26, 118, 119, 83, 121, -19, -19, -273, - -273, -19, 1019, -19, 83, -273, -273, -19, -273, -273, - 1034, -273, 117, 83, 1019, 1034, -273, 83, -273, 112, - -273, 1019, 1019, -273, 188, 1019, 1019, 710, 900, -273, - -273, -273, -19, 1034, -273, -273, -273, 642, 596, 83, - -273, -273, 1034, -273, -273, -273, 295, -19, -21, 126, - 295, 295, 169, -13, -273, 117, -273, 821, 186, -273, - -273, -273, 83, -273, -273, 13, -273, -273, -273, 83, - 83, 139, 132, 83, 55, -273, -273, 710, -273, -273, - 1, 710, 1019, 100, 743, 137, 1019, 192, -273, -273, - 295, 83, 286, 83, 992, 83, 44, 83, 710, 83, - 946, 710, -273, 247, 154, -273, 156, -273, -273, 946, - 100, -273, -273, -273, 226, 228, -273, 154, -273, 83, - -273, 100, 83, -273, -273, 83, -273, 83, 710, -273, - 448, 710, -273, 522, -273 + -267, 372, -267, -267, -30, -22, -267, -267, -267, -267, + 88, -267, -267, 26, 26, 26, -4, 0, -267, -267, + -267, 977, 977, -267, 977, 1024, 795, 156, -267, -20, + -7, -267, -267, 19, 1039, 950, 288, 367, -267, -267, + -267, -267, 293, 748, 795, -267, 11, -267, -267, -267, + -267, -267, 20, 10, -267, 27, -267, -267, -267, 748, + 748, 119, 58, -8, 58, 58, 977, 73, -267, -267, + 130, 344, 33, 45, -267, 75, -267, -267, -267, 19, + -267, 75, -267, 124, -267, -267, 977, 126, 977, 977, + 977, 75, -267, -267, -267, 977, 94, 288, 977, 977, + 977, 977, 977, 977, 977, 977, 977, 977, 977, 977, + -267, -267, -267, -267, -267, 136, 977, 87, 194, 1064, + 23, -267, -267, -267, 44, 977, -267, 87, 87, 344, + -267, -267, -267, 977, 75, -267, 116, 822, -267, -267, + 5, -21, -267, 15, -21, 19, -267, 595, -267, -267, + 18, -267, 271, 111, 1057, 977, 105, 26, 128, 128, + 58, 58, 58, 58, 128, 128, 58, 58, 58, 58, + -267, 1064, -267, -267, -267, -267, 87, 150, 288, -267, + -267, 1064, -267, 126, -267, 1064, -267, -267, -267, -267, + -267, 103, -267, 13, 107, 110, 75, 112, -21, -21, + -267, -267, -21, 977, -21, 75, -267, -267, -21, -267, + -267, 1064, -267, 118, 75, 977, 1064, -267, 75, -267, + 46, -267, 977, 977, -267, 205, 977, 977, 668, 870, + -267, -267, -267, -21, 1064, -267, -267, -267, 251, 595, + 75, -267, -267, 1064, -267, -267, -267, 344, -21, -22, + 129, 344, 344, 184, -15, -267, 118, -267, 795, 203, + -267, -267, -267, 75, -267, -267, 12, -267, -267, -267, + 75, 75, 149, 126, 75, 130, -267, -267, 668, -267, + -267, -7, 668, 977, 87, 715, 116, 977, 197, -267, + -267, 344, 75, 992, 75, 950, 75, 250, 75, 668, + 75, 903, 668, -267, 263, 169, -267, 154, -267, -267, + 903, 87, -267, -267, -267, 223, 225, -267, 169, -267, + 75, -267, 87, 75, -267, -267, 75, -267, 75, 668, + -267, 445, 668, -267, 520, -267 }; /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. @@ -784,64 +787,64 @@ static const yytype_int16 yypact[] = means the default is an error. */ static const yytype_uint8 yydefact[] = { - 2, 0, 1, 6, 0, 174, 156, 157, 21, 22, - 0, 23, 24, 163, 0, 0, 0, 151, 5, 87, + 2, 0, 1, 6, 0, 175, 157, 158, 21, 22, + 0, 23, 24, 164, 0, 0, 0, 152, 5, 87, 36, 0, 0, 35, 0, 0, 0, 0, 3, 0, - 0, 146, 33, 4, 19, 117, 125, 126, 128, 152, - 160, 176, 153, 0, 0, 171, 0, 175, 27, 26, - 30, 31, 0, 0, 28, 91, 164, 154, 155, 0, - 0, 0, 159, 153, 158, 147, 0, 180, 153, 106, - 0, 104, 0, 0, 161, 89, 186, 7, 8, 40, - 37, 89, 9, 0, 88, 121, 0, 0, 0, 0, - 0, 89, 122, 124, 123, 0, 0, 127, 0, 0, + 0, 147, 33, 4, 19, 117, 126, 127, 129, 153, + 161, 177, 154, 0, 0, 172, 0, 176, 27, 26, + 30, 31, 0, 0, 28, 91, 165, 155, 156, 0, + 0, 0, 160, 154, 159, 148, 0, 181, 154, 106, + 0, 104, 0, 0, 162, 89, 187, 7, 8, 40, + 37, 89, 9, 0, 88, 122, 0, 0, 0, 0, + 0, 89, 123, 125, 124, 0, 0, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 119, 118, 136, 137, 0, 0, 0, 0, 104, 0, - 173, 172, 29, 0, 0, 135, 0, 0, 0, 178, - 179, 177, 107, 89, 183, 0, 0, 148, 14, 0, - 0, 17, 0, 0, 90, 181, 0, 41, 34, 113, - 114, 111, 112, 0, 0, 115, 163, 133, 134, 130, - 131, 132, 129, 144, 145, 141, 142, 143, 140, 120, - 110, 162, 170, 97, 95, 0, 0, 92, 149, 150, - 108, 188, 0, 109, 105, 13, 10, 16, 11, 39, - 0, 57, 0, 0, 0, 89, 0, 0, 0, 78, - 79, 0, 100, 0, 89, 38, 51, 0, 60, 44, - 65, 37, 184, 89, 0, 20, 139, 89, 98, 0, - 138, 0, 100, 62, 0, 0, 0, 0, 66, 52, - 53, 54, 0, 101, 55, 182, 59, 0, 0, 89, - 185, 42, 116, 32, 99, 96, 0, 0, 165, 0, - 0, 0, 0, 174, 67, 0, 56, 0, 82, 80, - 43, 25, 89, 58, 63, 0, 167, 169, 64, 89, - 89, 0, 0, 89, 0, 83, 61, 0, 166, 168, - 0, 0, 0, 0, 0, 81, 0, 85, 68, 46, - 0, 89, 0, 89, 84, 89, 0, 89, 0, 89, - 66, 0, 70, 0, 0, 69, 0, 47, 48, 66, - 0, 86, 73, 76, 0, 0, 77, 0, 187, 89, - 45, 0, 89, 75, 74, 89, 37, 89, 0, 37, - 0, 0, 50, 0, 49 + 119, 118, 120, 137, 138, 0, 0, 0, 0, 104, + 0, 174, 173, 29, 0, 0, 136, 0, 0, 0, + 179, 180, 178, 107, 89, 184, 0, 0, 149, 14, + 0, 0, 17, 0, 0, 90, 182, 0, 41, 34, + 113, 114, 111, 112, 0, 0, 115, 164, 134, 135, + 131, 132, 133, 130, 145, 146, 142, 143, 144, 141, + 121, 110, 163, 171, 97, 95, 0, 0, 92, 150, + 151, 108, 189, 0, 109, 105, 13, 10, 16, 11, + 39, 0, 57, 0, 0, 0, 89, 0, 0, 0, + 78, 79, 0, 100, 0, 89, 38, 51, 0, 60, + 44, 65, 37, 185, 89, 0, 20, 140, 89, 98, + 0, 139, 0, 100, 62, 0, 0, 0, 0, 66, + 52, 53, 54, 0, 101, 55, 183, 59, 0, 0, + 89, 186, 42, 116, 32, 99, 96, 0, 0, 166, + 0, 0, 0, 0, 175, 67, 0, 56, 0, 82, + 80, 43, 25, 89, 58, 63, 0, 168, 170, 64, + 89, 89, 0, 0, 89, 0, 83, 61, 0, 167, + 169, 0, 0, 0, 0, 0, 81, 0, 85, 68, + 46, 0, 89, 0, 89, 84, 89, 0, 89, 0, + 89, 66, 0, 70, 0, 0, 69, 0, 47, 48, + 66, 0, 86, 73, 76, 0, 0, 77, 0, 188, + 89, 45, 0, 89, 75, 74, 89, 37, 89, 0, + 37, 0, 0, 50, 0, 49 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { - -273, -273, -273, -273, -273, -273, 208, -273, -273, -273, - -64, -273, -273, -202, 71, -58, -273, -273, -218, -273, - -273, -272, -273, -273, -273, -273, -273, -273, -273, -273, - 50, 76, -273, -273, -273, 19, -54, -23, -1, -273, - -273, -273, -44, 39, -273, 224, -273, -11, 94, -273, - -273, -7, -38, -273, -273, -73, -2, -273, -28, -231, - -46, -273, -25, -57, 85 + -267, -267, -267, -267, -267, -267, 204, -267, -267, -267, + -71, -267, -267, -202, -32, -117, -267, -267, -224, -267, + -267, -266, -267, -267, -267, -267, -267, -267, -267, -267, + 40, 69, -267, -267, -267, 17, -51, -23, -1, -267, + -267, -267, -46, 39, -267, 218, -267, -9, 90, -267, + -267, -17, -39, -267, -267, -73, -2, -267, -28, -199, + -55, -267, -25, -56, 68 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { - -1, 1, 28, 140, 143, 29, 77, 53, 54, 30, - 31, 83, 32, 146, 78, 205, 206, 222, 207, 237, - 248, 255, 296, 305, 317, 208, 258, 276, 286, 209, - 144, 145, 125, 175, 176, 232, 116, 117, 210, 115, - 94, 95, 35, 36, 37, 38, 39, 40, 55, 264, - 265, 266, 45, 46, 47, 41, 42, 131, 211, 212, - 137, 239, 213, 319, 136 + -1, 1, 28, 141, 144, 29, 77, 53, 54, 30, + 31, 83, 32, 147, 78, 206, 207, 223, 208, 238, + 249, 256, 297, 306, 318, 209, 259, 277, 287, 210, + 145, 146, 126, 176, 177, 233, 117, 118, 211, 116, + 94, 95, 35, 36, 37, 38, 39, 40, 55, 265, + 266, 267, 45, 46, 47, 41, 42, 132, 212, 213, + 138, 240, 214, 320, 137 }; /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If @@ -849,306 +852,300 @@ static const yytype_int16 yydefgoto[] = number is the opposite. If YYTABLE_NINF, syntax error. */ static const yytype_int16 yytable[] = { - 34, 80, 80, 70, 81, 126, 127, 260, 121, 238, - 254, 56, 57, 58, 150, 5, 74, 132, 120, 63, - 63, 119, 63, 68, 135, 71, -103, 272, 310, 278, - 223, 19, 19, 63, 100, 101, 102, 321, 132, 103, - 43, 138, 118, 118, 173, 302, 139, 174, 141, 44, - 74, 33, 75, 142, 76, 76, 132, 44, 118, 118, - 62, 64, 59, 65, 60, 128, 218, -103, 303, 304, - 171, 133, 44, 75, 97, 320, 185, 25, 187, 79, - 178, 179, 254, 44, -103, 149, 84, 151, 152, 153, - -103, 254, 133, 224, 155, 19, 63, 63, 63, 63, - 63, 63, 63, 63, 63, 63, 63, 63, 172, 220, - 133, -93, 122, 244, 170, 81, 245, -89, 81, 4, - 133, 123, 63, 134, 330, 124, -12, 333, -15, 217, - 4, 180, 85, -94, 19, 184, 5, 157, 158, 159, - 160, 161, 162, 163, 164, 165, 166, 167, 168, -12, - 85, -15, 103, 215, 56, 86, 148, 147, 112, 113, - 48, 49, 156, 177, 72, 169, 73, 154, 134, 252, - -104, 221, 81, 81, 129, 130, 81, 182, 81, 92, - 93, 87, 81, 259, 85, 225, 226, 240, 228, 86, - 79, 76, 249, 79, 268, 271, 275, 92, 93, 283, - 262, 233, 50, 51, 269, 270, 282, 81, 318, 181, - 267, 186, 295, 242, 188, 87, 88, -104, -104, 287, - 246, 233, 81, 289, 250, 251, 52, 267, 285, 204, - 273, 92, 93, 323, 274, 324, 118, 291, 82, 316, - 308, 247, 294, 311, 297, 110, 111, 79, 79, 67, - 216, 79, 288, 79, 312, 313, 71, 79, 279, 293, - 325, 219, 0, 0, 322, 0, 0, 299, 229, 230, - 332, 227, 231, 334, 234, 327, 112, 113, 236, 0, - 235, 290, 79, 292, 63, 114, 0, 0, 0, 241, - 0, 0, 63, 243, 0, 85, 0, 79, 0, 20, - 86, 0, 0, 256, 85, 314, 315, 0, 23, 86, - 98, 99, 100, 101, 102, 261, 0, 103, 263, 0, - 0, 0, 0, 0, 0, 0, 87, 88, 89, 0, - 0, 0, 0, 97, 0, 87, 88, 89, 277, 90, - 0, 0, 92, 93, 0, 280, 281, 0, 90, 284, - 0, 92, 93, 0, 104, 105, 106, 107, 108, 0, - 76, 109, 0, 134, 0, 0, 0, 298, 0, 300, - 0, 301, 306, 307, 0, 309, 2, 3, 0, 4, - 5, 0, 0, 6, 7, 0, 0, 0, 0, 0, - 0, 0, 0, 8, 9, 326, 0, 0, 328, 0, - 0, 329, 0, 331, 0, 0, 0, 0, 0, 0, - 0, 10, 11, 12, 13, 0, 0, 0, 0, 14, - 15, 16, 17, 18, 0, 0, 0, 19, 20, 0, + 34, 80, 80, 70, 81, 255, 186, 122, 127, 128, + 239, 56, 57, 58, 151, 136, 188, 224, 74, 63, + 63, 120, 63, 68, 133, 71, 273, 85, 121, 279, + 5, 19, 19, 63, 139, 311, 113, 114, 43, 140, + 261, 33, 119, 119, 322, 174, 142, 245, 175, 44, + 246, 143, 74, 75, 76, 76, 44, -12, 119, 119, + 62, 64, 172, 65, 59, 129, 75, -15, 60, 79, + 123, 84, 179, 180, 97, 92, 93, 255, 124, 134, + -12, 225, 44, 44, 125, 150, 255, 152, 153, 154, + -15, 48, 49, 25, 156, 173, 63, 63, 63, 63, + 63, 63, 63, 63, 63, 63, 63, 63, 321, 187, + 221, 253, 189, -93, -104, 171, 81, 130, 131, 81, + 85, 218, 4, 63, 103, 331, 86, 19, 334, 149, + 5, 133, 181, 157, 50, 51, 185, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, + 148, 219, 87, 88, 216, 56, 135, 183, 52, 4, + 155, 288, -104, -104, 178, 290, 230, 231, 92, 93, + 232, 222, 235, 81, 81, 226, 237, 81, 227, 81, + 229, 79, 309, 81, 79, 312, 134, 260, 241, 100, + 101, 102, 263, 76, 103, 133, 270, 271, 269, 135, + 284, 257, 234, 182, -103, 72, 134, 73, 81, 250, + 268, 272, 333, 276, 243, 335, 264, 283, 296, -94, + 286, 247, 234, 81, 319, 251, 252, 268, 205, 292, + 324, 274, 325, 317, 82, 275, 298, 119, 79, 79, + 248, 295, 79, 67, 79, 220, -103, 217, 79, 280, + 134, 303, 69, 289, 4, 5, 323, 71, 6, 7, + 294, -102, 326, -103, 0, 228, 0, 328, 300, -103, + 313, 314, 0, 79, 236, 304, 305, 0, 0, 0, + 85, 0, 291, 242, 293, 63, 86, 244, 79, 0, + 13, 0, 0, 63, 0, 14, 15, 16, 17, 0, + 0, 0, 19, -102, 20, 110, 111, 112, 0, 262, + 21, 22, 87, 23, 0, 24, 20, 0, 25, 258, + -102, 61, 315, 316, -89, 23, -102, 0, 92, 93, + 0, 0, 278, 0, 97, 0, 0, 113, 114, 281, + 282, 0, 0, 285, 0, 0, 115, 98, 99, 100, + 101, 102, 0, 85, 103, 0, 0, 0, 0, 86, + 0, 299, 0, 301, 0, 302, 307, 308, 0, 310, + 0, 0, 2, 3, 0, 4, 5, 0, 0, 6, + 7, 0, 0, 0, 0, 87, 88, 89, 0, 327, + 8, 9, 329, 0, 0, 330, 0, 332, 90, 0, + 0, 92, 93, 0, 0, 0, 0, 0, 10, 11, + 12, 13, 0, 135, 0, 0, 14, 15, 16, 17, + 18, 0, 0, 0, 19, 20, 104, 105, 106, 107, + 108, 21, 22, 109, 23, 0, 24, 0, 0, 25, + 26, 0, 27, 0, 0, -18, 190, -18, 4, 5, + 0, 0, 6, 7, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 191, 0, 192, 193, 194, + -72, -72, 195, 196, 197, 198, 199, 200, 201, 202, + 203, 0, 0, 0, 13, 204, 0, 0, 0, 14, + 15, 16, 17, 0, 0, 0, 0, -72, 20, 0, 0, 0, 0, 0, 21, 22, 0, 23, 0, 24, - 0, 0, 25, 26, 0, 27, 0, 0, -18, 189, - -18, 4, 5, 0, 0, 6, 7, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 190, 0, 191, - 192, 193, -72, -72, 194, 195, 196, 197, 198, 199, - 200, 201, 202, 0, 0, 0, 13, 203, 0, 0, - 0, 14, 15, 16, 17, 0, 0, 0, 0, -72, - 20, 0, 0, 0, 0, 0, 21, 22, 0, 23, - 0, 24, 0, 0, 25, 26, 0, 61, 0, 0, - 75, -72, 76, 189, 0, 4, 5, 0, 0, 6, - 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 190, 0, 191, 192, 193, -71, -71, 194, 195, - 196, 197, 198, 199, 200, 201, 202, 0, 0, 0, - 13, 203, 0, 0, 0, 14, 15, 16, 17, 0, - 0, 0, 0, -71, 20, 0, 0, 0, 0, 0, - 21, 22, 0, 23, 0, 24, 0, 0, 25, 26, - 0, 61, 0, 0, 75, -71, 76, 189, 0, 4, - 5, 0, 0, 6, 7, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 190, 0, 191, 192, 193, - 0, 0, 194, 195, 196, 197, 198, 199, 200, 201, - 202, 0, 0, 0, 13, 203, 0, 0, 0, 14, - 15, 16, 17, 69, 0, 4, 5, 0, 20, 6, - 7, 0, -102, 0, 21, 22, 0, 23, 0, 24, - 0, 0, 25, 26, 0, 61, 0, 0, 75, 204, - 76, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 13, 0, 0, 0, 0, 14, 15, 16, 17, 0, - 0, 0, 0, -102, 20, 0, 0, 0, 0, 0, - 21, 22, 0, 23, 0, 24, 0, 0, 25, 257, - -102, 61, 0, 4, 5, 0, -102, 6, 7, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 190, - 0, 191, 192, 193, 0, 0, 194, 195, 196, 197, - 198, 199, 200, 201, 202, 0, 4, 5, 13, 203, - 6, 7, 0, 14, 15, 16, 17, 0, 0, 0, - 0, 0, 20, 0, 0, 0, 0, 85, 21, 22, - 0, 23, 86, 24, 0, 0, 25, 26, 0, 61, - 0, 13, 75, 0, 76, 0, 14, 15, 16, 17, - 69, 0, 4, 5, 0, 20, 6, 7, 87, 88, - 89, 21, 22, 0, 23, 0, 24, 0, 0, 25, - 26, 90, 61, 91, 92, 93, 0, 76, 0, 0, - 0, 0, 69, 0, 4, 5, 0, 13, 6, 7, - 0, 0, 14, 15, 16, 17, 0, 0, 0, 0, - 0, 20, 0, 0, 0, 0, 0, 21, 22, 0, - 23, 0, 24, 0, 0, 25, 26, -102, 61, 13, - 0, 0, 0, 0, 14, 15, 16, 17, 183, 0, - 4, 5, 0, 20, 6, 7, 0, 0, 0, 21, + 0, 0, 25, 26, 0, 61, 0, 0, 75, -72, + 76, 190, 0, 4, 5, 0, 0, 6, 7, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 191, 0, 192, 193, 194, -71, -71, 195, 196, 197, + 198, 199, 200, 201, 202, 203, 0, 0, 0, 13, + 204, 0, 0, 0, 14, 15, 16, 17, 0, 0, + 0, 0, -71, 20, 0, 0, 0, 0, 0, 21, 22, 0, 23, 0, 24, 0, 0, 25, 26, 0, - 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 4, 253, 13, 0, 6, 7, 0, - 14, 15, 16, 17, 0, 0, 0, 0, 0, 20, - 0, 0, 192, 0, 0, 21, 22, 0, 23, 0, - 24, 199, 200, 25, 26, 0, 61, 0, 13, 0, - 0, 0, 0, 14, 15, 16, 17, 0, 0, 4, - 5, 0, 20, 6, 7, 0, 0, 0, 21, 22, - 0, 23, 0, 24, 0, 0, 25, 26, 192, 61, - 0, 0, 0, 0, 0, 0, 0, 199, 200, 0, - 0, 0, 0, 0, 13, 0, 0, 0, 0, 14, - 15, 16, 17, 0, 0, 4, 5, 0, 20, 6, - 7, 0, 0, 96, 21, 22, 0, 23, 0, 24, - 0, 0, 25, 26, 0, 61, 0, 0, 0, 0, - 0, 0, 4, 5, 0, 0, 6, 7, 0, 0, - 13, 0, 0, 0, 0, 14, 15, 16, 17, 0, - 0, 0, 0, 85, 20, 0, 0, 0, 86, 0, - 21, 22, 0, 23, 0, 24, 0, 13, 25, 26, - 0, 61, 14, 15, 16, 17, 0, 0, 4, 5, - 0, 20, 6, 7, 87, 88, 89, 21, 22, 0, - 23, 0, 24, 0, 0, 25, 26, 90, 61, 0, - 92, 93, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 85, 14, 15, - 16, 17, 86, 0, 0, 0, 0, 20, 0, 0, - 0, 0, 0, 21, 22, 0, 23, 0, 24, 0, - 0, 25, 66, 0, 61, 0, 0, 0, 87, 88, - 89, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 90, 214, 0, 92, 93 + 61, 0, 0, 75, -71, 76, 190, 0, 4, 5, + 0, 0, 6, 7, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 191, 0, 192, 193, 194, + 0, 0, 195, 196, 197, 198, 199, 200, 201, 202, + 203, 0, 0, 0, 13, 204, 0, 0, 0, 14, + 15, 16, 17, 0, 0, 0, 0, 0, 20, 0, + 0, 0, 0, 0, 21, 22, 0, 23, 0, 24, + 0, 0, 25, 26, 0, 61, 0, 0, 75, 205, + 76, 4, 5, 0, 0, 6, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 191, 0, + 192, 193, 194, 0, 0, 195, 196, 197, 198, 199, + 200, 201, 202, 203, 0, 0, 0, 13, 204, 0, + 0, 0, 14, 15, 16, 17, 0, 0, 4, 5, + 0, 20, 6, 7, 0, 0, 0, 21, 22, 0, + 23, 0, 24, 0, 0, 25, 26, 0, 61, 0, + 0, 75, 0, 76, 0, 0, 0, 0, 0, 69, + 0, 4, 5, 0, 13, 6, 7, 0, 0, 14, + 15, 16, 17, 0, 0, 0, 0, 0, 20, 0, + 0, 0, 0, 0, 21, 22, 0, 23, 0, 24, + 0, 0, 25, 26, 0, 61, 0, 13, 0, 0, + 76, 0, 14, 15, 16, 17, 69, 0, 4, 5, + 0, 20, 6, 7, 0, 0, 0, 21, 22, 0, + 23, 0, 24, 0, 0, 25, 26, -102, 61, 0, + 0, 0, 0, 184, 0, 4, 5, 0, 0, 6, + 7, 0, 0, 0, 13, 0, 0, 0, 0, 14, + 15, 16, 17, 0, 0, 0, 0, 0, 20, 0, + 0, 0, 0, 0, 21, 22, 0, 23, 0, 24, + 0, 13, 25, 26, 0, 61, 14, 15, 16, 17, + 0, 0, 0, 4, 254, 20, 0, 6, 7, 0, + 0, 21, 22, 0, 23, 0, 24, 0, 0, 25, + 26, 0, 61, 193, 0, 0, 0, 0, 0, 0, + 0, 0, 200, 201, 0, 0, 4, 5, 0, 13, + 6, 7, 0, 0, 14, 15, 16, 17, 0, 0, + 0, 0, 0, 20, 0, 0, 193, 0, 0, 21, + 22, 0, 23, 0, 24, 200, 201, 25, 26, 0, + 61, 0, 13, 0, 0, 0, 0, 14, 15, 16, + 17, 0, 0, 4, 5, 0, 20, 6, 7, 0, + 0, 96, 21, 22, 0, 23, 0, 24, 0, 0, + 25, 26, 0, 61, 0, 0, 0, 0, 0, 0, + 4, 5, 0, 0, 6, 7, 0, 0, 0, 13, + 0, 0, 0, 0, 14, 15, 16, 17, 0, 0, + 0, 85, 0, 20, 0, 0, 0, 86, 0, 21, + 22, 0, 23, 0, 24, 0, 13, 25, 26, 0, + 61, 14, 15, 16, 17, 0, 0, 4, 5, 0, + 20, 6, 7, 87, 88, 89, 21, 22, 0, 23, + 0, 24, 0, 0, 25, 26, 90, 61, 85, 92, + 93, 0, 0, 0, 86, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 85, 76, 14, 15, + 16, 17, 86, 85, 0, 0, 0, 20, 0, 86, + 87, 88, 89, 21, 22, 0, 23, 0, 24, 0, + 0, 25, 66, 90, 61, 91, 92, 93, 87, 88, + 89, 0, 0, 0, 0, 87, 88, 89, 0, 0, + 0, 90, 215, 0, 92, 93, 0, 0, 90, 0, + 0, 92, 93 }; static const yytype_int16 yycheck[] = { - 1, 29, 30, 26, 29, 59, 60, 238, 46, 211, - 228, 13, 14, 15, 87, 4, 27, 1, 16, 21, - 22, 44, 24, 25, 70, 26, 10, 40, 300, 16, - 4, 51, 51, 35, 60, 61, 62, 309, 1, 65, - 67, 1, 43, 44, 1, 1, 6, 4, 1, 70, - 61, 1, 72, 6, 74, 74, 1, 70, 59, 60, - 21, 22, 67, 24, 67, 66, 1, 51, 24, 25, - 116, 55, 70, 72, 35, 306, 1, 66, 1, 29, - 126, 127, 300, 70, 68, 86, 51, 88, 89, 90, - 74, 309, 55, 67, 95, 51, 98, 99, 100, 101, - 102, 103, 104, 105, 106, 107, 108, 109, 71, 182, - 55, 68, 49, 1, 115, 140, 4, 73, 143, 3, - 55, 67, 124, 68, 326, 56, 51, 329, 51, 175, - 3, 132, 9, 68, 51, 136, 4, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 74, - 9, 74, 65, 154, 156, 14, 5, 81, 43, 44, - 3, 4, 38, 124, 48, 13, 50, 91, 68, 227, - 9, 67, 197, 198, 43, 44, 201, 40, 203, 56, - 57, 40, 207, 237, 9, 67, 67, 212, 67, 14, - 140, 74, 4, 143, 68, 26, 10, 56, 57, 272, - 246, 202, 45, 46, 250, 251, 67, 232, 54, 133, - 248, 140, 20, 214, 143, 40, 41, 56, 57, 277, - 221, 222, 247, 281, 225, 226, 69, 265, 274, 73, - 255, 56, 57, 7, 257, 7, 237, 283, 30, 303, - 298, 222, 286, 301, 290, 12, 13, 197, 198, 25, - 156, 201, 280, 203, 7, 8, 257, 207, 265, 284, - 317, 176, -1, -1, 310, -1, -1, 292, 197, 198, - 328, 195, 201, 331, 203, 321, 43, 44, 207, -1, - 204, 282, 232, 284, 286, 52, -1, -1, -1, 213, - -1, -1, 294, 217, -1, 9, -1, 247, -1, 52, - 14, -1, -1, 232, 9, 58, 59, -1, 61, 14, - 58, 59, 60, 61, 62, 239, -1, 65, 247, -1, - -1, -1, -1, -1, -1, -1, 40, 41, 42, -1, - -1, -1, -1, 294, -1, 40, 41, 42, 262, 53, - -1, -1, 56, 57, -1, 269, 270, -1, 53, 273, - -1, 56, 57, -1, 58, 59, 60, 61, 62, -1, - 74, 65, -1, 68, -1, -1, -1, 291, -1, 293, - -1, 295, 296, 297, -1, 299, 0, 1, -1, 3, - 4, -1, -1, 7, 8, -1, -1, -1, -1, -1, - -1, -1, -1, 17, 18, 319, -1, -1, 322, -1, - -1, 325, -1, 327, -1, -1, -1, -1, -1, -1, - -1, 35, 36, 37, 38, -1, -1, -1, -1, 43, - 44, 45, 46, 47, -1, -1, -1, 51, 52, -1, - -1, -1, -1, -1, 58, 59, -1, 61, -1, 63, - -1, -1, 66, 67, -1, 69, -1, -1, 72, 1, - 74, 3, 4, -1, -1, 7, 8, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 19, -1, 21, - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, -1, -1, -1, 38, 39, -1, -1, - -1, 43, 44, 45, 46, -1, -1, -1, -1, 51, - 52, -1, -1, -1, -1, -1, 58, 59, -1, 61, - -1, 63, -1, -1, 66, 67, -1, 69, -1, -1, - 72, 73, 74, 1, -1, 3, 4, -1, -1, 7, - 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 19, -1, 21, 22, 23, 24, 25, 26, 27, - 28, 29, 30, 31, 32, 33, 34, -1, -1, -1, - 38, 39, -1, -1, -1, 43, 44, 45, 46, -1, - -1, -1, -1, 51, 52, -1, -1, -1, -1, -1, - 58, 59, -1, 61, -1, 63, -1, -1, 66, 67, - -1, 69, -1, -1, 72, 73, 74, 1, -1, 3, - 4, -1, -1, 7, 8, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 19, -1, 21, 22, 23, - -1, -1, 26, 27, 28, 29, 30, 31, 32, 33, - 34, -1, -1, -1, 38, 39, -1, -1, -1, 43, - 44, 45, 46, 1, -1, 3, 4, -1, 52, 7, - 8, -1, 10, -1, 58, 59, -1, 61, -1, 63, - -1, -1, 66, 67, -1, 69, -1, -1, 72, 73, - 74, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 38, -1, -1, -1, -1, 43, 44, 45, 46, -1, - -1, -1, -1, 51, 52, -1, -1, -1, -1, -1, - 58, 59, -1, 61, -1, 63, -1, -1, 66, 67, - 68, 69, -1, 3, 4, -1, 74, 7, 8, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 19, - -1, 21, 22, 23, -1, -1, 26, 27, 28, 29, - 30, 31, 32, 33, 34, -1, 3, 4, 38, 39, - 7, 8, -1, 43, 44, 45, 46, -1, -1, -1, - -1, -1, 52, -1, -1, -1, -1, 9, 58, 59, - -1, 61, 14, 63, -1, -1, 66, 67, -1, 69, - -1, 38, 72, -1, 74, -1, 43, 44, 45, 46, - 1, -1, 3, 4, -1, 52, 7, 8, 40, 41, - 42, 58, 59, -1, 61, -1, 63, -1, -1, 66, - 67, 53, 69, 55, 56, 57, -1, 74, -1, -1, - -1, -1, 1, -1, 3, 4, -1, 38, 7, 8, - -1, -1, 43, 44, 45, 46, -1, -1, -1, -1, - -1, 52, -1, -1, -1, -1, -1, 58, 59, -1, - 61, -1, 63, -1, -1, 66, 67, 68, 69, 38, - -1, -1, -1, -1, 43, 44, 45, 46, 1, -1, - 3, 4, -1, 52, 7, 8, -1, -1, -1, 58, - 59, -1, 61, -1, 63, -1, -1, 66, 67, -1, - 69, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 3, 4, 38, -1, 7, 8, -1, - 43, 44, 45, 46, -1, -1, -1, -1, -1, 52, - -1, -1, 22, -1, -1, 58, 59, -1, 61, -1, - 63, 31, 32, 66, 67, -1, 69, -1, 38, -1, - -1, -1, -1, 43, 44, 45, 46, -1, -1, 3, - 4, -1, 52, 7, 8, -1, -1, -1, 58, 59, - -1, 61, -1, 63, -1, -1, 66, 67, 22, 69, - -1, -1, -1, -1, -1, -1, -1, 31, 32, -1, - -1, -1, -1, -1, 38, -1, -1, -1, -1, 43, - 44, 45, 46, -1, -1, 3, 4, -1, 52, 7, - 8, -1, -1, 11, 58, 59, -1, 61, -1, 63, - -1, -1, 66, 67, -1, 69, -1, -1, -1, -1, - -1, -1, 3, 4, -1, -1, 7, 8, -1, -1, - 38, -1, -1, -1, -1, 43, 44, 45, 46, -1, - -1, -1, -1, 9, 52, -1, -1, -1, 14, -1, - 58, 59, -1, 61, -1, 63, -1, 38, 66, 67, - -1, 69, 43, 44, 45, 46, -1, -1, 3, 4, - -1, 52, 7, 8, 40, 41, 42, 58, 59, -1, - 61, -1, 63, -1, -1, 66, 67, 53, 69, -1, - 56, 57, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 9, 43, 44, - 45, 46, 14, -1, -1, -1, -1, 52, -1, -1, - -1, -1, -1, 58, 59, -1, 61, -1, 63, -1, - -1, 66, 67, -1, 69, -1, -1, -1, 40, 41, - 42, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 53, 54, -1, 56, 57 + 1, 29, 30, 26, 29, 229, 1, 46, 59, 60, + 212, 13, 14, 15, 87, 70, 1, 4, 27, 21, + 22, 44, 24, 25, 1, 26, 41, 9, 17, 17, + 4, 52, 52, 35, 1, 301, 44, 45, 68, 6, + 239, 1, 43, 44, 310, 1, 1, 1, 4, 71, + 4, 6, 61, 73, 75, 75, 71, 52, 59, 60, + 21, 22, 117, 24, 68, 66, 73, 52, 68, 29, + 50, 52, 127, 128, 35, 57, 58, 301, 68, 56, + 75, 68, 71, 71, 57, 86, 310, 88, 89, 90, + 75, 3, 4, 67, 95, 72, 98, 99, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 109, 307, 141, + 183, 228, 144, 69, 9, 116, 141, 44, 45, 144, + 9, 176, 3, 125, 66, 327, 15, 52, 330, 5, + 4, 1, 133, 39, 46, 47, 137, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 13, + 81, 1, 41, 42, 155, 157, 69, 41, 70, 3, + 91, 278, 57, 58, 125, 282, 198, 199, 57, 58, + 202, 68, 204, 198, 199, 68, 208, 202, 68, 204, + 68, 141, 299, 208, 144, 302, 56, 238, 213, 61, + 62, 63, 247, 75, 66, 1, 251, 252, 69, 69, + 273, 233, 203, 134, 10, 49, 56, 51, 233, 4, + 249, 27, 329, 10, 215, 332, 248, 68, 21, 69, + 275, 222, 223, 248, 55, 226, 227, 266, 74, 284, + 7, 256, 7, 304, 30, 258, 291, 238, 198, 199, + 223, 287, 202, 25, 204, 177, 52, 157, 208, 266, + 56, 1, 1, 281, 3, 4, 311, 258, 7, 8, + 285, 10, 318, 69, -1, 196, -1, 322, 293, 75, + 7, 8, -1, 233, 205, 25, 26, -1, -1, -1, + 9, -1, 283, 214, 285, 287, 15, 218, 248, -1, + 39, -1, -1, 295, -1, 44, 45, 46, 47, -1, + -1, -1, 52, 52, 53, 12, 13, 14, -1, 240, + 59, 60, 41, 62, -1, 64, 53, -1, 67, 68, + 69, 70, 59, 60, 74, 62, 75, -1, 57, 58, + -1, -1, 263, -1, 295, -1, -1, 44, 45, 270, + 271, -1, -1, 274, -1, -1, 53, 59, 60, 61, + 62, 63, -1, 9, 66, -1, -1, -1, -1, 15, + -1, 292, -1, 294, -1, 296, 297, 298, -1, 300, + -1, -1, 0, 1, -1, 3, 4, -1, -1, 7, + 8, -1, -1, -1, -1, 41, 42, 43, -1, 320, + 18, 19, 323, -1, -1, 326, -1, 328, 54, -1, + -1, 57, 58, -1, -1, -1, -1, -1, 36, 37, + 38, 39, -1, 69, -1, -1, 44, 45, 46, 47, + 48, -1, -1, -1, 52, 53, 59, 60, 61, 62, + 63, 59, 60, 66, 62, -1, 64, -1, -1, 67, + 68, -1, 70, -1, -1, 73, 1, 75, 3, 4, + -1, -1, 7, 8, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 20, -1, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, -1, -1, -1, 39, 40, -1, -1, -1, 44, + 45, 46, 47, -1, -1, -1, -1, 52, 53, -1, + -1, -1, -1, -1, 59, 60, -1, 62, -1, 64, + -1, -1, 67, 68, -1, 70, -1, -1, 73, 74, + 75, 1, -1, 3, 4, -1, -1, 7, 8, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 20, -1, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, -1, -1, -1, 39, + 40, -1, -1, -1, 44, 45, 46, 47, -1, -1, + -1, -1, 52, 53, -1, -1, -1, -1, -1, 59, + 60, -1, 62, -1, 64, -1, -1, 67, 68, -1, + 70, -1, -1, 73, 74, 75, 1, -1, 3, 4, + -1, -1, 7, 8, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 20, -1, 22, 23, 24, + -1, -1, 27, 28, 29, 30, 31, 32, 33, 34, + 35, -1, -1, -1, 39, 40, -1, -1, -1, 44, + 45, 46, 47, -1, -1, -1, -1, -1, 53, -1, + -1, -1, -1, -1, 59, 60, -1, 62, -1, 64, + -1, -1, 67, 68, -1, 70, -1, -1, 73, 74, + 75, 3, 4, -1, -1, 7, 8, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 20, -1, + 22, 23, 24, -1, -1, 27, 28, 29, 30, 31, + 32, 33, 34, 35, -1, -1, -1, 39, 40, -1, + -1, -1, 44, 45, 46, 47, -1, -1, 3, 4, + -1, 53, 7, 8, -1, -1, -1, 59, 60, -1, + 62, -1, 64, -1, -1, 67, 68, -1, 70, -1, + -1, 73, -1, 75, -1, -1, -1, -1, -1, 1, + -1, 3, 4, -1, 39, 7, 8, -1, -1, 44, + 45, 46, 47, -1, -1, -1, -1, -1, 53, -1, + -1, -1, -1, -1, 59, 60, -1, 62, -1, 64, + -1, -1, 67, 68, -1, 70, -1, 39, -1, -1, + 75, -1, 44, 45, 46, 47, 1, -1, 3, 4, + -1, 53, 7, 8, -1, -1, -1, 59, 60, -1, + 62, -1, 64, -1, -1, 67, 68, 69, 70, -1, + -1, -1, -1, 1, -1, 3, 4, -1, -1, 7, + 8, -1, -1, -1, 39, -1, -1, -1, -1, 44, + 45, 46, 47, -1, -1, -1, -1, -1, 53, -1, + -1, -1, -1, -1, 59, 60, -1, 62, -1, 64, + -1, 39, 67, 68, -1, 70, 44, 45, 46, 47, + -1, -1, -1, 3, 4, 53, -1, 7, 8, -1, + -1, 59, 60, -1, 62, -1, 64, -1, -1, 67, + 68, -1, 70, 23, -1, -1, -1, -1, -1, -1, + -1, -1, 32, 33, -1, -1, 3, 4, -1, 39, + 7, 8, -1, -1, 44, 45, 46, 47, -1, -1, + -1, -1, -1, 53, -1, -1, 23, -1, -1, 59, + 60, -1, 62, -1, 64, 32, 33, 67, 68, -1, + 70, -1, 39, -1, -1, -1, -1, 44, 45, 46, + 47, -1, -1, 3, 4, -1, 53, 7, 8, -1, + -1, 11, 59, 60, -1, 62, -1, 64, -1, -1, + 67, 68, -1, 70, -1, -1, -1, -1, -1, -1, + 3, 4, -1, -1, 7, 8, -1, -1, -1, 39, + -1, -1, -1, -1, 44, 45, 46, 47, -1, -1, + -1, 9, -1, 53, -1, -1, -1, 15, -1, 59, + 60, -1, 62, -1, 64, -1, 39, 67, 68, -1, + 70, 44, 45, 46, 47, -1, -1, 3, 4, -1, + 53, 7, 8, 41, 42, 43, 59, 60, -1, 62, + -1, 64, -1, -1, 67, 68, 54, 70, 9, 57, + 58, -1, -1, -1, 15, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 9, 75, 44, 45, + 46, 47, 15, 9, -1, -1, -1, 53, -1, 15, + 41, 42, 43, 59, 60, -1, 62, -1, 64, -1, + -1, 67, 68, 54, 70, 56, 57, 58, 41, 42, + 43, -1, -1, -1, -1, 41, 42, 43, -1, -1, + -1, 54, 55, -1, 57, 58, -1, -1, 54, -1, + -1, 57, 58 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ static const yytype_uint8 yystos[] = { - 0, 76, 0, 1, 3, 4, 7, 8, 17, 18, - 35, 36, 37, 38, 43, 44, 45, 46, 47, 51, - 52, 58, 59, 61, 63, 66, 67, 69, 77, 80, - 84, 85, 87, 105, 113, 117, 118, 119, 120, 121, - 122, 130, 131, 67, 70, 127, 128, 129, 3, 4, - 45, 46, 69, 82, 83, 123, 131, 131, 131, 67, - 67, 69, 118, 131, 118, 118, 67, 120, 131, 1, - 112, 113, 48, 50, 122, 72, 74, 81, 89, 105, - 133, 137, 81, 86, 51, 9, 14, 40, 41, 42, - 53, 55, 56, 57, 115, 116, 11, 118, 58, 59, - 60, 61, 62, 65, 58, 59, 60, 61, 62, 65, - 12, 13, 43, 44, 52, 114, 111, 112, 113, 112, - 16, 127, 49, 67, 56, 107, 111, 111, 113, 43, - 44, 132, 1, 55, 68, 135, 139, 135, 1, 6, - 78, 1, 6, 79, 105, 106, 88, 106, 5, 113, - 130, 113, 113, 113, 106, 113, 38, 118, 118, 118, - 118, 118, 118, 118, 118, 118, 118, 118, 118, 13, - 113, 135, 71, 1, 4, 108, 109, 118, 135, 135, - 113, 106, 40, 1, 113, 1, 89, 1, 89, 1, - 19, 21, 22, 23, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 39, 73, 90, 91, 93, 100, 104, - 113, 133, 134, 137, 54, 113, 123, 135, 1, 139, - 130, 67, 92, 4, 67, 67, 67, 106, 67, 89, - 89, 89, 110, 113, 89, 106, 89, 94, 88, 136, - 137, 106, 113, 106, 1, 4, 113, 110, 95, 4, - 113, 113, 90, 4, 93, 96, 89, 67, 101, 111, - 134, 106, 135, 89, 124, 125, 126, 127, 68, 135, - 135, 26, 40, 137, 112, 10, 102, 106, 16, 126, - 106, 106, 67, 130, 106, 135, 103, 90, 133, 90, - 113, 135, 113, 137, 117, 20, 97, 135, 106, 137, - 106, 106, 1, 24, 25, 98, 106, 106, 90, 106, - 96, 90, 7, 8, 58, 59, 85, 99, 54, 138, - 134, 96, 135, 7, 7, 138, 106, 135, 106, 106, - 88, 106, 90, 88, 90 + 0, 77, 0, 1, 3, 4, 7, 8, 18, 19, + 36, 37, 38, 39, 44, 45, 46, 47, 48, 52, + 53, 59, 60, 62, 64, 67, 68, 70, 78, 81, + 85, 86, 88, 106, 114, 118, 119, 120, 121, 122, + 123, 131, 132, 68, 71, 128, 129, 130, 3, 4, + 46, 47, 70, 83, 84, 124, 132, 132, 132, 68, + 68, 70, 119, 132, 119, 119, 68, 121, 132, 1, + 113, 114, 49, 51, 123, 73, 75, 82, 90, 106, + 134, 138, 82, 87, 52, 9, 15, 41, 42, 43, + 54, 56, 57, 58, 116, 117, 11, 119, 59, 60, + 61, 62, 63, 66, 59, 60, 61, 62, 63, 66, + 12, 13, 14, 44, 45, 53, 115, 112, 113, 114, + 113, 17, 128, 50, 68, 57, 108, 112, 112, 114, + 44, 45, 133, 1, 56, 69, 136, 140, 136, 1, + 6, 79, 1, 6, 80, 106, 107, 89, 107, 5, + 114, 131, 114, 114, 114, 107, 114, 39, 119, 119, + 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, + 13, 114, 136, 72, 1, 4, 109, 110, 119, 136, + 136, 114, 107, 41, 1, 114, 1, 90, 1, 90, + 1, 20, 22, 23, 24, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 40, 74, 91, 92, 94, 101, + 105, 114, 134, 135, 138, 55, 114, 124, 136, 1, + 140, 131, 68, 93, 4, 68, 68, 68, 107, 68, + 90, 90, 90, 111, 114, 90, 107, 90, 95, 89, + 137, 138, 107, 114, 107, 1, 4, 114, 111, 96, + 4, 114, 114, 91, 4, 94, 97, 90, 68, 102, + 112, 135, 107, 136, 90, 125, 126, 127, 128, 69, + 136, 136, 27, 41, 138, 113, 10, 103, 107, 17, + 127, 107, 107, 68, 131, 107, 136, 104, 91, 134, + 91, 114, 136, 114, 138, 118, 21, 98, 136, 107, + 138, 107, 107, 1, 25, 26, 99, 107, 107, 91, + 107, 97, 91, 7, 8, 59, 60, 86, 100, 55, + 139, 135, 97, 136, 7, 7, 139, 107, 136, 107, + 107, 89, 107, 91, 89, 91 }; /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const yytype_uint8 yyr1[] = { - 0, 75, 76, 76, 76, 76, 76, 77, 77, 77, - 77, 77, 78, 78, 78, 79, 79, 79, 80, 80, - 80, 80, 80, 80, 80, 81, 82, 82, 82, 82, - 83, 83, 84, 86, 85, 87, 87, 88, 88, 88, - 89, 89, 90, 90, 90, 90, 90, 90, 90, 90, - 90, 90, 91, 91, 91, 91, 91, 92, 91, 91, - 94, 93, 95, 93, 93, 93, 96, 96, 97, 97, - 97, 98, 98, 99, 99, 99, 99, 99, 100, 100, - 101, 101, 102, 103, 102, 104, 104, 105, 105, 106, - 106, 107, 107, 108, 108, 109, 109, 109, 109, 109, - 110, 110, 111, 111, 112, 112, 112, 112, 112, 112, - 113, 113, 113, 113, 113, 113, 113, 113, 114, 114, - 114, 115, 115, 116, 116, 117, 117, 117, 118, 118, - 118, 118, 118, 118, 118, 118, 118, 118, 118, 119, - 119, 119, 119, 119, 119, 119, 120, 120, 120, 120, - 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, - 121, 121, 122, 123, 123, 124, 124, 125, 125, 126, - 127, 128, 128, 129, 130, 130, 131, 131, 132, 132, - 132, 133, 134, 135, 136, 136, 137, 138, 139 + 0, 76, 77, 77, 77, 77, 77, 78, 78, 78, + 78, 78, 79, 79, 79, 80, 80, 80, 81, 81, + 81, 81, 81, 81, 81, 82, 83, 83, 83, 83, + 84, 84, 85, 87, 86, 88, 88, 89, 89, 89, + 90, 90, 91, 91, 91, 91, 91, 91, 91, 91, + 91, 91, 92, 92, 92, 92, 92, 93, 92, 92, + 95, 94, 96, 94, 94, 94, 97, 97, 98, 98, + 98, 99, 99, 100, 100, 100, 100, 100, 101, 101, + 102, 102, 103, 104, 103, 105, 105, 106, 106, 107, + 107, 108, 108, 109, 109, 110, 110, 110, 110, 110, + 111, 111, 112, 112, 113, 113, 113, 113, 113, 113, + 114, 114, 114, 114, 114, 114, 114, 114, 115, 115, + 115, 115, 116, 116, 117, 117, 118, 118, 118, 119, + 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, + 120, 120, 120, 120, 120, 120, 120, 121, 121, 121, + 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, + 121, 122, 122, 123, 124, 124, 125, 125, 126, 126, + 127, 128, 129, 129, 130, 131, 131, 132, 132, 133, + 133, 133, 134, 135, 136, 137, 137, 138, 139, 140 }; /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ @@ -1166,13 +1163,13 @@ static const yytype_uint8 yyr2[] = 1, 0, 2, 0, 1, 1, 3, 1, 2, 3, 0, 1, 0, 1, 1, 3, 1, 2, 3, 3, 3, 3, 3, 3, 3, 3, 5, 1, 1, 1, - 2, 1, 1, 1, 1, 1, 1, 2, 1, 3, - 3, 3, 3, 3, 3, 3, 2, 2, 5, 4, - 3, 3, 3, 3, 3, 3, 1, 2, 3, 4, - 4, 1, 1, 1, 2, 2, 1, 1, 2, 2, - 1, 2, 4, 0, 1, 0, 2, 1, 2, 1, - 3, 1, 2, 2, 1, 2, 1, 3, 1, 1, - 0, 2, 2, 1, 0, 1, 1, 1, 2 + 1, 2, 1, 1, 1, 1, 1, 1, 2, 1, + 3, 3, 3, 3, 3, 3, 3, 2, 2, 5, + 4, 3, 3, 3, 3, 3, 3, 1, 2, 3, + 4, 4, 1, 1, 1, 2, 2, 1, 1, 2, + 2, 1, 2, 4, 0, 1, 0, 2, 1, 2, + 1, 3, 1, 2, 2, 1, 2, 1, 3, 1, + 1, 0, 2, 2, 1, 0, 1, 1, 1, 2 }; @@ -1854,7 +1851,7 @@ yyreduce: rule = 0; yyerrok; } -#line 1858 "awkgram.c" /* yacc.c:1646 */ +#line 1855 "awkgram.c" /* yacc.c:1646 */ break; case 5: @@ -1862,7 +1859,7 @@ yyreduce: { next_sourcefile(); } -#line 1866 "awkgram.c" /* yacc.c:1646 */ +#line 1863 "awkgram.c" /* yacc.c:1646 */ break; case 6: @@ -1875,7 +1872,7 @@ yyreduce: */ /* yyerrok; */ } -#line 1879 "awkgram.c" /* yacc.c:1646 */ +#line 1876 "awkgram.c" /* yacc.c:1646 */ break; case 7: @@ -1884,7 +1881,7 @@ yyreduce: (void) append_rule((yyvsp[-1]), (yyvsp[0])); first_rule = false; } -#line 1888 "awkgram.c" /* yacc.c:1646 */ +#line 1885 "awkgram.c" /* yacc.c:1646 */ break; case 8: @@ -1899,7 +1896,7 @@ yyreduce: } else /* pattern rule with non-empty pattern */ (void) append_rule((yyvsp[-1]), NULL); } -#line 1903 "awkgram.c" /* yacc.c:1646 */ +#line 1900 "awkgram.c" /* yacc.c:1646 */ break; case 9: @@ -1909,7 +1906,7 @@ yyreduce: (void) mk_function((yyvsp[-1]), (yyvsp[0])); yyerrok; } -#line 1913 "awkgram.c" /* yacc.c:1646 */ +#line 1910 "awkgram.c" /* yacc.c:1646 */ break; case 10: @@ -1919,7 +1916,7 @@ yyreduce: at_seen = false; yyerrok; } -#line 1923 "awkgram.c" /* yacc.c:1646 */ +#line 1920 "awkgram.c" /* yacc.c:1646 */ break; case 11: @@ -1929,7 +1926,7 @@ yyreduce: at_seen = false; yyerrok; } -#line 1933 "awkgram.c" /* yacc.c:1646 */ +#line 1930 "awkgram.c" /* yacc.c:1646 */ break; case 12: @@ -1941,19 +1938,19 @@ yyreduce: bcfree((yyvsp[0])); (yyval) = NULL; } -#line 1945 "awkgram.c" /* yacc.c:1646 */ +#line 1942 "awkgram.c" /* yacc.c:1646 */ break; case 13: #line 275 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 1951 "awkgram.c" /* yacc.c:1646 */ +#line 1948 "awkgram.c" /* yacc.c:1646 */ break; case 14: #line 277 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 1957 "awkgram.c" /* yacc.c:1646 */ +#line 1954 "awkgram.c" /* yacc.c:1646 */ break; case 15: @@ -1965,19 +1962,19 @@ yyreduce: bcfree((yyvsp[0])); (yyval) = NULL; } -#line 1969 "awkgram.c" /* yacc.c:1646 */ +#line 1966 "awkgram.c" /* yacc.c:1646 */ break; case 16: #line 290 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 1975 "awkgram.c" /* yacc.c:1646 */ +#line 1972 "awkgram.c" /* yacc.c:1646 */ break; case 17: #line 292 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 1981 "awkgram.c" /* yacc.c:1646 */ +#line 1978 "awkgram.c" /* yacc.c:1646 */ break; case 18: @@ -1990,7 +1987,7 @@ yyreduce: } else (yyval) = NULL; } -#line 1994 "awkgram.c" /* yacc.c:1646 */ +#line 1991 "awkgram.c" /* yacc.c:1646 */ break; case 19: @@ -2003,7 +2000,7 @@ yyreduce: } else (yyval) = (yyvsp[0]); } -#line 2007 "awkgram.c" /* yacc.c:1646 */ +#line 2004 "awkgram.c" /* yacc.c:1646 */ break; case 20: @@ -2037,7 +2034,7 @@ yyreduce: (yyval) = list_append(list_merge((yyvsp[-3]), (yyvsp[0])), tp); rule = Rule; } -#line 2041 "awkgram.c" /* yacc.c:1646 */ +#line 2038 "awkgram.c" /* yacc.c:1646 */ break; case 21: @@ -2055,7 +2052,7 @@ yyreduce: check_comment(); (yyval) = (yyvsp[0]); } -#line 2059 "awkgram.c" /* yacc.c:1646 */ +#line 2056 "awkgram.c" /* yacc.c:1646 */ break; case 22: @@ -2073,7 +2070,7 @@ yyreduce: check_comment(); (yyval) = (yyvsp[0]); } -#line 2077 "awkgram.c" /* yacc.c:1646 */ +#line 2074 "awkgram.c" /* yacc.c:1646 */ break; case 23: @@ -2085,7 +2082,7 @@ yyreduce: check_comment(); (yyval) = (yyvsp[0]); } -#line 2089 "awkgram.c" /* yacc.c:1646 */ +#line 2086 "awkgram.c" /* yacc.c:1646 */ break; case 24: @@ -2097,7 +2094,7 @@ yyreduce: check_comment(); (yyval) = (yyvsp[0]); } -#line 2101 "awkgram.c" /* yacc.c:1646 */ +#line 2098 "awkgram.c" /* yacc.c:1646 */ break; case 25: @@ -2110,19 +2107,19 @@ yyreduce: ip = (yyvsp[-3]); (yyval) = ip; } -#line 2114 "awkgram.c" /* yacc.c:1646 */ +#line 2111 "awkgram.c" /* yacc.c:1646 */ break; case 26: #line 405 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 2120 "awkgram.c" /* yacc.c:1646 */ +#line 2117 "awkgram.c" /* yacc.c:1646 */ break; case 27: #line 407 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 2126 "awkgram.c" /* yacc.c:1646 */ +#line 2123 "awkgram.c" /* yacc.c:1646 */ break; case 28: @@ -2132,7 +2129,7 @@ yyreduce: tokstart); YYABORT; } -#line 2136 "awkgram.c" /* yacc.c:1646 */ +#line 2133 "awkgram.c" /* yacc.c:1646 */ break; case 29: @@ -2141,7 +2138,7 @@ yyreduce: (yyval) = (yyvsp[0]); at_seen = false; } -#line 2145 "awkgram.c" /* yacc.c:1646 */ +#line 2142 "awkgram.c" /* yacc.c:1646 */ break; case 32: @@ -2172,13 +2169,13 @@ yyreduce: /* $4 already free'd in install_function */ (yyval) = (yyvsp[-5]); } -#line 2176 "awkgram.c" /* yacc.c:1646 */ +#line 2173 "awkgram.c" /* yacc.c:1646 */ break; case 33: #line 462 "awkgram.y" /* yacc.c:1646 */ { want_regexp = true; } -#line 2182 "awkgram.c" /* yacc.c:1646 */ +#line 2179 "awkgram.c" /* yacc.c:1646 */ break; case 34: @@ -2211,13 +2208,13 @@ yyreduce: (yyval)->opcode = Op_match_rec; (yyval)->memory = n; } -#line 2215 "awkgram.c" /* yacc.c:1646 */ +#line 2212 "awkgram.c" /* yacc.c:1646 */ break; case 35: #line 496 "awkgram.y" /* yacc.c:1646 */ { bcfree((yyvsp[0])); } -#line 2221 "awkgram.c" /* yacc.c:1646 */ +#line 2218 "awkgram.c" /* yacc.c:1646 */ break; case 37: @@ -2228,7 +2225,7 @@ yyreduce: comment = NULL; } else (yyval) = NULL; } -#line 2232 "awkgram.c" /* yacc.c:1646 */ +#line 2229 "awkgram.c" /* yacc.c:1646 */ break; case 38: @@ -2260,25 +2257,25 @@ yyreduce: } yyerrok; } -#line 2264 "awkgram.c" /* yacc.c:1646 */ +#line 2261 "awkgram.c" /* yacc.c:1646 */ break; case 39: #line 537 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 2270 "awkgram.c" /* yacc.c:1646 */ +#line 2267 "awkgram.c" /* yacc.c:1646 */ break; case 42: #line 547 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 2276 "awkgram.c" /* yacc.c:1646 */ +#line 2273 "awkgram.c" /* yacc.c:1646 */ break; case 43: #line 549 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } -#line 2282 "awkgram.c" /* yacc.c:1646 */ +#line 2279 "awkgram.c" /* yacc.c:1646 */ break; case 44: @@ -2289,7 +2286,7 @@ yyreduce: else (yyval) = (yyvsp[0]); } -#line 2293 "awkgram.c" /* yacc.c:1646 */ +#line 2290 "awkgram.c" /* yacc.c:1646 */ break; case 45: @@ -2383,7 +2380,7 @@ yyreduce: break_allowed--; fix_break_continue(ip, tbreak, NULL); } -#line 2387 "awkgram.c" /* yacc.c:1646 */ +#line 2384 "awkgram.c" /* yacc.c:1646 */ break; case 46: @@ -2429,7 +2426,7 @@ yyreduce: continue_allowed--; fix_break_continue(ip, tbreak, tcont); } -#line 2433 "awkgram.c" /* yacc.c:1646 */ +#line 2430 "awkgram.c" /* yacc.c:1646 */ break; case 47: @@ -2475,7 +2472,7 @@ yyreduce: } /* else $1 and $4 are NULLs */ } -#line 2479 "awkgram.c" /* yacc.c:1646 */ +#line 2476 "awkgram.c" /* yacc.c:1646 */ break; case 48: @@ -2592,7 +2589,7 @@ regular_loop: break_allowed--; continue_allowed--; } -#line 2596 "awkgram.c" /* yacc.c:1646 */ +#line 2593 "awkgram.c" /* yacc.c:1646 */ break; case 49: @@ -2603,7 +2600,7 @@ regular_loop: break_allowed--; continue_allowed--; } -#line 2607 "awkgram.c" /* yacc.c:1646 */ +#line 2604 "awkgram.c" /* yacc.c:1646 */ break; case 50: @@ -2614,7 +2611,7 @@ regular_loop: break_allowed--; continue_allowed--; } -#line 2618 "awkgram.c" /* yacc.c:1646 */ +#line 2615 "awkgram.c" /* yacc.c:1646 */ break; case 51: @@ -2625,7 +2622,7 @@ regular_loop: else (yyval) = (yyvsp[0]); } -#line 2629 "awkgram.c" /* yacc.c:1646 */ +#line 2626 "awkgram.c" /* yacc.c:1646 */ break; case 52: @@ -2638,7 +2635,7 @@ regular_loop: (yyval) = list_create((yyvsp[-1])); } -#line 2642 "awkgram.c" /* yacc.c:1646 */ +#line 2639 "awkgram.c" /* yacc.c:1646 */ break; case 53: @@ -2651,7 +2648,7 @@ regular_loop: (yyval) = list_create((yyvsp[-1])); } -#line 2655 "awkgram.c" /* yacc.c:1646 */ +#line 2652 "awkgram.c" /* yacc.c:1646 */ break; case 54: @@ -2664,7 +2661,7 @@ regular_loop: (yyvsp[-1])->target_jmp = ip_rec; (yyval) = list_create((yyvsp[-1])); } -#line 2668 "awkgram.c" /* yacc.c:1646 */ +#line 2665 "awkgram.c" /* yacc.c:1646 */ break; case 55: @@ -2679,7 +2676,7 @@ regular_loop: (yyvsp[-1])->target_endfile = ip_endfile; (yyval) = list_create((yyvsp[-1])); } -#line 2683 "awkgram.c" /* yacc.c:1646 */ +#line 2680 "awkgram.c" /* yacc.c:1646 */ break; case 56: @@ -2698,7 +2695,7 @@ regular_loop: } else (yyval) = list_append((yyvsp[-1]), (yyvsp[-2])); } -#line 2702 "awkgram.c" /* yacc.c:1646 */ +#line 2699 "awkgram.c" /* yacc.c:1646 */ break; case 57: @@ -2707,7 +2704,7 @@ regular_loop: if (! in_function) yyerror(_("`return' used outside function context")); } -#line 2711 "awkgram.c" /* yacc.c:1646 */ +#line 2708 "awkgram.c" /* yacc.c:1646 */ break; case 58: @@ -2732,13 +2729,13 @@ regular_loop: (yyval) = list_append((yyvsp[-1]), (yyvsp[-3])); } } -#line 2736 "awkgram.c" /* yacc.c:1646 */ +#line 2733 "awkgram.c" /* yacc.c:1646 */ break; case 60: #line 957 "awkgram.y" /* yacc.c:1646 */ { in_print = true; in_parens = 0; } -#line 2742 "awkgram.c" /* yacc.c:1646 */ +#line 2739 "awkgram.c" /* yacc.c:1646 */ break; case 61: @@ -2839,13 +2836,13 @@ regular_print: } } } -#line 2843 "awkgram.c" /* yacc.c:1646 */ +#line 2840 "awkgram.c" /* yacc.c:1646 */ break; case 62: #line 1055 "awkgram.y" /* yacc.c:1646 */ { sub_counter = 0; } -#line 2849 "awkgram.c" /* yacc.c:1646 */ +#line 2846 "awkgram.c" /* yacc.c:1646 */ break; case 63: @@ -2882,7 +2879,7 @@ regular_print: (yyval) = list_append(list_append((yyvsp[0]), (yyvsp[-2])), (yyvsp[-3])); } } -#line 2886 "awkgram.c" /* yacc.c:1646 */ +#line 2883 "awkgram.c" /* yacc.c:1646 */ break; case 64: @@ -2912,31 +2909,31 @@ regular_print: fatal(_("`delete' is not allowed with FUNCTAB")); } } -#line 2916 "awkgram.c" /* yacc.c:1646 */ +#line 2913 "awkgram.c" /* yacc.c:1646 */ break; case 65: #line 1119 "awkgram.y" /* yacc.c:1646 */ { (yyval) = optimize_assignment((yyvsp[0])); } -#line 2922 "awkgram.c" /* yacc.c:1646 */ +#line 2919 "awkgram.c" /* yacc.c:1646 */ break; case 66: #line 1124 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 2928 "awkgram.c" /* yacc.c:1646 */ +#line 2925 "awkgram.c" /* yacc.c:1646 */ break; case 67: #line 1126 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 2934 "awkgram.c" /* yacc.c:1646 */ +#line 2931 "awkgram.c" /* yacc.c:1646 */ break; case 68: #line 1131 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 2940 "awkgram.c" /* yacc.c:1646 */ +#line 2937 "awkgram.c" /* yacc.c:1646 */ break; case 69: @@ -2947,13 +2944,13 @@ regular_print: else (yyval) = list_prepend((yyvsp[-1]), (yyvsp[0])); } -#line 2951 "awkgram.c" /* yacc.c:1646 */ +#line 2948 "awkgram.c" /* yacc.c:1646 */ break; case 70: #line 1140 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 2957 "awkgram.c" /* yacc.c:1646 */ +#line 2954 "awkgram.c" /* yacc.c:1646 */ break; case 71: @@ -2969,7 +2966,7 @@ regular_print: bcfree((yyvsp[-2])); (yyval) = (yyvsp[-4]); } -#line 2973 "awkgram.c" /* yacc.c:1646 */ +#line 2970 "awkgram.c" /* yacc.c:1646 */ break; case 72: @@ -2984,13 +2981,13 @@ regular_print: (yyvsp[-3])->case_stmt = casestmt; (yyval) = (yyvsp[-3]); } -#line 2988 "awkgram.c" /* yacc.c:1646 */ +#line 2985 "awkgram.c" /* yacc.c:1646 */ break; case 73: #line 1171 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 2994 "awkgram.c" /* yacc.c:1646 */ +#line 2991 "awkgram.c" /* yacc.c:1646 */ break; case 74: @@ -3002,7 +2999,7 @@ regular_print: bcfree((yyvsp[-1])); (yyval) = (yyvsp[0]); } -#line 3006 "awkgram.c" /* yacc.c:1646 */ +#line 3003 "awkgram.c" /* yacc.c:1646 */ break; case 75: @@ -3011,13 +3008,13 @@ regular_print: bcfree((yyvsp[-1])); (yyval) = (yyvsp[0]); } -#line 3015 "awkgram.c" /* yacc.c:1646 */ +#line 3012 "awkgram.c" /* yacc.c:1646 */ break; case 76: #line 1186 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3021 "awkgram.c" /* yacc.c:1646 */ +#line 3018 "awkgram.c" /* yacc.c:1646 */ break; case 77: @@ -3026,19 +3023,19 @@ regular_print: (yyvsp[0])->opcode = Op_push_re; (yyval) = (yyvsp[0]); } -#line 3030 "awkgram.c" /* yacc.c:1646 */ +#line 3027 "awkgram.c" /* yacc.c:1646 */ break; case 78: #line 1196 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3036 "awkgram.c" /* yacc.c:1646 */ +#line 3033 "awkgram.c" /* yacc.c:1646 */ break; case 79: #line 1198 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3042 "awkgram.c" /* yacc.c:1646 */ +#line 3039 "awkgram.c" /* yacc.c:1646 */ break; case 81: @@ -3046,7 +3043,7 @@ regular_print: { (yyval) = (yyvsp[-1]); } -#line 3050 "awkgram.c" /* yacc.c:1646 */ +#line 3047 "awkgram.c" /* yacc.c:1646 */ break; case 82: @@ -3056,13 +3053,13 @@ regular_print: in_parens = 0; (yyval) = NULL; } -#line 3060 "awkgram.c" /* yacc.c:1646 */ +#line 3057 "awkgram.c" /* yacc.c:1646 */ break; case 83: #line 1220 "awkgram.y" /* yacc.c:1646 */ { in_print = false; in_parens = 0; } -#line 3066 "awkgram.c" /* yacc.c:1646 */ +#line 3063 "awkgram.c" /* yacc.c:1646 */ break; case 84: @@ -3074,7 +3071,7 @@ regular_print: yyerror(_("multistage two-way pipelines don't work")); (yyval) = list_prepend((yyvsp[0]), (yyvsp[-2])); } -#line 3078 "awkgram.c" /* yacc.c:1646 */ +#line 3075 "awkgram.c" /* yacc.c:1646 */ break; case 85: @@ -3082,7 +3079,7 @@ regular_print: { (yyval) = mk_condition((yyvsp[-3]), (yyvsp[-5]), (yyvsp[0]), NULL, NULL); } -#line 3086 "awkgram.c" /* yacc.c:1646 */ +#line 3083 "awkgram.c" /* yacc.c:1646 */ break; case 86: @@ -3090,13 +3087,13 @@ regular_print: { (yyval) = mk_condition((yyvsp[-6]), (yyvsp[-8]), (yyvsp[-3]), (yyvsp[-2]), (yyvsp[0])); } -#line 3094 "awkgram.c" /* yacc.c:1646 */ +#line 3091 "awkgram.c" /* yacc.c:1646 */ break; case 91: #line 1254 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3100 "awkgram.c" /* yacc.c:1646 */ +#line 3097 "awkgram.c" /* yacc.c:1646 */ break; case 92: @@ -3105,19 +3102,19 @@ regular_print: bcfree((yyvsp[-1])); (yyval) = (yyvsp[0]); } -#line 3109 "awkgram.c" /* yacc.c:1646 */ +#line 3106 "awkgram.c" /* yacc.c:1646 */ break; case 93: #line 1264 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3115 "awkgram.c" /* yacc.c:1646 */ +#line 3112 "awkgram.c" /* yacc.c:1646 */ break; case 94: #line 1266 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3121 "awkgram.c" /* yacc.c:1646 */ +#line 3118 "awkgram.c" /* yacc.c:1646 */ break; case 95: @@ -3126,7 +3123,7 @@ regular_print: (yyvsp[0])->param_count = 0; (yyval) = list_create((yyvsp[0])); } -#line 3130 "awkgram.c" /* yacc.c:1646 */ +#line 3127 "awkgram.c" /* yacc.c:1646 */ break; case 96: @@ -3136,55 +3133,55 @@ regular_print: (yyval) = list_append((yyvsp[-2]), (yyvsp[0])); yyerrok; } -#line 3140 "awkgram.c" /* yacc.c:1646 */ +#line 3137 "awkgram.c" /* yacc.c:1646 */ break; case 97: #line 1282 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3146 "awkgram.c" /* yacc.c:1646 */ +#line 3143 "awkgram.c" /* yacc.c:1646 */ break; case 98: #line 1284 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } -#line 3152 "awkgram.c" /* yacc.c:1646 */ +#line 3149 "awkgram.c" /* yacc.c:1646 */ break; case 99: #line 1286 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-2]); } -#line 3158 "awkgram.c" /* yacc.c:1646 */ +#line 3155 "awkgram.c" /* yacc.c:1646 */ break; case 100: #line 1292 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3164 "awkgram.c" /* yacc.c:1646 */ +#line 3161 "awkgram.c" /* yacc.c:1646 */ break; case 101: #line 1294 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3170 "awkgram.c" /* yacc.c:1646 */ +#line 3167 "awkgram.c" /* yacc.c:1646 */ break; case 102: #line 1299 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3176 "awkgram.c" /* yacc.c:1646 */ +#line 3173 "awkgram.c" /* yacc.c:1646 */ break; case 103: #line 1301 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3182 "awkgram.c" /* yacc.c:1646 */ +#line 3179 "awkgram.c" /* yacc.c:1646 */ break; case 104: #line 1306 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_expression_list(NULL, (yyvsp[0])); } -#line 3188 "awkgram.c" /* yacc.c:1646 */ +#line 3185 "awkgram.c" /* yacc.c:1646 */ break; case 105: @@ -3193,13 +3190,13 @@ regular_print: (yyval) = mk_expression_list((yyvsp[-2]), (yyvsp[0])); yyerrok; } -#line 3197 "awkgram.c" /* yacc.c:1646 */ +#line 3194 "awkgram.c" /* yacc.c:1646 */ break; case 106: #line 1313 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3203 "awkgram.c" /* yacc.c:1646 */ +#line 3200 "awkgram.c" /* yacc.c:1646 */ break; case 107: @@ -3211,7 +3208,7 @@ regular_print: */ (yyval) = (yyvsp[-1]); } -#line 3215 "awkgram.c" /* yacc.c:1646 */ +#line 3212 "awkgram.c" /* yacc.c:1646 */ break; case 108: @@ -3220,7 +3217,7 @@ regular_print: /* Ditto */ (yyval) = mk_expression_list((yyvsp[-2]), (yyvsp[0])); } -#line 3224 "awkgram.c" /* yacc.c:1646 */ +#line 3221 "awkgram.c" /* yacc.c:1646 */ break; case 109: @@ -3229,7 +3226,7 @@ regular_print: /* Ditto */ (yyval) = (yyvsp[-2]); } -#line 3233 "awkgram.c" /* yacc.c:1646 */ +#line 3230 "awkgram.c" /* yacc.c:1646 */ break; case 110: @@ -3240,19 +3237,19 @@ regular_print: _("regular expression on right of assignment")); (yyval) = mk_assignment((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3244 "awkgram.c" /* yacc.c:1646 */ +#line 3241 "awkgram.c" /* yacc.c:1646 */ break; case 111: #line 1344 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_boolean((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3250 "awkgram.c" /* yacc.c:1646 */ +#line 3247 "awkgram.c" /* yacc.c:1646 */ break; case 112: #line 1346 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_boolean((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3256 "awkgram.c" /* yacc.c:1646 */ +#line 3253 "awkgram.c" /* yacc.c:1646 */ break; case 113: @@ -3272,7 +3269,7 @@ regular_print: (yyval) = list_append(list_merge((yyvsp[-2]), (yyvsp[0])), (yyvsp[-1])); } } -#line 3276 "awkgram.c" /* yacc.c:1646 */ +#line 3273 "awkgram.c" /* yacc.c:1646 */ break; case 114: @@ -3286,7 +3283,7 @@ regular_print: (yyvsp[-1])->expr_count = 1; (yyval) = list_append(list_merge((yyvsp[-2]), (yyvsp[0])), (yyvsp[-1])); } -#line 3290 "awkgram.c" /* yacc.c:1646 */ +#line 3287 "awkgram.c" /* yacc.c:1646 */ break; case 115: @@ -3297,80 +3294,86 @@ regular_print: _("regular expression on right of comparison")); (yyval) = list_append(list_merge((yyvsp[-2]), (yyvsp[0])), (yyvsp[-1])); } -#line 3301 "awkgram.c" /* yacc.c:1646 */ +#line 3298 "awkgram.c" /* yacc.c:1646 */ break; case 116: #line 1381 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_condition((yyvsp[-4]), (yyvsp[-3]), (yyvsp[-2]), (yyvsp[-1]), (yyvsp[0])); } -#line 3307 "awkgram.c" /* yacc.c:1646 */ +#line 3304 "awkgram.c" /* yacc.c:1646 */ break; case 117: #line 1383 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3313 "awkgram.c" /* yacc.c:1646 */ +#line 3310 "awkgram.c" /* yacc.c:1646 */ break; case 118: #line 1388 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3319 "awkgram.c" /* yacc.c:1646 */ +#line 3316 "awkgram.c" /* yacc.c:1646 */ break; case 119: #line 1390 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3325 "awkgram.c" /* yacc.c:1646 */ +#line 3322 "awkgram.c" /* yacc.c:1646 */ break; case 120: #line 1392 "awkgram.y" /* yacc.c:1646 */ + { (yyval) = (yyvsp[0]); } +#line 3328 "awkgram.c" /* yacc.c:1646 */ + break; + + case 121: +#line 1394 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->opcode = Op_assign_quotient; (yyval) = (yyvsp[0]); } -#line 3334 "awkgram.c" /* yacc.c:1646 */ - break; - - case 121: -#line 1400 "awkgram.y" /* yacc.c:1646 */ - { (yyval) = (yyvsp[0]); } -#line 3340 "awkgram.c" /* yacc.c:1646 */ +#line 3337 "awkgram.c" /* yacc.c:1646 */ break; case 122: #line 1402 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3346 "awkgram.c" /* yacc.c:1646 */ +#line 3343 "awkgram.c" /* yacc.c:1646 */ break; case 123: -#line 1407 "awkgram.y" /* yacc.c:1646 */ +#line 1404 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3352 "awkgram.c" /* yacc.c:1646 */ +#line 3349 "awkgram.c" /* yacc.c:1646 */ break; case 124: #line 1409 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3358 "awkgram.c" /* yacc.c:1646 */ +#line 3355 "awkgram.c" /* yacc.c:1646 */ break; case 125: -#line 1414 "awkgram.y" /* yacc.c:1646 */ +#line 1411 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3364 "awkgram.c" /* yacc.c:1646 */ +#line 3361 "awkgram.c" /* yacc.c:1646 */ break; case 126: #line 1416 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3370 "awkgram.c" /* yacc.c:1646 */ +#line 3367 "awkgram.c" /* yacc.c:1646 */ break; case 127: #line 1418 "awkgram.y" /* yacc.c:1646 */ + { (yyval) = (yyvsp[0]); } +#line 3373 "awkgram.c" /* yacc.c:1646 */ + break; + + case 128: +#line 1420 "awkgram.y" /* yacc.c:1646 */ { int count = 2; bool is_simple_var = false; @@ -3417,47 +3420,47 @@ regular_print: max_args = count; } } -#line 3421 "awkgram.c" /* yacc.c:1646 */ - break; - - case 129: -#line 1470 "awkgram.y" /* yacc.c:1646 */ - { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3427 "awkgram.c" /* yacc.c:1646 */ +#line 3424 "awkgram.c" /* yacc.c:1646 */ break; case 130: #line 1472 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3433 "awkgram.c" /* yacc.c:1646 */ +#line 3430 "awkgram.c" /* yacc.c:1646 */ break; case 131: #line 1474 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3439 "awkgram.c" /* yacc.c:1646 */ +#line 3436 "awkgram.c" /* yacc.c:1646 */ break; case 132: #line 1476 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3445 "awkgram.c" /* yacc.c:1646 */ +#line 3442 "awkgram.c" /* yacc.c:1646 */ break; case 133: #line 1478 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3451 "awkgram.c" /* yacc.c:1646 */ +#line 3448 "awkgram.c" /* yacc.c:1646 */ break; case 134: #line 1480 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3457 "awkgram.c" /* yacc.c:1646 */ +#line 3454 "awkgram.c" /* yacc.c:1646 */ break; case 135: #line 1482 "awkgram.y" /* yacc.c:1646 */ + { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } +#line 3460 "awkgram.c" /* yacc.c:1646 */ + break; + + case 136: +#line 1484 "awkgram.y" /* yacc.c:1646 */ { /* * In BEGINFILE/ENDFILE, allow `getline [var] < file' @@ -3471,29 +3474,29 @@ regular_print: _("non-redirected `getline' undefined inside END action")); (yyval) = mk_getline((yyvsp[-2]), (yyvsp[-1]), (yyvsp[0]), redirect_input); } -#line 3475 "awkgram.c" /* yacc.c:1646 */ +#line 3478 "awkgram.c" /* yacc.c:1646 */ break; - case 136: -#line 1496 "awkgram.y" /* yacc.c:1646 */ + case 137: +#line 1498 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->opcode = Op_postincrement; (yyval) = mk_assignment((yyvsp[-1]), NULL, (yyvsp[0])); } -#line 3484 "awkgram.c" /* yacc.c:1646 */ +#line 3487 "awkgram.c" /* yacc.c:1646 */ break; - case 137: -#line 1501 "awkgram.y" /* yacc.c:1646 */ + case 138: +#line 1503 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->opcode = Op_postdecrement; (yyval) = mk_assignment((yyvsp[-1]), NULL, (yyvsp[0])); } -#line 3493 "awkgram.c" /* yacc.c:1646 */ +#line 3496 "awkgram.c" /* yacc.c:1646 */ break; - case 138: -#line 1506 "awkgram.y" /* yacc.c:1646 */ + case 139: +#line 1508 "awkgram.y" /* yacc.c:1646 */ { if (do_lint_old) { warning_ln((yyvsp[-1])->source_line, @@ -3513,64 +3516,64 @@ regular_print: (yyval) = list_append(list_merge(t, (yyvsp[0])), (yyvsp[-1])); } } -#line 3517 "awkgram.c" /* yacc.c:1646 */ +#line 3520 "awkgram.c" /* yacc.c:1646 */ break; - case 139: -#line 1531 "awkgram.y" /* yacc.c:1646 */ + case 140: +#line 1533 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_getline((yyvsp[-1]), (yyvsp[0]), (yyvsp[-3]), (yyvsp[-2])->redir_type); bcfree((yyvsp[-2])); } -#line 3526 "awkgram.c" /* yacc.c:1646 */ - break; - - case 140: -#line 1537 "awkgram.y" /* yacc.c:1646 */ - { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3532 "awkgram.c" /* yacc.c:1646 */ +#line 3529 "awkgram.c" /* yacc.c:1646 */ break; case 141: #line 1539 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3538 "awkgram.c" /* yacc.c:1646 */ +#line 3535 "awkgram.c" /* yacc.c:1646 */ break; case 142: #line 1541 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3544 "awkgram.c" /* yacc.c:1646 */ +#line 3541 "awkgram.c" /* yacc.c:1646 */ break; case 143: #line 1543 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3550 "awkgram.c" /* yacc.c:1646 */ +#line 3547 "awkgram.c" /* yacc.c:1646 */ break; case 144: #line 1545 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3556 "awkgram.c" /* yacc.c:1646 */ +#line 3553 "awkgram.c" /* yacc.c:1646 */ break; case 145: #line 1547 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3562 "awkgram.c" /* yacc.c:1646 */ +#line 3559 "awkgram.c" /* yacc.c:1646 */ break; case 146: -#line 1552 "awkgram.y" /* yacc.c:1646 */ +#line 1549 "awkgram.y" /* yacc.c:1646 */ + { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } +#line 3565 "awkgram.c" /* yacc.c:1646 */ + break; + + case 147: +#line 1554 "awkgram.y" /* yacc.c:1646 */ { (yyval) = list_create((yyvsp[0])); } -#line 3570 "awkgram.c" /* yacc.c:1646 */ +#line 3573 "awkgram.c" /* yacc.c:1646 */ break; - case 147: -#line 1556 "awkgram.y" /* yacc.c:1646 */ + case 148: +#line 1558 "awkgram.y" /* yacc.c:1646 */ { if ((yyvsp[0])->opcode == Op_match_rec) { (yyvsp[0])->opcode = Op_nomatch; @@ -3602,37 +3605,37 @@ regular_print: } } } -#line 3606 "awkgram.c" /* yacc.c:1646 */ +#line 3609 "awkgram.c" /* yacc.c:1646 */ break; - case 148: -#line 1588 "awkgram.y" /* yacc.c:1646 */ + case 149: +#line 1590 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } -#line 3612 "awkgram.c" /* yacc.c:1646 */ +#line 3615 "awkgram.c" /* yacc.c:1646 */ break; - case 149: -#line 1590 "awkgram.y" /* yacc.c:1646 */ + case 150: +#line 1592 "awkgram.y" /* yacc.c:1646 */ { (yyval) = snode((yyvsp[-1]), (yyvsp[-3])); if ((yyval) == NULL) YYABORT; } -#line 3622 "awkgram.c" /* yacc.c:1646 */ +#line 3625 "awkgram.c" /* yacc.c:1646 */ break; - case 150: -#line 1596 "awkgram.y" /* yacc.c:1646 */ + case 151: +#line 1598 "awkgram.y" /* yacc.c:1646 */ { (yyval) = snode((yyvsp[-1]), (yyvsp[-3])); if ((yyval) == NULL) YYABORT; } -#line 3632 "awkgram.c" /* yacc.c:1646 */ +#line 3635 "awkgram.c" /* yacc.c:1646 */ break; - case 151: -#line 1602 "awkgram.y" /* yacc.c:1646 */ + case 152: +#line 1604 "awkgram.y" /* yacc.c:1646 */ { static bool warned = false; @@ -3645,45 +3648,45 @@ regular_print: if ((yyval) == NULL) YYABORT; } -#line 3649 "awkgram.c" /* yacc.c:1646 */ +#line 3652 "awkgram.c" /* yacc.c:1646 */ break; - case 154: -#line 1617 "awkgram.y" /* yacc.c:1646 */ + case 155: +#line 1619 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[-1])->opcode = Op_preincrement; (yyval) = mk_assignment((yyvsp[0]), NULL, (yyvsp[-1])); } -#line 3658 "awkgram.c" /* yacc.c:1646 */ +#line 3661 "awkgram.c" /* yacc.c:1646 */ break; - case 155: -#line 1622 "awkgram.y" /* yacc.c:1646 */ + case 156: +#line 1624 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[-1])->opcode = Op_predecrement; (yyval) = mk_assignment((yyvsp[0]), NULL, (yyvsp[-1])); } -#line 3667 "awkgram.c" /* yacc.c:1646 */ +#line 3670 "awkgram.c" /* yacc.c:1646 */ break; - case 156: -#line 1627 "awkgram.y" /* yacc.c:1646 */ + case 157: +#line 1629 "awkgram.y" /* yacc.c:1646 */ { (yyval) = list_create((yyvsp[0])); } -#line 3675 "awkgram.c" /* yacc.c:1646 */ +#line 3678 "awkgram.c" /* yacc.c:1646 */ break; - case 157: -#line 1631 "awkgram.y" /* yacc.c:1646 */ + case 158: +#line 1633 "awkgram.y" /* yacc.c:1646 */ { (yyval) = list_create((yyvsp[0])); } -#line 3683 "awkgram.c" /* yacc.c:1646 */ +#line 3686 "awkgram.c" /* yacc.c:1646 */ break; - case 158: -#line 1635 "awkgram.y" /* yacc.c:1646 */ + case 159: +#line 1637 "awkgram.y" /* yacc.c:1646 */ { if ((yyvsp[0])->lasti->opcode == Op_push_i && ((yyvsp[0])->lasti->memory->flags & (STRCUR|STRING)) == 0 @@ -3698,11 +3701,11 @@ regular_print: (yyval) = list_append((yyvsp[0]), (yyvsp[-1])); } } -#line 3702 "awkgram.c" /* yacc.c:1646 */ +#line 3705 "awkgram.c" /* yacc.c:1646 */ break; - case 159: -#line 1650 "awkgram.y" /* yacc.c:1646 */ + case 160: +#line 1652 "awkgram.y" /* yacc.c:1646 */ { /* * was: $$ = $2 @@ -3712,20 +3715,20 @@ regular_print: (yyvsp[-1])->memory = make_number(0.0); (yyval) = list_append((yyvsp[0]), (yyvsp[-1])); } -#line 3716 "awkgram.c" /* yacc.c:1646 */ +#line 3719 "awkgram.c" /* yacc.c:1646 */ break; - case 160: -#line 1663 "awkgram.y" /* yacc.c:1646 */ + case 161: +#line 1665 "awkgram.y" /* yacc.c:1646 */ { func_use((yyvsp[0])->lasti->func_name, FUNC_USE); (yyval) = (yyvsp[0]); } -#line 3725 "awkgram.c" /* yacc.c:1646 */ +#line 3728 "awkgram.c" /* yacc.c:1646 */ break; - case 161: -#line 1668 "awkgram.y" /* yacc.c:1646 */ + case 162: +#line 1670 "awkgram.y" /* yacc.c:1646 */ { /* indirect function call */ INSTRUCTION *f, *t; @@ -3759,11 +3762,11 @@ regular_print: (yyval) = list_prepend((yyvsp[0]), t); at_seen = false; } -#line 3763 "awkgram.c" /* yacc.c:1646 */ +#line 3766 "awkgram.c" /* yacc.c:1646 */ break; - case 162: -#line 1705 "awkgram.y" /* yacc.c:1646 */ + case 163: +#line 1707 "awkgram.y" /* yacc.c:1646 */ { NODE *n; @@ -3788,49 +3791,49 @@ regular_print: (yyval) = list_append(t, (yyvsp[-3])); } } -#line 3792 "awkgram.c" /* yacc.c:1646 */ - break; - - case 163: -#line 1733 "awkgram.y" /* yacc.c:1646 */ - { (yyval) = NULL; } -#line 3798 "awkgram.c" /* yacc.c:1646 */ +#line 3795 "awkgram.c" /* yacc.c:1646 */ break; case 164: #line 1735 "awkgram.y" /* yacc.c:1646 */ - { (yyval) = (yyvsp[0]); } -#line 3804 "awkgram.c" /* yacc.c:1646 */ + { (yyval) = NULL; } +#line 3801 "awkgram.c" /* yacc.c:1646 */ break; case 165: -#line 1740 "awkgram.y" /* yacc.c:1646 */ - { (yyval) = NULL; } -#line 3810 "awkgram.c" /* yacc.c:1646 */ +#line 1737 "awkgram.y" /* yacc.c:1646 */ + { (yyval) = (yyvsp[0]); } +#line 3807 "awkgram.c" /* yacc.c:1646 */ break; case 166: #line 1742 "awkgram.y" /* yacc.c:1646 */ - { (yyval) = (yyvsp[-1]); } -#line 3816 "awkgram.c" /* yacc.c:1646 */ + { (yyval) = NULL; } +#line 3813 "awkgram.c" /* yacc.c:1646 */ break; case 167: -#line 1747 "awkgram.y" /* yacc.c:1646 */ - { (yyval) = (yyvsp[0]); } -#line 3822 "awkgram.c" /* yacc.c:1646 */ +#line 1744 "awkgram.y" /* yacc.c:1646 */ + { (yyval) = (yyvsp[-1]); } +#line 3819 "awkgram.c" /* yacc.c:1646 */ break; case 168: #line 1749 "awkgram.y" /* yacc.c:1646 */ + { (yyval) = (yyvsp[0]); } +#line 3825 "awkgram.c" /* yacc.c:1646 */ + break; + + case 169: +#line 1751 "awkgram.y" /* yacc.c:1646 */ { (yyval) = list_merge((yyvsp[-1]), (yyvsp[0])); } -#line 3830 "awkgram.c" /* yacc.c:1646 */ +#line 3833 "awkgram.c" /* yacc.c:1646 */ break; - case 169: -#line 1756 "awkgram.y" /* yacc.c:1646 */ + case 170: +#line 1758 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *ip = (yyvsp[0])->lasti; int count = ip->sub_count; /* # of SUBSEP-seperated expressions */ @@ -3844,11 +3847,11 @@ regular_print: sub_counter++; /* count # of dimensions */ (yyval) = (yyvsp[0]); } -#line 3848 "awkgram.c" /* yacc.c:1646 */ +#line 3851 "awkgram.c" /* yacc.c:1646 */ break; - case 170: -#line 1773 "awkgram.y" /* yacc.c:1646 */ + case 171: +#line 1775 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *t = (yyvsp[-1]); if ((yyvsp[-1]) == NULL) { @@ -3862,31 +3865,31 @@ regular_print: (yyvsp[0])->sub_count = count_expressions(&t, false); (yyval) = list_append(t, (yyvsp[0])); } -#line 3866 "awkgram.c" /* yacc.c:1646 */ +#line 3869 "awkgram.c" /* yacc.c:1646 */ break; - case 171: -#line 1790 "awkgram.y" /* yacc.c:1646 */ + case 172: +#line 1792 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3872 "awkgram.c" /* yacc.c:1646 */ +#line 3875 "awkgram.c" /* yacc.c:1646 */ break; - case 172: -#line 1792 "awkgram.y" /* yacc.c:1646 */ + case 173: +#line 1794 "awkgram.y" /* yacc.c:1646 */ { (yyval) = list_merge((yyvsp[-1]), (yyvsp[0])); } -#line 3880 "awkgram.c" /* yacc.c:1646 */ +#line 3883 "awkgram.c" /* yacc.c:1646 */ break; - case 173: -#line 1799 "awkgram.y" /* yacc.c:1646 */ + case 174: +#line 1801 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } -#line 3886 "awkgram.c" /* yacc.c:1646 */ +#line 3889 "awkgram.c" /* yacc.c:1646 */ break; - case 174: -#line 1804 "awkgram.y" /* yacc.c:1646 */ + case 175: +#line 1806 "awkgram.y" /* yacc.c:1646 */ { char *var_name = (yyvsp[0])->lextok; @@ -3894,22 +3897,22 @@ regular_print: (yyvsp[0])->memory = variable((yyvsp[0])->source_line, var_name, Node_var_new); (yyval) = list_create((yyvsp[0])); } -#line 3898 "awkgram.c" /* yacc.c:1646 */ +#line 3901 "awkgram.c" /* yacc.c:1646 */ break; - case 175: -#line 1812 "awkgram.y" /* yacc.c:1646 */ + case 176: +#line 1814 "awkgram.y" /* yacc.c:1646 */ { char *arr = (yyvsp[-1])->lextok; (yyvsp[-1])->memory = variable((yyvsp[-1])->source_line, arr, Node_var_new); (yyvsp[-1])->opcode = Op_push_array; (yyval) = list_prepend((yyvsp[0]), (yyvsp[-1])); } -#line 3909 "awkgram.c" /* yacc.c:1646 */ +#line 3912 "awkgram.c" /* yacc.c:1646 */ break; - case 176: -#line 1822 "awkgram.y" /* yacc.c:1646 */ + case 177: +#line 1824 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *ip = (yyvsp[0])->nexti; if (ip->opcode == Op_push @@ -3921,73 +3924,73 @@ regular_print: } else (yyval) = (yyvsp[0]); } -#line 3925 "awkgram.c" /* yacc.c:1646 */ +#line 3928 "awkgram.c" /* yacc.c:1646 */ break; - case 177: -#line 1834 "awkgram.y" /* yacc.c:1646 */ + case 178: +#line 1836 "awkgram.y" /* yacc.c:1646 */ { (yyval) = list_append((yyvsp[-1]), (yyvsp[-2])); if ((yyvsp[0]) != NULL) mk_assignment((yyvsp[-1]), NULL, (yyvsp[0])); } -#line 3935 "awkgram.c" /* yacc.c:1646 */ +#line 3938 "awkgram.c" /* yacc.c:1646 */ break; - case 178: -#line 1843 "awkgram.y" /* yacc.c:1646 */ + case 179: +#line 1845 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->opcode = Op_postincrement; } -#line 3943 "awkgram.c" /* yacc.c:1646 */ +#line 3946 "awkgram.c" /* yacc.c:1646 */ break; - case 179: -#line 1847 "awkgram.y" /* yacc.c:1646 */ + case 180: +#line 1849 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->opcode = Op_postdecrement; } -#line 3951 "awkgram.c" /* yacc.c:1646 */ +#line 3954 "awkgram.c" /* yacc.c:1646 */ break; - case 180: -#line 1850 "awkgram.y" /* yacc.c:1646 */ + case 181: +#line 1852 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3957 "awkgram.c" /* yacc.c:1646 */ +#line 3960 "awkgram.c" /* yacc.c:1646 */ break; - case 182: -#line 1858 "awkgram.y" /* yacc.c:1646 */ + case 183: +#line 1860 "awkgram.y" /* yacc.c:1646 */ { yyerrok; } -#line 3963 "awkgram.c" /* yacc.c:1646 */ +#line 3966 "awkgram.c" /* yacc.c:1646 */ break; - case 183: -#line 1862 "awkgram.y" /* yacc.c:1646 */ + case 184: +#line 1864 "awkgram.y" /* yacc.c:1646 */ { yyerrok; } -#line 3969 "awkgram.c" /* yacc.c:1646 */ +#line 3972 "awkgram.c" /* yacc.c:1646 */ break; - case 186: -#line 1871 "awkgram.y" /* yacc.c:1646 */ + case 187: +#line 1873 "awkgram.y" /* yacc.c:1646 */ { yyerrok; } -#line 3975 "awkgram.c" /* yacc.c:1646 */ +#line 3978 "awkgram.c" /* yacc.c:1646 */ break; - case 187: -#line 1875 "awkgram.y" /* yacc.c:1646 */ + case 188: +#line 1877 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); yyerrok; } -#line 3981 "awkgram.c" /* yacc.c:1646 */ +#line 3984 "awkgram.c" /* yacc.c:1646 */ break; - case 188: -#line 1879 "awkgram.y" /* yacc.c:1646 */ + case 189: +#line 1881 "awkgram.y" /* yacc.c:1646 */ { yyerrok; } -#line 3987 "awkgram.c" /* yacc.c:1646 */ +#line 3990 "awkgram.c" /* yacc.c:1646 */ break; -#line 3991 "awkgram.c" /* yacc.c:1646 */ +#line 3994 "awkgram.c" /* yacc.c:1646 */ default: break; } /* User semantic actions sometimes alter yychar, and that requires @@ -4215,7 +4218,7 @@ yyreturn: #endif return yyresult; } -#line 1881 "awkgram.y" /* yacc.c:1906 */ +#line 1883 "awkgram.y" /* yacc.c:1906 */ struct token { @@ -5736,6 +5739,14 @@ retry: break; case ':': + if (! do_traditional) { + if (nextc(true) == '=') { + yylval = GET_INSTRUCTION(Op_assign_const); + return lasttok = ASSIGN_CONST; + } + pushback(); + } + /* fall through */ case '?': yylval = GET_INSTRUCTION(Op_cond_exp); if (! do_posix) @@ -6673,9 +6684,15 @@ parms_shadow(INSTRUCTION *pc, bool *shadow) void valinfo(NODE *n, Func_print print_func, FILE *fp) { - if (n == Nnull_string) + if (n == Nnull_string) { print_func(fp, "uninitialized scalar\n"); - else if (n->flags & STRING) { + return; + } + + if (n->flags & VAR_CONST) + print_func(fp, "defined constant "); + + if (n->flags & STRING) { pp_string_fp(print_func, fp, n->stptr, n->stlen, '"', false); print_func(fp, "\n"); } else if (n->flags & NUMBER) { @@ -7583,7 +7600,8 @@ mk_assignment(INSTRUCTION *lhs, INSTRUCTION *rhs, INSTRUCTION *op) break; } - tp->do_reference = (op->opcode != Op_assign); /* check for uninitialized reference */ + tp->do_reference = (op->opcode != Op_assign /* check for uninitialized reference */ + && op->opcode != Op_assign_const); if (rhs != NULL) ip = list_merge(rhs, lhs); @@ -166,7 +166,7 @@ extern double fmod(double x, double y); %token FUNC_CALL NAME REGEXP FILENAME %token YNUMBER YSTRING %token RELOP IO_OUT IO_IN -%token ASSIGNOP ASSIGN MATCHOP CONCAT_OP +%token ASSIGNOP ASSIGN ASSIGN_CONST MATCHOP CONCAT_OP %token SUBSCRIPT %token LEX_BEGIN LEX_END LEX_IF LEX_ELSE LEX_RETURN LEX_DELETE %token LEX_SWITCH LEX_CASE LEX_DEFAULT LEX_WHILE LEX_DO LEX_FOR LEX_BREAK LEX_CONTINUE @@ -181,7 +181,7 @@ extern double fmod(double x, double y); %token NEWLINE /* Lowest to highest */ -%right ASSIGNOP ASSIGN SLASH_BEFORE_EQUAL +%right ASSIGNOP ASSIGN ASSIGN_CONST SLASH_BEFORE_EQUAL %right '?' ':' %left LEX_OR %left LEX_AND @@ -1388,6 +1388,8 @@ assign_operator { $$ = $1; } | ASSIGNOP { $$ = $1; } + | ASSIGN_CONST + { $$ = $1; } | SLASH_BEFORE_EQUAL ASSIGN /* `/=' */ { $2->opcode = Op_assign_quotient; @@ -3398,6 +3400,14 @@ retry: break; case ':': + if (! do_traditional) { + if (nextc(true) == '=') { + yylval = GET_INSTRUCTION(Op_assign_const); + return lasttok = ASSIGN_CONST; + } + pushback(); + } + /* fall through */ case '?': yylval = GET_INSTRUCTION(Op_cond_exp); if (! do_posix) @@ -4335,9 +4345,15 @@ parms_shadow(INSTRUCTION *pc, bool *shadow) void valinfo(NODE *n, Func_print print_func, FILE *fp) { - if (n == Nnull_string) + if (n == Nnull_string) { print_func(fp, "uninitialized scalar\n"); - else if (n->flags & STRING) { + return; + } + + if (n->flags & VAR_CONST) + print_func(fp, "defined constant "); + + if (n->flags & STRING) { pp_string_fp(print_func, fp, n->stptr, n->stlen, '"', false); print_func(fp, "\n"); } else if (n->flags & NUMBER) { @@ -5245,7 +5261,8 @@ mk_assignment(INSTRUCTION *lhs, INSTRUCTION *rhs, INSTRUCTION *op) break; } - tp->do_reference = (op->opcode != Op_assign); /* check for uninitialized reference */ + tp->do_reference = (op->opcode != Op_assign /* check for uninitialized reference */ + && op->opcode != Op_assign_const); if (rhs != NULL) ip = list_merge(rhs, lhs); @@ -2815,6 +2815,8 @@ set_how_many: t = POP_STRING(); else { lhs = POP_ADDRESS(); + if (((*lhs)->flags & VAR_CONST) != 0) + fatal(_("cannot assign to defined constant")); t = force_string(*lhs); } } @@ -404,6 +404,19 @@ d_error(const char *mesg, ...) va_end(args); } +/* d_warning --- print a warning message */ + +void +d_warning(const char *mesg, ...) +{ + va_list args; + va_start(args, mesg); + fprintf(out_fp, _("warning: ")); + vfprintf(out_fp, mesg, args); + fprintf(out_fp, "\n"); + va_end(args); +} + /* find_lines --- find the positions of the lines in the source file. */ static int @@ -1224,6 +1237,8 @@ do_set_var(CMDARG *arg, int cmd ATTRIBUTE_UNUSED) /* fall through */ case Node_var: lhs = &r->var_value; + if (((*lhs)->flags & VAR_CONST) != 0) + d_warning(_("`%s' is a constant (changing anyway)"), name); unref(*lhs); *lhs = dupnode(val); if (pname == NULL && r->var_assign != NULL) diff --git a/doc/ChangeLog b/doc/ChangeLog index 4fb63919..5ac65604 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -47,6 +47,10 @@ * gawktexi.in: A few minor formatting fixes to sync with O'Reilly version. +2015-02-17 Arnold D. Robbins <arnold@skeeve.com> + + * gawktexi.in (Symbol table by name): Document sym_constant(). + 2015-02-13 Arnold D. Robbins <arnold@skeeve.com> * gawktexi.in: O'Reilly fixes. Through QC1 review. @@ -964,6 +968,8 @@ * gawk.texi (Getline/Pipe): Add a nice quote from BWK. + API doc: Restore sym_constant. + 2013-02-08 Arnold D. Robbins <arnold@skeeve.com> * gawk.texi: Restore centering of text images. diff --git a/doc/gawktexi.in b/doc/gawktexi.in index 121a066e..2dee5c99 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -31904,6 +31904,16 @@ Changing types (scalar to array or vice versa) of an existing variable is @emph{not} allowed, nor may this routine be used to update an array. This routine cannot be used to update any of the predefined variables (such as @code{ARGC} or @code{NF}). + +@item awk_bool_t sym_constant(const char *name, awk_value_t *value); +Create a variable named by the string @code{name}, which is +a regular C string, that has the constant value as given by +@code{value}. @command{awk}-level code cannot change the value of this +variable. The extension may change the value of @code{name}'s +variable with subsequent calls to this routine, and may also convert +a variable created by @code{sym_update()} into a constant. However, +once a variable becomes a constant, it cannot later be reverted into a +mutable variable. @end table An extension can look up the value of @command{gawk}'s special variables. @@ -290,6 +290,7 @@ static struct optypetab { { "Op_field_spec", "$" }, { "Op_not", "! " }, { "Op_assign", " = " }, + { "Op_assign_const", " := " }, { "Op_store_var", " = " }, { "Op_store_sub", " = " }, { "Op_store_field", " = " }, @@ -447,6 +448,8 @@ flags2str(int flagval) { ARRAYMAXED, "ARRAYMAXED" }, { HALFHAT, "HALFHAT" }, { XARRAY, "XARRAY" }, + { VAR_CONST, "VAR_CONST" }, + { VAR_SPEC, "VAR_SPEC" }, { 0, NULL }, }; @@ -1066,6 +1069,7 @@ update_NR() if (NR_node->var_value->numbr != NR) { unref(NR_node->var_value); NR_node->var_value = make_number(NR); + NR_node->var_value->flags |= VAR_SPEC; } } @@ -1082,6 +1086,7 @@ update_NF() (void) get_field(UNLIMITED - 1, NULL); /* parse record */ unref(NF_node->var_value); NF_node->var_value = make_number(NF); + NF_node->var_value->flags |= VAR_SPEC; } } @@ -1164,6 +1169,8 @@ r_get_lhs(NODE *n, bool reference) break; case Node_var: + if ((n->var_value->flags & VAR_CONST) != 0) + fatal(_("cannot assign to defined constant")); break; default: @@ -1574,6 +1581,9 @@ op_assign(OPCODE op) AWKNUM x = 0.0, x1, x2; lhs = POP_ADDRESS(); + if (((*lhs)->flags & VAR_CONST) != 0) + fatal(_("cannot assign to defined constant")); + t1 = *lhs; x1 = force_number(t1)->numbr; diff --git a/extension/ChangeLog b/extension/ChangeLog index 9d7e6173..ee32f582 100644 --- a/extension/ChangeLog +++ b/extension/ChangeLog @@ -322,6 +322,15 @@ 2013-03-04 Arnold D. Robbins <arnold@skeeve.com> + * filefuncs.c, fnmatch.c: Restore use of sym_constant. + * filefuncs.3am, fnmatch.3am: Restore documentation of constants. + +2013-03-04 Arnold D. Robbins <arnold@skeeve.com> + + * testext.c: Make answer_num a constant. + +2013-03-04 Arnold D. Robbins <arnold@skeeve.com> + * filefuncs.c (fill_stat_array): Adjust computation for block count for WIN32 systems after consultation with Eli Zaretskii. diff --git a/extension/filefuncs.3am b/extension/filefuncs.3am index d0eb2acf..34e079cd 100644 --- a/extension/filefuncs.3am +++ b/extension/filefuncs.3am @@ -185,7 +185,7 @@ An array of filenames. The element values are used; the index values are ignore .TP .B flags This should be the bitwise OR of one or more of the following -predefined flag values. At least one of +predefined constant flag values. At least one of .B FTS_LOGICAL or .B FTS_PHYSICAL @@ -312,12 +312,6 @@ already provides powerful array sorting facilities. While an interface could have been provided, this felt less natural than simply creating a multi-dimensional array to represent the file heirarchy and its information. -.PP -Nothing prevents AWK code from changing the predefined -.BI FTS_ xx -values, but doing so is may cause strange results when -the changed values are passed to -.BR fts() . .SH BUGS There are many more file-related functions for which AWK interfaces would be desirable. diff --git a/extension/filefuncs.c b/extension/filefuncs.c index ddb1ecda..39c9c2ea 100644 --- a/extension/filefuncs.c +++ b/extension/filefuncs.c @@ -529,8 +529,8 @@ init_filefuncs(void) for (i = 0; opentab[i].name != NULL; i++) { (void) make_number(opentab[i].value, & value); - if (! sym_update(opentab[i].name, & value)) { - warning(ext_id, _("fts init: could not create variable %s"), + if (! sym_constant(opentab[i].name, & value)) { + warning(ext_id, _("fts init: could not create constant %s"), opentab[i].name); errors++; } diff --git a/extension/fnmatch.3am b/extension/fnmatch.3am index e2e8391d..7a1d904b 100644 --- a/extension/fnmatch.3am +++ b/extension/fnmatch.3am @@ -14,7 +14,7 @@ extension provides an AWK interface to the .IR fnmatch (3) routine. It adds a single function named .BR fnmatch() , -one predefined variable +one constant .RB ( FNM_NOMATCH ), and an array of flag values named .BR FNM . @@ -68,11 +68,7 @@ Corresponds to the flag as defined in .IR fnmatch (3). .PP -.SH NOTES -Nothing prevents AWK code from changing the predefined -variabale -.BR FNM_NOMATCH , -but doing so may cause strange results. +... .SH NOTES ... .SH BUGS .SH EXAMPLE .ft CW diff --git a/extension/fnmatch.c b/extension/fnmatch.c index a85bcc78..6817f52b 100644 --- a/extension/fnmatch.c +++ b/extension/fnmatch.c @@ -169,7 +169,7 @@ init_fnmatch(void) awk_array_t new_array; int i; - if (! sym_update("FNM_NOMATCH", make_number(FNM_NOMATCH, & value))) { + if (! sym_constant("FNM_NOMATCH", make_number(FNM_NOMATCH, & value))) { warning(ext_id, _("fnmatch init: could not add FNM_NOMATCH variable")); errors++; } diff --git a/extension/testext.c b/extension/testext.c index 4a1e7032..bde44f7f 100644 --- a/extension/testext.c +++ b/extension/testext.c @@ -863,7 +863,7 @@ BEGIN { */ /* install some variables */ - if (! sym_update("answer_num", make_number(42, & value))) + if (! sym_constant("answer_num", make_number(42, & value))) printf("testext: sym_update(\"answer_num\") failed!\n"); if (! sym_update("message_string", @@ -340,6 +340,7 @@ set_NF() assert(NF != -1); + NF_node->var_value->flags |= VAR_SPEC; (void) force_number(NF_node->var_value); nf = get_number_si(NF_node->var_value); if (nf < 0) @@ -1179,6 +1180,8 @@ set_FIELDWIDTHS() } FIELDWIDTHS[i+1] = -1; + FIELDWIDTHS_node->var_value->flags |= VAR_SPEC; + update_PROCINFO_str("FS", "FIELDWIDTHS"); if (fatal_error) fatal(_("invalid FIELDWIDTHS value, near `%s'"), @@ -1315,6 +1318,7 @@ choose_fs_function: if (fs->stlen == 1 && parse_field == re_parse_field) FS_regexp = FS_re_yes_case; + FS_node->var_value->flags |= VAR_SPEC; update_PROCINFO_str("FS", "FS"); } @@ -1429,6 +1433,7 @@ set_fpat_function: FPAT_regexp = (IGNORECASE ? FPAT_re_no_case : FPAT_re_yes_case); } + FPAT_node->var_value->flags |= VAR_SPEC; update_PROCINFO_str("FS", "FPAT"); } @@ -540,12 +540,13 @@ api_sym_lookup_scalar(awk_ext_id_t id, return node_to_awk_value(node, result, wanted); } -/* api_sym_update --- update a symbol's value, see gawkapi.h for semantics */ +/* sym_update_real --- update a symbol's value, see gawkapi.h for semantics */ static awk_bool_t -api_sym_update(awk_ext_id_t id, +sym_update_real(awk_ext_id_t id, const char *name, - awk_value_t *value) + awk_value_t *value, + bool is_const) { NODE *node; NODE *array_node; @@ -586,6 +587,8 @@ api_sym_update(awk_ext_id_t id, node = install_symbol(estrdup((char *) name, strlen(name)), Node_var); node->var_value = awk_value_to_node(value); + if (is_const) + node->var_value->flags |= VAR_CONST; } return awk_true; @@ -605,8 +608,12 @@ api_sym_update(awk_ext_id_t id, && (node->type == Node_var || node->type == Node_var_new)) { unref(node->var_value); node->var_value = awk_value_to_node(value); - if (node->type == Node_var_new && value->val_type != AWK_UNDEFINED) - node->type = Node_var; + if (value->val_type != AWK_UNDEFINED) { + if (node->type == Node_var_new) + node->type = Node_var; + if (is_const) + node->var_value->flags |= VAR_CONST; + } return awk_true; } @@ -711,6 +718,22 @@ valid_subscript_type(awk_valtype_t valtype) } } +static awk_bool_t +api_sym_update(awk_ext_id_t id, + const char *name, + awk_value_t *value) +{ + return sym_update_real(id, name, value, false); +} + +static awk_bool_t +api_sym_constant(awk_ext_id_t id, + const char *name, + awk_value_t *value) +{ + return sym_update_real(id, name, value, true); +} + /* Array management */ /* * api_get_array_element --- teturn the value of an element - read only! @@ -1095,6 +1118,7 @@ gawk_api_t api_impl = { /* Accessing and installing variables and constants */ api_sym_lookup, api_sym_update, + api_sym_constant, /* Accessing and modifying variables via scalar cookies */ api_sym_lookup_scalar, @@ -550,6 +550,13 @@ typedef struct gawk_api { awk_value_t *value); /* + * Install a constant value. + */ + awk_bool_t (*sym_constant)(awk_ext_id_t id, + const char *name, + awk_value_t *value); + + /* * A ``scalar cookie'' is an opaque handle that provide access * to a global variable or array. It is an optimization that * avoids looking up variables in gawk's symbol table every time @@ -719,6 +726,8 @@ typedef struct gawk_api { (api->api_sym_update(ext_id, name, value)) #define sym_update_scalar(scalar_cookie, value) \ (api->api_sym_update_scalar)(ext_id, scalar_cookie, value) +#define sym_constant(name, value) \ + (api->sym_constant(ext_id, name, value)) #define get_array_element(array, index, wanted, result) \ (api->api_get_array_element(ext_id, array, index, wanted, result)) diff --git a/interpret.h b/interpret.h index 3a9cab37..4d55d932 100644 --- a/interpret.h +++ b/interpret.h @@ -205,7 +205,7 @@ uninitialized_scalar: if (m->type == Node_param_list) m = GET_PARAM(m->param_cnt); if (m->type == Node_var) { - m = m->var_value; + m = dupnode(m->var_value); UPREF(m); PUSH(m); break; @@ -573,6 +573,8 @@ mod: case Op_predecrement: x = op == Op_preincrement ? 1.0 : -1.0; lhs = TOP_ADDRESS(); + if (((*lhs)->flags & VAR_CONST) != 0) + fatal(_("cannot assign to defined constant")); t1 = *lhs; force_number(t1); if (t1->valref == 1 && t1->flags == (MALLOC|NUMCUR|NUMBER)) { @@ -591,6 +593,8 @@ mod: case Op_postdecrement: x = op == Op_postincrement ? 1.0 : -1.0; lhs = TOP_ADDRESS(); + if (((*lhs)->flags & VAR_CONST) != 0) + fatal(_("cannot assign to defined constant")); t1 = *lhs; force_number(t1); r = make_number(t1->numbr); @@ -665,6 +669,8 @@ mod: */ lhs = get_lhs(pc->memory, false); + if (*lhs != NULL && ((*lhs)->flags & VAR_CONST) != 0) + fatal(_("cannot assign to defined constant")); unref(*lhs); r = pc->initval; /* constant initializer */ if (r != NULL) { @@ -674,6 +680,11 @@ mod: r = POP_SCALAR(); UNFIELD(*lhs, r); } + if (((*lhs)->flags & VAR_CONST) != 0) { + NODE *t = *lhs; + *lhs = dupnode(t); + unref(t); + } break; case Op_store_field: @@ -698,6 +709,8 @@ mod: case Op_assign_concat: /* x = x ... string concatenation optimization */ lhs = get_lhs(pc->memory, false); + if (*lhs != NULL && ((*lhs)->flags & VAR_CONST) != 0) + fatal(_("cannot assign to defined constant")); t1 = force_string(*lhs); t2 = POP_STRING(); @@ -741,10 +754,29 @@ mod: case Op_assign: lhs = POP_ADDRESS(); + if (*lhs != NULL && ((*lhs)->flags & VAR_CONST) != 0) + fatal(_("cannot assign to defined constant")); r = TOP_SCALAR(); unref(*lhs); + *lhs = r; UPREF(r); + REPLACE(r); UNFIELD(*lhs, r); + break; + + case Op_assign_const: + lhs = POP_ADDRESS(); + if (*lhs != NULL) { + if (((*lhs)->flags & VAR_CONST) != 0) + fatal(_("cannot assign to defined constant")); + else if (((*lhs)->flags & VAR_SPEC) != 0) + fatal(_("cannot convert built-in variable to constant")); + } + r = TOP_SCALAR(); + unref(*lhs); + r->flags |= VAR_CONST; + *lhs = r; + UPREF(r); REPLACE(r); break; @@ -852,6 +884,8 @@ mod: case Op_K_delete_loop: t1 = POP_ARRAY(); lhs = POP_ADDRESS(); /* item */ + if (((*lhs)->flags & VAR_CONST) != 0) + fatal(_("cannot assign to defined constant")); do_delete_loop(t1, lhs); break; @@ -926,6 +960,8 @@ arrayfor: t1 = r->for_list[r->cur_idx]; lhs = get_lhs(pc->array_var, false); + if (((*lhs)->flags & VAR_CONST) != 0) + fatal(_("cannot assign to defined constant")); unref(*lhs); *lhs = dupnode(t1); break; @@ -1111,7 +1147,10 @@ match_re: f = pc->func_body; if (f == NULL) { f = lookup(pc->func_name); - if (f == NULL || (f->type != Node_func && f->type != Node_ext_func && f->type != Node_old_ext_func)) + if (f == NULL || + (f->type != Node_func && + f->type != Node_ext_func + && f->type != Node_old_ext_func)) fatal(_("function `%s' not defined"), pc->func_name); pc->func_body = f; /* save for next call */ } @@ -562,6 +562,7 @@ set_FNR() else #endif FNR = get_number_si(n); + FNR_node->var_value->flags |= VAR_SPEC; } /* set_NR --- update internal NR from awk variable */ @@ -577,6 +578,7 @@ set_NR() else #endif NR = get_number_si(n); + NR_node->var_value->flags |= VAR_SPEC; } /* inrec --- This reads in a record from the input file */ @@ -2475,8 +2477,11 @@ do_getline_redir(int into_variable, enum redirval redirtype) NODE **lhs = NULL; int redir_error = 0; - if (into_variable) + if (into_variable) { lhs = POP_ADDRESS(); + if (((*lhs)->flags & VAR_CONST) != 0) + fatal(_("cannot assign to defined constant")); + } assert(redirtype != redirect_none); redir_exp = TOP(); @@ -2562,6 +2567,8 @@ do_getline(int into_variable, IOBUF *iop) else { /* assignment to variable */ NODE **lhs; lhs = POP_ADDRESS(); + if (((*lhs)->flags & VAR_CONST) != 0) + fatal(_("cannot assign to defined constant")); unref(*lhs); *lhs = make_string(s, cnt); (*lhs)->flags |= MAYBE_NUM; @@ -3700,6 +3707,7 @@ set_RS() set_FS: if (current_field_sep() == Using_FS) set_FS(); + RS_node->var_value->flags |= VAR_SPEC; } @@ -715,6 +715,7 @@ init_args(int argc0, int argc, const char *argv0, char **argv) ARGC_node = install_symbol(estrdup("ARGC", 4), Node_var); ARGC_node->var_value = make_number((AWKNUM) j); + ARGC_node->var_value->flags |= VAR_SPEC; } @@ -792,6 +793,7 @@ init_vars() n->var_update = (Func_ptr) vp->update; if (vp->do_assign) (*(vp->assign))(); + n->flags |= VAR_SPEC; } /* Load PROCINFO and ENVIRON */ @@ -1057,6 +1059,7 @@ arg_assign(char *arg, bool initing) NODE *it; NODE **lhs; long save_FNR; + bool isconst = false; if (! initing && disallow_var_assigns) return false; /* --exec */ @@ -1071,10 +1074,14 @@ arg_assign(char *arg, bool initing) _("%s: `%s' argument to `-v' not in `var=value' form\n\n"), myname, arg); usage(EXIT_FAILURE, stderr); + } else { + if (cp[-1] == ':') { + isconst = true; + cp[-1] = '\0'; /* will need restoring */ + } + *cp++ = '\0'; /* temporarily nuke the = */ } - *cp++ = '\0'; - /* avoid false source indications in a fatal message */ source = NULL; sourceline = 0; @@ -1142,13 +1149,19 @@ arg_assign(char *arg, bool initing) lhs = get_lhs(var, false); unref(*lhs); *lhs = it; + if (isconst) + (*lhs)->flags |= VAR_CONST; /* check for set_FOO() routine */ if (var->type == Node_var && var->var_assign) var->var_assign(); } - if (! initing) + if (! initing) { *--cp = '='; /* restore original text of ARGV */ + if (isconst) + *--cp = ':'; /* restore it all the way */ + } + FNR = save_FNR; return ! badvar; } @@ -521,6 +521,7 @@ set_PREC() if (! do_mpfr) return; + PREC_node->var_value->flags |= VAR_SPEC; val = PREC_node->var_value; if ((val->flags & MAYBE_NUM) != 0) force_number(val); @@ -613,6 +614,7 @@ set_ROUNDMODE() ROUND_MODE = rndm; } else warning(_("RNDMODE value `%.*s' is invalid"), (int) n->stlen, n->stptr); + ROUNDMODE_node->var_value->flags |= VAR_SPEC; } } @@ -270,15 +270,20 @@ r_dupnode(NODE *n) assert(n->type == Node_val); #ifdef GAWKDEBUG + if ((n->flags & VAR_CONST) != 0) + goto copynode; + if ((n->flags & MALLOC) != 0) { n->valref++; return n; } + +copynode: #endif getnode(r); *r = *n; - r->flags &= ~FIELD; + r->flags &= ~(FIELD|VAR_CONST); r->flags |= MALLOC; r->valref = 1; /* @@ -444,6 +444,7 @@ cleanup: break; case Op_assign: + case Op_assign_const: case Op_assign_plus: case Op_assign_minus: case Op_assign_times: diff --git a/test/ChangeLog b/test/ChangeLog index e9848c4b..21b3fd6d 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -594,6 +594,19 @@ * Makefile.am (colonwarn): New test. * colonwarn.awk, colonwarn.in, colonwarn.ok: New files. +2013-03-10 Arnold D. Robbins <arnold@skeeve.com> + + * Makefile.am (assignconst): Add more tests. Put data in "15" + which uses getline. + * assignconst.awk, assignconst.ok: Update with more tests. + +2013-03-04 Arnold D. Robbins <arnold@skeeve.com> + + * assignconst.awk, assignconst.ok: New file. + * Makefile.am (EXTRA_DIST): Added assignconst.awk, assignconst.ok. + (SHLIB_TESTS): Added assignconst. + (assignconst): Added test. + 2013-02-26 Arnold D. Robbins <arnold@skeeve.com> * parseme.ok: Update after change in grammar. Now with new and diff --git a/test/Makefile.am b/test/Makefile.am index d2cd0ddd..645975fc 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -102,6 +102,8 @@ EXTRA_DIST = \ asort.ok \ asorti.awk \ asorti.ok \ + assignconst.awk \ + assignconst.ok \ awkpath.ok \ back89.awk \ back89.in \ @@ -1082,6 +1084,7 @@ LOCALE_CHARSET_TESTS = \ mbprintf1 mbprintf2 mbprintf3 mbprintf4 rebt8b2 rtlenmb sort1 sprintfc SHLIB_TESTS = \ + assignconst \ fnmatch filefuncs fork fork2 fts functab4 inplace1 inplace2 inplace3 \ ordchr ordchr2 readdir readfile readfile2 revout revtwoway rwarray testext time @@ -1934,6 +1937,15 @@ testext:: @$(AWK) -f ./testext.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ testext.awk +assignconst: + @echo $@ + @echo foo > 15 + @for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17; \ + do AWKPATH=$(srcdir) $(AWK) -f $@.awk $$i ; \ + done 2>&1 | grep -v at_exit > _$@ + @rm -f 15 + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + readdir: @if [ "`uname`" = Linux ] && [ "`stat -f . 2>/dev/null | awk 'NR == 2 { print $$NF }'`" = nfs ]; then \ echo This test may fail on GNU/Linux systems when run on an NFS filesystem.; \ diff --git a/test/Makefile.in b/test/Makefile.in index cf8093b8..1f93220f 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -359,6 +359,8 @@ EXTRA_DIST = \ asort.ok \ asorti.awk \ asorti.ok \ + assignconst.awk \ + assignconst.ok \ awkpath.ok \ back89.awk \ back89.in \ @@ -1335,6 +1337,7 @@ LOCALE_CHARSET_TESTS = \ mbprintf1 mbprintf2 mbprintf3 mbprintf4 rebt8b2 rtlenmb sort1 sprintfc SHLIB_TESTS = \ + assignconst \ fnmatch filefuncs fork fork2 fts functab4 inplace1 inplace2 inplace3 \ ordchr ordchr2 readdir readfile readfile2 revout revtwoway rwarray testext time @@ -2371,6 +2374,15 @@ testext:: @$(AWK) -f ./testext.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ testext.awk +assignconst: + @echo $@ + @echo foo > 15 + @for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17; \ + do AWKPATH=$(srcdir) $(AWK) -f $@.awk $$i ; \ + done 2>&1 | grep -v at_exit > _$@ + @rm -f 15 + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + readdir: @if [ "`uname`" = Linux ] && [ "`stat -f . 2>/dev/null | awk 'NR == 2 { print $$NF }'`" = nfs ]; then \ echo This test may fail on GNU/Linux systems when run on an NFS filesystem.; \ diff --git a/test/assignconst.awk b/test/assignconst.awk new file mode 100644 index 00000000..39fc0db3 --- /dev/null +++ b/test/assignconst.awk @@ -0,0 +1,69 @@ +@load "testext" + +BEGIN { + print "" + print "test:", ARGV[1] + switch (ARGV[1] + 0) { + case 1: + answer_num = 43 + break + case 2: + ++answer_num + break + case 3: + --answer_num + break + case 4: + answer_num++ + break + case 5: + answer_num-- + break + case 6: + answer_num += 1 + break + case 7: + answer_num -= 1 + break + case 8: + answer_num *= 1 + break + case 9: + answer_num /= 1 + break + case 10: + answer_num ^= 1 + break + case 11: + answer_num = answer_num "foo" + break + case 12: + sub(/2/, "3", answer_num) + break + case 13: + a[1] = 1 + for (answer_num in a) + print answer_num, a[answer_num] + break + case 14: + a[1] = 1 + for (answer_num in a) + delete a[answer_num] + break + case 15: + getline answer_num + break + case 16: + getline answer_num < "Makefile" + break + case 17: + test_func(answer_num) + break + } +} + +function test_func(val) +{ + val++ + print "in test_func, val now =", val +} diff --git a/test/assignconst.ok b/test/assignconst.ok new file mode 100644 index 00000000..ee610789 --- /dev/null +++ b/test/assignconst.ok @@ -0,0 +1,51 @@ + +test: 1 +gawk: assignconst.awk:8: fatal: cannot assign to defined constant + +test: 2 +gawk: assignconst.awk:11: fatal: cannot assign to defined constant + +test: 3 +gawk: assignconst.awk:14: fatal: cannot assign to defined constant + +test: 4 +gawk: assignconst.awk:17: fatal: cannot assign to defined constant + +test: 5 +gawk: assignconst.awk:20: fatal: cannot assign to defined constant + +test: 6 +gawk: assignconst.awk:23: fatal: cannot assign to defined constant + +test: 7 +gawk: assignconst.awk:26: fatal: cannot assign to defined constant + +test: 8 +gawk: assignconst.awk:29: fatal: cannot assign to defined constant + +test: 9 +gawk: assignconst.awk:32: fatal: cannot assign to defined constant + +test: 10 +gawk: assignconst.awk:35: fatal: cannot assign to defined constant + +test: 11 +gawk: assignconst.awk:38: fatal: cannot assign to defined constant + +test: 12 +gawk: assignconst.awk:41: fatal: cannot assign to defined constant + +test: 13 +gawk: assignconst.awk:45: fatal: cannot assign to defined constant + +test: 14 +gawk: assignconst.awk:51: fatal: cannot assign to defined constant + +test: 15 +gawk: assignconst.awk:54: (FILENAME=15 FNR=1) fatal: cannot assign to defined constant + +test: 16 +gawk: assignconst.awk:57: fatal: cannot assign to defined constant + +test: 17 +in test_func, val now = 43 |