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