[JSCRIPT]
[reactos.git] / reactos / dll / win32 / jscript / parser.tab.c
1
2 /* A Bison parser, made by GNU Bison 2.4.1. */
3
4 /* Skeleton implementation for Bison's Yacc-like parsers in C
5
6 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
7 Free Software Foundation, Inc.
8
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.
13
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.
18
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/>. */
21
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.
31
32 This special exception was added by the Free Software Foundation in
33 version 2.2 of Bison. */
34
35 /* C LALR(1) parser skeleton written by Richard Stallman, by
36 simplifying the original so-called "semantic" parser. */
37
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. */
44
45 /* Identify Bison output. */
46 #define YYBISON 1
47
48 /* Bison version. */
49 #define YYBISON_VERSION "2.4.1"
50
51 /* Skeleton name. */
52 #define YYSKELETON_NAME "yacc.c"
53
54 /* Pure parsers. */
55 #define YYPURE 1
56
57 /* Push parsers. */
58 #define YYPUSH 0
59
60 /* Pull parsers. */
61 #define YYPULL 1
62
63 /* Using locations. */
64 #define YYLSP_NEEDED 0
65
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
74
75
76 /* Copy the first part of user declarations. */
77
78 /* Line 189 of yacc.c */
79 #line 19 "parser.y"
80
81
82 #include "jscript.h"
83 #include "engine.h"
84
85 #define YYLEX_PARAM ctx
86 #define YYPARSE_PARAM ctx
87
88 static int parser_error(const char*);
89 static void set_error(parser_ctx_t*,UINT);
90 static BOOL explicit_error(parser_ctx_t*,void*,WCHAR);
91 static BOOL allow_auto_semicolon(parser_ctx_t*);
92 static void program_parsed(parser_ctx_t*,source_elements_t*);
93 static source_elements_t *function_body_parsed(parser_ctx_t*,source_elements_t*);
94
95 typedef struct _statement_list_t {
96 statement_t *head;
97 statement_t *tail;
98 } statement_list_t;
99
100 static literal_t *new_string_literal(parser_ctx_t*,const WCHAR*);
101 static literal_t *new_null_literal(parser_ctx_t*);
102 static literal_t *new_boolean_literal(parser_ctx_t*,VARIANT_BOOL);
103
104 typedef struct _property_list_t {
105 prop_val_t *head;
106 prop_val_t *tail;
107 } property_list_t;
108
109 static property_list_t *new_property_list(parser_ctx_t*,literal_t*,expression_t*);
110 static property_list_t *property_list_add(parser_ctx_t*,property_list_t*,literal_t*,expression_t*);
111
112 typedef struct _element_list_t {
113 array_element_t *head;
114 array_element_t *tail;
115 } element_list_t;
116
117 static element_list_t *new_element_list(parser_ctx_t*,int,expression_t*);
118 static element_list_t *element_list_add(parser_ctx_t*,element_list_t*,int,expression_t*);
119
120 typedef struct _argument_list_t {
121 argument_t *head;
122 argument_t *tail;
123 } argument_list_t;
124
125 static argument_list_t *new_argument_list(parser_ctx_t*,expression_t*);
126 static argument_list_t *argument_list_add(parser_ctx_t*,argument_list_t*,expression_t*);
127
128 typedef struct _case_list_t {
129 case_clausule_t *head;
130 case_clausule_t *tail;
131 } case_list_t;
132
133 static catch_block_t *new_catch_block(parser_ctx_t*,const WCHAR*,statement_t*);
134 static case_clausule_t *new_case_clausule(parser_ctx_t*,expression_t*,statement_list_t*);
135 static case_list_t *new_case_list(parser_ctx_t*,case_clausule_t*);
136 static case_list_t *case_list_add(parser_ctx_t*,case_list_t*,case_clausule_t*);
137 static case_clausule_t *new_case_block(parser_ctx_t*,case_list_t*,case_clausule_t*,case_list_t*);
138
139 typedef struct _variable_list_t {
140 variable_declaration_t *head;
141 variable_declaration_t *tail;
142 } variable_list_t;
143
144 static variable_declaration_t *new_variable_declaration(parser_ctx_t*,const WCHAR*,expression_t*);
145 static variable_list_t *new_variable_list(parser_ctx_t*,variable_declaration_t*);
146 static variable_list_t *variable_list_add(parser_ctx_t*,variable_list_t*,variable_declaration_t*);
147
148 static statement_t *new_block_statement(parser_ctx_t*,statement_list_t*);
149 static statement_t *new_var_statement(parser_ctx_t*,variable_list_t*);
150 static statement_t *new_empty_statement(parser_ctx_t*);
151 static statement_t *new_expression_statement(parser_ctx_t*,expression_t*);
152 static statement_t *new_if_statement(parser_ctx_t*,expression_t*,statement_t*,statement_t*);
153 static statement_t *new_while_statement(parser_ctx_t*,BOOL,expression_t*,statement_t*);
154 static statement_t *new_for_statement(parser_ctx_t*,variable_list_t*,expression_t*,expression_t*,
155 expression_t*,statement_t*);
156 static statement_t *new_forin_statement(parser_ctx_t*,variable_declaration_t*,expression_t*,expression_t*,statement_t*);
157 static statement_t *new_continue_statement(parser_ctx_t*,const WCHAR*);
158 static statement_t *new_break_statement(parser_ctx_t*,const WCHAR*);
159 static statement_t *new_return_statement(parser_ctx_t*,expression_t*);
160 static statement_t *new_with_statement(parser_ctx_t*,expression_t*,statement_t*);
161 static statement_t *new_labelled_statement(parser_ctx_t*,const WCHAR*,statement_t*);
162 static statement_t *new_switch_statement(parser_ctx_t*,expression_t*,case_clausule_t*);
163 static statement_t *new_throw_statement(parser_ctx_t*,expression_t*);
164 static statement_t *new_try_statement(parser_ctx_t*,statement_t*,catch_block_t*,statement_t*);
165
166 struct statement_list_t {
167 statement_t *head;
168 statement_t *tail;
169 };
170
171 static statement_list_t *new_statement_list(parser_ctx_t*,statement_t*);
172 static statement_list_t *statement_list_add(statement_list_t*,statement_t*);
173
174 typedef struct _parameter_list_t {
175 parameter_t *head;
176 parameter_t *tail;
177 } parameter_list_t;
178
179 static parameter_list_t *new_parameter_list(parser_ctx_t*,const WCHAR*);
180 static parameter_list_t *parameter_list_add(parser_ctx_t*,parameter_list_t*,const WCHAR*);
181
182 static void push_func(parser_ctx_t*);
183 static inline void pop_func(parser_ctx_t *ctx)
184 {
185 ctx->func_stack = ctx->func_stack->next;
186 }
187
188 static expression_t *new_function_expression(parser_ctx_t*,const WCHAR*,parameter_list_t*,
189 source_elements_t*,const WCHAR*,DWORD);
190 static expression_t *new_binary_expression(parser_ctx_t*,expression_type_t,expression_t*,expression_t*);
191 static expression_t *new_unary_expression(parser_ctx_t*,expression_type_t,expression_t*);
192 static expression_t *new_conditional_expression(parser_ctx_t*,expression_t*,expression_t*,expression_t*);
193 static expression_t *new_array_expression(parser_ctx_t*,expression_t*,expression_t*);
194 static expression_t *new_member_expression(parser_ctx_t*,expression_t*,const WCHAR*);
195 static expression_t *new_new_expression(parser_ctx_t*,expression_t*,argument_list_t*);
196 static expression_t *new_call_expression(parser_ctx_t*,expression_t*,argument_list_t*);
197 static expression_t *new_this_expression(parser_ctx_t*);
198 static expression_t *new_identifier_expression(parser_ctx_t*,const WCHAR*);
199 static expression_t *new_literal_expression(parser_ctx_t*,literal_t*);
200 static expression_t *new_array_literal_expression(parser_ctx_t*,element_list_t*,int);
201 static expression_t *new_prop_and_value_expression(parser_ctx_t*,property_list_t*);
202
203 static source_elements_t *new_source_elements(parser_ctx_t*);
204 static source_elements_t *source_elements_add_statement(source_elements_t*,statement_t*);
205
206
207
208 /* Line 189 of yacc.c */
209 #line 210 "parser.tab.c"
210
211 /* Enabling traces. */
212 #ifndef YYDEBUG
213 # define YYDEBUG 0
214 #endif
215
216 /* Enabling verbose error messages. */
217 #ifdef YYERROR_VERBOSE
218 # undef YYERROR_VERBOSE
219 # define YYERROR_VERBOSE 1
220 #else
221 # define YYERROR_VERBOSE 0
222 #endif
223
224 /* Enabling the token table. */
225 #ifndef YYTOKEN_TABLE
226 # define YYTOKEN_TABLE 0
227 #endif
228
229
230 /* Tokens. */
231 #ifndef YYTOKENTYPE
232 # define YYTOKENTYPE
233 /* Put the tokens into the symbol table, so that GDB and other debuggers
234 know about them. */
235 enum yytokentype {
236 kBREAK = 258,
237 kCASE = 259,
238 kCATCH = 260,
239 kCONTINUE = 261,
240 kDEFAULT = 262,
241 kDELETE = 263,
242 kDO = 264,
243 kELSE = 265,
244 kIF = 266,
245 kFINALLY = 267,
246 kFOR = 268,
247 kIN = 269,
248 kINSTANCEOF = 270,
249 kNEW = 271,
250 kNULL = 272,
251 kRETURN = 273,
252 kSWITCH = 274,
253 kTHIS = 275,
254 kTHROW = 276,
255 kTRUE = 277,
256 kFALSE = 278,
257 kTRY = 279,
258 kTYPEOF = 280,
259 kVAR = 281,
260 kVOID = 282,
261 kWHILE = 283,
262 kWITH = 284,
263 tANDAND = 285,
264 tOROR = 286,
265 tINC = 287,
266 tDEC = 288,
267 tHTMLCOMMENT = 289,
268 kDIVEQ = 290,
269 kFUNCTION = 291,
270 tIdentifier = 292,
271 tAssignOper = 293,
272 tEqOper = 294,
273 tShiftOper = 295,
274 tRelOper = 296,
275 tNumericLiteral = 297,
276 tStringLiteral = 298,
277 LOWER_THAN_ELSE = 299
278 };
279 #endif
280
281
282
283 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
284 typedef union YYSTYPE
285 {
286
287 /* Line 214 of yacc.c */
288 #line 150 "parser.y"
289
290 int ival;
291 const WCHAR *srcptr;
292 LPCWSTR wstr;
293 literal_t *literal;
294 struct _argument_list_t *argument_list;
295 case_clausule_t *case_clausule;
296 struct _case_list_t *case_list;
297 catch_block_t *catch_block;
298 struct _element_list_t *element_list;
299 expression_t *expr;
300 const WCHAR *identifier;
301 struct _parameter_list_t *parameter_list;
302 struct _property_list_t *property_list;
303 source_elements_t *source_elements;
304 statement_t *statement;
305 struct _statement_list_t *statement_list;
306 struct _variable_list_t *variable_list;
307 variable_declaration_t *variable_declaration;
308
309
310
311 /* Line 214 of yacc.c */
312 #line 313 "parser.tab.c"
313 } YYSTYPE;
314 # define YYSTYPE_IS_TRIVIAL 1
315 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
316 # define YYSTYPE_IS_DECLARED 1
317 #endif
318
319
320 /* Copy the second part of user declarations. */
321
322
323 /* Line 264 of yacc.c */
324 #line 325 "parser.tab.c"
325
326 #ifdef short
327 # undef short
328 #endif
329
330 #ifdef YYTYPE_UINT8
331 typedef YYTYPE_UINT8 yytype_uint8;
332 #else
333 typedef unsigned char yytype_uint8;
334 #endif
335
336 #ifdef YYTYPE_INT8
337 typedef YYTYPE_INT8 yytype_int8;
338 #elif (defined __STDC__ || defined __C99__FUNC__ \
339 || defined __cplusplus || defined _MSC_VER)
340 typedef signed char yytype_int8;
341 #else
342 typedef short int yytype_int8;
343 #endif
344
345 #ifdef YYTYPE_UINT16
346 typedef YYTYPE_UINT16 yytype_uint16;
347 #else
348 typedef unsigned short int yytype_uint16;
349 #endif
350
351 #ifdef YYTYPE_INT16
352 typedef YYTYPE_INT16 yytype_int16;
353 #else
354 typedef short int yytype_int16;
355 #endif
356
357 #ifndef YYSIZE_T
358 # ifdef __SIZE_TYPE__
359 # define YYSIZE_T __SIZE_TYPE__
360 # elif defined size_t
361 # define YYSIZE_T size_t
362 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
363 || defined __cplusplus || defined _MSC_VER)
364 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
365 # define YYSIZE_T size_t
366 # else
367 # define YYSIZE_T unsigned int
368 # endif
369 #endif
370
371 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
372
373 #ifndef YY_
374 # if YYENABLE_NLS
375 # if ENABLE_NLS
376 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
377 # define YY_(msgid) dgettext ("bison-runtime", msgid)
378 # endif
379 # endif
380 # ifndef YY_
381 # define YY_(msgid) msgid
382 # endif
383 #endif
384
385 /* Suppress unused-variable warnings by "using" E. */
386 #if ! defined lint || defined __GNUC__
387 # define YYUSE(e) ((void) (e))
388 #else
389 # define YYUSE(e) /* empty */
390 #endif
391
392 /* Identity function, used to suppress warnings about constant conditions. */
393 #ifndef lint
394 # define YYID(n) (n)
395 #else
396 #if (defined __STDC__ || defined __C99__FUNC__ \
397 || defined __cplusplus || defined _MSC_VER)
398 static int
399 YYID (int yyi)
400 #else
401 static int
402 YYID (yyi)
403 int yyi;
404 #endif
405 {
406 return yyi;
407 }
408 #endif
409
410 #if ! defined yyoverflow || YYERROR_VERBOSE
411
412 /* The parser invokes alloca or malloc; define the necessary symbols. */
413
414 # ifdef YYSTACK_USE_ALLOCA
415 # if YYSTACK_USE_ALLOCA
416 # ifdef __GNUC__
417 # define YYSTACK_ALLOC __builtin_alloca
418 # elif defined __BUILTIN_VA_ARG_INCR
419 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
420 # elif defined _AIX
421 # define YYSTACK_ALLOC __alloca
422 # elif defined _MSC_VER
423 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
424 # define alloca _alloca
425 # else
426 # define YYSTACK_ALLOC alloca
427 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
428 || defined __cplusplus || defined _MSC_VER)
429 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
430 # ifndef _STDLIB_H
431 # define _STDLIB_H 1
432 # endif
433 # endif
434 # endif
435 # endif
436 # endif
437
438 # ifdef YYSTACK_ALLOC
439 /* Pacify GCC's `empty if-body' warning. */
440 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
441 # ifndef YYSTACK_ALLOC_MAXIMUM
442 /* The OS might guarantee only one guard page at the bottom of the stack,
443 and a page size can be as small as 4096 bytes. So we cannot safely
444 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
445 to allow for a few compiler-allocated temporary stack slots. */
446 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
447 # endif
448 # else
449 # define YYSTACK_ALLOC YYMALLOC
450 # define YYSTACK_FREE YYFREE
451 # ifndef YYSTACK_ALLOC_MAXIMUM
452 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
453 # endif
454 # if (defined __cplusplus && ! defined _STDLIB_H \
455 && ! ((defined YYMALLOC || defined malloc) \
456 && (defined YYFREE || defined free)))
457 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
458 # ifndef _STDLIB_H
459 # define _STDLIB_H 1
460 # endif
461 # endif
462 # ifndef YYMALLOC
463 # define YYMALLOC malloc
464 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
465 || defined __cplusplus || defined _MSC_VER)
466 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
467 # endif
468 # endif
469 # ifndef YYFREE
470 # define YYFREE free
471 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
472 || defined __cplusplus || defined _MSC_VER)
473 void free (void *); /* INFRINGES ON USER NAME SPACE */
474 # endif
475 # endif
476 # endif
477 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
478
479
480 #if (! defined yyoverflow \
481 && (! defined __cplusplus \
482 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
483
484 /* A type that is properly aligned for any stack member. */
485 union yyalloc
486 {
487 yytype_int16 yyss_alloc;
488 YYSTYPE yyvs_alloc;
489 };
490
491 /* The size of the maximum gap between one aligned stack and the next. */
492 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
493
494 /* The size of an array large to enough to hold all stacks, each with
495 N elements. */
496 # define YYSTACK_BYTES(N) \
497 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
498 + YYSTACK_GAP_MAXIMUM)
499
500 /* Copy COUNT objects from FROM to TO. The source and destination do
501 not overlap. */
502 # ifndef YYCOPY
503 # if defined __GNUC__ && 1 < __GNUC__
504 # define YYCOPY(To, From, Count) \
505 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
506 # else
507 # define YYCOPY(To, From, Count) \
508 do \
509 { \
510 YYSIZE_T yyi; \
511 for (yyi = 0; yyi < (Count); yyi++) \
512 (To)[yyi] = (From)[yyi]; \
513 } \
514 while (YYID (0))
515 # endif
516 # endif
517
518 /* Relocate STACK from its old location to the new one. The
519 local variables YYSIZE and YYSTACKSIZE give the old and new number of
520 elements in the stack, and YYPTR gives the new location of the
521 stack. Advance YYPTR to a properly aligned location for the next
522 stack. */
523 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
524 do \
525 { \
526 YYSIZE_T yynewbytes; \
527 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
528 Stack = &yyptr->Stack_alloc; \
529 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
530 yyptr += yynewbytes / sizeof (*yyptr); \
531 } \
532 while (YYID (0))
533
534 #endif
535
536 /* YYFINAL -- State number of the termination state. */
537 #define YYFINAL 3
538 /* YYLAST -- Last index in YYTABLE. */
539 #define YYLAST 1030
540
541 /* YYNTOKENS -- Number of terminals. */
542 #define YYNTOKENS 67
543 /* YYNNTS -- Number of nonterminals. */
544 #define YYNNTS 95
545 /* YYNRULES -- Number of rules. */
546 #define YYNRULES 214
547 /* YYNRULES -- Number of states. */
548 #define YYNSTATES 373
549
550 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
551 #define YYUNDEFTOK 2
552 #define YYMAXUTOK 299
553
554 #define YYTRANSLATE(YYX) \
555 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
556
557 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
558 static const yytype_uint8 yytranslate[] =
559 {
560 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
561 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
562 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
563 2, 2, 2, 61, 2, 2, 2, 59, 54, 2,
564 65, 66, 57, 55, 47, 56, 64, 58, 2, 2,
565 2, 2, 2, 2, 2, 2, 2, 2, 50, 49,
566 2, 48, 2, 51, 2, 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, 62, 2, 63, 53, 2, 2, 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, 46, 52, 37, 60, 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, 2, 2, 2, 2,
583 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
584 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
585 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
586 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
587 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
588 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
589 35, 36, 38, 39, 40, 41, 42, 43, 44, 45
590 };
591
592 #if YYDEBUG
593 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
594 YYRHS. */
595 static const yytype_uint16 yyprhs[] =
596 {
597 0, 0, 3, 6, 8, 9, 10, 13, 22, 24,
598 26, 28, 32, 33, 35, 37, 39, 41, 43, 45,
599 47, 49, 51, 53, 55, 57, 59, 61, 63, 65,
600 67, 70, 71, 73, 77, 80, 84, 86, 90, 92,
601 96, 99, 102, 103, 105, 108, 109, 111, 114, 116,
602 119, 127, 133, 141, 147, 148, 149, 161, 162, 163,
603 176, 184, 193, 197, 201, 205, 211, 215, 221, 225,
604 231, 232, 234, 236, 239, 244, 248, 252, 256, 260,
605 265, 271, 274, 275, 277, 279, 281, 283, 287, 288,
606 290, 292, 296, 298, 300, 302, 306, 310, 312, 316,
607 320, 322, 328, 330, 336, 338, 342, 344, 348, 350,
608 354, 356, 360, 362, 366, 368, 372, 374, 378, 380,
609 384, 386, 390, 392, 396, 398, 402, 404, 408, 410,
610 414, 418, 422, 424, 428, 432, 434, 438, 440, 444,
611 448, 450, 454, 458, 462, 464, 467, 470, 473, 476,
612 479, 482, 485, 488, 491, 493, 496, 499, 501, 503,
613 505, 508, 510, 512, 517, 521, 525, 528, 531, 536,
614 540, 543, 547, 549, 553, 555, 557, 559, 561, 563,
615 567, 570, 574, 578, 584, 587, 592, 594, 597, 598,
616 600, 603, 607, 611, 617, 619, 621, 623, 624, 626,
617 628, 630, 632, 634, 636, 638, 640, 642, 644, 646,
618 648, 650, 652, 654, 656
619 };
620
621 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
622 static const yytype_int16 yyrhs[] =
623 {
624 68, 0, -1, 70, 69, -1, 34, -1, -1, -1,
625 70, 76, -1, 72, 155, 159, 75, 160, 46, 73,
626 37, -1, 36, -1, 70, -1, 38, -1, 74, 47,
627 38, -1, -1, 74, -1, 79, -1, 80, -1, 89,
628 -1, 71, -1, 90, -1, 91, -1, 92, -1, 97,
629 -1, 98, -1, 99, -1, 100, -1, 101, -1, 102,
630 -1, 108, -1, 109, -1, 76, -1, 77, 76, -1,
631 -1, 77, -1, 46, 77, 37, -1, 46, 37, -1,
632 26, 81, 158, -1, 83, -1, 81, 47, 83, -1,
633 84, -1, 82, 47, 84, -1, 38, 85, -1, 38,
634 87, -1, -1, 86, -1, 48, 118, -1, -1, 88,
635 -1, 48, 119, -1, 49, -1, 114, 158, -1, 11,
636 159, 113, 160, 76, 10, 76, -1, 11, 159, 113,
637 160, 76, -1, 9, 76, 28, 159, 113, 160, 158,
638 -1, 28, 159, 113, 160, 76, -1, -1, -1, 13,
639 159, 115, 93, 161, 112, 94, 161, 112, 160, 76,
640 -1, -1, -1, 13, 159, 26, 82, 95, 161, 112,
641 96, 161, 112, 160, 76, -1, 13, 159, 141, 14,
642 113, 160, 76, -1, 13, 159, 26, 84, 14, 113,
643 160, 76, -1, 6, 155, 158, -1, 3, 155, 158,
644 -1, 18, 112, 158, -1, 29, 159, 114, 160, 76,
645 -1, 38, 50, 76, -1, 19, 159, 114, 160, 103,
646 -1, 46, 104, 37, -1, 46, 104, 107, 104, 37,
647 -1, -1, 105, -1, 106, -1, 105, 106, -1, 4,
648 114, 50, 78, -1, 7, 50, 78, -1, 21, 114,
649 158, -1, 24, 79, 110, -1, 24, 79, 111, -1,
650 24, 79, 110, 111, -1, 5, 159, 38, 160, 79,
651 -1, 12, 79, -1, -1, 114, -1, 114, -1, 1,
652 -1, 118, -1, 114, 47, 118, -1, -1, 116, -1,
653 119, -1, 116, 47, 119, -1, 39, -1, 35, -1,
654 120, -1, 141, 48, 118, -1, 141, 117, 118, -1,
655 121, -1, 141, 48, 119, -1, 141, 117, 119, -1,
656 122, -1, 122, 51, 118, 50, 118, -1, 123, -1,
657 123, 51, 119, 50, 119, -1, 124, -1, 122, 31,
658 124, -1, 125, -1, 123, 31, 125, -1, 126, -1,
659 124, 30, 126, -1, 127, -1, 125, 30, 127, -1,
660 128, -1, 126, 52, 128, -1, 129, -1, 127, 52,
661 129, -1, 130, -1, 128, 53, 130, -1, 131, -1,
662 129, 53, 131, -1, 132, -1, 130, 54, 132, -1,
663 133, -1, 131, 54, 133, -1, 134, -1, 132, 40,
664 134, -1, 135, -1, 133, 40, 135, -1, 136, -1,
665 134, 42, 136, -1, 134, 15, 136, -1, 134, 14,
666 136, -1, 136, -1, 135, 42, 136, -1, 135, 15,
667 136, -1, 137, -1, 136, 41, 137, -1, 138, -1,
668 137, 55, 138, -1, 137, 56, 138, -1, 139, -1,
669 138, 57, 139, -1, 138, 58, 139, -1, 138, 59,
670 139, -1, 140, -1, 8, 139, -1, 27, 139, -1,
671 25, 139, -1, 32, 139, -1, 33, 139, -1, 55,
672 139, -1, 56, 139, -1, 60, 139, -1, 61, 139,
673 -1, 141, -1, 141, 32, -1, 141, 33, -1, 142,
674 -1, 144, -1, 143, -1, 16, 142, -1, 147, -1,
675 71, -1, 143, 62, 114, 63, -1, 143, 64, 38,
676 -1, 16, 143, 145, -1, 143, 145, -1, 144, 145,
677 -1, 144, 62, 114, 63, -1, 144, 64, 38, -1,
678 65, 66, -1, 65, 146, 66, -1, 118, -1, 146,
679 47, 118, -1, 20, -1, 38, -1, 156, -1, 148,
680 -1, 152, -1, 65, 114, 66, -1, 62, 63, -1,
681 62, 150, 63, -1, 62, 149, 63, -1, 62, 149,
682 47, 151, 63, -1, 151, 118, -1, 149, 47, 151,
683 118, -1, 47, -1, 150, 47, -1, -1, 150, -1,
684 46, 37, -1, 46, 153, 37, -1, 154, 50, 118,
685 -1, 153, 47, 154, 50, 118, -1, 38, -1, 44,
686 -1, 43, -1, -1, 38, -1, 17, -1, 157, -1,
687 43, -1, 44, -1, 58, -1, 35, -1, 22, -1,
688 23, -1, 49, -1, 1, -1, 65, -1, 1, -1,
689 66, -1, 1, -1, 49, -1, 1, -1
690 };
691
692 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
693 static const yytype_uint16 yyrline[] =
694 {
695 0, 256, 256, 260, 261, 265, 266, 271, 275, 279,
696 283, 284, 289, 290, 294, 295, 296, 297, 298, 299,
697 300, 301, 302, 303, 304, 305, 306, 307, 308, 312,
698 313, 318, 319, 323, 324, 328, 333, 334, 339, 341,
699 346, 351, 356, 357, 361, 366, 367, 371, 376, 380,
700 385, 387, 392, 394, 397, 399, 396, 403, 405, 402,
701 408, 410, 415, 420, 425, 430, 435, 440, 445, 447,
702 452, 453, 457, 458, 463, 468, 473, 478, 479, 480,
703 485, 490, 494, 495, 498, 499, 503, 504, 509, 510,
704 514, 516, 520, 521, 525, 526, 528, 533, 535, 537,
705 542, 543, 548, 550, 555, 556, 561, 563, 568, 569,
706 574, 576, 581, 582, 587, 589, 594, 595, 600, 602,
707 607, 608, 613, 615, 620, 621, 626, 627, 632, 633,
708 635, 637, 642, 643, 645, 650, 651, 656, 658, 660,
709 665, 666, 668, 670, 675, 676, 678, 679, 681, 682,
710 683, 684, 685, 686, 690, 692, 694, 700, 701, 705,
711 706, 710, 711, 712, 714, 716, 721, 723, 725, 727,
712 732, 733, 737, 738, 743, 744, 745, 746, 747, 748,
713 752, 753, 754, 755, 760, 762, 767, 768, 772, 773,
714 777, 778, 783, 785, 790, 791, 792, 796, 797, 801,
715 802, 803, 804, 805, 807, 812, 813, 816, 817, 820,
716 821, 824, 825, 828, 829
717 };
718 #endif
719
720 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
721 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
722 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
723 static const char *const yytname[] =
724 {
725 "$end", "error", "$undefined", "kBREAK", "kCASE", "kCATCH", "kCONTINUE",
726 "kDEFAULT", "kDELETE", "kDO", "kELSE", "kIF", "kFINALLY", "kFOR", "kIN",
727 "kINSTANCEOF", "kNEW", "kNULL", "kRETURN", "kSWITCH", "kTHIS", "kTHROW",
728 "kTRUE", "kFALSE", "kTRY", "kTYPEOF", "kVAR", "kVOID", "kWHILE", "kWITH",
729 "tANDAND", "tOROR", "tINC", "tDEC", "tHTMLCOMMENT", "kDIVEQ",
730 "kFUNCTION", "'}'", "tIdentifier", "tAssignOper", "tEqOper",
731 "tShiftOper", "tRelOper", "tNumericLiteral", "tStringLiteral",
732 "LOWER_THAN_ELSE", "'{'", "','", "'='", "';'", "':'", "'?'", "'|'",
733 "'^'", "'&'", "'+'", "'-'", "'*'", "'/'", "'%'", "'~'", "'!'", "'['",
734 "']'", "'.'", "'('", "')'", "$accept", "Program", "HtmlComment",
735 "SourceElements", "FunctionExpression", "KFunction", "FunctionBody",
736 "FormalParameterList", "FormalParameterList_opt", "Statement",
737 "StatementList", "StatementList_opt", "Block", "VariableStatement",
738 "VariableDeclarationList", "VariableDeclarationListNoIn",
739 "VariableDeclaration", "VariableDeclarationNoIn", "Initialiser_opt",
740 "Initialiser", "InitialiserNoIn_opt", "InitialiserNoIn",
741 "EmptyStatement", "ExpressionStatement", "IfStatement",
742 "IterationStatement", "$@1", "$@2", "$@3", "$@4", "ContinueStatement",
743 "BreakStatement", "ReturnStatement", "WithStatement",
744 "LabelledStatement", "SwitchStatement", "CaseBlock", "CaseClausules_opt",
745 "CaseClausules", "CaseClausule", "DefaultClausule", "ThrowStatement",
746 "TryStatement", "Catch", "Finally", "Expression_opt", "Expression_err",
747 "Expression", "ExpressionNoIn_opt", "ExpressionNoIn", "AssignOper",
748 "AssignmentExpression", "AssignmentExpressionNoIn",
749 "ConditionalExpression", "ConditionalExpressionNoIn",
750 "LogicalORExpression", "LogicalORExpressionNoIn", "LogicalANDExpression",
751 "LogicalANDExpressionNoIn", "BitwiseORExpression",
752 "BitwiseORExpressionNoIn", "BitwiseXORExpression",
753 "BitwiseXORExpressionNoIn", "BitwiseANDExpression",
754 "BitwiseANDExpressionNoIn", "EqualityExpression",
755 "EqualityExpressionNoIn", "RelationalExpression",
756 "RelationalExpressionNoIn", "ShiftExpression", "AdditiveExpression",
757 "MultiplicativeExpression", "UnaryExpression", "PostfixExpression",
758 "LeftHandSideExpression", "NewExpression", "MemberExpression",
759 "CallExpression", "Arguments", "ArgumentList", "PrimaryExpression",
760 "ArrayLiteral", "ElementList", "Elision", "Elision_opt", "ObjectLiteral",
761 "PropertyNameAndValueList", "PropertyName", "Identifier_opt", "Literal",
762 "BooleanLiteral", "semicolon_opt", "left_bracket", "right_bracket",
763 "semicolon", 0
764 };
765 #endif
766
767 # ifdef YYPRINT
768 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
769 token YYLEX-NUM. */
770 static const yytype_uint16 yytoknum[] =
771 {
772 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
773 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
774 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
775 285, 286, 287, 288, 289, 290, 291, 125, 292, 293,
776 294, 295, 296, 297, 298, 299, 123, 44, 61, 59,
777 58, 63, 124, 94, 38, 43, 45, 42, 47, 37,
778 126, 33, 91, 93, 46, 40, 41
779 };
780 # endif
781
782 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
783 static const yytype_uint8 yyr1[] =
784 {
785 0, 67, 68, 69, 69, 70, 70, 71, 72, 73,
786 74, 74, 75, 75, 76, 76, 76, 76, 76, 76,
787 76, 76, 76, 76, 76, 76, 76, 76, 76, 77,
788 77, 78, 78, 79, 79, 80, 81, 81, 82, 82,
789 83, 84, 85, 85, 86, 87, 87, 88, 89, 90,
790 91, 91, 92, 92, 93, 94, 92, 95, 96, 92,
791 92, 92, 97, 98, 99, 100, 101, 102, 103, 103,
792 104, 104, 105, 105, 106, 107, 108, 109, 109, 109,
793 110, 111, 112, 112, 113, 113, 114, 114, 115, 115,
794 116, 116, 117, 117, 118, 118, 118, 119, 119, 119,
795 120, 120, 121, 121, 122, 122, 123, 123, 124, 124,
796 125, 125, 126, 126, 127, 127, 128, 128, 129, 129,
797 130, 130, 131, 131, 132, 132, 133, 133, 134, 134,
798 134, 134, 135, 135, 135, 136, 136, 137, 137, 137,
799 138, 138, 138, 138, 139, 139, 139, 139, 139, 139,
800 139, 139, 139, 139, 140, 140, 140, 141, 141, 142,
801 142, 143, 143, 143, 143, 143, 144, 144, 144, 144,
802 145, 145, 146, 146, 147, 147, 147, 147, 147, 147,
803 148, 148, 148, 148, 149, 149, 150, 150, 151, 151,
804 152, 152, 153, 153, 154, 154, 154, 155, 155, 156,
805 156, 156, 156, 156, 156, 157, 157, 158, 158, 159,
806 159, 160, 160, 161, 161
807 };
808
809 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
810 static const yytype_uint8 yyr2[] =
811 {
812 0, 2, 2, 1, 0, 0, 2, 8, 1, 1,
813 1, 3, 0, 1, 1, 1, 1, 1, 1, 1,
814 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
815 2, 0, 1, 3, 2, 3, 1, 3, 1, 3,
816 2, 2, 0, 1, 2, 0, 1, 2, 1, 2,
817 7, 5, 7, 5, 0, 0, 11, 0, 0, 12,
818 7, 8, 3, 3, 3, 5, 3, 5, 3, 5,
819 0, 1, 1, 2, 4, 3, 3, 3, 3, 4,
820 5, 2, 0, 1, 1, 1, 1, 3, 0, 1,
821 1, 3, 1, 1, 1, 3, 3, 1, 3, 3,
822 1, 5, 1, 5, 1, 3, 1, 3, 1, 3,
823 1, 3, 1, 3, 1, 3, 1, 3, 1, 3,
824 1, 3, 1, 3, 1, 3, 1, 3, 1, 3,
825 3, 3, 1, 3, 3, 1, 3, 1, 3, 3,
826 1, 3, 3, 3, 1, 2, 2, 2, 2, 2,
827 2, 2, 2, 2, 1, 2, 2, 1, 1, 1,
828 2, 1, 1, 4, 3, 3, 2, 2, 4, 3,
829 2, 3, 1, 3, 1, 1, 1, 1, 1, 3,
830 2, 3, 3, 5, 2, 4, 1, 2, 0, 1,
831 2, 3, 3, 5, 1, 1, 1, 0, 1, 1,
832 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
833 1, 1, 1, 1, 1
834 };
835
836 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
837 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
838 means the default is an error. */
839 static const yytype_uint8 yydefact[] =
840 {
841 5, 0, 4, 1, 197, 197, 0, 0, 0, 0,
842 0, 199, 82, 0, 174, 0, 205, 206, 0, 0,
843 0, 0, 0, 0, 0, 0, 3, 204, 8, 175,
844 201, 202, 0, 48, 0, 0, 203, 0, 0, 188,
845 0, 2, 17, 197, 6, 14, 15, 16, 18, 19,
846 20, 21, 22, 23, 24, 25, 26, 27, 28, 0,
847 86, 94, 100, 104, 108, 112, 116, 120, 124, 128,
848 135, 137, 140, 144, 154, 157, 159, 158, 161, 177,
849 178, 176, 200, 198, 0, 0, 175, 0, 162, 145,
850 154, 0, 210, 209, 0, 88, 160, 159, 0, 83,
851 0, 0, 0, 0, 147, 42, 0, 36, 146, 0,
852 0, 148, 149, 0, 34, 175, 201, 202, 29, 0,
853 0, 0, 150, 151, 152, 153, 186, 180, 0, 189,
854 0, 0, 0, 208, 0, 207, 49, 0, 0, 0,
855 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
856 0, 0, 0, 155, 156, 93, 92, 0, 0, 0,
857 0, 0, 166, 0, 0, 167, 63, 62, 190, 194,
858 196, 195, 0, 85, 0, 84, 0, 54, 89, 90,
859 97, 102, 106, 110, 114, 118, 122, 126, 132, 154,
860 165, 64, 0, 76, 34, 0, 0, 77, 78, 0,
861 40, 43, 0, 35, 0, 0, 66, 33, 30, 191,
862 0, 0, 188, 182, 187, 181, 184, 179, 12, 87,
863 105, 0, 109, 113, 117, 121, 125, 131, 130, 129,
864 136, 138, 139, 141, 142, 143, 95, 96, 0, 164,
865 170, 172, 0, 0, 169, 0, 212, 211, 0, 45,
866 57, 38, 0, 0, 0, 0, 0, 0, 0, 0,
867 0, 0, 0, 0, 0, 0, 0, 0, 81, 79,
868 44, 37, 0, 0, 0, 192, 189, 0, 10, 13,
869 0, 0, 163, 0, 171, 168, 0, 51, 0, 41,
870 46, 0, 0, 0, 214, 213, 82, 91, 154, 107,
871 0, 111, 115, 119, 123, 127, 134, 133, 0, 98,
872 99, 70, 67, 0, 53, 65, 0, 183, 185, 0,
873 0, 101, 173, 0, 0, 47, 39, 82, 0, 55,
874 0, 0, 0, 0, 71, 72, 0, 193, 11, 5,
875 52, 50, 58, 0, 0, 103, 60, 0, 0, 68,
876 70, 73, 80, 9, 0, 0, 61, 82, 31, 31,
877 0, 7, 82, 0, 32, 74, 75, 69, 0, 0,
878 0, 56, 59
879 };
880
881 /* YYDEFGOTO[NTERM-NUM]. */
882 static const yytype_int16 yydefgoto[] =
883 {
884 -1, 1, 41, 2, 88, 43, 354, 279, 280, 118,
885 119, 365, 45, 46, 106, 250, 107, 251, 200, 201,
886 289, 290, 47, 48, 49, 50, 252, 344, 292, 355,
887 51, 52, 53, 54, 55, 56, 312, 333, 334, 335,
888 350, 57, 58, 197, 198, 98, 174, 59, 177, 178,
889 265, 60, 179, 61, 180, 62, 181, 63, 182, 64,
890 183, 65, 184, 66, 185, 67, 186, 68, 187, 69,
891 70, 71, 72, 73, 74, 75, 76, 77, 162, 242,
892 78, 79, 128, 129, 130, 80, 120, 121, 84, 81,
893 82, 136, 94, 248, 296
894 };
895
896 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
897 STATE-NUM. */
898 #define YYPACT_NINF -287
899 static const yytype_int16 yypact[] =
900 {
901 -287, 29, 490, -287, -18, -18, 934, 730, 21, 21,
902 965, -287, 934, 21, -287, 934, -287, -287, 36, 934,
903 89, 934, 21, 21, 934, 934, -287, -287, -287, 105,
904 -287, -287, 550, -287, 934, 934, -287, 934, 934, 61,
905 934, -287, 403, -18, -287, -287, -287, -287, -287, -287,
906 -287, -287, -287, -287, -287, -287, -287, -287, -287, 15,
907 -287, -287, 41, 106, 117, 129, 142, 158, 76, 162,
908 131, 47, -287, -287, 141, -287, 113, 148, -287, -287,
909 -287, -287, -287, -287, 5, 5, -287, 147, -287, -287,
910 169, 177, -287, -287, 370, 832, -287, 113, 5, 164,
911 934, 15, 610, 123, -287, 159, 16, -287, -287, 370,
912 934, -287, -287, 730, 438, 105, 175, 176, -287, 670,
913 86, 178, -287, -287, -287, -287, -287, -287, 62, 63,
914 934, 28, 21, -287, 934, -287, -287, 934, 934, 934,
915 934, 934, 934, 934, 934, 934, 934, 934, 934, 934,
916 934, 934, 934, -287, -287, -287, -287, 934, 934, 934,
917 181, 781, -287, 934, 189, -287, -287, -287, -287, -287,
918 -287, -287, 21, -287, 8, 164, 191, -287, 183, -287,
919 -287, 56, 201, 180, 182, 179, 194, 53, 162, 10,
920 -287, -287, 12, -287, -287, 21, 36, 225, -287, 934,
921 -287, -287, 89, -287, 8, 12, -287, -287, -287, -287,
922 94, 934, 193, -287, -287, -287, -287, -287, 200, -287,
923 106, 192, 117, 129, 142, 158, 76, 162, 162, 162,
924 131, 47, 47, -287, -287, -287, -287, -287, 68, -287,
925 -287, -287, 46, 109, -287, 370, -287, -287, 730, 195,
926 197, 227, 18, 934, 934, 934, 934, 934, 934, 934,
927 934, 934, 934, 370, 934, 934, 199, 209, -287, -287,
928 -287, -287, 730, 730, 202, -287, 204, 883, -287, 206,
929 8, 934, -287, 934, -287, -287, 8, 239, 934, -287,
930 -287, 191, 18, 370, -287, -287, 934, -287, 160, 201,
931 218, 180, 182, 179, 194, 53, 162, 162, 8, -287,
932 -287, 250, -287, 8, -287, -287, 934, -287, -287, 231,
933 228, -287, -287, 5, 730, -287, -287, 934, 8, -287,
934 934, 730, 934, 66, 250, -287, 36, -287, -287, -287,
935 -287, -287, -287, 730, 18, -287, -287, -32, 226, -287,
936 250, -287, -287, 730, 238, 18, -287, 934, 730, 730,
937 240, -287, 934, 8, 730, -287, -287, -287, 8, 730,
938 730, -287, -287
939 };
940
941 /* YYPGOTO[NTERM-NUM]. */
942 static const yytype_int16 yypgoto[] =
943 {
944 -287, -287, -287, -61, -2, -287, -287, -287, -287, 0,
945 -141, -80, -15, -287, -287, -287, 78, -10, -287, -287,
946 -287, -287, -287, -287, -287, -287, -287, -287, -287, -287,
947 -287, -287, -287, -287, -287, -287, -287, -68, -287, -50,
948 -287, -287, -287, -287, 88, -286, -105, 20, -287, -287,
949 212, -77, -209, -287, -287, -287, -287, 150, 34, 152,
950 33, 153, 35, 154, 38, 156, 40, 151, 42, -94,
951 157, 75, 64, -287, 2, 290, 291, -287, 19, -287,
952 -287, -287, -287, 93, 95, -287, -287, 96, 26, -287,
953 -287, -73, 25, 17, -278
954 };
955
956 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
957 positive, shift that token. If negative, reduce the rule which
958 number is the opposite. If zero, do what YYDEFACT says.
959 If YYTABLE_NINF, syntax error. */
960 #define YYTABLE_NINF -197
961 static const yytype_int16 yytable[] =
962 {
963 42, 188, 44, 103, 204, 42, 133, 91, 90, 246,
964 329, 166, 167, 246, 327, 134, 133, 133, 358, 294,
965 83, 90, 92, 90, 263, 191, 90, 90, 193, 3,
966 42, 85, 99, 203, 95, 101, 90, 90, 100, 90,
967 90, 342, 153, 154, 297, 155, 300, 109, 110, 156,
968 227, 228, 229, 216, 135, 309, 310, 219, 264, 134,
969 131, 221, 134, 202, 135, 135, 357, 295, 261, 132,
970 89, 363, 137, 348, 247, 134, 368, 362, 247, 325,
971 236, 237, 102, 104, 241, 108, 93, 254, 111, 112,
972 144, 145, 138, 283, 217, 262, 165, 189, 122, 123,
973 42, 124, 125, 349, 150, 151, 152, 255, 126, 212,
974 214, 42, 284, 206, 175, 134, 190, 42, 146, 208,
975 192, 345, 270, 209, 127, 213, 215, 105, 195, 175,
976 205, 282, 169, 210, 275, 196, 139, 170, 171, 90,
977 286, 90, 90, 90, 90, 90, 90, 90, 90, 90,
978 90, 90, 90, 90, 90, 113, 134, 218, 308, 188,
979 188, 188, 188, 188, 188, 188, 188, 306, 307, 140,
980 188, 188, 285, 153, 154, 159, 155, 160, 161, 238,
981 156, 268, 141, 243, 168, 169, 148, 149, 328, 157,
982 170, 171, 153, 154, 188, 155, 142, 245, 143, 156,
983 318, 153, 154, 147, 321, 172, 322, 199, 264, 266,
984 163, 134, 164, 161, 233, 234, 235, 364, 364, 239,
985 267, 272, 273, 231, 232, -196, -195, 244, 211, 249,
986 253, 256, 257, 259, 260, 258, 188, 196, 278, 337,
987 126, 293, 281, 288, 291, 311, 42, 313, 287, 324,
988 340, 214, 316, 319, 332, 298, 90, 298, 90, 90,
989 90, 90, 90, 90, 90, 175, 298, 298, 330, 338,
990 42, 42, 314, 315, 339, 361, 359, 367, 353, 366,
991 271, 326, 360, 175, 351, 269, 158, 220, 299, 301,
992 298, 222, 302, 223, 226, 224, 303, 320, 225, 304,
993 96, 97, 305, 323, 230, 276, 274, 277, 0, 0,
994 0, 0, 0, 175, 0, 0, 99, 0, 0, 0,
995 0, 352, 42, 0, 341, 331, 0, 0, 0, 42,
996 336, 346, 298, 0, 0, 0, 0, 0, 0, 0,
997 0, 42, 0, 356, 0, 343, 0, 99, 0, 0,
998 0, 42, 347, 44, 0, 0, 42, 42, 0, 0,
999 0, 0, 42, 0, 208, 0, 0, 42, 42, 371,
1000 372, 173, 0, 0, 0, 0, 0, 99, 6, 0,
1001 369, 0, 99, 0, 0, 370, 10, 11, 0, 0,
1002 14, 0, 16, 17, 0, 19, 0, 21, 0, 0,
1003 0, 0, 24, 25, -162, 27, 28, 0, 86, 0,
1004 0, 0, 0, 30, 31, 0, 87, -162, -162, 0,
1005 0, 0, 0, 0, 0, 34, 35, 0, 36, 0,
1006 37, 38, 39, -162, -162, 40, 0, 0, 0, -190,
1007 0, 0, -162, -162, -162, -162, 0, 0, 0, 0,
1008 -162, -162, -190, -190, -162, -162, -162, -162, 0, 0,
1009 -162, 0, -162, 0, 0, 0, 0, -162, -190, -190,
1010 0, 0, 0, 0, 0, 0, 0, -190, -190, -190,
1011 -190, 0, 0, 0, 0, -190, -190, 0, 0, -190,
1012 -190, -190, -190, 4, 0, -190, 5, -190, 6, 7,
1013 0, 8, -190, 9, 0, 0, 10, 11, 12, 13,
1014 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
1015 0, 0, 24, 25, 26, 27, 28, 0, 29, 0,
1016 0, 0, 0, 30, 31, 0, 32, 0, 0, 33,
1017 0, 0, 0, 0, 0, 34, 35, 0, 36, 0,
1018 37, 38, 39, 4, 0, 40, 5, 0, 6, 7,
1019 0, 8, 0, 9, 0, 0, 10, 11, 12, 13,
1020 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
1021 0, 0, 24, 25, 0, 27, 28, 114, 115, 0,
1022 0, 0, 0, 116, 117, 0, 32, 0, 0, 33,
1023 0, 0, 0, 0, 0, 34, 35, 0, 36, 0,
1024 37, 38, 39, 4, 0, 40, 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, 194, 29, 0,
1028 0, 0, 0, 30, 31, 0, 32, 0, 0, 33,
1029 0, 0, 0, 0, 0, 34, 35, 0, 36, 0,
1030 37, 38, 39, 4, 0, 40, 5, 0, 6, 7,
1031 0, 8, 0, 9, 0, 0, 10, 11, 12, 13,
1032 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
1033 0, 0, 24, 25, 0, 27, 28, 207, 29, 0,
1034 0, 0, 0, 30, 31, 0, 32, 0, 0, 33,
1035 0, 0, 0, 0, 0, 34, 35, 0, 36, 0,
1036 37, 38, 39, 4, 0, 40, 5, 0, 6, 7,
1037 0, 8, 0, 9, 0, 0, 10, 11, 12, 13,
1038 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
1039 0, 0, 24, 25, 0, 27, 28, 0, 29, 0,
1040 0, 0, 0, 30, 31, 0, 32, 0, 0, 33,
1041 0, 0, 0, 0, 0, 34, 35, 0, 36, 6,
1042 37, 38, 39, 0, 0, 40, 0, 10, 11, 0,
1043 0, 14, 0, 16, 17, 0, 19, 0, 21, 0,
1044 0, 0, 0, 24, 25, 0, 27, 28, 0, 86,
1045 0, 0, 0, 0, 30, 31, 0, 87, 0, 0,
1046 0, 0, 0, 0, 0, 0, 34, 35, 0, 36,
1047 6, 37, 38, 39, 0, 0, 40, 240, 10, 11,
1048 0, 0, 14, 0, 16, 17, 0, 19, 176, 21,
1049 0, 0, 0, 0, 24, 25, 0, 27, 28, 0,
1050 86, 0, 0, 0, 0, 30, 31, 0, 87, 0,
1051 0, 0, 0, 0, 0, 0, 0, 34, 35, 0,
1052 36, 6, 37, 38, 39, 0, 0, 40, 0, 10,
1053 11, 0, 0, 14, 0, 16, 17, 0, 19, 0,
1054 21, 0, 0, 0, 0, 24, 25, 0, 27, 28,
1055 0, 86, 0, 0, 0, 0, 30, 31, 0, 87,
1056 0, 0, 0, 0, 0, 0, 0, 0, 34, 35,
1057 0, 36, 6, 37, 38, 39, 317, 0, 40, 0,
1058 10, 11, 0, 0, 14, 0, 16, 17, 0, 19,
1059 0, 21, 0, 0, 0, 0, 24, 25, 0, 27,
1060 28, 0, 86, 0, 0, 0, 0, 30, 31, 0,
1061 87, 10, 11, 0, 0, 14, 0, 16, 17, 34,
1062 35, 0, 36, 0, 37, 38, 39, 0, 0, 40,
1063 27, 28, 0, 86, 0, 0, 0, 0, 30, 31,
1064 0, 87, 0, 0, 0, 0, 0, 0, 0, 0,
1065 0, 0, 0, 36, 0, 0, 0, 39, 0, 0,
1066 40
1067 };
1068
1069 static const yytype_int16 yycheck[] =
1070 {
1071 2, 95, 2, 18, 109, 7, 1, 7, 6, 1,
1072 296, 84, 85, 1, 292, 47, 1, 1, 50, 1,
1073 38, 19, 1, 21, 14, 98, 24, 25, 101, 0,
1074 32, 5, 12, 106, 9, 15, 34, 35, 13, 37,
1075 38, 327, 32, 33, 253, 35, 255, 22, 23, 39,
1076 144, 145, 146, 130, 49, 264, 265, 134, 48, 47,
1077 40, 138, 47, 47, 49, 49, 344, 49, 15, 43,
1078 6, 357, 31, 7, 66, 47, 362, 355, 66, 288,
1079 157, 158, 46, 19, 161, 21, 65, 31, 24, 25,
1080 14, 15, 51, 47, 66, 42, 77, 95, 34, 35,
1081 102, 37, 38, 37, 57, 58, 59, 51, 47, 47,
1082 47, 113, 66, 113, 94, 47, 97, 119, 42, 119,
1083 100, 330, 199, 37, 63, 63, 63, 38, 5, 109,
1084 110, 63, 38, 47, 211, 12, 30, 43, 44, 137,
1085 245, 139, 140, 141, 142, 143, 144, 145, 146, 147,
1086 148, 149, 150, 151, 152, 50, 47, 132, 263, 253,
1087 254, 255, 256, 257, 258, 259, 260, 261, 262, 52,
1088 264, 265, 63, 32, 33, 62, 35, 64, 65, 159,
1089 39, 196, 53, 163, 37, 38, 55, 56, 293, 48,
1090 43, 44, 32, 33, 288, 35, 54, 172, 40, 39,
1091 277, 32, 33, 41, 281, 28, 283, 48, 48, 192,
1092 62, 47, 64, 65, 150, 151, 152, 358, 359, 38,
1093 195, 204, 205, 148, 149, 50, 50, 38, 50, 38,
1094 47, 30, 52, 54, 40, 53, 330, 12, 38, 316,
1095 47, 14, 50, 48, 47, 46, 248, 38, 248, 10,
1096 323, 47, 50, 47, 4, 253, 254, 255, 256, 257,
1097 258, 259, 260, 261, 262, 245, 264, 265, 50, 38,
1098 272, 273, 272, 273, 46, 37, 50, 37, 339, 359,
1099 202, 291, 350, 263, 334, 197, 74, 137, 254, 256,
1100 288, 139, 257, 140, 143, 141, 258, 280, 142, 259,
1101 10, 10, 260, 286, 147, 212, 210, 212, -1, -1,
1102 -1, -1, -1, 293, -1, -1, 296, -1, -1, -1,
1103 -1, 336, 324, -1, 324, 308, -1, -1, -1, 331,
1104 313, 331, 330, -1, -1, -1, -1, -1, -1, -1,
1105 -1, 343, -1, 343, -1, 328, -1, 327, -1, -1,
1106 -1, 353, 332, 353, -1, -1, 358, 359, -1, -1,
1107 -1, -1, 364, -1, 364, -1, -1, 369, 370, 369,
1108 370, 1, -1, -1, -1, -1, -1, 357, 8, -1,
1109 363, -1, 362, -1, -1, 368, 16, 17, -1, -1,
1110 20, -1, 22, 23, -1, 25, -1, 27, -1, -1,
1111 -1, -1, 32, 33, 1, 35, 36, -1, 38, -1,
1112 -1, -1, -1, 43, 44, -1, 46, 14, 15, -1,
1113 -1, -1, -1, -1, -1, 55, 56, -1, 58, -1,
1114 60, 61, 62, 30, 31, 65, -1, -1, -1, 1,
1115 -1, -1, 39, 40, 41, 42, -1, -1, -1, -1,
1116 47, 48, 14, 15, 51, 52, 53, 54, -1, -1,
1117 57, -1, 59, -1, -1, -1, -1, 64, 30, 31,
1118 -1, -1, -1, -1, -1, -1, -1, 39, 40, 41,
1119 42, -1, -1, -1, -1, 47, 48, -1, -1, 51,
1120 52, 53, 54, 3, -1, 57, 6, 59, 8, 9,
1121 -1, 11, 64, 13, -1, -1, 16, 17, 18, 19,
1122 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
1123 -1, -1, 32, 33, 34, 35, 36, -1, 38, -1,
1124 -1, -1, -1, 43, 44, -1, 46, -1, -1, 49,
1125 -1, -1, -1, -1, -1, 55, 56, -1, 58, -1,
1126 60, 61, 62, 3, -1, 65, 6, -1, 8, 9,
1127 -1, 11, -1, 13, -1, -1, 16, 17, 18, 19,
1128 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
1129 -1, -1, 32, 33, -1, 35, 36, 37, 38, -1,
1130 -1, -1, -1, 43, 44, -1, 46, -1, -1, 49,
1131 -1, -1, -1, -1, -1, 55, 56, -1, 58, -1,
1132 60, 61, 62, 3, -1, 65, 6, -1, 8, 9,
1133 -1, 11, -1, 13, -1, -1, 16, 17, 18, 19,
1134 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
1135 -1, -1, 32, 33, -1, 35, 36, 37, 38, -1,
1136 -1, -1, -1, 43, 44, -1, 46, -1, -1, 49,
1137 -1, -1, -1, -1, -1, 55, 56, -1, 58, -1,
1138 60, 61, 62, 3, -1, 65, 6, -1, 8, 9,
1139 -1, 11, -1, 13, -1, -1, 16, 17, 18, 19,
1140 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
1141 -1, -1, 32, 33, -1, 35, 36, 37, 38, -1,
1142 -1, -1, -1, 43, 44, -1, 46, -1, -1, 49,
1143 -1, -1, -1, -1, -1, 55, 56, -1, 58, -1,
1144 60, 61, 62, 3, -1, 65, 6, -1, 8, 9,
1145 -1, 11, -1, 13, -1, -1, 16, 17, 18, 19,
1146 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
1147 -1, -1, 32, 33, -1, 35, 36, -1, 38, -1,
1148 -1, -1, -1, 43, 44, -1, 46, -1, -1, 49,
1149 -1, -1, -1, -1, -1, 55, 56, -1, 58, 8,
1150 60, 61, 62, -1, -1, 65, -1, 16, 17, -1,
1151 -1, 20, -1, 22, 23, -1, 25, -1, 27, -1,
1152 -1, -1, -1, 32, 33, -1, 35, 36, -1, 38,
1153 -1, -1, -1, -1, 43, 44, -1, 46, -1, -1,
1154 -1, -1, -1, -1, -1, -1, 55, 56, -1, 58,
1155 8, 60, 61, 62, -1, -1, 65, 66, 16, 17,
1156 -1, -1, 20, -1, 22, 23, -1, 25, 26, 27,
1157 -1, -1, -1, -1, 32, 33, -1, 35, 36, -1,
1158 38, -1, -1, -1, -1, 43, 44, -1, 46, -1,
1159 -1, -1, -1, -1, -1, -1, -1, 55, 56, -1,
1160 58, 8, 60, 61, 62, -1, -1, 65, -1, 16,
1161 17, -1, -1, 20, -1, 22, 23, -1, 25, -1,
1162 27, -1, -1, -1, -1, 32, 33, -1, 35, 36,
1163 -1, 38, -1, -1, -1, -1, 43, 44, -1, 46,
1164 -1, -1, -1, -1, -1, -1, -1, -1, 55, 56,
1165 -1, 58, 8, 60, 61, 62, 63, -1, 65, -1,
1166 16, 17, -1, -1, 20, -1, 22, 23, -1, 25,
1167 -1, 27, -1, -1, -1, -1, 32, 33, -1, 35,
1168 36, -1, 38, -1, -1, -1, -1, 43, 44, -1,
1169 46, 16, 17, -1, -1, 20, -1, 22, 23, 55,
1170 56, -1, 58, -1, 60, 61, 62, -1, -1, 65,
1171 35, 36, -1, 38, -1, -1, -1, -1, 43, 44,
1172 -1, 46, -1, -1, -1, -1, -1, -1, -1, -1,
1173 -1, -1, -1, 58, -1, -1, -1, 62, -1, -1,
1174 65
1175 };
1176
1177 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
1178 symbol of state STATE-NUM. */
1179 static const yytype_uint8 yystos[] =
1180 {
1181 0, 68, 70, 0, 3, 6, 8, 9, 11, 13,
1182 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
1183 26, 27, 28, 29, 32, 33, 34, 35, 36, 38,
1184 43, 44, 46, 49, 55, 56, 58, 60, 61, 62,
1185 65, 69, 71, 72, 76, 79, 80, 89, 90, 91,
1186 92, 97, 98, 99, 100, 101, 102, 108, 109, 114,
1187 118, 120, 122, 124, 126, 128, 130, 132, 134, 136,
1188 137, 138, 139, 140, 141, 142, 143, 144, 147, 148,
1189 152, 156, 157, 38, 155, 155, 38, 46, 71, 139,
1190 141, 76, 1, 65, 159, 159, 142, 143, 112, 114,
1191 159, 114, 46, 79, 139, 38, 81, 83, 139, 159,
1192 159, 139, 139, 50, 37, 38, 43, 44, 76, 77,
1193 153, 154, 139, 139, 139, 139, 47, 63, 149, 150,
1194 151, 114, 155, 1, 47, 49, 158, 31, 51, 30,
1195 52, 53, 54, 40, 14, 15, 42, 41, 55, 56,
1196 57, 58, 59, 32, 33, 35, 39, 48, 117, 62,
1197 64, 65, 145, 62, 64, 145, 158, 158, 37, 38,
1198 43, 44, 28, 1, 113, 114, 26, 115, 116, 119,
1199 121, 123, 125, 127, 129, 131, 133, 135, 136, 141,
1200 145, 158, 114, 158, 37, 5, 12, 110, 111, 48,
1201 85, 86, 47, 158, 113, 114, 76, 37, 76, 37,
1202 47, 50, 47, 63, 47, 63, 118, 66, 159, 118,
1203 124, 118, 126, 128, 130, 132, 134, 136, 136, 136,
1204 137, 138, 138, 139, 139, 139, 118, 118, 114, 38,
1205 66, 118, 146, 114, 38, 159, 1, 66, 160, 38,
1206 82, 84, 93, 47, 31, 51, 30, 52, 53, 54,
1207 40, 15, 42, 14, 48, 117, 160, 159, 79, 111,
1208 118, 83, 160, 160, 154, 118, 150, 151, 38, 74,
1209 75, 50, 63, 47, 66, 63, 113, 76, 48, 87,
1210 88, 47, 95, 14, 1, 49, 161, 119, 141, 125,
1211 119, 127, 129, 131, 133, 135, 136, 136, 113, 119,
1212 119, 46, 103, 38, 76, 76, 50, 63, 118, 47,
1213 160, 118, 118, 160, 10, 119, 84, 161, 113, 112,
1214 50, 160, 4, 104, 105, 106, 160, 118, 38, 46,
1215 158, 76, 112, 160, 94, 119, 76, 114, 7, 37,
1216 107, 106, 79, 70, 73, 96, 76, 161, 50, 50,
1217 104, 37, 161, 112, 77, 78, 78, 37, 112, 160,
1218 160, 76, 76
1219 };
1220
1221 #define yyerrok (yyerrstatus = 0)
1222 #define yyclearin (yychar = YYEMPTY)
1223 #define YYEMPTY (-2)
1224 #define YYEOF 0
1225
1226 #define YYACCEPT goto yyacceptlab
1227 #define YYABORT goto yyabortlab
1228 #define YYERROR goto yyerrorlab
1229
1230
1231 /* Like YYERROR except do call yyerror. This remains here temporarily
1232 to ease the transition to the new meaning of YYERROR, for GCC.
1233 Once GCC version 2 has supplanted version 1, this can go. */
1234
1235 #define YYFAIL goto yyerrlab
1236
1237 #define YYRECOVERING() (!!yyerrstatus)
1238
1239 #define YYBACKUP(Token, Value) \
1240 do \
1241 if (yychar == YYEMPTY && yylen == 1) \
1242 { \
1243 yychar = (Token); \
1244 yylval = (Value); \
1245 yytoken = YYTRANSLATE (yychar); \
1246 YYPOPSTACK (1); \
1247 goto yybackup; \
1248 } \
1249 else \
1250 { \
1251 yyerror (YY_("syntax error: cannot back up")); \
1252 YYERROR; \
1253 } \
1254 while (YYID (0))
1255
1256
1257 #define YYTERROR 1
1258 #define YYERRCODE 256
1259
1260
1261 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
1262 If N is 0, then set CURRENT to the empty location which ends
1263 the previous symbol: RHS[0] (always defined). */
1264
1265 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
1266 #ifndef YYLLOC_DEFAULT
1267 # define YYLLOC_DEFAULT(Current, Rhs, N) \
1268 do \
1269 if (YYID (N)) \
1270 { \
1271 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
1272 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
1273 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
1274 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
1275 } \
1276 else \
1277 { \
1278 (Current).first_line = (Current).last_line = \
1279 YYRHSLOC (Rhs, 0).last_line; \
1280 (Current).first_column = (Current).last_column = \
1281 YYRHSLOC (Rhs, 0).last_column; \
1282 } \
1283 while (YYID (0))
1284 #endif
1285
1286
1287 /* YY_LOCATION_PRINT -- Print the location on the stream.
1288 This macro was not mandated originally: define only if we know
1289 we won't break user code: when these are the locations we know. */
1290
1291 #ifndef YY_LOCATION_PRINT
1292 # if YYLTYPE_IS_TRIVIAL
1293 # define YY_LOCATION_PRINT(File, Loc) \
1294 fprintf (File, "%d.%d-%d.%d", \
1295 (Loc).first_line, (Loc).first_column, \
1296 (Loc).last_line, (Loc).last_column)
1297 # else
1298 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
1299 # endif
1300 #endif
1301
1302
1303 /* YYLEX -- calling `yylex' with the right arguments. */
1304
1305 #ifdef YYLEX_PARAM
1306 # define YYLEX yylex (&yylval, YYLEX_PARAM)
1307 #else
1308 # define YYLEX yylex (&yylval)
1309 #endif
1310
1311 /* Enable debugging if requested. */
1312 #if YYDEBUG
1313
1314 # ifndef YYFPRINTF
1315 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1316 # define YYFPRINTF fprintf
1317 # endif
1318
1319 # define YYDPRINTF(Args) \
1320 do { \
1321 if (yydebug) \
1322 YYFPRINTF Args; \
1323 } while (YYID (0))
1324
1325 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
1326 do { \
1327 if (yydebug) \
1328 { \
1329 YYFPRINTF (stderr, "%s ", Title); \
1330 yy_symbol_print (stderr, \
1331 Type, Value); \
1332 YYFPRINTF (stderr, "\n"); \
1333 } \
1334 } while (YYID (0))
1335
1336
1337 /*--------------------------------.
1338 | Print this symbol on YYOUTPUT. |
1339 `--------------------------------*/
1340
1341 /*ARGSUSED*/
1342 #if (defined __STDC__ || defined __C99__FUNC__ \
1343 || defined __cplusplus || defined _MSC_VER)
1344 static void
1345 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
1346 #else
1347 static void
1348 yy_symbol_value_print (yyoutput, yytype, yyvaluep)
1349 FILE *yyoutput;
1350 int yytype;
1351 YYSTYPE const * const yyvaluep;
1352 #endif
1353 {
1354 if (!yyvaluep)
1355 return;
1356 # ifdef YYPRINT
1357 if (yytype < YYNTOKENS)
1358 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
1359 # else
1360 YYUSE (yyoutput);
1361 # endif
1362 switch (yytype)
1363 {
1364 default:
1365 break;
1366 }
1367 }
1368
1369
1370 /*--------------------------------.
1371 | Print this symbol on YYOUTPUT. |
1372 `--------------------------------*/
1373
1374 #if (defined __STDC__ || defined __C99__FUNC__ \
1375 || defined __cplusplus || defined _MSC_VER)
1376 static void
1377 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
1378 #else
1379 static void
1380 yy_symbol_print (yyoutput, yytype, yyvaluep)
1381 FILE *yyoutput;
1382 int yytype;
1383 YYSTYPE const * const yyvaluep;
1384 #endif
1385 {
1386 if (yytype < YYNTOKENS)
1387 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
1388 else
1389 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
1390
1391 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
1392 YYFPRINTF (yyoutput, ")");
1393 }
1394
1395 /*------------------------------------------------------------------.
1396 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1397 | TOP (included). |
1398 `------------------------------------------------------------------*/
1399
1400 #if (defined __STDC__ || defined __C99__FUNC__ \
1401 || defined __cplusplus || defined _MSC_VER)
1402 static void
1403 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
1404 #else
1405 static void
1406 yy_stack_print (yybottom, yytop)
1407 yytype_int16 *yybottom;
1408 yytype_int16 *yytop;
1409 #endif
1410 {
1411 YYFPRINTF (stderr, "Stack now");
1412 for (; yybottom <= yytop; yybottom++)
1413 {
1414 int yybot = *yybottom;
1415 YYFPRINTF (stderr, " %d", yybot);
1416 }
1417 YYFPRINTF (stderr, "\n");
1418 }
1419
1420 # define YY_STACK_PRINT(Bottom, Top) \
1421 do { \
1422 if (yydebug) \
1423 yy_stack_print ((Bottom), (Top)); \
1424 } while (YYID (0))
1425
1426
1427 /*------------------------------------------------.
1428 | Report that the YYRULE is going to be reduced. |
1429 `------------------------------------------------*/
1430
1431 #if (defined __STDC__ || defined __C99__FUNC__ \
1432 || defined __cplusplus || defined _MSC_VER)
1433 static void
1434 yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
1435 #else
1436 static void
1437 yy_reduce_print (yyvsp, yyrule)
1438 YYSTYPE *yyvsp;
1439 int yyrule;
1440 #endif
1441 {
1442 int yynrhs = yyr2[yyrule];
1443 int yyi;
1444 unsigned long int yylno = yyrline[yyrule];
1445 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
1446 yyrule - 1, yylno);
1447 /* The symbols being reduced. */
1448 for (yyi = 0; yyi < yynrhs; yyi++)
1449 {
1450 YYFPRINTF (stderr, " $%d = ", yyi + 1);
1451 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
1452 &(yyvsp[(yyi + 1) - (yynrhs)])
1453 );
1454 YYFPRINTF (stderr, "\n");
1455 }
1456 }
1457
1458 # define YY_REDUCE_PRINT(Rule) \
1459 do { \
1460 if (yydebug) \
1461 yy_reduce_print (yyvsp, Rule); \
1462 } while (YYID (0))
1463
1464 /* Nonzero means print parse trace. It is left uninitialized so that
1465 multiple parsers can coexist. */
1466 int yydebug;
1467 #else /* !YYDEBUG */
1468 # define YYDPRINTF(Args)
1469 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1470 # define YY_STACK_PRINT(Bottom, Top)
1471 # define YY_REDUCE_PRINT(Rule)
1472 #endif /* !YYDEBUG */
1473
1474
1475 /* YYINITDEPTH -- initial size of the parser's stacks. */
1476 #ifndef YYINITDEPTH
1477 # define YYINITDEPTH 200
1478 #endif
1479
1480 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1481 if the built-in stack extension method is used).
1482
1483 Do not make this value too large; the results are undefined if
1484 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1485 evaluated with infinite-precision integer arithmetic. */
1486
1487 #ifndef YYMAXDEPTH
1488 # define YYMAXDEPTH 10000
1489 #endif
1490
1491 \f
1492
1493 #if YYERROR_VERBOSE
1494
1495 # ifndef yystrlen
1496 # if defined __GLIBC__ && defined _STRING_H
1497 # define yystrlen strlen
1498 # else
1499 /* Return the length of YYSTR. */
1500 #if (defined __STDC__ || defined __C99__FUNC__ \
1501 || defined __cplusplus || defined _MSC_VER)
1502 static YYSIZE_T
1503 yystrlen (const char *yystr)
1504 #else
1505 static YYSIZE_T
1506 yystrlen (yystr)
1507 const char *yystr;
1508 #endif
1509 {
1510 YYSIZE_T yylen;
1511 for (yylen = 0; yystr[yylen]; yylen++)
1512 continue;
1513 return yylen;
1514 }
1515 # endif
1516 # endif
1517
1518 # ifndef yystpcpy
1519 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1520 # define yystpcpy stpcpy
1521 # else
1522 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1523 YYDEST. */
1524 #if (defined __STDC__ || defined __C99__FUNC__ \
1525 || defined __cplusplus || defined _MSC_VER)
1526 static char *
1527 yystpcpy (char *yydest, const char *yysrc)
1528 #else
1529 static char *
1530 yystpcpy (yydest, yysrc)
1531 char *yydest;
1532 const char *yysrc;
1533 #endif
1534 {
1535 char *yyd = yydest;
1536 const char *yys = yysrc;
1537
1538 while ((*yyd++ = *yys++) != '\0')
1539 continue;
1540
1541 return yyd - 1;
1542 }
1543 # endif
1544 # endif
1545
1546 # ifndef yytnamerr
1547 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1548 quotes and backslashes, so that it's suitable for yyerror. The
1549 heuristic is that double-quoting is unnecessary unless the string
1550 contains an apostrophe, a comma, or backslash (other than
1551 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1552 null, do not copy; instead, return the length of what the result
1553 would have been. */
1554 static YYSIZE_T
1555 yytnamerr (char *yyres, const char *yystr)
1556 {
1557 if (*yystr == '"')
1558 {
1559 YYSIZE_T yyn = 0;
1560 char const *yyp = yystr;
1561
1562 for (;;)
1563 switch (*++yyp)
1564 {
1565 case '\'':
1566 case ',':
1567 goto do_not_strip_quotes;
1568
1569 case '\\':
1570 if (*++yyp != '\\')
1571 goto do_not_strip_quotes;
1572 /* Fall through. */
1573 default:
1574 if (yyres)
1575 yyres[yyn] = *yyp;
1576 yyn++;
1577 break;
1578
1579 case '"':
1580 if (yyres)
1581 yyres[yyn] = '\0';
1582 return yyn;
1583 }
1584 do_not_strip_quotes: ;
1585 }
1586
1587 if (! yyres)
1588 return yystrlen (yystr);
1589
1590 return yystpcpy (yyres, yystr) - yyres;
1591 }
1592 # endif
1593
1594 /* Copy into YYRESULT an error message about the unexpected token
1595 YYCHAR while in state YYSTATE. Return the number of bytes copied,
1596 including the terminating null byte. If YYRESULT is null, do not
1597 copy anything; just return the number of bytes that would be
1598 copied. As a special case, return 0 if an ordinary "syntax error"
1599 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
1600 size calculation. */
1601 static YYSIZE_T
1602 yysyntax_error (char *yyresult, int yystate, int yychar)
1603 {
1604 int yyn = yypact[yystate];
1605
1606 if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
1607 return 0;
1608 else
1609 {
1610 int yytype = YYTRANSLATE (yychar);
1611 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
1612 YYSIZE_T yysize = yysize0;
1613 YYSIZE_T yysize1;
1614 int yysize_overflow = 0;
1615 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1616 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1617 int yyx;
1618
1619 # if 0
1620 /* This is so xgettext sees the translatable formats that are
1621 constructed on the fly. */
1622 YY_("syntax error, unexpected %s");
1623 YY_("syntax error, unexpected %s, expecting %s");
1624 YY_("syntax error, unexpected %s, expecting %s or %s");
1625 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
1626 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
1627 # endif
1628 char *yyfmt;
1629 char const *yyf;
1630 static char const yyunexpected[] = "syntax error, unexpected %s";
1631 static char const yyexpecting[] = ", expecting %s";
1632 static char const yyor[] = " or %s";
1633 char yyformat[sizeof yyunexpected
1634 + sizeof yyexpecting - 1
1635 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
1636 * (sizeof yyor - 1))];
1637 char const *yyprefix = yyexpecting;
1638
1639 /* Start YYX at -YYN if negative to avoid negative indexes in
1640 YYCHECK. */
1641 int yyxbegin = yyn < 0 ? -yyn : 0;
1642
1643 /* Stay within bounds of both yycheck and yytname. */
1644 int yychecklim = YYLAST - yyn + 1;
1645 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1646 int yycount = 1;
1647
1648 yyarg[0] = yytname[yytype];
1649 yyfmt = yystpcpy (yyformat, yyunexpected);
1650
1651 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1652 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1653 {
1654 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1655 {
1656 yycount = 1;
1657 yysize = yysize0;
1658 yyformat[sizeof yyunexpected - 1] = '\0';
1659 break;
1660 }
1661 yyarg[yycount++] = yytname[yyx];
1662 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
1663 yysize_overflow |= (yysize1 < yysize);
1664 yysize = yysize1;
1665 yyfmt = yystpcpy (yyfmt, yyprefix);
1666 yyprefix = yyor;
1667 }
1668
1669 yyf = YY_(yyformat);
1670 yysize1 = yysize + yystrlen (yyf);
1671 yysize_overflow |= (yysize1 < yysize);
1672 yysize = yysize1;
1673
1674 if (yysize_overflow)
1675 return YYSIZE_MAXIMUM;
1676
1677 if (yyresult)
1678 {
1679 /* Avoid sprintf, as that infringes on the user's name space.
1680 Don't have undefined behavior even if the translation
1681 produced a string with the wrong number of "%s"s. */
1682 char *yyp = yyresult;
1683 int yyi = 0;
1684 while ((*yyp = *yyf) != '\0')
1685 {
1686 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
1687 {
1688 yyp += yytnamerr (yyp, yyarg[yyi++]);
1689 yyf += 2;
1690 }
1691 else
1692 {
1693 yyp++;
1694 yyf++;
1695 }
1696 }
1697 }
1698 return yysize;
1699 }
1700 }
1701 #endif /* YYERROR_VERBOSE */
1702 \f
1703
1704 /*-----------------------------------------------.
1705 | Release the memory associated to this symbol. |
1706 `-----------------------------------------------*/
1707
1708 /*ARGSUSED*/
1709 #if (defined __STDC__ || defined __C99__FUNC__ \
1710 || defined __cplusplus || defined _MSC_VER)
1711 static void
1712 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
1713 #else
1714 static void
1715 yydestruct (yymsg, yytype, yyvaluep)
1716 const char *yymsg;
1717 int yytype;
1718 YYSTYPE *yyvaluep;
1719 #endif
1720 {
1721 YYUSE (yyvaluep);
1722
1723 if (!yymsg)
1724 yymsg = "Deleting";
1725 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1726
1727 switch (yytype)
1728 {
1729
1730 default:
1731 break;
1732 }
1733 }
1734
1735 /* Prevent warnings from -Wmissing-prototypes. */
1736 #ifdef YYPARSE_PARAM
1737 #if defined __STDC__ || defined __cplusplus
1738 int yyparse (void *YYPARSE_PARAM);
1739 #else
1740 int yyparse ();
1741 #endif
1742 #else /* ! YYPARSE_PARAM */
1743 #if defined __STDC__ || defined __cplusplus
1744 int yyparse (void);
1745 #else
1746 int yyparse ();
1747 #endif
1748 #endif /* ! YYPARSE_PARAM */
1749
1750
1751
1752
1753
1754 /*-------------------------.
1755 | yyparse or yypush_parse. |
1756 `-------------------------*/
1757
1758 #ifdef YYPARSE_PARAM
1759 #if (defined __STDC__ || defined __C99__FUNC__ \
1760 || defined __cplusplus || defined _MSC_VER)
1761 int
1762 yyparse (void *YYPARSE_PARAM)
1763 #else
1764 int
1765 yyparse (YYPARSE_PARAM)
1766 void *YYPARSE_PARAM;
1767 #endif
1768 #else /* ! YYPARSE_PARAM */
1769 #if (defined __STDC__ || defined __C99__FUNC__ \
1770 || defined __cplusplus || defined _MSC_VER)
1771 int
1772 yyparse (void)
1773 #else
1774 int
1775 yyparse ()
1776
1777 #endif
1778 #endif
1779 {
1780 /* The lookahead symbol. */
1781 int yychar;
1782
1783 /* The semantic value of the lookahead symbol. */
1784 YYSTYPE yylval;
1785
1786 /* Number of syntax errors so far. */
1787 int yynerrs;
1788
1789 int yystate;
1790 /* Number of tokens to shift before error messages enabled. */
1791 int yyerrstatus;
1792
1793 /* The stacks and their tools:
1794 `yyss': related to states.
1795 `yyvs': related to semantic values.
1796
1797 Refer to the stacks thru separate pointers, to allow yyoverflow
1798 to reallocate them elsewhere. */
1799
1800 /* The state stack. */
1801 yytype_int16 yyssa[YYINITDEPTH];
1802 yytype_int16 *yyss;
1803 yytype_int16 *yyssp;
1804
1805 /* The semantic value stack. */
1806 YYSTYPE yyvsa[YYINITDEPTH];
1807 YYSTYPE *yyvs;
1808 YYSTYPE *yyvsp;
1809
1810 YYSIZE_T yystacksize;
1811
1812 int yyn;
1813 int yyresult;
1814 /* Lookahead token as an internal (translated) token number. */
1815 int yytoken;
1816 /* The variables used to return semantic value and location from the
1817 action routines. */
1818 YYSTYPE yyval;
1819
1820 #if YYERROR_VERBOSE
1821 /* Buffer for error messages, and its allocated size. */
1822 char yymsgbuf[128];
1823 char *yymsg = yymsgbuf;
1824 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1825 #endif
1826
1827 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1828
1829 /* The number of symbols on the RHS of the reduced rule.
1830 Keep to zero when no symbol should be popped. */
1831 int yylen = 0;
1832
1833 yytoken = 0;
1834 yyss = yyssa;
1835 yyvs = yyvsa;
1836 yystacksize = YYINITDEPTH;
1837
1838 YYDPRINTF ((stderr, "Starting parse\n"));
1839
1840 yystate = 0;
1841 yyerrstatus = 0;
1842 yynerrs = 0;
1843 yychar = YYEMPTY; /* Cause a token to be read. */
1844
1845 /* Initialize stack pointers.
1846 Waste one element of value and location stack
1847 so that they stay on the same level as the state stack.
1848 The wasted elements are never initialized. */
1849 yyssp = yyss;
1850 yyvsp = yyvs;
1851
1852 goto yysetstate;
1853
1854 /*------------------------------------------------------------.
1855 | yynewstate -- Push a new state, which is found in yystate. |
1856 `------------------------------------------------------------*/
1857 yynewstate:
1858 /* In all cases, when you get here, the value and location stacks
1859 have just been pushed. So pushing a state here evens the stacks. */
1860 yyssp++;
1861
1862 yysetstate:
1863 *yyssp = yystate;
1864
1865 if (yyss + yystacksize - 1 <= yyssp)
1866 {
1867 /* Get the current used size of the three stacks, in elements. */
1868 YYSIZE_T yysize = yyssp - yyss + 1;
1869
1870 #ifdef yyoverflow
1871 {
1872 /* Give user a chance to reallocate the stack. Use copies of
1873 these so that the &'s don't force the real ones into
1874 memory. */
1875 YYSTYPE *yyvs1 = yyvs;
1876 yytype_int16 *yyss1 = yyss;
1877
1878 /* Each stack pointer address is followed by the size of the
1879 data in use in that stack, in bytes. This used to be a
1880 conditional around just the two extra args, but that might
1881 be undefined if yyoverflow is a macro. */
1882 yyoverflow (YY_("memory exhausted"),
1883 &yyss1, yysize * sizeof (*yyssp),
1884 &yyvs1, yysize * sizeof (*yyvsp),
1885 &yystacksize);
1886
1887 yyss = yyss1;
1888 yyvs = yyvs1;
1889 }
1890 #else /* no yyoverflow */
1891 # ifndef YYSTACK_RELOCATE
1892 goto yyexhaustedlab;
1893 # else
1894 /* Extend the stack our own way. */
1895 if (YYMAXDEPTH <= yystacksize)
1896 goto yyexhaustedlab;
1897 yystacksize *= 2;
1898 if (YYMAXDEPTH < yystacksize)
1899 yystacksize = YYMAXDEPTH;
1900
1901 {
1902 yytype_int16 *yyss1 = yyss;
1903 union yyalloc *yyptr =
1904 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1905 if (! yyptr)
1906 goto yyexhaustedlab;
1907 YYSTACK_RELOCATE (yyss_alloc, yyss);
1908 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1909 # undef YYSTACK_RELOCATE
1910 if (yyss1 != yyssa)
1911 YYSTACK_FREE (yyss1);
1912 }
1913 # endif
1914 #endif /* no yyoverflow */
1915
1916 yyssp = yyss + yysize - 1;
1917 yyvsp = yyvs + yysize - 1;
1918
1919 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1920 (unsigned long int) yystacksize));
1921
1922 if (yyss + yystacksize - 1 <= yyssp)
1923 YYABORT;
1924 }
1925
1926 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1927
1928 if (yystate == YYFINAL)
1929 YYACCEPT;
1930
1931 goto yybackup;
1932
1933 /*-----------.
1934 | yybackup. |
1935 `-----------*/
1936 yybackup:
1937
1938 /* Do appropriate processing given the current state. Read a
1939 lookahead token if we need one and don't already have one. */
1940
1941 /* First try to decide what to do without reference to lookahead token. */
1942 yyn = yypact[yystate];
1943 if (yyn == YYPACT_NINF)
1944 goto yydefault;
1945
1946 /* Not known => get a lookahead token if don't already have one. */
1947
1948 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1949 if (yychar == YYEMPTY)
1950 {
1951 YYDPRINTF ((stderr, "Reading a token: "));
1952 yychar = YYLEX;
1953 }
1954
1955 if (yychar <= YYEOF)
1956 {
1957 yychar = yytoken = YYEOF;
1958 YYDPRINTF ((stderr, "Now at end of input.\n"));
1959 }
1960 else
1961 {
1962 yytoken = YYTRANSLATE (yychar);
1963 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1964 }
1965
1966 /* If the proper action on seeing token YYTOKEN is to reduce or to
1967 detect an error, take that action. */
1968 yyn += yytoken;
1969 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1970 goto yydefault;
1971 yyn = yytable[yyn];
1972 if (yyn <= 0)
1973 {
1974 if (yyn == 0 || yyn == YYTABLE_NINF)
1975 goto yyerrlab;
1976 yyn = -yyn;
1977 goto yyreduce;
1978 }
1979
1980 /* Count tokens shifted since error; after three, turn off error
1981 status. */
1982 if (yyerrstatus)
1983 yyerrstatus--;
1984
1985 /* Shift the lookahead token. */
1986 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1987
1988 /* Discard the shifted token. */
1989 yychar = YYEMPTY;
1990
1991 yystate = yyn;
1992 *++yyvsp = yylval;
1993
1994 goto yynewstate;
1995
1996
1997 /*-----------------------------------------------------------.
1998 | yydefault -- do the default action for the current state. |
1999 `-----------------------------------------------------------*/
2000 yydefault:
2001 yyn = yydefact[yystate];
2002 if (yyn == 0)
2003 goto yyerrlab;
2004 goto yyreduce;
2005
2006
2007 /*-----------------------------.
2008 | yyreduce -- Do a reduction. |
2009 `-----------------------------*/
2010 yyreduce:
2011 /* yyn is the number of a rule to reduce with. */
2012 yylen = yyr2[yyn];
2013
2014 /* If YYLEN is nonzero, implement the default value of the action:
2015 `$$ = $1'.
2016
2017 Otherwise, the following line sets YYVAL to garbage.
2018 This behavior is undocumented and Bison
2019 users should not rely upon it. Assigning to YYVAL
2020 unconditionally makes the parser a bit smaller, and it avoids a
2021 GCC warning that YYVAL may be used uninitialized. */
2022 yyval = yyvsp[1-yylen];
2023
2024
2025 YY_REDUCE_PRINT (yyn);
2026 switch (yyn)
2027 {
2028 case 2:
2029
2030 /* Line 1455 of yacc.c */
2031 #line 257 "parser.y"
2032 { program_parsed(ctx, (yyvsp[(1) - (2)].source_elements)); ;}
2033 break;
2034
2035 case 3:
2036
2037 /* Line 1455 of yacc.c */
2038 #line 260 "parser.y"
2039 {;}
2040 break;
2041
2042 case 4:
2043
2044 /* Line 1455 of yacc.c */
2045 #line 261 "parser.y"
2046 {;}
2047 break;
2048
2049 case 5:
2050
2051 /* Line 1455 of yacc.c */
2052 #line 265 "parser.y"
2053 { (yyval.source_elements) = new_source_elements(ctx); ;}
2054 break;
2055
2056 case 6:
2057
2058 /* Line 1455 of yacc.c */
2059 #line 267 "parser.y"
2060 { (yyval.source_elements) = source_elements_add_statement((yyvsp[(1) - (2)].source_elements), (yyvsp[(2) - (2)].statement)); ;}
2061 break;
2062
2063 case 7:
2064
2065 /* Line 1455 of yacc.c */
2066 #line 272 "parser.y"
2067 { (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); ;}
2068 break;
2069
2070 case 8:
2071
2072 /* Line 1455 of yacc.c */
2073 #line 275 "parser.y"
2074 { push_func(ctx); (yyval.srcptr) = (yyvsp[(1) - (1)].srcptr); ;}
2075 break;
2076
2077 case 9:
2078
2079 /* Line 1455 of yacc.c */
2080 #line 279 "parser.y"
2081 { (yyval.source_elements) = function_body_parsed(ctx, (yyvsp[(1) - (1)].source_elements)); ;}
2082 break;
2083
2084 case 10:
2085
2086 /* Line 1455 of yacc.c */
2087 #line 283 "parser.y"
2088 { (yyval.parameter_list) = new_parameter_list(ctx, (yyvsp[(1) - (1)].identifier)); ;}
2089 break;
2090
2091 case 11:
2092
2093 /* Line 1455 of yacc.c */
2094 #line 285 "parser.y"
2095 { (yyval.parameter_list) = parameter_list_add(ctx, (yyvsp[(1) - (3)].parameter_list), (yyvsp[(3) - (3)].identifier)); ;}
2096 break;
2097
2098 case 12:
2099
2100 /* Line 1455 of yacc.c */
2101 #line 289 "parser.y"
2102 { (yyval.parameter_list) = NULL; ;}
2103 break;
2104
2105 case 13:
2106
2107 /* Line 1455 of yacc.c */
2108 #line 290 "parser.y"
2109 { (yyval.parameter_list) = (yyvsp[(1) - (1)].parameter_list); ;}
2110 break;
2111
2112 case 14:
2113
2114 /* Line 1455 of yacc.c */
2115 #line 294 "parser.y"
2116 { (yyval.statement) = (yyvsp[(1) - (1)].statement); ;}
2117 break;
2118
2119 case 15:
2120
2121 /* Line 1455 of yacc.c */
2122 #line 295 "parser.y"
2123 { (yyval.statement) = (yyvsp[(1) - (1)].statement); ;}
2124 break;
2125
2126 case 16:
2127
2128 /* Line 1455 of yacc.c */
2129 #line 296 "parser.y"
2130 { (yyval.statement) = (yyvsp[(1) - (1)].statement); ;}
2131 break;
2132
2133 case 17:
2134
2135 /* Line 1455 of yacc.c */
2136 #line 297 "parser.y"
2137 { (yyval.statement) = new_empty_statement(ctx); ;}
2138 break;
2139
2140 case 18:
2141
2142 /* Line 1455 of yacc.c */
2143 #line 298 "parser.y"
2144 { (yyval.statement) = (yyvsp[(1) - (1)].statement); ;}
2145 break;
2146
2147 case 19:
2148
2149 /* Line 1455 of yacc.c */
2150 #line 299 "parser.y"
2151 { (yyval.statement) = (yyvsp[(1) - (1)].statement); ;}
2152 break;
2153
2154 case 20:
2155
2156 /* Line 1455 of yacc.c */
2157 #line 300 "parser.y"
2158 { (yyval.statement) = (yyvsp[(1) - (1)].statement); ;}
2159 break;
2160
2161 case 21:
2162
2163 /* Line 1455 of yacc.c */
2164 #line 301 "parser.y"
2165 { (yyval.statement) = (yyvsp[(1) - (1)].statement); ;}
2166 break;
2167
2168 case 22:
2169
2170 /* Line 1455 of yacc.c */
2171 #line 302 "parser.y"
2172 { (yyval.statement) = (yyvsp[(1) - (1)].statement); ;}
2173 break;
2174
2175 case 23:
2176
2177 /* Line 1455 of yacc.c */
2178 #line 303 "parser.y"
2179 { (yyval.statement) = (yyvsp[(1) - (1)].statement); ;}
2180 break;
2181
2182 case 24:
2183
2184 /* Line 1455 of yacc.c */
2185 #line 304 "parser.y"
2186 { (yyval.statement) = (yyvsp[(1) - (1)].statement); ;}
2187 break;
2188
2189 case 25:
2190
2191 /* Line 1455 of yacc.c */
2192 #line 305 "parser.y"
2193 { (yyval.statement) = (yyvsp[(1) - (1)].statement); ;}
2194 break;
2195
2196 case 26:
2197
2198 /* Line 1455 of yacc.c */
2199 #line 306 "parser.y"
2200 { (yyval.statement) = (yyvsp[(1) - (1)].statement); ;}
2201 break;
2202
2203 case 27:
2204
2205 /* Line 1455 of yacc.c */
2206 #line 307 "parser.y"
2207 { (yyval.statement) = (yyvsp[(1) - (1)].statement); ;}
2208 break;
2209
2210 case 28:
2211
2212 /* Line 1455 of yacc.c */
2213 #line 308 "parser.y"
2214 { (yyval.statement) = (yyvsp[(1) - (1)].statement); ;}
2215 break;
2216
2217 case 29:
2218
2219 /* Line 1455 of yacc.c */
2220 #line 312 "parser.y"
2221 { (yyval.statement_list) = new_statement_list(ctx, (yyvsp[(1) - (1)].statement)); ;}
2222 break;
2223
2224 case 30:
2225
2226 /* Line 1455 of yacc.c */
2227 #line 314 "parser.y"
2228 { (yyval.statement_list) = statement_list_add((yyvsp[(1) - (2)].statement_list), (yyvsp[(2) - (2)].statement)); ;}
2229 break;
2230
2231 case 31:
2232
2233 /* Line 1455 of yacc.c */
2234 #line 318 "parser.y"
2235 { (yyval.statement_list) = NULL; ;}
2236 break;
2237
2238 case 32:
2239
2240 /* Line 1455 of yacc.c */
2241 #line 319 "parser.y"
2242 { (yyval.statement_list) = (yyvsp[(1) - (1)].statement_list); ;}
2243 break;
2244
2245 case 33:
2246
2247 /* Line 1455 of yacc.c */
2248 #line 323 "parser.y"
2249 { (yyval.statement) = new_block_statement(ctx, (yyvsp[(2) - (3)].statement_list)); ;}
2250 break;
2251
2252 case 34:
2253
2254 /* Line 1455 of yacc.c */
2255 #line 324 "parser.y"
2256 { (yyval.statement) = new_block_statement(ctx, NULL); ;}
2257 break;
2258
2259 case 35:
2260
2261 /* Line 1455 of yacc.c */
2262 #line 329 "parser.y"
2263 { (yyval.statement) = new_var_statement(ctx, (yyvsp[(2) - (3)].variable_list)); ;}
2264 break;
2265
2266 case 36:
2267
2268 /* Line 1455 of yacc.c */
2269 #line 333 "parser.y"
2270 { (yyval.variable_list) = new_variable_list(ctx, (yyvsp[(1) - (1)].variable_declaration)); ;}
2271 break;
2272
2273 case 37:
2274
2275 /* Line 1455 of yacc.c */
2276 #line 335 "parser.y"
2277 { (yyval.variable_list) = variable_list_add(ctx, (yyvsp[(1) - (3)].variable_list), (yyvsp[(3) - (3)].variable_declaration)); ;}
2278 break;
2279
2280 case 38:
2281
2282 /* Line 1455 of yacc.c */
2283 #line 340 "parser.y"
2284 { (yyval.variable_list) = new_variable_list(ctx, (yyvsp[(1) - (1)].variable_declaration)); ;}
2285 break;
2286
2287 case 39:
2288
2289 /* Line 1455 of yacc.c */
2290 #line 342 "parser.y"
2291 { (yyval.variable_list) = variable_list_add(ctx, (yyvsp[(1) - (3)].variable_list), (yyvsp[(3) - (3)].variable_declaration)); ;}
2292 break;
2293
2294 case 40:
2295
2296 /* Line 1455 of yacc.c */
2297 #line 347 "parser.y"
2298 { (yyval.variable_declaration) = new_variable_declaration(ctx, (yyvsp[(1) - (2)].identifier), (yyvsp[(2) - (2)].expr)); ;}
2299 break;
2300
2301 case 41:
2302
2303 /* Line 1455 of yacc.c */
2304 #line 352 "parser.y"
2305 { (yyval.variable_declaration) = new_variable_declaration(ctx, (yyvsp[(1) - (2)].identifier), (yyvsp[(2) - (2)].expr)); ;}
2306 break;
2307
2308 case 42:
2309
2310 /* Line 1455 of yacc.c */
2311 #line 356 "parser.y"
2312 { (yyval.expr) = NULL; ;}
2313 break;
2314
2315 case 43:
2316
2317 /* Line 1455 of yacc.c */
2318 #line 357 "parser.y"
2319 { (yyval.expr) = (yyvsp[(1) - (1)].expr); ;}
2320 break;
2321
2322 case 44:
2323
2324 /* Line 1455 of yacc.c */
2325 #line 362 "parser.y"
2326 { (yyval.expr) = (yyvsp[(2) - (2)].expr); ;}
2327 break;
2328
2329 case 45:
2330
2331 /* Line 1455 of yacc.c */
2332 #line 366 "parser.y"
2333 { (yyval.expr) = NULL; ;}
2334 break;
2335
2336 case 46:
2337
2338 /* Line 1455 of yacc.c */
2339 #line 367 "parser.y"
2340 { (yyval.expr) = (yyvsp[(1) - (1)].expr); ;}
2341 break;
2342
2343 case 47:
2344
2345 /* Line 1455 of yacc.c */
2346 #line 372 "parser.y"
2347 { (yyval.expr) = (yyvsp[(2) - (2)].expr); ;}
2348 break;
2349
2350 case 48:
2351
2352 /* Line 1455 of yacc.c */
2353 #line 376 "parser.y"
2354 { (yyval.statement) = new_empty_statement(ctx); ;}
2355 break;
2356
2357 case 49:
2358
2359 /* Line 1455 of yacc.c */
2360 #line 381 "parser.y"
2361 { (yyval.statement) = new_expression_statement(ctx, (yyvsp[(1) - (2)].expr)); ;}
2362 break;
2363
2364 case 50:
2365
2366 /* Line 1455 of yacc.c */
2367 #line 386 "parser.y"
2368 { (yyval.statement) = new_if_statement(ctx, (yyvsp[(3) - (7)].expr), (yyvsp[(5) - (7)].statement), (yyvsp[(7) - (7)].statement)); ;}
2369 break;
2370
2371 case 51:
2372
2373 /* Line 1455 of yacc.c */
2374 #line 388 "parser.y"
2375 { (yyval.statement) = new_if_statement(ctx, (yyvsp[(3) - (5)].expr), (yyvsp[(5) - (5)].statement), NULL); ;}
2376 break;
2377
2378 case 52:
2379
2380 /* Line 1455 of yacc.c */
2381 #line 393 "parser.y"
2382 { (yyval.statement) = new_while_statement(ctx, TRUE, (yyvsp[(5) - (7)].expr), (yyvsp[(2) - (7)].statement)); ;}
2383 break;
2384
2385 case 53:
2386
2387 /* Line 1455 of yacc.c */
2388 #line 395 "parser.y"
2389 { (yyval.statement) = new_while_statement(ctx, FALSE, (yyvsp[(3) - (5)].expr), (yyvsp[(5) - (5)].statement)); ;}
2390 break;
2391
2392 case 54:
2393
2394 /* Line 1455 of yacc.c */
2395 #line 397 "parser.y"
2396 { if(!explicit_error(ctx, (yyvsp[(3) - (3)].expr), ';')) YYABORT; ;}
2397 break;
2398
2399 case 55:
2400
2401 /* Line 1455 of yacc.c */
2402 #line 399 "parser.y"
2403 { if(!explicit_error(ctx, (yyvsp[(6) - (6)].expr), ';')) YYABORT; ;}
2404 break;
2405
2406 case 56:
2407
2408 /* Line 1455 of yacc.c */
2409 #line 401 "parser.y"
2410 { (yyval.statement) = new_for_statement(ctx, NULL, (yyvsp[(3) - (11)].expr), (yyvsp[(6) - (11)].expr), (yyvsp[(9) - (11)].expr), (yyvsp[(11) - (11)].statement)); ;}
2411 break;
2412
2413 case 57:
2414
2415 /* Line 1455 of yacc.c */
2416 #line 403 "parser.y"
2417 { if(!explicit_error(ctx, (yyvsp[(4) - (4)].variable_list), ';')) YYABORT; ;}
2418 break;
2419
2420 case 58:
2421
2422 /* Line 1455 of yacc.c */
2423 #line 405 "parser.y"
2424 { if(!explicit_error(ctx, (yyvsp[(7) - (7)].expr), ';')) YYABORT; ;}
2425 break;
2426
2427 case 59:
2428
2429 /* Line 1455 of yacc.c */
2430 #line 407 "parser.y"
2431 { (yyval.statement) = new_for_statement(ctx, (yyvsp[(4) - (12)].variable_list), NULL, (yyvsp[(7) - (12)].expr), (yyvsp[(10) - (12)].expr), (yyvsp[(12) - (12)].statement)); ;}
2432 break;
2433
2434 case 60:
2435
2436 /* Line 1455 of yacc.c */
2437 #line 409 "parser.y"
2438 { (yyval.statement) = new_forin_statement(ctx, NULL, (yyvsp[(3) - (7)].expr), (yyvsp[(5) - (7)].expr), (yyvsp[(7) - (7)].statement)); ;}
2439 break;
2440
2441 case 61:
2442
2443 /* Line 1455 of yacc.c */
2444 #line 411 "parser.y"
2445 { (yyval.statement) = new_forin_statement(ctx, (yyvsp[(4) - (8)].variable_declaration), NULL, (yyvsp[(6) - (8)].expr), (yyvsp[(8) - (8)].statement)); ;}
2446 break;
2447
2448 case 62:
2449
2450 /* Line 1455 of yacc.c */
2451 #line 416 "parser.y"
2452 { (yyval.statement) = new_continue_statement(ctx, (yyvsp[(2) - (3)].identifier)); ;}
2453 break;
2454
2455 case 63:
2456
2457 /* Line 1455 of yacc.c */
2458 #line 421 "parser.y"
2459 { (yyval.statement) = new_break_statement(ctx, (yyvsp[(2) - (3)].identifier)); ;}
2460 break;
2461
2462 case 64:
2463
2464 /* Line 1455 of yacc.c */
2465 #line 426 "parser.y"
2466 { (yyval.statement) = new_return_statement(ctx, (yyvsp[(2) - (3)].expr)); ;}
2467 break;
2468
2469 case 65:
2470
2471 /* Line 1455 of yacc.c */
2472 #line 431 "parser.y"
2473 { (yyval.statement) = new_with_statement(ctx, (yyvsp[(3) - (5)].expr), (yyvsp[(5) - (5)].statement)); ;}
2474 break;
2475
2476 case 66:
2477
2478 /* Line 1455 of yacc.c */
2479 #line 436 "parser.y"
2480 { (yyval.statement) = new_labelled_statement(ctx, (yyvsp[(1) - (3)].identifier), (yyvsp[(3) - (3)].statement)); ;}
2481 break;
2482
2483 case 67:
2484
2485 /* Line 1455 of yacc.c */
2486 #line 441 "parser.y"
2487 { (yyval.statement) = new_switch_statement(ctx, (yyvsp[(3) - (5)].expr), (yyvsp[(5) - (5)].case_clausule)); ;}
2488 break;
2489
2490 case 68:
2491
2492 /* Line 1455 of yacc.c */
2493 #line 446 "parser.y"
2494 { (yyval.case_clausule) = new_case_block(ctx, (yyvsp[(2) - (3)].case_list), NULL, NULL); ;}
2495 break;
2496
2497 case 69:
2498
2499 /* Line 1455 of yacc.c */
2500 #line 448 "parser.y"
2501 { (yyval.case_clausule) = new_case_block(ctx, (yyvsp[(2) - (5)].case_list), (yyvsp[(3) - (5)].case_clausule), (yyvsp[(4) - (5)].case_list)); ;}
2502 break;
2503
2504 case 70:
2505
2506 /* Line 1455 of yacc.c */
2507 #line 452 "parser.y"
2508 { (yyval.case_list) = NULL; ;}
2509 break;
2510
2511 case 71:
2512
2513 /* Line 1455 of yacc.c */
2514 #line 453 "parser.y"
2515 { (yyval.case_list) = (yyvsp[(1) - (1)].case_list); ;}
2516 break;
2517
2518 case 72:
2519
2520 /* Line 1455 of yacc.c */
2521 #line 457 "parser.y"
2522 { (yyval.case_list) = new_case_list(ctx, (yyvsp[(1) - (1)].case_clausule)); ;}
2523 break;
2524
2525 case 73:
2526
2527 /* Line 1455 of yacc.c */
2528 #line 459 "parser.y"
2529 { (yyval.case_list) = case_list_add(ctx, (yyvsp[(1) - (2)].case_list), (yyvsp[(2) - (2)].case_clausule)); ;}
2530 break;
2531
2532 case 74:
2533
2534 /* Line 1455 of yacc.c */
2535 #line 464 "parser.y"
2536 { (yyval.case_clausule) = new_case_clausule(ctx, (yyvsp[(2) - (4)].expr), (yyvsp[(4) - (4)].statement_list)); ;}
2537 break;
2538
2539 case 75:
2540
2541 /* Line 1455 of yacc.c */
2542 #line 469 "parser.y"
2543 { (yyval.case_clausule) = new_case_clausule(ctx, NULL, (yyvsp[(3) - (3)].statement_list)); ;}
2544 break;
2545
2546 case 76:
2547
2548 /* Line 1455 of yacc.c */
2549 #line 474 "parser.y"
2550 { (yyval.statement) = new_throw_statement(ctx, (yyvsp[(2) - (3)].expr)); ;}
2551 break;
2552
2553 case 77:
2554
2555 /* Line 1455 of yacc.c */
2556 #line 478 "parser.y"
2557 { (yyval.statement) = new_try_statement(ctx, (yyvsp[(2) - (3)].statement), (yyvsp[(3) - (3)].catch_block), NULL); ;}
2558 break;
2559
2560 case 78:
2561
2562 /* Line 1455 of yacc.c */
2563 #line 479 "parser.y"
2564 { (yyval.statement) = new_try_statement(ctx, (yyvsp[(2) - (3)].statement), NULL, (yyvsp[(3) - (3)].statement)); ;}
2565 break;
2566
2567 case 79:
2568
2569 /* Line 1455 of yacc.c */
2570 #line 481 "parser.y"
2571 { (yyval.statement) = new_try_statement(ctx, (yyvsp[(2) - (4)].statement), (yyvsp[(3) - (4)].catch_block), (yyvsp[(4) - (4)].statement)); ;}
2572 break;
2573
2574 case 80:
2575
2576 /* Line 1455 of yacc.c */
2577 #line 486 "parser.y"
2578 { (yyval.catch_block) = new_catch_block(ctx, (yyvsp[(3) - (5)].identifier), (yyvsp[(5) - (5)].statement)); ;}
2579 break;
2580
2581 case 81:
2582
2583 /* Line 1455 of yacc.c */
2584 #line 490 "parser.y"
2585 { (yyval.statement) = (yyvsp[(2) - (2)].statement); ;}
2586 break;
2587
2588 case 82:
2589
2590 /* Line 1455 of yacc.c */
2591 #line 494 "parser.y"
2592 { (yyval.expr) = NULL; ;}
2593 break;
2594
2595 case 83:
2596
2597 /* Line 1455 of yacc.c */
2598 #line 495 "parser.y"
2599 { (yyval.expr) = (yyvsp[(1) - (1)].expr); ;}
2600 break;
2601
2602 case 84:
2603
2604 /* Line 1455 of yacc.c */
2605 #line 498 "parser.y"
2606 { (yyval.expr) = (yyvsp[(1) - (1)].expr); ;}
2607 break;
2608
2609 case 85:
2610
2611 /* Line 1455 of yacc.c */
2612 #line 499 "parser.y"
2613 { set_error(ctx, IDS_SYNTAX_ERROR); YYABORT; ;}
2614 break;
2615
2616 case 86:
2617
2618 /* Line 1455 of yacc.c */
2619 #line 503 "parser.y"
2620 { (yyval.expr) = (yyvsp[(1) - (1)].expr); ;}
2621 break;
2622
2623 case 87:
2624
2625 /* Line 1455 of yacc.c */
2626 #line 505 "parser.y"
2627 { (yyval.expr) = new_binary_expression(ctx, EXPR_COMMA, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); ;}
2628 break;
2629
2630 case 88:
2631
2632 /* Line 1455 of yacc.c */
2633 #line 509 "parser.y"
2634 { (yyval.expr) = NULL; ;}
2635 break;
2636
2637 case 89:
2638
2639 /* Line 1455 of yacc.c */
2640 #line 510 "parser.y"
2641 { (yyval.expr) = (yyvsp[(1) - (1)].expr); ;}
2642 break;
2643
2644 case 90:
2645
2646 /* Line 1455 of yacc.c */
2647 #line 515 "parser.y"
2648 { (yyval.expr) = (yyvsp[(1) - (1)].expr); ;}
2649 break;
2650
2651 case 91:
2652
2653 /* Line 1455 of yacc.c */
2654 #line 517 "parser.y"
2655 { (yyval.expr) = new_binary_expression(ctx, EXPR_COMMA, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); ;}
2656 break;
2657
2658 case 92:
2659
2660 /* Line 1455 of yacc.c */
2661 #line 520 "parser.y"
2662 { (yyval.ival) = (yyvsp[(1) - (1)].ival); ;}
2663 break;
2664
2665 case 93:
2666
2667 /* Line 1455 of yacc.c */
2668 #line 521 "parser.y"
2669 { (yyval.ival) = EXPR_ASSIGNDIV; ;}
2670 break;
2671
2672 case 94:
2673
2674 /* Line 1455 of yacc.c */
2675 #line 525 "parser.y"
2676 { (yyval.expr) = (yyvsp[(1) - (1)].expr); ;}
2677 break;
2678
2679 case 95:
2680
2681 /* Line 1455 of yacc.c */
2682 #line 527 "parser.y"
2683 { (yyval.expr) = new_binary_expression(ctx, EXPR_ASSIGN, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); ;}
2684 break;
2685
2686 case 96:
2687
2688 /* Line 1455 of yacc.c */
2689 #line 529 "parser.y"
2690 { (yyval.expr) = new_binary_expression(ctx, (yyvsp[(2) - (3)].ival), (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); ;}
2691 break;
2692
2693 case 97:
2694
2695 /* Line 1455 of yacc.c */
2696 #line 534 "parser.y"
2697 { (yyval.expr) = (yyvsp[(1) - (1)].expr); ;}
2698 break;
2699
2700 case 98:
2701
2702 /* Line 1455 of yacc.c */
2703 #line 536 "parser.y"
2704 { (yyval.expr) = new_binary_expression(ctx, EXPR_ASSIGN, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); ;}
2705 break;
2706
2707 case 99:
2708
2709 /* Line 1455 of yacc.c */
2710 #line 538 "parser.y"
2711 { (yyval.expr) = new_binary_expression(ctx, (yyvsp[(2) - (3)].ival), (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); ;}
2712 break;
2713
2714 case 100:
2715
2716 /* Line 1455 of yacc.c */
2717 #line 542 "parser.y"
2718 { (yyval.expr) = (yyvsp[(1) - (1)].expr); ;}
2719 break;
2720
2721 case 101:
2722
2723 /* Line 1455 of yacc.c */
2724 #line 544 "parser.y"
2725 { (yyval.expr) = new_conditional_expression(ctx, (yyvsp[(1) - (5)].expr), (yyvsp[(3) - (5)].expr), (yyvsp[(5) - (5)].expr)); ;}
2726 break;
2727
2728 case 102:
2729
2730 /* Line 1455 of yacc.c */
2731 #line 549 "parser.y"
2732 { (yyval.expr) = (yyvsp[(1) - (1)].expr); ;}
2733 break;
2734
2735 case 103:
2736
2737 /* Line 1455 of yacc.c */
2738 #line 551 "parser.y"
2739 { (yyval.expr) = new_conditional_expression(ctx, (yyvsp[(1) - (5)].expr), (yyvsp[(3) - (5)].expr), (yyvsp[(5) - (5)].expr)); ;}
2740 break;
2741
2742 case 104:
2743
2744 /* Line 1455 of yacc.c */
2745 #line 555 "parser.y"
2746 { (yyval.expr) = (yyvsp[(1) - (1)].expr); ;}
2747 break;
2748
2749 case 105:
2750
2751 /* Line 1455 of yacc.c */
2752 #line 557 "parser.y"
2753 { (yyval.expr) = new_binary_expression(ctx, EXPR_OR, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); ;}
2754 break;
2755
2756 case 106:
2757
2758 /* Line 1455 of yacc.c */
2759 #line 562 "parser.y"
2760 { (yyval.expr) = (yyvsp[(1) - (1)].expr); ;}
2761 break;
2762
2763 case 107:
2764
2765 /* Line 1455 of yacc.c */
2766 #line 564 "parser.y"
2767 { (yyval.expr) = new_binary_expression(ctx, EXPR_OR, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); ;}
2768 break;
2769
2770 case 108:
2771
2772 /* Line 1455 of yacc.c */
2773 #line 568 "parser.y"
2774 { (yyval.expr) = (yyvsp[(1) - (1)].expr); ;}
2775 break;
2776
2777 case 109:
2778
2779 /* Line 1455 of yacc.c */
2780 #line 570 "parser.y"
2781 { (yyval.expr) = new_binary_expression(ctx, EXPR_AND, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); ;}
2782 break;
2783
2784 case 110:
2785
2786 /* Line 1455 of yacc.c */
2787 #line 575 "parser.y"
2788 { (yyval.expr) = (yyvsp[(1) - (1)].expr); ;}
2789 break;
2790
2791 case 111:
2792
2793 /* Line 1455 of yacc.c */
2794 #line 577 "parser.y"
2795 { (yyval.expr) = new_binary_expression(ctx, EXPR_AND, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); ;}
2796 break;
2797
2798 case 112:
2799
2800 /* Line 1455 of yacc.c */
2801 #line 581 "parser.y"
2802 { (yyval.expr) = (yyvsp[(1) - (1)].expr); ;}
2803 break;
2804
2805 case 113:
2806
2807 /* Line 1455 of yacc.c */
2808 #line 583 "parser.y"
2809 { (yyval.expr) = new_binary_expression(ctx, EXPR_BOR, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); ;}
2810 break;
2811
2812 case 114:
2813
2814 /* Line 1455 of yacc.c */
2815 #line 588 "parser.y"
2816 { (yyval.expr) = (yyvsp[(1) - (1)].expr); ;}
2817 break;
2818
2819 case 115:
2820
2821 /* Line 1455 of yacc.c */
2822 #line 590 "parser.y"
2823 { (yyval.expr) = new_binary_expression(ctx, EXPR_BOR, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); ;}
2824 break;
2825
2826 case 116:
2827
2828 /* Line 1455 of yacc.c */
2829 #line 594 "parser.y"
2830 { (yyval.expr) = (yyvsp[(1) - (1)].expr); ;}
2831 break;
2832
2833 case 117:
2834
2835 /* Line 1455 of yacc.c */
2836 #line 596 "parser.y"
2837 { (yyval.expr) = new_binary_expression(ctx, EXPR_BXOR, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); ;}
2838 break;
2839
2840 case 118:
2841
2842 /* Line 1455 of yacc.c */
2843 #line 601 "parser.y"
2844 { (yyval.expr) = (yyvsp[(1) - (1)].expr); ;}
2845 break;
2846
2847 case 119:
2848
2849 /* Line 1455 of yacc.c */
2850 #line 603 "parser.y"
2851 { (yyval.expr) = new_binary_expression(ctx, EXPR_BXOR, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); ;}
2852 break;
2853
2854 case 120:
2855
2856 /* Line 1455 of yacc.c */
2857 #line 607 "parser.y"
2858 { (yyval.expr) = (yyvsp[(1) - (1)].expr); ;}
2859 break;
2860
2861 case 121:
2862
2863 /* Line 1455 of yacc.c */
2864 #line 609 "parser.y"
2865 { (yyval.expr) = new_binary_expression(ctx, EXPR_BAND, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); ;}
2866 break;
2867
2868 case 122:
2869
2870 /* Line 1455 of yacc.c */
2871 #line 614 "parser.y"
2872 { (yyval.expr) = (yyvsp[(1) - (1)].expr); ;}
2873 break;
2874
2875 case 123:
2876
2877 /* Line 1455 of yacc.c */
2878 #line 616 "parser.y"
2879 { (yyval.expr) = new_binary_expression(ctx, EXPR_BAND, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); ;}
2880 break;
2881
2882 case 124:
2883
2884 /* Line 1455 of yacc.c */
2885 #line 620 "parser.y"
2886 { (yyval.expr) = (yyvsp[(1) - (1)].expr); ;}
2887 break;
2888
2889 case 125:
2890
2891 /* Line 1455 of yacc.c */
2892 #line 622 "parser.y"
2893 { (yyval.expr) = new_binary_expression(ctx, (yyvsp[(2) - (3)].ival), (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); ;}
2894 break;
2895
2896 case 126:
2897
2898 /* Line 1455 of yacc.c */
2899 #line 626 "parser.y"
2900 { (yyval.expr) = (yyvsp[(1) - (1)].expr); ;}
2901 break;
2902
2903 case 127:
2904
2905 /* Line 1455 of yacc.c */
2906 #line 628 "parser.y"
2907 { (yyval.expr) = new_binary_expression(ctx, (yyvsp[(2) - (3)].ival), (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); ;}
2908 break;
2909
2910 case 128:
2911
2912 /* Line 1455 of yacc.c */
2913 #line 632 "parser.y"
2914 { (yyval.expr) = (yyvsp[(1) - (1)].expr); ;}
2915 break;
2916
2917 case 129:
2918
2919 /* Line 1455 of yacc.c */
2920 #line 634 "parser.y"
2921 { (yyval.expr) = new_binary_expression(ctx, (yyvsp[(2) - (3)].ival), (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); ;}
2922 break;
2923
2924 case 130:
2925
2926 /* Line 1455 of yacc.c */
2927 #line 636 "parser.y"
2928 { (yyval.expr) = new_binary_expression(ctx, EXPR_INSTANCEOF, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); ;}
2929 break;
2930
2931 case 131:
2932
2933 /* Line 1455 of yacc.c */
2934 #line 638 "parser.y"
2935 { (yyval.expr) = new_binary_expression(ctx, EXPR_IN, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); ;}
2936 break;
2937
2938 case 132:
2939
2940 /* Line 1455 of yacc.c */
2941 #line 642 "parser.y"
2942 { (yyval.expr) = (yyvsp[(1) - (1)].expr); ;}
2943 break;
2944
2945 case 133:
2946
2947 /* Line 1455 of yacc.c */
2948 #line 644 "parser.y"
2949 { (yyval.expr) = new_binary_expression(ctx, (yyvsp[(2) - (3)].ival), (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); ;}
2950 break;
2951
2952 case 134:
2953
2954 /* Line 1455 of yacc.c */
2955 #line 646 "parser.y"
2956 { (yyval.expr) = new_binary_expression(ctx, EXPR_INSTANCEOF, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); ;}
2957 break;
2958
2959 case 135:
2960
2961 /* Line 1455 of yacc.c */
2962 #line 650 "parser.y"
2963 { (yyval.expr) = (yyvsp[(1) - (1)].expr); ;}
2964 break;
2965
2966 case 136:
2967
2968 /* Line 1455 of yacc.c */
2969 #line 652 "parser.y"
2970 { (yyval.expr) = new_binary_expression(ctx, (yyvsp[(2) - (3)].ival), (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); ;}
2971 break;
2972
2973 case 137:
2974
2975 /* Line 1455 of yacc.c */
2976 #line 657 "parser.y"
2977 { (yyval.expr) = (yyvsp[(1) - (1)].expr); ;}
2978 break;
2979
2980 case 138:
2981
2982 /* Line 1455 of yacc.c */
2983 #line 659 "parser.y"
2984 { (yyval.expr) = new_binary_expression(ctx, EXPR_ADD, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); ;}
2985 break;
2986
2987 case 139:
2988
2989 /* Line 1455 of yacc.c */
2990 #line 661 "parser.y"
2991 { (yyval.expr) = new_binary_expression(ctx, EXPR_SUB, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); ;}
2992 break;
2993
2994 case 140:
2995
2996 /* Line 1455 of yacc.c */
2997 #line 665 "parser.y"
2998 { (yyval.expr) = (yyvsp[(1) - (1)].expr); ;}
2999 break;
3000
3001 case 141:
3002
3003 /* Line 1455 of yacc.c */
3004 #line 667 "parser.y"
3005 { (yyval.expr) = new_binary_expression(ctx, EXPR_MUL, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); ;}
3006 break;
3007
3008 case 142:
3009
3010 /* Line 1455 of yacc.c */
3011 #line 669 "parser.y"
3012 { (yyval.expr) = new_binary_expression(ctx, EXPR_DIV, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); ;}
3013 break;
3014
3015 case 143:
3016
3017 /* Line 1455 of yacc.c */
3018 #line 671 "parser.y"
3019 { (yyval.expr) = new_binary_expression(ctx, EXPR_MOD, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); ;}
3020 break;
3021
3022 case 144:
3023
3024 /* Line 1455 of yacc.c */
3025 #line 675 "parser.y"
3026 { (yyval.expr) = (yyvsp[(1) - (1)].expr); ;}
3027 break;
3028
3029 case 145:
3030
3031 /* Line 1455 of yacc.c */
3032 #line 677 "parser.y"
3033 { (yyval.expr) = new_unary_expression(ctx, EXPR_DELETE, (yyvsp[(2) - (2)].expr)); ;}
3034 break;
3035
3036 case 146:
3037
3038 /* Line 1455 of yacc.c */
3039 #line 678 "parser.y"
3040 { (yyval.expr) = new_unary_expression(ctx, EXPR_VOID, (yyvsp[(2) - (2)].expr)); ;}
3041 break;
3042
3043 case 147:
3044
3045 /* Line 1455 of yacc.c */
3046 #line 680 "parser.y"
3047 { (yyval.expr) = new_unary_expression(ctx, EXPR_TYPEOF, (yyvsp[(2) - (2)].expr)); ;}
3048 break;
3049
3050 case 148:
3051
3052 /* Line 1455 of yacc.c */
3053 #line 681 "parser.y"
3054 { (yyval.expr) = new_unary_expression(ctx, EXPR_PREINC, (yyvsp[(2) - (2)].expr)); ;}
3055 break;
3056
3057 case 149:
3058
3059 /* Line 1455 of yacc.c */
3060 #line 682 "parser.y"
3061 { (yyval.expr) = new_unary_expression(ctx, EXPR_PREDEC, (yyvsp[(2) - (2)].expr)); ;}
3062 break;
3063
3064 case 150:
3065
3066 /* Line 1455 of yacc.c */
3067 #line 683 "parser.y"
3068 { (yyval.expr) = new_unary_expression(ctx, EXPR_PLUS, (yyvsp[(2) - (2)].expr)); ;}
3069 break;
3070
3071 case 151:
3072
3073 /* Line 1455 of yacc.c */
3074 #line 684 "parser.y"
3075 { (yyval.expr) = new_unary_expression(ctx, EXPR_MINUS, (yyvsp[(2) - (2)].expr)); ;}
3076 break;
3077
3078 case 152:
3079
3080 /* Line 1455 of yacc.c */
3081 #line 685 "parser.y"
3082 { (yyval.expr) = new_unary_expression(ctx, EXPR_BITNEG, (yyvsp[(2) - (2)].expr)); ;}
3083 break;
3084
3085 case 153:
3086
3087 /* Line 1455 of yacc.c */
3088 #line 686 "parser.y"
3089 { (yyval.expr) = new_unary_expression(ctx, EXPR_LOGNEG, (yyvsp[(2) - (2)].expr)); ;}
3090 break;
3091
3092 case 154:
3093
3094 /* Line 1455 of yacc.c */
3095 #line 691 "parser.y"
3096 { (yyval.expr) = (yyvsp[(1) - (1)].expr); ;}
3097 break;
3098
3099 case 155:
3100
3101 /* Line 1455 of yacc.c */
3102 #line 693 "parser.y"
3103 { (yyval.expr) = new_unary_expression(ctx, EXPR_POSTINC, (yyvsp[(1) - (2)].expr)); ;}
3104 break;
3105
3106 case 156:
3107
3108 /* Line 1455 of yacc.c */
3109 #line 695 "parser.y"
3110 { (yyval.expr) = new_unary_expression(ctx, EXPR_POSTDEC, (yyvsp[(1) - (2)].expr)); ;}
3111 break;
3112
3113 case 157:
3114
3115 /* Line 1455 of yacc.c */
3116 #line 700 "parser.y"
3117 { (yyval.expr) = (yyvsp[(1) - (1)].expr); ;}
3118 break;
3119
3120 case 158:
3121
3122 /* Line 1455 of yacc.c */
3123 #line 701 "parser.y"
3124 { (yyval.expr) = (yyvsp[(1) - (1)].expr); ;}
3125 break;
3126
3127 case 159:
3128
3129 /* Line 1455 of yacc.c */
3130 #line 705 "parser.y"
3131 { (yyval.expr) = (yyvsp[(1) - (1)].expr); ;}
3132 break;
3133
3134 case 160:
3135
3136 /* Line 1455 of yacc.c */
3137 #line 706 "parser.y"
3138 { (yyval.expr) = new_new_expression(ctx, (yyvsp[(2) - (2)].expr), NULL); ;}
3139 break;
3140
3141 case 161:
3142
3143 /* Line 1455 of yacc.c */
3144 #line 710 "parser.y"
3145 { (yyval.expr) = (yyvsp[(1) - (1)].expr); ;}
3146 break;
3147
3148 case 162:
3149
3150 /* Line 1455 of yacc.c */
3151 #line 711 "parser.y"
3152 { (yyval.expr) = (yyvsp[(1) - (1)].expr); ;}
3153 break;
3154
3155 case 163:
3156
3157 /* Line 1455 of yacc.c */
3158 #line 713 "parser.y"
3159 { (yyval.expr) = new_array_expression(ctx, (yyvsp[(1) - (4)].expr), (yyvsp[(3) - (4)].expr)); ;}
3160 break;
3161
3162 case 164:
3163
3164 /* Line 1455 of yacc.c */
3165 #line 715 "parser.y"
3166 { (yyval.expr) = new_member_expression(ctx, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].identifier)); ;}
3167 break;
3168
3169 case 165:
3170
3171 /* Line 1455 of yacc.c */
3172 #line 717 "parser.y"
3173 { (yyval.expr) = new_new_expression(ctx, (yyvsp[(2) - (3)].expr), (yyvsp[(3) - (3)].argument_list)); ;}
3174 break;
3175
3176 case 166:
3177
3178 /* Line 1455 of yacc.c */
3179 #line 722 "parser.y"
3180 { (yyval.expr) = new_call_expression(ctx, (yyvsp[(1) - (2)].expr), (yyvsp[(2) - (2)].argument_list)); ;}
3181 break;
3182
3183 case 167:
3184
3185 /* Line 1455 of yacc.c */
3186 #line 724 "parser.y"
3187 { (yyval.expr) = new_call_expression(ctx, (yyvsp[(1) - (2)].expr), (yyvsp[(2) - (2)].argument_list)); ;}
3188 break;
3189
3190 case 168:
3191
3192 /* Line 1455 of yacc.c */
3193 #line 726 "parser.y"
3194 { (yyval.expr) = new_array_expression(ctx, (yyvsp[(1) - (4)].expr), (yyvsp[(3) - (4)].expr)); ;}
3195 break;
3196
3197 case 169:
3198
3199 /* Line 1455 of yacc.c */
3200 #line 728 "parser.y"
3201 { (yyval.expr) = new_member_expression(ctx, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].identifier)); ;}
3202 break;
3203
3204 case 170:
3205
3206 /* Line 1455 of yacc.c */
3207 #line 732 "parser.y"
3208 { (yyval.argument_list) = NULL; ;}
3209 break;
3210
3211 case 171:
3212
3213 /* Line 1455 of yacc.c */
3214 #line 733 "parser.y"
3215 { (yyval.argument_list) = (yyvsp[(2) - (3)].argument_list); ;}
3216 break;
3217
3218 case 172:
3219
3220 /* Line 1455 of yacc.c */
3221 #line 737 "parser.y"
3222 { (yyval.argument_list) = new_argument_list(ctx, (yyvsp[(1) - (1)].expr)); ;}
3223 break;
3224
3225 case 173:
3226
3227 /* Line 1455 of yacc.c */
3228 #line 739 "parser.y"
3229 { (yyval.argument_list) = argument_list_add(ctx, (yyvsp[(1) - (3)].argument_list), (yyvsp[(3) - (3)].expr)); ;}
3230 break;
3231
3232 case 174:
3233
3234 /* Line 1455 of yacc.c */
3235 #line 743 "parser.y"
3236 { (yyval.expr) = new_this_expression(ctx); ;}
3237 break;
3238
3239 case 175:
3240
3241 /* Line 1455 of yacc.c */
3242 #line 744 "parser.y"
3243 { (yyval.expr) = new_identifier_expression(ctx, (yyvsp[(1) - (1)].identifier)); ;}
3244 break;
3245
3246 case 176:
3247
3248 /* Line 1455 of yacc.c */
3249 #line 745 "parser.y"
3250 { (yyval.expr) = new_literal_expression(ctx, (yyvsp[(1) - (1)].literal)); ;}
3251 break;
3252
3253 case 177:
3254
3255 /* Line 1455 of yacc.c */
3256 #line 746 "parser.y"
3257 { (yyval.expr) = (yyvsp[(1) - (1)].expr); ;}
3258 break;
3259
3260 case 178:
3261
3262 /* Line 1455 of yacc.c */
3263 #line 747 "parser.y"
3264 { (yyval.expr) = (yyvsp[(1) - (1)].expr); ;}
3265 break;
3266
3267 case 179:
3268
3269 /* Line 1455 of yacc.c */
3270 #line 748 "parser.y"
3271 { (yyval.expr) = (yyvsp[(2) - (3)].expr); ;}
3272 break;
3273
3274 case 180:
3275
3276 /* Line 1455 of yacc.c */
3277 #line 752 "parser.y"
3278 { (yyval.expr) = new_array_literal_expression(ctx, NULL, 0); ;}
3279 break;
3280
3281 case 181:
3282
3283 /* Line 1455 of yacc.c */
3284 #line 753 "parser.y"
3285 { (yyval.expr) = new_array_literal_expression(ctx, NULL, (yyvsp[(2) - (3)].ival)+1); ;}
3286 break;
3287
3288 case 182:
3289
3290 /* Line 1455 of yacc.c */
3291 #line 754 "parser.y"
3292 { (yyval.expr) = new_array_literal_expression(ctx, (yyvsp[(2) - (3)].element_list), 0); ;}
3293 break;
3294
3295 case 183:
3296
3297 /* Line 1455 of yacc.c */
3298 #line 756 "parser.y"
3299 { (yyval.expr) = new_array_literal_expression(ctx, (yyvsp[(2) - (5)].element_list), (yyvsp[(4) - (5)].ival)+1); ;}
3300 break;
3301
3302 case 184:
3303
3304 /* Line 1455 of yacc.c */
3305 #line 761 "parser.y"
3306 { (yyval.element_list) = new_element_list(ctx, (yyvsp[(1) - (2)].ival), (yyvsp[(2) - (2)].expr)); ;}
3307 break;
3308
3309 case 185:
3310
3311 /* Line 1455 of yacc.c */
3312 #line 763 "parser.y"
3313 { (yyval.element_list) = element_list_add(ctx, (yyvsp[(1) - (4)].element_list), (yyvsp[(3) - (4)].ival), (yyvsp[(4) - (4)].expr)); ;}
3314 break;
3315
3316 case 186:
3317
3318 /* Line 1455 of yacc.c */
3319 #line 767 "parser.y"
3320 { (yyval.ival) = 1; ;}
3321 break;
3322
3323 case 187:
3324
3325 /* Line 1455 of yacc.c */
3326 #line 768 "parser.y"
3327 { (yyval.ival) = (yyvsp[(1) - (2)].ival) + 1; ;}
3328 break;
3329
3330 case 188:
3331
3332 /* Line 1455 of yacc.c */
3333 #line 772 "parser.y"
3334 { (yyval.ival) = 0; ;}
3335 break;
3336
3337 case 189:
3338
3339 /* Line 1455 of yacc.c */
3340 #line 773 "parser.y"
3341 { (yyval.ival) = (yyvsp[(1) - (1)].ival); ;}
3342 break;
3343
3344 case 190:
3345
3346 /* Line 1455 of yacc.c */
3347 #line 777 "parser.y"
3348 { (yyval.expr) = new_prop_and_value_expression(ctx, NULL); ;}
3349 break;
3350
3351 case 191:
3352
3353 /* Line 1455 of yacc.c */
3354 #line 779 "parser.y"
3355 { (yyval.expr) = new_prop_and_value_expression(ctx, (yyvsp[(2) - (3)].property_list)); ;}
3356 break;
3357
3358 case 192:
3359
3360 /* Line 1455 of yacc.c */
3361 #line 784 "parser.y"
3362 { (yyval.property_list) = new_property_list(ctx, (yyvsp[(1) - (3)].literal), (yyvsp[(3) - (3)].expr)); ;}
3363 break;
3364
3365 case 193:
3366
3367 /* Line 1455 of yacc.c */
3368 #line 786 "parser.y"
3369 { (yyval.property_list) = property_list_add(ctx, (yyvsp[(1) - (5)].property_list), (yyvsp[(3) - (5)].literal), (yyvsp[(5) - (5)].expr)); ;}
3370 break;
3371
3372 case 194:
3373
3374 /* Line 1455 of yacc.c */
3375 #line 790 "parser.y"
3376 { (yyval.literal) = new_string_literal(ctx, (yyvsp[(1) - (1)].identifier)); ;}
3377 break;
3378
3379 case 195:
3380
3381 /* Line 1455 of yacc.c */
3382 #line 791 "parser.y"
3383 { (yyval.literal) = new_string_literal(ctx, (yyvsp[(1) - (1)].wstr)); ;}
3384 break;
3385
3386 case 196:
3387
3388 /* Line 1455 of yacc.c */
3389 #line 792 "parser.y"
3390 { (yyval.literal) = (yyvsp[(1) - (1)].literal); ;}
3391 break;
3392
3393 case 197:
3394
3395 /* Line 1455 of yacc.c */
3396 #line 796 "parser.y"
3397 { (yyval.identifier) = NULL; ;}
3398 break;
3399
3400 case 198:
3401
3402 /* Line 1455 of yacc.c */
3403 #line 797 "parser.y"
3404 { (yyval.identifier) = (yyvsp[(1) - (1)].identifier); ;}
3405 break;
3406
3407 case 199:
3408
3409 /* Line 1455 of yacc.c */
3410 #line 801 "parser.y"
3411 { (yyval.literal) = new_null_literal(ctx); ;}
3412 break;
3413
3414 case 200:
3415
3416 /* Line 1455 of yacc.c */
3417 #line 802 "parser.y"
3418 { (yyval.literal) = (yyvsp[(1) - (1)].literal); ;}
3419 break;
3420
3421 case 201:
3422
3423 /* Line 1455 of yacc.c */
3424 #line 803 "parser.y"
3425 { (yyval.literal) = (yyvsp[(1) - (1)].literal); ;}
3426 break;
3427
3428 case 202:
3429
3430 /* Line 1455 of yacc.c */
3431 #line 804 "parser.y"
3432 { (yyval.literal) = new_string_literal(ctx, (yyvsp[(1) - (1)].wstr)); ;}
3433 break;
3434
3435 case 203:
3436
3437 /* Line 1455 of yacc.c */
3438 #line 805 "parser.y"
3439 { (yyval.literal) = parse_regexp(ctx);
3440 if(!(yyval.literal)) YYABORT; ;}
3441 break;
3442
3443 case 204:
3444
3445 /* Line 1455 of yacc.c */
3446 #line 807 "parser.y"
3447 { (yyval.literal) = parse_regexp(ctx);
3448 if(!(yyval.literal)) YYABORT; ;}
3449 break;
3450
3451 case 205:
3452
3453 /* Line 1455 of yacc.c */
3454 #line 812 "parser.y"
3455 { (yyval.literal) = new_boolean_literal(ctx, VARIANT_TRUE); ;}
3456 break;
3457
3458 case 206:
3459
3460 /* Line 1455 of yacc.c */
3461 #line 813 "parser.y"
3462 { (yyval.literal) = new_boolean_literal(ctx, VARIANT_FALSE); ;}
3463 break;
3464
3465 case 208:
3466
3467 /* Line 1455 of yacc.c */
3468 #line 817 "parser.y"
3469 { if(!allow_auto_semicolon(ctx)) {YYABORT;} ;}
3470 break;
3471
3472 case 210:
3473
3474 /* Line 1455 of yacc.c */
3475 #line 821 "parser.y"
3476 { set_error(ctx, IDS_LBRACKET); YYABORT; ;}
3477 break;
3478
3479 case 212:
3480
3481 /* Line 1455 of yacc.c */
3482 #line 825 "parser.y"
3483 { set_error(ctx, IDS_RBRACKET); YYABORT; ;}
3484 break;
3485
3486 case 214:
3487
3488 /* Line 1455 of yacc.c */
3489 #line 829 "parser.y"
3490 { set_error(ctx, IDS_SEMICOLON); YYABORT; ;}
3491 break;
3492
3493
3494
3495 /* Line 1455 of yacc.c */
3496 #line 3497 "parser.tab.c"
3497 default: break;
3498 }
3499 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
3500
3501 YYPOPSTACK (yylen);
3502 yylen = 0;
3503 YY_STACK_PRINT (yyss, yyssp);
3504
3505 *++yyvsp = yyval;
3506
3507 /* Now `shift' the result of the reduction. Determine what state
3508 that goes to, based on the state we popped back to and the rule
3509 number reduced by. */
3510
3511 yyn = yyr1[yyn];
3512
3513 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
3514 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
3515 yystate = yytable[yystate];
3516 else
3517 yystate = yydefgoto[yyn - YYNTOKENS];
3518
3519 goto yynewstate;
3520
3521
3522 /*------------------------------------.
3523 | yyerrlab -- here on detecting error |
3524 `------------------------------------*/
3525 yyerrlab:
3526 /* If not already recovering from an error, report this error. */
3527 if (!yyerrstatus)
3528 {
3529 ++yynerrs;
3530 #if ! YYERROR_VERBOSE
3531 yyerror (YY_("syntax error"));
3532 #else
3533 {
3534 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
3535 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
3536 {
3537 YYSIZE_T yyalloc = 2 * yysize;
3538 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
3539 yyalloc = YYSTACK_ALLOC_MAXIMUM;
3540 if (yymsg != yymsgbuf)
3541 YYSTACK_FREE (yymsg);
3542 yymsg = (char *) YYSTACK_ALLOC (yyalloc);
3543 if (yymsg)
3544 yymsg_alloc = yyalloc;
3545 else
3546 {
3547 yymsg = yymsgbuf;
3548 yymsg_alloc = sizeof yymsgbuf;
3549 }
3550 }
3551
3552 if (0 < yysize && yysize <= yymsg_alloc)
3553 {
3554 (void) yysyntax_error (yymsg, yystate, yychar);
3555 yyerror (yymsg);
3556 }
3557 else
3558 {
3559 yyerror (YY_("syntax error"));
3560 if (yysize != 0)
3561 goto yyexhaustedlab;
3562 }
3563 }
3564 #endif
3565 }
3566
3567
3568
3569 if (yyerrstatus == 3)
3570 {
3571 /* If just tried and failed to reuse lookahead token after an
3572 error, discard it. */
3573
3574 if (yychar <= YYEOF)
3575 {
3576 /* Return failure if at end of input. */
3577 if (yychar == YYEOF)
3578 YYABORT;
3579 }
3580 else
3581 {
3582 yydestruct ("Error: discarding",
3583 yytoken, &yylval);
3584 yychar = YYEMPTY;
3585 }
3586 }
3587
3588 /* Else will try to reuse lookahead token after shifting the error
3589 token. */
3590 goto yyerrlab1;
3591
3592
3593 /*---------------------------------------------------.
3594 | yyerrorlab -- error raised explicitly by YYERROR. |
3595 `---------------------------------------------------*/
3596 yyerrorlab:
3597
3598 /* Pacify compilers like GCC when the user code never invokes
3599 YYERROR and the label yyerrorlab therefore never appears in user
3600 code. */
3601 if (/*CONSTCOND*/ 0)
3602 goto yyerrorlab;
3603
3604 /* Do not reclaim the symbols of the rule which action triggered
3605 this YYERROR. */
3606 YYPOPSTACK (yylen);
3607 yylen = 0;
3608 YY_STACK_PRINT (yyss, yyssp);
3609 yystate = *yyssp;
3610 goto yyerrlab1;
3611
3612
3613 /*-------------------------------------------------------------.
3614 | yyerrlab1 -- common code for both syntax error and YYERROR. |
3615 `-------------------------------------------------------------*/
3616 yyerrlab1:
3617 yyerrstatus = 3; /* Each real token shifted decrements this. */
3618
3619 for (;;)
3620 {
3621 yyn = yypact[yystate];
3622 if (yyn != YYPACT_NINF)
3623 {
3624 yyn += YYTERROR;
3625 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
3626 {
3627 yyn = yytable[yyn];
3628 if (0 < yyn)
3629 break;
3630 }
3631 }
3632
3633 /* Pop the current state because it cannot handle the error token. */
3634 if (yyssp == yyss)
3635 YYABORT;
3636
3637
3638 yydestruct ("Error: popping",
3639 yystos[yystate], yyvsp);
3640 YYPOPSTACK (1);
3641 yystate = *yyssp;
3642 YY_STACK_PRINT (yyss, yyssp);
3643 }
3644
3645 *++yyvsp = yylval;
3646
3647
3648 /* Shift the error token. */
3649 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
3650
3651 yystate = yyn;
3652 goto yynewstate;
3653
3654
3655 /*-------------------------------------.
3656 | yyacceptlab -- YYACCEPT comes here. |
3657 `-------------------------------------*/
3658 yyacceptlab:
3659 yyresult = 0;
3660 goto yyreturn;
3661
3662 /*-----------------------------------.
3663 | yyabortlab -- YYABORT comes here. |
3664 `-----------------------------------*/
3665 yyabortlab:
3666 yyresult = 1;
3667 goto yyreturn;
3668
3669 #if !defined(yyoverflow) || YYERROR_VERBOSE
3670 /*-------------------------------------------------.
3671 | yyexhaustedlab -- memory exhaustion comes here. |
3672 `-------------------------------------------------*/
3673 yyexhaustedlab:
3674 yyerror (YY_("memory exhausted"));
3675 yyresult = 2;
3676 /* Fall through. */
3677 #endif
3678
3679 yyreturn:
3680 if (yychar != YYEMPTY)
3681 yydestruct ("Cleanup: discarding lookahead",
3682 yytoken, &yylval);
3683 /* Do not reclaim the symbols of the rule which action triggered
3684 this YYABORT or YYACCEPT. */
3685 YYPOPSTACK (yylen);
3686 YY_STACK_PRINT (yyss, yyssp);
3687 while (yyssp != yyss)
3688 {
3689 yydestruct ("Cleanup: popping",
3690 yystos[*yyssp], yyvsp);
3691 YYPOPSTACK (1);
3692 }
3693 #ifndef yyoverflow
3694 if (yyss != yyssa)
3695 YYSTACK_FREE (yyss);
3696 #endif
3697 #if YYERROR_VERBOSE
3698 if (yymsg != yymsgbuf)
3699 YYSTACK_FREE (yymsg);
3700 #endif
3701 /* Make sure YYID is used. */
3702 return YYID (yyresult);
3703 }
3704
3705
3706
3707 /* Line 1675 of yacc.c */
3708 #line 831 "parser.y"
3709
3710
3711 static BOOL allow_auto_semicolon(parser_ctx_t *ctx)
3712 {
3713 return ctx->nl || ctx->ptr == ctx->end || *(ctx->ptr-1) == '}';
3714 }
3715
3716 static literal_t *new_string_literal(parser_ctx_t *ctx, const WCHAR *str)
3717 {
3718 literal_t *ret = parser_alloc(ctx, sizeof(literal_t));
3719
3720 ret->type = LT_STRING;
3721 ret->u.wstr = str;
3722
3723 return ret;
3724 }
3725
3726 static literal_t *new_null_literal(parser_ctx_t *ctx)
3727 {
3728 literal_t *ret = parser_alloc(ctx, sizeof(literal_t));
3729
3730 ret->type = LT_NULL;
3731
3732 return ret;
3733 }
3734
3735 static literal_t *new_boolean_literal(parser_ctx_t *ctx, VARIANT_BOOL bval)
3736 {
3737 literal_t *ret = parser_alloc(ctx, sizeof(literal_t));
3738
3739 ret->type = LT_BOOL;
3740 ret->u.bval = bval;
3741
3742 return ret;
3743 }
3744
3745 static prop_val_t *new_prop_val(parser_ctx_t *ctx, literal_t *name, expression_t *value)
3746 {
3747 prop_val_t *ret = parser_alloc(ctx, sizeof(prop_val_t));
3748
3749 ret->name = name;
3750 ret->value = value;
3751 ret->next = NULL;
3752
3753 return ret;
3754 }
3755
3756 static property_list_t *new_property_list(parser_ctx_t *ctx, literal_t *name, expression_t *value)
3757 {
3758 property_list_t *ret = parser_alloc_tmp(ctx, sizeof(property_list_t));
3759
3760 ret->head = ret->tail = new_prop_val(ctx, name, value);
3761
3762 return ret;
3763 }
3764
3765 static property_list_t *property_list_add(parser_ctx_t *ctx, property_list_t *list, literal_t *name, expression_t *value)
3766 {
3767 list->tail = list->tail->next = new_prop_val(ctx, name, value);
3768
3769 return list;
3770 }
3771
3772 static array_element_t *new_array_element(parser_ctx_t *ctx, int elision, expression_t *expr)
3773 {
3774 array_element_t *ret = parser_alloc(ctx, sizeof(array_element_t));
3775
3776 ret->elision = elision;
3777 ret->expr = expr;
3778 ret->next = NULL;
3779
3780 return ret;
3781 }
3782
3783 static element_list_t *new_element_list(parser_ctx_t *ctx, int elision, expression_t *expr)
3784 {
3785 element_list_t *ret = parser_alloc_tmp(ctx, sizeof(element_list_t));
3786
3787 ret->head = ret->tail = new_array_element(ctx, elision, expr);
3788
3789 return ret;
3790 }
3791
3792 static element_list_t *element_list_add(parser_ctx_t *ctx, element_list_t *list, int elision, expression_t *expr)
3793 {
3794 list->tail = list->tail->next = new_array_element(ctx, elision, expr);
3795
3796 return list;
3797 }
3798
3799 static argument_t *new_argument(parser_ctx_t *ctx, expression_t *expr)
3800 {
3801 argument_t *ret = parser_alloc(ctx, sizeof(argument_t));
3802
3803 ret->expr = expr;
3804 ret->next = NULL;
3805
3806 return ret;
3807 }
3808
3809 static argument_list_t *new_argument_list(parser_ctx_t *ctx, expression_t *expr)
3810 {
3811 argument_list_t *ret = parser_alloc_tmp(ctx, sizeof(argument_list_t));
3812
3813 ret->head = ret->tail = new_argument(ctx, expr);
3814
3815 return ret;
3816 }
3817
3818 static argument_list_t *argument_list_add(parser_ctx_t *ctx, argument_list_t *list, expression_t *expr)
3819 {
3820 list->tail = list->tail->next = new_argument(ctx, expr);
3821
3822 return list;
3823 }
3824
3825 static catch_block_t *new_catch_block(parser_ctx_t *ctx, const WCHAR *identifier, statement_t *statement)
3826 {
3827 catch_block_t *ret = parser_alloc(ctx, sizeof(catch_block_t));
3828
3829 ret->identifier = identifier;
3830 ret->statement = statement;
3831
3832 return ret;
3833 }
3834
3835 static case_clausule_t *new_case_clausule(parser_ctx_t *ctx, expression_t *expr, statement_list_t *stat_list)
3836 {
3837 case_clausule_t *ret = parser_alloc(ctx, sizeof(case_clausule_t));
3838
3839 ret->expr = expr;
3840 ret->stat = stat_list ? stat_list->head : NULL;
3841 ret->next = NULL;
3842
3843 return ret;
3844 }
3845
3846 static case_list_t *new_case_list(parser_ctx_t *ctx, case_clausule_t *case_clausule)
3847 {
3848 case_list_t *ret = parser_alloc_tmp(ctx, sizeof(case_list_t));
3849
3850 ret->head = ret->tail = case_clausule;
3851
3852 return ret;
3853 }
3854
3855 static case_list_t *case_list_add(parser_ctx_t *ctx, case_list_t *list, case_clausule_t *case_clausule)
3856 {
3857 list->tail = list->tail->next = case_clausule;
3858
3859 return list;
3860 }
3861
3862 static case_clausule_t *new_case_block(parser_ctx_t *ctx, case_list_t *case_list1,
3863 case_clausule_t *default_clausule, case_list_t *case_list2)
3864 {
3865 case_clausule_t *ret = NULL, *iter = NULL, *iter2;
3866 statement_t *stat = NULL;
3867
3868 if(case_list1) {
3869 ret = case_list1->head;
3870 iter = case_list1->tail;
3871 }
3872
3873 if(default_clausule) {
3874 if(ret)
3875 iter = iter->next = default_clausule;
3876 else
3877 ret = iter = default_clausule;
3878 }
3879
3880 if(case_list2) {
3881 if(ret)
3882 iter->next = case_list2->head;
3883 else
3884 ret = case_list2->head;
3885 }
3886
3887 if(!ret)
3888 return NULL;
3889
3890 for(iter = ret; iter; iter = iter->next) {
3891 for(iter2 = iter; iter2 && !iter2->stat; iter2 = iter2->next);
3892 if(!iter2)
3893 break;
3894
3895 while(iter != iter2) {
3896 iter->stat = iter2->stat;
3897 iter = iter->next;
3898 }
3899
3900 if(stat) {
3901 while(stat->next)
3902 stat = stat->next;
3903 stat->next = iter->stat;
3904 }else {
3905 stat = iter->stat;
3906 }
3907 }
3908
3909 return ret;
3910 }
3911
3912 static statement_t *new_block_statement(parser_ctx_t *ctx, statement_list_t *list)
3913 {
3914 block_statement_t *ret = parser_alloc(ctx, sizeof(block_statement_t));
3915
3916 ret->stat.eval = block_statement_eval;
3917 ret->stat.next = NULL;
3918 ret->stat_list = list ? list->head : NULL;
3919
3920 return &ret->stat;
3921 }
3922
3923 static variable_declaration_t *new_variable_declaration(parser_ctx_t *ctx, const WCHAR *identifier, expression_t *expr)
3924 {
3925 variable_declaration_t *ret = parser_alloc(ctx, sizeof(variable_declaration_t));
3926 var_list_t *var_list = parser_alloc(ctx, sizeof(var_list_t));
3927
3928 ret->identifier = identifier;
3929 ret->expr = expr;
3930 ret->next = NULL;
3931
3932 var_list->identifier = identifier;
3933 var_list->next = NULL;
3934
3935 if(ctx->func_stack->var_tail)
3936 ctx->func_stack->var_tail = ctx->func_stack->var_tail->next = var_list;
3937 else
3938 ctx->func_stack->var_head = ctx->func_stack->var_tail = var_list;
3939
3940 return ret;
3941 }
3942
3943 static variable_list_t *new_variable_list(parser_ctx_t *ctx, variable_declaration_t *decl)
3944 {
3945 variable_list_t *ret = parser_alloc_tmp(ctx, sizeof(variable_list_t));
3946
3947 ret->head = ret->tail = decl;
3948
3949 return ret;
3950 }
3951
3952 static variable_list_t *variable_list_add(parser_ctx_t *ctx, variable_list_t *list, variable_declaration_t *decl)
3953 {
3954 list->tail = list->tail->next = decl;
3955
3956 return list;
3957 }
3958
3959 static statement_t *new_var_statement(parser_ctx_t *ctx, variable_list_t *variable_list)
3960 {
3961 var_statement_t *ret = parser_alloc(ctx, sizeof(var_statement_t));
3962
3963 ret->stat.eval = var_statement_eval;
3964 ret->stat.next = NULL;
3965 ret->variable_list = variable_list->head;
3966
3967 return &ret->stat;
3968 }
3969
3970 static statement_t *new_empty_statement(parser_ctx_t *ctx)
3971 {
3972 statement_t *ret = parser_alloc(ctx, sizeof(statement_t));
3973
3974 ret->eval = empty_statement_eval;
3975 ret->next = NULL;
3976
3977 return ret;
3978 }
3979
3980 static statement_t *new_expression_statement(parser_ctx_t *ctx, expression_t *expr)
3981 {
3982 expression_statement_t *ret = parser_alloc(ctx, sizeof(expression_statement_t));
3983
3984 ret->stat.eval = expression_statement_eval;
3985 ret->stat.next = NULL;
3986 ret->expr = expr;
3987
3988 return &ret->stat;
3989 }
3990
3991 static statement_t *new_if_statement(parser_ctx_t *ctx, expression_t *expr, statement_t *if_stat, statement_t *else_stat)
3992 {
3993 if_statement_t *ret = parser_alloc(ctx, sizeof(if_statement_t));
3994
3995 ret->stat.eval = if_statement_eval;
3996 ret->stat.next = NULL;
3997 ret->expr = expr;
3998 ret->if_stat = if_stat;
3999 ret->else_stat = else_stat;
4000
4001 return &ret->stat;
4002 }
4003
4004 static statement_t *new_while_statement(parser_ctx_t *ctx, BOOL dowhile, expression_t *expr, statement_t *stat)
4005 {
4006 while_statement_t *ret = parser_alloc(ctx, sizeof(while_statement_t));
4007
4008 ret->stat.eval = while_statement_eval;
4009 ret->stat.next = NULL;
4010 ret->do_while = dowhile;
4011 ret->expr = expr;
4012 ret->statement = stat;
4013
4014 return &ret->stat;
4015 }
4016
4017 static statement_t *new_for_statement(parser_ctx_t *ctx, variable_list_t *variable_list, expression_t *begin_expr,
4018 expression_t *expr, expression_t *end_expr, statement_t *statement)
4019 {
4020 for_statement_t *ret = parser_alloc(ctx, sizeof(for_statement_t));
4021
4022 ret->stat.eval = for_statement_eval;
4023 ret->stat.next = NULL;
4024 ret->variable_list = variable_list ? variable_list->head : NULL;
4025 ret->begin_expr = begin_expr;
4026 ret->expr = expr;
4027 ret->end_expr = end_expr;
4028 ret->statement = statement;
4029
4030 return &ret->stat;
4031 }
4032
4033 static statement_t *new_forin_statement(parser_ctx_t *ctx, variable_declaration_t *variable, expression_t *expr,
4034 expression_t *in_expr, statement_t *statement)
4035 {
4036 forin_statement_t *ret = parser_alloc(ctx, sizeof(forin_statement_t));
4037
4038 ret->stat.eval = forin_statement_eval;
4039 ret->stat.next = NULL;
4040 ret->variable = variable;
4041 ret->expr = expr;
4042 ret->in_expr = in_expr;
4043 ret->statement = statement;
4044
4045 return &ret->stat;
4046 }
4047
4048 static statement_t *new_continue_statement(parser_ctx_t *ctx, const WCHAR *identifier)
4049 {
4050 branch_statement_t *ret = parser_alloc(ctx, sizeof(branch_statement_t));
4051
4052 ret->stat.eval = continue_statement_eval;
4053 ret->stat.next = NULL;
4054 ret->identifier = identifier;
4055
4056 return &ret->stat;
4057 }
4058
4059 static statement_t *new_break_statement(parser_ctx_t *ctx, const WCHAR *identifier)
4060 {
4061 branch_statement_t *ret = parser_alloc(ctx, sizeof(branch_statement_t));
4062
4063 ret->stat.eval = break_statement_eval;
4064 ret->stat.next = NULL;
4065 ret->identifier = identifier;
4066
4067 return &ret->stat;
4068 }
4069
4070 static statement_t *new_return_statement(parser_ctx_t *ctx, expression_t *expr)
4071 {
4072 expression_statement_t *ret = parser_alloc(ctx, sizeof(expression_statement_t));
4073
4074 ret->stat.eval = return_statement_eval;
4075 ret->stat.next = NULL;
4076 ret->expr = expr;
4077
4078 return &ret->stat;
4079 }
4080
4081 static statement_t *new_with_statement(parser_ctx_t *ctx, expression_t *expr, statement_t *statement)
4082 {
4083 with_statement_t *ret = parser_alloc(ctx, sizeof(with_statement_t));
4084
4085 ret->stat.eval = with_statement_eval;
4086 ret->stat.next = NULL;
4087 ret->expr = expr;
4088 ret->statement = statement;
4089
4090 return &ret->stat;
4091 }
4092
4093 static statement_t *new_labelled_statement(parser_ctx_t *ctx, const WCHAR *identifier, statement_t *statement)
4094 {
4095 labelled_statement_t *ret = parser_alloc(ctx, sizeof(labelled_statement_t));
4096
4097 ret->stat.eval = labelled_statement_eval;
4098 ret->stat.next = NULL;
4099 ret->identifier = identifier;
4100 ret->statement = statement;
4101
4102 return &ret->stat;
4103 }
4104
4105 static statement_t *new_switch_statement(parser_ctx_t *ctx, expression_t *expr, case_clausule_t *case_list)
4106 {
4107 switch_statement_t *ret = parser_alloc(ctx, sizeof(switch_statement_t));
4108
4109 ret->stat.eval = switch_statement_eval;
4110 ret->stat.next = NULL;
4111 ret->expr = expr;
4112 ret->case_list = case_list;
4113
4114 return &ret->stat;
4115 }
4116
4117 static statement_t *new_throw_statement(parser_ctx_t *ctx, expression_t *expr)
4118 {
4119 expression_statement_t *ret = parser_alloc(ctx, sizeof(expression_statement_t));
4120
4121 ret->stat.eval = throw_statement_eval;
4122 ret->stat.next = NULL;
4123 ret->expr = expr;
4124
4125 return &ret->stat;
4126 }
4127
4128 static statement_t *new_try_statement(parser_ctx_t *ctx, statement_t *try_statement,
4129 catch_block_t *catch_block, statement_t *finally_statement)
4130 {
4131 try_statement_t *ret = parser_alloc(ctx, sizeof(try_statement_t));
4132
4133 ret->stat.eval = try_statement_eval;
4134 ret->stat.next = NULL;
4135 ret->try_statement = try_statement;
4136 ret->catch_block = catch_block;
4137 ret->finally_statement = finally_statement;
4138
4139 return &ret->stat;
4140 }
4141
4142 static parameter_t *new_parameter(parser_ctx_t *ctx, const WCHAR *identifier)
4143 {
4144 parameter_t *ret = parser_alloc(ctx, sizeof(parameter_t));
4145
4146 ret->identifier = identifier;
4147 ret->next = NULL;
4148
4149 return ret;
4150 }
4151
4152 static parameter_list_t *new_parameter_list(parser_ctx_t *ctx, const WCHAR *identifier)
4153 {
4154 parameter_list_t *ret = parser_alloc_tmp(ctx, sizeof(parameter_list_t));
4155
4156 ret->head = ret->tail = new_parameter(ctx, identifier);
4157
4158 return ret;
4159 }
4160
4161 static parameter_list_t *parameter_list_add(parser_ctx_t *ctx, parameter_list_t *list, const WCHAR *identifier)
4162 {
4163 list->tail = list->tail->next = new_parameter(ctx, identifier);
4164
4165 return list;
4166 }
4167
4168 static expression_t *new_function_expression(parser_ctx_t *ctx, const WCHAR *identifier,
4169 parameter_list_t *parameter_list, source_elements_t *source_elements, const WCHAR *src_str, DWORD src_len)
4170 {
4171 function_expression_t *ret = parser_alloc(ctx, sizeof(function_expression_t));
4172
4173 ret->expr.eval = function_expression_eval;
4174 ret->identifier = identifier;
4175 ret->parameter_list = parameter_list ? parameter_list->head : NULL;
4176 ret->source_elements = source_elements;
4177 ret->src_str = src_str;
4178 ret->src_len = src_len;
4179
4180 if(ret->identifier) {
4181 function_declaration_t *decl = parser_alloc(ctx, sizeof(function_declaration_t));
4182
4183 decl->expr = ret;
4184 decl->next = NULL;
4185
4186 if(ctx->func_stack->func_tail)
4187 ctx->func_stack->func_tail = ctx->func_stack->func_tail->next = decl;
4188 else
4189 ctx->func_stack->func_head = ctx->func_stack->func_tail = decl;
4190 }
4191
4192 return &ret->expr;
4193 }
4194
4195 static const expression_eval_t expression_eval_table[] = {
4196 comma_expression_eval,
4197 logical_or_expression_eval,
4198 logical_and_expression_eval,
4199 binary_or_expression_eval,
4200 binary_xor_expression_eval,
4201 binary_and_expression_eval,
4202 instanceof_expression_eval,
4203 in_expression_eval,
4204 add_expression_eval,
4205 sub_expression_eval,
4206 mul_expression_eval,
4207 div_expression_eval,
4208 mod_expression_eval,
4209 delete_expression_eval,
4210 void_expression_eval,
4211 typeof_expression_eval,
4212 minus_expression_eval,
4213 plus_expression_eval,
4214 post_increment_expression_eval,
4215 post_decrement_expression_eval,
4216 pre_increment_expression_eval,
4217 pre_decrement_expression_eval,
4218 equal_expression_eval,
4219 equal2_expression_eval,
4220 not_equal_expression_eval,
4221 not_equal2_expression_eval,
4222 less_expression_eval,
4223 lesseq_expression_eval,
4224 greater_expression_eval,
4225 greatereq_expression_eval,
4226 binary_negation_expression_eval,
4227 logical_negation_expression_eval,
4228 left_shift_expression_eval,
4229 right_shift_expression_eval,
4230 right2_shift_expression_eval,
4231 assign_expression_eval,
4232 assign_lshift_expression_eval,
4233 assign_rshift_expression_eval,
4234 assign_rrshift_expression_eval,
4235 assign_add_expression_eval,
4236 assign_sub_expression_eval,
4237 assign_mul_expression_eval,
4238 assign_div_expression_eval,
4239 assign_mod_expression_eval,
4240 assign_and_expression_eval,
4241 assign_or_expression_eval,
4242 assign_xor_expression_eval,
4243 };
4244
4245 static expression_t *new_binary_expression(parser_ctx_t *ctx, expression_type_t type,
4246 expression_t *expression1, expression_t *expression2)
4247 {
4248 binary_expression_t *ret = parser_alloc(ctx, sizeof(binary_expression_t));
4249
4250 ret->expr.eval = expression_eval_table[type];
4251 ret->expression1 = expression1;
4252 ret->expression2 = expression2;
4253
4254 return &ret->expr;
4255 }
4256
4257 static expression_t *new_unary_expression(parser_ctx_t *ctx, expression_type_t type, expression_t *expression)
4258 {
4259 unary_expression_t *ret = parser_alloc(ctx, sizeof(unary_expression_t));
4260
4261 ret->expr.eval = expression_eval_table[type];
4262 ret->expression = expression;
4263
4264 return &ret->expr;
4265 }
4266
4267 static expression_t *new_conditional_expression(parser_ctx_t *ctx, expression_t *expression,
4268 expression_t *true_expression, expression_t *false_expression)
4269 {
4270 conditional_expression_t *ret = parser_alloc(ctx, sizeof(conditional_expression_t));
4271
4272 ret->expr.eval = conditional_expression_eval;
4273 ret->expression = expression;
4274 ret->true_expression = true_expression;
4275 ret->false_expression = false_expression;
4276
4277 return &ret->expr;
4278 }
4279
4280 static expression_t *new_array_expression(parser_ctx_t *ctx, expression_t *member_expr, expression_t *expression)
4281 {
4282 array_expression_t *ret = parser_alloc(ctx, sizeof(array_expression_t));
4283
4284 ret->expr.eval = array_expression_eval;
4285 ret->member_expr = member_expr;
4286 ret->expression = expression;
4287
4288 return &ret->expr;
4289 }
4290
4291 static expression_t *new_member_expression(parser_ctx_t *ctx, expression_t *expression, const WCHAR *identifier)
4292 {
4293 member_expression_t *ret = parser_alloc(ctx, sizeof(member_expression_t));
4294
4295 ret->expr.eval = member_expression_eval;
4296 ret->expression = expression;
4297 ret->identifier = identifier;
4298
4299 return &ret->expr;
4300 }
4301
4302 static expression_t *new_new_expression(parser_ctx_t *ctx, expression_t *expression, argument_list_t *argument_list)
4303 {
4304 call_expression_t *ret = parser_alloc(ctx, sizeof(call_expression_t));
4305
4306 ret->expr.eval = new_expression_eval;
4307 ret->expression = expression;
4308 ret->argument_list = argument_list ? argument_list->head : NULL;
4309
4310 return &ret->expr;
4311 }
4312
4313 static expression_t *new_call_expression(parser_ctx_t *ctx, expression_t *expression, argument_list_t *argument_list)
4314 {
4315 call_expression_t *ret = parser_alloc(ctx, sizeof(call_expression_t));
4316
4317 ret->expr.eval = call_expression_eval;
4318 ret->expression = expression;
4319 ret->argument_list = argument_list ? argument_list->head : NULL;
4320
4321 return &ret->expr;
4322 }
4323
4324 static expression_t *new_this_expression(parser_ctx_t *ctx)
4325 {
4326 expression_t *ret = parser_alloc(ctx, sizeof(expression_t));
4327
4328 ret->eval = this_expression_eval;
4329
4330 return ret;
4331 }
4332
4333 static int parser_error(const char *str)
4334 {
4335 return 0;
4336 }
4337
4338 static void set_error(parser_ctx_t *ctx, UINT error)
4339 {
4340 ctx->hres = JSCRIPT_ERROR|error;
4341 }
4342
4343 static BOOL explicit_error(parser_ctx_t *ctx, void *obj, WCHAR next)
4344 {
4345 if(obj || *(ctx->ptr-1)==next) return TRUE;
4346
4347 set_error(ctx, IDS_SYNTAX_ERROR);
4348 return FALSE;
4349 }
4350
4351
4352 static expression_t *new_identifier_expression(parser_ctx_t *ctx, const WCHAR *identifier)
4353 {
4354 identifier_expression_t *ret = parser_alloc(ctx, sizeof(identifier_expression_t));
4355
4356 ret->expr.eval = identifier_expression_eval;
4357 ret->identifier = identifier;
4358
4359 return &ret->expr;
4360 }
4361
4362 static expression_t *new_array_literal_expression(parser_ctx_t *ctx, element_list_t *element_list, int length)
4363 {
4364 array_literal_expression_t *ret = parser_alloc(ctx, sizeof(array_literal_expression_t));
4365
4366 ret->expr.eval = array_literal_expression_eval;
4367 ret->element_list = element_list ? element_list->head : NULL;
4368 ret->length = length;
4369
4370 return &ret->expr;
4371 }
4372
4373 static expression_t *new_prop_and_value_expression(parser_ctx_t *ctx, property_list_t *property_list)
4374 {
4375 property_value_expression_t *ret = parser_alloc(ctx, sizeof(property_value_expression_t));
4376
4377 ret->expr.eval = property_value_expression_eval;
4378 ret->property_list = property_list ? property_list->head : NULL;
4379
4380 return &ret->expr;
4381 }
4382
4383 static expression_t *new_literal_expression(parser_ctx_t *ctx, literal_t *literal)
4384 {
4385 literal_expression_t *ret = parser_alloc(ctx, sizeof(literal_expression_t));
4386
4387 ret->expr.eval = literal_expression_eval;
4388 ret->literal = literal;
4389
4390 return &ret->expr;
4391 }
4392
4393 static source_elements_t *new_source_elements(parser_ctx_t *ctx)
4394 {
4395 source_elements_t *ret = parser_alloc(ctx, sizeof(source_elements_t));
4396
4397 memset(ret, 0, sizeof(*ret));
4398
4399 return ret;
4400 }
4401
4402 static source_elements_t *source_elements_add_statement(source_elements_t *source_elements, statement_t *statement)
4403 {
4404 if(source_elements->statement_tail)
4405 source_elements->statement_tail = source_elements->statement_tail->next = statement;
4406 else
4407 source_elements->statement = source_elements->statement_tail = statement;
4408
4409 return source_elements;
4410 }
4411
4412 static statement_list_t *new_statement_list(parser_ctx_t *ctx, statement_t *statement)
4413 {
4414 statement_list_t *ret = parser_alloc_tmp(ctx, sizeof(statement_list_t));
4415
4416 ret->head = ret->tail = statement;
4417
4418 return ret;
4419 }
4420
4421 static statement_list_t *statement_list_add(statement_list_t *list, statement_t *statement)
4422 {
4423 list->tail = list->tail->next = statement;
4424
4425 return list;
4426 }
4427
4428 static void push_func(parser_ctx_t *ctx)
4429 {
4430 func_stack_t *new_func = parser_alloc_tmp(ctx, sizeof(func_stack_t));
4431
4432 new_func->func_head = new_func->func_tail = NULL;
4433 new_func->var_head = new_func->var_tail = NULL;
4434
4435 new_func->next = ctx->func_stack;
4436 ctx->func_stack = new_func;
4437 }
4438
4439 static source_elements_t *function_body_parsed(parser_ctx_t *ctx, source_elements_t *source)
4440 {
4441 source->functions = ctx->func_stack->func_head;
4442 source->variables = ctx->func_stack->var_head;
4443 pop_func(ctx);
4444
4445 return source;
4446 }
4447
4448 static void program_parsed(parser_ctx_t *ctx, source_elements_t *source)
4449 {
4450 source->functions = ctx->func_stack->func_head;
4451 source->variables = ctx->func_stack->var_head;
4452 pop_func(ctx);
4453
4454 ctx->source = source;
4455 if(!ctx->lexer_error)
4456 ctx->hres = S_OK;
4457 }
4458
4459 void parser_release(parser_ctx_t *ctx)
4460 {
4461 if(--ctx->ref)
4462 return;
4463
4464 script_release(ctx->script);
4465 heap_free(ctx->begin);
4466 jsheap_free(&ctx->heap);
4467 heap_free(ctx);
4468 }
4469
4470 HRESULT script_parse(script_ctx_t *ctx, const WCHAR *code, const WCHAR *delimiter,
4471 parser_ctx_t **ret)
4472 {
4473 parser_ctx_t *parser_ctx;
4474 jsheap_t *mark;
4475 HRESULT hres;
4476
4477 const WCHAR html_tagW[] = {'<','/','s','c','r','i','p','t','>',0};
4478
4479 parser_ctx = heap_alloc_zero(sizeof(parser_ctx_t));
4480 if(!parser_ctx)
4481 return E_OUTOFMEMORY;
4482
4483 parser_ctx->ref = 1;
4484 parser_ctx->hres = JSCRIPT_ERROR|IDS_SYNTAX_ERROR;
4485 parser_ctx->is_html = delimiter && !strcmpiW(delimiter, html_tagW);
4486
4487 parser_ctx->begin = heap_strdupW(code);
4488 if(!parser_ctx->begin) {
4489 heap_free(parser_ctx);
4490 return E_OUTOFMEMORY;
4491 }
4492
4493 parser_ctx->ptr = parser_ctx->begin;
4494 parser_ctx->end = parser_ctx->begin + strlenW(parser_ctx->begin);
4495
4496 script_addref(ctx);
4497 parser_ctx->script = ctx;
4498
4499 mark = jsheap_mark(&ctx->tmp_heap);
4500 jsheap_init(&parser_ctx->heap);
4501
4502 push_func(parser_ctx);
4503
4504 parser_parse(parser_ctx);
4505 jsheap_clear(mark);
4506 if(FAILED(parser_ctx->hres)) {
4507 hres = parser_ctx->hres;
4508 parser_release(parser_ctx);
4509 return hres;
4510 }
4511
4512 *ret = parser_ctx;
4513 return S_OK;
4514 }
4515