2 /* A Bison parser, made by GNU Bison 2.4.1. */
4 /* Skeleton implementation for Bison's Yacc-like parsers in C
6 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
7 Free Software Foundation, Inc.
9 This program is free software: you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation, either version 3 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program. If not, see <http://www.gnu.org/licenses/>. */
22 /* As a special exception, you may create a larger work that contains
23 part or all of the Bison parser skeleton and distribute that work
24 under terms of your choice, so long as that work isn't itself a
25 parser generator using the skeleton or a modified version thereof
26 as a parser skeleton. Alternatively, if you modify or redistribute
27 the parser skeleton itself, you may (at your option) remove this
28 special exception, which will cause the skeleton and the resulting
29 Bison output files to be licensed under the GNU General Public
30 License without this special exception.
32 This special exception was added by the Free Software Foundation in
33 version 2.2 of Bison. */
35 /* C LALR(1) parser skeleton written by Richard Stallman, by
36 simplifying the original so-called "semantic" parser. */
38 /* All symbols defined below should begin with yy or YY, to avoid
39 infringing on user name space. This should be done even for local
40 variables, as they might otherwise be expanded by user macros.
41 There are some unavoidable exceptions within include files to
42 define necessary library symbols; they are noted "INFRINGES ON
43 USER NAME SPACE" below. */
45 /* Identify Bison output. */
49 #define YYBISON_VERSION "2.4.1"
52 #define YYSKELETON_NAME "yacc.c"
63 /* Using locations. */
64 #define YYLSP_NEEDED 0
66 /* Substitute the variable and function names. */
67 #define yyparse parser_parse
68 #define yylex parser_lex
69 #define yyerror parser_error
70 #define yylval parser_lval
71 #define yychar parser_char
72 #define yydebug parser_debug
73 #define yynerrs parser_nerrs
76 /* Copy the first part of user declarations. */
78 /* Line 189 of yacc.c */
85 #include "wine/debug.h"
87 WINE_DEFAULT_DEBUG_CHANNEL(jscript
);
89 #define YYLEX_PARAM ctx
90 #define YYPARSE_PARAM ctx
92 static int parser_error(const char*);
93 static void set_error(parser_ctx_t
*,UINT
);
94 static BOOL
explicit_error(parser_ctx_t
*,void*,WCHAR
);
95 static BOOL
allow_auto_semicolon(parser_ctx_t
*);
96 static void program_parsed(parser_ctx_t
*,source_elements_t
*);
98 typedef struct _statement_list_t
{
103 static literal_t
*new_string_literal(parser_ctx_t
*,const WCHAR
*);
104 static literal_t
*new_null_literal(parser_ctx_t
*);
106 typedef struct _property_list_t
{
111 static property_list_t
*new_property_list(parser_ctx_t
*,literal_t
*,expression_t
*);
112 static property_list_t
*property_list_add(parser_ctx_t
*,property_list_t
*,literal_t
*,expression_t
*);
114 typedef struct _element_list_t
{
115 array_element_t
*head
;
116 array_element_t
*tail
;
119 static element_list_t
*new_element_list(parser_ctx_t
*,int,expression_t
*);
120 static element_list_t
*element_list_add(parser_ctx_t
*,element_list_t
*,int,expression_t
*);
122 typedef struct _argument_list_t
{
127 static argument_list_t
*new_argument_list(parser_ctx_t
*,expression_t
*);
128 static argument_list_t
*argument_list_add(parser_ctx_t
*,argument_list_t
*,expression_t
*);
130 typedef struct _case_list_t
{
131 case_clausule_t
*head
;
132 case_clausule_t
*tail
;
135 static catch_block_t
*new_catch_block(parser_ctx_t
*,const WCHAR
*,statement_t
*);
136 static case_clausule_t
*new_case_clausule(parser_ctx_t
*,expression_t
*,statement_list_t
*);
137 static case_list_t
*new_case_list(parser_ctx_t
*,case_clausule_t
*);
138 static case_list_t
*case_list_add(parser_ctx_t
*,case_list_t
*,case_clausule_t
*);
139 static case_clausule_t
*new_case_block(parser_ctx_t
*,case_list_t
*,case_clausule_t
*,case_list_t
*);
141 typedef struct _variable_list_t
{
142 variable_declaration_t
*head
;
143 variable_declaration_t
*tail
;
146 static variable_declaration_t
*new_variable_declaration(parser_ctx_t
*,const WCHAR
*,expression_t
*);
147 static variable_list_t
*new_variable_list(parser_ctx_t
*,variable_declaration_t
*);
148 static variable_list_t
*variable_list_add(parser_ctx_t
*,variable_list_t
*,variable_declaration_t
*);
150 static void *new_statement(parser_ctx_t
*,statement_type_t
,size_t);
151 static statement_t
*new_block_statement(parser_ctx_t
*,statement_list_t
*);
152 static statement_t
*new_var_statement(parser_ctx_t
*,variable_list_t
*);
153 static statement_t
*new_expression_statement(parser_ctx_t
*,expression_t
*);
154 static statement_t
*new_if_statement(parser_ctx_t
*,expression_t
*,statement_t
*,statement_t
*);
155 static statement_t
*new_while_statement(parser_ctx_t
*,BOOL
,expression_t
*,statement_t
*);
156 static statement_t
*new_for_statement(parser_ctx_t
*,variable_list_t
*,expression_t
*,expression_t
*,
157 expression_t
*,statement_t
*);
158 static statement_t
*new_forin_statement(parser_ctx_t
*,variable_declaration_t
*,expression_t
*,expression_t
*,statement_t
*);
159 static statement_t
*new_continue_statement(parser_ctx_t
*,const WCHAR
*);
160 static statement_t
*new_break_statement(parser_ctx_t
*,const WCHAR
*);
161 static statement_t
*new_return_statement(parser_ctx_t
*,expression_t
*);
162 static statement_t
*new_with_statement(parser_ctx_t
*,expression_t
*,statement_t
*);
163 static statement_t
*new_labelled_statement(parser_ctx_t
*,const WCHAR
*,statement_t
*);
164 static statement_t
*new_switch_statement(parser_ctx_t
*,expression_t
*,case_clausule_t
*);
165 static statement_t
*new_throw_statement(parser_ctx_t
*,expression_t
*);
166 static statement_t
*new_try_statement(parser_ctx_t
*,statement_t
*,catch_block_t
*,statement_t
*);
168 struct statement_list_t
{
173 static statement_list_t
*new_statement_list(parser_ctx_t
*,statement_t
*);
174 static statement_list_t
*statement_list_add(statement_list_t
*,statement_t
*);
176 typedef struct _parameter_list_t
{
181 static parameter_list_t
*new_parameter_list(parser_ctx_t
*,const WCHAR
*);
182 static parameter_list_t
*parameter_list_add(parser_ctx_t
*,parameter_list_t
*,const WCHAR
*);
184 static void *new_expression(parser_ctx_t
*ctx
,expression_type_t
,size_t);
185 static expression_t
*new_function_expression(parser_ctx_t
*,const WCHAR
*,parameter_list_t
*,
186 source_elements_t
*,const WCHAR
*,DWORD
);
187 static expression_t
*new_binary_expression(parser_ctx_t
*,expression_type_t
,expression_t
*,expression_t
*);
188 static expression_t
*new_unary_expression(parser_ctx_t
*,expression_type_t
,expression_t
*);
189 static expression_t
*new_conditional_expression(parser_ctx_t
*,expression_t
*,expression_t
*,expression_t
*);
190 static expression_t
*new_member_expression(parser_ctx_t
*,expression_t
*,const WCHAR
*);
191 static expression_t
*new_new_expression(parser_ctx_t
*,expression_t
*,argument_list_t
*);
192 static expression_t
*new_call_expression(parser_ctx_t
*,expression_t
*,argument_list_t
*);
193 static expression_t
*new_identifier_expression(parser_ctx_t
*,const WCHAR
*);
194 static expression_t
*new_literal_expression(parser_ctx_t
*,literal_t
*);
195 static expression_t
*new_array_literal_expression(parser_ctx_t
*,element_list_t
*,int);
196 static expression_t
*new_prop_and_value_expression(parser_ctx_t
*,property_list_t
*);
198 static source_elements_t
*new_source_elements(parser_ctx_t
*);
199 static source_elements_t
*source_elements_add_statement(source_elements_t
*,statement_t
*);
203 /* Line 189 of yacc.c */
204 #line 205 "parser.tab.c"
206 /* Enabling traces. */
211 /* Enabling verbose error messages. */
212 #ifdef YYERROR_VERBOSE
213 # undef YYERROR_VERBOSE
214 # define YYERROR_VERBOSE 1
216 # define YYERROR_VERBOSE 0
219 /* Enabling the token table. */
220 #ifndef YYTOKEN_TABLE
221 # define YYTOKEN_TABLE 0
228 /* Put the tokens into the symbol table, so that GDB and other debuggers
270 tNumericLiteral
= 297,
271 tBooleanLiteral
= 298,
272 tStringLiteral
= 299,
274 LOWER_THAN_ELSE
= 301
280 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
281 typedef union YYSTYPE
284 /* Line 214 of yacc.c */
291 struct _argument_list_t
*argument_list
;
292 case_clausule_t
*case_clausule
;
293 struct _case_list_t
*case_list
;
294 catch_block_t
*catch_block
;
295 struct _element_list_t
*element_list
;
297 const WCHAR
*identifier
;
298 struct _parameter_list_t
*parameter_list
;
299 struct _property_list_t
*property_list
;
300 source_elements_t
*source_elements
;
301 statement_t
*statement
;
302 struct _statement_list_t
*statement_list
;
303 struct _variable_list_t
*variable_list
;
304 variable_declaration_t
*variable_declaration
;
308 /* Line 214 of yacc.c */
309 #line 310 "parser.tab.c"
311 # define YYSTYPE_IS_TRIVIAL 1
312 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
313 # define YYSTYPE_IS_DECLARED 1
317 /* Copy the second part of user declarations. */
320 /* Line 264 of yacc.c */
321 #line 322 "parser.tab.c"
328 typedef YYTYPE_UINT8 yytype_uint8
;
330 typedef unsigned char yytype_uint8
;
334 typedef YYTYPE_INT8 yytype_int8
;
335 #elif (defined __STDC__ || defined __C99__FUNC__ \
336 || defined __cplusplus || defined _MSC_VER)
337 typedef signed char yytype_int8
;
339 typedef short int yytype_int8
;
343 typedef YYTYPE_UINT16 yytype_uint16
;
345 typedef unsigned short int yytype_uint16
;
349 typedef YYTYPE_INT16 yytype_int16
;
351 typedef short int yytype_int16
;
355 # ifdef __SIZE_TYPE__
356 # define YYSIZE_T __SIZE_TYPE__
357 # elif defined size_t
358 # define YYSIZE_T size_t
359 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
360 || defined __cplusplus || defined _MSC_VER)
361 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
362 # define YYSIZE_T size_t
364 # define YYSIZE_T unsigned int
368 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
373 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
374 # define YY_(msgid) dgettext ("bison-runtime", msgid)
378 # define YY_(msgid) msgid
382 /* Suppress unused-variable warnings by "using" E. */
383 #if ! defined lint || defined __GNUC__
384 # define YYUSE(e) ((void) (e))
386 # define YYUSE(e) /* empty */
389 /* Identity function, used to suppress warnings about constant conditions. */
393 #if (defined __STDC__ || defined __C99__FUNC__ \
394 || defined __cplusplus || defined _MSC_VER)
407 #if ! defined yyoverflow || YYERROR_VERBOSE
409 /* The parser invokes alloca or malloc; define the necessary symbols. */
411 # ifdef YYSTACK_USE_ALLOCA
412 # if YYSTACK_USE_ALLOCA
414 # define YYSTACK_ALLOC __builtin_alloca
415 # elif defined __BUILTIN_VA_ARG_INCR
416 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
418 # define YYSTACK_ALLOC __alloca
419 # elif defined _MSC_VER
420 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
421 # define alloca _alloca
423 # define YYSTACK_ALLOC alloca
424 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
425 || defined __cplusplus || defined _MSC_VER)
426 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
435 # ifdef YYSTACK_ALLOC
436 /* Pacify GCC's `empty if-body' warning. */
437 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
438 # ifndef YYSTACK_ALLOC_MAXIMUM
439 /* The OS might guarantee only one guard page at the bottom of the stack,
440 and a page size can be as small as 4096 bytes. So we cannot safely
441 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
442 to allow for a few compiler-allocated temporary stack slots. */
443 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
446 # define YYSTACK_ALLOC YYMALLOC
447 # define YYSTACK_FREE YYFREE
448 # ifndef YYSTACK_ALLOC_MAXIMUM
449 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
451 # if (defined __cplusplus && ! defined _STDLIB_H \
452 && ! ((defined YYMALLOC || defined malloc) \
453 && (defined YYFREE || defined free)))
454 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
460 # define YYMALLOC malloc
461 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
462 || defined __cplusplus || defined _MSC_VER)
463 void *malloc (YYSIZE_T
); /* INFRINGES ON USER NAME SPACE */
468 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
469 || defined __cplusplus || defined _MSC_VER)
470 void free (void *); /* INFRINGES ON USER NAME SPACE */
474 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
477 #if (! defined yyoverflow \
478 && (! defined __cplusplus \
479 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
481 /* A type that is properly aligned for any stack member. */
484 yytype_int16 yyss_alloc
;
488 /* The size of the maximum gap between one aligned stack and the next. */
489 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
491 /* The size of an array large to enough to hold all stacks, each with
493 # define YYSTACK_BYTES(N) \
494 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
495 + YYSTACK_GAP_MAXIMUM)
497 /* Copy COUNT objects from FROM to TO. The source and destination do
500 # if defined __GNUC__ && 1 < __GNUC__
501 # define YYCOPY(To, From, Count) \
502 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
504 # define YYCOPY(To, From, Count) \
508 for (yyi = 0; yyi < (Count); yyi++) \
509 (To)[yyi] = (From)[yyi]; \
515 /* Relocate STACK from its old location to the new one. The
516 local variables YYSIZE and YYSTACKSIZE give the old and new number of
517 elements in the stack, and YYPTR gives the new location of the
518 stack. Advance YYPTR to a properly aligned location for the next
520 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
523 YYSIZE_T yynewbytes; \
524 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
525 Stack = &yyptr->Stack_alloc; \
526 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
527 yyptr += yynewbytes / sizeof (*yyptr); \
533 /* YYFINAL -- State number of the termination state. */
535 /* YYLAST -- Last index in YYTABLE. */
538 /* YYNTOKENS -- Number of terminals. */
540 /* YYNNTS -- Number of nonterminals. */
542 /* YYNRULES -- Number of rules. */
544 /* YYNRULES -- Number of states. */
545 #define YYNSTATES 375
547 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
549 #define YYMAXUTOK 301
551 #define YYTRANSLATE(YYX) \
552 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
554 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
555 static const yytype_uint8 yytranslate
[] =
557 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
558 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
559 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
560 2, 2, 2, 63, 2, 2, 2, 61, 56, 2,
561 67, 68, 59, 57, 49, 58, 66, 60, 2, 2,
562 2, 2, 2, 2, 2, 2, 2, 2, 52, 51,
563 2, 50, 2, 53, 2, 2, 2, 2, 2, 2,
564 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
565 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
566 2, 64, 2, 65, 55, 2, 2, 2, 2, 2,
567 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
568 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
569 2, 2, 2, 48, 54, 37, 62, 2, 2, 2,
570 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
571 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
572 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
573 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
574 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
575 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
576 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
577 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
578 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
579 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
580 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
581 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
582 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
583 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
584 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
585 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
586 35, 36, 38, 39, 40, 41, 42, 43, 44, 45,
591 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
593 static const yytype_uint16 yyprhs
[] =
595 0, 0, 3, 7, 9, 10, 11, 14, 23, 25,
596 27, 29, 33, 34, 36, 38, 40, 42, 44, 46,
597 48, 50, 52, 54, 56, 58, 60, 62, 64, 66,
598 68, 71, 72, 74, 78, 81, 85, 87, 91, 93,
599 97, 100, 103, 104, 106, 109, 110, 112, 115, 117,
600 120, 128, 134, 142, 148, 149, 150, 162, 163, 164,
601 177, 185, 194, 198, 202, 206, 212, 216, 222, 226,
602 232, 233, 235, 237, 240, 245, 249, 253, 257, 261,
603 266, 272, 275, 276, 278, 280, 282, 284, 288, 289,
604 291, 293, 297, 299, 301, 303, 307, 311, 313, 317,
605 321, 323, 329, 331, 337, 339, 343, 345, 349, 351,
606 355, 357, 361, 363, 367, 369, 373, 375, 379, 381,
607 385, 387, 391, 393, 397, 399, 403, 405, 409, 411,
608 415, 419, 423, 425, 429, 433, 435, 439, 441, 445,
609 449, 451, 455, 459, 463, 465, 468, 471, 474, 477,
610 480, 483, 486, 489, 492, 494, 497, 500, 502, 504,
611 506, 509, 511, 513, 518, 522, 526, 529, 532, 537,
612 541, 544, 548, 550, 554, 556, 558, 560, 562, 564,
613 568, 571, 575, 579, 585, 588, 593, 595, 598, 599,
614 601, 604, 608, 612, 618, 620, 622, 624, 625, 627,
615 629, 631, 633, 635, 637, 639, 641, 643, 645, 647,
616 649, 651, 653, 655, 657, 659
619 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
620 static const yytype_int16 yyrhs
[] =
622 70, 0, -1, 72, 71, 46, -1, 34, -1, -1,
623 -1, 72, 78, -1, 74, 157, 161, 77, 162, 48,
624 75, 37, -1, 36, -1, 72, -1, 38, -1, 76,
625 49, 38, -1, -1, 76, -1, 81, -1, 82, -1,
626 91, -1, 73, -1, 92, -1, 93, -1, 94, -1,
627 99, -1, 100, -1, 101, -1, 102, -1, 103, -1,
628 104, -1, 110, -1, 111, -1, 78, -1, 79, 78,
629 -1, -1, 79, -1, 48, 79, 37, -1, 48, 37,
630 -1, 26, 83, 160, -1, 85, -1, 83, 49, 85,
631 -1, 86, -1, 84, 49, 86, -1, 38, 87, -1,
632 38, 89, -1, -1, 88, -1, 50, 120, -1, -1,
633 90, -1, 50, 121, -1, 51, -1, 116, 160, -1,
634 11, 161, 115, 162, 78, 10, 78, -1, 11, 161,
635 115, 162, 78, -1, 9, 78, 28, 161, 115, 162,
636 160, -1, 28, 161, 115, 162, 78, -1, -1, -1,
637 13, 161, 117, 95, 163, 114, 96, 163, 114, 162,
638 78, -1, -1, -1, 13, 161, 26, 84, 97, 163,
639 114, 98, 163, 114, 162, 78, -1, 13, 161, 143,
640 14, 115, 162, 78, -1, 13, 161, 26, 86, 14,
641 115, 162, 78, -1, 6, 157, 160, -1, 3, 157,
642 160, -1, 18, 114, 160, -1, 29, 161, 116, 162,
643 78, -1, 38, 52, 78, -1, 19, 161, 116, 162,
644 105, -1, 48, 106, 37, -1, 48, 106, 109, 106,
645 37, -1, -1, 107, -1, 108, -1, 107, 108, -1,
646 4, 116, 52, 80, -1, 7, 52, 80, -1, 21,
647 116, 160, -1, 24, 81, 112, -1, 24, 81, 113,
648 -1, 24, 81, 112, 113, -1, 5, 161, 38, 162,
649 81, -1, 12, 81, -1, -1, 116, -1, 116, -1,
650 1, -1, 120, -1, 116, 49, 120, -1, -1, 118,
651 -1, 121, -1, 118, 49, 121, -1, 39, -1, 35,
652 -1, 122, -1, 143, 50, 120, -1, 143, 119, 120,
653 -1, 123, -1, 143, 50, 121, -1, 143, 119, 121,
654 -1, 124, -1, 124, 53, 120, 52, 120, -1, 125,
655 -1, 125, 53, 121, 52, 121, -1, 126, -1, 124,
656 31, 126, -1, 127, -1, 125, 31, 127, -1, 128,
657 -1, 126, 30, 128, -1, 129, -1, 127, 30, 129,
658 -1, 130, -1, 128, 54, 130, -1, 131, -1, 129,
659 54, 131, -1, 132, -1, 130, 55, 132, -1, 133,
660 -1, 131, 55, 133, -1, 134, -1, 132, 56, 134,
661 -1, 135, -1, 133, 56, 135, -1, 136, -1, 134,
662 40, 136, -1, 137, -1, 135, 40, 137, -1, 138,
663 -1, 136, 42, 138, -1, 136, 15, 138, -1, 136,
664 14, 138, -1, 138, -1, 137, 42, 138, -1, 137,
665 15, 138, -1, 139, -1, 138, 41, 139, -1, 140,
666 -1, 139, 57, 140, -1, 139, 58, 140, -1, 141,
667 -1, 140, 59, 141, -1, 140, 60, 141, -1, 140,
668 61, 141, -1, 142, -1, 8, 141, -1, 27, 141,
669 -1, 25, 141, -1, 32, 141, -1, 33, 141, -1,
670 57, 141, -1, 58, 141, -1, 62, 141, -1, 63,
671 141, -1, 143, -1, 143, 32, -1, 143, 33, -1,
672 144, -1, 146, -1, 145, -1, 16, 144, -1, 149,
673 -1, 73, -1, 145, 64, 116, 65, -1, 145, 66,
674 38, -1, 16, 145, 147, -1, 145, 147, -1, 146,
675 147, -1, 146, 64, 116, 65, -1, 146, 66, 38,
676 -1, 67, 68, -1, 67, 148, 68, -1, 120, -1,
677 148, 49, 120, -1, 20, -1, 38, -1, 158, -1,
678 150, -1, 154, -1, 67, 116, 68, -1, 64, 65,
679 -1, 64, 152, 65, -1, 64, 151, 65, -1, 64,
680 151, 49, 153, 65, -1, 153, 120, -1, 151, 49,
681 153, 120, -1, 49, -1, 152, 49, -1, -1, 152,
682 -1, 48, 37, -1, 48, 155, 37, -1, 156, 52,
683 120, -1, 155, 49, 156, 52, 120, -1, 38, -1,
684 45, -1, 43, -1, -1, 38, -1, 17, -1, 159,
685 -1, 43, -1, 45, -1, 60, -1, 35, -1, 22,
686 -1, 23, -1, 44, -1, 51, -1, 1, -1, 67,
687 -1, 1, -1, 68, -1, 1, -1, 51, -1, 1,
691 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
692 static const yytype_uint16 yyrline
[] =
694 0, 252, 252, 256, 257, 261, 262, 267, 271, 275,
695 279, 280, 285, 286, 290, 291, 292, 293, 294, 295,
696 296, 297, 298, 299, 300, 301, 302, 303, 304, 308,
697 309, 314, 315, 319, 320, 324, 329, 330, 335, 337,
698 342, 347, 352, 353, 357, 362, 363, 367, 372, 376,
699 381, 383, 388, 390, 393, 395, 392, 399, 401, 398,
700 404, 406, 411, 416, 421, 426, 431, 436, 441, 443,
701 448, 449, 453, 454, 459, 464, 469, 474, 475, 476,
702 481, 486, 490, 491, 494, 495, 499, 500, 505, 506,
703 510, 512, 516, 517, 521, 522, 524, 529, 531, 533,
704 538, 539, 544, 546, 551, 552, 557, 559, 564, 565,
705 570, 572, 577, 578, 583, 585, 590, 591, 596, 598,
706 603, 604, 609, 611, 616, 617, 622, 623, 628, 629,
707 631, 633, 638, 639, 641, 646, 647, 652, 654, 656,
708 661, 662, 664, 666, 671, 672, 674, 675, 677, 678,
709 679, 680, 681, 682, 686, 688, 690, 696, 697, 701,
710 702, 706, 707, 708, 710, 712, 717, 719, 721, 723,
711 728, 729, 733, 734, 739, 740, 741, 742, 743, 744,
712 748, 749, 750, 751, 756, 758, 763, 764, 768, 769,
713 773, 774, 779, 781, 786, 787, 788, 792, 793, 797,
714 798, 799, 800, 801, 803, 808, 809, 810, 813, 814,
715 817, 818, 821, 822, 825, 826
719 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
720 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
721 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
722 static const char *const yytname
[] =
724 "$end", "error", "$undefined", "kBREAK", "kCASE", "kCATCH", "kCONTINUE",
725 "kDEFAULT", "kDELETE", "kDO", "kELSE", "kIF", "kFINALLY", "kFOR", "kIN",
726 "kINSTANCEOF", "kNEW", "kNULL", "kRETURN", "kSWITCH", "kTHIS", "kTHROW",
727 "kTRUE", "kFALSE", "kTRY", "kTYPEOF", "kVAR", "kVOID", "kWHILE", "kWITH",
728 "tANDAND", "tOROR", "tINC", "tDEC", "tHTMLCOMMENT", "kDIVEQ",
729 "kFUNCTION", "'}'", "tIdentifier", "tAssignOper", "tEqOper",
730 "tShiftOper", "tRelOper", "tNumericLiteral", "tBooleanLiteral",
731 "tStringLiteral", "tEOF", "LOWER_THAN_ELSE", "'{'", "','", "'='", "';'",
732 "':'", "'?'", "'|'", "'^'", "'&'", "'+'", "'-'", "'*'", "'/'", "'%'",
733 "'~'", "'!'", "'['", "']'", "'.'", "'('", "')'", "$accept", "Program",
734 "HtmlComment", "SourceElements", "FunctionExpression", "KFunction",
735 "FunctionBody", "FormalParameterList", "FormalParameterList_opt",
736 "Statement", "StatementList", "StatementList_opt", "Block",
737 "VariableStatement", "VariableDeclarationList",
738 "VariableDeclarationListNoIn", "VariableDeclaration",
739 "VariableDeclarationNoIn", "Initialiser_opt", "Initialiser",
740 "InitialiserNoIn_opt", "InitialiserNoIn", "EmptyStatement",
741 "ExpressionStatement", "IfStatement", "IterationStatement", "$@1", "$@2",
742 "$@3", "$@4", "ContinueStatement", "BreakStatement", "ReturnStatement",
743 "WithStatement", "LabelledStatement", "SwitchStatement", "CaseBlock",
744 "CaseClausules_opt", "CaseClausules", "CaseClausule", "DefaultClausule",
745 "ThrowStatement", "TryStatement", "Catch", "Finally", "Expression_opt",
746 "Expression_err", "Expression", "ExpressionNoIn_opt", "ExpressionNoIn",
747 "AssignOper", "AssignmentExpression", "AssignmentExpressionNoIn",
748 "ConditionalExpression", "ConditionalExpressionNoIn",
749 "LogicalORExpression", "LogicalORExpressionNoIn", "LogicalANDExpression",
750 "LogicalANDExpressionNoIn", "BitwiseORExpression",
751 "BitwiseORExpressionNoIn", "BitwiseXORExpression",
752 "BitwiseXORExpressionNoIn", "BitwiseANDExpression",
753 "BitwiseANDExpressionNoIn", "EqualityExpression",
754 "EqualityExpressionNoIn", "RelationalExpression",
755 "RelationalExpressionNoIn", "ShiftExpression", "AdditiveExpression",
756 "MultiplicativeExpression", "UnaryExpression", "PostfixExpression",
757 "LeftHandSideExpression", "NewExpression", "MemberExpression",
758 "CallExpression", "Arguments", "ArgumentList", "PrimaryExpression",
759 "ArrayLiteral", "ElementList", "Elision", "Elision_opt", "ObjectLiteral",
760 "PropertyNameAndValueList", "PropertyName", "Identifier_opt", "Literal",
761 "BooleanLiteral", "semicolon_opt", "left_bracket", "right_bracket",
767 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
769 static const yytype_uint16 yytoknum
[] =
771 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
772 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
773 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
774 285, 286, 287, 288, 289, 290, 291, 125, 292, 293,
775 294, 295, 296, 297, 298, 299, 300, 301, 123, 44,
776 61, 59, 58, 63, 124, 94, 38, 43, 45, 42,
777 47, 37, 126, 33, 91, 93, 46, 40, 41
781 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
782 static const yytype_uint8 yyr1
[] =
784 0, 69, 70, 71, 71, 72, 72, 73, 74, 75,
785 76, 76, 77, 77, 78, 78, 78, 78, 78, 78,
786 78, 78, 78, 78, 78, 78, 78, 78, 78, 79,
787 79, 80, 80, 81, 81, 82, 83, 83, 84, 84,
788 85, 86, 87, 87, 88, 89, 89, 90, 91, 92,
789 93, 93, 94, 94, 95, 96, 94, 97, 98, 94,
790 94, 94, 99, 100, 101, 102, 103, 104, 105, 105,
791 106, 106, 107, 107, 108, 109, 110, 111, 111, 111,
792 112, 113, 114, 114, 115, 115, 116, 116, 117, 117,
793 118, 118, 119, 119, 120, 120, 120, 121, 121, 121,
794 122, 122, 123, 123, 124, 124, 125, 125, 126, 126,
795 127, 127, 128, 128, 129, 129, 130, 130, 131, 131,
796 132, 132, 133, 133, 134, 134, 135, 135, 136, 136,
797 136, 136, 137, 137, 137, 138, 138, 139, 139, 139,
798 140, 140, 140, 140, 141, 141, 141, 141, 141, 141,
799 141, 141, 141, 141, 142, 142, 142, 143, 143, 144,
800 144, 145, 145, 145, 145, 145, 146, 146, 146, 146,
801 147, 147, 148, 148, 149, 149, 149, 149, 149, 149,
802 150, 150, 150, 150, 151, 151, 152, 152, 153, 153,
803 154, 154, 155, 155, 156, 156, 156, 157, 157, 158,
804 158, 158, 158, 158, 158, 159, 159, 159, 160, 160,
805 161, 161, 162, 162, 163, 163
808 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
809 static const yytype_uint8 yyr2
[] =
811 0, 2, 3, 1, 0, 0, 2, 8, 1, 1,
812 1, 3, 0, 1, 1, 1, 1, 1, 1, 1,
813 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
814 2, 0, 1, 3, 2, 3, 1, 3, 1, 3,
815 2, 2, 0, 1, 2, 0, 1, 2, 1, 2,
816 7, 5, 7, 5, 0, 0, 11, 0, 0, 12,
817 7, 8, 3, 3, 3, 5, 3, 5, 3, 5,
818 0, 1, 1, 2, 4, 3, 3, 3, 3, 4,
819 5, 2, 0, 1, 1, 1, 1, 3, 0, 1,
820 1, 3, 1, 1, 1, 3, 3, 1, 3, 3,
821 1, 5, 1, 5, 1, 3, 1, 3, 1, 3,
822 1, 3, 1, 3, 1, 3, 1, 3, 1, 3,
823 1, 3, 1, 3, 1, 3, 1, 3, 1, 3,
824 3, 3, 1, 3, 3, 1, 3, 1, 3, 3,
825 1, 3, 3, 3, 1, 2, 2, 2, 2, 2,
826 2, 2, 2, 2, 1, 2, 2, 1, 1, 1,
827 2, 1, 1, 4, 3, 3, 2, 2, 4, 3,
828 2, 3, 1, 3, 1, 1, 1, 1, 1, 3,
829 2, 3, 3, 5, 2, 4, 1, 2, 0, 1,
830 2, 3, 3, 5, 1, 1, 1, 0, 1, 1,
831 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
835 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
836 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
837 means the default is an error. */
838 static const yytype_uint8 yydefact
[] =
840 5, 0, 4, 1, 197, 197, 0, 0, 0, 0,
841 0, 199, 82, 0, 174, 0, 205, 206, 0, 0,
842 0, 0, 0, 0, 0, 0, 3, 204, 8, 175,
843 201, 207, 202, 0, 48, 0, 0, 203, 0, 0,
844 188, 0, 0, 17, 197, 6, 14, 15, 16, 18,
845 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
846 0, 86, 94, 100, 104, 108, 112, 116, 120, 124,
847 128, 135, 137, 140, 144, 154, 157, 159, 158, 161,
848 177, 178, 176, 200, 198, 0, 0, 175, 0, 162,
849 145, 154, 0, 211, 210, 0, 88, 160, 159, 0,
850 83, 0, 0, 0, 0, 147, 42, 0, 36, 146,
851 0, 0, 148, 149, 0, 34, 175, 201, 202, 29,
852 0, 0, 0, 150, 151, 152, 153, 186, 180, 0,
853 189, 0, 0, 2, 0, 209, 0, 208, 49, 0,
854 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
855 0, 0, 0, 0, 0, 155, 156, 93, 92, 0,
856 0, 0, 0, 0, 166, 0, 0, 167, 63, 62,
857 190, 194, 196, 195, 0, 85, 0, 84, 0, 54,
858 89, 90, 97, 102, 106, 110, 114, 118, 122, 126,
859 132, 154, 165, 64, 0, 76, 34, 0, 0, 77,
860 78, 0, 40, 43, 0, 35, 0, 0, 66, 33,
861 30, 191, 0, 0, 188, 182, 187, 181, 184, 179,
862 12, 87, 105, 0, 109, 113, 117, 121, 125, 131,
863 130, 129, 136, 138, 139, 141, 142, 143, 95, 96,
864 0, 164, 170, 172, 0, 0, 169, 0, 213, 212,
865 0, 45, 57, 38, 0, 0, 0, 0, 0, 0,
866 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
867 81, 79, 44, 37, 0, 0, 0, 192, 189, 0,
868 10, 13, 0, 0, 163, 0, 171, 168, 0, 51,
869 0, 41, 46, 0, 0, 0, 215, 214, 82, 91,
870 154, 107, 0, 111, 115, 119, 123, 127, 134, 133,
871 0, 98, 99, 70, 67, 0, 53, 65, 0, 183,
872 185, 0, 0, 101, 173, 0, 0, 47, 39, 82,
873 0, 55, 0, 0, 0, 0, 71, 72, 0, 193,
874 11, 5, 52, 50, 58, 0, 0, 103, 60, 0,
875 0, 68, 70, 73, 80, 9, 0, 0, 61, 82,
876 31, 31, 0, 7, 82, 0, 32, 74, 75, 69,
880 /* YYDEFGOTO[NTERM-NUM]. */
881 static const yytype_int16 yydefgoto
[] =
883 -1, 1, 42, 2, 89, 44, 356, 281, 282, 119,
884 120, 367, 46, 47, 107, 252, 108, 253, 202, 203,
885 291, 292, 48, 49, 50, 51, 254, 346, 294, 357,
886 52, 53, 54, 55, 56, 57, 314, 335, 336, 337,
887 352, 58, 59, 199, 200, 99, 176, 60, 179, 180,
888 267, 61, 181, 62, 182, 63, 183, 64, 184, 65,
889 185, 66, 186, 67, 187, 68, 188, 69, 189, 70,
890 71, 72, 73, 74, 75, 76, 77, 78, 164, 244,
891 79, 80, 129, 130, 131, 81, 121, 122, 85, 82,
892 83, 138, 95, 250, 298
895 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
897 #define YYPACT_NINF -293
898 static const yytype_int16 yypact
[] =
900 -293, 53, 496, -293, 26, 26, 956, 744, 8, 8,
901 986, -293, 956, 8, -293, 956, -293, -293, 39, 956,
902 71, 956, 8, 8, 956, 956, -293, -293, -293, 67,
903 -293, -293, -293, 558, -293, 956, 956, -293, 956, 956,
904 41, 956, 76, 410, 26, -293, -293, -293, -293, -293,
905 -293, -293, -293, -293, -293, -293, -293, -293, -293, -293,
906 19, -293, -293, -7, 102, 100, 108, 111, 135, 36,
907 142, -43, 97, -293, -293, 129, -293, 105, 118, -293,
908 -293, -293, -293, -293, -293, 7, 7, -293, 176, -293,
909 -293, 49, 158, -293, -293, 372, 850, -293, 105, 7,
910 140, 956, 19, 620, 125, -293, 153, 47, -293, -293,
911 372, 956, -293, -293, 744, 442, 67, 155, 163, -293,
912 682, 80, 165, -293, -293, -293, -293, -293, -293, 42,
913 48, 956, 31, -293, 8, -293, 956, -293, -293, 956,
914 956, 956, 956, 956, 956, 956, 956, 956, 956, 956,
915 956, 956, 956, 956, 956, -293, -293, -293, -293, 956,
916 956, 956, 180, 797, -293, 956, 182, -293, -293, -293,
917 -293, -293, -293, -293, 8, -293, 3, 140, 184, -293,
918 181, -293, -293, 35, 195, 172, 178, 175, 192, 23,
919 142, 120, -293, -293, 11, -293, -293, 8, 39, 222,
920 -293, 956, -293, -293, 71, -293, 3, 11, -293, -293,
921 -293, -293, 90, 956, 186, -293, -293, -293, -293, -293,
922 198, -293, 102, 185, 100, 108, 111, 135, 36, 142,
923 142, 142, -43, 97, 97, -293, -293, -293, -293, -293,
924 56, -293, -293, -293, 34, 66, -293, 372, -293, -293,
925 744, 188, 190, 226, 10, 956, 956, 956, 956, 956,
926 956, 956, 956, 956, 956, 372, 956, 956, 193, 204,
927 -293, -293, -293, -293, 744, 744, 194, -293, 196, 903,
928 -293, 202, 3, 956, -293, 956, -293, -293, 3, 234,
929 956, -293, -293, 184, 10, 372, -293, -293, 956, -293,
930 177, 195, 214, 172, 178, 175, 192, 23, 142, 142,
931 3, -293, -293, 263, -293, 3, -293, -293, 956, -293,
932 -293, 230, 221, -293, -293, 7, 744, -293, -293, 956,
933 3, -293, 956, 744, 956, 6, 263, -293, 39, -293,
934 -293, -293, -293, -293, -293, 744, 10, -293, -293, 59,
935 219, -293, 263, -293, -293, 744, 239, 10, -293, 956,
936 744, 744, 240, -293, 956, 3, 744, -293, -293, -293,
937 3, 744, 744, -293, -293
940 /* YYPGOTO[NTERM-NUM]. */
941 static const yytype_int16 yypgoto
[] =
943 -293, -293, -293, -63, -2, -293, -293, -293, -293, 0,
944 -187, -82, -17, -293, -293, -293, 77, -10, -293, -293,
945 -293, -293, -293, -293, -293, -293, -293, -293, -293, -293,
946 -293, -293, -293, -293, -293, -293, -293, -68, -293, -51,
947 -293, -293, -293, -293, 87, -292, -87, 15, -293, -293,
948 213, -36, -238, -293, -293, -293, -293, 150, 40, 149,
949 33, 151, 43, 152, 44, 148, 45, 156, 46, -62,
950 145, 37, 38, -293, -3, 287, 288, -293, -9, -293,
951 -293, -293, -293, 86, 89, -293, -293, 95, 5, -293,
952 -293, -60, 32, 17, -254
955 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
956 positive, shift that token. If negative, reduce the rule which
957 number is the opposite. If zero, do what YYDEFACT says.
958 If YYTABLE_NINF, syntax error. */
959 #define YYTABLE_NINF -197
960 static const yytype_int16 yytable
[] =
962 43, 104, 45, 91, 248, 43, 331, 92, 135, 93,
963 86, 296, 248, 350, 150, 151, 91, 299, 91, 302,
964 135, 91, 91, 206, 139, 168, 169, 100, 311, 312,
965 102, 43, 91, 91, 190, 91, 91, 344, 263, 193,
966 329, 96, 195, 351, 90, 101, 140, 205, 135, 134,
967 146, 147, 327, 3, 110, 111, 132, 105, 137, 109,
968 136, 297, 112, 113, 84, 264, 256, 365, 136, 167,
969 137, 249, 370, 123, 124, 94, 125, 126, 148, 249,
970 136, 155, 156, 285, 229, 230, 231, 103, 257, 192,
971 127, 214, 359, 191, 347, 218, 204, 216, 137, 219,
972 221, 43, 286, 364, 223, 136, 128, 215, 136, 106,
973 177, 360, 43, 217, 208, 136, 194, 211, 43, 114,
974 210, 284, 133, 238, 239, 177, 207, 243, 171, 212,
975 197, 287, 141, 172, 265, 173, 91, 198, 91, 91,
976 91, 91, 91, 91, 91, 91, 91, 91, 91, 91,
977 91, 91, 155, 156, 142, 157, 152, 153, 154, 158,
978 288, 155, 156, 143, 157, 272, 220, 144, 158, 161,
979 266, 162, 163, 366, 366, 145, 240, 277, 310, 159,
980 245, 270, 165, 149, 166, 163, 174, 233, 234, 136,
981 235, 236, 237, 190, 190, 190, 190, 190, 190, 190,
982 190, 308, 309, 201, 190, 190, 247, -196, 330, 155,
983 156, 268, 157, 170, 171, -195, 158, 213, 241, 172,
984 246, 173, 251, 274, 275, 258, 259, 266, 190, 269,
985 255, 261, 262, 260, 198, 127, 280, 283, 290, 293,
986 295, 313, 315, 320, 326, 216, 318, 323, 43, 324,
987 289, 321, 300, 91, 300, 91, 91, 91, 91, 91,
988 91, 91, 177, 300, 300, 342, 332, 334, 340, 341,
989 190, 361, 43, 43, 316, 317, 363, 369, 355, 368,
990 177, 273, 339, 328, 362, 353, 271, 300, 160, 222,
991 224, 303, 227, 225, 232, 226, 301, 97, 98, 322,
992 278, 228, 304, 279, 305, 325, 306, 276, 307, 0,
993 177, 0, 0, 100, 0, 0, 0, 0, 0, 0,
994 0, 354, 0, 0, 43, 0, 343, 333, 0, 300,
995 0, 43, 338, 348, 0, 0, 0, 0, 0, 0,
996 0, 0, 0, 43, 100, 358, 0, 345, 0, 349,
997 0, 0, 0, 43, 0, 45, 0, 0, 43, 43,
998 0, 0, 0, 0, 43, 0, 210, 0, 0, 43,
999 43, 373, 374, 175, 100, 0, 0, 0, 0, 100,
1000 6, 0, 371, 0, 0, 0, 0, 372, 10, 11,
1001 0, 0, 14, 0, 16, 17, 0, 19, 0, 21,
1002 0, 0, 0, 0, 24, 25, 0, 27, 28, 0,
1003 87, -162, 0, 0, 0, 30, 31, 32, 0, 0,
1004 88, 0, 0, 0, -162, -162, 0, 0, 0, 35,
1005 36, 0, 37, 0, 38, 39, 40, 0, 0, 41,
1006 -162, -162, 0, -190, 0, 0, 0, 0, 0, -162,
1007 -162, -162, -162, 0, 0, 0, -190, -190, 0, -162,
1008 -162, 0, 0, -162, -162, -162, -162, 0, 0, -162,
1009 0, -162, -190, -190, 0, 0, -162, 0, 0, 0,
1010 0, -190, -190, -190, -190, 0, 0, 0, 0, 0,
1011 0, -190, -190, 0, 0, -190, -190, -190, -190, 4,
1012 0, -190, 5, -190, 6, 7, 0, 8, -190, 9,
1013 0, 0, 10, 11, 12, 13, 14, 15, 16, 17,
1014 18, 19, 20, 21, 22, 23, 0, 0, 24, 25,
1015 26, 27, 28, 0, 29, 0, 0, 0, 0, 30,
1016 31, 32, 0, 0, 33, 0, 0, 34, 0, 0,
1017 0, 0, 0, 35, 36, 0, 37, 0, 38, 39,
1018 40, 4, 0, 41, 5, 0, 6, 7, 0, 8,
1019 0, 9, 0, 0, 10, 11, 12, 13, 14, 15,
1020 16, 17, 18, 19, 20, 21, 22, 23, 0, 0,
1021 24, 25, 0, 27, 28, 115, 116, 0, 0, 0,
1022 0, 117, 31, 118, 0, 0, 33, 0, 0, 34,
1023 0, 0, 0, 0, 0, 35, 36, 0, 37, 0,
1024 38, 39, 40, 4, 0, 41, 5, 0, 6, 7,
1025 0, 8, 0, 9, 0, 0, 10, 11, 12, 13,
1026 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
1027 0, 0, 24, 25, 0, 27, 28, 196, 29, 0,
1028 0, 0, 0, 30, 31, 32, 0, 0, 33, 0,
1029 0, 34, 0, 0, 0, 0, 0, 35, 36, 0,
1030 37, 0, 38, 39, 40, 4, 0, 41, 5, 0,
1031 6, 7, 0, 8, 0, 9, 0, 0, 10, 11,
1032 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
1033 22, 23, 0, 0, 24, 25, 0, 27, 28, 209,
1034 29, 0, 0, 0, 0, 30, 31, 32, 0, 0,
1035 33, 0, 0, 34, 0, 0, 0, 0, 0, 35,
1036 36, 0, 37, 0, 38, 39, 40, 4, 0, 41,
1037 5, 0, 6, 7, 0, 8, 0, 9, 0, 0,
1038 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
1039 20, 21, 22, 23, 0, 0, 24, 25, 0, 27,
1040 28, 0, 29, 0, 0, 0, 0, 30, 31, 32,
1041 0, 0, 33, 0, 0, 34, 0, 0, 0, 0,
1042 0, 35, 36, 0, 37, 6, 38, 39, 40, 0,
1043 0, 41, 0, 10, 11, 0, 0, 14, 0, 16,
1044 17, 0, 19, 0, 21, 0, 0, 0, 0, 24,
1045 25, 0, 27, 28, 0, 87, 0, 0, 0, 0,
1046 30, 31, 32, 0, 0, 88, 0, 0, 0, 0,
1047 0, 0, 0, 0, 35, 36, 0, 37, 6, 38,
1048 39, 40, 0, 0, 41, 242, 10, 11, 0, 0,
1049 14, 0, 16, 17, 0, 19, 178, 21, 0, 0,
1050 0, 0, 24, 25, 0, 27, 28, 0, 87, 0,
1051 0, 0, 0, 30, 31, 32, 0, 0, 88, 0,
1052 0, 0, 0, 0, 0, 0, 0, 35, 36, 0,
1053 37, 6, 38, 39, 40, 0, 0, 41, 0, 10,
1054 11, 0, 0, 14, 0, 16, 17, 0, 19, 0,
1055 21, 0, 0, 0, 0, 24, 25, 0, 27, 28,
1056 0, 87, 0, 0, 0, 0, 30, 31, 32, 0,
1057 0, 88, 0, 0, 0, 0, 0, 0, 0, 0,
1058 35, 36, 0, 37, 6, 38, 39, 40, 319, 0,
1059 41, 0, 10, 11, 0, 0, 14, 0, 16, 17,
1060 0, 19, 0, 21, 0, 0, 0, 0, 24, 25,
1061 0, 27, 28, 0, 87, 0, 0, 0, 0, 30,
1062 31, 32, 10, 11, 88, 0, 14, 0, 16, 17,
1063 0, 0, 0, 35, 36, 0, 37, 0, 38, 39,
1064 40, 27, 28, 41, 87, 0, 0, 0, 0, 30,
1065 31, 32, 0, 0, 88, 0, 0, 0, 0, 0,
1066 0, 0, 0, 0, 0, 0, 37, 0, 0, 0,
1070 static const yytype_int16 yycheck
[] =
1072 2, 18, 2, 6, 1, 7, 298, 7, 1, 1,
1073 5, 1, 1, 7, 57, 58, 19, 255, 21, 257,
1074 1, 24, 25, 110, 31, 85, 86, 12, 266, 267,
1075 15, 33, 35, 36, 96, 38, 39, 329, 15, 99,
1076 294, 9, 102, 37, 6, 13, 53, 107, 1, 44,
1077 14, 15, 290, 0, 22, 23, 41, 19, 51, 21,
1078 49, 51, 24, 25, 38, 42, 31, 359, 49, 78,
1079 51, 68, 364, 35, 36, 67, 38, 39, 42, 68,
1080 49, 32, 33, 49, 146, 147, 148, 48, 53, 98,
1081 49, 49, 346, 96, 332, 131, 49, 49, 51, 68,
1082 136, 103, 68, 357, 140, 49, 65, 65, 49, 38,
1083 95, 52, 114, 65, 114, 49, 101, 37, 120, 52,
1084 120, 65, 46, 159, 160, 110, 111, 163, 38, 49,
1085 5, 65, 30, 43, 14, 45, 139, 12, 141, 142,
1086 143, 144, 145, 146, 147, 148, 149, 150, 151, 152,
1087 153, 154, 32, 33, 54, 35, 59, 60, 61, 39,
1088 247, 32, 33, 55, 35, 201, 134, 56, 39, 64,
1089 50, 66, 67, 360, 361, 40, 161, 213, 265, 50,
1090 165, 198, 64, 41, 66, 67, 28, 150, 151, 49,
1091 152, 153, 154, 255, 256, 257, 258, 259, 260, 261,
1092 262, 263, 264, 50, 266, 267, 174, 52, 295, 32,
1093 33, 194, 35, 37, 38, 52, 39, 52, 38, 43,
1094 38, 45, 38, 206, 207, 30, 54, 50, 290, 197,
1095 49, 56, 40, 55, 12, 49, 38, 52, 50, 49,
1096 14, 48, 38, 279, 10, 49, 52, 283, 250, 285,
1097 250, 49, 255, 256, 257, 258, 259, 260, 261, 262,
1098 263, 264, 247, 266, 267, 325, 52, 4, 38, 48,
1099 332, 52, 274, 275, 274, 275, 37, 37, 341, 361,
1100 265, 204, 318, 293, 352, 336, 199, 290, 75, 139,
1101 141, 258, 144, 142, 149, 143, 256, 10, 10, 282,
1102 214, 145, 259, 214, 260, 288, 261, 212, 262, -1,
1103 295, -1, -1, 298, -1, -1, -1, -1, -1, -1,
1104 -1, 338, -1, -1, 326, -1, 326, 310, -1, 332,
1105 -1, 333, 315, 333, -1, -1, -1, -1, -1, -1,
1106 -1, -1, -1, 345, 329, 345, -1, 330, -1, 334,
1107 -1, -1, -1, 355, -1, 355, -1, -1, 360, 361,
1108 -1, -1, -1, -1, 366, -1, 366, -1, -1, 371,
1109 372, 371, 372, 1, 359, -1, -1, -1, -1, 364,
1110 8, -1, 365, -1, -1, -1, -1, 370, 16, 17,
1111 -1, -1, 20, -1, 22, 23, -1, 25, -1, 27,
1112 -1, -1, -1, -1, 32, 33, -1, 35, 36, -1,
1113 38, 1, -1, -1, -1, 43, 44, 45, -1, -1,
1114 48, -1, -1, -1, 14, 15, -1, -1, -1, 57,
1115 58, -1, 60, -1, 62, 63, 64, -1, -1, 67,
1116 30, 31, -1, 1, -1, -1, -1, -1, -1, 39,
1117 40, 41, 42, -1, -1, -1, 14, 15, -1, 49,
1118 50, -1, -1, 53, 54, 55, 56, -1, -1, 59,
1119 -1, 61, 30, 31, -1, -1, 66, -1, -1, -1,
1120 -1, 39, 40, 41, 42, -1, -1, -1, -1, -1,
1121 -1, 49, 50, -1, -1, 53, 54, 55, 56, 3,
1122 -1, 59, 6, 61, 8, 9, -1, 11, 66, 13,
1123 -1, -1, 16, 17, 18, 19, 20, 21, 22, 23,
1124 24, 25, 26, 27, 28, 29, -1, -1, 32, 33,
1125 34, 35, 36, -1, 38, -1, -1, -1, -1, 43,
1126 44, 45, -1, -1, 48, -1, -1, 51, -1, -1,
1127 -1, -1, -1, 57, 58, -1, 60, -1, 62, 63,
1128 64, 3, -1, 67, 6, -1, 8, 9, -1, 11,
1129 -1, 13, -1, -1, 16, 17, 18, 19, 20, 21,
1130 22, 23, 24, 25, 26, 27, 28, 29, -1, -1,
1131 32, 33, -1, 35, 36, 37, 38, -1, -1, -1,
1132 -1, 43, 44, 45, -1, -1, 48, -1, -1, 51,
1133 -1, -1, -1, -1, -1, 57, 58, -1, 60, -1,
1134 62, 63, 64, 3, -1, 67, 6, -1, 8, 9,
1135 -1, 11, -1, 13, -1, -1, 16, 17, 18, 19,
1136 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
1137 -1, -1, 32, 33, -1, 35, 36, 37, 38, -1,
1138 -1, -1, -1, 43, 44, 45, -1, -1, 48, -1,
1139 -1, 51, -1, -1, -1, -1, -1, 57, 58, -1,
1140 60, -1, 62, 63, 64, 3, -1, 67, 6, -1,
1141 8, 9, -1, 11, -1, 13, -1, -1, 16, 17,
1142 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,
1143 28, 29, -1, -1, 32, 33, -1, 35, 36, 37,
1144 38, -1, -1, -1, -1, 43, 44, 45, -1, -1,
1145 48, -1, -1, 51, -1, -1, -1, -1, -1, 57,
1146 58, -1, 60, -1, 62, 63, 64, 3, -1, 67,
1147 6, -1, 8, 9, -1, 11, -1, 13, -1, -1,
1148 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
1149 26, 27, 28, 29, -1, -1, 32, 33, -1, 35,
1150 36, -1, 38, -1, -1, -1, -1, 43, 44, 45,
1151 -1, -1, 48, -1, -1, 51, -1, -1, -1, -1,
1152 -1, 57, 58, -1, 60, 8, 62, 63, 64, -1,
1153 -1, 67, -1, 16, 17, -1, -1, 20, -1, 22,
1154 23, -1, 25, -1, 27, -1, -1, -1, -1, 32,
1155 33, -1, 35, 36, -1, 38, -1, -1, -1, -1,
1156 43, 44, 45, -1, -1, 48, -1, -1, -1, -1,
1157 -1, -1, -1, -1, 57, 58, -1, 60, 8, 62,
1158 63, 64, -1, -1, 67, 68, 16, 17, -1, -1,
1159 20, -1, 22, 23, -1, 25, 26, 27, -1, -1,
1160 -1, -1, 32, 33, -1, 35, 36, -1, 38, -1,
1161 -1, -1, -1, 43, 44, 45, -1, -1, 48, -1,
1162 -1, -1, -1, -1, -1, -1, -1, 57, 58, -1,
1163 60, 8, 62, 63, 64, -1, -1, 67, -1, 16,
1164 17, -1, -1, 20, -1, 22, 23, -1, 25, -1,
1165 27, -1, -1, -1, -1, 32, 33, -1, 35, 36,
1166 -1, 38, -1, -1, -1, -1, 43, 44, 45, -1,
1167 -1, 48, -1, -1, -1, -1, -1, -1, -1, -1,
1168 57, 58, -1, 60, 8, 62, 63, 64, 65, -1,
1169 67, -1, 16, 17, -1, -1, 20, -1, 22, 23,
1170 -1, 25, -1, 27, -1, -1, -1, -1, 32, 33,
1171 -1, 35, 36, -1, 38, -1, -1, -1, -1, 43,
1172 44, 45, 16, 17, 48, -1, 20, -1, 22, 23,
1173 -1, -1, -1, 57, 58, -1, 60, -1, 62, 63,
1174 64, 35, 36, 67, 38, -1, -1, -1, -1, 43,
1175 44, 45, -1, -1, 48, -1, -1, -1, -1, -1,
1176 -1, -1, -1, -1, -1, -1, 60, -1, -1, -1,
1180 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
1181 symbol of state STATE-NUM. */
1182 static const yytype_uint8 yystos
[] =
1184 0, 70, 72, 0, 3, 6, 8, 9, 11, 13,
1185 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
1186 26, 27, 28, 29, 32, 33, 34, 35, 36, 38,
1187 43, 44, 45, 48, 51, 57, 58, 60, 62, 63,
1188 64, 67, 71, 73, 74, 78, 81, 82, 91, 92,
1189 93, 94, 99, 100, 101, 102, 103, 104, 110, 111,
1190 116, 120, 122, 124, 126, 128, 130, 132, 134, 136,
1191 138, 139, 140, 141, 142, 143, 144, 145, 146, 149,
1192 150, 154, 158, 159, 38, 157, 157, 38, 48, 73,
1193 141, 143, 78, 1, 67, 161, 161, 144, 145, 114,
1194 116, 161, 116, 48, 81, 141, 38, 83, 85, 141,
1195 161, 161, 141, 141, 52, 37, 38, 43, 45, 78,
1196 79, 155, 156, 141, 141, 141, 141, 49, 65, 151,
1197 152, 153, 116, 46, 157, 1, 49, 51, 160, 31,
1198 53, 30, 54, 55, 56, 40, 14, 15, 42, 41,
1199 57, 58, 59, 60, 61, 32, 33, 35, 39, 50,
1200 119, 64, 66, 67, 147, 64, 66, 147, 160, 160,
1201 37, 38, 43, 45, 28, 1, 115, 116, 26, 117,
1202 118, 121, 123, 125, 127, 129, 131, 133, 135, 137,
1203 138, 143, 147, 160, 116, 160, 37, 5, 12, 112,
1204 113, 50, 87, 88, 49, 160, 115, 116, 78, 37,
1205 78, 37, 49, 52, 49, 65, 49, 65, 120, 68,
1206 161, 120, 126, 120, 128, 130, 132, 134, 136, 138,
1207 138, 138, 139, 140, 140, 141, 141, 141, 120, 120,
1208 116, 38, 68, 120, 148, 116, 38, 161, 1, 68,
1209 162, 38, 84, 86, 95, 49, 31, 53, 30, 54,
1210 55, 56, 40, 15, 42, 14, 50, 119, 162, 161,
1211 81, 113, 120, 85, 162, 162, 156, 120, 152, 153,
1212 38, 76, 77, 52, 65, 49, 68, 65, 115, 78,
1213 50, 89, 90, 49, 97, 14, 1, 51, 163, 121,
1214 143, 127, 121, 129, 131, 133, 135, 137, 138, 138,
1215 115, 121, 121, 48, 105, 38, 78, 78, 52, 65,
1216 120, 49, 162, 120, 120, 162, 10, 121, 86, 163,
1217 115, 114, 52, 162, 4, 106, 107, 108, 162, 120,
1218 38, 48, 160, 78, 114, 162, 96, 121, 78, 116,
1219 7, 37, 109, 108, 81, 72, 75, 98, 78, 163,
1220 52, 52, 106, 37, 163, 114, 79, 80, 80, 37,
1221 114, 162, 162, 78, 78
1224 #define yyerrok (yyerrstatus = 0)
1225 #define yyclearin (yychar = YYEMPTY)
1226 #define YYEMPTY (-2)
1229 #define YYACCEPT goto yyacceptlab
1230 #define YYABORT goto yyabortlab
1231 #define YYERROR goto yyerrorlab
1234 /* Like YYERROR except do call yyerror. This remains here temporarily
1235 to ease the transition to the new meaning of YYERROR, for GCC.
1236 Once GCC version 2 has supplanted version 1, this can go. */
1238 #define YYFAIL goto yyerrlab
1240 #define YYRECOVERING() (!!yyerrstatus)
1242 #define YYBACKUP(Token, Value) \
1244 if (yychar == YYEMPTY && yylen == 1) \
1248 yytoken = YYTRANSLATE (yychar); \
1254 yyerror (YY_("syntax error: cannot back up")); \
1261 #define YYERRCODE 256
1264 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
1265 If N is 0, then set CURRENT to the empty location which ends
1266 the previous symbol: RHS[0] (always defined). */
1268 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
1269 #ifndef YYLLOC_DEFAULT
1270 # define YYLLOC_DEFAULT(Current, Rhs, N) \
1274 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
1275 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
1276 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
1277 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
1281 (Current).first_line = (Current).last_line = \
1282 YYRHSLOC (Rhs, 0).last_line; \
1283 (Current).first_column = (Current).last_column = \
1284 YYRHSLOC (Rhs, 0).last_column; \
1290 /* YY_LOCATION_PRINT -- Print the location on the stream.
1291 This macro was not mandated originally: define only if we know
1292 we won't break user code: when these are the locations we know. */
1294 #ifndef YY_LOCATION_PRINT
1295 # if YYLTYPE_IS_TRIVIAL
1296 # define YY_LOCATION_PRINT(File, Loc) \
1297 fprintf (File, "%d.%d-%d.%d", \
1298 (Loc).first_line, (Loc).first_column, \
1299 (Loc).last_line, (Loc).last_column)
1301 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
1306 /* YYLEX -- calling `yylex' with the right arguments. */
1309 # define YYLEX yylex (&yylval, YYLEX_PARAM)
1311 # define YYLEX yylex (&yylval)
1314 /* Enable debugging if requested. */
1318 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1319 # define YYFPRINTF fprintf
1322 # define YYDPRINTF(Args) \
1328 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
1332 YYFPRINTF (stderr, "%s ", Title); \
1333 yy_symbol_print (stderr, \
1335 YYFPRINTF (stderr, "\n"); \
1340 /*--------------------------------.
1341 | Print this symbol on YYOUTPUT. |
1342 `--------------------------------*/
1345 #if (defined __STDC__ || defined __C99__FUNC__ \
1346 || defined __cplusplus || defined _MSC_VER)
1348 yy_symbol_value_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
)
1351 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
)
1354 YYSTYPE
const * const yyvaluep
;
1360 if (yytype
< YYNTOKENS
)
1361 YYPRINT (yyoutput
, yytoknum
[yytype
], *yyvaluep
);
1373 /*--------------------------------.
1374 | Print this symbol on YYOUTPUT. |
1375 `--------------------------------*/
1377 #if (defined __STDC__ || defined __C99__FUNC__ \
1378 || defined __cplusplus || defined _MSC_VER)
1380 yy_symbol_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
)
1383 yy_symbol_print (yyoutput
, yytype
, yyvaluep
)
1386 YYSTYPE
const * const yyvaluep
;
1389 if (yytype
< YYNTOKENS
)
1390 YYFPRINTF (yyoutput
, "token %s (", yytname
[yytype
]);
1392 YYFPRINTF (yyoutput
, "nterm %s (", yytname
[yytype
]);
1394 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
);
1395 YYFPRINTF (yyoutput
, ")");
1398 /*------------------------------------------------------------------.
1399 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1401 `------------------------------------------------------------------*/
1403 #if (defined __STDC__ || defined __C99__FUNC__ \
1404 || defined __cplusplus || defined _MSC_VER)
1406 yy_stack_print (yytype_int16
*yybottom
, yytype_int16
*yytop
)
1409 yy_stack_print (yybottom
, yytop
)
1410 yytype_int16
*yybottom
;
1411 yytype_int16
*yytop
;
1414 YYFPRINTF (stderr
, "Stack now");
1415 for (; yybottom
<= yytop
; yybottom
++)
1417 int yybot
= *yybottom
;
1418 YYFPRINTF (stderr
, " %d", yybot
);
1420 YYFPRINTF (stderr
, "\n");
1423 # define YY_STACK_PRINT(Bottom, Top) \
1426 yy_stack_print ((Bottom), (Top)); \
1430 /*------------------------------------------------.
1431 | Report that the YYRULE is going to be reduced. |
1432 `------------------------------------------------*/
1434 #if (defined __STDC__ || defined __C99__FUNC__ \
1435 || defined __cplusplus || defined _MSC_VER)
1437 yy_reduce_print (YYSTYPE
*yyvsp
, int yyrule
)
1440 yy_reduce_print (yyvsp
, yyrule
)
1445 int yynrhs
= yyr2
[yyrule
];
1447 unsigned long int yylno
= yyrline
[yyrule
];
1448 YYFPRINTF (stderr
, "Reducing stack by rule %d (line %lu):\n",
1450 /* The symbols being reduced. */
1451 for (yyi
= 0; yyi
< yynrhs
; yyi
++)
1453 YYFPRINTF (stderr
, " $%d = ", yyi
+ 1);
1454 yy_symbol_print (stderr
, yyrhs
[yyprhs
[yyrule
] + yyi
],
1455 &(yyvsp
[(yyi
+ 1) - (yynrhs
)])
1457 YYFPRINTF (stderr
, "\n");
1461 # define YY_REDUCE_PRINT(Rule) \
1464 yy_reduce_print (yyvsp, Rule); \
1467 /* Nonzero means print parse trace. It is left uninitialized so that
1468 multiple parsers can coexist. */
1470 #else /* !YYDEBUG */
1471 # define YYDPRINTF(Args)
1472 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1473 # define YY_STACK_PRINT(Bottom, Top)
1474 # define YY_REDUCE_PRINT(Rule)
1475 #endif /* !YYDEBUG */
1478 /* YYINITDEPTH -- initial size of the parser's stacks. */
1480 # define YYINITDEPTH 200
1483 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1484 if the built-in stack extension method is used).
1486 Do not make this value too large; the results are undefined if
1487 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1488 evaluated with infinite-precision integer arithmetic. */
1491 # define YYMAXDEPTH 10000
1499 # if defined __GLIBC__ && defined _STRING_H
1500 # define yystrlen strlen
1502 /* Return the length of YYSTR. */
1503 #if (defined __STDC__ || defined __C99__FUNC__ \
1504 || defined __cplusplus || defined _MSC_VER)
1506 yystrlen (const char *yystr
)
1514 for (yylen
= 0; yystr
[yylen
]; yylen
++)
1522 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1523 # define yystpcpy stpcpy
1525 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1527 #if (defined __STDC__ || defined __C99__FUNC__ \
1528 || defined __cplusplus || defined _MSC_VER)
1530 yystpcpy (char *yydest
, const char *yysrc
)
1533 yystpcpy (yydest
, yysrc
)
1539 const char *yys
= yysrc
;
1541 while ((*yyd
++ = *yys
++) != '\0')
1550 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1551 quotes and backslashes, so that it's suitable for yyerror. The
1552 heuristic is that double-quoting is unnecessary unless the string
1553 contains an apostrophe, a comma, or backslash (other than
1554 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1555 null, do not copy; instead, return the length of what the result
1558 yytnamerr (char *yyres
, const char *yystr
)
1563 char const *yyp
= yystr
;
1570 goto do_not_strip_quotes
;
1574 goto do_not_strip_quotes
;
1587 do_not_strip_quotes
: ;
1591 return yystrlen (yystr
);
1593 return yystpcpy (yyres
, yystr
) - yyres
;
1597 /* Copy into YYRESULT an error message about the unexpected token
1598 YYCHAR while in state YYSTATE. Return the number of bytes copied,
1599 including the terminating null byte. If YYRESULT is null, do not
1600 copy anything; just return the number of bytes that would be
1601 copied. As a special case, return 0 if an ordinary "syntax error"
1602 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
1603 size calculation. */
1605 yysyntax_error (char *yyresult
, int yystate
, int yychar
)
1607 int yyn
= yypact
[yystate
];
1609 if (! (YYPACT_NINF
< yyn
&& yyn
<= YYLAST
))
1613 int yytype
= YYTRANSLATE (yychar
);
1614 YYSIZE_T yysize0
= yytnamerr (0, yytname
[yytype
]);
1615 YYSIZE_T yysize
= yysize0
;
1617 int yysize_overflow
= 0;
1618 enum { YYERROR_VERBOSE_ARGS_MAXIMUM
= 5 };
1619 char const *yyarg
[YYERROR_VERBOSE_ARGS_MAXIMUM
];
1623 /* This is so xgettext sees the translatable formats that are
1624 constructed on the fly. */
1625 YY_("syntax error, unexpected %s");
1626 YY_("syntax error, unexpected %s, expecting %s");
1627 YY_("syntax error, unexpected %s, expecting %s or %s");
1628 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
1629 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
1633 static char const yyunexpected
[] = "syntax error, unexpected %s";
1634 static char const yyexpecting
[] = ", expecting %s";
1635 static char const yyor
[] = " or %s";
1636 char yyformat
[sizeof yyunexpected
1637 + sizeof yyexpecting
- 1
1638 + ((YYERROR_VERBOSE_ARGS_MAXIMUM
- 2)
1639 * (sizeof yyor
- 1))];
1640 char const *yyprefix
= yyexpecting
;
1642 /* Start YYX at -YYN if negative to avoid negative indexes in
1644 int yyxbegin
= yyn
< 0 ? -yyn
: 0;
1646 /* Stay within bounds of both yycheck and yytname. */
1647 int yychecklim
= YYLAST
- yyn
+ 1;
1648 int yyxend
= yychecklim
< YYNTOKENS
? yychecklim
: YYNTOKENS
;
1651 yyarg
[0] = yytname
[yytype
];
1652 yyfmt
= yystpcpy (yyformat
, yyunexpected
);
1654 for (yyx
= yyxbegin
; yyx
< yyxend
; ++yyx
)
1655 if (yycheck
[yyx
+ yyn
] == yyx
&& yyx
!= YYTERROR
)
1657 if (yycount
== YYERROR_VERBOSE_ARGS_MAXIMUM
)
1661 yyformat
[sizeof yyunexpected
- 1] = '\0';
1664 yyarg
[yycount
++] = yytname
[yyx
];
1665 yysize1
= yysize
+ yytnamerr (0, yytname
[yyx
]);
1666 yysize_overflow
|= (yysize1
< yysize
);
1668 yyfmt
= yystpcpy (yyfmt
, yyprefix
);
1672 yyf
= YY_(yyformat
);
1673 yysize1
= yysize
+ yystrlen (yyf
);
1674 yysize_overflow
|= (yysize1
< yysize
);
1677 if (yysize_overflow
)
1678 return YYSIZE_MAXIMUM
;
1682 /* Avoid sprintf, as that infringes on the user's name space.
1683 Don't have undefined behavior even if the translation
1684 produced a string with the wrong number of "%s"s. */
1685 char *yyp
= yyresult
;
1687 while ((*yyp
= *yyf
) != '\0')
1689 if (*yyp
== '%' && yyf
[1] == 's' && yyi
< yycount
)
1691 yyp
+= yytnamerr (yyp
, yyarg
[yyi
++]);
1704 #endif /* YYERROR_VERBOSE */
1707 /*-----------------------------------------------.
1708 | Release the memory associated to this symbol. |
1709 `-----------------------------------------------*/
1712 #if (defined __STDC__ || defined __C99__FUNC__ \
1713 || defined __cplusplus || defined _MSC_VER)
1715 yydestruct (const char *yymsg
, int yytype
, YYSTYPE
*yyvaluep
)
1718 yydestruct (yymsg
, yytype
, yyvaluep
)
1728 YY_SYMBOL_PRINT (yymsg
, yytype
, yyvaluep
, yylocationp
);
1738 /* Prevent warnings from -Wmissing-prototypes. */
1739 #ifdef YYPARSE_PARAM
1740 #if defined __STDC__ || defined __cplusplus
1741 int yyparse (void *YYPARSE_PARAM
);
1745 #else /* ! YYPARSE_PARAM */
1746 #if defined __STDC__ || defined __cplusplus
1751 #endif /* ! YYPARSE_PARAM */
1757 /*-------------------------.
1758 | yyparse or yypush_parse. |
1759 `-------------------------*/
1761 #ifdef YYPARSE_PARAM
1762 #if (defined __STDC__ || defined __C99__FUNC__ \
1763 || defined __cplusplus || defined _MSC_VER)
1765 yyparse (void *YYPARSE_PARAM
)
1768 yyparse (YYPARSE_PARAM
)
1769 void *YYPARSE_PARAM
;
1771 #else /* ! YYPARSE_PARAM */
1772 #if (defined __STDC__ || defined __C99__FUNC__ \
1773 || defined __cplusplus || defined _MSC_VER)
1783 /* The lookahead symbol. */
1786 /* The semantic value of the lookahead symbol. */
1789 /* Number of syntax errors so far. */
1793 /* Number of tokens to shift before error messages enabled. */
1796 /* The stacks and their tools:
1797 `yyss': related to states.
1798 `yyvs': related to semantic values.
1800 Refer to the stacks thru separate pointers, to allow yyoverflow
1801 to reallocate them elsewhere. */
1803 /* The state stack. */
1804 yytype_int16 yyssa
[YYINITDEPTH
];
1806 yytype_int16
*yyssp
;
1808 /* The semantic value stack. */
1809 YYSTYPE yyvsa
[YYINITDEPTH
];
1813 YYSIZE_T yystacksize
;
1817 /* Lookahead token as an internal (translated) token number. */
1819 /* The variables used to return semantic value and location from the
1824 /* Buffer for error messages, and its allocated size. */
1826 char *yymsg
= yymsgbuf
;
1827 YYSIZE_T yymsg_alloc
= sizeof yymsgbuf
;
1830 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1832 /* The number of symbols on the RHS of the reduced rule.
1833 Keep to zero when no symbol should be popped. */
1839 yystacksize
= YYINITDEPTH
;
1841 YYDPRINTF ((stderr
, "Starting parse\n"));
1846 yychar
= YYEMPTY
; /* Cause a token to be read. */
1848 /* Initialize stack pointers.
1849 Waste one element of value and location stack
1850 so that they stay on the same level as the state stack.
1851 The wasted elements are never initialized. */
1857 /*------------------------------------------------------------.
1858 | yynewstate -- Push a new state, which is found in yystate. |
1859 `------------------------------------------------------------*/
1861 /* In all cases, when you get here, the value and location stacks
1862 have just been pushed. So pushing a state here evens the stacks. */
1868 if (yyss
+ yystacksize
- 1 <= yyssp
)
1870 /* Get the current used size of the three stacks, in elements. */
1871 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
1875 /* Give user a chance to reallocate the stack. Use copies of
1876 these so that the &'s don't force the real ones into
1878 YYSTYPE
*yyvs1
= yyvs
;
1879 yytype_int16
*yyss1
= yyss
;
1881 /* Each stack pointer address is followed by the size of the
1882 data in use in that stack, in bytes. This used to be a
1883 conditional around just the two extra args, but that might
1884 be undefined if yyoverflow is a macro. */
1885 yyoverflow (YY_("memory exhausted"),
1886 &yyss1
, yysize
* sizeof (*yyssp
),
1887 &yyvs1
, yysize
* sizeof (*yyvsp
),
1893 #else /* no yyoverflow */
1894 # ifndef YYSTACK_RELOCATE
1895 goto yyexhaustedlab
;
1897 /* Extend the stack our own way. */
1898 if (YYMAXDEPTH
<= yystacksize
)
1899 goto yyexhaustedlab
;
1901 if (YYMAXDEPTH
< yystacksize
)
1902 yystacksize
= YYMAXDEPTH
;
1905 yytype_int16
*yyss1
= yyss
;
1906 union yyalloc
*yyptr
=
1907 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
1909 goto yyexhaustedlab
;
1910 YYSTACK_RELOCATE (yyss_alloc
, yyss
);
1911 YYSTACK_RELOCATE (yyvs_alloc
, yyvs
);
1912 # undef YYSTACK_RELOCATE
1914 YYSTACK_FREE (yyss1
);
1917 #endif /* no yyoverflow */
1919 yyssp
= yyss
+ yysize
- 1;
1920 yyvsp
= yyvs
+ yysize
- 1;
1922 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
1923 (unsigned long int) yystacksize
));
1925 if (yyss
+ yystacksize
- 1 <= yyssp
)
1929 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
1931 if (yystate
== YYFINAL
)
1941 /* Do appropriate processing given the current state. Read a
1942 lookahead token if we need one and don't already have one. */
1944 /* First try to decide what to do without reference to lookahead token. */
1945 yyn
= yypact
[yystate
];
1946 if (yyn
== YYPACT_NINF
)
1949 /* Not known => get a lookahead token if don't already have one. */
1951 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1952 if (yychar
== YYEMPTY
)
1954 YYDPRINTF ((stderr
, "Reading a token: "));
1958 if (yychar
<= YYEOF
)
1960 yychar
= yytoken
= YYEOF
;
1961 YYDPRINTF ((stderr
, "Now at end of input.\n"));
1965 yytoken
= YYTRANSLATE (yychar
);
1966 YY_SYMBOL_PRINT ("Next token is", yytoken
, &yylval
, &yylloc
);
1969 /* If the proper action on seeing token YYTOKEN is to reduce or to
1970 detect an error, take that action. */
1972 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yytoken
)
1977 if (yyn
== 0 || yyn
== YYTABLE_NINF
)
1983 /* Count tokens shifted since error; after three, turn off error
1988 /* Shift the lookahead token. */
1989 YY_SYMBOL_PRINT ("Shifting", yytoken
, &yylval
, &yylloc
);
1991 /* Discard the shifted token. */
2000 /*-----------------------------------------------------------.
2001 | yydefault -- do the default action for the current state. |
2002 `-----------------------------------------------------------*/
2004 yyn
= yydefact
[yystate
];
2010 /*-----------------------------.
2011 | yyreduce -- Do a reduction. |
2012 `-----------------------------*/
2014 /* yyn is the number of a rule to reduce with. */
2017 /* If YYLEN is nonzero, implement the default value of the action:
2020 Otherwise, the following line sets YYVAL to garbage.
2021 This behavior is undocumented and Bison
2022 users should not rely upon it. Assigning to YYVAL
2023 unconditionally makes the parser a bit smaller, and it avoids a
2024 GCC warning that YYVAL may be used uninitialized. */
2025 yyval
= yyvsp
[1-yylen
];
2028 YY_REDUCE_PRINT (yyn
);
2033 /* Line 1455 of yacc.c */
2034 #line 253 "parser.y"
2035 { program_parsed(ctx
, (yyvsp
[(1) - (3)].source_elements
)); ;}
2040 /* Line 1455 of yacc.c */
2041 #line 256 "parser.y"
2047 /* Line 1455 of yacc.c */
2048 #line 257 "parser.y"
2054 /* Line 1455 of yacc.c */
2055 #line 261 "parser.y"
2056 { (yyval
.source_elements
) = new_source_elements(ctx
); ;}
2061 /* Line 1455 of yacc.c */
2062 #line 263 "parser.y"
2063 { (yyval
.source_elements
) = source_elements_add_statement((yyvsp
[(1) - (2)].source_elements
), (yyvsp
[(2) - (2)].statement
)); ;}
2068 /* Line 1455 of yacc.c */
2069 #line 268 "parser.y"
2070 { (yyval
.expr
) = new_function_expression(ctx
, (yyvsp
[(2) - (8)].identifier
), (yyvsp
[(4) - (8)].parameter_list
), (yyvsp
[(7) - (8)].source_elements
), (yyvsp
[(1) - (8)].srcptr
), (yyvsp
[(8) - (8)].srcptr
)-(yyvsp
[(1) - (8)].srcptr
)+1); ;}
2075 /* Line 1455 of yacc.c */
2076 #line 271 "parser.y"
2077 { (yyval
.srcptr
) = (yyvsp
[(1) - (1)].srcptr
); ;}
2082 /* Line 1455 of yacc.c */
2083 #line 275 "parser.y"
2084 { (yyval
.source_elements
) = (yyvsp
[(1) - (1)].source_elements
); ;}
2089 /* Line 1455 of yacc.c */
2090 #line 279 "parser.y"
2091 { (yyval
.parameter_list
) = new_parameter_list(ctx
, (yyvsp
[(1) - (1)].identifier
)); ;}
2096 /* Line 1455 of yacc.c */
2097 #line 281 "parser.y"
2098 { (yyval
.parameter_list
) = parameter_list_add(ctx
, (yyvsp
[(1) - (3)].parameter_list
), (yyvsp
[(3) - (3)].identifier
)); ;}
2103 /* Line 1455 of yacc.c */
2104 #line 285 "parser.y"
2105 { (yyval
.parameter_list
) = NULL
; ;}
2110 /* Line 1455 of yacc.c */
2111 #line 286 "parser.y"
2112 { (yyval
.parameter_list
) = (yyvsp
[(1) - (1)].parameter_list
); ;}
2117 /* Line 1455 of yacc.c */
2118 #line 290 "parser.y"
2119 { (yyval
.statement
) = (yyvsp
[(1) - (1)].statement
); ;}
2124 /* Line 1455 of yacc.c */
2125 #line 291 "parser.y"
2126 { (yyval
.statement
) = (yyvsp
[(1) - (1)].statement
); ;}
2131 /* Line 1455 of yacc.c */
2132 #line 292 "parser.y"
2133 { (yyval
.statement
) = (yyvsp
[(1) - (1)].statement
); ;}
2138 /* Line 1455 of yacc.c */
2139 #line 293 "parser.y"
2140 { (yyval
.statement
) = new_expression_statement(ctx
, (yyvsp
[(1) - (1)].expr
)); ;}
2145 /* Line 1455 of yacc.c */
2146 #line 294 "parser.y"
2147 { (yyval
.statement
) = (yyvsp
[(1) - (1)].statement
); ;}
2152 /* Line 1455 of yacc.c */
2153 #line 295 "parser.y"
2154 { (yyval
.statement
) = (yyvsp
[(1) - (1)].statement
); ;}
2159 /* Line 1455 of yacc.c */
2160 #line 296 "parser.y"
2161 { (yyval
.statement
) = (yyvsp
[(1) - (1)].statement
); ;}
2166 /* Line 1455 of yacc.c */
2167 #line 297 "parser.y"
2168 { (yyval
.statement
) = (yyvsp
[(1) - (1)].statement
); ;}
2173 /* Line 1455 of yacc.c */
2174 #line 298 "parser.y"
2175 { (yyval
.statement
) = (yyvsp
[(1) - (1)].statement
); ;}
2180 /* Line 1455 of yacc.c */
2181 #line 299 "parser.y"
2182 { (yyval
.statement
) = (yyvsp
[(1) - (1)].statement
); ;}
2187 /* Line 1455 of yacc.c */
2188 #line 300 "parser.y"
2189 { (yyval
.statement
) = (yyvsp
[(1) - (1)].statement
); ;}
2194 /* Line 1455 of yacc.c */
2195 #line 301 "parser.y"
2196 { (yyval
.statement
) = (yyvsp
[(1) - (1)].statement
); ;}
2201 /* Line 1455 of yacc.c */
2202 #line 302 "parser.y"
2203 { (yyval
.statement
) = (yyvsp
[(1) - (1)].statement
); ;}
2208 /* Line 1455 of yacc.c */
2209 #line 303 "parser.y"
2210 { (yyval
.statement
) = (yyvsp
[(1) - (1)].statement
); ;}
2215 /* Line 1455 of yacc.c */
2216 #line 304 "parser.y"
2217 { (yyval
.statement
) = (yyvsp
[(1) - (1)].statement
); ;}
2222 /* Line 1455 of yacc.c */
2223 #line 308 "parser.y"
2224 { (yyval
.statement_list
) = new_statement_list(ctx
, (yyvsp
[(1) - (1)].statement
)); ;}
2229 /* Line 1455 of yacc.c */
2230 #line 310 "parser.y"
2231 { (yyval
.statement_list
) = statement_list_add((yyvsp
[(1) - (2)].statement_list
), (yyvsp
[(2) - (2)].statement
)); ;}
2236 /* Line 1455 of yacc.c */
2237 #line 314 "parser.y"
2238 { (yyval
.statement_list
) = NULL
; ;}
2243 /* Line 1455 of yacc.c */
2244 #line 315 "parser.y"
2245 { (yyval
.statement_list
) = (yyvsp
[(1) - (1)].statement_list
); ;}
2250 /* Line 1455 of yacc.c */
2251 #line 319 "parser.y"
2252 { (yyval
.statement
) = new_block_statement(ctx
, (yyvsp
[(2) - (3)].statement_list
)); ;}
2257 /* Line 1455 of yacc.c */
2258 #line 320 "parser.y"
2259 { (yyval
.statement
) = new_block_statement(ctx
, NULL
); ;}
2264 /* Line 1455 of yacc.c */
2265 #line 325 "parser.y"
2266 { (yyval
.statement
) = new_var_statement(ctx
, (yyvsp
[(2) - (3)].variable_list
)); ;}
2271 /* Line 1455 of yacc.c */
2272 #line 329 "parser.y"
2273 { (yyval
.variable_list
) = new_variable_list(ctx
, (yyvsp
[(1) - (1)].variable_declaration
)); ;}
2278 /* Line 1455 of yacc.c */
2279 #line 331 "parser.y"
2280 { (yyval
.variable_list
) = variable_list_add(ctx
, (yyvsp
[(1) - (3)].variable_list
), (yyvsp
[(3) - (3)].variable_declaration
)); ;}
2285 /* Line 1455 of yacc.c */
2286 #line 336 "parser.y"
2287 { (yyval
.variable_list
) = new_variable_list(ctx
, (yyvsp
[(1) - (1)].variable_declaration
)); ;}
2292 /* Line 1455 of yacc.c */
2293 #line 338 "parser.y"
2294 { (yyval
.variable_list
) = variable_list_add(ctx
, (yyvsp
[(1) - (3)].variable_list
), (yyvsp
[(3) - (3)].variable_declaration
)); ;}
2299 /* Line 1455 of yacc.c */
2300 #line 343 "parser.y"
2301 { (yyval
.variable_declaration
) = new_variable_declaration(ctx
, (yyvsp
[(1) - (2)].identifier
), (yyvsp
[(2) - (2)].expr
)); ;}
2306 /* Line 1455 of yacc.c */
2307 #line 348 "parser.y"
2308 { (yyval
.variable_declaration
) = new_variable_declaration(ctx
, (yyvsp
[(1) - (2)].identifier
), (yyvsp
[(2) - (2)].expr
)); ;}
2313 /* Line 1455 of yacc.c */
2314 #line 352 "parser.y"
2315 { (yyval
.expr
) = NULL
; ;}
2320 /* Line 1455 of yacc.c */
2321 #line 353 "parser.y"
2322 { (yyval
.expr
) = (yyvsp
[(1) - (1)].expr
); ;}
2327 /* Line 1455 of yacc.c */
2328 #line 358 "parser.y"
2329 { (yyval
.expr
) = (yyvsp
[(2) - (2)].expr
); ;}
2334 /* Line 1455 of yacc.c */
2335 #line 362 "parser.y"
2336 { (yyval
.expr
) = NULL
; ;}
2341 /* Line 1455 of yacc.c */
2342 #line 363 "parser.y"
2343 { (yyval
.expr
) = (yyvsp
[(1) - (1)].expr
); ;}
2348 /* Line 1455 of yacc.c */
2349 #line 368 "parser.y"
2350 { (yyval
.expr
) = (yyvsp
[(2) - (2)].expr
); ;}
2355 /* Line 1455 of yacc.c */
2356 #line 372 "parser.y"
2357 { (yyval
.statement
) = new_statement(ctx
, STAT_EMPTY
, 0); ;}
2362 /* Line 1455 of yacc.c */
2363 #line 377 "parser.y"
2364 { (yyval
.statement
) = new_expression_statement(ctx
, (yyvsp
[(1) - (2)].expr
)); ;}
2369 /* Line 1455 of yacc.c */
2370 #line 382 "parser.y"
2371 { (yyval
.statement
) = new_if_statement(ctx
, (yyvsp
[(3) - (7)].expr
), (yyvsp
[(5) - (7)].statement
), (yyvsp
[(7) - (7)].statement
)); ;}
2376 /* Line 1455 of yacc.c */
2377 #line 384 "parser.y"
2378 { (yyval
.statement
) = new_if_statement(ctx
, (yyvsp
[(3) - (5)].expr
), (yyvsp
[(5) - (5)].statement
), NULL
); ;}
2383 /* Line 1455 of yacc.c */
2384 #line 389 "parser.y"
2385 { (yyval
.statement
) = new_while_statement(ctx
, TRUE
, (yyvsp
[(5) - (7)].expr
), (yyvsp
[(2) - (7)].statement
)); ;}
2390 /* Line 1455 of yacc.c */
2391 #line 391 "parser.y"
2392 { (yyval
.statement
) = new_while_statement(ctx
, FALSE
, (yyvsp
[(3) - (5)].expr
), (yyvsp
[(5) - (5)].statement
)); ;}
2397 /* Line 1455 of yacc.c */
2398 #line 393 "parser.y"
2399 { if(!explicit_error(ctx
, (yyvsp
[(3) - (3)].expr
), ';')) YYABORT
; ;}
2404 /* Line 1455 of yacc.c */
2405 #line 395 "parser.y"
2406 { if(!explicit_error(ctx
, (yyvsp
[(6) - (6)].expr
), ';')) YYABORT
; ;}
2411 /* Line 1455 of yacc.c */
2412 #line 397 "parser.y"
2413 { (yyval
.statement
) = new_for_statement(ctx
, NULL
, (yyvsp
[(3) - (11)].expr
), (yyvsp
[(6) - (11)].expr
), (yyvsp
[(9) - (11)].expr
), (yyvsp
[(11) - (11)].statement
)); ;}
2418 /* Line 1455 of yacc.c */
2419 #line 399 "parser.y"
2420 { if(!explicit_error(ctx
, (yyvsp
[(4) - (4)].variable_list
), ';')) YYABORT
; ;}
2425 /* Line 1455 of yacc.c */
2426 #line 401 "parser.y"
2427 { if(!explicit_error(ctx
, (yyvsp
[(7) - (7)].expr
), ';')) YYABORT
; ;}
2432 /* Line 1455 of yacc.c */
2433 #line 403 "parser.y"
2434 { (yyval
.statement
) = new_for_statement(ctx
, (yyvsp
[(4) - (12)].variable_list
), NULL
, (yyvsp
[(7) - (12)].expr
), (yyvsp
[(10) - (12)].expr
), (yyvsp
[(12) - (12)].statement
)); ;}
2439 /* Line 1455 of yacc.c */
2440 #line 405 "parser.y"
2441 { (yyval
.statement
) = new_forin_statement(ctx
, NULL
, (yyvsp
[(3) - (7)].expr
), (yyvsp
[(5) - (7)].expr
), (yyvsp
[(7) - (7)].statement
)); ;}
2446 /* Line 1455 of yacc.c */
2447 #line 407 "parser.y"
2448 { (yyval
.statement
) = new_forin_statement(ctx
, (yyvsp
[(4) - (8)].variable_declaration
), NULL
, (yyvsp
[(6) - (8)].expr
), (yyvsp
[(8) - (8)].statement
)); ;}
2453 /* Line 1455 of yacc.c */
2454 #line 412 "parser.y"
2455 { (yyval
.statement
) = new_continue_statement(ctx
, (yyvsp
[(2) - (3)].identifier
)); ;}
2460 /* Line 1455 of yacc.c */
2461 #line 417 "parser.y"
2462 { (yyval
.statement
) = new_break_statement(ctx
, (yyvsp
[(2) - (3)].identifier
)); ;}
2467 /* Line 1455 of yacc.c */
2468 #line 422 "parser.y"
2469 { (yyval
.statement
) = new_return_statement(ctx
, (yyvsp
[(2) - (3)].expr
)); ;}
2474 /* Line 1455 of yacc.c */
2475 #line 427 "parser.y"
2476 { (yyval
.statement
) = new_with_statement(ctx
, (yyvsp
[(3) - (5)].expr
), (yyvsp
[(5) - (5)].statement
)); ;}
2481 /* Line 1455 of yacc.c */
2482 #line 432 "parser.y"
2483 { (yyval
.statement
) = new_labelled_statement(ctx
, (yyvsp
[(1) - (3)].identifier
), (yyvsp
[(3) - (3)].statement
)); ;}
2488 /* Line 1455 of yacc.c */
2489 #line 437 "parser.y"
2490 { (yyval
.statement
) = new_switch_statement(ctx
, (yyvsp
[(3) - (5)].expr
), (yyvsp
[(5) - (5)].case_clausule
)); ;}
2495 /* Line 1455 of yacc.c */
2496 #line 442 "parser.y"
2497 { (yyval
.case_clausule
) = new_case_block(ctx
, (yyvsp
[(2) - (3)].case_list
), NULL
, NULL
); ;}
2502 /* Line 1455 of yacc.c */
2503 #line 444 "parser.y"
2504 { (yyval
.case_clausule
) = new_case_block(ctx
, (yyvsp
[(2) - (5)].case_list
), (yyvsp
[(3) - (5)].case_clausule
), (yyvsp
[(4) - (5)].case_list
)); ;}
2509 /* Line 1455 of yacc.c */
2510 #line 448 "parser.y"
2511 { (yyval
.case_list
) = NULL
; ;}
2516 /* Line 1455 of yacc.c */
2517 #line 449 "parser.y"
2518 { (yyval
.case_list
) = (yyvsp
[(1) - (1)].case_list
); ;}
2523 /* Line 1455 of yacc.c */
2524 #line 453 "parser.y"
2525 { (yyval
.case_list
) = new_case_list(ctx
, (yyvsp
[(1) - (1)].case_clausule
)); ;}
2530 /* Line 1455 of yacc.c */
2531 #line 455 "parser.y"
2532 { (yyval
.case_list
) = case_list_add(ctx
, (yyvsp
[(1) - (2)].case_list
), (yyvsp
[(2) - (2)].case_clausule
)); ;}
2537 /* Line 1455 of yacc.c */
2538 #line 460 "parser.y"
2539 { (yyval
.case_clausule
) = new_case_clausule(ctx
, (yyvsp
[(2) - (4)].expr
), (yyvsp
[(4) - (4)].statement_list
)); ;}
2544 /* Line 1455 of yacc.c */
2545 #line 465 "parser.y"
2546 { (yyval
.case_clausule
) = new_case_clausule(ctx
, NULL
, (yyvsp
[(3) - (3)].statement_list
)); ;}
2551 /* Line 1455 of yacc.c */
2552 #line 470 "parser.y"
2553 { (yyval
.statement
) = new_throw_statement(ctx
, (yyvsp
[(2) - (3)].expr
)); ;}
2558 /* Line 1455 of yacc.c */
2559 #line 474 "parser.y"
2560 { (yyval
.statement
) = new_try_statement(ctx
, (yyvsp
[(2) - (3)].statement
), (yyvsp
[(3) - (3)].catch_block
), NULL
); ;}
2565 /* Line 1455 of yacc.c */
2566 #line 475 "parser.y"
2567 { (yyval
.statement
) = new_try_statement(ctx
, (yyvsp
[(2) - (3)].statement
), NULL
, (yyvsp
[(3) - (3)].statement
)); ;}
2572 /* Line 1455 of yacc.c */
2573 #line 477 "parser.y"
2574 { (yyval
.statement
) = new_try_statement(ctx
, (yyvsp
[(2) - (4)].statement
), (yyvsp
[(3) - (4)].catch_block
), (yyvsp
[(4) - (4)].statement
)); ;}
2579 /* Line 1455 of yacc.c */
2580 #line 482 "parser.y"
2581 { (yyval
.catch_block
) = new_catch_block(ctx
, (yyvsp
[(3) - (5)].identifier
), (yyvsp
[(5) - (5)].statement
)); ;}
2586 /* Line 1455 of yacc.c */
2587 #line 486 "parser.y"
2588 { (yyval
.statement
) = (yyvsp
[(2) - (2)].statement
); ;}
2593 /* Line 1455 of yacc.c */
2594 #line 490 "parser.y"
2595 { (yyval
.expr
) = NULL
; ;}
2600 /* Line 1455 of yacc.c */
2601 #line 491 "parser.y"
2602 { (yyval
.expr
) = (yyvsp
[(1) - (1)].expr
); ;}
2607 /* Line 1455 of yacc.c */
2608 #line 494 "parser.y"
2609 { (yyval
.expr
) = (yyvsp
[(1) - (1)].expr
); ;}
2614 /* Line 1455 of yacc.c */
2615 #line 495 "parser.y"
2616 { set_error(ctx
, JS_E_SYNTAX
); YYABORT
; ;}
2621 /* Line 1455 of yacc.c */
2622 #line 499 "parser.y"
2623 { (yyval
.expr
) = (yyvsp
[(1) - (1)].expr
); ;}
2628 /* Line 1455 of yacc.c */
2629 #line 501 "parser.y"
2630 { (yyval
.expr
) = new_binary_expression(ctx
, EXPR_COMMA
, (yyvsp
[(1) - (3)].expr
), (yyvsp
[(3) - (3)].expr
)); ;}
2635 /* Line 1455 of yacc.c */
2636 #line 505 "parser.y"
2637 { (yyval
.expr
) = NULL
; ;}
2642 /* Line 1455 of yacc.c */
2643 #line 506 "parser.y"
2644 { (yyval
.expr
) = (yyvsp
[(1) - (1)].expr
); ;}
2649 /* Line 1455 of yacc.c */
2650 #line 511 "parser.y"
2651 { (yyval
.expr
) = (yyvsp
[(1) - (1)].expr
); ;}
2656 /* Line 1455 of yacc.c */
2657 #line 513 "parser.y"
2658 { (yyval
.expr
) = new_binary_expression(ctx
, EXPR_COMMA
, (yyvsp
[(1) - (3)].expr
), (yyvsp
[(3) - (3)].expr
)); ;}
2663 /* Line 1455 of yacc.c */
2664 #line 516 "parser.y"
2665 { (yyval
.ival
) = (yyvsp
[(1) - (1)].ival
); ;}
2670 /* Line 1455 of yacc.c */
2671 #line 517 "parser.y"
2672 { (yyval
.ival
) = EXPR_ASSIGNDIV
; ;}
2677 /* Line 1455 of yacc.c */
2678 #line 521 "parser.y"
2679 { (yyval
.expr
) = (yyvsp
[(1) - (1)].expr
); ;}
2684 /* Line 1455 of yacc.c */
2685 #line 523 "parser.y"
2686 { (yyval
.expr
) = new_binary_expression(ctx
, EXPR_ASSIGN
, (yyvsp
[(1) - (3)].expr
), (yyvsp
[(3) - (3)].expr
)); ;}
2691 /* Line 1455 of yacc.c */
2692 #line 525 "parser.y"
2693 { (yyval
.expr
) = new_binary_expression(ctx
, (yyvsp
[(2) - (3)].ival
), (yyvsp
[(1) - (3)].expr
), (yyvsp
[(3) - (3)].expr
)); ;}
2698 /* Line 1455 of yacc.c */
2699 #line 530 "parser.y"
2700 { (yyval
.expr
) = (yyvsp
[(1) - (1)].expr
); ;}
2705 /* Line 1455 of yacc.c */
2706 #line 532 "parser.y"
2707 { (yyval
.expr
) = new_binary_expression(ctx
, EXPR_ASSIGN
, (yyvsp
[(1) - (3)].expr
), (yyvsp
[(3) - (3)].expr
)); ;}
2712 /* Line 1455 of yacc.c */
2713 #line 534 "parser.y"
2714 { (yyval
.expr
) = new_binary_expression(ctx
, (yyvsp
[(2) - (3)].ival
), (yyvsp
[(1) - (3)].expr
), (yyvsp
[(3) - (3)].expr
)); ;}
2719 /* Line 1455 of yacc.c */
2720 #line 538 "parser.y"
2721 { (yyval
.expr
) = (yyvsp
[(1) - (1)].expr
); ;}
2726 /* Line 1455 of yacc.c */
2727 #line 540 "parser.y"
2728 { (yyval
.expr
) = new_conditional_expression(ctx
, (yyvsp
[(1) - (5)].expr
), (yyvsp
[(3) - (5)].expr
), (yyvsp
[(5) - (5)].expr
)); ;}
2733 /* Line 1455 of yacc.c */
2734 #line 545 "parser.y"
2735 { (yyval
.expr
) = (yyvsp
[(1) - (1)].expr
); ;}
2740 /* Line 1455 of yacc.c */
2741 #line 547 "parser.y"
2742 { (yyval
.expr
) = new_conditional_expression(ctx
, (yyvsp
[(1) - (5)].expr
), (yyvsp
[(3) - (5)].expr
), (yyvsp
[(5) - (5)].expr
)); ;}
2747 /* Line 1455 of yacc.c */
2748 #line 551 "parser.y"
2749 { (yyval
.expr
) = (yyvsp
[(1) - (1)].expr
); ;}
2754 /* Line 1455 of yacc.c */
2755 #line 553 "parser.y"
2756 { (yyval
.expr
) = new_binary_expression(ctx
, EXPR_OR
, (yyvsp
[(1) - (3)].expr
), (yyvsp
[(3) - (3)].expr
)); ;}
2761 /* Line 1455 of yacc.c */
2762 #line 558 "parser.y"
2763 { (yyval
.expr
) = (yyvsp
[(1) - (1)].expr
); ;}
2768 /* Line 1455 of yacc.c */
2769 #line 560 "parser.y"
2770 { (yyval
.expr
) = new_binary_expression(ctx
, EXPR_OR
, (yyvsp
[(1) - (3)].expr
), (yyvsp
[(3) - (3)].expr
)); ;}
2775 /* Line 1455 of yacc.c */
2776 #line 564 "parser.y"
2777 { (yyval
.expr
) = (yyvsp
[(1) - (1)].expr
); ;}
2782 /* Line 1455 of yacc.c */
2783 #line 566 "parser.y"
2784 { (yyval
.expr
) = new_binary_expression(ctx
, EXPR_AND
, (yyvsp
[(1) - (3)].expr
), (yyvsp
[(3) - (3)].expr
)); ;}
2789 /* Line 1455 of yacc.c */
2790 #line 571 "parser.y"
2791 { (yyval
.expr
) = (yyvsp
[(1) - (1)].expr
); ;}
2796 /* Line 1455 of yacc.c */
2797 #line 573 "parser.y"
2798 { (yyval
.expr
) = new_binary_expression(ctx
, EXPR_AND
, (yyvsp
[(1) - (3)].expr
), (yyvsp
[(3) - (3)].expr
)); ;}
2803 /* Line 1455 of yacc.c */
2804 #line 577 "parser.y"
2805 { (yyval
.expr
) = (yyvsp
[(1) - (1)].expr
); ;}
2810 /* Line 1455 of yacc.c */
2811 #line 579 "parser.y"
2812 { (yyval
.expr
) = new_binary_expression(ctx
, EXPR_BOR
, (yyvsp
[(1) - (3)].expr
), (yyvsp
[(3) - (3)].expr
)); ;}
2817 /* Line 1455 of yacc.c */
2818 #line 584 "parser.y"
2819 { (yyval
.expr
) = (yyvsp
[(1) - (1)].expr
); ;}
2824 /* Line 1455 of yacc.c */
2825 #line 586 "parser.y"
2826 { (yyval
.expr
) = new_binary_expression(ctx
, EXPR_BOR
, (yyvsp
[(1) - (3)].expr
), (yyvsp
[(3) - (3)].expr
)); ;}
2831 /* Line 1455 of yacc.c */
2832 #line 590 "parser.y"
2833 { (yyval
.expr
) = (yyvsp
[(1) - (1)].expr
); ;}
2838 /* Line 1455 of yacc.c */
2839 #line 592 "parser.y"
2840 { (yyval
.expr
) = new_binary_expression(ctx
, EXPR_BXOR
, (yyvsp
[(1) - (3)].expr
), (yyvsp
[(3) - (3)].expr
)); ;}
2845 /* Line 1455 of yacc.c */
2846 #line 597 "parser.y"
2847 { (yyval
.expr
) = (yyvsp
[(1) - (1)].expr
); ;}
2852 /* Line 1455 of yacc.c */
2853 #line 599 "parser.y"
2854 { (yyval
.expr
) = new_binary_expression(ctx
, EXPR_BXOR
, (yyvsp
[(1) - (3)].expr
), (yyvsp
[(3) - (3)].expr
)); ;}
2859 /* Line 1455 of yacc.c */
2860 #line 603 "parser.y"
2861 { (yyval
.expr
) = (yyvsp
[(1) - (1)].expr
); ;}
2866 /* Line 1455 of yacc.c */
2867 #line 605 "parser.y"
2868 { (yyval
.expr
) = new_binary_expression(ctx
, EXPR_BAND
, (yyvsp
[(1) - (3)].expr
), (yyvsp
[(3) - (3)].expr
)); ;}
2873 /* Line 1455 of yacc.c */
2874 #line 610 "parser.y"
2875 { (yyval
.expr
) = (yyvsp
[(1) - (1)].expr
); ;}
2880 /* Line 1455 of yacc.c */
2881 #line 612 "parser.y"
2882 { (yyval
.expr
) = new_binary_expression(ctx
, EXPR_BAND
, (yyvsp
[(1) - (3)].expr
), (yyvsp
[(3) - (3)].expr
)); ;}
2887 /* Line 1455 of yacc.c */
2888 #line 616 "parser.y"
2889 { (yyval
.expr
) = (yyvsp
[(1) - (1)].expr
); ;}
2894 /* Line 1455 of yacc.c */
2895 #line 618 "parser.y"
2896 { (yyval
.expr
) = new_binary_expression(ctx
, (yyvsp
[(2) - (3)].ival
), (yyvsp
[(1) - (3)].expr
), (yyvsp
[(3) - (3)].expr
)); ;}
2901 /* Line 1455 of yacc.c */
2902 #line 622 "parser.y"
2903 { (yyval
.expr
) = (yyvsp
[(1) - (1)].expr
); ;}
2908 /* Line 1455 of yacc.c */
2909 #line 624 "parser.y"
2910 { (yyval
.expr
) = new_binary_expression(ctx
, (yyvsp
[(2) - (3)].ival
), (yyvsp
[(1) - (3)].expr
), (yyvsp
[(3) - (3)].expr
)); ;}
2915 /* Line 1455 of yacc.c */
2916 #line 628 "parser.y"
2917 { (yyval
.expr
) = (yyvsp
[(1) - (1)].expr
); ;}
2922 /* Line 1455 of yacc.c */
2923 #line 630 "parser.y"
2924 { (yyval
.expr
) = new_binary_expression(ctx
, (yyvsp
[(2) - (3)].ival
), (yyvsp
[(1) - (3)].expr
), (yyvsp
[(3) - (3)].expr
)); ;}
2929 /* Line 1455 of yacc.c */
2930 #line 632 "parser.y"
2931 { (yyval
.expr
) = new_binary_expression(ctx
, EXPR_INSTANCEOF
, (yyvsp
[(1) - (3)].expr
), (yyvsp
[(3) - (3)].expr
)); ;}
2936 /* Line 1455 of yacc.c */
2937 #line 634 "parser.y"
2938 { (yyval
.expr
) = new_binary_expression(ctx
, EXPR_IN
, (yyvsp
[(1) - (3)].expr
), (yyvsp
[(3) - (3)].expr
)); ;}
2943 /* Line 1455 of yacc.c */
2944 #line 638 "parser.y"
2945 { (yyval
.expr
) = (yyvsp
[(1) - (1)].expr
); ;}
2950 /* Line 1455 of yacc.c */
2951 #line 640 "parser.y"
2952 { (yyval
.expr
) = new_binary_expression(ctx
, (yyvsp
[(2) - (3)].ival
), (yyvsp
[(1) - (3)].expr
), (yyvsp
[(3) - (3)].expr
)); ;}
2957 /* Line 1455 of yacc.c */
2958 #line 642 "parser.y"
2959 { (yyval
.expr
) = new_binary_expression(ctx
, EXPR_INSTANCEOF
, (yyvsp
[(1) - (3)].expr
), (yyvsp
[(3) - (3)].expr
)); ;}
2964 /* Line 1455 of yacc.c */
2965 #line 646 "parser.y"
2966 { (yyval
.expr
) = (yyvsp
[(1) - (1)].expr
); ;}
2971 /* Line 1455 of yacc.c */
2972 #line 648 "parser.y"
2973 { (yyval
.expr
) = new_binary_expression(ctx
, (yyvsp
[(2) - (3)].ival
), (yyvsp
[(1) - (3)].expr
), (yyvsp
[(3) - (3)].expr
)); ;}
2978 /* Line 1455 of yacc.c */
2979 #line 653 "parser.y"
2980 { (yyval
.expr
) = (yyvsp
[(1) - (1)].expr
); ;}
2985 /* Line 1455 of yacc.c */
2986 #line 655 "parser.y"
2987 { (yyval
.expr
) = new_binary_expression(ctx
, EXPR_ADD
, (yyvsp
[(1) - (3)].expr
), (yyvsp
[(3) - (3)].expr
)); ;}
2992 /* Line 1455 of yacc.c */
2993 #line 657 "parser.y"
2994 { (yyval
.expr
) = new_binary_expression(ctx
, EXPR_SUB
, (yyvsp
[(1) - (3)].expr
), (yyvsp
[(3) - (3)].expr
)); ;}
2999 /* Line 1455 of yacc.c */
3000 #line 661 "parser.y"
3001 { (yyval
.expr
) = (yyvsp
[(1) - (1)].expr
); ;}
3006 /* Line 1455 of yacc.c */
3007 #line 663 "parser.y"
3008 { (yyval
.expr
) = new_binary_expression(ctx
, EXPR_MUL
, (yyvsp
[(1) - (3)].expr
), (yyvsp
[(3) - (3)].expr
)); ;}
3013 /* Line 1455 of yacc.c */
3014 #line 665 "parser.y"
3015 { (yyval
.expr
) = new_binary_expression(ctx
, EXPR_DIV
, (yyvsp
[(1) - (3)].expr
), (yyvsp
[(3) - (3)].expr
)); ;}
3020 /* Line 1455 of yacc.c */
3021 #line 667 "parser.y"
3022 { (yyval
.expr
) = new_binary_expression(ctx
, EXPR_MOD
, (yyvsp
[(1) - (3)].expr
), (yyvsp
[(3) - (3)].expr
)); ;}
3027 /* Line 1455 of yacc.c */
3028 #line 671 "parser.y"
3029 { (yyval
.expr
) = (yyvsp
[(1) - (1)].expr
); ;}
3034 /* Line 1455 of yacc.c */
3035 #line 673 "parser.y"
3036 { (yyval
.expr
) = new_unary_expression(ctx
, EXPR_DELETE
, (yyvsp
[(2) - (2)].expr
)); ;}
3041 /* Line 1455 of yacc.c */
3042 #line 674 "parser.y"
3043 { (yyval
.expr
) = new_unary_expression(ctx
, EXPR_VOID
, (yyvsp
[(2) - (2)].expr
)); ;}
3048 /* Line 1455 of yacc.c */
3049 #line 676 "parser.y"
3050 { (yyval
.expr
) = new_unary_expression(ctx
, EXPR_TYPEOF
, (yyvsp
[(2) - (2)].expr
)); ;}
3055 /* Line 1455 of yacc.c */
3056 #line 677 "parser.y"
3057 { (yyval
.expr
) = new_unary_expression(ctx
, EXPR_PREINC
, (yyvsp
[(2) - (2)].expr
)); ;}
3062 /* Line 1455 of yacc.c */
3063 #line 678 "parser.y"
3064 { (yyval
.expr
) = new_unary_expression(ctx
, EXPR_PREDEC
, (yyvsp
[(2) - (2)].expr
)); ;}
3069 /* Line 1455 of yacc.c */
3070 #line 679 "parser.y"
3071 { (yyval
.expr
) = new_unary_expression(ctx
, EXPR_PLUS
, (yyvsp
[(2) - (2)].expr
)); ;}
3076 /* Line 1455 of yacc.c */
3077 #line 680 "parser.y"
3078 { (yyval
.expr
) = new_unary_expression(ctx
, EXPR_MINUS
, (yyvsp
[(2) - (2)].expr
)); ;}
3083 /* Line 1455 of yacc.c */
3084 #line 681 "parser.y"
3085 { (yyval
.expr
) = new_unary_expression(ctx
, EXPR_BITNEG
, (yyvsp
[(2) - (2)].expr
)); ;}
3090 /* Line 1455 of yacc.c */
3091 #line 682 "parser.y"
3092 { (yyval
.expr
) = new_unary_expression(ctx
, EXPR_LOGNEG
, (yyvsp
[(2) - (2)].expr
)); ;}
3097 /* Line 1455 of yacc.c */
3098 #line 687 "parser.y"
3099 { (yyval
.expr
) = (yyvsp
[(1) - (1)].expr
); ;}
3104 /* Line 1455 of yacc.c */
3105 #line 689 "parser.y"
3106 { (yyval
.expr
) = new_unary_expression(ctx
, EXPR_POSTINC
, (yyvsp
[(1) - (2)].expr
)); ;}
3111 /* Line 1455 of yacc.c */
3112 #line 691 "parser.y"
3113 { (yyval
.expr
) = new_unary_expression(ctx
, EXPR_POSTDEC
, (yyvsp
[(1) - (2)].expr
)); ;}
3118 /* Line 1455 of yacc.c */
3119 #line 696 "parser.y"
3120 { (yyval
.expr
) = (yyvsp
[(1) - (1)].expr
); ;}
3125 /* Line 1455 of yacc.c */
3126 #line 697 "parser.y"
3127 { (yyval
.expr
) = (yyvsp
[(1) - (1)].expr
); ;}
3132 /* Line 1455 of yacc.c */
3133 #line 701 "parser.y"
3134 { (yyval
.expr
) = (yyvsp
[(1) - (1)].expr
); ;}
3139 /* Line 1455 of yacc.c */
3140 #line 702 "parser.y"
3141 { (yyval
.expr
) = new_new_expression(ctx
, (yyvsp
[(2) - (2)].expr
), NULL
); ;}
3146 /* Line 1455 of yacc.c */
3147 #line 706 "parser.y"
3148 { (yyval
.expr
) = (yyvsp
[(1) - (1)].expr
); ;}
3153 /* Line 1455 of yacc.c */
3154 #line 707 "parser.y"
3155 { (yyval
.expr
) = (yyvsp
[(1) - (1)].expr
); ;}
3160 /* Line 1455 of yacc.c */
3161 #line 709 "parser.y"
3162 { (yyval
.expr
) = new_binary_expression(ctx
, EXPR_ARRAY
, (yyvsp
[(1) - (4)].expr
), (yyvsp
[(3) - (4)].expr
)); ;}
3167 /* Line 1455 of yacc.c */
3168 #line 711 "parser.y"
3169 { (yyval
.expr
) = new_member_expression(ctx
, (yyvsp
[(1) - (3)].expr
), (yyvsp
[(3) - (3)].identifier
)); ;}
3174 /* Line 1455 of yacc.c */
3175 #line 713 "parser.y"
3176 { (yyval
.expr
) = new_new_expression(ctx
, (yyvsp
[(2) - (3)].expr
), (yyvsp
[(3) - (3)].argument_list
)); ;}
3181 /* Line 1455 of yacc.c */
3182 #line 718 "parser.y"
3183 { (yyval
.expr
) = new_call_expression(ctx
, (yyvsp
[(1) - (2)].expr
), (yyvsp
[(2) - (2)].argument_list
)); ;}
3188 /* Line 1455 of yacc.c */
3189 #line 720 "parser.y"
3190 { (yyval
.expr
) = new_call_expression(ctx
, (yyvsp
[(1) - (2)].expr
), (yyvsp
[(2) - (2)].argument_list
)); ;}
3195 /* Line 1455 of yacc.c */
3196 #line 722 "parser.y"
3197 { (yyval
.expr
) = new_binary_expression(ctx
, EXPR_ARRAY
, (yyvsp
[(1) - (4)].expr
), (yyvsp
[(3) - (4)].expr
)); ;}
3202 /* Line 1455 of yacc.c */
3203 #line 724 "parser.y"
3204 { (yyval
.expr
) = new_member_expression(ctx
, (yyvsp
[(1) - (3)].expr
), (yyvsp
[(3) - (3)].identifier
)); ;}
3209 /* Line 1455 of yacc.c */
3210 #line 728 "parser.y"
3211 { (yyval
.argument_list
) = NULL
; ;}
3216 /* Line 1455 of yacc.c */
3217 #line 729 "parser.y"
3218 { (yyval
.argument_list
) = (yyvsp
[(2) - (3)].argument_list
); ;}
3223 /* Line 1455 of yacc.c */
3224 #line 733 "parser.y"
3225 { (yyval
.argument_list
) = new_argument_list(ctx
, (yyvsp
[(1) - (1)].expr
)); ;}
3230 /* Line 1455 of yacc.c */
3231 #line 735 "parser.y"
3232 { (yyval
.argument_list
) = argument_list_add(ctx
, (yyvsp
[(1) - (3)].argument_list
), (yyvsp
[(3) - (3)].expr
)); ;}
3237 /* Line 1455 of yacc.c */
3238 #line 739 "parser.y"
3239 { (yyval
.expr
) = new_expression(ctx
, EXPR_THIS
, 0); ;}
3244 /* Line 1455 of yacc.c */
3245 #line 740 "parser.y"
3246 { (yyval
.expr
) = new_identifier_expression(ctx
, (yyvsp
[(1) - (1)].identifier
)); ;}
3251 /* Line 1455 of yacc.c */
3252 #line 741 "parser.y"
3253 { (yyval
.expr
) = new_literal_expression(ctx
, (yyvsp
[(1) - (1)].literal
)); ;}
3258 /* Line 1455 of yacc.c */
3259 #line 742 "parser.y"
3260 { (yyval
.expr
) = (yyvsp
[(1) - (1)].expr
); ;}
3265 /* Line 1455 of yacc.c */
3266 #line 743 "parser.y"
3267 { (yyval
.expr
) = (yyvsp
[(1) - (1)].expr
); ;}
3272 /* Line 1455 of yacc.c */
3273 #line 744 "parser.y"
3274 { (yyval
.expr
) = (yyvsp
[(2) - (3)].expr
); ;}
3279 /* Line 1455 of yacc.c */
3280 #line 748 "parser.y"
3281 { (yyval
.expr
) = new_array_literal_expression(ctx
, NULL
, 0); ;}
3286 /* Line 1455 of yacc.c */
3287 #line 749 "parser.y"
3288 { (yyval
.expr
) = new_array_literal_expression(ctx
, NULL
, (yyvsp
[(2) - (3)].ival
)+1); ;}
3293 /* Line 1455 of yacc.c */
3294 #line 750 "parser.y"
3295 { (yyval
.expr
) = new_array_literal_expression(ctx
, (yyvsp
[(2) - (3)].element_list
), 0); ;}
3300 /* Line 1455 of yacc.c */
3301 #line 752 "parser.y"
3302 { (yyval
.expr
) = new_array_literal_expression(ctx
, (yyvsp
[(2) - (5)].element_list
), (yyvsp
[(4) - (5)].ival
)+1); ;}
3307 /* Line 1455 of yacc.c */
3308 #line 757 "parser.y"
3309 { (yyval
.element_list
) = new_element_list(ctx
, (yyvsp
[(1) - (2)].ival
), (yyvsp
[(2) - (2)].expr
)); ;}
3314 /* Line 1455 of yacc.c */
3315 #line 759 "parser.y"
3316 { (yyval
.element_list
) = element_list_add(ctx
, (yyvsp
[(1) - (4)].element_list
), (yyvsp
[(3) - (4)].ival
), (yyvsp
[(4) - (4)].expr
)); ;}
3321 /* Line 1455 of yacc.c */
3322 #line 763 "parser.y"
3323 { (yyval
.ival
) = 1; ;}
3328 /* Line 1455 of yacc.c */
3329 #line 764 "parser.y"
3330 { (yyval
.ival
) = (yyvsp
[(1) - (2)].ival
) + 1; ;}
3335 /* Line 1455 of yacc.c */
3336 #line 768 "parser.y"
3337 { (yyval
.ival
) = 0; ;}
3342 /* Line 1455 of yacc.c */
3343 #line 769 "parser.y"
3344 { (yyval
.ival
) = (yyvsp
[(1) - (1)].ival
); ;}
3349 /* Line 1455 of yacc.c */
3350 #line 773 "parser.y"
3351 { (yyval
.expr
) = new_prop_and_value_expression(ctx
, NULL
); ;}
3356 /* Line 1455 of yacc.c */
3357 #line 775 "parser.y"
3358 { (yyval
.expr
) = new_prop_and_value_expression(ctx
, (yyvsp
[(2) - (3)].property_list
)); ;}
3363 /* Line 1455 of yacc.c */
3364 #line 780 "parser.y"
3365 { (yyval
.property_list
) = new_property_list(ctx
, (yyvsp
[(1) - (3)].literal
), (yyvsp
[(3) - (3)].expr
)); ;}
3370 /* Line 1455 of yacc.c */
3371 #line 782 "parser.y"
3372 { (yyval
.property_list
) = property_list_add(ctx
, (yyvsp
[(1) - (5)].property_list
), (yyvsp
[(3) - (5)].literal
), (yyvsp
[(5) - (5)].expr
)); ;}
3377 /* Line 1455 of yacc.c */
3378 #line 786 "parser.y"
3379 { (yyval
.literal
) = new_string_literal(ctx
, (yyvsp
[(1) - (1)].identifier
)); ;}
3384 /* Line 1455 of yacc.c */
3385 #line 787 "parser.y"
3386 { (yyval
.literal
) = new_string_literal(ctx
, (yyvsp
[(1) - (1)].wstr
)); ;}
3391 /* Line 1455 of yacc.c */
3392 #line 788 "parser.y"
3393 { (yyval
.literal
) = (yyvsp
[(1) - (1)].literal
); ;}
3398 /* Line 1455 of yacc.c */
3399 #line 792 "parser.y"
3400 { (yyval
.identifier
) = NULL
; ;}
3405 /* Line 1455 of yacc.c */
3406 #line 793 "parser.y"
3407 { (yyval
.identifier
) = (yyvsp
[(1) - (1)].identifier
); ;}
3412 /* Line 1455 of yacc.c */
3413 #line 797 "parser.y"
3414 { (yyval
.literal
) = new_null_literal(ctx
); ;}
3419 /* Line 1455 of yacc.c */
3420 #line 798 "parser.y"
3421 { (yyval
.literal
) = (yyvsp
[(1) - (1)].literal
); ;}
3426 /* Line 1455 of yacc.c */
3427 #line 799 "parser.y"
3428 { (yyval
.literal
) = (yyvsp
[(1) - (1)].literal
); ;}
3433 /* Line 1455 of yacc.c */
3434 #line 800 "parser.y"
3435 { (yyval
.literal
) = new_string_literal(ctx
, (yyvsp
[(1) - (1)].wstr
)); ;}
3440 /* Line 1455 of yacc.c */
3441 #line 801 "parser.y"
3442 { (yyval
.literal
) = parse_regexp(ctx
);
3443 if(!(yyval
.literal
)) YYABORT
; ;}
3448 /* Line 1455 of yacc.c */
3449 #line 803 "parser.y"
3450 { (yyval
.literal
) = parse_regexp(ctx
);
3451 if(!(yyval
.literal
)) YYABORT
; ;}
3456 /* Line 1455 of yacc.c */
3457 #line 808 "parser.y"
3458 { (yyval
.literal
) = new_boolean_literal(ctx
, VARIANT_TRUE
); ;}
3463 /* Line 1455 of yacc.c */
3464 #line 809 "parser.y"
3465 { (yyval
.literal
) = new_boolean_literal(ctx
, VARIANT_FALSE
); ;}
3470 /* Line 1455 of yacc.c */
3471 #line 810 "parser.y"
3472 { (yyval
.literal
) = (yyvsp
[(1) - (1)].literal
); ;}
3477 /* Line 1455 of yacc.c */
3478 #line 814 "parser.y"
3479 { if(!allow_auto_semicolon(ctx
)) {YYABORT
;} ;}
3484 /* Line 1455 of yacc.c */
3485 #line 818 "parser.y"
3486 { set_error(ctx
, JS_E_MISSING_LBRACKET
); YYABORT
; ;}
3491 /* Line 1455 of yacc.c */
3492 #line 822 "parser.y"
3493 { set_error(ctx
, JS_E_MISSING_RBRACKET
); YYABORT
; ;}
3498 /* Line 1455 of yacc.c */
3499 #line 826 "parser.y"
3500 { set_error(ctx
, JS_E_MISSING_SEMICOLON
); YYABORT
; ;}
3505 /* Line 1455 of yacc.c */
3506 #line 3507 "parser.tab.c"
3509 YY_SYMBOL_PRINT ("-> $$ =", yyr1
[yyn
], &yyval
, &yyloc
);
3513 YY_STACK_PRINT (yyss
, yyssp
);
3517 /* Now `shift' the result of the reduction. Determine what state
3518 that goes to, based on the state we popped back to and the rule
3519 number reduced by. */
3523 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
3524 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
3525 yystate
= yytable
[yystate
];
3527 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
3532 /*------------------------------------.
3533 | yyerrlab -- here on detecting error |
3534 `------------------------------------*/
3536 /* If not already recovering from an error, report this error. */
3540 #if ! YYERROR_VERBOSE
3541 yyerror (YY_("syntax error"));
3544 YYSIZE_T yysize
= yysyntax_error (0, yystate
, yychar
);
3545 if (yymsg_alloc
< yysize
&& yymsg_alloc
< YYSTACK_ALLOC_MAXIMUM
)
3547 YYSIZE_T yyalloc
= 2 * yysize
;
3548 if (! (yysize
<= yyalloc
&& yyalloc
<= YYSTACK_ALLOC_MAXIMUM
))
3549 yyalloc
= YYSTACK_ALLOC_MAXIMUM
;
3550 if (yymsg
!= yymsgbuf
)
3551 YYSTACK_FREE (yymsg
);
3552 yymsg
= (char *) YYSTACK_ALLOC (yyalloc
);
3554 yymsg_alloc
= yyalloc
;
3558 yymsg_alloc
= sizeof yymsgbuf
;
3562 if (0 < yysize
&& yysize
<= yymsg_alloc
)
3564 (void) yysyntax_error (yymsg
, yystate
, yychar
);
3569 yyerror (YY_("syntax error"));
3571 goto yyexhaustedlab
;
3579 if (yyerrstatus
== 3)
3581 /* If just tried and failed to reuse lookahead token after an
3582 error, discard it. */
3584 if (yychar
<= YYEOF
)
3586 /* Return failure if at end of input. */
3587 if (yychar
== YYEOF
)
3592 yydestruct ("Error: discarding",
3598 /* Else will try to reuse lookahead token after shifting the error
3603 /*---------------------------------------------------.
3604 | yyerrorlab -- error raised explicitly by YYERROR. |
3605 `---------------------------------------------------*/
3608 /* Pacify compilers like GCC when the user code never invokes
3609 YYERROR and the label yyerrorlab therefore never appears in user
3611 if (/*CONSTCOND*/ 0)
3614 /* Do not reclaim the symbols of the rule which action triggered
3618 YY_STACK_PRINT (yyss
, yyssp
);
3623 /*-------------------------------------------------------------.
3624 | yyerrlab1 -- common code for both syntax error and YYERROR. |
3625 `-------------------------------------------------------------*/
3627 yyerrstatus
= 3; /* Each real token shifted decrements this. */
3631 yyn
= yypact
[yystate
];
3632 if (yyn
!= YYPACT_NINF
)
3635 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
3643 /* Pop the current state because it cannot handle the error token. */
3648 yydestruct ("Error: popping",
3649 yystos
[yystate
], yyvsp
);
3652 YY_STACK_PRINT (yyss
, yyssp
);
3658 /* Shift the error token. */
3659 YY_SYMBOL_PRINT ("Shifting", yystos
[yyn
], yyvsp
, yylsp
);
3665 /*-------------------------------------.
3666 | yyacceptlab -- YYACCEPT comes here. |
3667 `-------------------------------------*/
3672 /*-----------------------------------.
3673 | yyabortlab -- YYABORT comes here. |
3674 `-----------------------------------*/
3679 #if !defined(yyoverflow) || YYERROR_VERBOSE
3680 /*-------------------------------------------------.
3681 | yyexhaustedlab -- memory exhaustion comes here. |
3682 `-------------------------------------------------*/
3684 yyerror (YY_("memory exhausted"));
3690 if (yychar
!= YYEMPTY
)
3691 yydestruct ("Cleanup: discarding lookahead",
3693 /* Do not reclaim the symbols of the rule which action triggered
3694 this YYABORT or YYACCEPT. */
3696 YY_STACK_PRINT (yyss
, yyssp
);
3697 while (yyssp
!= yyss
)
3699 yydestruct ("Cleanup: popping",
3700 yystos
[*yyssp
], yyvsp
);
3705 YYSTACK_FREE (yyss
);
3708 if (yymsg
!= yymsgbuf
)
3709 YYSTACK_FREE (yymsg
);
3711 /* Make sure YYID is used. */
3712 return YYID (yyresult
);
3717 /* Line 1675 of yacc.c */
3718 #line 828 "parser.y"
3721 static BOOL
allow_auto_semicolon(parser_ctx_t
*ctx
)
3723 return ctx
->nl
|| ctx
->ptr
== ctx
->end
|| *(ctx
->ptr
-1) == '}';
3726 static void *new_statement(parser_ctx_t
*ctx
, statement_type_t type
, size_t size
)
3730 stat
= parser_alloc(ctx
, size
? size
: sizeof(*stat
));
3740 static literal_t
*new_string_literal(parser_ctx_t
*ctx
, const WCHAR
*str
)
3742 literal_t
*ret
= parser_alloc(ctx
, sizeof(literal_t
));
3744 ret
->type
= LT_STRING
;
3750 static literal_t
*new_null_literal(parser_ctx_t
*ctx
)
3752 literal_t
*ret
= parser_alloc(ctx
, sizeof(literal_t
));
3754 ret
->type
= LT_NULL
;
3759 static prop_val_t
*new_prop_val(parser_ctx_t
*ctx
, literal_t
*name
, expression_t
*value
)
3761 prop_val_t
*ret
= parser_alloc(ctx
, sizeof(prop_val_t
));
3770 static property_list_t
*new_property_list(parser_ctx_t
*ctx
, literal_t
*name
, expression_t
*value
)
3772 property_list_t
*ret
= parser_alloc_tmp(ctx
, sizeof(property_list_t
));
3774 ret
->head
= ret
->tail
= new_prop_val(ctx
, name
, value
);
3779 static property_list_t
*property_list_add(parser_ctx_t
*ctx
, property_list_t
*list
, literal_t
*name
, expression_t
*value
)
3781 list
->tail
= list
->tail
->next
= new_prop_val(ctx
, name
, value
);
3786 static array_element_t
*new_array_element(parser_ctx_t
*ctx
, int elision
, expression_t
*expr
)
3788 array_element_t
*ret
= parser_alloc(ctx
, sizeof(array_element_t
));
3790 ret
->elision
= elision
;
3797 static element_list_t
*new_element_list(parser_ctx_t
*ctx
, int elision
, expression_t
*expr
)
3799 element_list_t
*ret
= parser_alloc_tmp(ctx
, sizeof(element_list_t
));
3801 ret
->head
= ret
->tail
= new_array_element(ctx
, elision
, expr
);
3806 static element_list_t
*element_list_add(parser_ctx_t
*ctx
, element_list_t
*list
, int elision
, expression_t
*expr
)
3808 list
->tail
= list
->tail
->next
= new_array_element(ctx
, elision
, expr
);
3813 static argument_t
*new_argument(parser_ctx_t
*ctx
, expression_t
*expr
)
3815 argument_t
*ret
= parser_alloc(ctx
, sizeof(argument_t
));
3823 static argument_list_t
*new_argument_list(parser_ctx_t
*ctx
, expression_t
*expr
)
3825 argument_list_t
*ret
= parser_alloc_tmp(ctx
, sizeof(argument_list_t
));
3827 ret
->head
= ret
->tail
= new_argument(ctx
, expr
);
3832 static argument_list_t
*argument_list_add(parser_ctx_t
*ctx
, argument_list_t
*list
, expression_t
*expr
)
3834 list
->tail
= list
->tail
->next
= new_argument(ctx
, expr
);
3839 static catch_block_t
*new_catch_block(parser_ctx_t
*ctx
, const WCHAR
*identifier
, statement_t
*statement
)
3841 catch_block_t
*ret
= parser_alloc(ctx
, sizeof(catch_block_t
));
3843 ret
->identifier
= identifier
;
3844 ret
->statement
= statement
;
3849 static case_clausule_t
*new_case_clausule(parser_ctx_t
*ctx
, expression_t
*expr
, statement_list_t
*stat_list
)
3851 case_clausule_t
*ret
= parser_alloc(ctx
, sizeof(case_clausule_t
));
3854 ret
->stat
= stat_list
? stat_list
->head
: NULL
;
3860 static case_list_t
*new_case_list(parser_ctx_t
*ctx
, case_clausule_t
*case_clausule
)
3862 case_list_t
*ret
= parser_alloc_tmp(ctx
, sizeof(case_list_t
));
3864 ret
->head
= ret
->tail
= case_clausule
;
3869 static case_list_t
*case_list_add(parser_ctx_t
*ctx
, case_list_t
*list
, case_clausule_t
*case_clausule
)
3871 list
->tail
= list
->tail
->next
= case_clausule
;
3876 static case_clausule_t
*new_case_block(parser_ctx_t
*ctx
, case_list_t
*case_list1
,
3877 case_clausule_t
*default_clausule
, case_list_t
*case_list2
)
3879 case_clausule_t
*ret
= NULL
, *iter
= NULL
, *iter2
;
3880 statement_t
*stat
= NULL
;
3883 ret
= case_list1
->head
;
3884 iter
= case_list1
->tail
;
3887 if(default_clausule
) {
3889 iter
= iter
->next
= default_clausule
;
3891 ret
= iter
= default_clausule
;
3896 iter
->next
= case_list2
->head
;
3898 ret
= case_list2
->head
;
3904 for(iter
= ret
; iter
; iter
= iter
->next
) {
3905 for(iter2
= iter
; iter2
&& !iter2
->stat
; iter2
= iter2
->next
);
3909 while(iter
!= iter2
) {
3910 iter
->stat
= iter2
->stat
;
3917 stat
->next
= iter
->stat
;
3926 static statement_t
*new_block_statement(parser_ctx_t
*ctx
, statement_list_t
*list
)
3928 block_statement_t
*ret
;
3930 ret
= new_statement(ctx
, STAT_BLOCK
, sizeof(*ret
));
3934 ret
->stat_list
= list
? list
->head
: NULL
;
3939 static variable_declaration_t
*new_variable_declaration(parser_ctx_t
*ctx
, const WCHAR
*identifier
, expression_t
*expr
)
3941 variable_declaration_t
*ret
= parser_alloc(ctx
, sizeof(variable_declaration_t
));
3943 ret
->identifier
= identifier
;
3946 ret
->global_next
= NULL
;
3951 static variable_list_t
*new_variable_list(parser_ctx_t
*ctx
, variable_declaration_t
*decl
)
3953 variable_list_t
*ret
= parser_alloc_tmp(ctx
, sizeof(variable_list_t
));
3955 ret
->head
= ret
->tail
= decl
;
3960 static variable_list_t
*variable_list_add(parser_ctx_t
*ctx
, variable_list_t
*list
, variable_declaration_t
*decl
)
3962 list
->tail
= list
->tail
->next
= decl
;
3967 static statement_t
*new_var_statement(parser_ctx_t
*ctx
, variable_list_t
*variable_list
)
3969 var_statement_t
*ret
;
3971 ret
= new_statement(ctx
, STAT_VAR
, sizeof(*ret
));
3975 ret
->variable_list
= variable_list
->head
;
3980 static statement_t
*new_expression_statement(parser_ctx_t
*ctx
, expression_t
*expr
)
3982 expression_statement_t
*ret
;
3984 ret
= new_statement(ctx
, STAT_EXPR
, sizeof(*ret
));
3993 static statement_t
*new_if_statement(parser_ctx_t
*ctx
, expression_t
*expr
, statement_t
*if_stat
, statement_t
*else_stat
)
3995 if_statement_t
*ret
;
3997 ret
= new_statement(ctx
, STAT_IF
, sizeof(*ret
));
4002 ret
->if_stat
= if_stat
;
4003 ret
->else_stat
= else_stat
;
4008 static statement_t
*new_while_statement(parser_ctx_t
*ctx
, BOOL dowhile
, expression_t
*expr
, statement_t
*stat
)
4010 while_statement_t
*ret
;
4012 ret
= new_statement(ctx
, STAT_WHILE
, sizeof(*ret
));
4016 ret
->do_while
= dowhile
;
4018 ret
->statement
= stat
;
4023 static statement_t
*new_for_statement(parser_ctx_t
*ctx
, variable_list_t
*variable_list
, expression_t
*begin_expr
,
4024 expression_t
*expr
, expression_t
*end_expr
, statement_t
*statement
)
4026 for_statement_t
*ret
;
4028 ret
= new_statement(ctx
, STAT_FOR
, sizeof(*ret
));
4032 ret
->variable_list
= variable_list
? variable_list
->head
: NULL
;
4033 ret
->begin_expr
= begin_expr
;
4035 ret
->end_expr
= end_expr
;
4036 ret
->statement
= statement
;
4041 static statement_t
*new_forin_statement(parser_ctx_t
*ctx
, variable_declaration_t
*variable
, expression_t
*expr
,
4042 expression_t
*in_expr
, statement_t
*statement
)
4044 forin_statement_t
*ret
;
4046 ret
= new_statement(ctx
, STAT_FORIN
, sizeof(*ret
));
4050 ret
->variable
= variable
;
4052 ret
->in_expr
= in_expr
;
4053 ret
->statement
= statement
;
4058 static statement_t
*new_continue_statement(parser_ctx_t
*ctx
, const WCHAR
*identifier
)
4060 branch_statement_t
*ret
;
4062 ret
= new_statement(ctx
, STAT_CONTINUE
, sizeof(*ret
));
4066 ret
->identifier
= identifier
;
4071 static statement_t
*new_break_statement(parser_ctx_t
*ctx
, const WCHAR
*identifier
)
4073 branch_statement_t
*ret
;
4075 ret
= new_statement(ctx
, STAT_BREAK
, sizeof(*ret
));
4079 ret
->identifier
= identifier
;
4084 static statement_t
*new_return_statement(parser_ctx_t
*ctx
, expression_t
*expr
)
4086 expression_statement_t
*ret
;
4088 ret
= new_statement(ctx
, STAT_RETURN
, sizeof(*ret
));
4097 static statement_t
*new_with_statement(parser_ctx_t
*ctx
, expression_t
*expr
, statement_t
*statement
)
4099 with_statement_t
*ret
;
4101 ret
= new_statement(ctx
, STAT_WITH
, sizeof(*ret
));
4106 ret
->statement
= statement
;
4111 static statement_t
*new_labelled_statement(parser_ctx_t
*ctx
, const WCHAR
*identifier
, statement_t
*statement
)
4113 labelled_statement_t
*ret
;
4115 ret
= new_statement(ctx
, STAT_LABEL
, sizeof(*ret
));
4119 ret
->identifier
= identifier
;
4120 ret
->statement
= statement
;
4125 static statement_t
*new_switch_statement(parser_ctx_t
*ctx
, expression_t
*expr
, case_clausule_t
*case_list
)
4127 switch_statement_t
*ret
;
4129 ret
= new_statement(ctx
, STAT_SWITCH
, sizeof(*ret
));
4134 ret
->case_list
= case_list
;
4139 static statement_t
*new_throw_statement(parser_ctx_t
*ctx
, expression_t
*expr
)
4141 expression_statement_t
*ret
;
4143 ret
= new_statement(ctx
, STAT_THROW
, sizeof(*ret
));
4152 static statement_t
*new_try_statement(parser_ctx_t
*ctx
, statement_t
*try_statement
,
4153 catch_block_t
*catch_block
, statement_t
*finally_statement
)
4155 try_statement_t
*ret
;
4157 ret
= new_statement(ctx
, STAT_TRY
, sizeof(*ret
));
4161 ret
->try_statement
= try_statement
;
4162 ret
->catch_block
= catch_block
;
4163 ret
->finally_statement
= finally_statement
;
4168 static parameter_t
*new_parameter(parser_ctx_t
*ctx
, const WCHAR
*identifier
)
4170 parameter_t
*ret
= parser_alloc(ctx
, sizeof(parameter_t
));
4172 ret
->identifier
= identifier
;
4178 static parameter_list_t
*new_parameter_list(parser_ctx_t
*ctx
, const WCHAR
*identifier
)
4180 parameter_list_t
*ret
= parser_alloc_tmp(ctx
, sizeof(parameter_list_t
));
4182 ret
->head
= ret
->tail
= new_parameter(ctx
, identifier
);
4187 static parameter_list_t
*parameter_list_add(parser_ctx_t
*ctx
, parameter_list_t
*list
, const WCHAR
*identifier
)
4189 list
->tail
= list
->tail
->next
= new_parameter(ctx
, identifier
);
4194 static expression_t
*new_function_expression(parser_ctx_t
*ctx
, const WCHAR
*identifier
,
4195 parameter_list_t
*parameter_list
, source_elements_t
*source_elements
, const WCHAR
*src_str
, DWORD src_len
)
4197 function_expression_t
*ret
= new_expression(ctx
, EXPR_FUNC
, sizeof(*ret
));
4199 ret
->identifier
= identifier
;
4200 ret
->parameter_list
= parameter_list
? parameter_list
->head
: NULL
;
4201 ret
->source_elements
= source_elements
;
4202 ret
->src_str
= src_str
;
4203 ret
->src_len
= src_len
;
4209 static void *new_expression(parser_ctx_t
*ctx
, expression_type_t type
, size_t size
)
4211 expression_t
*ret
= parser_alloc(ctx
, size
? size
: sizeof(*ret
));
4218 static expression_t
*new_binary_expression(parser_ctx_t
*ctx
, expression_type_t type
,
4219 expression_t
*expression1
, expression_t
*expression2
)
4221 binary_expression_t
*ret
= new_expression(ctx
, type
, sizeof(*ret
));
4223 ret
->expression1
= expression1
;
4224 ret
->expression2
= expression2
;
4229 static expression_t
*new_unary_expression(parser_ctx_t
*ctx
, expression_type_t type
, expression_t
*expression
)
4231 unary_expression_t
*ret
= new_expression(ctx
, type
, sizeof(*ret
));
4233 ret
->expression
= expression
;
4238 static expression_t
*new_conditional_expression(parser_ctx_t
*ctx
, expression_t
*expression
,
4239 expression_t
*true_expression
, expression_t
*false_expression
)
4241 conditional_expression_t
*ret
= new_expression(ctx
, EXPR_COND
, sizeof(*ret
));
4243 ret
->expression
= expression
;
4244 ret
->true_expression
= true_expression
;
4245 ret
->false_expression
= false_expression
;
4250 static expression_t
*new_member_expression(parser_ctx_t
*ctx
, expression_t
*expression
, const WCHAR
*identifier
)
4252 member_expression_t
*ret
= new_expression(ctx
, EXPR_MEMBER
, sizeof(*ret
));
4254 ret
->expression
= expression
;
4255 ret
->identifier
= identifier
;
4260 static expression_t
*new_new_expression(parser_ctx_t
*ctx
, expression_t
*expression
, argument_list_t
*argument_list
)
4262 call_expression_t
*ret
= new_expression(ctx
, EXPR_NEW
, sizeof(*ret
));
4264 ret
->expression
= expression
;
4265 ret
->argument_list
= argument_list
? argument_list
->head
: NULL
;
4270 static expression_t
*new_call_expression(parser_ctx_t
*ctx
, expression_t
*expression
, argument_list_t
*argument_list
)
4272 call_expression_t
*ret
= new_expression(ctx
, EXPR_CALL
, sizeof(*ret
));
4274 ret
->expression
= expression
;
4275 ret
->argument_list
= argument_list
? argument_list
->head
: NULL
;
4280 static int parser_error(const char *str
)
4285 static void set_error(parser_ctx_t
*ctx
, UINT error
)
4290 static BOOL
explicit_error(parser_ctx_t
*ctx
, void *obj
, WCHAR next
)
4292 if(obj
|| *(ctx
->ptr
-1)==next
) return TRUE
;
4294 set_error(ctx
, JS_E_SYNTAX
);
4299 static expression_t
*new_identifier_expression(parser_ctx_t
*ctx
, const WCHAR
*identifier
)
4301 identifier_expression_t
*ret
= new_expression(ctx
, EXPR_IDENT
, sizeof(*ret
));
4303 ret
->identifier
= identifier
;
4308 static expression_t
*new_array_literal_expression(parser_ctx_t
*ctx
, element_list_t
*element_list
, int length
)
4310 array_literal_expression_t
*ret
= new_expression(ctx
, EXPR_ARRAYLIT
, sizeof(*ret
));
4312 ret
->element_list
= element_list
? element_list
->head
: NULL
;
4313 ret
->length
= length
;
4318 static expression_t
*new_prop_and_value_expression(parser_ctx_t
*ctx
, property_list_t
*property_list
)
4320 property_value_expression_t
*ret
= new_expression(ctx
, EXPR_PROPVAL
, sizeof(*ret
));
4322 ret
->property_list
= property_list
? property_list
->head
: NULL
;
4327 static expression_t
*new_literal_expression(parser_ctx_t
*ctx
, literal_t
*literal
)
4329 literal_expression_t
*ret
= new_expression(ctx
, EXPR_LITERAL
, sizeof(*ret
));
4331 ret
->literal
= literal
;
4336 static source_elements_t
*new_source_elements(parser_ctx_t
*ctx
)
4338 source_elements_t
*ret
= parser_alloc(ctx
, sizeof(source_elements_t
));
4340 memset(ret
, 0, sizeof(*ret
));
4345 static source_elements_t
*source_elements_add_statement(source_elements_t
*source_elements
, statement_t
*statement
)
4347 if(source_elements
->statement_tail
)
4348 source_elements
->statement_tail
= source_elements
->statement_tail
->next
= statement
;
4350 source_elements
->statement
= source_elements
->statement_tail
= statement
;
4352 return source_elements
;
4355 static statement_list_t
*new_statement_list(parser_ctx_t
*ctx
, statement_t
*statement
)
4357 statement_list_t
*ret
= parser_alloc_tmp(ctx
, sizeof(statement_list_t
));
4359 ret
->head
= ret
->tail
= statement
;
4364 static statement_list_t
*statement_list_add(statement_list_t
*list
, statement_t
*statement
)
4366 list
->tail
= list
->tail
->next
= statement
;
4371 static void program_parsed(parser_ctx_t
*ctx
, source_elements_t
*source
)
4373 ctx
->source
= source
;
4374 if(!ctx
->lexer_error
)
4378 void parser_release(parser_ctx_t
*ctx
)
4380 script_release(ctx
->script
);
4381 heap_pool_free(&ctx
->heap
);
4385 HRESULT
script_parse(script_ctx_t
*ctx
, const WCHAR
*code
, const WCHAR
*delimiter
, BOOL from_eval
,
4388 parser_ctx_t
*parser_ctx
;
4392 const WCHAR html_tagW
[] = {'<','/','s','c','r','i','p','t','>',0};
4394 parser_ctx
= heap_alloc_zero(sizeof(parser_ctx_t
));
4396 return E_OUTOFMEMORY
;
4398 parser_ctx
->hres
= JS_E_SYNTAX
;
4399 parser_ctx
->is_html
= delimiter
&& !strcmpiW(delimiter
, html_tagW
);
4401 parser_ctx
->begin
= parser_ctx
->ptr
= code
;
4402 parser_ctx
->end
= parser_ctx
->begin
+ strlenW(parser_ctx
->begin
);
4405 parser_ctx
->script
= ctx
;
4407 mark
= heap_pool_mark(&ctx
->tmp_heap
);
4408 heap_pool_init(&parser_ctx
->heap
);
4410 parser_parse(parser_ctx
);
4411 heap_pool_clear(mark
);
4412 hres
= parser_ctx
->hres
;
4414 WARN("parser failed around %s\n",
4415 debugstr_w(parser_ctx
->begin
+20 > parser_ctx
->ptr
? parser_ctx
->begin
: parser_ctx
->ptr
-20));
4416 parser_release(parser_ctx
);