[VBSCRIPT] Sync with Wine Staging 1.7.37. CORE-9246
[reactos.git] / reactos / dll / win32 / vbscript / parser.tab.c
1 /* A Bison parser, made by GNU Bison 3.0.2. */
2
3 /* Bison implementation for Yacc-like parsers in C
4
5 Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc.
6
7 This program is free software: you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>. */
19
20 /* As a special exception, you may create a larger work that contains
21 part or all of the Bison parser skeleton and distribute that work
22 under terms of your choice, so long as that work isn't itself a
23 parser generator using the skeleton or a modified version thereof
24 as a parser skeleton. Alternatively, if you modify or redistribute
25 the parser skeleton itself, you may (at your option) remove this
26 special exception, which will cause the skeleton and the resulting
27 Bison output files to be licensed under the GNU General Public
28 License without this special exception.
29
30 This special exception was added by the Free Software Foundation in
31 version 2.2 of Bison. */
32
33 /* C LALR(1) parser skeleton written by Richard Stallman, by
34 simplifying the original so-called "semantic" parser. */
35
36 /* All symbols defined below should begin with yy or YY, to avoid
37 infringing on user name space. This should be done even for local
38 variables, as they might otherwise be expanded by user macros.
39 There are some unavoidable exceptions within include files to
40 define necessary library symbols; they are noted "INFRINGES ON
41 USER NAME SPACE" below. */
42
43 /* Identify Bison output. */
44 #define YYBISON 1
45
46 /* Bison version. */
47 #define YYBISON_VERSION "3.0.2"
48
49 /* Skeleton name. */
50 #define YYSKELETON_NAME "yacc.c"
51
52 /* Pure parsers. */
53 #define YYPURE 1
54
55 /* Push parsers. */
56 #define YYPUSH 0
57
58 /* Pull parsers. */
59 #define YYPULL 1
60
61
62 /* Substitute the variable and function names. */
63 #define yyparse parser_parse
64 #define yylex parser_lex
65 #define yyerror parser_error
66 #define yydebug parser_debug
67 #define yynerrs parser_nerrs
68
69
70 /* Copy the first part of user declarations. */
71 #line 19 "parser.y" /* yacc.c:339 */
72
73
74 #include "vbscript.h"
75
76 static int parser_error(parser_ctx_t *,const char*);
77
78 static void parse_complete(parser_ctx_t*,BOOL);
79
80 static void source_add_statement(parser_ctx_t*,statement_t*);
81 static void source_add_class(parser_ctx_t*,class_decl_t*);
82
83 static void *new_expression(parser_ctx_t*,expression_type_t,size_t);
84 static expression_t *new_bool_expression(parser_ctx_t*,VARIANT_BOOL);
85 static expression_t *new_string_expression(parser_ctx_t*,const WCHAR*);
86 static expression_t *new_long_expression(parser_ctx_t*,expression_type_t,LONG);
87 static expression_t *new_double_expression(parser_ctx_t*,double);
88 static expression_t *new_unary_expression(parser_ctx_t*,expression_type_t,expression_t*);
89 static expression_t *new_binary_expression(parser_ctx_t*,expression_type_t,expression_t*,expression_t*);
90 static expression_t *new_new_expression(parser_ctx_t*,const WCHAR*);
91
92 static member_expression_t *new_member_expression(parser_ctx_t*,expression_t*,const WCHAR*);
93
94 static void *new_statement(parser_ctx_t*,statement_type_t,size_t);
95 static statement_t *new_call_statement(parser_ctx_t*,BOOL,member_expression_t*);
96 static statement_t *new_assign_statement(parser_ctx_t*,member_expression_t*,expression_t*);
97 static statement_t *new_set_statement(parser_ctx_t*,member_expression_t*,expression_t*);
98 static statement_t *new_dim_statement(parser_ctx_t*,dim_decl_t*);
99 static statement_t *new_while_statement(parser_ctx_t*,statement_type_t,expression_t*,statement_t*);
100 static statement_t *new_forto_statement(parser_ctx_t*,const WCHAR*,expression_t*,expression_t*,expression_t*,statement_t*);
101 static statement_t *new_foreach_statement(parser_ctx_t*,const WCHAR*,expression_t*,statement_t*);
102 static statement_t *new_if_statement(parser_ctx_t*,expression_t*,statement_t*,elseif_decl_t*,statement_t*);
103 static statement_t *new_function_statement(parser_ctx_t*,function_decl_t*);
104 static statement_t *new_onerror_statement(parser_ctx_t*,BOOL);
105 static statement_t *new_const_statement(parser_ctx_t*,const_decl_t*);
106 static statement_t *new_select_statement(parser_ctx_t*,expression_t*,case_clausule_t*);
107
108 static dim_decl_t *new_dim_decl(parser_ctx_t*,const WCHAR*,BOOL,dim_list_t*);
109 static dim_list_t *new_dim(parser_ctx_t*,unsigned,dim_list_t*);
110 static elseif_decl_t *new_elseif_decl(parser_ctx_t*,expression_t*,statement_t*);
111 static function_decl_t *new_function_decl(parser_ctx_t*,const WCHAR*,function_type_t,unsigned,arg_decl_t*,statement_t*);
112 static arg_decl_t *new_argument_decl(parser_ctx_t*,const WCHAR*,BOOL);
113 static const_decl_t *new_const_decl(parser_ctx_t*,const WCHAR*,expression_t*);
114 static case_clausule_t *new_case_clausule(parser_ctx_t*,expression_t*,statement_t*,case_clausule_t*);
115
116 static class_decl_t *new_class_decl(parser_ctx_t*);
117 static class_decl_t *add_class_function(parser_ctx_t*,class_decl_t*,function_decl_t*);
118 static class_decl_t *add_dim_prop(parser_ctx_t*,class_decl_t*,dim_decl_t*,unsigned);
119
120 static statement_t *link_statements(statement_t*,statement_t*);
121
122 static const WCHAR propertyW[] = {'p','r','o','p','e','r','t','y',0};
123
124 #define STORAGE_IS_PRIVATE 1
125 #define STORAGE_IS_DEFAULT 2
126
127 #define CHECK_ERROR if(((parser_ctx_t*)ctx)->hres != S_OK) YYABORT
128
129
130 #line 136 "parser.tab.c" /* yacc.c:339 */
131
132 # ifndef YY_NULLPTR
133 # if defined __cplusplus && 201103L <= __cplusplus
134 # define YY_NULLPTR nullptr
135 # else
136 # define YY_NULLPTR 0
137 # endif
138 # endif
139
140 /* Enabling verbose error messages. */
141 #ifdef YYERROR_VERBOSE
142 # undef YYERROR_VERBOSE
143 # define YYERROR_VERBOSE 1
144 #else
145 # define YYERROR_VERBOSE 0
146 #endif
147
148 /* In a future release of Bison, this section will be replaced
149 by #include "parser.tab.h". */
150 #ifndef YY_PARSER_PARSER_TAB_H_INCLUDED
151 # define YY_PARSER_PARSER_TAB_H_INCLUDED
152 /* Debug traces. */
153 #ifndef YYDEBUG
154 # define YYDEBUG 0
155 #endif
156 #if YYDEBUG
157 extern int parser_debug;
158 #endif
159
160 /* Token type. */
161 #ifndef YYTOKENTYPE
162 # define YYTOKENTYPE
163 enum yytokentype
164 {
165 tEOF = 258,
166 tNL = 259,
167 tREM = 260,
168 tEMPTYBRACKETS = 261,
169 tTRUE = 262,
170 tFALSE = 263,
171 tNOT = 264,
172 tAND = 265,
173 tOR = 266,
174 tXOR = 267,
175 tEQV = 268,
176 tIMP = 269,
177 tNEQ = 270,
178 tIS = 271,
179 tLTEQ = 272,
180 tGTEQ = 273,
181 tMOD = 274,
182 tCALL = 275,
183 tDIM = 276,
184 tSUB = 277,
185 tFUNCTION = 278,
186 tPROPERTY = 279,
187 tGET = 280,
188 tLET = 281,
189 tCONST = 282,
190 tIF = 283,
191 tELSE = 284,
192 tELSEIF = 285,
193 tEND = 286,
194 tTHEN = 287,
195 tEXIT = 288,
196 tWHILE = 289,
197 tWEND = 290,
198 tDO = 291,
199 tLOOP = 292,
200 tUNTIL = 293,
201 tFOR = 294,
202 tTO = 295,
203 tSTEP = 296,
204 tEACH = 297,
205 tIN = 298,
206 tSELECT = 299,
207 tCASE = 300,
208 tBYREF = 301,
209 tBYVAL = 302,
210 tOPTION = 303,
211 tEXPLICIT = 304,
212 tSTOP = 305,
213 tNOTHING = 306,
214 tEMPTY = 307,
215 tNULL = 308,
216 tCLASS = 309,
217 tSET = 310,
218 tNEW = 311,
219 tPUBLIC = 312,
220 tPRIVATE = 313,
221 tDEFAULT = 314,
222 tME = 315,
223 tERROR = 316,
224 tNEXT = 317,
225 tON = 318,
226 tRESUME = 319,
227 tGOTO = 320,
228 tIdentifier = 321,
229 tString = 322,
230 tLong = 323,
231 tShort = 324,
232 tDouble = 325
233 };
234 #endif
235
236 /* Value type. */
237 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
238 typedef union YYSTYPE YYSTYPE;
239 union YYSTYPE
240 {
241 #line 88 "parser.y" /* yacc.c:355 */
242
243 const WCHAR *string;
244 statement_t *statement;
245 expression_t *expression;
246 member_expression_t *member;
247 elseif_decl_t *elseif;
248 dim_decl_t *dim_decl;
249 dim_list_t *dim_list;
250 function_decl_t *func_decl;
251 arg_decl_t *arg_decl;
252 class_decl_t *class_decl;
253 const_decl_t *const_decl;
254 case_clausule_t *case_clausule;
255 unsigned uint;
256 LONG lng;
257 BOOL boolean;
258 double dbl;
259
260 #line 266 "parser.tab.c" /* yacc.c:355 */
261 };
262 # define YYSTYPE_IS_TRIVIAL 1
263 # define YYSTYPE_IS_DECLARED 1
264 #endif
265
266
267
268 int parser_parse (parser_ctx_t *ctx);
269
270 #endif /* !YY_PARSER_PARSER_TAB_H_INCLUDED */
271
272 /* Copy the second part of user declarations. */
273
274 #line 280 "parser.tab.c" /* yacc.c:358 */
275
276 #ifdef short
277 # undef short
278 #endif
279
280 #ifdef YYTYPE_UINT8
281 typedef YYTYPE_UINT8 yytype_uint8;
282 #else
283 typedef unsigned char yytype_uint8;
284 #endif
285
286 #ifdef YYTYPE_INT8
287 typedef YYTYPE_INT8 yytype_int8;
288 #else
289 typedef signed char yytype_int8;
290 #endif
291
292 #ifdef YYTYPE_UINT16
293 typedef YYTYPE_UINT16 yytype_uint16;
294 #else
295 typedef unsigned short int yytype_uint16;
296 #endif
297
298 #ifdef YYTYPE_INT16
299 typedef YYTYPE_INT16 yytype_int16;
300 #else
301 typedef short int yytype_int16;
302 #endif
303
304 #ifndef YYSIZE_T
305 # ifdef __SIZE_TYPE__
306 # define YYSIZE_T __SIZE_TYPE__
307 # elif defined size_t
308 # define YYSIZE_T size_t
309 # elif ! defined YYSIZE_T
310 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
311 # define YYSIZE_T size_t
312 # else
313 # define YYSIZE_T unsigned int
314 # endif
315 #endif
316
317 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
318
319 #ifndef YY_
320 # if defined YYENABLE_NLS && YYENABLE_NLS
321 # if ENABLE_NLS
322 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
323 # define YY_(Msgid) dgettext ("bison-runtime", Msgid)
324 # endif
325 # endif
326 # ifndef YY_
327 # define YY_(Msgid) Msgid
328 # endif
329 #endif
330
331 #ifndef YY_ATTRIBUTE
332 # if (defined __GNUC__ \
333 && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \
334 || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
335 # define YY_ATTRIBUTE(Spec) __attribute__(Spec)
336 # else
337 # define YY_ATTRIBUTE(Spec) /* empty */
338 # endif
339 #endif
340
341 #ifndef YY_ATTRIBUTE_PURE
342 # define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__))
343 #endif
344
345 #ifndef YY_ATTRIBUTE_UNUSED
346 # define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
347 #endif
348
349 #if !defined _Noreturn \
350 && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
351 # if defined _MSC_VER && 1200 <= _MSC_VER
352 # define _Noreturn __declspec (noreturn)
353 # else
354 # define _Noreturn YY_ATTRIBUTE ((__noreturn__))
355 # endif
356 #endif
357
358 /* Suppress unused-variable warnings by "using" E. */
359 #if ! defined lint || defined __GNUC__
360 # define YYUSE(E) ((void) (E))
361 #else
362 # define YYUSE(E) /* empty */
363 #endif
364
365 #if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
366 /* Suppress an incorrect diagnostic about yylval being uninitialized. */
367 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
368 _Pragma ("GCC diagnostic push") \
369 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
370 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
371 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
372 _Pragma ("GCC diagnostic pop")
373 #else
374 # define YY_INITIAL_VALUE(Value) Value
375 #endif
376 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
377 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
378 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
379 #endif
380 #ifndef YY_INITIAL_VALUE
381 # define YY_INITIAL_VALUE(Value) /* Nothing. */
382 #endif
383
384
385 #if ! defined yyoverflow || YYERROR_VERBOSE
386
387 /* The parser invokes alloca or malloc; define the necessary symbols. */
388
389 # ifdef YYSTACK_USE_ALLOCA
390 # if YYSTACK_USE_ALLOCA
391 # ifdef __GNUC__
392 # define YYSTACK_ALLOC __builtin_alloca
393 # elif defined __BUILTIN_VA_ARG_INCR
394 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
395 # elif defined _AIX
396 # define YYSTACK_ALLOC __alloca
397 # elif defined _MSC_VER
398 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
399 # define alloca _alloca
400 # else
401 # define YYSTACK_ALLOC alloca
402 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
403 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
404 /* Use EXIT_SUCCESS as a witness for stdlib.h. */
405 # ifndef EXIT_SUCCESS
406 # define EXIT_SUCCESS 0
407 # endif
408 # endif
409 # endif
410 # endif
411 # endif
412
413 # ifdef YYSTACK_ALLOC
414 /* Pacify GCC's 'empty if-body' warning. */
415 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
416 # ifndef YYSTACK_ALLOC_MAXIMUM
417 /* The OS might guarantee only one guard page at the bottom of the stack,
418 and a page size can be as small as 4096 bytes. So we cannot safely
419 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
420 to allow for a few compiler-allocated temporary stack slots. */
421 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
422 # endif
423 # else
424 # define YYSTACK_ALLOC YYMALLOC
425 # define YYSTACK_FREE YYFREE
426 # ifndef YYSTACK_ALLOC_MAXIMUM
427 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
428 # endif
429 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
430 && ! ((defined YYMALLOC || defined malloc) \
431 && (defined YYFREE || defined free)))
432 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
433 # ifndef EXIT_SUCCESS
434 # define EXIT_SUCCESS 0
435 # endif
436 # endif
437 # ifndef YYMALLOC
438 # define YYMALLOC malloc
439 # if ! defined malloc && ! defined EXIT_SUCCESS
440 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
441 # endif
442 # endif
443 # ifndef YYFREE
444 # define YYFREE free
445 # if ! defined free && ! defined EXIT_SUCCESS
446 void free (void *); /* INFRINGES ON USER NAME SPACE */
447 # endif
448 # endif
449 # endif
450 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
451
452
453 #if (! defined yyoverflow \
454 && (! defined __cplusplus \
455 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
456
457 /* A type that is properly aligned for any stack member. */
458 union yyalloc
459 {
460 yytype_int16 yyss_alloc;
461 YYSTYPE yyvs_alloc;
462 };
463
464 /* The size of the maximum gap between one aligned stack and the next. */
465 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
466
467 /* The size of an array large to enough to hold all stacks, each with
468 N elements. */
469 # define YYSTACK_BYTES(N) \
470 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
471 + YYSTACK_GAP_MAXIMUM)
472
473 # define YYCOPY_NEEDED 1
474
475 /* Relocate STACK from its old location to the new one. The
476 local variables YYSIZE and YYSTACKSIZE give the old and new number of
477 elements in the stack, and YYPTR gives the new location of the
478 stack. Advance YYPTR to a properly aligned location for the next
479 stack. */
480 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
481 do \
482 { \
483 YYSIZE_T yynewbytes; \
484 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
485 Stack = &yyptr->Stack_alloc; \
486 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
487 yyptr += yynewbytes / sizeof (*yyptr); \
488 } \
489 while (0)
490
491 #endif
492
493 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
494 /* Copy COUNT objects from SRC to DST. The source and destination do
495 not overlap. */
496 # ifndef YYCOPY
497 # if defined __GNUC__ && 1 < __GNUC__
498 # define YYCOPY(Dst, Src, Count) \
499 __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
500 # else
501 # define YYCOPY(Dst, Src, Count) \
502 do \
503 { \
504 YYSIZE_T yyi; \
505 for (yyi = 0; yyi < (Count); yyi++) \
506 (Dst)[yyi] = (Src)[yyi]; \
507 } \
508 while (0)
509 # endif
510 # endif
511 #endif /* !YYCOPY_NEEDED */
512
513 /* YYFINAL -- State number of the termination state. */
514 #define YYFINAL 5
515 /* YYLAST -- Last index in YYTABLE. */
516 #define YYLAST 871
517
518 /* YYNTOKENS -- Number of terminals. */
519 #define YYNTOKENS 87
520 /* YYNNTS -- Number of nonterminals. */
521 #define YYNNTS 60
522 /* YYNRULES -- Number of rules. */
523 #define YYNRULES 167
524 /* YYNSTATES -- Number of states. */
525 #define YYNSTATES 341
526
527 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
528 by yylex, with out-of-bounds checking. */
529 #define YYUNDEFTOK 2
530 #define YYMAXUTOK 325
531
532 #define YYTRANSLATE(YYX) \
533 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
534
535 /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
536 as returned by yylex, without out-of-bounds checking. */
537 static const yytype_uint8 yytranslate[] =
538 {
539 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
540 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
541 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
542 2, 2, 2, 2, 2, 2, 2, 2, 81, 2,
543 76, 77, 84, 82, 75, 78, 74, 85, 73, 2,
544 2, 2, 2, 2, 2, 2, 2, 2, 71, 2,
545 80, 72, 79, 2, 2, 2, 2, 2, 2, 2,
546 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
547 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
548 2, 2, 83, 2, 86, 2, 2, 2, 2, 2,
549 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
550 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
551 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
552 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
553 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
554 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
555 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
556 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
557 2, 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, 2, 2, 2, 2, 2, 2, 2,
561 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
562 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
563 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
564 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
565 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
566 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
567 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
568 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
569 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
570 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
571 65, 66, 67, 68, 69, 70
572 };
573
574 #if YYDEBUG
575 /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
576 static const yytype_uint16 yyrline[] =
577 {
578 0, 147, 147, 150, 151, 153, 155, 156, 159, 160,
579 163, 164, 167, 170, 171, 172, 173, 174, 177, 178,
580 179, 181, 182, 183, 185, 188, 191, 192, 193, 194,
581 195, 196, 197, 198, 200, 201, 202, 203, 204, 206,
582 208, 212, 213, 216, 217, 220, 221, 222, 225, 226,
583 229, 230, 233, 236, 237, 240, 241, 244, 245, 248,
584 250, 251, 254, 256, 259, 260, 263, 264, 267, 271,
585 272, 275, 276, 277, 281, 282, 285, 286, 289, 290,
586 291, 293, 295, 298, 299, 302, 303, 306, 307, 310,
587 311, 314, 315, 318, 319, 322, 323, 326, 327, 328,
588 329, 330, 331, 332, 333, 336, 337, 340, 341, 342,
589 345, 346, 349, 350, 354, 355, 357, 361, 362, 365,
590 366, 367, 368, 371, 372, 375, 376, 377, 378, 379,
591 380, 381, 384, 385, 386, 387, 390, 391, 392, 395,
592 396, 399, 402, 403, 405, 407, 408, 411, 413, 415,
593 419, 421, 425, 426, 429, 430, 431, 434, 435, 438,
594 439, 442, 443, 444, 448, 449, 453, 454
595 };
596 #endif
597
598 #if YYDEBUG || YYERROR_VERBOSE || 0
599 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
600 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
601 static const char *const yytname[] =
602 {
603 "$end", "error", "$undefined", "tEOF", "tNL", "tREM", "tEMPTYBRACKETS",
604 "tTRUE", "tFALSE", "tNOT", "tAND", "tOR", "tXOR", "tEQV", "tIMP", "tNEQ",
605 "tIS", "tLTEQ", "tGTEQ", "tMOD", "tCALL", "tDIM", "tSUB", "tFUNCTION",
606 "tPROPERTY", "tGET", "tLET", "tCONST", "tIF", "tELSE", "tELSEIF", "tEND",
607 "tTHEN", "tEXIT", "tWHILE", "tWEND", "tDO", "tLOOP", "tUNTIL", "tFOR",
608 "tTO", "tSTEP", "tEACH", "tIN", "tSELECT", "tCASE", "tBYREF", "tBYVAL",
609 "tOPTION", "tEXPLICIT", "tSTOP", "tNOTHING", "tEMPTY", "tNULL", "tCLASS",
610 "tSET", "tNEW", "tPUBLIC", "tPRIVATE", "tDEFAULT", "tME", "tERROR",
611 "tNEXT", "tON", "tRESUME", "tGOTO", "tIdentifier", "tString", "tLong",
612 "tShort", "tDouble", "':'", "'='", "'0'", "'.'", "','", "'('", "')'",
613 "'-'", "'>'", "'<'", "'&'", "'+'", "'\\\\'", "'*'", "'/'", "'^'",
614 "$accept", "Program", "OptionExplicit_opt", "SourceElements",
615 "StatementsNl_opt", "StatementsNl", "StatementNl", "Statement",
616 "SimpleStatement", "MemberExpression", "DimDeclList", "DimDecl",
617 "DimList", "ConstDeclList", "ConstDecl", "ConstExpression", "DoType",
618 "Step_opt", "IfStatement", "EndIf_opt", "ElseIfs_opt", "ElseIfs",
619 "ElseIf", "Else_opt", "CaseClausules", "Arguments_opt",
620 "ArgumentList_opt", "ArgumentList", "EmptyBrackets_opt",
621 "ExpressionList", "Expression", "EqvExpression", "XorExpression",
622 "OrExpression", "AndExpression", "NotExpression", "EqualityExpression",
623 "ConcatExpression", "AdditiveExpression", "ModExpression",
624 "IntdivExpression", "MultiplicativeExpression", "ExpExpression",
625 "UnaryExpression", "CallExpression", "LiteralExpression",
626 "NumericLiteralExpression", "IntegerValue", "PrimaryExpression",
627 "ClassDeclaration", "ClassBody", "PropertyDecl", "FunctionDecl",
628 "Storage_opt", "Storage", "ArgumentsDecl_opt", "ArgumentDeclList",
629 "ArgumentDecl", "Identifier", "StSep", YY_NULLPTR
630 };
631 #endif
632
633 # ifdef YYPRINT
634 /* YYTOKNUM[NUM] -- (External) token number corresponding to the
635 (internal) symbol number NUM (which must be that of a token). */
636 static const yytype_uint16 yytoknum[] =
637 {
638 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
639 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
640 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
641 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
642 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
643 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
644 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
645 325, 58, 61, 48, 46, 44, 40, 41, 45, 62,
646 60, 38, 43, 92, 42, 47, 94
647 };
648 # endif
649
650 #define YYPACT_NINF -154
651
652 #define yypact_value_is_default(Yystate) \
653 (!!((Yystate) == (-154)))
654
655 #define YYTABLE_NINF -153
656
657 #define yytable_value_is_error(Yytable_value) \
658 0
659
660 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
661 STATE-NUM. */
662 static const yytype_int16 yypact[] =
663 {
664 -13, -11, 67, -154, 78, -154, 313, -154, -154, 98,
665 -5, -154, -5, 464, 146, 464, 12, 34, 76, -154,
666 -5, 98, 96, -154, -154, 90, -154, 566, 464, -154,
667 159, 101, 182, -154, 104, -154, -154, -154, 37, -154,
668 -154, 1, -154, 100, 4, -154, 112, 131, -154, -154,
669 464, -154, -154, -154, -5, -154, -154, -154, -154, -154,
670 497, 1, 31, 171, 196, 198, 212, -154, 24, 147,
671 -60, 208, 148, -31, 143, -154, 104, -154, -154, -154,
672 -154, -154, -154, -154, 52, 607, -154, -154, 464, -5,
673 158, 464, 228, 1, -154, 65, -154, -3, -154, 566,
674 -154, 392, 392, 165, -154, -154, 130, 19, -5, -5,
675 -5, 392, 167, -154, -5, -154, 92, -5, 528, -154,
676 -154, -154, -154, 464, 354, 464, 464, 464, 464, 497,
677 497, 497, 497, 497, 497, 497, 497, 497, 497, 497,
678 497, 497, 497, 497, 660, 202, -154, 566, 105, 204,
679 464, 16, 123, 181, 201, 191, -154, -154, -154, 188,
680 22, 464, 392, -154, 7, 7, -154, -154, -154, -154,
681 192, 193, -154, 42, -154, -154, 171, 566, 85, 196,
682 198, 212, -154, 147, 147, 147, 147, 147, 147, 147,
683 -60, 208, 208, 148, -31, 143, 143, -154, 236, 13,
684 -154, 607, 464, 29, -154, -154, 227, -5, 242, 270,
685 271, 176, 210, 464, -154, -154, -154, 263, -154, 2,
686 -154, 274, 275, -154, 92, -154, 250, 795, 253, -154,
687 -154, 464, 245, 109, 464, 425, 258, 286, 239, 123,
688 123, 107, 291, 263, -5, -5, 219, 222, 292, 701,
689 701, -154, 464, 273, -154, 250, 269, -154, 263, -154,
690 742, 14, 21, 21, 30, 260, 123, 302, -154, -154,
691 241, 244, 247, 123, 292, 292, -154, 2, -154, 277,
692 280, 43, 311, 287, -154, -154, 259, 464, 316, 795,
693 566, 464, -154, -154, -154, 7, 246, 248, -154, -154,
694 -154, -154, 301, 307, 321, 701, 308, -154, 263, 742,
695 -154, 227, -154, 331, 2, 2, -154, -154, 566, -154,
696 -154, 276, -154, 701, 262, 265, -154, -154, 312, 341,
697 346, 327, 701, 701, -154, 322, 323, 332, 335, -154,
698 -154
699 };
700
701 /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
702 Performed when YYTABLE does not specify something else to do. Zero
703 means the default is an error. */
704 static const yytype_uint8 yydefact[] =
705 {
706 3, 0, 0, 5, 0, 1, 152, 4, 2, 0,
707 0, 165, 0, 0, 0, 0, 0, 0, 0, 34,
708 0, 0, 155, 156, 140, 0, 164, 13, 0, 6,
709 0, 15, 81, 22, 0, 123, 7, 27, 0, 153,
710 41, 81, 21, 43, 45, 37, 50, 0, 125, 126,
711 0, 131, 129, 130, 0, 127, 134, 132, 135, 133,
712 0, 81, 0, 85, 87, 89, 91, 93, 95, 97,
713 105, 107, 110, 112, 114, 117, 120, 119, 128, 32,
714 30, 31, 28, 29, 0, 152, 55, 56, 0, 0,
715 0, 0, 0, 81, 154, 0, 14, 0, 12, 17,
716 82, 0, 0, 124, 18, 77, 76, 78, 0, 0,
717 0, 0, 19, 74, 0, 47, 0, 0, 0, 96,
718 121, 122, 124, 0, 152, 0, 0, 0, 0, 0,
719 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
720 0, 0, 0, 0, 152, 0, 9, 10, 0, 0,
721 0, 0, 152, 124, 0, 0, 139, 16, 80, 0,
722 0, 0, 0, 42, 81, 81, 44, 138, 136, 137,
723 0, 48, 51, 0, 52, 53, 86, 8, 62, 88,
724 90, 92, 94, 99, 104, 103, 102, 98, 100, 101,
725 106, 109, 108, 111, 113, 115, 116, 118, 0, 26,
726 11, 152, 0, 0, 166, 167, 71, 0, 0, 0,
727 0, 0, 153, 0, 35, 36, 75, 20, 79, 0,
728 157, 0, 0, 46, 0, 54, 64, 152, 0, 60,
729 23, 0, 0, 0, 0, 0, 0, 0, 0, 152,
730 152, 0, 0, 33, 0, 0, 0, 159, 81, 152,
731 152, 49, 0, 69, 65, 66, 62, 63, 25, 24,
732 152, 57, 0, 0, 83, 0, 152, 0, 146, 143,
733 0, 0, 0, 152, 81, 81, 158, 0, 161, 0,
734 0, 0, 0, 0, 67, 61, 0, 0, 0, 152,
735 8, 0, 40, 145, 141, 81, 0, 0, 144, 162,
736 163, 160, 0, 0, 0, 152, 0, 39, 58, 152,
737 72, 71, 84, 0, 0, 0, 150, 151, 8, 70,
738 59, 0, 73, 152, 0, 0, 68, 38, 0, 0,
739 0, 0, 152, 152, 147, 0, 0, 0, 0, 148,
740 149
741 };
742
743 /* YYPGOTO[NTERM-NUM]. */
744 static const yytype_int16 yypgoto[] =
745 {
746 -154, -154, -154, -154, -113, -143, 349, -26, -154, -6,
747 251, 153, 137, 249, -154, -154, 163, -154, -154, 108,
748 -154, 114, -154, -154, 61, -9, -154, -23, -8, 86,
749 57, 257, 261, 266, 256, -42, -154, 82, 255, -30,
750 264, 254, 25, -54, -4, 267, 223, -154, -154, -154,
751 -149, -154, -138, -90, -87, -153, 118, -121, 17, -37
752 };
753
754 /* YYDEFGOTO[NTERM-NUM]. */
755 static const yytype_int16 yydefgoto[] =
756 {
757 -1, 2, 3, 6, 145, 146, 147, 30, 31, 61,
758 42, 43, 170, 45, 46, 174, 88, 288, 33, 229,
759 253, 254, 255, 283, 236, 103, 104, 159, 113, 263,
760 107, 63, 64, 65, 66, 67, 68, 69, 70, 71,
761 72, 73, 74, 75, 76, 77, 78, 171, 35, 36,
762 208, 209, 37, 38, 39, 221, 246, 247, 40, 206
763 };
764
765 /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
766 positive, shift that token. If negative, reduce the rule whose
767 number is the opposite. If YYTABLE_NINF, syntax error. */
768 static const yytype_int16 yytable[] =
769 {
770 32, 96, 34, 41, 200, 34, 121, 100, 119, 105,
771 115, 123, 222, 100, 210, 93, 85, 34, 137, 11,
772 204, 32, 138, 34, 106, 204, 11, 44, 123, 47,
773 123, 198, 112, 123, 90, 1, 123, 92, 4, 129,
774 130, 131, 132, 123, 123, 123, 86, 86, 244, 245,
775 87, 87, 122, 141, 142, 287, 144, 123, 11, 109,
776 110, 26, 211, 124, 226, 212, 123, 5, 26, 234,
777 62, 120, 84, 157, 156, 304, 89, 111, 158, 32,
778 116, 34, 7, 219, 153, 97, 182, 205, 232, 197,
779 268, 269, 205, 32, 162, 34, 133, 162, 178, 156,
780 26, 210, 210, 134, 135, 291, 149, 191, 192, 201,
781 56, 57, 58, 260, 227, 59, 228, 293, 32, 123,
782 34, 91, 11, 123, 298, 163, 164, 165, 210, 154,
783 155, 44, 270, 271, 47, 210, 279, 280, 32, 218,
784 34, 32, 313, 34, 207, 148, 310, 286, 151, 211,
785 211, 95, 212, 212, -142, 94, 220, 220, 24, 160,
786 167, 168, 272, 98, 26, 169, 195, 196, 79, 80,
787 81, 32, 99, 34, 28, 114, 211, 311, 108, 212,
788 22, 23, 82, 211, 125, 83, 212, 117, 100, 48,
789 49, 50, 319, 324, 325, 32, 321, 34, 109, 110,
790 241, 256, -74, 118, -74, 326, 11, 203, 126, 127,
791 328, 183, 184, 185, 186, 187, 188, 189, 217, 335,
792 336, 32, 128, 34, 44, 289, 290, 139, 136, 143,
793 150, 140, 152, 51, 52, 53, 248, 161, 54, 199,
794 278, -124, 24, 32, 32, 34, 34, 202, 26, 55,
795 56, 57, 58, 213, 32, 59, 34, 101, 102, 233,
796 60, 274, 275, 214, 215, 216, 299, 300, 224, 223,
797 243, 230, 235, 238, 239, 240, 242, 123, 249, 250,
798 252, 257, 259, 32, 32, 34, 34, 220, 258, 265,
799 266, 261, 264, 267, 248, 273, 276, 277, 100, 32,
800 228, 34, 282, 32, 292, 34, 294, 295, 302, 281,
801 296, 303, 32, 297, 34, 305, 8, 32, 306, 34,
802 309, 307, 314, 316, 315, 318, 32, 32, 34, 34,
803 317, 248, 248, 9, 10, 323, 320, 11, 327, 329,
804 12, 13, 330, 331, 308, 332, 14, 15, 264, 16,
805 333, 334, 17, 337, 338, 29, 339, 18, 177, 340,
806 237, 251, 231, 19, 285, 166, 172, 20, 21, 284,
807 22, 23, 322, 24, 9, 10, 25, 312, 11, 26,
808 176, 12, 13, 181, 27, 175, 179, 14, 15, 28,
809 16, 190, 180, 17, 194, 301, 225, 0, 18, 48,
810 49, 50, 0, 193, 19, 0, 0, 0, 0, 21,
811 0, 22, 23, 0, 24, 0, 11, 25, 0, 0,
812 26, 0, 0, 0, 0, 27, 0, 0, 0, 0,
813 28, 0, 48, 49, 50, 0, 0, 0, 0, 0,
814 0, 0, 0, 51, 52, 53, 0, 0, 54, 11,
815 0, 0, 24, 0, 262, 0, 0, 0, 26, 55,
816 56, 57, 58, 0, 0, 59, 0, 101, 28, 0,
817 60, 48, 49, 50, 0, 0, 51, 52, 53, 0,
818 0, 54, 0, 0, 0, 24, 0, 0, 11, 0,
819 0, 26, 55, 56, 57, 58, 0, 0, 59, 0,
820 0, 28, 0, 60, 48, 49, 0, 0, 0, 0,
821 0, 0, 0, 0, 0, 51, 52, 53, 0, 0,
822 54, 11, 0, 0, 24, 0, 0, 0, 0, 0,
823 26, 55, 56, 57, 58, 48, 49, 59, 0, 0,
824 28, 0, 60, 0, 0, 0, 0, 0, 51, 52,
825 53, 0, 0, 54, 0, 0, 0, 24, 0, 0,
826 0, 0, 0, 26, 55, 56, 57, 58, 0, 0,
827 59, 0, 0, 28, 0, 60, 0, 0, 0, 51,
828 52, 53, 0, 0, 0, 0, 9, 10, -152, -152,
829 11, 0, 0, 12, 13, 55, 56, 57, 58, 14,
830 15, 59, 16, 0, 0, 17, 173, 0, 0, 0,
831 18, 0, 0, 0, 0, 0, 19, 0, 0, 0,
832 0, 21, 0, 22, 23, 0, 24, 9, 10, 25,
833 0, 11, 26, 0, 12, 13, 0, 27, 0, 0,
834 14, 15, 28, 16, -8, 0, 17, 0, 0, 0,
835 0, 18, 0, 0, 0, 0, 0, 19, 0, 0,
836 0, 0, 21, 0, 22, 23, 0, 24, 0, 0,
837 25, 0, 0, 26, 0, 0, 0, 0, 27, 0,
838 9, 10, 0, 28, 11, 0, 0, 12, 13, 0,
839 0, 0, 0, 14, 15, -8, 16, 0, 0, 17,
840 0, 0, 0, 0, 18, 0, 0, 0, 0, 0,
841 19, 0, 0, 0, 0, 21, 0, 22, 23, 0,
842 24, 9, 10, 25, 0, 11, 26, 0, 12, 13,
843 0, 27, -8, 0, 14, 15, 28, 16, 0, 0,
844 17, 0, 0, 0, 0, 18, 0, 0, 0, 0,
845 0, 19, 0, 0, 0, 0, 21, 0, 22, 23,
846 0, 24, 9, 10, 25, 0, 11, 26, 0, 12,
847 13, 0, 27, 0, 0, 14, 15, 28, 16, 0,
848 0, 17, 0, 0, 0, 0, 18, 0, 0, 0,
849 0, 0, 19, 0, 0, 0, 0, 21, 0, 22,
850 23, 0, 24, 0, -8, 25, 0, 0, 26, 0,
851 0, 0, 0, 27, 0, 9, 10, 0, 28, 11,
852 0, 0, 12, 13, 0, 0, 0, 0, 14, 15,
853 0, 16, 0, 0, 17, 0, 0, 0, 0, 18,
854 0, 0, 0, 0, 0, 19, 0, 0, 0, 0,
855 21, 0, 22, 23, 0, 24, 0, 0, 25, 0,
856 0, 26, 0, 0, 0, 0, 27, 0, 0, 0,
857 0, 28
858 };
859
860 static const yytype_int16 yycheck[] =
861 {
862 6, 27, 6, 9, 147, 9, 60, 6, 50, 32,
863 6, 14, 165, 6, 152, 21, 4, 21, 78, 24,
864 4, 27, 82, 27, 32, 4, 24, 10, 14, 12,
865 14, 144, 41, 14, 17, 48, 14, 20, 49, 15,
866 16, 17, 18, 14, 14, 14, 34, 34, 46, 47,
867 38, 38, 61, 84, 85, 41, 4, 14, 24, 22,
868 23, 66, 152, 32, 177, 152, 14, 0, 66, 40,
869 13, 54, 15, 99, 77, 32, 42, 76, 101, 85,
870 76, 85, 4, 76, 93, 28, 128, 71, 201, 143,
871 239, 240, 71, 99, 75, 99, 72, 75, 124, 77,
872 66, 239, 240, 79, 80, 75, 89, 137, 138, 4,
873 68, 69, 70, 4, 29, 73, 31, 266, 124, 14,
874 124, 45, 24, 14, 273, 108, 109, 110, 266, 64,
875 65, 114, 25, 26, 117, 273, 249, 250, 144, 162,
876 144, 147, 295, 147, 21, 88, 289, 260, 91, 239,
877 240, 61, 239, 240, 31, 59, 164, 165, 60, 102,
878 68, 69, 55, 4, 66, 73, 141, 142, 22, 23,
879 24, 177, 71, 177, 76, 75, 266, 290, 74, 266,
880 57, 58, 36, 273, 13, 39, 273, 75, 6, 7,
881 8, 9, 305, 314, 315, 201, 309, 201, 22, 23,
882 24, 227, 72, 72, 74, 318, 24, 150, 12, 11,
883 323, 129, 130, 131, 132, 133, 134, 135, 161, 332,
884 333, 227, 10, 227, 207, 262, 263, 19, 81, 86,
885 72, 83, 4, 51, 52, 53, 219, 72, 56, 37,
886 248, 74, 60, 249, 250, 249, 250, 43, 66, 67,
887 68, 69, 70, 72, 260, 73, 260, 75, 76, 202,
888 78, 244, 245, 62, 73, 77, 274, 275, 75, 77,
889 213, 35, 45, 31, 4, 4, 66, 14, 4, 4,
890 30, 28, 37, 289, 290, 289, 290, 295, 231, 31,
891 4, 234, 235, 54, 277, 4, 77, 75, 6, 305,
892 31, 305, 29, 309, 44, 309, 4, 66, 31, 252,
893 66, 31, 318, 66, 318, 4, 3, 323, 31, 323,
894 4, 62, 76, 22, 76, 4, 332, 333, 332, 333,
895 23, 314, 315, 20, 21, 4, 28, 24, 62, 77,
896 27, 28, 77, 31, 287, 4, 33, 34, 291, 36,
897 4, 24, 39, 31, 31, 6, 24, 44, 4, 24,
898 207, 224, 199, 50, 256, 114, 117, 54, 55, 255,
899 57, 58, 311, 60, 20, 21, 63, 291, 24, 66,
900 123, 27, 28, 127, 71, 118, 125, 33, 34, 76,
901 36, 136, 126, 39, 140, 277, 173, -1, 44, 7,
902 8, 9, -1, 139, 50, -1, -1, -1, -1, 55,
903 -1, 57, 58, -1, 60, -1, 24, 63, -1, -1,
904 66, -1, -1, -1, -1, 71, -1, -1, -1, -1,
905 76, -1, 7, 8, 9, -1, -1, -1, -1, -1,
906 -1, -1, -1, 51, 52, 53, -1, -1, 56, 24,
907 -1, -1, 60, -1, 29, -1, -1, -1, 66, 67,
908 68, 69, 70, -1, -1, 73, -1, 75, 76, -1,
909 78, 7, 8, 9, -1, -1, 51, 52, 53, -1,
910 -1, 56, -1, -1, -1, 60, -1, -1, 24, -1,
911 -1, 66, 67, 68, 69, 70, -1, -1, 73, -1,
912 -1, 76, -1, 78, 7, 8, -1, -1, -1, -1,
913 -1, -1, -1, -1, -1, 51, 52, 53, -1, -1,
914 56, 24, -1, -1, 60, -1, -1, -1, -1, -1,
915 66, 67, 68, 69, 70, 7, 8, 73, -1, -1,
916 76, -1, 78, -1, -1, -1, -1, -1, 51, 52,
917 53, -1, -1, 56, -1, -1, -1, 60, -1, -1,
918 -1, -1, -1, 66, 67, 68, 69, 70, -1, -1,
919 73, -1, -1, 76, -1, 78, -1, -1, -1, 51,
920 52, 53, -1, -1, -1, -1, 20, 21, 22, 23,
921 24, -1, -1, 27, 28, 67, 68, 69, 70, 33,
922 34, 73, 36, -1, -1, 39, 78, -1, -1, -1,
923 44, -1, -1, -1, -1, -1, 50, -1, -1, -1,
924 -1, 55, -1, 57, 58, -1, 60, 20, 21, 63,
925 -1, 24, 66, -1, 27, 28, -1, 71, -1, -1,
926 33, 34, 76, 36, 37, -1, 39, -1, -1, -1,
927 -1, 44, -1, -1, -1, -1, -1, 50, -1, -1,
928 -1, -1, 55, -1, 57, 58, -1, 60, -1, -1,
929 63, -1, -1, 66, -1, -1, -1, -1, 71, -1,
930 20, 21, -1, 76, 24, -1, -1, 27, 28, -1,
931 -1, -1, -1, 33, 34, 35, 36, -1, -1, 39,
932 -1, -1, -1, -1, 44, -1, -1, -1, -1, -1,
933 50, -1, -1, -1, -1, 55, -1, 57, 58, -1,
934 60, 20, 21, 63, -1, 24, 66, -1, 27, 28,
935 -1, 71, 31, -1, 33, 34, 76, 36, -1, -1,
936 39, -1, -1, -1, -1, 44, -1, -1, -1, -1,
937 -1, 50, -1, -1, -1, -1, 55, -1, 57, 58,
938 -1, 60, 20, 21, 63, -1, 24, 66, -1, 27,
939 28, -1, 71, -1, -1, 33, 34, 76, 36, -1,
940 -1, 39, -1, -1, -1, -1, 44, -1, -1, -1,
941 -1, -1, 50, -1, -1, -1, -1, 55, -1, 57,
942 58, -1, 60, -1, 62, 63, -1, -1, 66, -1,
943 -1, -1, -1, 71, -1, 20, 21, -1, 76, 24,
944 -1, -1, 27, 28, -1, -1, -1, -1, 33, 34,
945 -1, 36, -1, -1, 39, -1, -1, -1, -1, 44,
946 -1, -1, -1, -1, -1, 50, -1, -1, -1, -1,
947 55, -1, 57, 58, -1, 60, -1, -1, 63, -1,
948 -1, 66, -1, -1, -1, -1, 71, -1, -1, -1,
949 -1, 76
950 };
951
952 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
953 symbol of state STATE-NUM. */
954 static const yytype_uint8 yystos[] =
955 {
956 0, 48, 88, 89, 49, 0, 90, 4, 3, 20,
957 21, 24, 27, 28, 33, 34, 36, 39, 44, 50,
958 54, 55, 57, 58, 60, 63, 66, 71, 76, 93,
959 94, 95, 96, 105, 131, 135, 136, 139, 140, 141,
960 145, 96, 97, 98, 145, 100, 101, 145, 7, 8,
961 9, 51, 52, 53, 56, 67, 68, 69, 70, 73,
962 78, 96, 117, 118, 119, 120, 121, 122, 123, 124,
963 125, 126, 127, 128, 129, 130, 131, 132, 133, 22,
964 23, 24, 36, 39, 117, 4, 34, 38, 103, 42,
965 145, 45, 145, 96, 59, 61, 94, 117, 4, 71,
966 6, 75, 76, 112, 113, 114, 115, 117, 74, 22,
967 23, 76, 112, 115, 75, 6, 76, 75, 72, 122,
968 145, 130, 112, 14, 32, 13, 12, 11, 10, 15,
969 16, 17, 18, 72, 79, 80, 81, 78, 82, 19,
970 83, 84, 85, 86, 4, 91, 92, 93, 117, 145,
971 72, 117, 4, 112, 64, 65, 77, 94, 114, 114,
972 117, 72, 75, 145, 145, 145, 97, 68, 69, 73,
973 99, 134, 100, 78, 102, 132, 118, 4, 94, 119,
974 120, 121, 122, 124, 124, 124, 124, 124, 124, 124,
975 125, 126, 126, 127, 128, 129, 129, 130, 91, 37,
976 92, 4, 43, 117, 4, 71, 146, 21, 137, 138,
977 139, 140, 141, 72, 62, 73, 77, 117, 114, 76,
978 115, 142, 142, 77, 75, 133, 91, 29, 31, 106,
979 35, 103, 91, 117, 40, 45, 111, 98, 31, 4,
980 4, 24, 66, 117, 46, 47, 143, 144, 145, 4,
981 4, 99, 30, 107, 108, 109, 94, 28, 117, 37,
982 4, 117, 29, 116, 117, 31, 4, 54, 137, 137,
983 25, 26, 55, 4, 145, 145, 77, 75, 115, 91,
984 91, 117, 29, 110, 108, 106, 91, 41, 104, 146,
985 146, 75, 44, 137, 4, 66, 66, 66, 137, 115,
986 115, 143, 31, 31, 32, 4, 31, 62, 117, 4,
987 92, 91, 116, 142, 76, 76, 22, 23, 4, 91,
988 28, 91, 111, 4, 144, 144, 91, 62, 91, 77,
989 77, 31, 4, 4, 24, 91, 91, 31, 31, 24,
990 24
991 };
992
993 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
994 static const yytype_uint8 yyr1[] =
995 {
996 0, 87, 88, 89, 89, 90, 90, 90, 91, 91,
997 92, 92, 93, 94, 94, 94, 94, 94, 95, 95,
998 95, 95, 95, 95, 95, 95, 95, 95, 95, 95,
999 95, 95, 95, 95, 95, 95, 95, 95, 95, 95,
1000 95, 96, 96, 97, 97, 98, 98, 98, 99, 99,
1001 100, 100, 101, 102, 102, 103, 103, 104, 104, 105,
1002 105, 105, 106, 106, 107, 107, 108, 108, 109, 110,
1003 110, 111, 111, 111, 112, 112, 113, 113, 114, 114,
1004 114, 115, 115, 116, 116, 117, 117, 118, 118, 119,
1005 119, 120, 120, 121, 121, 122, 122, 123, 123, 123,
1006 123, 123, 123, 123, 123, 124, 124, 125, 125, 125,
1007 126, 126, 127, 127, 128, 128, 128, 129, 129, 130,
1008 130, 130, 130, 131, 131, 132, 132, 132, 132, 132,
1009 132, 132, 133, 133, 133, 133, 134, 134, 134, 135,
1010 135, 136, 137, 137, 137, 137, 137, 138, 138, 138,
1011 139, 139, 140, 140, 141, 141, 141, 142, 142, 143,
1012 143, 144, 144, 144, 145, 145, 146, 146
1013 };
1014
1015 /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
1016 static const yytype_uint8 yyr2[] =
1017 {
1018 0, 2, 3, 0, 3, 0, 2, 2, 0, 1,
1019 1, 2, 2, 1, 2, 1, 3, 2, 2, 3,
1020 4, 2, 1, 5, 6, 6, 4, 1, 2, 2,
1021 2, 2, 2, 5, 1, 4, 4, 2, 10, 8,
1022 7, 1, 3, 1, 3, 1, 4, 2, 1, 3,
1023 1, 3, 3, 1, 2, 1, 1, 0, 2, 9,
1024 5, 7, 0, 2, 0, 1, 1, 2, 5, 0,
1025 3, 0, 4, 5, 1, 3, 1, 1, 1, 3,
1026 2, 0, 1, 1, 3, 1, 3, 1, 3, 1,
1027 3, 1, 3, 1, 3, 1, 2, 1, 3, 3,
1028 3, 3, 3, 3, 3, 1, 3, 1, 3, 3,
1029 1, 3, 1, 3, 1, 3, 3, 1, 3, 1,
1030 1, 2, 2, 1, 2, 1, 1, 1, 1, 1,
1031 1, 1, 1, 1, 1, 1, 1, 1, 1, 3,
1032 1, 7, 0, 3, 4, 4, 3, 9, 11, 11,
1033 8, 8, 0, 1, 2, 1, 1, 1, 3, 1,
1034 3, 2, 3, 3, 1, 1, 1, 1
1035 };
1036
1037
1038 #define yyerrok (yyerrstatus = 0)
1039 #define yyclearin (yychar = YYEMPTY)
1040 #define YYEMPTY (-2)
1041 #define YYEOF 0
1042
1043 #define YYACCEPT goto yyacceptlab
1044 #define YYABORT goto yyabortlab
1045 #define YYERROR goto yyerrorlab
1046
1047
1048 #define YYRECOVERING() (!!yyerrstatus)
1049
1050 #define YYBACKUP(Token, Value) \
1051 do \
1052 if (yychar == YYEMPTY) \
1053 { \
1054 yychar = (Token); \
1055 yylval = (Value); \
1056 YYPOPSTACK (yylen); \
1057 yystate = *yyssp; \
1058 goto yybackup; \
1059 } \
1060 else \
1061 { \
1062 yyerror (ctx, YY_("syntax error: cannot back up")); \
1063 YYERROR; \
1064 } \
1065 while (0)
1066
1067 /* Error token number */
1068 #define YYTERROR 1
1069 #define YYERRCODE 256
1070
1071
1072
1073 /* Enable debugging if requested. */
1074 #if YYDEBUG
1075
1076 # ifndef YYFPRINTF
1077 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1078 # define YYFPRINTF fprintf
1079 # endif
1080
1081 # define YYDPRINTF(Args) \
1082 do { \
1083 if (yydebug) \
1084 YYFPRINTF Args; \
1085 } while (0)
1086
1087 /* This macro is provided for backward compatibility. */
1088 #ifndef YY_LOCATION_PRINT
1089 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
1090 #endif
1091
1092
1093 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
1094 do { \
1095 if (yydebug) \
1096 { \
1097 YYFPRINTF (stderr, "%s ", Title); \
1098 yy_symbol_print (stderr, \
1099 Type, Value, ctx); \
1100 YYFPRINTF (stderr, "\n"); \
1101 } \
1102 } while (0)
1103
1104
1105 /*----------------------------------------.
1106 | Print this symbol's value on YYOUTPUT. |
1107 `----------------------------------------*/
1108
1109 static void
1110 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, parser_ctx_t *ctx)
1111 {
1112 FILE *yyo = yyoutput;
1113 YYUSE (yyo);
1114 YYUSE (ctx);
1115 if (!yyvaluep)
1116 return;
1117 # ifdef YYPRINT
1118 if (yytype < YYNTOKENS)
1119 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
1120 # endif
1121 YYUSE (yytype);
1122 }
1123
1124
1125 /*--------------------------------.
1126 | Print this symbol on YYOUTPUT. |
1127 `--------------------------------*/
1128
1129 static void
1130 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, parser_ctx_t *ctx)
1131 {
1132 YYFPRINTF (yyoutput, "%s %s (",
1133 yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
1134
1135 yy_symbol_value_print (yyoutput, yytype, yyvaluep, ctx);
1136 YYFPRINTF (yyoutput, ")");
1137 }
1138
1139 /*------------------------------------------------------------------.
1140 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1141 | TOP (included). |
1142 `------------------------------------------------------------------*/
1143
1144 static void
1145 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
1146 {
1147 YYFPRINTF (stderr, "Stack now");
1148 for (; yybottom <= yytop; yybottom++)
1149 {
1150 int yybot = *yybottom;
1151 YYFPRINTF (stderr, " %d", yybot);
1152 }
1153 YYFPRINTF (stderr, "\n");
1154 }
1155
1156 # define YY_STACK_PRINT(Bottom, Top) \
1157 do { \
1158 if (yydebug) \
1159 yy_stack_print ((Bottom), (Top)); \
1160 } while (0)
1161
1162
1163 /*------------------------------------------------.
1164 | Report that the YYRULE is going to be reduced. |
1165 `------------------------------------------------*/
1166
1167 static void
1168 yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule, parser_ctx_t *ctx)
1169 {
1170 unsigned long int yylno = yyrline[yyrule];
1171 int yynrhs = yyr2[yyrule];
1172 int yyi;
1173 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
1174 yyrule - 1, yylno);
1175 /* The symbols being reduced. */
1176 for (yyi = 0; yyi < yynrhs; yyi++)
1177 {
1178 YYFPRINTF (stderr, " $%d = ", yyi + 1);
1179 yy_symbol_print (stderr,
1180 yystos[yyssp[yyi + 1 - yynrhs]],
1181 &(yyvsp[(yyi + 1) - (yynrhs)])
1182 , ctx);
1183 YYFPRINTF (stderr, "\n");
1184 }
1185 }
1186
1187 # define YY_REDUCE_PRINT(Rule) \
1188 do { \
1189 if (yydebug) \
1190 yy_reduce_print (yyssp, yyvsp, Rule, ctx); \
1191 } while (0)
1192
1193 /* Nonzero means print parse trace. It is left uninitialized so that
1194 multiple parsers can coexist. */
1195 int yydebug;
1196 #else /* !YYDEBUG */
1197 # define YYDPRINTF(Args)
1198 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1199 # define YY_STACK_PRINT(Bottom, Top)
1200 # define YY_REDUCE_PRINT(Rule)
1201 #endif /* !YYDEBUG */
1202
1203
1204 /* YYINITDEPTH -- initial size of the parser's stacks. */
1205 #ifndef YYINITDEPTH
1206 # define YYINITDEPTH 200
1207 #endif
1208
1209 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1210 if the built-in stack extension method is used).
1211
1212 Do not make this value too large; the results are undefined if
1213 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1214 evaluated with infinite-precision integer arithmetic. */
1215
1216 #ifndef YYMAXDEPTH
1217 # define YYMAXDEPTH 10000
1218 #endif
1219
1220
1221 #if YYERROR_VERBOSE
1222
1223 # ifndef yystrlen
1224 # if defined __GLIBC__ && defined _STRING_H
1225 # define yystrlen strlen
1226 # else
1227 /* Return the length of YYSTR. */
1228 static YYSIZE_T
1229 yystrlen (const char *yystr)
1230 {
1231 YYSIZE_T yylen;
1232 for (yylen = 0; yystr[yylen]; yylen++)
1233 continue;
1234 return yylen;
1235 }
1236 # endif
1237 # endif
1238
1239 # ifndef yystpcpy
1240 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1241 # define yystpcpy stpcpy
1242 # else
1243 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1244 YYDEST. */
1245 static char *
1246 yystpcpy (char *yydest, const char *yysrc)
1247 {
1248 char *yyd = yydest;
1249 const char *yys = yysrc;
1250
1251 while ((*yyd++ = *yys++) != '\0')
1252 continue;
1253
1254 return yyd - 1;
1255 }
1256 # endif
1257 # endif
1258
1259 # ifndef yytnamerr
1260 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1261 quotes and backslashes, so that it's suitable for yyerror. The
1262 heuristic is that double-quoting is unnecessary unless the string
1263 contains an apostrophe, a comma, or backslash (other than
1264 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1265 null, do not copy; instead, return the length of what the result
1266 would have been. */
1267 static YYSIZE_T
1268 yytnamerr (char *yyres, const char *yystr)
1269 {
1270 if (*yystr == '"')
1271 {
1272 YYSIZE_T yyn = 0;
1273 char const *yyp = yystr;
1274
1275 for (;;)
1276 switch (*++yyp)
1277 {
1278 case '\'':
1279 case ',':
1280 goto do_not_strip_quotes;
1281
1282 case '\\':
1283 if (*++yyp != '\\')
1284 goto do_not_strip_quotes;
1285 /* Fall through. */
1286 default:
1287 if (yyres)
1288 yyres[yyn] = *yyp;
1289 yyn++;
1290 break;
1291
1292 case '"':
1293 if (yyres)
1294 yyres[yyn] = '\0';
1295 return yyn;
1296 }
1297 do_not_strip_quotes: ;
1298 }
1299
1300 if (! yyres)
1301 return yystrlen (yystr);
1302
1303 return yystpcpy (yyres, yystr) - yyres;
1304 }
1305 # endif
1306
1307 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1308 about the unexpected token YYTOKEN for the state stack whose top is
1309 YYSSP.
1310
1311 Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
1312 not large enough to hold the message. In that case, also set
1313 *YYMSG_ALLOC to the required number of bytes. Return 2 if the
1314 required number of bytes is too large to store. */
1315 static int
1316 yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
1317 yytype_int16 *yyssp, int yytoken)
1318 {
1319 YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
1320 YYSIZE_T yysize = yysize0;
1321 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1322 /* Internationalized format string. */
1323 const char *yyformat = YY_NULLPTR;
1324 /* Arguments of yyformat. */
1325 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1326 /* Number of reported tokens (one for the "unexpected", one per
1327 "expected"). */
1328 int yycount = 0;
1329
1330 /* There are many possibilities here to consider:
1331 - If this state is a consistent state with a default action, then
1332 the only way this function was invoked is if the default action
1333 is an error action. In that case, don't check for expected
1334 tokens because there are none.
1335 - The only way there can be no lookahead present (in yychar) is if
1336 this state is a consistent state with a default action. Thus,
1337 detecting the absence of a lookahead is sufficient to determine
1338 that there is no unexpected or expected token to report. In that
1339 case, just report a simple "syntax error".
1340 - Don't assume there isn't a lookahead just because this state is a
1341 consistent state with a default action. There might have been a
1342 previous inconsistent state, consistent state with a non-default
1343 action, or user semantic action that manipulated yychar.
1344 - Of course, the expected token list depends on states to have
1345 correct lookahead information, and it depends on the parser not
1346 to perform extra reductions after fetching a lookahead from the
1347 scanner and before detecting a syntax error. Thus, state merging
1348 (from LALR or IELR) and default reductions corrupt the expected
1349 token list. However, the list is correct for canonical LR with
1350 one exception: it will still contain any token that will not be
1351 accepted due to an error action in a later state.
1352 */
1353 if (yytoken != YYEMPTY)
1354 {
1355 int yyn = yypact[*yyssp];
1356 yyarg[yycount++] = yytname[yytoken];
1357 if (!yypact_value_is_default (yyn))
1358 {
1359 /* Start YYX at -YYN if negative to avoid negative indexes in
1360 YYCHECK. In other words, skip the first -YYN actions for
1361 this state because they are default actions. */
1362 int yyxbegin = yyn < 0 ? -yyn : 0;
1363 /* Stay within bounds of both yycheck and yytname. */
1364 int yychecklim = YYLAST - yyn + 1;
1365 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1366 int yyx;
1367
1368 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1369 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
1370 && !yytable_value_is_error (yytable[yyx + yyn]))
1371 {
1372 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1373 {
1374 yycount = 1;
1375 yysize = yysize0;
1376 break;
1377 }
1378 yyarg[yycount++] = yytname[yyx];
1379 {
1380 YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
1381 if (! (yysize <= yysize1
1382 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1383 return 2;
1384 yysize = yysize1;
1385 }
1386 }
1387 }
1388 }
1389
1390 switch (yycount)
1391 {
1392 # define YYCASE_(N, S) \
1393 case N: \
1394 yyformat = S; \
1395 break
1396 YYCASE_(0, YY_("syntax error"));
1397 YYCASE_(1, YY_("syntax error, unexpected %s"));
1398 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1399 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1400 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1401 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1402 # undef YYCASE_
1403 }
1404
1405 {
1406 YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
1407 if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1408 return 2;
1409 yysize = yysize1;
1410 }
1411
1412 if (*yymsg_alloc < yysize)
1413 {
1414 *yymsg_alloc = 2 * yysize;
1415 if (! (yysize <= *yymsg_alloc
1416 && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1417 *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1418 return 1;
1419 }
1420
1421 /* Avoid sprintf, as that infringes on the user's name space.
1422 Don't have undefined behavior even if the translation
1423 produced a string with the wrong number of "%s"s. */
1424 {
1425 char *yyp = *yymsg;
1426 int yyi = 0;
1427 while ((*yyp = *yyformat) != '\0')
1428 if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1429 {
1430 yyp += yytnamerr (yyp, yyarg[yyi++]);
1431 yyformat += 2;
1432 }
1433 else
1434 {
1435 yyp++;
1436 yyformat++;
1437 }
1438 }
1439 return 0;
1440 }
1441 #endif /* YYERROR_VERBOSE */
1442
1443 /*-----------------------------------------------.
1444 | Release the memory associated to this symbol. |
1445 `-----------------------------------------------*/
1446
1447 static void
1448 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, parser_ctx_t *ctx)
1449 {
1450 YYUSE (yyvaluep);
1451 YYUSE (ctx);
1452 if (!yymsg)
1453 yymsg = "Deleting";
1454 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1455
1456 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1457 YYUSE (yytype);
1458 YY_IGNORE_MAYBE_UNINITIALIZED_END
1459 }
1460
1461
1462
1463
1464 /*----------.
1465 | yyparse. |
1466 `----------*/
1467
1468 int
1469 yyparse (parser_ctx_t *ctx)
1470 {
1471 /* The lookahead symbol. */
1472 int yychar;
1473
1474
1475 /* The semantic value of the lookahead symbol. */
1476 /* Default value used for initialization, for pacifying older GCCs
1477 or non-GCC compilers. */
1478 YY_INITIAL_VALUE (static YYSTYPE yyval_default;)
1479 YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default);
1480
1481 /* Number of syntax errors so far. */
1482 int yynerrs;
1483
1484 int yystate;
1485 /* Number of tokens to shift before error messages enabled. */
1486 int yyerrstatus;
1487
1488 /* The stacks and their tools:
1489 'yyss': related to states.
1490 'yyvs': related to semantic values.
1491
1492 Refer to the stacks through separate pointers, to allow yyoverflow
1493 to reallocate them elsewhere. */
1494
1495 /* The state stack. */
1496 yytype_int16 yyssa[YYINITDEPTH];
1497 yytype_int16 *yyss;
1498 yytype_int16 *yyssp;
1499
1500 /* The semantic value stack. */
1501 YYSTYPE yyvsa[YYINITDEPTH];
1502 YYSTYPE *yyvs;
1503 YYSTYPE *yyvsp;
1504
1505 YYSIZE_T yystacksize;
1506
1507 int yyn;
1508 int yyresult;
1509 /* Lookahead token as an internal (translated) token number. */
1510 int yytoken = 0;
1511 /* The variables used to return semantic value and location from the
1512 action routines. */
1513 YYSTYPE yyval;
1514
1515 #if YYERROR_VERBOSE
1516 /* Buffer for error messages, and its allocated size. */
1517 char yymsgbuf[128];
1518 char *yymsg = yymsgbuf;
1519 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1520 #endif
1521
1522 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1523
1524 /* The number of symbols on the RHS of the reduced rule.
1525 Keep to zero when no symbol should be popped. */
1526 int yylen = 0;
1527
1528 yyssp = yyss = yyssa;
1529 yyvsp = yyvs = yyvsa;
1530 yystacksize = YYINITDEPTH;
1531
1532 YYDPRINTF ((stderr, "Starting parse\n"));
1533
1534 yystate = 0;
1535 yyerrstatus = 0;
1536 yynerrs = 0;
1537 yychar = YYEMPTY; /* Cause a token to be read. */
1538 goto yysetstate;
1539
1540 /*------------------------------------------------------------.
1541 | yynewstate -- Push a new state, which is found in yystate. |
1542 `------------------------------------------------------------*/
1543 yynewstate:
1544 /* In all cases, when you get here, the value and location stacks
1545 have just been pushed. So pushing a state here evens the stacks. */
1546 yyssp++;
1547
1548 yysetstate:
1549 *yyssp = yystate;
1550
1551 if (yyss + yystacksize - 1 <= yyssp)
1552 {
1553 /* Get the current used size of the three stacks, in elements. */
1554 YYSIZE_T yysize = yyssp - yyss + 1;
1555
1556 #ifdef yyoverflow
1557 {
1558 /* Give user a chance to reallocate the stack. Use copies of
1559 these so that the &'s don't force the real ones into
1560 memory. */
1561 YYSTYPE *yyvs1 = yyvs;
1562 yytype_int16 *yyss1 = yyss;
1563
1564 /* Each stack pointer address is followed by the size of the
1565 data in use in that stack, in bytes. This used to be a
1566 conditional around just the two extra args, but that might
1567 be undefined if yyoverflow is a macro. */
1568 yyoverflow (YY_("memory exhausted"),
1569 &yyss1, yysize * sizeof (*yyssp),
1570 &yyvs1, yysize * sizeof (*yyvsp),
1571 &yystacksize);
1572
1573 yyss = yyss1;
1574 yyvs = yyvs1;
1575 }
1576 #else /* no yyoverflow */
1577 # ifndef YYSTACK_RELOCATE
1578 goto yyexhaustedlab;
1579 # else
1580 /* Extend the stack our own way. */
1581 if (YYMAXDEPTH <= yystacksize)
1582 goto yyexhaustedlab;
1583 yystacksize *= 2;
1584 if (YYMAXDEPTH < yystacksize)
1585 yystacksize = YYMAXDEPTH;
1586
1587 {
1588 yytype_int16 *yyss1 = yyss;
1589 union yyalloc *yyptr =
1590 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1591 if (! yyptr)
1592 goto yyexhaustedlab;
1593 YYSTACK_RELOCATE (yyss_alloc, yyss);
1594 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1595 # undef YYSTACK_RELOCATE
1596 if (yyss1 != yyssa)
1597 YYSTACK_FREE (yyss1);
1598 }
1599 # endif
1600 #endif /* no yyoverflow */
1601
1602 yyssp = yyss + yysize - 1;
1603 yyvsp = yyvs + yysize - 1;
1604
1605 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1606 (unsigned long int) yystacksize));
1607
1608 if (yyss + yystacksize - 1 <= yyssp)
1609 YYABORT;
1610 }
1611
1612 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1613
1614 if (yystate == YYFINAL)
1615 YYACCEPT;
1616
1617 goto yybackup;
1618
1619 /*-----------.
1620 | yybackup. |
1621 `-----------*/
1622 yybackup:
1623
1624 /* Do appropriate processing given the current state. Read a
1625 lookahead token if we need one and don't already have one. */
1626
1627 /* First try to decide what to do without reference to lookahead token. */
1628 yyn = yypact[yystate];
1629 if (yypact_value_is_default (yyn))
1630 goto yydefault;
1631
1632 /* Not known => get a lookahead token if don't already have one. */
1633
1634 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1635 if (yychar == YYEMPTY)
1636 {
1637 YYDPRINTF ((stderr, "Reading a token: "));
1638 yychar = yylex (&yylval, ctx);
1639 }
1640
1641 if (yychar <= YYEOF)
1642 {
1643 yychar = yytoken = YYEOF;
1644 YYDPRINTF ((stderr, "Now at end of input.\n"));
1645 }
1646 else
1647 {
1648 yytoken = YYTRANSLATE (yychar);
1649 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1650 }
1651
1652 /* If the proper action on seeing token YYTOKEN is to reduce or to
1653 detect an error, take that action. */
1654 yyn += yytoken;
1655 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1656 goto yydefault;
1657 yyn = yytable[yyn];
1658 if (yyn <= 0)
1659 {
1660 if (yytable_value_is_error (yyn))
1661 goto yyerrlab;
1662 yyn = -yyn;
1663 goto yyreduce;
1664 }
1665
1666 /* Count tokens shifted since error; after three, turn off error
1667 status. */
1668 if (yyerrstatus)
1669 yyerrstatus--;
1670
1671 /* Shift the lookahead token. */
1672 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1673
1674 /* Discard the shifted token. */
1675 yychar = YYEMPTY;
1676
1677 yystate = yyn;
1678 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1679 *++yyvsp = yylval;
1680 YY_IGNORE_MAYBE_UNINITIALIZED_END
1681
1682 goto yynewstate;
1683
1684
1685 /*-----------------------------------------------------------.
1686 | yydefault -- do the default action for the current state. |
1687 `-----------------------------------------------------------*/
1688 yydefault:
1689 yyn = yydefact[yystate];
1690 if (yyn == 0)
1691 goto yyerrlab;
1692 goto yyreduce;
1693
1694
1695 /*-----------------------------.
1696 | yyreduce -- Do a reduction. |
1697 `-----------------------------*/
1698 yyreduce:
1699 /* yyn is the number of a rule to reduce with. */
1700 yylen = yyr2[yyn];
1701
1702 /* If YYLEN is nonzero, implement the default value of the action:
1703 '$$ = $1'.
1704
1705 Otherwise, the following line sets YYVAL to garbage.
1706 This behavior is undocumented and Bison
1707 users should not rely upon it. Assigning to YYVAL
1708 unconditionally makes the parser a bit smaller, and it avoids a
1709 GCC warning that YYVAL may be used uninitialized. */
1710 yyval = yyvsp[1-yylen];
1711
1712
1713 YY_REDUCE_PRINT (yyn);
1714 switch (yyn)
1715 {
1716 case 2:
1717 #line 147 "parser.y" /* yacc.c:1646 */
1718 { parse_complete(ctx, (yyvsp[-2].boolean)); }
1719 #line 1725 "parser.tab.c" /* yacc.c:1646 */
1720 break;
1721
1722 case 3:
1723 #line 150 "parser.y" /* yacc.c:1646 */
1724 { (yyval.boolean) = FALSE; }
1725 #line 1731 "parser.tab.c" /* yacc.c:1646 */
1726 break;
1727
1728 case 4:
1729 #line 151 "parser.y" /* yacc.c:1646 */
1730 { (yyval.boolean) = TRUE; }
1731 #line 1737 "parser.tab.c" /* yacc.c:1646 */
1732 break;
1733
1734 case 6:
1735 #line 155 "parser.y" /* yacc.c:1646 */
1736 { source_add_statement(ctx, (yyvsp[0].statement)); }
1737 #line 1743 "parser.tab.c" /* yacc.c:1646 */
1738 break;
1739
1740 case 7:
1741 #line 156 "parser.y" /* yacc.c:1646 */
1742 { source_add_class(ctx, (yyvsp[0].class_decl)); }
1743 #line 1749 "parser.tab.c" /* yacc.c:1646 */
1744 break;
1745
1746 case 8:
1747 #line 159 "parser.y" /* yacc.c:1646 */
1748 { (yyval.statement) = NULL; }
1749 #line 1755 "parser.tab.c" /* yacc.c:1646 */
1750 break;
1751
1752 case 9:
1753 #line 160 "parser.y" /* yacc.c:1646 */
1754 { (yyval.statement) = (yyvsp[0].statement); }
1755 #line 1761 "parser.tab.c" /* yacc.c:1646 */
1756 break;
1757
1758 case 10:
1759 #line 163 "parser.y" /* yacc.c:1646 */
1760 { (yyval.statement) = (yyvsp[0].statement); }
1761 #line 1767 "parser.tab.c" /* yacc.c:1646 */
1762 break;
1763
1764 case 11:
1765 #line 164 "parser.y" /* yacc.c:1646 */
1766 { (yyval.statement) = link_statements((yyvsp[-1].statement), (yyvsp[0].statement)); }
1767 #line 1773 "parser.tab.c" /* yacc.c:1646 */
1768 break;
1769
1770 case 12:
1771 #line 167 "parser.y" /* yacc.c:1646 */
1772 { (yyval.statement) = (yyvsp[-1].statement); }
1773 #line 1779 "parser.tab.c" /* yacc.c:1646 */
1774 break;
1775
1776 case 13:
1777 #line 170 "parser.y" /* yacc.c:1646 */
1778 { (yyval.statement) = NULL; }
1779 #line 1785 "parser.tab.c" /* yacc.c:1646 */
1780 break;
1781
1782 case 14:
1783 #line 171 "parser.y" /* yacc.c:1646 */
1784 { (yyval.statement) = (yyvsp[0].statement); }
1785 #line 1791 "parser.tab.c" /* yacc.c:1646 */
1786 break;
1787
1788 case 15:
1789 #line 172 "parser.y" /* yacc.c:1646 */
1790 { (yyval.statement) = (yyvsp[0].statement); }
1791 #line 1797 "parser.tab.c" /* yacc.c:1646 */
1792 break;
1793
1794 case 16:
1795 #line 173 "parser.y" /* yacc.c:1646 */
1796 { (yyvsp[-2].statement)->next = (yyvsp[0].statement); (yyval.statement) = (yyvsp[-2].statement); }
1797 #line 1803 "parser.tab.c" /* yacc.c:1646 */
1798 break;
1799
1800 case 17:
1801 #line 174 "parser.y" /* yacc.c:1646 */
1802 { (yyval.statement) = (yyvsp[-1].statement); }
1803 #line 1809 "parser.tab.c" /* yacc.c:1646 */
1804 break;
1805
1806 case 18:
1807 #line 177 "parser.y" /* yacc.c:1646 */
1808 { (yyvsp[-1].member)->args = (yyvsp[0].expression); (yyval.statement) = new_call_statement(ctx, FALSE, (yyvsp[-1].member)); CHECK_ERROR; }
1809 #line 1815 "parser.tab.c" /* yacc.c:1646 */
1810 break;
1811
1812 case 19:
1813 #line 178 "parser.y" /* yacc.c:1646 */
1814 { (yyvsp[-1].member)->args = (yyvsp[0].expression); (yyval.statement) = new_call_statement(ctx, TRUE, (yyvsp[-1].member)); CHECK_ERROR; }
1815 #line 1821 "parser.tab.c" /* yacc.c:1646 */
1816 break;
1817
1818 case 20:
1819 #line 180 "parser.y" /* yacc.c:1646 */
1820 { (yyvsp[-3].member)->args = (yyvsp[-2].expression); (yyval.statement) = new_assign_statement(ctx, (yyvsp[-3].member), (yyvsp[0].expression)); CHECK_ERROR; }
1821 #line 1827 "parser.tab.c" /* yacc.c:1646 */
1822 break;
1823
1824 case 21:
1825 #line 181 "parser.y" /* yacc.c:1646 */
1826 { (yyval.statement) = new_dim_statement(ctx, (yyvsp[0].dim_decl)); CHECK_ERROR; }
1827 #line 1833 "parser.tab.c" /* yacc.c:1646 */
1828 break;
1829
1830 case 22:
1831 #line 182 "parser.y" /* yacc.c:1646 */
1832 { (yyval.statement) = (yyvsp[0].statement); }
1833 #line 1839 "parser.tab.c" /* yacc.c:1646 */
1834 break;
1835
1836 case 23:
1837 #line 184 "parser.y" /* yacc.c:1646 */
1838 { (yyval.statement) = new_while_statement(ctx, STAT_WHILE, (yyvsp[-3].expression), (yyvsp[-1].statement)); CHECK_ERROR; }
1839 #line 1845 "parser.tab.c" /* yacc.c:1646 */
1840 break;
1841
1842 case 24:
1843 #line 186 "parser.y" /* yacc.c:1646 */
1844 { (yyval.statement) = new_while_statement(ctx, (yyvsp[-4].boolean) ? STAT_WHILELOOP : STAT_UNTIL, (yyvsp[-3].expression), (yyvsp[-1].statement));
1845 CHECK_ERROR; }
1846 #line 1852 "parser.tab.c" /* yacc.c:1646 */
1847 break;
1848
1849 case 25:
1850 #line 189 "parser.y" /* yacc.c:1646 */
1851 { (yyval.statement) = new_while_statement(ctx, (yyvsp[-1].boolean) ? STAT_DOWHILE : STAT_DOUNTIL, (yyvsp[0].expression), (yyvsp[-3].statement));
1852 CHECK_ERROR; }
1853 #line 1859 "parser.tab.c" /* yacc.c:1646 */
1854 break;
1855
1856 case 26:
1857 #line 191 "parser.y" /* yacc.c:1646 */
1858 { (yyval.statement) = new_while_statement(ctx, STAT_DOWHILE, NULL, (yyvsp[-1].statement)); CHECK_ERROR; }
1859 #line 1865 "parser.tab.c" /* yacc.c:1646 */
1860 break;
1861
1862 case 27:
1863 #line 192 "parser.y" /* yacc.c:1646 */
1864 { (yyval.statement) = new_function_statement(ctx, (yyvsp[0].func_decl)); CHECK_ERROR; }
1865 #line 1871 "parser.tab.c" /* yacc.c:1646 */
1866 break;
1867
1868 case 28:
1869 #line 193 "parser.y" /* yacc.c:1646 */
1870 { (yyval.statement) = new_statement(ctx, STAT_EXITDO, 0); CHECK_ERROR; }
1871 #line 1877 "parser.tab.c" /* yacc.c:1646 */
1872 break;
1873
1874 case 29:
1875 #line 194 "parser.y" /* yacc.c:1646 */
1876 { (yyval.statement) = new_statement(ctx, STAT_EXITFOR, 0); CHECK_ERROR; }
1877 #line 1883 "parser.tab.c" /* yacc.c:1646 */
1878 break;
1879
1880 case 30:
1881 #line 195 "parser.y" /* yacc.c:1646 */
1882 { (yyval.statement) = new_statement(ctx, STAT_EXITFUNC, 0); CHECK_ERROR; }
1883 #line 1889 "parser.tab.c" /* yacc.c:1646 */
1884 break;
1885
1886 case 31:
1887 #line 196 "parser.y" /* yacc.c:1646 */
1888 { (yyval.statement) = new_statement(ctx, STAT_EXITPROP, 0); CHECK_ERROR; }
1889 #line 1895 "parser.tab.c" /* yacc.c:1646 */
1890 break;
1891
1892 case 32:
1893 #line 197 "parser.y" /* yacc.c:1646 */
1894 { (yyval.statement) = new_statement(ctx, STAT_EXITSUB, 0); CHECK_ERROR; }
1895 #line 1901 "parser.tab.c" /* yacc.c:1646 */
1896 break;
1897
1898 case 33:
1899 #line 199 "parser.y" /* yacc.c:1646 */
1900 { (yyvsp[-3].member)->args = (yyvsp[-2].expression); (yyval.statement) = new_set_statement(ctx, (yyvsp[-3].member), (yyvsp[0].expression)); CHECK_ERROR; }
1901 #line 1907 "parser.tab.c" /* yacc.c:1646 */
1902 break;
1903
1904 case 34:
1905 #line 200 "parser.y" /* yacc.c:1646 */
1906 { (yyval.statement) = new_statement(ctx, STAT_STOP, 0); CHECK_ERROR; }
1907 #line 1913 "parser.tab.c" /* yacc.c:1646 */
1908 break;
1909
1910 case 35:
1911 #line 201 "parser.y" /* yacc.c:1646 */
1912 { (yyval.statement) = new_onerror_statement(ctx, TRUE); CHECK_ERROR; }
1913 #line 1919 "parser.tab.c" /* yacc.c:1646 */
1914 break;
1915
1916 case 36:
1917 #line 202 "parser.y" /* yacc.c:1646 */
1918 { (yyval.statement) = new_onerror_statement(ctx, FALSE); CHECK_ERROR; }
1919 #line 1925 "parser.tab.c" /* yacc.c:1646 */
1920 break;
1921
1922 case 37:
1923 #line 203 "parser.y" /* yacc.c:1646 */
1924 { (yyval.statement) = new_const_statement(ctx, (yyvsp[0].const_decl)); CHECK_ERROR; }
1925 #line 1931 "parser.tab.c" /* yacc.c:1646 */
1926 break;
1927
1928 case 38:
1929 #line 205 "parser.y" /* yacc.c:1646 */
1930 { (yyval.statement) = new_forto_statement(ctx, (yyvsp[-8].string), (yyvsp[-6].expression), (yyvsp[-4].expression), (yyvsp[-3].expression), (yyvsp[-1].statement)); CHECK_ERROR; }
1931 #line 1937 "parser.tab.c" /* yacc.c:1646 */
1932 break;
1933
1934 case 39:
1935 #line 207 "parser.y" /* yacc.c:1646 */
1936 { (yyval.statement) = new_foreach_statement(ctx, (yyvsp[-5].string), (yyvsp[-3].expression), (yyvsp[-1].statement)); }
1937 #line 1943 "parser.tab.c" /* yacc.c:1646 */
1938 break;
1939
1940 case 40:
1941 #line 209 "parser.y" /* yacc.c:1646 */
1942 { (yyval.statement) = new_select_statement(ctx, (yyvsp[-4].expression), (yyvsp[-2].case_clausule)); }
1943 #line 1949 "parser.tab.c" /* yacc.c:1646 */
1944 break;
1945
1946 case 41:
1947 #line 212 "parser.y" /* yacc.c:1646 */
1948 { (yyval.member) = new_member_expression(ctx, NULL, (yyvsp[0].string)); CHECK_ERROR; }
1949 #line 1955 "parser.tab.c" /* yacc.c:1646 */
1950 break;
1951
1952 case 42:
1953 #line 213 "parser.y" /* yacc.c:1646 */
1954 { (yyval.member) = new_member_expression(ctx, (yyvsp[-2].expression), (yyvsp[0].string)); CHECK_ERROR; }
1955 #line 1961 "parser.tab.c" /* yacc.c:1646 */
1956 break;
1957
1958 case 43:
1959 #line 216 "parser.y" /* yacc.c:1646 */
1960 { (yyval.dim_decl) = (yyvsp[0].dim_decl); }
1961 #line 1967 "parser.tab.c" /* yacc.c:1646 */
1962 break;
1963
1964 case 44:
1965 #line 217 "parser.y" /* yacc.c:1646 */
1966 { (yyvsp[-2].dim_decl)->next = (yyvsp[0].dim_decl); (yyval.dim_decl) = (yyvsp[-2].dim_decl); }
1967 #line 1973 "parser.tab.c" /* yacc.c:1646 */
1968 break;
1969
1970 case 45:
1971 #line 220 "parser.y" /* yacc.c:1646 */
1972 { (yyval.dim_decl) = new_dim_decl(ctx, (yyvsp[0].string), FALSE, NULL); CHECK_ERROR; }
1973 #line 1979 "parser.tab.c" /* yacc.c:1646 */
1974 break;
1975
1976 case 46:
1977 #line 221 "parser.y" /* yacc.c:1646 */
1978 { (yyval.dim_decl) = new_dim_decl(ctx, (yyvsp[-3].string), TRUE, (yyvsp[-1].dim_list)); CHECK_ERROR; }
1979 #line 1985 "parser.tab.c" /* yacc.c:1646 */
1980 break;
1981
1982 case 47:
1983 #line 222 "parser.y" /* yacc.c:1646 */
1984 { (yyval.dim_decl) = new_dim_decl(ctx, (yyvsp[-1].string), TRUE, NULL); CHECK_ERROR; }
1985 #line 1991 "parser.tab.c" /* yacc.c:1646 */
1986 break;
1987
1988 case 48:
1989 #line 225 "parser.y" /* yacc.c:1646 */
1990 { (yyval.dim_list) = new_dim(ctx, (yyvsp[0].uint), NULL); }
1991 #line 1997 "parser.tab.c" /* yacc.c:1646 */
1992 break;
1993
1994 case 49:
1995 #line 226 "parser.y" /* yacc.c:1646 */
1996 { (yyval.dim_list) = new_dim(ctx, (yyvsp[-2].uint), (yyvsp[0].dim_list)); }
1997 #line 2003 "parser.tab.c" /* yacc.c:1646 */
1998 break;
1999
2000 case 50:
2001 #line 229 "parser.y" /* yacc.c:1646 */
2002 { (yyval.const_decl) = (yyvsp[0].const_decl); }
2003 #line 2009 "parser.tab.c" /* yacc.c:1646 */
2004 break;
2005
2006 case 51:
2007 #line 230 "parser.y" /* yacc.c:1646 */
2008 { (yyvsp[-2].const_decl)->next = (yyvsp[0].const_decl); (yyval.const_decl) = (yyvsp[-2].const_decl); }
2009 #line 2015 "parser.tab.c" /* yacc.c:1646 */
2010 break;
2011
2012 case 52:
2013 #line 233 "parser.y" /* yacc.c:1646 */
2014 { (yyval.const_decl) = new_const_decl(ctx, (yyvsp[-2].string), (yyvsp[0].expression)); CHECK_ERROR; }
2015 #line 2021 "parser.tab.c" /* yacc.c:1646 */
2016 break;
2017
2018 case 53:
2019 #line 236 "parser.y" /* yacc.c:1646 */
2020 { (yyval.expression) = (yyvsp[0].expression); }
2021 #line 2027 "parser.tab.c" /* yacc.c:1646 */
2022 break;
2023
2024 case 54:
2025 #line 237 "parser.y" /* yacc.c:1646 */
2026 { (yyval.expression) = new_unary_expression(ctx, EXPR_NEG, (yyvsp[0].expression)); CHECK_ERROR; }
2027 #line 2033 "parser.tab.c" /* yacc.c:1646 */
2028 break;
2029
2030 case 55:
2031 #line 240 "parser.y" /* yacc.c:1646 */
2032 { (yyval.boolean) = TRUE; }
2033 #line 2039 "parser.tab.c" /* yacc.c:1646 */
2034 break;
2035
2036 case 56:
2037 #line 241 "parser.y" /* yacc.c:1646 */
2038 { (yyval.boolean) = FALSE; }
2039 #line 2045 "parser.tab.c" /* yacc.c:1646 */
2040 break;
2041
2042 case 57:
2043 #line 244 "parser.y" /* yacc.c:1646 */
2044 { (yyval.expression) = NULL;}
2045 #line 2051 "parser.tab.c" /* yacc.c:1646 */
2046 break;
2047
2048 case 58:
2049 #line 245 "parser.y" /* yacc.c:1646 */
2050 { (yyval.expression) = (yyvsp[0].expression); }
2051 #line 2057 "parser.tab.c" /* yacc.c:1646 */
2052 break;
2053
2054 case 59:
2055 #line 249 "parser.y" /* yacc.c:1646 */
2056 { (yyval.statement) = new_if_statement(ctx, (yyvsp[-7].expression), (yyvsp[-4].statement), (yyvsp[-3].elseif), (yyvsp[-2].statement)); CHECK_ERROR; }
2057 #line 2063 "parser.tab.c" /* yacc.c:1646 */
2058 break;
2059
2060 case 60:
2061 #line 250 "parser.y" /* yacc.c:1646 */
2062 { (yyval.statement) = new_if_statement(ctx, (yyvsp[-3].expression), (yyvsp[-1].statement), NULL, NULL); CHECK_ERROR; }
2063 #line 2069 "parser.tab.c" /* yacc.c:1646 */
2064 break;
2065
2066 case 61:
2067 #line 252 "parser.y" /* yacc.c:1646 */
2068 { (yyval.statement) = new_if_statement(ctx, (yyvsp[-5].expression), (yyvsp[-3].statement), NULL, (yyvsp[-1].statement)); CHECK_ERROR; }
2069 #line 2075 "parser.tab.c" /* yacc.c:1646 */
2070 break;
2071
2072 case 64:
2073 #line 259 "parser.y" /* yacc.c:1646 */
2074 { (yyval.elseif) = NULL; }
2075 #line 2081 "parser.tab.c" /* yacc.c:1646 */
2076 break;
2077
2078 case 65:
2079 #line 260 "parser.y" /* yacc.c:1646 */
2080 { (yyval.elseif) = (yyvsp[0].elseif); }
2081 #line 2087 "parser.tab.c" /* yacc.c:1646 */
2082 break;
2083
2084 case 66:
2085 #line 263 "parser.y" /* yacc.c:1646 */
2086 { (yyval.elseif) = (yyvsp[0].elseif); }
2087 #line 2093 "parser.tab.c" /* yacc.c:1646 */
2088 break;
2089
2090 case 67:
2091 #line 264 "parser.y" /* yacc.c:1646 */
2092 { (yyvsp[-1].elseif)->next = (yyvsp[0].elseif); (yyval.elseif) = (yyvsp[-1].elseif); }
2093 #line 2099 "parser.tab.c" /* yacc.c:1646 */
2094 break;
2095
2096 case 68:
2097 #line 268 "parser.y" /* yacc.c:1646 */
2098 { (yyval.elseif) = new_elseif_decl(ctx, (yyvsp[-3].expression), (yyvsp[0].statement)); }
2099 #line 2105 "parser.tab.c" /* yacc.c:1646 */
2100 break;
2101
2102 case 69:
2103 #line 271 "parser.y" /* yacc.c:1646 */
2104 { (yyval.statement) = NULL; }
2105 #line 2111 "parser.tab.c" /* yacc.c:1646 */
2106 break;
2107
2108 case 70:
2109 #line 272 "parser.y" /* yacc.c:1646 */
2110 { (yyval.statement) = (yyvsp[0].statement); }
2111 #line 2117 "parser.tab.c" /* yacc.c:1646 */
2112 break;
2113
2114 case 71:
2115 #line 275 "parser.y" /* yacc.c:1646 */
2116 { (yyval.case_clausule) = NULL; }
2117 #line 2123 "parser.tab.c" /* yacc.c:1646 */
2118 break;
2119
2120 case 72:
2121 #line 276 "parser.y" /* yacc.c:1646 */
2122 { (yyval.case_clausule) = new_case_clausule(ctx, NULL, (yyvsp[0].statement), NULL); }
2123 #line 2129 "parser.tab.c" /* yacc.c:1646 */
2124 break;
2125
2126 case 73:
2127 #line 278 "parser.y" /* yacc.c:1646 */
2128 { (yyval.case_clausule) = new_case_clausule(ctx, (yyvsp[-3].expression), (yyvsp[-1].statement), (yyvsp[0].case_clausule)); }
2129 #line 2135 "parser.tab.c" /* yacc.c:1646 */
2130 break;
2131
2132 case 74:
2133 #line 281 "parser.y" /* yacc.c:1646 */
2134 { (yyval.expression) = NULL; }
2135 #line 2141 "parser.tab.c" /* yacc.c:1646 */
2136 break;
2137
2138 case 75:
2139 #line 282 "parser.y" /* yacc.c:1646 */
2140 { (yyval.expression) = (yyvsp[-1].expression); }
2141 #line 2147 "parser.tab.c" /* yacc.c:1646 */
2142 break;
2143
2144 case 76:
2145 #line 285 "parser.y" /* yacc.c:1646 */
2146 { (yyval.expression) = NULL; }
2147 #line 2153 "parser.tab.c" /* yacc.c:1646 */
2148 break;
2149
2150 case 77:
2151 #line 286 "parser.y" /* yacc.c:1646 */
2152 { (yyval.expression) = (yyvsp[0].expression); }
2153 #line 2159 "parser.tab.c" /* yacc.c:1646 */
2154 break;
2155
2156 case 78:
2157 #line 289 "parser.y" /* yacc.c:1646 */
2158 { (yyval.expression) = (yyvsp[0].expression); }
2159 #line 2165 "parser.tab.c" /* yacc.c:1646 */
2160 break;
2161
2162 case 79:
2163 #line 290 "parser.y" /* yacc.c:1646 */
2164 { (yyvsp[-2].expression)->next = (yyvsp[0].expression); (yyval.expression) = (yyvsp[-2].expression); }
2165 #line 2171 "parser.tab.c" /* yacc.c:1646 */
2166 break;
2167
2168 case 80:
2169 #line 291 "parser.y" /* yacc.c:1646 */
2170 { (yyval.expression) = new_expression(ctx, EXPR_NOARG, 0); CHECK_ERROR; (yyval.expression)->next = (yyvsp[0].expression); }
2171 #line 2177 "parser.tab.c" /* yacc.c:1646 */
2172 break;
2173
2174 case 83:
2175 #line 298 "parser.y" /* yacc.c:1646 */
2176 { (yyval.expression) = (yyvsp[0].expression); }
2177 #line 2183 "parser.tab.c" /* yacc.c:1646 */
2178 break;
2179
2180 case 84:
2181 #line 299 "parser.y" /* yacc.c:1646 */
2182 { (yyvsp[-2].expression)->next = (yyvsp[0].expression); (yyval.expression) = (yyvsp[-2].expression); }
2183 #line 2189 "parser.tab.c" /* yacc.c:1646 */
2184 break;
2185
2186 case 85:
2187 #line 302 "parser.y" /* yacc.c:1646 */
2188 { (yyval.expression) = (yyvsp[0].expression); }
2189 #line 2195 "parser.tab.c" /* yacc.c:1646 */
2190 break;
2191
2192 case 86:
2193 #line 303 "parser.y" /* yacc.c:1646 */
2194 { (yyval.expression) = new_binary_expression(ctx, EXPR_IMP, (yyvsp[-2].expression), (yyvsp[0].expression)); CHECK_ERROR; }
2195 #line 2201 "parser.tab.c" /* yacc.c:1646 */
2196 break;
2197
2198 case 87:
2199 #line 306 "parser.y" /* yacc.c:1646 */
2200 { (yyval.expression) = (yyvsp[0].expression); }
2201 #line 2207 "parser.tab.c" /* yacc.c:1646 */
2202 break;
2203
2204 case 88:
2205 #line 307 "parser.y" /* yacc.c:1646 */
2206 { (yyval.expression) = new_binary_expression(ctx, EXPR_EQV, (yyvsp[-2].expression), (yyvsp[0].expression)); CHECK_ERROR; }
2207 #line 2213 "parser.tab.c" /* yacc.c:1646 */
2208 break;
2209
2210 case 89:
2211 #line 310 "parser.y" /* yacc.c:1646 */
2212 { (yyval.expression) = (yyvsp[0].expression); }
2213 #line 2219 "parser.tab.c" /* yacc.c:1646 */
2214 break;
2215
2216 case 90:
2217 #line 311 "parser.y" /* yacc.c:1646 */
2218 { (yyval.expression) = new_binary_expression(ctx, EXPR_XOR, (yyvsp[-2].expression), (yyvsp[0].expression)); CHECK_ERROR; }
2219 #line 2225 "parser.tab.c" /* yacc.c:1646 */
2220 break;
2221
2222 case 91:
2223 #line 314 "parser.y" /* yacc.c:1646 */
2224 { (yyval.expression) = (yyvsp[0].expression); }
2225 #line 2231 "parser.tab.c" /* yacc.c:1646 */
2226 break;
2227
2228 case 92:
2229 #line 315 "parser.y" /* yacc.c:1646 */
2230 { (yyval.expression) = new_binary_expression(ctx, EXPR_OR, (yyvsp[-2].expression), (yyvsp[0].expression)); CHECK_ERROR; }
2231 #line 2237 "parser.tab.c" /* yacc.c:1646 */
2232 break;
2233
2234 case 93:
2235 #line 318 "parser.y" /* yacc.c:1646 */
2236 { (yyval.expression) = (yyvsp[0].expression); }
2237 #line 2243 "parser.tab.c" /* yacc.c:1646 */
2238 break;
2239
2240 case 94:
2241 #line 319 "parser.y" /* yacc.c:1646 */
2242 { (yyval.expression) = new_binary_expression(ctx, EXPR_AND, (yyvsp[-2].expression), (yyvsp[0].expression)); CHECK_ERROR; }
2243 #line 2249 "parser.tab.c" /* yacc.c:1646 */
2244 break;
2245
2246 case 95:
2247 #line 322 "parser.y" /* yacc.c:1646 */
2248 { (yyval.expression) = (yyvsp[0].expression); }
2249 #line 2255 "parser.tab.c" /* yacc.c:1646 */
2250 break;
2251
2252 case 96:
2253 #line 323 "parser.y" /* yacc.c:1646 */
2254 { (yyval.expression) = new_unary_expression(ctx, EXPR_NOT, (yyvsp[0].expression)); CHECK_ERROR; }
2255 #line 2261 "parser.tab.c" /* yacc.c:1646 */
2256 break;
2257
2258 case 97:
2259 #line 326 "parser.y" /* yacc.c:1646 */
2260 { (yyval.expression) = (yyvsp[0].expression); }
2261 #line 2267 "parser.tab.c" /* yacc.c:1646 */
2262 break;
2263
2264 case 98:
2265 #line 327 "parser.y" /* yacc.c:1646 */
2266 { (yyval.expression) = new_binary_expression(ctx, EXPR_EQUAL, (yyvsp[-2].expression), (yyvsp[0].expression)); CHECK_ERROR; }
2267 #line 2273 "parser.tab.c" /* yacc.c:1646 */
2268 break;
2269
2270 case 99:
2271 #line 328 "parser.y" /* yacc.c:1646 */
2272 { (yyval.expression) = new_binary_expression(ctx, EXPR_NEQUAL, (yyvsp[-2].expression), (yyvsp[0].expression)); CHECK_ERROR; }
2273 #line 2279 "parser.tab.c" /* yacc.c:1646 */
2274 break;
2275
2276 case 100:
2277 #line 329 "parser.y" /* yacc.c:1646 */
2278 { (yyval.expression) = new_binary_expression(ctx, EXPR_GT, (yyvsp[-2].expression), (yyvsp[0].expression)); CHECK_ERROR; }
2279 #line 2285 "parser.tab.c" /* yacc.c:1646 */
2280 break;
2281
2282 case 101:
2283 #line 330 "parser.y" /* yacc.c:1646 */
2284 { (yyval.expression) = new_binary_expression(ctx, EXPR_LT, (yyvsp[-2].expression), (yyvsp[0].expression)); CHECK_ERROR; }
2285 #line 2291 "parser.tab.c" /* yacc.c:1646 */
2286 break;
2287
2288 case 102:
2289 #line 331 "parser.y" /* yacc.c:1646 */
2290 { (yyval.expression) = new_binary_expression(ctx, EXPR_GTEQ, (yyvsp[-2].expression), (yyvsp[0].expression)); CHECK_ERROR; }
2291 #line 2297 "parser.tab.c" /* yacc.c:1646 */
2292 break;
2293
2294 case 103:
2295 #line 332 "parser.y" /* yacc.c:1646 */
2296 { (yyval.expression) = new_binary_expression(ctx, EXPR_LTEQ, (yyvsp[-2].expression), (yyvsp[0].expression)); CHECK_ERROR; }
2297 #line 2303 "parser.tab.c" /* yacc.c:1646 */
2298 break;
2299
2300 case 104:
2301 #line 333 "parser.y" /* yacc.c:1646 */
2302 { (yyval.expression) = new_binary_expression(ctx, EXPR_IS, (yyvsp[-2].expression), (yyvsp[0].expression)); CHECK_ERROR; }
2303 #line 2309 "parser.tab.c" /* yacc.c:1646 */
2304 break;
2305
2306 case 105:
2307 #line 336 "parser.y" /* yacc.c:1646 */
2308 { (yyval.expression) = (yyvsp[0].expression); }
2309 #line 2315 "parser.tab.c" /* yacc.c:1646 */
2310 break;
2311
2312 case 106:
2313 #line 337 "parser.y" /* yacc.c:1646 */
2314 { (yyval.expression) = new_binary_expression(ctx, EXPR_CONCAT, (yyvsp[-2].expression), (yyvsp[0].expression)); CHECK_ERROR; }
2315 #line 2321 "parser.tab.c" /* yacc.c:1646 */
2316 break;
2317
2318 case 107:
2319 #line 340 "parser.y" /* yacc.c:1646 */
2320 { (yyval.expression) = (yyvsp[0].expression); }
2321 #line 2327 "parser.tab.c" /* yacc.c:1646 */
2322 break;
2323
2324 case 108:
2325 #line 341 "parser.y" /* yacc.c:1646 */
2326 { (yyval.expression) = new_binary_expression(ctx, EXPR_ADD, (yyvsp[-2].expression), (yyvsp[0].expression)); CHECK_ERROR; }
2327 #line 2333 "parser.tab.c" /* yacc.c:1646 */
2328 break;
2329
2330 case 109:
2331 #line 342 "parser.y" /* yacc.c:1646 */
2332 { (yyval.expression) = new_binary_expression(ctx, EXPR_SUB, (yyvsp[-2].expression), (yyvsp[0].expression)); CHECK_ERROR; }
2333 #line 2339 "parser.tab.c" /* yacc.c:1646 */
2334 break;
2335
2336 case 110:
2337 #line 345 "parser.y" /* yacc.c:1646 */
2338 { (yyval.expression) = (yyvsp[0].expression); }
2339 #line 2345 "parser.tab.c" /* yacc.c:1646 */
2340 break;
2341
2342 case 111:
2343 #line 346 "parser.y" /* yacc.c:1646 */
2344 { (yyval.expression) = new_binary_expression(ctx, EXPR_MOD, (yyvsp[-2].expression), (yyvsp[0].expression)); CHECK_ERROR; }
2345 #line 2351 "parser.tab.c" /* yacc.c:1646 */
2346 break;
2347
2348 case 112:
2349 #line 349 "parser.y" /* yacc.c:1646 */
2350 { (yyval.expression) = (yyvsp[0].expression); }
2351 #line 2357 "parser.tab.c" /* yacc.c:1646 */
2352 break;
2353
2354 case 113:
2355 #line 351 "parser.y" /* yacc.c:1646 */
2356 { (yyval.expression) = new_binary_expression(ctx, EXPR_IDIV, (yyvsp[-2].expression), (yyvsp[0].expression)); CHECK_ERROR; }
2357 #line 2363 "parser.tab.c" /* yacc.c:1646 */
2358 break;
2359
2360 case 114:
2361 #line 354 "parser.y" /* yacc.c:1646 */
2362 { (yyval.expression) = (yyvsp[0].expression); }
2363 #line 2369 "parser.tab.c" /* yacc.c:1646 */
2364 break;
2365
2366 case 115:
2367 #line 356 "parser.y" /* yacc.c:1646 */
2368 { (yyval.expression) = new_binary_expression(ctx, EXPR_MUL, (yyvsp[-2].expression), (yyvsp[0].expression)); CHECK_ERROR; }
2369 #line 2375 "parser.tab.c" /* yacc.c:1646 */
2370 break;
2371
2372 case 116:
2373 #line 358 "parser.y" /* yacc.c:1646 */
2374 { (yyval.expression) = new_binary_expression(ctx, EXPR_DIV, (yyvsp[-2].expression), (yyvsp[0].expression)); CHECK_ERROR; }
2375 #line 2381 "parser.tab.c" /* yacc.c:1646 */
2376 break;
2377
2378 case 117:
2379 #line 361 "parser.y" /* yacc.c:1646 */
2380 { (yyval.expression) = (yyvsp[0].expression); }
2381 #line 2387 "parser.tab.c" /* yacc.c:1646 */
2382 break;
2383
2384 case 118:
2385 #line 362 "parser.y" /* yacc.c:1646 */
2386 { (yyval.expression) = new_binary_expression(ctx, EXPR_EXP, (yyvsp[-2].expression), (yyvsp[0].expression)); CHECK_ERROR; }
2387 #line 2393 "parser.tab.c" /* yacc.c:1646 */
2388 break;
2389
2390 case 119:
2391 #line 365 "parser.y" /* yacc.c:1646 */
2392 { (yyval.expression) = (yyvsp[0].expression); }
2393 #line 2399 "parser.tab.c" /* yacc.c:1646 */
2394 break;
2395
2396 case 120:
2397 #line 366 "parser.y" /* yacc.c:1646 */
2398 { (yyval.expression) = (yyvsp[0].expression); }
2399 #line 2405 "parser.tab.c" /* yacc.c:1646 */
2400 break;
2401
2402 case 121:
2403 #line 367 "parser.y" /* yacc.c:1646 */
2404 { (yyval.expression) = new_new_expression(ctx, (yyvsp[0].string)); CHECK_ERROR; }
2405 #line 2411 "parser.tab.c" /* yacc.c:1646 */
2406 break;
2407
2408 case 122:
2409 #line 368 "parser.y" /* yacc.c:1646 */
2410 { (yyval.expression) = new_unary_expression(ctx, EXPR_NEG, (yyvsp[0].expression)); CHECK_ERROR; }
2411 #line 2417 "parser.tab.c" /* yacc.c:1646 */
2412 break;
2413
2414 case 123:
2415 #line 371 "parser.y" /* yacc.c:1646 */
2416 { (yyval.expression) = (yyvsp[0].expression); }
2417 #line 2423 "parser.tab.c" /* yacc.c:1646 */
2418 break;
2419
2420 case 124:
2421 #line 372 "parser.y" /* yacc.c:1646 */
2422 { (yyvsp[-1].member)->args = (yyvsp[0].expression); (yyval.expression) = &(yyvsp[-1].member)->expr; }
2423 #line 2429 "parser.tab.c" /* yacc.c:1646 */
2424 break;
2425
2426 case 125:
2427 #line 375 "parser.y" /* yacc.c:1646 */
2428 { (yyval.expression) = new_bool_expression(ctx, VARIANT_TRUE); CHECK_ERROR; }
2429 #line 2435 "parser.tab.c" /* yacc.c:1646 */
2430 break;
2431
2432 case 126:
2433 #line 376 "parser.y" /* yacc.c:1646 */
2434 { (yyval.expression) = new_bool_expression(ctx, VARIANT_FALSE); CHECK_ERROR; }
2435 #line 2441 "parser.tab.c" /* yacc.c:1646 */
2436 break;
2437
2438 case 127:
2439 #line 377 "parser.y" /* yacc.c:1646 */
2440 { (yyval.expression) = new_string_expression(ctx, (yyvsp[0].string)); CHECK_ERROR; }
2441 #line 2447 "parser.tab.c" /* yacc.c:1646 */
2442 break;
2443
2444 case 128:
2445 #line 378 "parser.y" /* yacc.c:1646 */
2446 { (yyval.expression) = (yyvsp[0].expression); }
2447 #line 2453 "parser.tab.c" /* yacc.c:1646 */
2448 break;
2449
2450 case 129:
2451 #line 379 "parser.y" /* yacc.c:1646 */
2452 { (yyval.expression) = new_expression(ctx, EXPR_EMPTY, 0); CHECK_ERROR; }
2453 #line 2459 "parser.tab.c" /* yacc.c:1646 */
2454 break;
2455
2456 case 130:
2457 #line 380 "parser.y" /* yacc.c:1646 */
2458 { (yyval.expression) = new_expression(ctx, EXPR_NULL, 0); CHECK_ERROR; }
2459 #line 2465 "parser.tab.c" /* yacc.c:1646 */
2460 break;
2461
2462 case 131:
2463 #line 381 "parser.y" /* yacc.c:1646 */
2464 { (yyval.expression) = new_expression(ctx, EXPR_NOTHING, 0); CHECK_ERROR; }
2465 #line 2471 "parser.tab.c" /* yacc.c:1646 */
2466 break;
2467
2468 case 132:
2469 #line 384 "parser.y" /* yacc.c:1646 */
2470 { (yyval.expression) = new_long_expression(ctx, EXPR_USHORT, (yyvsp[0].lng)); CHECK_ERROR; }
2471 #line 2477 "parser.tab.c" /* yacc.c:1646 */
2472 break;
2473
2474 case 133:
2475 #line 385 "parser.y" /* yacc.c:1646 */
2476 { (yyval.expression) = new_long_expression(ctx, EXPR_USHORT, 0); CHECK_ERROR; }
2477 #line 2483 "parser.tab.c" /* yacc.c:1646 */
2478 break;
2479
2480 case 134:
2481 #line 386 "parser.y" /* yacc.c:1646 */
2482 { (yyval.expression) = new_long_expression(ctx, EXPR_ULONG, (yyvsp[0].lng)); CHECK_ERROR; }
2483 #line 2489 "parser.tab.c" /* yacc.c:1646 */
2484 break;
2485
2486 case 135:
2487 #line 387 "parser.y" /* yacc.c:1646 */
2488 { (yyval.expression) = new_double_expression(ctx, (yyvsp[0].dbl)); CHECK_ERROR; }
2489 #line 2495 "parser.tab.c" /* yacc.c:1646 */
2490 break;
2491
2492 case 136:
2493 #line 390 "parser.y" /* yacc.c:1646 */
2494 { (yyval.uint) = (yyvsp[0].lng); }
2495 #line 2501 "parser.tab.c" /* yacc.c:1646 */
2496 break;
2497
2498 case 137:
2499 #line 391 "parser.y" /* yacc.c:1646 */
2500 { (yyval.uint) = 0; }
2501 #line 2507 "parser.tab.c" /* yacc.c:1646 */
2502 break;
2503
2504 case 138:
2505 #line 392 "parser.y" /* yacc.c:1646 */
2506 { (yyval.uint) = (yyvsp[0].lng); }
2507 #line 2513 "parser.tab.c" /* yacc.c:1646 */
2508 break;
2509
2510 case 139:
2511 #line 395 "parser.y" /* yacc.c:1646 */
2512 { (yyval.expression) = new_unary_expression(ctx, EXPR_BRACKETS, (yyvsp[-1].expression)); }
2513 #line 2519 "parser.tab.c" /* yacc.c:1646 */
2514 break;
2515
2516 case 140:
2517 #line 396 "parser.y" /* yacc.c:1646 */
2518 { (yyval.expression) = new_expression(ctx, EXPR_ME, 0); CHECK_ERROR; }
2519 #line 2525 "parser.tab.c" /* yacc.c:1646 */
2520 break;
2521
2522 case 141:
2523 #line 399 "parser.y" /* yacc.c:1646 */
2524 { (yyvsp[-3].class_decl)->name = (yyvsp[-5].string); (yyval.class_decl) = (yyvsp[-3].class_decl); }
2525 #line 2531 "parser.tab.c" /* yacc.c:1646 */
2526 break;
2527
2528 case 142:
2529 #line 402 "parser.y" /* yacc.c:1646 */
2530 { (yyval.class_decl) = new_class_decl(ctx); }
2531 #line 2537 "parser.tab.c" /* yacc.c:1646 */
2532 break;
2533
2534 case 143:
2535 #line 403 "parser.y" /* yacc.c:1646 */
2536 { (yyval.class_decl) = add_class_function(ctx, (yyvsp[0].class_decl), (yyvsp[-2].func_decl)); CHECK_ERROR; }
2537 #line 2543 "parser.tab.c" /* yacc.c:1646 */
2538 break;
2539
2540 case 144:
2541 #line 405 "parser.y" /* yacc.c:1646 */
2542 { dim_decl_t *dim_decl = new_dim_decl(ctx, (yyvsp[-2].string), FALSE, NULL); CHECK_ERROR;
2543 (yyval.class_decl) = add_dim_prop(ctx, (yyvsp[0].class_decl), dim_decl, (yyvsp[-3].uint)); CHECK_ERROR; }
2544 #line 2550 "parser.tab.c" /* yacc.c:1646 */
2545 break;
2546
2547 case 145:
2548 #line 407 "parser.y" /* yacc.c:1646 */
2549 { (yyval.class_decl) = add_dim_prop(ctx, (yyvsp[0].class_decl), (yyvsp[-2].dim_decl), 0); CHECK_ERROR; }
2550 #line 2556 "parser.tab.c" /* yacc.c:1646 */
2551 break;
2552
2553 case 146:
2554 #line 408 "parser.y" /* yacc.c:1646 */
2555 { (yyval.class_decl) = add_class_function(ctx, (yyvsp[0].class_decl), (yyvsp[-2].func_decl)); CHECK_ERROR; }
2556 #line 2562 "parser.tab.c" /* yacc.c:1646 */
2557 break;
2558
2559 case 147:
2560 #line 412 "parser.y" /* yacc.c:1646 */
2561 { (yyval.func_decl) = new_function_decl(ctx, (yyvsp[-5].string), FUNC_PROPGET, (yyvsp[-8].uint), (yyvsp[-4].arg_decl), (yyvsp[-2].statement)); CHECK_ERROR; }
2562 #line 2568 "parser.tab.c" /* yacc.c:1646 */
2563 break;
2564
2565 case 148:
2566 #line 414 "parser.y" /* yacc.c:1646 */
2567 { (yyval.func_decl) = new_function_decl(ctx, (yyvsp[-7].string), FUNC_PROPLET, (yyvsp[-10].uint), (yyvsp[-5].arg_decl), (yyvsp[-2].statement)); CHECK_ERROR; }
2568 #line 2574 "parser.tab.c" /* yacc.c:1646 */
2569 break;
2570
2571 case 149:
2572 #line 416 "parser.y" /* yacc.c:1646 */
2573 { (yyval.func_decl) = new_function_decl(ctx, (yyvsp[-7].string), FUNC_PROPSET, (yyvsp[-10].uint), (yyvsp[-5].arg_decl), (yyvsp[-2].statement)); CHECK_ERROR; }
2574 #line 2580 "parser.tab.c" /* yacc.c:1646 */
2575 break;
2576
2577 case 150:
2578 #line 420 "parser.y" /* yacc.c:1646 */
2579 { (yyval.func_decl) = new_function_decl(ctx, (yyvsp[-5].string), FUNC_SUB, (yyvsp[-7].uint), (yyvsp[-4].arg_decl), (yyvsp[-2].statement)); CHECK_ERROR; }
2580 #line 2586 "parser.tab.c" /* yacc.c:1646 */
2581 break;
2582
2583 case 151:
2584 #line 422 "parser.y" /* yacc.c:1646 */
2585 { (yyval.func_decl) = new_function_decl(ctx, (yyvsp[-5].string), FUNC_FUNCTION, (yyvsp[-7].uint), (yyvsp[-4].arg_decl), (yyvsp[-2].statement)); CHECK_ERROR; }
2586 #line 2592 "parser.tab.c" /* yacc.c:1646 */
2587 break;
2588
2589 case 152:
2590 #line 425 "parser.y" /* yacc.c:1646 */
2591 { (yyval.uint) = 0; }
2592 #line 2598 "parser.tab.c" /* yacc.c:1646 */
2593 break;
2594
2595 case 153:
2596 #line 426 "parser.y" /* yacc.c:1646 */
2597 { (yyval.uint) = (yyvsp[0].uint); }
2598 #line 2604 "parser.tab.c" /* yacc.c:1646 */
2599 break;
2600
2601 case 154:
2602 #line 429 "parser.y" /* yacc.c:1646 */
2603 { (yyval.uint) = STORAGE_IS_DEFAULT; }
2604 #line 2610 "parser.tab.c" /* yacc.c:1646 */
2605 break;
2606
2607 case 155:
2608 #line 430 "parser.y" /* yacc.c:1646 */
2609 { (yyval.uint) = 0; }
2610 #line 2616 "parser.tab.c" /* yacc.c:1646 */
2611 break;
2612
2613 case 156:
2614 #line 431 "parser.y" /* yacc.c:1646 */
2615 { (yyval.uint) = STORAGE_IS_PRIVATE; }
2616 #line 2622 "parser.tab.c" /* yacc.c:1646 */
2617 break;
2618
2619 case 157:
2620 #line 434 "parser.y" /* yacc.c:1646 */
2621 { (yyval.arg_decl) = NULL; }
2622 #line 2628 "parser.tab.c" /* yacc.c:1646 */
2623 break;
2624
2625 case 158:
2626 #line 435 "parser.y" /* yacc.c:1646 */
2627 { (yyval.arg_decl) = (yyvsp[-1].arg_decl); }
2628 #line 2634 "parser.tab.c" /* yacc.c:1646 */
2629 break;
2630
2631 case 159:
2632 #line 438 "parser.y" /* yacc.c:1646 */
2633 { (yyval.arg_decl) = (yyvsp[0].arg_decl); }
2634 #line 2640 "parser.tab.c" /* yacc.c:1646 */
2635 break;
2636
2637 case 160:
2638 #line 439 "parser.y" /* yacc.c:1646 */
2639 { (yyvsp[-2].arg_decl)->next = (yyvsp[0].arg_decl); (yyval.arg_decl) = (yyvsp[-2].arg_decl); }
2640 #line 2646 "parser.tab.c" /* yacc.c:1646 */
2641 break;
2642
2643 case 161:
2644 #line 442 "parser.y" /* yacc.c:1646 */
2645 { (yyval.arg_decl) = new_argument_decl(ctx, (yyvsp[-1].string), TRUE); }
2646 #line 2652 "parser.tab.c" /* yacc.c:1646 */
2647 break;
2648
2649 case 162:
2650 #line 443 "parser.y" /* yacc.c:1646 */
2651 { (yyval.arg_decl) = new_argument_decl(ctx, (yyvsp[-1].string), TRUE); }
2652 #line 2658 "parser.tab.c" /* yacc.c:1646 */
2653 break;
2654
2655 case 163:
2656 #line 444 "parser.y" /* yacc.c:1646 */
2657 { (yyval.arg_decl) = new_argument_decl(ctx, (yyvsp[-1].string), FALSE); }
2658 #line 2664 "parser.tab.c" /* yacc.c:1646 */
2659 break;
2660
2661 case 164:
2662 #line 448 "parser.y" /* yacc.c:1646 */
2663 { (yyval.string) = (yyvsp[0].string); }
2664 #line 2670 "parser.tab.c" /* yacc.c:1646 */
2665 break;
2666
2667 case 165:
2668 #line 449 "parser.y" /* yacc.c:1646 */
2669 { (yyval.string) = propertyW; }
2670 #line 2676 "parser.tab.c" /* yacc.c:1646 */
2671 break;
2672
2673
2674 #line 2680 "parser.tab.c" /* yacc.c:1646 */
2675 default: break;
2676 }
2677 /* User semantic actions sometimes alter yychar, and that requires
2678 that yytoken be updated with the new translation. We take the
2679 approach of translating immediately before every use of yytoken.
2680 One alternative is translating here after every semantic action,
2681 but that translation would be missed if the semantic action invokes
2682 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
2683 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
2684 incorrect destructor might then be invoked immediately. In the
2685 case of YYERROR or YYBACKUP, subsequent parser actions might lead
2686 to an incorrect destructor call or verbose syntax error message
2687 before the lookahead is translated. */
2688 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
2689
2690 YYPOPSTACK (yylen);
2691 yylen = 0;
2692 YY_STACK_PRINT (yyss, yyssp);
2693
2694 *++yyvsp = yyval;
2695
2696 /* Now 'shift' the result of the reduction. Determine what state
2697 that goes to, based on the state we popped back to and the rule
2698 number reduced by. */
2699
2700 yyn = yyr1[yyn];
2701
2702 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
2703 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
2704 yystate = yytable[yystate];
2705 else
2706 yystate = yydefgoto[yyn - YYNTOKENS];
2707
2708 goto yynewstate;
2709
2710
2711 /*--------------------------------------.
2712 | yyerrlab -- here on detecting error. |
2713 `--------------------------------------*/
2714 yyerrlab:
2715 /* Make sure we have latest lookahead translation. See comments at
2716 user semantic actions for why this is necessary. */
2717 yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
2718
2719 /* If not already recovering from an error, report this error. */
2720 if (!yyerrstatus)
2721 {
2722 ++yynerrs;
2723 #if ! YYERROR_VERBOSE
2724 yyerror (ctx, YY_("syntax error"));
2725 #else
2726 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
2727 yyssp, yytoken)
2728 {
2729 char const *yymsgp = YY_("syntax error");
2730 int yysyntax_error_status;
2731 yysyntax_error_status = YYSYNTAX_ERROR;
2732 if (yysyntax_error_status == 0)
2733 yymsgp = yymsg;
2734 else if (yysyntax_error_status == 1)
2735 {
2736 if (yymsg != yymsgbuf)
2737 YYSTACK_FREE (yymsg);
2738 yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
2739 if (!yymsg)
2740 {
2741 yymsg = yymsgbuf;
2742 yymsg_alloc = sizeof yymsgbuf;
2743 yysyntax_error_status = 2;
2744 }
2745 else
2746 {
2747 yysyntax_error_status = YYSYNTAX_ERROR;
2748 yymsgp = yymsg;
2749 }
2750 }
2751 yyerror (ctx, yymsgp);
2752 if (yysyntax_error_status == 2)
2753 goto yyexhaustedlab;
2754 }
2755 # undef YYSYNTAX_ERROR
2756 #endif
2757 }
2758
2759
2760
2761 if (yyerrstatus == 3)
2762 {
2763 /* If just tried and failed to reuse lookahead token after an
2764 error, discard it. */
2765
2766 if (yychar <= YYEOF)
2767 {
2768 /* Return failure if at end of input. */
2769 if (yychar == YYEOF)
2770 YYABORT;
2771 }
2772 else
2773 {
2774 yydestruct ("Error: discarding",
2775 yytoken, &yylval, ctx);
2776 yychar = YYEMPTY;
2777 }
2778 }
2779
2780 /* Else will try to reuse lookahead token after shifting the error
2781 token. */
2782 goto yyerrlab1;
2783
2784
2785 /*---------------------------------------------------.
2786 | yyerrorlab -- error raised explicitly by YYERROR. |
2787 `---------------------------------------------------*/
2788 yyerrorlab:
2789
2790 /* Pacify compilers like GCC when the user code never invokes
2791 YYERROR and the label yyerrorlab therefore never appears in user
2792 code. */
2793 if (/*CONSTCOND*/ 0)
2794 goto yyerrorlab;
2795
2796 /* Do not reclaim the symbols of the rule whose action triggered
2797 this YYERROR. */
2798 YYPOPSTACK (yylen);
2799 yylen = 0;
2800 YY_STACK_PRINT (yyss, yyssp);
2801 yystate = *yyssp;
2802 goto yyerrlab1;
2803
2804
2805 /*-------------------------------------------------------------.
2806 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2807 `-------------------------------------------------------------*/
2808 yyerrlab1:
2809 yyerrstatus = 3; /* Each real token shifted decrements this. */
2810
2811 for (;;)
2812 {
2813 yyn = yypact[yystate];
2814 if (!yypact_value_is_default (yyn))
2815 {
2816 yyn += YYTERROR;
2817 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
2818 {
2819 yyn = yytable[yyn];
2820 if (0 < yyn)
2821 break;
2822 }
2823 }
2824
2825 /* Pop the current state because it cannot handle the error token. */
2826 if (yyssp == yyss)
2827 YYABORT;
2828
2829
2830 yydestruct ("Error: popping",
2831 yystos[yystate], yyvsp, ctx);
2832 YYPOPSTACK (1);
2833 yystate = *yyssp;
2834 YY_STACK_PRINT (yyss, yyssp);
2835 }
2836
2837 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
2838 *++yyvsp = yylval;
2839 YY_IGNORE_MAYBE_UNINITIALIZED_END
2840
2841
2842 /* Shift the error token. */
2843 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
2844
2845 yystate = yyn;
2846 goto yynewstate;
2847
2848
2849 /*-------------------------------------.
2850 | yyacceptlab -- YYACCEPT comes here. |
2851 `-------------------------------------*/
2852 yyacceptlab:
2853 yyresult = 0;
2854 goto yyreturn;
2855
2856 /*-----------------------------------.
2857 | yyabortlab -- YYABORT comes here. |
2858 `-----------------------------------*/
2859 yyabortlab:
2860 yyresult = 1;
2861 goto yyreturn;
2862
2863 #if !defined yyoverflow || YYERROR_VERBOSE
2864 /*-------------------------------------------------.
2865 | yyexhaustedlab -- memory exhaustion comes here. |
2866 `-------------------------------------------------*/
2867 yyexhaustedlab:
2868 yyerror (ctx, YY_("memory exhausted"));
2869 yyresult = 2;
2870 /* Fall through. */
2871 #endif
2872
2873 yyreturn:
2874 if (yychar != YYEMPTY)
2875 {
2876 /* Make sure we have latest lookahead translation. See comments at
2877 user semantic actions for why this is necessary. */
2878 yytoken = YYTRANSLATE (yychar);
2879 yydestruct ("Cleanup: discarding lookahead",
2880 yytoken, &yylval, ctx);
2881 }
2882 /* Do not reclaim the symbols of the rule whose action triggered
2883 this YYABORT or YYACCEPT. */
2884 YYPOPSTACK (yylen);
2885 YY_STACK_PRINT (yyss, yyssp);
2886 while (yyssp != yyss)
2887 {
2888 yydestruct ("Cleanup: popping",
2889 yystos[*yyssp], yyvsp, ctx);
2890 YYPOPSTACK (1);
2891 }
2892 #ifndef yyoverflow
2893 if (yyss != yyssa)
2894 YYSTACK_FREE (yyss);
2895 #endif
2896 #if YYERROR_VERBOSE
2897 if (yymsg != yymsgbuf)
2898 YYSTACK_FREE (yymsg);
2899 #endif
2900 return yyresult;
2901 }
2902 #line 456 "parser.y" /* yacc.c:1906 */
2903
2904
2905 static int parser_error(parser_ctx_t *ctx, const char *str)
2906 {
2907 return 0;
2908 }
2909
2910 static void source_add_statement(parser_ctx_t *ctx, statement_t *stat)
2911 {
2912 if(!stat)
2913 return;
2914
2915 if(ctx->stats) {
2916 ctx->stats_tail->next = stat;
2917 ctx->stats_tail = stat;
2918 }else {
2919 ctx->stats = ctx->stats_tail = stat;
2920 }
2921 }
2922
2923 static void source_add_class(parser_ctx_t *ctx, class_decl_t *class_decl)
2924 {
2925 class_decl->next = ctx->class_decls;
2926 ctx->class_decls = class_decl;
2927 }
2928
2929 static void parse_complete(parser_ctx_t *ctx, BOOL option_explicit)
2930 {
2931 ctx->parse_complete = TRUE;
2932 ctx->option_explicit = option_explicit;
2933 }
2934
2935 static void *new_expression(parser_ctx_t *ctx, expression_type_t type, size_t size)
2936 {
2937 expression_t *expr;
2938
2939 expr = parser_alloc(ctx, size ? size : sizeof(*expr));
2940 if(expr) {
2941 expr->type = type;
2942 expr->next = NULL;
2943 }
2944
2945 return expr;
2946 }
2947
2948 static expression_t *new_bool_expression(parser_ctx_t *ctx, VARIANT_BOOL value)
2949 {
2950 bool_expression_t *expr;
2951
2952 expr = new_expression(ctx, EXPR_BOOL, sizeof(*expr));
2953 if(!expr)
2954 return NULL;
2955
2956 expr->value = value;
2957 return &expr->expr;
2958 }
2959
2960 static expression_t *new_string_expression(parser_ctx_t *ctx, const WCHAR *value)
2961 {
2962 string_expression_t *expr;
2963
2964 expr = new_expression(ctx, EXPR_STRING, sizeof(*expr));
2965 if(!expr)
2966 return NULL;
2967
2968 expr->value = value;
2969 return &expr->expr;
2970 }
2971
2972 static expression_t *new_long_expression(parser_ctx_t *ctx, expression_type_t type, LONG value)
2973 {
2974 int_expression_t *expr;
2975
2976 expr = new_expression(ctx, type, sizeof(*expr));
2977 if(!expr)
2978 return NULL;
2979
2980 expr->value = value;
2981 return &expr->expr;
2982 }
2983
2984 static expression_t *new_double_expression(parser_ctx_t *ctx, double value)
2985 {
2986 double_expression_t *expr;
2987
2988 expr = new_expression(ctx, EXPR_DOUBLE, sizeof(*expr));
2989 if(!expr)
2990 return NULL;
2991
2992 expr->value = value;
2993 return &expr->expr;
2994 }
2995
2996 static expression_t *new_unary_expression(parser_ctx_t *ctx, expression_type_t type, expression_t *subexpr)
2997 {
2998 unary_expression_t *expr;
2999
3000 expr = new_expression(ctx, type, sizeof(*expr));
3001 if(!expr)
3002 return NULL;
3003
3004 expr->subexpr = subexpr;
3005 return &expr->expr;
3006 }
3007
3008 static expression_t *new_binary_expression(parser_ctx_t *ctx, expression_type_t type, expression_t *left, expression_t *right)
3009 {
3010 binary_expression_t *expr;
3011
3012 expr = new_expression(ctx, type, sizeof(*expr));
3013 if(!expr)
3014 return NULL;
3015
3016 expr->left = left;
3017 expr->right = right;
3018 return &expr->expr;
3019 }
3020
3021 static member_expression_t *new_member_expression(parser_ctx_t *ctx, expression_t *obj_expr, const WCHAR *identifier)
3022 {
3023 member_expression_t *expr;
3024
3025 expr = new_expression(ctx, EXPR_MEMBER, sizeof(*expr));
3026 if(!expr)
3027 return NULL;
3028
3029 expr->obj_expr = obj_expr;
3030 expr->identifier = identifier;
3031 expr->args = NULL;
3032 return expr;
3033 }
3034
3035 static expression_t *new_new_expression(parser_ctx_t *ctx, const WCHAR *identifier)
3036 {
3037 string_expression_t *expr;
3038
3039 expr = new_expression(ctx, EXPR_NEW, sizeof(*expr));
3040 if(!expr)
3041 return NULL;
3042
3043 expr->value = identifier;
3044 return &expr->expr;
3045 }
3046
3047 static void *new_statement(parser_ctx_t *ctx, statement_type_t type, size_t size)
3048 {
3049 statement_t *stat;
3050
3051 stat = parser_alloc(ctx, size ? size : sizeof(*stat));
3052 if(stat) {
3053 stat->type = type;
3054 stat->next = NULL;
3055 }
3056
3057 return stat;
3058 }
3059
3060 static statement_t *new_call_statement(parser_ctx_t *ctx, BOOL is_strict, member_expression_t *expr)
3061 {
3062 call_statement_t *stat;
3063
3064 stat = new_statement(ctx, STAT_CALL, sizeof(*stat));
3065 if(!stat)
3066 return NULL;
3067
3068 stat->expr = expr;
3069 stat->is_strict = is_strict;
3070 return &stat->stat;
3071 }
3072
3073 static statement_t *new_assign_statement(parser_ctx_t *ctx, member_expression_t *left, expression_t *right)
3074 {
3075 assign_statement_t *stat;
3076
3077 stat = new_statement(ctx, STAT_ASSIGN, sizeof(*stat));
3078 if(!stat)
3079 return NULL;
3080
3081 stat->member_expr = left;
3082 stat->value_expr = right;
3083 return &stat->stat;
3084 }
3085
3086 static statement_t *new_set_statement(parser_ctx_t *ctx, member_expression_t *left, expression_t *right)
3087 {
3088 assign_statement_t *stat;
3089
3090 stat = new_statement(ctx, STAT_SET, sizeof(*stat));
3091 if(!stat)
3092 return NULL;
3093
3094 stat->member_expr = left;
3095 stat->value_expr = right;
3096 return &stat->stat;
3097 }
3098
3099 static dim_decl_t *new_dim_decl(parser_ctx_t *ctx, const WCHAR *name, BOOL is_array, dim_list_t *dims)
3100 {
3101 dim_decl_t *decl;
3102
3103 decl = parser_alloc(ctx, sizeof(*decl));
3104 if(!decl)
3105 return NULL;
3106
3107 decl->name = name;
3108 decl->is_array = is_array;
3109 decl->dims = dims;
3110 decl->next = NULL;
3111 return decl;
3112 }
3113
3114 static dim_list_t *new_dim(parser_ctx_t *ctx, unsigned val, dim_list_t *next)
3115 {
3116 dim_list_t *ret;
3117
3118 ret = parser_alloc(ctx, sizeof(*ret));
3119 if(!ret)
3120 return NULL;
3121
3122 ret->val = val;
3123 ret->next = next;
3124 return ret;
3125 }
3126
3127 static statement_t *new_dim_statement(parser_ctx_t *ctx, dim_decl_t *decls)
3128 {
3129 dim_statement_t *stat;
3130
3131 stat = new_statement(ctx, STAT_DIM, sizeof(*stat));
3132 if(!stat)
3133 return NULL;
3134
3135 stat->dim_decls = decls;
3136 return &stat->stat;
3137 }
3138
3139 static elseif_decl_t *new_elseif_decl(parser_ctx_t *ctx, expression_t *expr, statement_t *stat)
3140 {
3141 elseif_decl_t *decl;
3142
3143 decl = parser_alloc(ctx, sizeof(*decl));
3144 if(!decl)
3145 return NULL;
3146
3147 decl->expr = expr;
3148 decl->stat = stat;
3149 decl->next = NULL;
3150 return decl;
3151 }
3152
3153 static statement_t *new_while_statement(parser_ctx_t *ctx, statement_type_t type, expression_t *expr, statement_t *body)
3154 {
3155 while_statement_t *stat;
3156
3157 stat = new_statement(ctx, type, sizeof(*stat));
3158 if(!stat)
3159 return NULL;
3160
3161 stat->expr = expr;
3162 stat->body = body;
3163 return &stat->stat;
3164 }
3165
3166 static statement_t *new_forto_statement(parser_ctx_t *ctx, const WCHAR *identifier, expression_t *from_expr,
3167 expression_t *to_expr, expression_t *step_expr, statement_t *body)
3168 {
3169 forto_statement_t *stat;
3170
3171 stat = new_statement(ctx, STAT_FORTO, sizeof(*stat));
3172 if(!stat)
3173 return NULL;
3174
3175 stat->identifier = identifier;
3176 stat->from_expr = from_expr;
3177 stat->to_expr = to_expr;
3178 stat->step_expr = step_expr;
3179 stat->body = body;
3180 return &stat->stat;
3181 }
3182
3183 static statement_t *new_foreach_statement(parser_ctx_t *ctx, const WCHAR *identifier, expression_t *group_expr,
3184 statement_t *body)
3185 {
3186 foreach_statement_t *stat;
3187
3188 stat = new_statement(ctx, STAT_FOREACH, sizeof(*stat));
3189 if(!stat)
3190 return NULL;
3191
3192 stat->identifier = identifier;
3193 stat->group_expr = group_expr;
3194 stat->body = body;
3195 return &stat->stat;
3196 }
3197
3198 static statement_t *new_if_statement(parser_ctx_t *ctx, expression_t *expr, statement_t *if_stat, elseif_decl_t *elseif_decl,
3199 statement_t *else_stat)
3200 {
3201 if_statement_t *stat;
3202
3203 stat = new_statement(ctx, STAT_IF, sizeof(*stat));
3204 if(!stat)
3205 return NULL;
3206
3207 stat->expr = expr;
3208 stat->if_stat = if_stat;
3209 stat->elseifs = elseif_decl;
3210 stat->else_stat = else_stat;
3211 return &stat->stat;
3212 }
3213
3214 static statement_t *new_select_statement(parser_ctx_t *ctx, expression_t *expr, case_clausule_t *case_clausules)
3215 {
3216 select_statement_t *stat;
3217
3218 stat = new_statement(ctx, STAT_SELECT, sizeof(*stat));
3219 if(!stat)
3220 return NULL;
3221
3222 stat->expr = expr;
3223 stat->case_clausules = case_clausules;
3224 return &stat->stat;
3225 }
3226
3227 static case_clausule_t *new_case_clausule(parser_ctx_t *ctx, expression_t *expr, statement_t *stat, case_clausule_t *next)
3228 {
3229 case_clausule_t *ret;
3230
3231 ret = parser_alloc(ctx, sizeof(*ret));
3232 if(!ret)
3233 return NULL;
3234
3235 ret->expr = expr;
3236 ret->stat = stat;
3237 ret->next = next;
3238 return ret;
3239 }
3240
3241 static statement_t *new_onerror_statement(parser_ctx_t *ctx, BOOL resume_next)
3242 {
3243 onerror_statement_t *stat;
3244
3245 stat = new_statement(ctx, STAT_ONERROR, sizeof(*stat));
3246 if(!stat)
3247 return NULL;
3248
3249 stat->resume_next = resume_next;
3250 return &stat->stat;
3251 }
3252
3253 static arg_decl_t *new_argument_decl(parser_ctx_t *ctx, const WCHAR *name, BOOL by_ref)
3254 {
3255 arg_decl_t *arg_decl;
3256
3257 arg_decl = parser_alloc(ctx, sizeof(*arg_decl));
3258 if(!arg_decl)
3259 return NULL;
3260
3261 arg_decl->name = name;
3262 arg_decl->by_ref = by_ref;
3263 arg_decl->next = NULL;
3264 return arg_decl;
3265 }
3266
3267 static function_decl_t *new_function_decl(parser_ctx_t *ctx, const WCHAR *name, function_type_t type,
3268 unsigned storage_flags, arg_decl_t *arg_decl, statement_t *body)
3269 {
3270 function_decl_t *decl;
3271
3272 if(storage_flags & STORAGE_IS_DEFAULT) {
3273 if(type == FUNC_PROPGET) {
3274 type = FUNC_DEFGET;
3275 }else {
3276 FIXME("Invalid default property\n");
3277 ctx->hres = E_FAIL;
3278 return NULL;
3279 }
3280 }
3281
3282 decl = parser_alloc(ctx, sizeof(*decl));
3283 if(!decl)
3284 return NULL;
3285
3286 decl->name = name;
3287 decl->type = type;
3288 decl->is_public = !(storage_flags & STORAGE_IS_PRIVATE);
3289 decl->args = arg_decl;
3290 decl->body = body;
3291 decl->next = NULL;
3292 decl->next_prop_func = NULL;
3293 return decl;
3294 }
3295
3296 static statement_t *new_function_statement(parser_ctx_t *ctx, function_decl_t *decl)
3297 {
3298 function_statement_t *stat;
3299
3300 stat = new_statement(ctx, STAT_FUNC, sizeof(*stat));
3301 if(!stat)
3302 return NULL;
3303
3304 stat->func_decl = decl;
3305 return &stat->stat;
3306 }
3307
3308 static class_decl_t *new_class_decl(parser_ctx_t *ctx)
3309 {
3310 class_decl_t *class_decl;
3311
3312 class_decl = parser_alloc(ctx, sizeof(*class_decl));
3313 if(!class_decl)
3314 return NULL;
3315
3316 class_decl->funcs = NULL;
3317 class_decl->props = NULL;
3318 class_decl->next = NULL;
3319 return class_decl;
3320 }
3321
3322 static class_decl_t *add_class_function(parser_ctx_t *ctx, class_decl_t *class_decl, function_decl_t *decl)
3323 {
3324 function_decl_t *iter;
3325
3326 for(iter = class_decl->funcs; iter; iter = iter->next) {
3327 if(!strcmpiW(iter->name, decl->name)) {
3328 if(decl->type == FUNC_SUB || decl->type == FUNC_FUNCTION) {
3329 FIXME("Redefinition of %s::%s\n", debugstr_w(class_decl->name), debugstr_w(decl->name));
3330 ctx->hres = E_FAIL;
3331 return NULL;
3332 }
3333
3334 while(1) {
3335 if(iter->type == decl->type) {
3336 FIXME("Redefinition of %s::%s\n", debugstr_w(class_decl->name), debugstr_w(decl->name));
3337 ctx->hres = E_FAIL;
3338 return NULL;
3339 }
3340 if(!iter->next_prop_func)
3341 break;
3342 iter = iter->next_prop_func;
3343 }
3344
3345 iter->next_prop_func = decl;
3346 return class_decl;
3347 }
3348 }
3349
3350 decl->next = class_decl->funcs;
3351 class_decl->funcs = decl;
3352 return class_decl;
3353 }
3354
3355 static class_decl_t *add_dim_prop(parser_ctx_t *ctx, class_decl_t *class_decl, dim_decl_t *dim_decl, unsigned storage_flags)
3356 {
3357 if(storage_flags & STORAGE_IS_DEFAULT) {
3358 FIXME("variant prop van't be default value\n");
3359 ctx->hres = E_FAIL;
3360 return NULL;
3361 }
3362
3363 dim_decl->is_public = !(storage_flags & STORAGE_IS_PRIVATE);
3364 dim_decl->next = class_decl->props;
3365 class_decl->props = dim_decl;
3366 return class_decl;
3367 }
3368
3369 static const_decl_t *new_const_decl(parser_ctx_t *ctx, const WCHAR *name, expression_t *expr)
3370 {
3371 const_decl_t *decl;
3372
3373 decl = parser_alloc(ctx, sizeof(*decl));
3374 if(!decl)
3375 return NULL;
3376
3377 decl->name = name;
3378 decl->value_expr = expr;
3379 decl->next = NULL;
3380 return decl;
3381 }
3382
3383 static statement_t *new_const_statement(parser_ctx_t *ctx, const_decl_t *decls)
3384 {
3385 const_statement_t *stat;
3386
3387 stat = new_statement(ctx, STAT_CONST, sizeof(*stat));
3388 if(!stat)
3389 return NULL;
3390
3391 stat->decls = decls;
3392 return &stat->stat;
3393 }
3394
3395 static statement_t *link_statements(statement_t *head, statement_t *tail)
3396 {
3397 statement_t *iter;
3398
3399 for(iter = head; iter->next; iter = iter->next);
3400 iter->next = tail;
3401
3402 return head;
3403 }
3404
3405 void *parser_alloc(parser_ctx_t *ctx, size_t size)
3406 {
3407 void *ret;
3408
3409 ret = heap_pool_alloc(&ctx->heap, size);
3410 if(!ret)
3411 ctx->hres = E_OUTOFMEMORY;
3412 return ret;
3413 }
3414
3415 HRESULT parse_script(parser_ctx_t *ctx, const WCHAR *code, const WCHAR *delimiter)
3416 {
3417 const WCHAR html_delimiterW[] = {'<','/','s','c','r','i','p','t','>',0};
3418
3419 ctx->code = ctx->ptr = code;
3420 ctx->end = ctx->code + strlenW(ctx->code);
3421
3422 heap_pool_init(&ctx->heap);
3423
3424 ctx->parse_complete = FALSE;
3425 ctx->hres = S_OK;
3426
3427 ctx->last_token = tNL;
3428 ctx->last_nl = 0;
3429 ctx->stats = ctx->stats_tail = NULL;
3430 ctx->class_decls = NULL;
3431 ctx->option_explicit = FALSE;
3432 ctx->is_html = delimiter && !strcmpiW(delimiter, html_delimiterW);
3433
3434 parser_parse(ctx);
3435
3436 if(FAILED(ctx->hres))
3437 return ctx->hres;
3438 if(!ctx->parse_complete) {
3439 FIXME("parser failed around %s\n", debugstr_w(ctx->code+20 > ctx->ptr ? ctx->code : ctx->ptr-20));
3440 return E_FAIL;
3441 }
3442
3443 return S_OK;
3444 }
3445
3446 void parser_release(parser_ctx_t *ctx)
3447 {
3448 heap_pool_free(&ctx->heap);
3449 }