show PC of labels
[xorcyst.git] / parser.c
blobf83b37f57c6e2f53463c4a35905b72c437ada7c8
1 /* A Bison parser, made by GNU Bison 1.875. */
3 /* Skeleton parser for Yacc-like parsing with Bison,
4 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation, Inc.
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
9 any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. */
21 /* As a special exception, when this file is copied by Bison into a
22 Bison output file, you may use that output file without restriction.
23 This special exception was added by the Free Software Foundation
24 in version 1.24 of Bison. */
26 /* Written by Richard Stallman by simplifying the original so called
27 ``semantic'' parser. */
29 /* All symbols defined below should begin with yy or YY, to avoid
30 infringing on user name space. This should be done even for local
31 variables, as they might otherwise be expanded by user macros.
32 There are some unavoidable exceptions within include files to
33 define necessary library symbols; they are noted "INFRINGES ON
34 USER NAME SPACE" below. */
36 /* Identify Bison output. */
37 #define YYBISON 1
39 /* Skeleton name. */
40 #define YYSKELETON_NAME "yacc.c"
42 /* Pure parsers. */
43 #define YYPURE 0
45 /* Using locations. */
46 #define YYLSP_NEEDED 1
50 /* Tokens. */
51 #ifndef YYTOKENTYPE
52 # define YYTOKENTYPE
53 /* Put the tokens into the symbol table, so that GDB and other debuggers
54 know about them. */
55 enum yytokentype {
56 INTEGER_LITERAL = 258,
57 STRING_LITERAL = 259,
58 FILE_PATH = 260,
59 IDENTIFIER = 261,
60 LOCAL_ID = 262,
61 FORWARD_BRANCH = 263,
62 BACKWARD_BRANCH = 264,
63 LABEL = 265,
64 LOCAL_LABEL = 266,
65 MNEMONIC = 267,
66 _LABEL_ = 268,
67 BYTE = 269,
68 CHAR = 270,
69 WORD = 271,
70 DWORD = 272,
71 DSB = 273,
72 DSW = 274,
73 DSD = 275,
74 DATASEG = 276,
75 CODESEG = 277,
76 IF = 278,
77 IFDEF = 279,
78 IFNDEF = 280,
79 ELSE = 281,
80 ELIF = 282,
81 ENDIF = 283,
82 INCSRC = 284,
83 INCBIN = 285,
84 MACRO = 286,
85 REPT = 287,
86 WHILE = 288,
87 ENDM = 289,
88 ALIGN = 290,
89 EQU = 291,
90 DEFINE = 292,
91 END = 293,
92 PUBLIC = 294,
93 EXTRN = 295,
94 CHARMAP = 296,
95 STRUC = 297,
96 UNION = 298,
97 ENDS = 299,
98 RECORD = 300,
99 ENUM = 301,
100 ENDE = 302,
101 PROC = 303,
102 ENDP = 304,
103 SIZEOF = 305,
104 MASK = 306,
105 TAG = 307,
106 MESSAGE = 308,
107 WARNING = 309,
108 ERROR = 310,
109 ZEROPAGE = 311,
110 ORG = 312,
111 SCOPE_OP = 313,
112 HI_OP = 314,
113 LO_OP = 315,
114 NE_OP = 316,
115 EQ_OP = 317,
116 GE_OP = 318,
117 LE_OP = 319,
118 SHR_OP = 320,
119 SHL_OP = 321,
120 UMINUS = 322
122 #endif
123 #define INTEGER_LITERAL 258
124 #define STRING_LITERAL 259
125 #define FILE_PATH 260
126 #define IDENTIFIER 261
127 #define LOCAL_ID 262
128 #define FORWARD_BRANCH 263
129 #define BACKWARD_BRANCH 264
130 #define LABEL 265
131 #define LOCAL_LABEL 266
132 #define MNEMONIC 267
133 #define _LABEL_ 268
134 #define BYTE 269
135 #define CHAR 270
136 #define WORD 271
137 #define DWORD 272
138 #define DSB 273
139 #define DSW 274
140 #define DSD 275
141 #define DATASEG 276
142 #define CODESEG 277
143 #define IF 278
144 #define IFDEF 279
145 #define IFNDEF 280
146 #define ELSE 281
147 #define ELIF 282
148 #define ENDIF 283
149 #define INCSRC 284
150 #define INCBIN 285
151 #define MACRO 286
152 #define REPT 287
153 #define WHILE 288
154 #define ENDM 289
155 #define ALIGN 290
156 #define EQU 291
157 #define DEFINE 292
158 #define END 293
159 #define PUBLIC 294
160 #define EXTRN 295
161 #define CHARMAP 296
162 #define STRUC 297
163 #define UNION 298
164 #define ENDS 299
165 #define RECORD 300
166 #define ENUM 301
167 #define ENDE 302
168 #define PROC 303
169 #define ENDP 304
170 #define SIZEOF 305
171 #define MASK 306
172 #define TAG 307
173 #define MESSAGE 308
174 #define WARNING 309
175 #define ERROR 310
176 #define ZEROPAGE 311
177 #define ORG 312
178 #define SCOPE_OP 313
179 #define HI_OP 314
180 #define LO_OP 315
181 #define NE_OP 316
182 #define EQ_OP 317
183 #define GE_OP 318
184 #define LE_OP 319
185 #define SHR_OP 320
186 #define SHL_OP 321
187 #define UMINUS 322
192 /* Copy the first part of user declarations. */
193 #line 1 "parser.y"
196 * $Id: parser.y,v 1.14 2007/11/11 22:35:51 khansen Exp $
197 * $Log: parser.y,v $
198 * Revision 1.14 2007/11/11 22:35:51 khansen
199 * compile on mac
201 * Revision 1.13 2007/08/19 11:19:47 khansen
202 * --case-insensitive option
204 * Revision 1.12 2007/08/12 18:59:00 khansen
205 * ability to generate pure 6502 binary
207 * Revision 1.11 2007/08/11 01:25:50 khansen
208 * includepaths support (-I option)
210 * Revision 1.10 2007/07/22 13:34:38 khansen
211 * convert tabs to whitespaces
213 * Revision 1.9 2005/01/05 02:28:40 kenth
214 * anonymous union parsing
216 * Revision 1.8 2004/12/29 21:45:26 kenth
217 * xorcyst 1.4.2
218 * static indexing
220 * Revision 1.7 2004/12/19 19:59:14 kenth
221 * xorcyst 1.4.0
223 * Revision 1.6 2004/12/16 13:22:27 kenth
224 * xorcyst 1.3.5
226 * Revision 1.5 2004/12/14 01:50:42 kenth
227 * xorcyst 1.3.0
229 * Revision 1.4 2004/12/11 02:12:41 kenth
230 * xorcyst 1.2.0
232 * Revision 1.3 2004/12/09 11:17:15 kenth
233 * added: warning_statement, error_statement
235 * Revision 1.2 2004/12/06 05:06:21 kenth
236 * xorcyst 1.1.0
238 * Revision 1.1 2004/06/30 07:57:03 kenth
239 * Initial revision
242 #include <stdlib.h>
243 #include <stdio.h>
244 #include <string.h>
245 #include "symtab.h"
246 #include "loc.h"
247 #include "xasm.h"
248 //#define YYDEBUG 1
249 int yyparse(void);
250 void yyerror(const char *); /* In lexer */
251 int yylex(void); /* In lexer */
252 int yypushandrestart(const char *, int); /* In lexer */
253 void __yy_memcpy(char *, char *, int);
254 extern char *yytext; /* In lexer */
255 extern YYLTYPE yylloc; /* In lexer */
256 char *scan_include(int); /* In lexer */
257 extern astnode *root_node; /* Root of the generated parse tree */
258 void handle_incsrc(astnode *); /* See below */
259 void handle_incbin(astnode *); /* See below */
262 /* Enabling traces. */
263 #ifndef YYDEBUG
264 # define YYDEBUG 0
265 #endif
267 /* Enabling verbose error messages. */
268 #ifdef YYERROR_VERBOSE
269 # undef YYERROR_VERBOSE
270 # define YYERROR_VERBOSE 1
271 #else
272 # define YYERROR_VERBOSE 1
273 #endif
275 #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
276 #line 69 "parser.y"
277 typedef union YYSTYPE {
278 long integer;
279 int mnemonic;
280 const char *string;
281 const char *label;
282 const char *ident;
283 astnode *node;
284 } YYSTYPE;
285 /* Line 191 of yacc.c. */
286 #line 286 "parser.c"
287 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
288 # define YYSTYPE_IS_DECLARED 1
289 # define YYSTYPE_IS_TRIVIAL 1
290 #endif
292 #if ! defined (YYLTYPE) && ! defined (YYLTYPE_IS_DECLARED)
293 typedef struct YYLTYPE
295 int first_line;
296 int first_column;
297 int last_line;
298 int last_column;
299 } YYLTYPE;
300 # define yyltype YYLTYPE /* obsolescent; will be withdrawn */
301 # define YYLTYPE_IS_DECLARED 1
302 # define YYLTYPE_IS_TRIVIAL 1
303 #endif
306 /* Copy the second part of user declarations. */
309 /* Line 214 of yacc.c. */
310 #line 310 "parser.c"
312 #if ! defined (yyoverflow) || YYERROR_VERBOSE
314 /* The parser invokes alloca or malloc; define the necessary symbols. */
316 # if YYSTACK_USE_ALLOCA
317 # define YYSTACK_ALLOC alloca
318 # else
319 # ifndef YYSTACK_USE_ALLOCA
320 # if defined (alloca) || defined (_ALLOCA_H)
321 # define YYSTACK_ALLOC alloca
322 # else
323 # ifdef __GNUC__
324 # define YYSTACK_ALLOC __builtin_alloca
325 # endif
326 # endif
327 # endif
328 # endif
330 # ifdef YYSTACK_ALLOC
331 /* Pacify GCC's `empty if-body' warning. */
332 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
333 # else
334 # if defined (__STDC__) || defined (__cplusplus)
335 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
336 # define YYSIZE_T size_t
337 # endif
338 # define YYSTACK_ALLOC malloc
339 # define YYSTACK_FREE free
340 # endif
341 #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
344 #if (! defined (yyoverflow) \
345 && (! defined (__cplusplus) \
346 || (YYLTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
348 /* A type that is properly aligned for any stack member. */
349 union yyalloc
351 short yyss;
352 YYSTYPE yyvs;
353 YYLTYPE yyls;
356 /* The size of the maximum gap between one aligned stack and the next. */
357 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
359 /* The size of an array large to enough to hold all stacks, each with
360 N elements. */
361 # define YYSTACK_BYTES(N) \
362 ((N) * (sizeof (short) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
363 + 2 * YYSTACK_GAP_MAXIMUM)
365 /* Copy COUNT objects from FROM to TO. The source and destination do
366 not overlap. */
367 # ifndef YYCOPY
368 # if 1 < __GNUC__
369 # define YYCOPY(To, From, Count) \
370 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
371 # else
372 # define YYCOPY(To, From, Count) \
373 do \
375 register YYSIZE_T yyi; \
376 for (yyi = 0; yyi < (Count); yyi++) \
377 (To)[yyi] = (From)[yyi]; \
379 while (0)
380 # endif
381 # endif
383 /* Relocate STACK from its old location to the new one. The
384 local variables YYSIZE and YYSTACKSIZE give the old and new number of
385 elements in the stack, and YYPTR gives the new location of the
386 stack. Advance YYPTR to a properly aligned location for the next
387 stack. */
388 # define YYSTACK_RELOCATE(Stack) \
389 do \
391 YYSIZE_T yynewbytes; \
392 YYCOPY (&yyptr->Stack, Stack, yysize); \
393 Stack = &yyptr->Stack; \
394 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
395 yyptr += yynewbytes / sizeof (*yyptr); \
397 while (0)
399 #endif
401 #if defined (__STDC__) || defined (__cplusplus)
402 typedef signed char yysigned_char;
403 #else
404 typedef short yysigned_char;
405 #endif
407 /* YYFINAL -- State number of the termination state. */
408 #define YYFINAL 160
409 /* YYLAST -- Last index in YYTABLE. */
410 #define YYLAST 2037
412 /* YYNTOKENS -- Number of terminals. */
413 #define YYNTOKENS 97
414 /* YYNNTS -- Number of nonterminals. */
415 #define YYNNTS 83
416 /* YYNRULES -- Number of rules. */
417 #define YYNRULES 215
418 /* YYNRULES -- Number of states. */
419 #define YYNSTATES 380
421 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
422 #define YYUNDEFTOK 2
423 #define YYMAXUTOK 322
425 #define YYTRANSLATE(YYX) \
426 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
428 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
429 static const unsigned char yytranslate[] =
431 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
432 58, 2, 2, 2, 2, 2, 2, 2, 2, 2,
433 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
434 2, 2, 2, 93, 2, 73, 66, 92, 78, 2,
435 95, 96, 90, 87, 71, 88, 72, 91, 2, 2,
436 2, 2, 2, 2, 2, 2, 2, 2, 59, 2,
437 82, 65, 81, 2, 60, 62, 2, 2, 2, 2,
438 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
439 2, 2, 2, 2, 2, 2, 2, 2, 63, 64,
440 2, 69, 2, 70, 77, 2, 2, 2, 2, 2,
441 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
442 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
443 2, 2, 2, 67, 76, 68, 94, 2, 2, 2,
444 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
445 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
446 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
447 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
448 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
449 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
450 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
451 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
452 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
453 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
454 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
455 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
456 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
457 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
458 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
459 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
460 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
461 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
462 55, 56, 57, 61, 74, 75, 79, 80, 83, 84,
463 85, 86, 89
466 #if YYDEBUG
467 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
468 YYRHS. */
469 static const unsigned short yyprhs[] =
471 0, 0, 3, 6, 9, 10, 12, 15, 18, 20,
472 22, 24, 26, 28, 30, 32, 34, 36, 38, 40,
473 42, 44, 46, 48, 50, 52, 54, 56, 58, 60,
474 62, 64, 66, 68, 70, 72, 74, 76, 78, 80,
475 82, 84, 87, 91, 96, 100, 104, 108, 114, 117,
476 118, 121, 122, 129, 136, 143, 150, 157, 164, 166,
477 169, 171, 174, 179, 181, 185, 189, 193, 196, 200,
478 203, 205, 207, 209, 211, 213, 216, 218, 221, 225,
479 228, 233, 238, 245, 252, 257, 259, 262, 264, 266,
480 268, 270, 272, 274, 276, 280, 282, 284, 286, 288,
481 291, 293, 298, 303, 305, 307, 309, 311, 313, 314,
482 318, 322, 326, 330, 332, 333, 335, 339, 341, 342,
483 344, 348, 352, 356, 360, 364, 368, 372, 376, 380,
484 384, 387, 390, 393, 396, 399, 402, 406, 410, 414,
485 418, 422, 426, 428, 430, 432, 434, 436, 438, 440,
486 442, 443, 445, 447, 456, 458, 459, 461, 464, 469,
487 473, 474, 482, 490, 493, 496, 499, 503, 507, 512,
488 517, 520, 522, 527, 529, 531, 533, 535, 538, 541,
489 543, 547, 551, 555, 557, 559, 567, 569, 570, 574,
490 576, 577, 579, 583, 588, 593, 597, 602, 606, 613,
491 616, 617, 619, 621, 623, 625, 627, 629, 632, 636,
492 640, 645, 650, 654, 656, 658
495 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
496 static const short yyrhs[] =
498 98, 0, -1, 100, 99, -1, 38, 127, -1, -1,
499 101, -1, 100, 101, -1, 126, 102, -1, 102, -1,
500 149, -1, 154, -1, 155, -1, 164, -1, 166, -1,
501 161, -1, 162, -1, 169, -1, 170, -1, 172, -1,
502 173, -1, 129, -1, 156, -1, 176, -1, 123, -1,
503 124, -1, 122, -1, 114, -1, 115, -1, 116, -1,
504 119, -1, 113, -1, 112, -1, 111, -1, 108, -1,
505 107, -1, 105, -1, 106, -1, 171, -1, 104, -1,
506 103, -1, 125, -1, 1, 127, -1, 57, 131, 127,
507 -1, 35, 168, 131, 127, -1, 54, 131, 127, -1,
508 55, 131, 127, -1, 53, 131, 127, -1, 13, 146,
509 109, 110, 127, -1, 65, 131, -1, -1, 59, 175,
510 -1, -1, 33, 131, 127, 100, 34, 127, -1, 32,
511 131, 127, 100, 34, 127, -1, 48, 146, 127, 100,
512 49, 127, -1, 42, 146, 127, 100, 44, 127, -1,
513 43, 147, 127, 100, 44, 127, -1, 46, 146, 127,
514 117, 47, 127, -1, 118, -1, 117, 118, -1, 170,
515 -1, 146, 127, -1, 45, 146, 120, 127, -1, 121,
516 -1, 120, 71, 121, -1, 146, 59, 131, -1, 41,
517 163, 127, -1, 21, 127, -1, 21, 56, 127, -1,
518 22, 127, -1, 127, -1, 145, -1, 128, -1, 59,
519 -1, 58, -1, 130, 127, -1, 12, -1, 12, 62,
520 -1, 12, 73, 131, -1, 12, 131, -1, 12, 131,
521 71, 63, -1, 12, 131, 71, 64, -1, 12, 69,
522 131, 71, 63, 70, -1, 12, 69, 131, 70, 71,
523 64, -1, 12, 69, 131, 70, -1, 132, -1, 50,
524 134, -1, 136, -1, 137, -1, 142, -1, 148, -1,
525 66, -1, 143, -1, 144, -1, 95, 131, 96, -1,
526 87, -1, 88, -1, 8, -1, 9, -1, 51, 136,
527 -1, 146, -1, 146, 69, 131, 70, -1, 146, 95,
528 131, 96, -1, 131, -1, 138, -1, 146, -1, 159,
529 -1, 131, -1, -1, 146, 61, 146, -1, 132, 72,
530 137, -1, 132, 72, 132, -1, 67, 139, 68, -1,
531 140, -1, -1, 141, -1, 140, 71, 141, -1, 133,
532 -1, -1, 7, -1, 131, 87, 131, -1, 131, 88,
533 131, -1, 131, 90, 131, -1, 131, 91, 131, -1,
534 131, 92, 131, -1, 131, 78, 131, -1, 131, 76,
535 131, -1, 131, 77, 131, -1, 131, 86, 131, -1,
536 131, 85, 131, -1, 94, 131, -1, 93, 131, -1,
537 77, 146, -1, 82, 131, -1, 81, 131, -1, 88,
538 131, -1, 131, 80, 131, -1, 131, 79, 131, -1,
539 131, 81, 131, -1, 131, 82, 131, -1, 131, 83,
540 131, -1, 131, 84, 131, -1, 10, -1, 11, -1,
541 87, -1, 88, -1, 8, -1, 9, -1, 6, -1,
542 146, -1, -1, 3, -1, 4, -1, 23, 131, 127,
543 100, 150, 153, 28, 127, -1, 151, -1, -1, 152,
544 -1, 151, 152, -1, 27, 131, 127, 100, -1, 26,
545 127, 100, -1, -1, 24, 146, 127, 100, 153, 28,
546 127, -1, 25, 146, 127, 100, 153, 28, 127, -1,
547 157, 127, -1, 158, 127, -1, 146, 158, -1, 56,
548 146, 158, -1, 39, 146, 158, -1, 56, 39, 146,
549 158, -1, 39, 56, 146, 158, -1, 159, 160, -1,
550 159, -1, 159, 69, 131, 70, -1, 14, -1, 15,
551 -1, 16, -1, 17, -1, 52, 146, -1, 72, 146,
552 -1, 133, -1, 160, 71, 133, -1, 29, 163, 127,
553 -1, 30, 163, 127, -1, 4, -1, 82, -1, 31,
554 146, 165, 127, 100, 34, 127, -1, 168, -1, -1,
555 146, 167, 127, -1, 160, -1, -1, 146, -1, 168,
556 71, 146, -1, 146, 36, 133, 127, -1, 146, 65,
557 133, 127, -1, 37, 146, 127, -1, 37, 146, 133,
558 127, -1, 39, 168, 127, -1, 40, 168, 59, 175,
559 174, 127, -1, 60, 146, -1, -1, 159, -1, 146,
560 -1, 48, -1, 13, -1, 177, -1, 178, -1, 146,
561 178, -1, 56, 146, 178, -1, 39, 146, 178, -1,
562 56, 39, 146, 178, -1, 39, 56, 146, 178, -1,
563 179, 135, 127, -1, 18, -1, 19, -1, 20, -1
566 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
567 static const unsigned short yyrline[] =
569 0, 123, 123, 127, 128, 132, 133, 140, 141, 145,
570 146, 147, 148, 149, 150, 151, 152, 153, 154, 155,
571 156, 157, 158, 159, 160, 161, 162, 163, 164, 165,
572 166, 167, 168, 169, 170, 171, 172, 173, 174, 175,
573 176, 177, 181, 185, 189, 193, 197, 201, 205, 206,
574 210, 211, 215, 219, 223, 227, 231, 235, 239, 240,
575 244, 245, 249, 253, 254, 258, 262, 266, 267, 270,
576 274, 278, 282, 283, 287, 291, 295, 296, 297, 298,
577 299, 300, 301, 302, 303, 307, 308, 309, 310, 311,
578 312, 313, 314, 315, 316, 317, 318, 319, 320, 321,
579 325, 326, 327, 331, 332, 336, 337, 341, 342, 346,
580 350, 351, 355, 359, 360, 364, 365, 369, 370, 374,
581 378, 379, 380, 381, 382, 383, 384, 385, 386, 387,
582 388, 389, 390, 391, 392, 393, 397, 398, 399, 400,
583 401, 402, 406, 407, 408, 409, 410, 411, 415, 419,
584 420, 424, 425, 429, 433, 434, 438, 439, 443, 447,
585 448, 452, 456, 460, 461, 465, 466, 467, 468, 469,
586 473, 474, 475, 479, 480, 481, 482, 483, 484, 488,
587 489, 493, 497, 501, 502, 506, 510, 511, 515, 519,
588 520, 524, 525, 529, 533, 537, 538, 542, 546, 550,
589 551, 555, 556, 557, 558, 562, 563, 567, 568, 569,
590 570, 571, 575, 579, 580, 581
592 #endif
594 #if YYDEBUG || YYERROR_VERBOSE
595 /* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
596 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
597 static const char *const yytname[] =
599 "$end", "error", "$undefined", "INTEGER_LITERAL", "STRING_LITERAL",
600 "FILE_PATH", "IDENTIFIER", "LOCAL_ID", "FORWARD_BRANCH",
601 "BACKWARD_BRANCH", "LABEL", "LOCAL_LABEL", "MNEMONIC", "_LABEL_",
602 "BYTE", "CHAR", "WORD", "DWORD", "DSB", "DSW", "DSD", "DATASEG",
603 "CODESEG", "IF", "IFDEF", "IFNDEF", "ELSE", "ELIF", "ENDIF", "INCSRC",
604 "INCBIN", "MACRO", "REPT", "WHILE", "ENDM", "ALIGN", "EQU", "DEFINE",
605 "END", "PUBLIC", "EXTRN", "CHARMAP", "STRUC", "UNION", "ENDS", "RECORD",
606 "ENUM", "ENDE", "PROC", "ENDP", "SIZEOF", "MASK", "TAG", "MESSAGE",
607 "WARNING", "ERROR", "ZEROPAGE", "ORG", "'\\n'", "':'", "'@'",
608 "SCOPE_OP", "'A'", "'X'", "'Y'", "'='", "'$'", "'{'", "'}'", "'['",
609 "']'", "','", "'.'", "'#'", "HI_OP", "LO_OP", "'|'", "'^'", "'&'",
610 "NE_OP", "EQ_OP", "'>'", "'<'", "GE_OP", "LE_OP", "SHR_OP", "SHL_OP",
611 "'+'", "'-'", "UMINUS", "'*'", "'/'", "'%'", "'!'", "'~'", "'('", "')'",
612 "$accept", "assembly_unit", "end_opt", "statement_list",
613 "labelable_statement", "statement", "org_statement", "align_statement",
614 "warning_statement", "error_statement", "message_statement",
615 "label_statement", "label_addr_part_opt", "label_type_part_opt",
616 "while_statement", "rept_statement", "proc_statement",
617 "struc_decl_statement", "union_decl_statement", "enum_decl_statement",
618 "enum_item_list", "enum_item", "record_decl_statement",
619 "record_field_list", "record_field", "charmap_statement",
620 "dataseg_statement", "codeseg_statement", "null_statement",
621 "label_decl", "line_tail", "newline", "instruction_statement",
622 "instruction", "expression", "indexed_identifier",
623 "extended_expression", "sizeof_arg", "expression_opt", "scope_access",
624 "struc_access", "struc_initializer", "field_initializer_list_opt",
625 "field_initializer_list", "field_initializer", "local_id",
626 "arithmetic_expression", "comparison_expression", "label", "identifier",
627 "identifier_opt", "literal", "if_statement", "elif_statement_list_opt",
628 "elif_statement_list", "elif_statement", "else_part_opt",
629 "ifdef_statement", "ifndef_statement", "data_statement",
630 "named_data_statement", "unnamed_data_statement", "datatype",
631 "expression_list", "incsrc_statement", "incbin_statement",
632 "file_specifier", "macro_decl_statement", "param_list_opt",
633 "macro_statement", "arg_list_opt", "identifier_list", "equ_statement",
634 "assign_statement", "define_statement", "public_statement",
635 "extrn_statement", "from_part_opt", "symbol_type", "storage_statement",
636 "named_storage_statement", "unnamed_storage_statement", "storage", 0
638 #endif
640 # ifdef YYPRINT
641 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
642 token YYLEX-NUM. */
643 static const unsigned short yytoknum[] =
645 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
646 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
647 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
648 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
649 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
650 305, 306, 307, 308, 309, 310, 311, 312, 10, 58,
651 64, 313, 65, 88, 89, 61, 36, 123, 125, 91,
652 93, 44, 46, 35, 314, 315, 124, 94, 38, 316,
653 317, 62, 60, 318, 319, 320, 321, 43, 45, 322,
654 42, 47, 37, 33, 126, 40, 41
656 # endif
658 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
659 static const unsigned char yyr1[] =
661 0, 97, 98, 99, 99, 100, 100, 101, 101, 102,
662 102, 102, 102, 102, 102, 102, 102, 102, 102, 102,
663 102, 102, 102, 102, 102, 102, 102, 102, 102, 102,
664 102, 102, 102, 102, 102, 102, 102, 102, 102, 102,
665 102, 102, 103, 104, 105, 106, 107, 108, 109, 109,
666 110, 110, 111, 112, 113, 114, 115, 116, 117, 117,
667 118, 118, 119, 120, 120, 121, 122, 123, 123, 124,
668 125, 126, 127, 127, 128, 129, 130, 130, 130, 130,
669 130, 130, 130, 130, 130, 131, 131, 131, 131, 131,
670 131, 131, 131, 131, 131, 131, 131, 131, 131, 131,
671 132, 132, 132, 133, 133, 134, 134, 135, 135, 136,
672 137, 137, 138, 139, 139, 140, 140, 141, 141, 142,
673 143, 143, 143, 143, 143, 143, 143, 143, 143, 143,
674 143, 143, 143, 143, 143, 143, 144, 144, 144, 144,
675 144, 144, 145, 145, 145, 145, 145, 145, 146, 147,
676 147, 148, 148, 149, 150, 150, 151, 151, 152, 153,
677 153, 154, 155, 156, 156, 157, 157, 157, 157, 157,
678 158, 158, 158, 159, 159, 159, 159, 159, 159, 160,
679 160, 161, 162, 163, 163, 164, 165, 165, 166, 167,
680 167, 168, 168, 169, 170, 171, 171, 172, 173, 174,
681 174, 175, 175, 175, 175, 176, 176, 177, 177, 177,
682 177, 177, 178, 179, 179, 179
685 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
686 static const unsigned char yyr2[] =
688 0, 2, 2, 2, 0, 1, 2, 2, 1, 1,
689 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
690 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
691 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
692 1, 2, 3, 4, 3, 3, 3, 5, 2, 0,
693 2, 0, 6, 6, 6, 6, 6, 6, 1, 2,
694 1, 2, 4, 1, 3, 3, 3, 2, 3, 2,
695 1, 1, 1, 1, 1, 2, 1, 2, 3, 2,
696 4, 4, 6, 6, 4, 1, 2, 1, 1, 1,
697 1, 1, 1, 1, 3, 1, 1, 1, 1, 2,
698 1, 4, 4, 1, 1, 1, 1, 1, 0, 3,
699 3, 3, 3, 1, 0, 1, 3, 1, 0, 1,
700 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
701 2, 2, 2, 2, 2, 2, 3, 3, 3, 3,
702 3, 3, 1, 1, 1, 1, 1, 1, 1, 1,
703 0, 1, 1, 8, 1, 0, 1, 2, 4, 3,
704 0, 7, 7, 2, 2, 2, 3, 3, 4, 4,
705 2, 1, 4, 1, 1, 1, 1, 2, 2, 1,
706 3, 3, 3, 1, 1, 7, 1, 0, 3, 1,
707 0, 1, 3, 4, 4, 3, 4, 3, 6, 2,
708 0, 1, 1, 1, 1, 1, 1, 2, 3, 3,
709 4, 4, 3, 1, 1, 1
712 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
713 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
714 means the default is an error. */
715 static const unsigned char yydefact[] =
717 0, 0, 148, 146, 147, 142, 143, 76, 0, 173,
718 174, 175, 176, 213, 214, 215, 0, 0, 0, 0,
719 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
720 0, 0, 150, 0, 0, 0, 0, 0, 0, 0,
721 0, 0, 74, 73, 0, 144, 145, 0, 0, 5,
722 8, 39, 38, 35, 36, 34, 33, 32, 31, 30,
723 26, 27, 28, 29, 25, 23, 24, 40, 0, 70,
724 72, 20, 0, 71, 190, 9, 10, 11, 21, 0,
725 0, 171, 14, 15, 12, 13, 16, 17, 37, 18,
726 19, 22, 205, 206, 108, 41, 151, 152, 119, 97,
727 98, 0, 0, 77, 91, 0, 0, 0, 0, 0,
728 95, 96, 0, 0, 0, 79, 85, 87, 88, 89,
729 92, 93, 100, 90, 49, 0, 67, 69, 0, 0,
730 0, 183, 184, 0, 0, 187, 0, 0, 191, 0,
731 0, 0, 191, 0, 0, 0, 0, 149, 0, 0,
732 0, 0, 177, 0, 0, 0, 0, 0, 0, 178,
733 1, 0, 2, 6, 7, 75, 0, 0, 114, 103,
734 179, 104, 165, 189, 0, 207, 163, 164, 0, 170,
735 107, 0, 86, 105, 106, 99, 0, 0, 78, 132,
736 134, 133, 135, 131, 130, 0, 0, 0, 0, 0,
737 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
738 0, 0, 0, 0, 0, 0, 0, 0, 51, 68,
739 0, 0, 0, 181, 182, 0, 186, 0, 0, 0,
740 0, 195, 0, 0, 167, 209, 197, 0, 66, 0,
741 0, 0, 63, 0, 0, 0, 46, 44, 45, 0,
742 166, 208, 42, 3, 0, 0, 117, 0, 113, 115,
743 0, 188, 0, 212, 84, 0, 94, 80, 81, 126,
744 127, 125, 137, 136, 138, 139, 140, 141, 129, 128,
745 120, 121, 122, 123, 124, 111, 110, 100, 109, 0,
746 0, 48, 0, 0, 0, 0, 0, 0, 0, 0,
747 192, 43, 196, 169, 211, 204, 203, 202, 201, 200,
748 0, 0, 0, 62, 0, 0, 58, 0, 60, 0,
749 168, 210, 193, 194, 112, 118, 180, 172, 0, 0,
750 101, 102, 50, 47, 0, 160, 154, 156, 0, 0,
751 0, 0, 0, 0, 0, 0, 0, 0, 64, 65,
752 0, 59, 61, 0, 116, 83, 82, 0, 0, 157,
753 0, 0, 0, 0, 53, 52, 199, 198, 55, 56,
754 57, 54, 0, 0, 0, 161, 162, 185, 0, 153
757 /* YYDEFGOTO[NTERM-NUM]. */
758 static const short yydefgoto[] =
760 -1, 47, 162, 48, 49, 50, 51, 52, 53, 54,
761 55, 56, 218, 293, 57, 58, 59, 60, 61, 62,
762 315, 316, 63, 241, 242, 64, 65, 66, 67, 68,
763 69, 70, 71, 72, 169, 116, 170, 182, 181, 117,
764 118, 171, 257, 258, 259, 119, 120, 121, 73, 122,
765 148, 123, 75, 335, 336, 337, 339, 76, 77, 78,
766 79, 80, 81, 173, 82, 83, 133, 84, 225, 85,
767 174, 139, 86, 87, 88, 89, 90, 345, 309, 91,
768 92, 93, 94
771 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
772 STATE-NUM. */
773 #define YYPACT_NINF -287
774 static const short yypact[] =
776 1808, -37, -287, -287, -287, -287, -287, 410, 19, -287,
777 -287, -287, -287, -287, -287, -287, 38, -37, 805, 19,
778 19, 5, 5, 19, 805, 805, 19, 19, 7, 19,
779 5, 19, 19, 19, 19, 19, 19, 805, 805, 805,
780 6, 805, -287, -287, 19, -287, -287, 46, 895, -287,
781 -287, -287, -287, -287, -287, -287, -287, -287, -287, -287,
782 -287, -287, -287, -287, -287, -287, -287, -287, 1869, -287,
783 -287, -287, -37, -287, 547, -287, -287, -287, -287, -37,
784 -37, 651, -287, -287, -287, -287, -287, -287, -287, -287,
785 -287, -287, -287, -287, 805, -287, -287, -287, -287, -287,
786 -287, 37, 19, -287, -287, 805, 805, 19, 805, 805,
787 -287, 53, 805, 805, 805, 1903, -14, -287, -287, -287,
788 -287, -287, 13, -287, -18, -37, -287, -287, 435, -37,
789 -37, -287, -287, -37, -37, 19, 435, 435, -287, 703,
790 586, 19, 268, 12, -29, -37, -37, -287, -37, 19,
791 -37, -37, -287, 435, 435, 435, 19, 268, 435, -287,
792 -287, -37, -287, -287, -287, -287, 796, 796, 684, 494,
793 -287, -287, -287, -7, -37, -287, -287, -287, 805, -7,
794 494, -37, -287, -287, -287, -287, 11, 745, 494, -287,
795 494, 494, 34, -287, -287, 1920, -46, 805, 805, 805,
796 805, 805, 805, 805, 805, 805, 805, 805, 805, 805,
797 805, 805, 805, 19, 19, 805, 805, 805, 16, -287,
798 1808, 1808, 1808, -287, -287, -37, -4, 1808, 1808, 19,
799 435, -287, -37, 268, -287, -287, -287, 153, -287, 1808,
800 1808, 20, -287, 17, 19, 1808, -287, -287, -287, 268,
801 -287, -287, -287, -287, -37, -37, -287, 22, 9, -287,
802 796, -287, 1866, -287, 10, 30, -287, -287, -287, 244,
803 878, 961, 298, 298, 174, 174, 174, 174, 24, 24,
804 34, 34, -287, -287, -287, -14, -287, -54, -287, 1885,
805 1941, 494, 153, -37, 978, 1144, 1144, 1808, 1227, 1310,
806 -287, -287, -287, -287, -287, -287, -287, -287, -287, 35,
807 1393, 1476, 19, -287, 805, 8, -287, 27, -287, 1559,
808 -287, -287, -287, -287, -287, 796, -287, -287, 56, 43,
809 -287, -287, -287, -287, 805, 96, 100, -287, -37, 102,
810 104, 1642, -37, -37, 19, -37, -37, -37, -287, 494,
811 -37, -287, -287, -37, -287, -287, -287, 435, 105, -287,
812 1808, -37, -37, -37, -287, -287, -287, -287, -287, -287,
813 -287, -287, 1808, -37, 1725, -287, -287, -287, 1061, -287
816 /* YYPGOTO[NTERM-NUM]. */
817 static const short yypgoto[] =
819 -287, -287, -287, -122, -41, 66, -287, -287, -287, -287,
820 -287, -287, -287, -287, -287, -287, -287, -287, -287, -287,
821 -287, -179, -287, -287, -175, -287, -287, -287, -287, -287,
822 49, -287, -287, -287, 332, -74, -129, -287, -287, 40,
823 -70, -287, -287, -287, -185, -287, -287, -287, -287, 0,
824 -287, -287, -287, -287, -287, -192, -286, -287, -287, -287,
825 -287, -73, -99, 64, -287, -287, -6, -287, -287, -287,
826 -287, -25, -287, -238, -287, -287, -287, -287, -142, -287,
827 -287, -69, -287
830 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
831 positive, shift that token. If negative, reduce the rule which
832 number is the opposite. If zero, do what YYDEFACT says.
833 If YYTABLE_NINF, syntax error. */
834 #define YYTABLE_NINF -161
835 static const short yytable[] =
837 74, 172, 184, 143, 144, 175, 318, 163, 124, 131,
838 340, 232, 2, 2, 2, 215, 134, 267, 268, 129,
839 130, 42, 43, 135, 145, 2, 138, 140, 142, 138,
840 237, 146, 147, 149, 150, 151, 152, 254, 255, 256,
841 157, 216, 229, 2, 159, 156, 160, 217, 74, 358,
842 95, 9, 10, 11, 12, 350, 96, 97, 213, 2,
843 98, 99, 100, 141, 260, 126, 127, 229, 74, 234,
844 42, 43, 214, 235, 214, 292, 314, 318, 42, 43,
845 325, 328, 215, 229, 250, 42, 43, 132, 251, 36,
846 324, 312, 167, 329, 125, 344, 42, 43, 294, 295,
847 296, 183, 186, 101, 102, 298, 299, 189, 216, 44,
848 226, 208, 209, 356, 210, 211, 212, 310, 311, 104,
849 355, 165, 338, 319, 210, 211, 212, 334, 176, 177,
850 361, 326, 362, 373, 164, 138, 351, 348, 308, 285,
851 354, 233, 185, 286, 359, 179, 112, 113, 114, 243,
852 332, 0, 0, 0, 0, 0, 249, 0, 0, 2,
853 303, 0, 0, 0, 304, 0, 305, 9, 10, 11,
854 12, 0, 0, 0, 219, 341, 320, 220, 221, 222,
855 321, 0, 223, 224, 0, 227, 228, 0, 0, 231,
856 0, 0, 236, 308, 238, 239, 256, 240, 0, 244,
857 245, 306, 246, 247, 248, 36, 0, 252, 0, 0,
858 253, 0, 0, 287, 288, 0, 0, 0, 0, 0,
859 74, 74, 74, 261, 0, 44, 0, 74, 74, 300,
860 263, 0, 0, 0, 0, 0, 0, 307, 374, 74,
861 74, 0, 0, 0, 317, 74, 0, 0, 0, 0,
862 378, 0, 0, 163, 163, 163, 0, 163, 163, 206,
863 207, 208, 209, 0, 210, 211, 212, 0, 0, 163,
864 163, 0, 0, 0, 297, 0, 0, 0, 163, 301,
865 0, 302, 9, 10, 11, 12, 13, 14, 15, 0,
866 313, 0, 307, 0, 74, 74, 74, 74, 74, 74,
867 163, 0, 0, 322, 323, 0, 0, 0, 0, 0,
868 74, 74, 243, 0, 0, 317, 0, 0, 0, 74,
869 36, 198, 199, 200, 201, 202, 203, 204, 205, 206,
870 207, 208, 209, 163, 210, 211, 212, 163, 0, 115,
871 44, 74, 333, 0, 366, 0, 0, 0, 0, 0,
872 128, 0, 0, 0, 0, 0, 136, 137, 0, 0,
873 74, 0, 0, 0, 0, 0, 352, 0, 0, 153,
874 154, 155, 74, 158, 74, 0, 0, 0, 74, 202,
875 203, 204, 205, 206, 207, 208, 209, 360, 210, 211,
876 212, 364, 365, 0, 367, 368, 369, 0, 0, 370,
877 0, 0, 371, 0, 0, 0, 372, 0, 0, 0,
878 375, 376, 377, 96, 97, 0, 2, 98, 99, 100,
879 0, 0, 379, 0, 0, 0, 180, 0, 0, 0,
880 0, 0, 0, 0, 0, 0, 0, 187, 188, 0,
881 190, 191, 0, 192, 193, 194, 195, 0, 0, 0,
882 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
883 101, 102, 0, 0, 0, 0, 0, 0, 0, 0,
884 0, 230, 103, 0, 0, 0, 104, 0, 0, 105,
885 0, 0, 0, 106, 0, 0, 0, 107, 0, 0,
886 0, 108, 109, 42, 43, 0, 0, 110, 111, 0,
887 0, 0, 0, 112, 113, 114, 0, 0, 0, 0,
888 262, 197, 198, 199, 200, 201, 202, 203, 204, 205,
889 206, 207, 208, 209, 0, 210, 211, 212, 0, 269,
890 270, 271, 272, 273, 274, 275, 276, 277, 278, 279,
891 280, 281, 282, 283, 284, 0, 0, 289, 290, 291,
892 96, 97, 0, 2, 98, 99, 100, 0, 0, 0,
893 0, 9, 10, 11, 12, 13, 14, 15, 0, 0,
894 197, 198, 199, 200, 201, 202, 203, 204, 205, 206,
895 207, 208, 209, 166, 210, 211, 212, 0, 0, 96,
896 97, 0, 2, 98, 99, 100, 0, 101, 102, 36,
897 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
898 0, 0, 167, 104, 168, 0, 0, 0, 0, 44,
899 0, 0, 0, 0, 107, 0, 0, 0, 108, 109,
900 0, 0, 0, 0, 110, 111, 101, 102, 0, 0,
901 112, 113, 114, 0, 42, 43, 349, 0, 0, 0,
902 0, 0, 104, 168, 96, 97, 0, 2, 98, 99,
903 100, 0, 0, 107, 0, 0, 357, 108, 109, 0,
904 0, 0, 0, 110, 111, 0, 0, 0, 0, 112,
905 113, 114, 0, 0, 0, 0, 0, 96, 97, 0,
906 2, 98, 99, 100, 0, 0, 0, 0, 0, 0,
907 0, 101, 102, 0, 0, 0, 96, 97, 0, 2,
908 98, 99, 100, 0, 0, 0, 0, 104, 168, 0,
909 178, 0, 0, 0, 0, 0, 0, 0, 107, 0,
910 0, 0, 108, 109, 101, 102, 0, 0, 110, 111,
911 0, 0, 0, 0, 112, 113, 114, 0, 0, 0,
912 104, 168, 0, 101, 102, -118, 0, 0, 0, 0,
913 0, 107, 0, 0, 0, 108, 109, 0, 0, 104,
914 0, 110, 111, 0, 229, 0, 0, 112, 113, 114,
915 107, 0, 0, 0, 108, 109, 0, 0, 0, 0,
916 110, 111, 0, 0, 0, 0, 112, 113, 114, 96,
917 97, 0, 2, 98, 99, 100, 0, 0, 96, 97,
918 0, 2, 98, 99, 100, 264, 265, 0, 0, 0,
919 0, 197, 198, 199, 200, 201, 202, 203, 204, 205,
920 206, 207, 208, 209, 0, 210, 211, 212, 0, 0,
921 0, 0, 0, 0, 0, 0, 101, 102, 0, 0,
922 0, 0, 0, 0, 0, 101, 102, 0, 0, 0,
923 0, 0, 104, 168, 0, 0, 0, 0, 0, 0,
924 0, 104, 0, 107, 0, 0, 0, 108, 109, 0,
925 0, 0, 107, 110, 111, 0, 108, 109, 0, 112,
926 113, 114, 110, 111, 0, -4, 1, 0, 112, 113,
927 114, 2, 0, 3, 4, 5, 6, 7, 8, 9,
928 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
929 20, 0, 0, 0, 21, 22, 23, 24, 25, 0,
930 26, 0, 27, 161, 28, 29, 30, 31, 32, 0,
931 33, 34, 0, 35, 0, 0, 0, 36, 37, 38,
932 39, 40, 41, 42, 43, 0, 199, 200, 201, 202,
933 203, 204, 205, 206, 207, 208, 209, 44, 210, 211,
934 212, 0, 0, 0, 0, 0, 0, 0, 0, 1,
935 0, 0, 45, 46, 2, 0, 3, 4, 5, 6,
936 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
937 17, 18, 19, 20, -155, 334, -155, 21, 22, 23,
938 24, 25, 0, 26, 0, 27, 0, 28, 29, 30,
939 31, 32, 0, 33, 34, 0, 35, 0, 0, 0,
940 36, 37, 38, 39, 40, 41, 42, 43, 0, 0,
941 200, 201, 202, 203, 204, 205, 206, 207, 208, 209,
942 44, 210, 211, 212, 0, 0, 0, 0, 0, 0,
943 0, 0, 1, 0, 0, 45, 46, 2, 0, 3,
944 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
945 14, 15, 16, 17, 18, 19, 20, -158, -158, -158,
946 21, 22, 23, 24, 25, 0, 26, 0, 27, 0,
947 28, 29, 30, 31, 32, 0, 33, 34, 0, 35,
948 0, 0, 0, 36, 37, 38, 39, 40, 41, 42,
949 43, 0, 0, 0, 0, 0, 0, 0, 0, 0,
950 0, 0, 0, 44, 0, 0, 0, 0, 0, 0,
951 0, 0, 0, 0, 0, 1, 0, 0, 45, 46,
952 2, 0, 3, 4, 5, 6, 7, 8, 9, 10,
953 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
954 338, 0, -160, 21, 22, 23, 24, 25, 0, 26,
955 0, 27, 0, 28, 29, 30, 31, 32, 0, 33,
956 34, 0, 35, 0, 0, 0, 36, 37, 38, 39,
957 40, 41, 42, 43, 0, 0, 0, 0, 0, 0,
958 0, 0, 0, 0, 0, 0, 44, 0, 0, 0,
959 0, 0, 0, 0, 0, 0, 0, 0, 1, 0,
960 0, 45, 46, 2, 0, 3, 4, 5, 6, 7,
961 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
962 18, 19, 20, 0, 0, 0, 21, 22, 23, 24,
963 25, 342, 26, 0, 27, 0, 28, 29, 30, 31,
964 32, 0, 33, 34, 0, 35, 0, 0, 0, 36,
965 37, 38, 39, 40, 41, 42, 43, 0, 0, 0,
966 0, 0, 0, 0, 0, 0, 0, 0, 0, 44,
967 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
968 0, 1, 0, 0, 45, 46, 2, 0, 3, 4,
969 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
970 15, 16, 17, 18, 19, 20, 0, 0, 0, 21,
971 22, 23, 24, 25, 343, 26, 0, 27, 0, 28,
972 29, 30, 31, 32, 0, 33, 34, 0, 35, 0,
973 0, 0, 36, 37, 38, 39, 40, 41, 42, 43,
974 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
975 0, 0, 44, 0, 0, 0, 0, 0, 0, 0,
976 0, 0, 0, 0, 1, 0, 0, 45, 46, 2,
977 0, 3, 4, 5, 6, 7, 8, 9, 10, 11,
978 12, 13, 14, 15, 16, 17, 18, 19, 20, 0,
979 0, 0, 21, 22, 23, 24, 25, 0, 26, 0,
980 27, 0, 28, 29, 30, 31, 32, 346, 33, 34,
981 0, 35, 0, 0, 0, 36, 37, 38, 39, 40,
982 41, 42, 43, 0, 0, 0, 0, 0, 0, 0,
983 0, 0, 0, 0, 0, 44, 0, 0, 0, 0,
984 0, 0, 0, 0, 0, 0, 0, 1, 0, 0,
985 45, 46, 2, 0, 3, 4, 5, 6, 7, 8,
986 9, 10, 11, 12, 13, 14, 15, 16, 17, 18,
987 19, 20, 0, 0, 0, 21, 22, 23, 24, 25,
988 0, 26, 0, 27, 0, 28, 29, 30, 31, 32,
989 347, 33, 34, 0, 35, 0, 0, 0, 36, 37,
990 38, 39, 40, 41, 42, 43, 0, 0, 0, 0,
991 0, 0, 0, 0, 0, 0, 0, 0, 44, 0,
992 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
993 1, 0, 0, 45, 46, 2, 0, 3, 4, 5,
994 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
995 16, 17, 18, 19, 20, 0, 0, 0, 21, 22,
996 23, 24, 25, 0, 26, 0, 27, 0, 28, 29,
997 30, 31, 32, 0, 33, 34, 0, 35, 353, 0,
998 0, 36, 37, 38, 39, 40, 41, 42, 43, 0,
999 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1000 0, 44, 0, 0, 0, 0, 0, 0, 0, 0,
1001 0, 0, 0, 1, 0, 0, 45, 46, 2, 0,
1002 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
1003 13, 14, 15, 16, 17, 18, 19, 20, 0, 0,
1004 0, 21, 22, 23, 24, 25, 363, 26, 0, 27,
1005 0, 28, 29, 30, 31, 32, 0, 33, 34, 0,
1006 35, 0, 0, 0, 36, 37, 38, 39, 40, 41,
1007 42, 43, 0, 0, 0, 0, 0, 0, 0, 0,
1008 0, 0, 0, 0, 44, 0, 0, 0, 0, 0,
1009 0, 0, 0, 0, 0, 0, 1, 0, 0, 45,
1010 46, 2, 0, 3, 4, 5, 6, 7, 8, 9,
1011 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
1012 20, 0, 0, -159, 21, 22, 23, 24, 25, 0,
1013 26, 0, 27, 0, 28, 29, 30, 31, 32, 0,
1014 33, 34, 0, 35, 0, 0, 0, 36, 37, 38,
1015 39, 40, 41, 42, 43, 0, 0, 0, 0, 0,
1016 0, 0, 0, 0, 0, 0, 0, 44, 0, 0,
1017 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
1018 0, 0, 45, 46, 2, 0, 3, 4, 5, 6,
1019 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
1020 17, 18, 19, 20, 0, 0, 0, 21, 22, 23,
1021 24, 25, 0, 26, 0, 27, 0, 28, 29, 30,
1022 31, 32, 0, 33, 34, 0, 35, 0, 0, 0,
1023 36, 37, 38, 39, 40, 41, 42, 43, 0, 0,
1024 1, 0, 0, 0, 0, 2, 0, 0, 0, 0,
1025 44, 7, 8, 9, 10, 11, 12, 13, 14, 15,
1026 16, 17, 18, 19, 20, 45, 46, 0, 21, 22,
1027 23, 24, 25, 0, 26, 0, 27, 0, 28, 29,
1028 30, 31, 32, 0, 33, 34, 0, 35, 0, 0,
1029 0, 36, 37, 38, 39, 40, 41, 42, 43, 0,
1030 0, 0, 0, 0, 0, 0, 327, 0, 0, 0,
1031 0, 44, 197, 198, 199, 200, 201, 202, 203, 204,
1032 205, 206, 207, 208, 209, 330, 210, 211, 212, 0,
1033 0, 197, 198, 199, 200, 201, 202, 203, 204, 205,
1034 206, 207, 208, 209, 196, 210, 211, 212, 0, 197,
1035 198, 199, 200, 201, 202, 203, 204, 205, 206, 207,
1036 208, 209, 0, 210, 211, 212, 197, 198, 199, 200,
1037 201, 202, 203, 204, 205, 206, 207, 208, 209, 0,
1038 210, 211, 212, 0, 0, 0, 266, 197, 198, 199,
1039 200, 201, 202, 203, 204, 205, 206, 207, 208, 209,
1040 0, 210, 211, 212, 0, 0, 0, 331
1043 static const short yycheck[] =
1045 0, 74, 101, 28, 29, 74, 244, 48, 8, 4,
1046 296, 140, 6, 6, 6, 69, 22, 63, 64, 19,
1047 20, 58, 59, 23, 30, 6, 26, 27, 28, 29,
1048 59, 31, 32, 33, 34, 35, 36, 166, 167, 168,
1049 40, 95, 71, 6, 44, 39, 0, 65, 48, 335,
1050 1, 14, 15, 16, 17, 47, 3, 4, 72, 6,
1051 7, 8, 9, 56, 71, 16, 17, 71, 68, 142,
1052 58, 59, 61, 142, 61, 59, 59, 315, 58, 59,
1053 71, 71, 69, 71, 157, 58, 59, 82, 157, 52,
1054 68, 71, 65, 63, 56, 60, 58, 59, 220, 221,
1055 222, 101, 102, 50, 51, 227, 228, 107, 95, 72,
1056 135, 87, 88, 70, 90, 91, 92, 239, 240, 66,
1057 64, 72, 26, 245, 90, 91, 92, 27, 79, 80,
1058 28, 260, 28, 28, 68, 135, 315, 312, 237, 213,
1059 325, 141, 102, 213, 336, 81, 93, 94, 95, 149,
1060 292, -1, -1, -1, -1, -1, 156, -1, -1, 6,
1061 233, -1, -1, -1, 233, -1, 13, 14, 15, 16,
1062 17, -1, -1, -1, 125, 297, 249, 128, 129, 130,
1063 249, -1, 133, 134, -1, 136, 137, -1, -1, 140,
1064 -1, -1, 143, 292, 145, 146, 325, 148, -1, 150,
1065 151, 48, 153, 154, 155, 52, -1, 158, -1, -1,
1066 161, -1, -1, 213, 214, -1, -1, -1, -1, -1,
1067 220, 221, 222, 174, -1, 72, -1, 227, 228, 229,
1068 181, -1, -1, -1, -1, -1, -1, 237, 360, 239,
1069 240, -1, -1, -1, 244, 245, -1, -1, -1, -1,
1070 372, -1, -1, 294, 295, 296, -1, 298, 299, 85,
1071 86, 87, 88, -1, 90, 91, 92, -1, -1, 310,
1072 311, -1, -1, -1, 225, -1, -1, -1, 319, 230,
1073 -1, 232, 14, 15, 16, 17, 18, 19, 20, -1,
1074 241, -1, 292, -1, 294, 295, 296, 297, 298, 299,
1075 341, -1, -1, 254, 255, -1, -1, -1, -1, -1,
1076 310, 311, 312, -1, -1, 315, -1, -1, -1, 319,
1077 52, 77, 78, 79, 80, 81, 82, 83, 84, 85,
1078 86, 87, 88, 374, 90, 91, 92, 378, -1, 7,
1079 72, 341, 293, -1, 344, -1, -1, -1, -1, -1,
1080 18, -1, -1, -1, -1, -1, 24, 25, -1, -1,
1081 360, -1, -1, -1, -1, -1, 317, -1, -1, 37,
1082 38, 39, 372, 41, 374, -1, -1, -1, 378, 81,
1083 82, 83, 84, 85, 86, 87, 88, 338, 90, 91,
1084 92, 342, 343, -1, 345, 346, 347, -1, -1, 350,
1085 -1, -1, 353, -1, -1, -1, 357, -1, -1, -1,
1086 361, 362, 363, 3, 4, -1, 6, 7, 8, 9,
1087 -1, -1, 373, -1, -1, -1, 94, -1, -1, -1,
1088 -1, -1, -1, -1, -1, -1, -1, 105, 106, -1,
1089 108, 109, -1, 111, 112, 113, 114, -1, -1, -1,
1090 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1091 50, 51, -1, -1, -1, -1, -1, -1, -1, -1,
1092 -1, 139, 62, -1, -1, -1, 66, -1, -1, 69,
1093 -1, -1, -1, 73, -1, -1, -1, 77, -1, -1,
1094 -1, 81, 82, 58, 59, -1, -1, 87, 88, -1,
1095 -1, -1, -1, 93, 94, 95, -1, -1, -1, -1,
1096 178, 76, 77, 78, 79, 80, 81, 82, 83, 84,
1097 85, 86, 87, 88, -1, 90, 91, 92, -1, 197,
1098 198, 199, 200, 201, 202, 203, 204, 205, 206, 207,
1099 208, 209, 210, 211, 212, -1, -1, 215, 216, 217,
1100 3, 4, -1, 6, 7, 8, 9, -1, -1, -1,
1101 -1, 14, 15, 16, 17, 18, 19, 20, -1, -1,
1102 76, 77, 78, 79, 80, 81, 82, 83, 84, 85,
1103 86, 87, 88, 36, 90, 91, 92, -1, -1, 3,
1104 4, -1, 6, 7, 8, 9, -1, 50, 51, 52,
1105 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1106 -1, -1, 65, 66, 67, -1, -1, -1, -1, 72,
1107 -1, -1, -1, -1, 77, -1, -1, -1, 81, 82,
1108 -1, -1, -1, -1, 87, 88, 50, 51, -1, -1,
1109 93, 94, 95, -1, 58, 59, 314, -1, -1, -1,
1110 -1, -1, 66, 67, 3, 4, -1, 6, 7, 8,
1111 9, -1, -1, 77, -1, -1, 334, 81, 82, -1,
1112 -1, -1, -1, 87, 88, -1, -1, -1, -1, 93,
1113 94, 95, -1, -1, -1, -1, -1, 3, 4, -1,
1114 6, 7, 8, 9, -1, -1, -1, -1, -1, -1,
1115 -1, 50, 51, -1, -1, -1, 3, 4, -1, 6,
1116 7, 8, 9, -1, -1, -1, -1, 66, 67, -1,
1117 69, -1, -1, -1, -1, -1, -1, -1, 77, -1,
1118 -1, -1, 81, 82, 50, 51, -1, -1, 87, 88,
1119 -1, -1, -1, -1, 93, 94, 95, -1, -1, -1,
1120 66, 67, -1, 50, 51, 71, -1, -1, -1, -1,
1121 -1, 77, -1, -1, -1, 81, 82, -1, -1, 66,
1122 -1, 87, 88, -1, 71, -1, -1, 93, 94, 95,
1123 77, -1, -1, -1, 81, 82, -1, -1, -1, -1,
1124 87, 88, -1, -1, -1, -1, 93, 94, 95, 3,
1125 4, -1, 6, 7, 8, 9, -1, -1, 3, 4,
1126 -1, 6, 7, 8, 9, 70, 71, -1, -1, -1,
1127 -1, 76, 77, 78, 79, 80, 81, 82, 83, 84,
1128 85, 86, 87, 88, -1, 90, 91, 92, -1, -1,
1129 -1, -1, -1, -1, -1, -1, 50, 51, -1, -1,
1130 -1, -1, -1, -1, -1, 50, 51, -1, -1, -1,
1131 -1, -1, 66, 67, -1, -1, -1, -1, -1, -1,
1132 -1, 66, -1, 77, -1, -1, -1, 81, 82, -1,
1133 -1, -1, 77, 87, 88, -1, 81, 82, -1, 93,
1134 94, 95, 87, 88, -1, 0, 1, -1, 93, 94,
1135 95, 6, -1, 8, 9, 10, 11, 12, 13, 14,
1136 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
1137 25, -1, -1, -1, 29, 30, 31, 32, 33, -1,
1138 35, -1, 37, 38, 39, 40, 41, 42, 43, -1,
1139 45, 46, -1, 48, -1, -1, -1, 52, 53, 54,
1140 55, 56, 57, 58, 59, -1, 78, 79, 80, 81,
1141 82, 83, 84, 85, 86, 87, 88, 72, 90, 91,
1142 92, -1, -1, -1, -1, -1, -1, -1, -1, 1,
1143 -1, -1, 87, 88, 6, -1, 8, 9, 10, 11,
1144 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
1145 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
1146 32, 33, -1, 35, -1, 37, -1, 39, 40, 41,
1147 42, 43, -1, 45, 46, -1, 48, -1, -1, -1,
1148 52, 53, 54, 55, 56, 57, 58, 59, -1, -1,
1149 79, 80, 81, 82, 83, 84, 85, 86, 87, 88,
1150 72, 90, 91, 92, -1, -1, -1, -1, -1, -1,
1151 -1, -1, 1, -1, -1, 87, 88, 6, -1, 8,
1152 9, 10, 11, 12, 13, 14, 15, 16, 17, 18,
1153 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
1154 29, 30, 31, 32, 33, -1, 35, -1, 37, -1,
1155 39, 40, 41, 42, 43, -1, 45, 46, -1, 48,
1156 -1, -1, -1, 52, 53, 54, 55, 56, 57, 58,
1157 59, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1158 -1, -1, -1, 72, -1, -1, -1, -1, -1, -1,
1159 -1, -1, -1, -1, -1, 1, -1, -1, 87, 88,
1160 6, -1, 8, 9, 10, 11, 12, 13, 14, 15,
1161 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
1162 26, -1, 28, 29, 30, 31, 32, 33, -1, 35,
1163 -1, 37, -1, 39, 40, 41, 42, 43, -1, 45,
1164 46, -1, 48, -1, -1, -1, 52, 53, 54, 55,
1165 56, 57, 58, 59, -1, -1, -1, -1, -1, -1,
1166 -1, -1, -1, -1, -1, -1, 72, -1, -1, -1,
1167 -1, -1, -1, -1, -1, -1, -1, -1, 1, -1,
1168 -1, 87, 88, 6, -1, 8, 9, 10, 11, 12,
1169 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
1170 23, 24, 25, -1, -1, -1, 29, 30, 31, 32,
1171 33, 34, 35, -1, 37, -1, 39, 40, 41, 42,
1172 43, -1, 45, 46, -1, 48, -1, -1, -1, 52,
1173 53, 54, 55, 56, 57, 58, 59, -1, -1, -1,
1174 -1, -1, -1, -1, -1, -1, -1, -1, -1, 72,
1175 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1176 -1, 1, -1, -1, 87, 88, 6, -1, 8, 9,
1177 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
1178 20, 21, 22, 23, 24, 25, -1, -1, -1, 29,
1179 30, 31, 32, 33, 34, 35, -1, 37, -1, 39,
1180 40, 41, 42, 43, -1, 45, 46, -1, 48, -1,
1181 -1, -1, 52, 53, 54, 55, 56, 57, 58, 59,
1182 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1183 -1, -1, 72, -1, -1, -1, -1, -1, -1, -1,
1184 -1, -1, -1, -1, 1, -1, -1, 87, 88, 6,
1185 -1, 8, 9, 10, 11, 12, 13, 14, 15, 16,
1186 17, 18, 19, 20, 21, 22, 23, 24, 25, -1,
1187 -1, -1, 29, 30, 31, 32, 33, -1, 35, -1,
1188 37, -1, 39, 40, 41, 42, 43, 44, 45, 46,
1189 -1, 48, -1, -1, -1, 52, 53, 54, 55, 56,
1190 57, 58, 59, -1, -1, -1, -1, -1, -1, -1,
1191 -1, -1, -1, -1, -1, 72, -1, -1, -1, -1,
1192 -1, -1, -1, -1, -1, -1, -1, 1, -1, -1,
1193 87, 88, 6, -1, 8, 9, 10, 11, 12, 13,
1194 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
1195 24, 25, -1, -1, -1, 29, 30, 31, 32, 33,
1196 -1, 35, -1, 37, -1, 39, 40, 41, 42, 43,
1197 44, 45, 46, -1, 48, -1, -1, -1, 52, 53,
1198 54, 55, 56, 57, 58, 59, -1, -1, -1, -1,
1199 -1, -1, -1, -1, -1, -1, -1, -1, 72, -1,
1200 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1201 1, -1, -1, 87, 88, 6, -1, 8, 9, 10,
1202 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
1203 21, 22, 23, 24, 25, -1, -1, -1, 29, 30,
1204 31, 32, 33, -1, 35, -1, 37, -1, 39, 40,
1205 41, 42, 43, -1, 45, 46, -1, 48, 49, -1,
1206 -1, 52, 53, 54, 55, 56, 57, 58, 59, -1,
1207 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1208 -1, 72, -1, -1, -1, -1, -1, -1, -1, -1,
1209 -1, -1, -1, 1, -1, -1, 87, 88, 6, -1,
1210 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
1211 18, 19, 20, 21, 22, 23, 24, 25, -1, -1,
1212 -1, 29, 30, 31, 32, 33, 34, 35, -1, 37,
1213 -1, 39, 40, 41, 42, 43, -1, 45, 46, -1,
1214 48, -1, -1, -1, 52, 53, 54, 55, 56, 57,
1215 58, 59, -1, -1, -1, -1, -1, -1, -1, -1,
1216 -1, -1, -1, -1, 72, -1, -1, -1, -1, -1,
1217 -1, -1, -1, -1, -1, -1, 1, -1, -1, 87,
1218 88, 6, -1, 8, 9, 10, 11, 12, 13, 14,
1219 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
1220 25, -1, -1, 28, 29, 30, 31, 32, 33, -1,
1221 35, -1, 37, -1, 39, 40, 41, 42, 43, -1,
1222 45, 46, -1, 48, -1, -1, -1, 52, 53, 54,
1223 55, 56, 57, 58, 59, -1, -1, -1, -1, -1,
1224 -1, -1, -1, -1, -1, -1, -1, 72, -1, -1,
1225 -1, -1, -1, -1, -1, -1, -1, -1, -1, 1,
1226 -1, -1, 87, 88, 6, -1, 8, 9, 10, 11,
1227 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
1228 22, 23, 24, 25, -1, -1, -1, 29, 30, 31,
1229 32, 33, -1, 35, -1, 37, -1, 39, 40, 41,
1230 42, 43, -1, 45, 46, -1, 48, -1, -1, -1,
1231 52, 53, 54, 55, 56, 57, 58, 59, -1, -1,
1232 1, -1, -1, -1, -1, 6, -1, -1, -1, -1,
1233 72, 12, 13, 14, 15, 16, 17, 18, 19, 20,
1234 21, 22, 23, 24, 25, 87, 88, -1, 29, 30,
1235 31, 32, 33, -1, 35, -1, 37, -1, 39, 40,
1236 41, 42, 43, -1, 45, 46, -1, 48, -1, -1,
1237 -1, 52, 53, 54, 55, 56, 57, 58, 59, -1,
1238 -1, -1, -1, -1, -1, -1, 70, -1, -1, -1,
1239 -1, 72, 76, 77, 78, 79, 80, 81, 82, 83,
1240 84, 85, 86, 87, 88, 70, 90, 91, 92, -1,
1241 -1, 76, 77, 78, 79, 80, 81, 82, 83, 84,
1242 85, 86, 87, 88, 71, 90, 91, 92, -1, 76,
1243 77, 78, 79, 80, 81, 82, 83, 84, 85, 86,
1244 87, 88, -1, 90, 91, 92, 76, 77, 78, 79,
1245 80, 81, 82, 83, 84, 85, 86, 87, 88, -1,
1246 90, 91, 92, -1, -1, -1, 96, 76, 77, 78,
1247 79, 80, 81, 82, 83, 84, 85, 86, 87, 88,
1248 -1, 90, 91, 92, -1, -1, -1, 96
1251 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
1252 symbol of state STATE-NUM. */
1253 static const unsigned char yystos[] =
1255 0, 1, 6, 8, 9, 10, 11, 12, 13, 14,
1256 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
1257 25, 29, 30, 31, 32, 33, 35, 37, 39, 40,
1258 41, 42, 43, 45, 46, 48, 52, 53, 54, 55,
1259 56, 57, 58, 59, 72, 87, 88, 98, 100, 101,
1260 102, 103, 104, 105, 106, 107, 108, 111, 112, 113,
1261 114, 115, 116, 119, 122, 123, 124, 125, 126, 127,
1262 128, 129, 130, 145, 146, 149, 154, 155, 156, 157,
1263 158, 159, 161, 162, 164, 166, 169, 170, 171, 172,
1264 173, 176, 177, 178, 179, 127, 3, 4, 7, 8,
1265 9, 50, 51, 62, 66, 69, 73, 77, 81, 82,
1266 87, 88, 93, 94, 95, 131, 132, 136, 137, 142,
1267 143, 144, 146, 148, 146, 56, 127, 127, 131, 146,
1268 146, 4, 82, 163, 163, 146, 131, 131, 146, 168,
1269 146, 56, 146, 168, 168, 163, 146, 146, 147, 146,
1270 146, 146, 146, 131, 131, 131, 39, 146, 131, 146,
1271 0, 38, 99, 101, 102, 127, 36, 65, 67, 131,
1272 133, 138, 158, 160, 167, 178, 127, 127, 69, 160,
1273 131, 135, 134, 146, 159, 136, 146, 131, 131, 146,
1274 131, 131, 131, 131, 131, 131, 71, 76, 77, 78,
1275 79, 80, 81, 82, 83, 84, 85, 86, 87, 88,
1276 90, 91, 92, 72, 61, 69, 95, 65, 109, 127,
1277 127, 127, 127, 127, 127, 165, 168, 127, 127, 71,
1278 131, 127, 133, 146, 158, 178, 127, 59, 127, 127,
1279 127, 120, 121, 146, 127, 127, 127, 127, 127, 146,
1280 158, 178, 127, 127, 133, 133, 133, 139, 140, 141,
1281 71, 127, 131, 127, 70, 71, 96, 63, 64, 131,
1282 131, 131, 131, 131, 131, 131, 131, 131, 131, 131,
1283 131, 131, 131, 131, 131, 132, 137, 146, 146, 131,
1284 131, 131, 59, 110, 100, 100, 100, 127, 100, 100,
1285 146, 127, 127, 158, 178, 13, 48, 146, 159, 175,
1286 100, 100, 71, 127, 59, 117, 118, 146, 170, 100,
1287 158, 178, 127, 127, 68, 71, 133, 70, 71, 63,
1288 70, 96, 175, 127, 27, 150, 151, 152, 26, 153,
1289 153, 100, 34, 34, 60, 174, 44, 44, 121, 131,
1290 47, 118, 127, 49, 141, 64, 70, 131, 153, 152,
1291 127, 28, 28, 34, 127, 127, 146, 127, 127, 127,
1292 127, 127, 127, 28, 100, 127, 127, 127, 100, 127
1295 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
1296 # define YYSIZE_T __SIZE_TYPE__
1297 #endif
1298 #if ! defined (YYSIZE_T) && defined (size_t)
1299 # define YYSIZE_T size_t
1300 #endif
1301 #if ! defined (YYSIZE_T)
1302 # if defined (__STDC__) || defined (__cplusplus)
1303 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
1304 # define YYSIZE_T size_t
1305 # endif
1306 #endif
1307 #if ! defined (YYSIZE_T)
1308 # define YYSIZE_T unsigned int
1309 #endif
1311 #define yyerrok (yyerrstatus = 0)
1312 #define yyclearin (yychar = YYEMPTY)
1313 #define YYEMPTY (-2)
1314 #define YYEOF 0
1316 #define YYACCEPT goto yyacceptlab
1317 #define YYABORT goto yyabortlab
1318 #define YYERROR goto yyerrlab1
1320 /* Like YYERROR except do call yyerror. This remains here temporarily
1321 to ease the transition to the new meaning of YYERROR, for GCC.
1322 Once GCC version 2 has supplanted version 1, this can go. */
1324 #define YYFAIL goto yyerrlab
1326 #define YYRECOVERING() (!!yyerrstatus)
1328 #define YYBACKUP(Token, Value) \
1329 do \
1330 if (yychar == YYEMPTY && yylen == 1) \
1332 yychar = (Token); \
1333 yylval = (Value); \
1334 yytoken = YYTRANSLATE (yychar); \
1335 YYPOPSTACK; \
1336 goto yybackup; \
1338 else \
1340 yyerror ("syntax error: cannot back up");\
1341 YYERROR; \
1343 while (0)
1345 #define YYTERROR 1
1346 #define YYERRCODE 256
1348 /* YYLLOC_DEFAULT -- Compute the default location (before the actions
1349 are run). */
1351 #ifndef YYLLOC_DEFAULT
1352 # define YYLLOC_DEFAULT(Current, Rhs, N) \
1353 Current.first_line = Rhs[1].first_line; \
1354 Current.first_column = Rhs[1].first_column; \
1355 Current.last_line = Rhs[N].last_line; \
1356 Current.last_column = Rhs[N].last_column;
1357 #endif
1359 /* YYLEX -- calling `yylex' with the right arguments. */
1361 #ifdef YYLEX_PARAM
1362 # define YYLEX yylex (YYLEX_PARAM)
1363 #else
1364 # define YYLEX yylex ()
1365 #endif
1367 /* Enable debugging if requested. */
1368 #if YYDEBUG
1370 # ifndef YYFPRINTF
1371 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1372 # define YYFPRINTF fprintf
1373 # endif
1375 # define YYDPRINTF(Args) \
1376 do { \
1377 if (yydebug) \
1378 YYFPRINTF Args; \
1379 } while (0)
1381 # define YYDSYMPRINT(Args) \
1382 do { \
1383 if (yydebug) \
1384 yysymprint Args; \
1385 } while (0)
1387 # define YYDSYMPRINTF(Title, Token, Value, Location) \
1388 do { \
1389 if (yydebug) \
1391 YYFPRINTF (stderr, "%s ", Title); \
1392 yysymprint (stderr, \
1393 Token, Value, Location); \
1394 YYFPRINTF (stderr, "\n"); \
1396 } while (0)
1398 /*------------------------------------------------------------------.
1399 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1400 | TOP (cinluded). |
1401 `------------------------------------------------------------------*/
1403 #if defined (__STDC__) || defined (__cplusplus)
1404 static void
1405 yy_stack_print (short *bottom, short *top)
1406 #else
1407 static void
1408 yy_stack_print (bottom, top)
1409 short *bottom;
1410 short *top;
1411 #endif
1413 YYFPRINTF (stderr, "Stack now");
1414 for (/* Nothing. */; bottom <= top; ++bottom)
1415 YYFPRINTF (stderr, " %d", *bottom);
1416 YYFPRINTF (stderr, "\n");
1419 # define YY_STACK_PRINT(Bottom, Top) \
1420 do { \
1421 if (yydebug) \
1422 yy_stack_print ((Bottom), (Top)); \
1423 } while (0)
1426 /*------------------------------------------------.
1427 | Report that the YYRULE is going to be reduced. |
1428 `------------------------------------------------*/
1430 #if defined (__STDC__) || defined (__cplusplus)
1431 static void
1432 yy_reduce_print (int yyrule)
1433 #else
1434 static void
1435 yy_reduce_print (yyrule)
1436 int yyrule;
1437 #endif
1439 int yyi;
1440 unsigned int yylineno = yyrline[yyrule];
1441 YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ",
1442 yyrule - 1, yylineno);
1443 /* Print the symbols being reduced, and their result. */
1444 for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
1445 YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]);
1446 YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]);
1449 # define YY_REDUCE_PRINT(Rule) \
1450 do { \
1451 if (yydebug) \
1452 yy_reduce_print (Rule); \
1453 } while (0)
1455 /* Nonzero means print parse trace. It is left uninitialized so that
1456 multiple parsers can coexist. */
1457 int yydebug;
1458 #else /* !YYDEBUG */
1459 # define YYDPRINTF(Args)
1460 # define YYDSYMPRINT(Args)
1461 # define YYDSYMPRINTF(Title, Token, Value, Location)
1462 # define YY_STACK_PRINT(Bottom, Top)
1463 # define YY_REDUCE_PRINT(Rule)
1464 #endif /* !YYDEBUG */
1467 /* YYINITDEPTH -- initial size of the parser's stacks. */
1468 #ifndef YYINITDEPTH
1469 # define YYINITDEPTH 200
1470 #endif
1472 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1473 if the built-in stack extension method is used).
1475 Do not make this value too large; the results are undefined if
1476 SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
1477 evaluated with infinite-precision integer arithmetic. */
1479 #if YYMAXDEPTH == 0
1480 # undef YYMAXDEPTH
1481 #endif
1483 #ifndef YYMAXDEPTH
1484 # define YYMAXDEPTH 10000
1485 #endif
1489 #if YYERROR_VERBOSE
1491 # ifndef yystrlen
1492 # if defined (__GLIBC__) && defined (_STRING_H)
1493 # define yystrlen strlen
1494 # else
1495 /* Return the length of YYSTR. */
1496 static YYSIZE_T
1497 # if defined (__STDC__) || defined (__cplusplus)
1498 yystrlen (const char *yystr)
1499 # else
1500 yystrlen (yystr)
1501 const char *yystr;
1502 # endif
1504 register const char *yys = yystr;
1506 while (*yys++ != '\0')
1507 continue;
1509 return yys - yystr - 1;
1511 # endif
1512 # endif
1514 # ifndef yystpcpy
1515 # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
1516 # define yystpcpy stpcpy
1517 # else
1518 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1519 YYDEST. */
1520 static char *
1521 # if defined (__STDC__) || defined (__cplusplus)
1522 yystpcpy (char *yydest, const char *yysrc)
1523 # else
1524 yystpcpy (yydest, yysrc)
1525 char *yydest;
1526 const char *yysrc;
1527 # endif
1529 register char *yyd = yydest;
1530 register const char *yys = yysrc;
1532 while ((*yyd++ = *yys++) != '\0')
1533 continue;
1535 return yyd - 1;
1537 # endif
1538 # endif
1540 #endif /* !YYERROR_VERBOSE */
1544 #if YYDEBUG
1545 /*--------------------------------.
1546 | Print this symbol on YYOUTPUT. |
1547 `--------------------------------*/
1549 #if defined (__STDC__) || defined (__cplusplus)
1550 static void
1551 yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp)
1552 #else
1553 static void
1554 yysymprint (yyoutput, yytype, yyvaluep, yylocationp)
1555 FILE *yyoutput;
1556 int yytype;
1557 YYSTYPE *yyvaluep;
1558 YYLTYPE *yylocationp;
1559 #endif
1561 /* Pacify ``unused variable'' warnings. */
1562 (void) yyvaluep;
1563 (void) yylocationp;
1565 if (yytype < YYNTOKENS)
1567 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
1568 # ifdef YYPRINT
1569 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
1570 # endif
1572 else
1573 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
1575 switch (yytype)
1577 default:
1578 break;
1580 YYFPRINTF (yyoutput, ")");
1583 #endif /* ! YYDEBUG */
1584 /*-----------------------------------------------.
1585 | Release the memory associated to this symbol. |
1586 `-----------------------------------------------*/
1588 #if defined (__STDC__) || defined (__cplusplus)
1589 static void
1590 yydestruct (int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp)
1591 #else
1592 static void
1593 yydestruct (yytype, yyvaluep, yylocationp)
1594 int yytype;
1595 YYSTYPE *yyvaluep;
1596 YYLTYPE *yylocationp;
1597 #endif
1599 /* Pacify ``unused variable'' warnings. */
1600 (void) yyvaluep;
1601 (void) yylocationp;
1603 switch (yytype)
1606 default:
1607 break;
1612 /* Prevent warnings from -Wmissing-prototypes. */
1614 #ifdef YYPARSE_PARAM
1615 # if defined (__STDC__) || defined (__cplusplus)
1616 int yyparse (void *YYPARSE_PARAM);
1617 # else
1618 int yyparse ();
1619 # endif
1620 #else /* ! YYPARSE_PARAM */
1621 #if defined (__STDC__) || defined (__cplusplus)
1622 int yyparse (void);
1623 #else
1624 int yyparse ();
1625 #endif
1626 #endif /* ! YYPARSE_PARAM */
1630 /* The lookahead symbol. */
1631 int yychar;
1633 /* The semantic value of the lookahead symbol. */
1634 YYSTYPE yylval;
1636 /* Number of syntax errors so far. */
1637 int yynerrs;
1638 /* Location data for the lookahead symbol. */
1639 YYLTYPE yylloc;
1643 /*----------.
1644 | yyparse. |
1645 `----------*/
1647 #ifdef YYPARSE_PARAM
1648 # if defined (__STDC__) || defined (__cplusplus)
1649 int yyparse (void *YYPARSE_PARAM)
1650 # else
1651 int yyparse (YYPARSE_PARAM)
1652 void *YYPARSE_PARAM;
1653 # endif
1654 #else /* ! YYPARSE_PARAM */
1655 #if defined (__STDC__) || defined (__cplusplus)
1657 yyparse (void)
1658 #else
1660 yyparse ()
1662 #endif
1663 #endif
1666 register int yystate;
1667 register int yyn;
1668 int yyresult;
1669 /* Number of tokens to shift before error messages enabled. */
1670 int yyerrstatus;
1671 /* Lookahead token as an internal (translated) token number. */
1672 int yytoken = 0;
1674 /* Three stacks and their tools:
1675 `yyss': related to states,
1676 `yyvs': related to semantic values,
1677 `yyls': related to locations.
1679 Refer to the stacks thru separate pointers, to allow yyoverflow
1680 to reallocate them elsewhere. */
1682 /* The state stack. */
1683 short yyssa[YYINITDEPTH];
1684 short *yyss = yyssa;
1685 register short *yyssp;
1687 /* The semantic value stack. */
1688 YYSTYPE yyvsa[YYINITDEPTH];
1689 YYSTYPE *yyvs = yyvsa;
1690 register YYSTYPE *yyvsp;
1692 /* The location stack. */
1693 YYLTYPE yylsa[YYINITDEPTH];
1694 YYLTYPE *yyls = yylsa;
1695 YYLTYPE *yylsp;
1696 YYLTYPE *yylerrsp;
1698 #define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
1700 YYSIZE_T yystacksize = YYINITDEPTH;
1702 /* The variables used to return semantic value and location from the
1703 action routines. */
1704 YYSTYPE yyval;
1705 YYLTYPE yyloc;
1707 /* When reducing, the number of symbols on the RHS of the reduced
1708 rule. */
1709 int yylen;
1711 YYDPRINTF ((stderr, "Starting parse\n"));
1713 yystate = 0;
1714 yyerrstatus = 0;
1715 yynerrs = 0;
1716 yychar = YYEMPTY; /* Cause a token to be read. */
1718 /* Initialize stack pointers.
1719 Waste one element of value and location stack
1720 so that they stay on the same level as the state stack.
1721 The wasted elements are never initialized. */
1723 yyssp = yyss;
1724 yyvsp = yyvs;
1725 yylsp = yyls;
1726 goto yysetstate;
1728 /*------------------------------------------------------------.
1729 | yynewstate -- Push a new state, which is found in yystate. |
1730 `------------------------------------------------------------*/
1731 yynewstate:
1732 /* In all cases, when you get here, the value and location stacks
1733 have just been pushed. so pushing a state here evens the stacks.
1735 yyssp++;
1737 yysetstate:
1738 *yyssp = yystate;
1740 if (yyss + yystacksize - 1 <= yyssp)
1742 /* Get the current used size of the three stacks, in elements. */
1743 YYSIZE_T yysize = yyssp - yyss + 1;
1745 #ifdef yyoverflow
1747 /* Give user a chance to reallocate the stack. Use copies of
1748 these so that the &'s don't force the real ones into
1749 memory. */
1750 YYSTYPE *yyvs1 = yyvs;
1751 short *yyss1 = yyss;
1752 YYLTYPE *yyls1 = yyls;
1754 /* Each stack pointer address is followed by the size of the
1755 data in use in that stack, in bytes. This used to be a
1756 conditional around just the two extra args, but that might
1757 be undefined if yyoverflow is a macro. */
1758 yyoverflow ("parser stack overflow",
1759 &yyss1, yysize * sizeof (*yyssp),
1760 &yyvs1, yysize * sizeof (*yyvsp),
1761 &yyls1, yysize * sizeof (*yylsp),
1762 &yystacksize);
1763 yyls = yyls1;
1764 yyss = yyss1;
1765 yyvs = yyvs1;
1767 #else /* no yyoverflow */
1768 # ifndef YYSTACK_RELOCATE
1769 goto yyoverflowlab;
1770 # else
1771 /* Extend the stack our own way. */
1772 if (YYMAXDEPTH <= yystacksize)
1773 goto yyoverflowlab;
1774 yystacksize *= 2;
1775 if (YYMAXDEPTH < yystacksize)
1776 yystacksize = YYMAXDEPTH;
1779 short *yyss1 = yyss;
1780 union yyalloc *yyptr =
1781 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1782 if (! yyptr)
1783 goto yyoverflowlab;
1784 YYSTACK_RELOCATE (yyss);
1785 YYSTACK_RELOCATE (yyvs);
1786 YYSTACK_RELOCATE (yyls);
1787 # undef YYSTACK_RELOCATE
1788 if (yyss1 != yyssa)
1789 YYSTACK_FREE (yyss1);
1791 # endif
1792 #endif /* no yyoverflow */
1794 yyssp = yyss + yysize - 1;
1795 yyvsp = yyvs + yysize - 1;
1796 yylsp = yyls + yysize - 1;
1798 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1799 (unsigned long int) yystacksize));
1801 if (yyss + yystacksize - 1 <= yyssp)
1802 YYABORT;
1805 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1807 goto yybackup;
1809 /*-----------.
1810 | yybackup. |
1811 `-----------*/
1812 yybackup:
1814 /* Do appropriate processing given the current state. */
1815 /* Read a lookahead token if we need one and don't already have one. */
1816 /* yyresume: */
1818 /* First try to decide what to do without reference to lookahead token. */
1820 yyn = yypact[yystate];
1821 if (yyn == YYPACT_NINF)
1822 goto yydefault;
1824 /* Not known => get a lookahead token if don't already have one. */
1826 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1827 if (yychar == YYEMPTY)
1829 YYDPRINTF ((stderr, "Reading a token: "));
1830 yychar = YYLEX;
1833 if (yychar <= YYEOF)
1835 yychar = yytoken = YYEOF;
1836 YYDPRINTF ((stderr, "Now at end of input.\n"));
1838 else
1840 yytoken = YYTRANSLATE (yychar);
1841 YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc);
1844 /* If the proper action on seeing token YYTOKEN is to reduce or to
1845 detect an error, take that action. */
1846 yyn += yytoken;
1847 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1848 goto yydefault;
1849 yyn = yytable[yyn];
1850 if (yyn <= 0)
1852 if (yyn == 0 || yyn == YYTABLE_NINF)
1853 goto yyerrlab;
1854 yyn = -yyn;
1855 goto yyreduce;
1858 if (yyn == YYFINAL)
1859 YYACCEPT;
1861 /* Shift the lookahead token. */
1862 YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken]));
1864 /* Discard the token being shifted unless it is eof. */
1865 if (yychar != YYEOF)
1866 yychar = YYEMPTY;
1868 *++yyvsp = yylval;
1869 *++yylsp = yylloc;
1871 /* Count tokens shifted since error; after three, turn off error
1872 status. */
1873 if (yyerrstatus)
1874 yyerrstatus--;
1876 yystate = yyn;
1877 goto yynewstate;
1880 /*-----------------------------------------------------------.
1881 | yydefault -- do the default action for the current state. |
1882 `-----------------------------------------------------------*/
1883 yydefault:
1884 yyn = yydefact[yystate];
1885 if (yyn == 0)
1886 goto yyerrlab;
1887 goto yyreduce;
1890 /*-----------------------------.
1891 | yyreduce -- Do a reduction. |
1892 `-----------------------------*/
1893 yyreduce:
1894 /* yyn is the number of a rule to reduce with. */
1895 yylen = yyr2[yyn];
1897 /* If YYLEN is nonzero, implement the default value of the action:
1898 `$$ = $1'.
1900 Otherwise, the following line sets YYVAL to garbage.
1901 This behavior is undocumented and Bison
1902 users should not rely upon it. Assigning to YYVAL
1903 unconditionally makes the parser a bit smaller, and it avoids a
1904 GCC warning that YYVAL may be used uninitialized. */
1905 yyval = yyvsp[1-yylen];
1907 /* Default location. */
1908 YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
1909 YY_REDUCE_PRINT (yyn);
1910 switch (yyn)
1912 case 2:
1913 #line 123 "parser.y"
1914 { root_node = astnode_create_list(yyvsp[-1].node); }
1915 break;
1917 case 3:
1918 #line 127 "parser.y"
1919 { ; }
1920 break;
1922 case 5:
1923 #line 132 "parser.y"
1924 { yyval.node = yyvsp[0].node; }
1925 break;
1927 case 6:
1928 #line 133 "parser.y"
1930 if (yyvsp[-1].node != NULL) { yyval.node = yyvsp[-1].node; astnode_add_sibling(yyval.node, yyvsp[0].node); }
1931 else { yyval.node = yyvsp[0].node; }
1933 break;
1935 case 7:
1936 #line 140 "parser.y"
1937 { yyval.node = yyvsp[-1].node; astnode_add_sibling(yyval.node, yyvsp[0].node); }
1938 break;
1940 case 8:
1941 #line 141 "parser.y"
1942 { yyval.node = yyvsp[0].node; }
1943 break;
1945 case 9:
1946 #line 145 "parser.y"
1947 { yyval.node = yyvsp[0].node; }
1948 break;
1950 case 10:
1951 #line 146 "parser.y"
1952 { yyval.node = yyvsp[0].node; }
1953 break;
1955 case 11:
1956 #line 147 "parser.y"
1957 { yyval.node = yyvsp[0].node; }
1958 break;
1960 case 12:
1961 #line 148 "parser.y"
1962 { yyval.node = yyvsp[0].node; }
1963 break;
1965 case 13:
1966 #line 149 "parser.y"
1967 { yyval.node = yyvsp[0].node; }
1968 break;
1970 case 14:
1971 #line 150 "parser.y"
1972 { yyval.node = yyvsp[0].node; }
1973 break;
1975 case 15:
1976 #line 151 "parser.y"
1977 { yyval.node = yyvsp[0].node; }
1978 break;
1980 case 16:
1981 #line 152 "parser.y"
1982 { yyval.node = yyvsp[0].node; }
1983 break;
1985 case 17:
1986 #line 153 "parser.y"
1987 { yyval.node = yyvsp[0].node; }
1988 break;
1990 case 18:
1991 #line 154 "parser.y"
1992 { yyval.node = yyvsp[0].node; }
1993 break;
1995 case 19:
1996 #line 155 "parser.y"
1997 { yyval.node = yyvsp[0].node; }
1998 break;
2000 case 20:
2001 #line 156 "parser.y"
2002 { yyval.node = yyvsp[0].node; }
2003 break;
2005 case 21:
2006 #line 157 "parser.y"
2007 { yyval.node = yyvsp[0].node; }
2008 break;
2010 case 22:
2011 #line 158 "parser.y"
2012 { yyval.node = yyvsp[0].node; }
2013 break;
2015 case 23:
2016 #line 159 "parser.y"
2017 { yyval.node = yyvsp[0].node; }
2018 break;
2020 case 24:
2021 #line 160 "parser.y"
2022 { yyval.node = yyvsp[0].node; }
2023 break;
2025 case 25:
2026 #line 161 "parser.y"
2027 { yyval.node = yyvsp[0].node; }
2028 break;
2030 case 26:
2031 #line 162 "parser.y"
2032 { yyval.node = yyvsp[0].node; }
2033 break;
2035 case 27:
2036 #line 163 "parser.y"
2037 { yyval.node = yyvsp[0].node; }
2038 break;
2040 case 28:
2041 #line 164 "parser.y"
2042 { yyval.node = yyvsp[0].node; }
2043 break;
2045 case 29:
2046 #line 165 "parser.y"
2047 { yyval.node = yyvsp[0].node; }
2048 break;
2050 case 30:
2051 #line 166 "parser.y"
2052 { yyval.node = yyvsp[0].node; }
2053 break;
2055 case 31:
2056 #line 167 "parser.y"
2057 { yyval.node = yyvsp[0].node; }
2058 break;
2060 case 32:
2061 #line 168 "parser.y"
2062 { yyval.node = yyvsp[0].node; }
2063 break;
2065 case 33:
2066 #line 169 "parser.y"
2067 { yyval.node = yyvsp[0].node; }
2068 break;
2070 case 34:
2071 #line 170 "parser.y"
2072 { yyval.node = yyvsp[0].node; }
2073 break;
2075 case 35:
2076 #line 171 "parser.y"
2077 { yyval.node = yyvsp[0].node; }
2078 break;
2080 case 36:
2081 #line 172 "parser.y"
2082 { yyval.node = yyvsp[0].node; }
2083 break;
2085 case 37:
2086 #line 173 "parser.y"
2087 { yyval.node = yyvsp[0].node; }
2088 break;
2090 case 38:
2091 #line 174 "parser.y"
2092 { yyval.node = yyvsp[0].node; }
2093 break;
2095 case 39:
2096 #line 175 "parser.y"
2097 { yyval.node = yyvsp[0].node; }
2098 break;
2100 case 40:
2101 #line 176 "parser.y"
2102 { yyval.node = yyvsp[0].node; }
2103 break;
2105 case 41:
2106 #line 177 "parser.y"
2107 { yyval.node = NULL; }
2108 break;
2110 case 42:
2111 #line 181 "parser.y"
2112 { yyval.node = astnode_create_org(yyvsp[-1].node, yyloc); }
2113 break;
2115 case 43:
2116 #line 185 "parser.y"
2117 { yyval.node = astnode_create_align(yyvsp[-2].node, yyvsp[-1].node, yyloc); }
2118 break;
2120 case 44:
2121 #line 189 "parser.y"
2122 { yyval.node = astnode_create_warning(yyvsp[-1].node, yyloc); }
2123 break;
2125 case 45:
2126 #line 193 "parser.y"
2127 { yyval.node = astnode_create_error(yyvsp[-1].node, yyloc); }
2128 break;
2130 case 46:
2131 #line 197 "parser.y"
2132 { yyval.node = astnode_create_message(yyvsp[-1].node, yyloc); }
2133 break;
2135 case 47:
2136 #line 201 "parser.y"
2137 { yyval.node = astnode_create_label(yyvsp[-3].node->label, yyvsp[-2].node, yyvsp[-1].node, yyloc); }
2138 break;
2140 case 48:
2141 #line 205 "parser.y"
2142 { yyval.node = yyvsp[0].node; }
2143 break;
2145 case 49:
2146 #line 206 "parser.y"
2147 { yyval.node = NULL; }
2148 break;
2150 case 50:
2151 #line 210 "parser.y"
2152 { yyval.node = yyvsp[0].node; }
2153 break;
2155 case 51:
2156 #line 211 "parser.y"
2157 { yyval.node = NULL; }
2158 break;
2160 case 52:
2161 #line 215 "parser.y"
2162 { yyval.node = astnode_create_while(yyvsp[-4].node, yyvsp[-2].node, yyloc); }
2163 break;
2165 case 53:
2166 #line 219 "parser.y"
2167 { yyval.node = astnode_create_rept(yyvsp[-4].node, yyvsp[-2].node, yyloc); }
2168 break;
2170 case 54:
2171 #line 223 "parser.y"
2172 { yyval.node = astnode_create_proc(yyvsp[-4].node, yyvsp[-2].node, yyloc); }
2173 break;
2175 case 55:
2176 #line 227 "parser.y"
2177 { yyval.node = astnode_create_struc_decl(yyvsp[-4].node, yyvsp[-2].node, yyloc); }
2178 break;
2180 case 56:
2181 #line 231 "parser.y"
2182 { yyval.node = astnode_create_union_decl(yyvsp[-4].node, yyvsp[-2].node, yyloc); }
2183 break;
2185 case 57:
2186 #line 235 "parser.y"
2187 { yyval.node = astnode_create_enum_decl(yyvsp[-4].node, yyvsp[-2].node, yyloc); }
2188 break;
2190 case 58:
2191 #line 239 "parser.y"
2192 { yyval.node = yyvsp[0].node; }
2193 break;
2195 case 59:
2196 #line 240 "parser.y"
2197 { yyval.node = yyvsp[-1].node; astnode_add_sibling(yyval.node, yyvsp[0].node); }
2198 break;
2200 case 60:
2201 #line 244 "parser.y"
2202 { yyval.node = yyvsp[0].node; }
2203 break;
2205 case 61:
2206 #line 245 "parser.y"
2207 { yyval.node = yyvsp[-1].node; }
2208 break;
2210 case 62:
2211 #line 249 "parser.y"
2212 { yyval.node = astnode_create_record_decl(yyvsp[-2].node, yyvsp[-1].node, yyloc); }
2213 break;
2215 case 63:
2216 #line 253 "parser.y"
2217 { yyval.node = yyvsp[0].node; }
2218 break;
2220 case 64:
2221 #line 254 "parser.y"
2222 { yyval.node = yyvsp[-2].node; astnode_add_sibling(yyval.node, yyvsp[0].node); }
2223 break;
2225 case 65:
2226 #line 258 "parser.y"
2227 { yyval.node = astnode_create_bitfield_decl(yyvsp[-2].node, yyvsp[0].node, yyloc); }
2228 break;
2230 case 66:
2231 #line 262 "parser.y"
2232 { yyval.node = astnode_create_charmap(yyvsp[-1].node, yyloc); }
2233 break;
2235 case 67:
2236 #line 266 "parser.y"
2237 { yyval.node = astnode_create_dataseg(0, yyloc); }
2238 break;
2240 case 68:
2241 #line 267 "parser.y"
2242 { yyval.node = astnode_create_dataseg(ZEROPAGE_FLAG, yyloc); }
2243 break;
2245 case 69:
2246 #line 270 "parser.y"
2247 { yyval.node = astnode_create_codeseg(yyloc); }
2248 break;
2250 case 70:
2251 #line 274 "parser.y"
2252 { yyval.node = NULL; }
2253 break;
2255 case 71:
2256 #line 278 "parser.y"
2257 { yyval.node = yyvsp[0].node; }
2258 break;
2260 case 72:
2261 #line 282 "parser.y"
2262 { ; }
2263 break;
2265 case 73:
2266 #line 283 "parser.y"
2267 { ; }
2268 break;
2270 case 74:
2271 #line 287 "parser.y"
2272 { ; }
2273 break;
2275 case 75:
2276 #line 291 "parser.y"
2277 { yyval.node = yyvsp[-1].node; }
2278 break;
2280 case 76:
2281 #line 295 "parser.y"
2282 { yyval.node = astnode_create_instruction(yyvsp[0].mnemonic, IMPLIED_MODE, NULL, yyloc); }
2283 break;
2285 case 77:
2286 #line 296 "parser.y"
2287 { yyval.node = astnode_create_instruction(yyvsp[-1].mnemonic, ACCUMULATOR_MODE, NULL, yyloc); }
2288 break;
2290 case 78:
2291 #line 297 "parser.y"
2292 { yyval.node = astnode_create_instruction(yyvsp[-2].mnemonic, IMMEDIATE_MODE, yyvsp[0].node, yyloc); }
2293 break;
2295 case 79:
2296 #line 298 "parser.y"
2297 { yyval.node = astnode_create_instruction(yyvsp[-1].mnemonic, ABSOLUTE_MODE, yyvsp[0].node, yyloc); }
2298 break;
2300 case 80:
2301 #line 299 "parser.y"
2302 { yyval.node = astnode_create_instruction(yyvsp[-3].mnemonic, ABSOLUTE_X_MODE, yyvsp[-2].node, yyloc); }
2303 break;
2305 case 81:
2306 #line 300 "parser.y"
2307 { yyval.node = astnode_create_instruction(yyvsp[-3].mnemonic, ABSOLUTE_Y_MODE, yyvsp[-2].node, yyloc); }
2308 break;
2310 case 82:
2311 #line 301 "parser.y"
2312 { yyval.node = astnode_create_instruction(yyvsp[-5].mnemonic, PREINDEXED_INDIRECT_MODE, yyvsp[-3].node, yyloc); }
2313 break;
2315 case 83:
2316 #line 302 "parser.y"
2317 { yyval.node = astnode_create_instruction(yyvsp[-5].mnemonic, POSTINDEXED_INDIRECT_MODE, yyvsp[-3].node, yyloc); }
2318 break;
2320 case 84:
2321 #line 303 "parser.y"
2322 { yyval.node = astnode_create_instruction(yyvsp[-3].mnemonic, INDIRECT_MODE, yyvsp[-1].node, yyloc); }
2323 break;
2325 case 85:
2326 #line 307 "parser.y"
2327 { yyval.node = yyvsp[0].node; }
2328 break;
2330 case 86:
2331 #line 308 "parser.y"
2332 { yyval.node = astnode_create_sizeof(yyvsp[0].node, yyloc); }
2333 break;
2335 case 87:
2336 #line 309 "parser.y"
2337 { yyval.node = yyvsp[0].node; }
2338 break;
2340 case 88:
2341 #line 310 "parser.y"
2342 { yyval.node = yyvsp[0].node; }
2343 break;
2345 case 89:
2346 #line 311 "parser.y"
2347 { yyval.node = yyvsp[0].node; }
2348 break;
2350 case 90:
2351 #line 312 "parser.y"
2352 { yyval.node = yyvsp[0].node; }
2353 break;
2355 case 91:
2356 #line 313 "parser.y"
2357 { yyval.node = astnode_create_pc(yyloc); }
2358 break;
2360 case 92:
2361 #line 314 "parser.y"
2362 { yyval.node = yyvsp[0].node; }
2363 break;
2365 case 93:
2366 #line 315 "parser.y"
2367 { yyval.node = yyvsp[0].node; }
2368 break;
2370 case 94:
2371 #line 316 "parser.y"
2372 { yyval.node = yyvsp[-1].node; }
2373 break;
2375 case 95:
2376 #line 317 "parser.y"
2377 { yyval.node = astnode_create_forward_branch("+", yyloc); }
2378 break;
2380 case 96:
2381 #line 318 "parser.y"
2382 { yyval.node = astnode_create_backward_branch("-", yyloc); }
2383 break;
2385 case 97:
2386 #line 319 "parser.y"
2387 { yyval.node = astnode_create_forward_branch(yyvsp[0].ident, yyloc); }
2388 break;
2390 case 98:
2391 #line 320 "parser.y"
2392 { yyval.node = astnode_create_backward_branch(yyvsp[0].ident, yyloc); }
2393 break;
2395 case 99:
2396 #line 321 "parser.y"
2397 { yyval.node = astnode_create_mask(yyvsp[0].node, yyloc); }
2398 break;
2400 case 100:
2401 #line 325 "parser.y"
2402 { yyval.node = yyvsp[0].node; }
2403 break;
2405 case 101:
2406 #line 326 "parser.y"
2407 { yyval.node = astnode_create_index(yyvsp[-3].node, yyvsp[-1].node, yyloc); }
2408 break;
2410 case 102:
2411 #line 327 "parser.y"
2412 { yyval.node = astnode_create_index(yyvsp[-3].node, yyvsp[-1].node, yyloc); }
2413 break;
2415 case 103:
2416 #line 331 "parser.y"
2417 { yyval.node = yyvsp[0].node; }
2418 break;
2420 case 104:
2421 #line 332 "parser.y"
2422 { yyval.node = yyvsp[0].node; }
2423 break;
2425 case 105:
2426 #line 336 "parser.y"
2427 { yyval.node = yyvsp[0].node; }
2428 break;
2430 case 106:
2431 #line 337 "parser.y"
2432 { yyval.node = yyvsp[0].node; }
2433 break;
2435 case 107:
2436 #line 341 "parser.y"
2437 { yyval.node = yyvsp[0].node; }
2438 break;
2440 case 108:
2441 #line 342 "parser.y"
2442 { yyval.node = NULL; }
2443 break;
2445 case 109:
2446 #line 346 "parser.y"
2447 { yyval.node = astnode_create_scope(yyvsp[-2].node, yyvsp[0].node, yyloc); }
2448 break;
2450 case 110:
2451 #line 350 "parser.y"
2452 { yyval.node = astnode_create_dot(yyvsp[-2].node, yyvsp[0].node, yyloc); }
2453 break;
2455 case 111:
2456 #line 351 "parser.y"
2457 { yyval.node = astnode_create_dot(yyvsp[-2].node, yyvsp[0].node, yyloc); }
2458 break;
2460 case 112:
2461 #line 355 "parser.y"
2462 { yyval.node = astnode_create_struc(yyvsp[-1].node, yyloc); }
2463 break;
2465 case 113:
2466 #line 359 "parser.y"
2467 { yyval.node = yyvsp[0].node; }
2468 break;
2470 case 114:
2471 #line 360 "parser.y"
2472 { yyval.node = NULL; }
2473 break;
2475 case 115:
2476 #line 364 "parser.y"
2477 { yyval.node = yyvsp[0].node; }
2478 break;
2480 case 116:
2481 #line 365 "parser.y"
2482 { yyval.node = yyvsp[-2].node; astnode_add_sibling(yyval.node, yyvsp[0].node); }
2483 break;
2485 case 117:
2486 #line 369 "parser.y"
2487 { yyval.node = yyvsp[0].node; }
2488 break;
2490 case 118:
2491 #line 370 "parser.y"
2492 { yyval.node = astnode_create_null(yyloc); }
2493 break;
2495 case 119:
2496 #line 374 "parser.y"
2497 { yyval.node = astnode_create_local_id(yyvsp[0].ident, yyloc); }
2498 break;
2500 case 120:
2501 #line 378 "parser.y"
2502 { yyval.node = astnode_create_arithmetic(PLUS_OPERATOR, yyvsp[-2].node, yyvsp[0].node, yyloc); }
2503 break;
2505 case 121:
2506 #line 379 "parser.y"
2507 { yyval.node = astnode_create_arithmetic(MINUS_OPERATOR, yyvsp[-2].node, yyvsp[0].node, yyloc); }
2508 break;
2510 case 122:
2511 #line 380 "parser.y"
2512 { yyval.node = astnode_create_arithmetic(MUL_OPERATOR, yyvsp[-2].node, yyvsp[0].node, yyloc); }
2513 break;
2515 case 123:
2516 #line 381 "parser.y"
2517 { yyval.node = astnode_create_arithmetic(DIV_OPERATOR, yyvsp[-2].node, yyvsp[0].node, yyloc); }
2518 break;
2520 case 124:
2521 #line 382 "parser.y"
2522 { yyval.node = astnode_create_arithmetic(MOD_OPERATOR, yyvsp[-2].node, yyvsp[0].node, yyloc); }
2523 break;
2525 case 125:
2526 #line 383 "parser.y"
2527 { yyval.node = astnode_create_arithmetic(AND_OPERATOR, yyvsp[-2].node, yyvsp[0].node, yyloc); }
2528 break;
2530 case 126:
2531 #line 384 "parser.y"
2532 { yyval.node = astnode_create_arithmetic(OR_OPERATOR, yyvsp[-2].node, yyvsp[0].node, yyloc); }
2533 break;
2535 case 127:
2536 #line 385 "parser.y"
2537 { yyval.node = astnode_create_arithmetic(XOR_OPERATOR, yyvsp[-2].node, yyvsp[0].node, yyloc); }
2538 break;
2540 case 128:
2541 #line 386 "parser.y"
2542 { yyval.node = astnode_create_arithmetic(SHL_OPERATOR, yyvsp[-2].node, yyvsp[0].node, yyloc); }
2543 break;
2545 case 129:
2546 #line 387 "parser.y"
2547 { yyval.node = astnode_create_arithmetic(SHR_OPERATOR, yyvsp[-2].node, yyvsp[0].node, yyloc); }
2548 break;
2550 case 130:
2551 #line 388 "parser.y"
2552 { yyval.node = astnode_create_arithmetic(NEG_OPERATOR, yyvsp[0].node, NULL, yyloc); }
2553 break;
2555 case 131:
2556 #line 389 "parser.y"
2557 { yyval.node = astnode_create_arithmetic(NOT_OPERATOR, yyvsp[0].node, NULL, yyloc); }
2558 break;
2560 case 132:
2561 #line 390 "parser.y"
2562 { yyval.node = astnode_create_arithmetic(BANK_OPERATOR, yyvsp[0].node, NULL, yyloc); }
2563 break;
2565 case 133:
2566 #line 391 "parser.y"
2567 { yyval.node = astnode_create_arithmetic(LO_OPERATOR, yyvsp[0].node, NULL, yyloc); }
2568 break;
2570 case 134:
2571 #line 392 "parser.y"
2572 { yyval.node = astnode_create_arithmetic(HI_OPERATOR, yyvsp[0].node, NULL, yyloc); }
2573 break;
2575 case 135:
2576 #line 393 "parser.y"
2577 { yyval.node = astnode_create_arithmetic(UMINUS_OPERATOR, yyvsp[0].node, NULL, yyloc); }
2578 break;
2580 case 136:
2581 #line 397 "parser.y"
2582 { yyval.node = astnode_create_arithmetic(EQ_OPERATOR, yyvsp[-2].node, yyvsp[0].node, yyloc); }
2583 break;
2585 case 137:
2586 #line 398 "parser.y"
2587 { yyval.node = astnode_create_arithmetic(NE_OPERATOR, yyvsp[-2].node, yyvsp[0].node, yyloc); }
2588 break;
2590 case 138:
2591 #line 399 "parser.y"
2592 { yyval.node = astnode_create_arithmetic(GT_OPERATOR, yyvsp[-2].node, yyvsp[0].node, yyloc); }
2593 break;
2595 case 139:
2596 #line 400 "parser.y"
2597 { yyval.node = astnode_create_arithmetic(LT_OPERATOR, yyvsp[-2].node, yyvsp[0].node, yyloc); }
2598 break;
2600 case 140:
2601 #line 401 "parser.y"
2602 { yyval.node = astnode_create_arithmetic(GE_OPERATOR, yyvsp[-2].node, yyvsp[0].node, yyloc); }
2603 break;
2605 case 141:
2606 #line 402 "parser.y"
2607 { yyval.node = astnode_create_arithmetic(LE_OPERATOR, yyvsp[-2].node, yyvsp[0].node, yyloc); }
2608 break;
2610 case 142:
2611 #line 406 "parser.y"
2612 { yyval.node = astnode_create_label(yyvsp[0].label, NULL, NULL, yyloc); }
2613 break;
2615 case 143:
2616 #line 407 "parser.y"
2617 { yyval.node = astnode_create_local_label(yyvsp[0].label, yyloc); }
2618 break;
2620 case 144:
2621 #line 408 "parser.y"
2622 { yyval.node = astnode_create_forward_branch_decl("+", yyloc); }
2623 break;
2625 case 145:
2626 #line 409 "parser.y"
2627 { yyval.node = astnode_create_backward_branch_decl("-", yyloc); }
2628 break;
2630 case 146:
2631 #line 410 "parser.y"
2632 { yyval.node = astnode_create_forward_branch_decl(yyvsp[0].ident, yyloc); }
2633 break;
2635 case 147:
2636 #line 411 "parser.y"
2637 { yyval.node = astnode_create_backward_branch_decl(yyvsp[0].ident, yyloc); }
2638 break;
2640 case 148:
2641 #line 415 "parser.y"
2642 { yyval.node = astnode_create_identifier(yyvsp[0].ident, yyloc); }
2643 break;
2645 case 149:
2646 #line 419 "parser.y"
2647 { yyval.node = yyvsp[0].node; }
2648 break;
2650 case 150:
2651 #line 420 "parser.y"
2652 { yyval.node = astnode_create_null(yyloc); }
2653 break;
2655 case 151:
2656 #line 424 "parser.y"
2657 { yyval.node = astnode_create_integer(yyvsp[0].integer, yyloc); }
2658 break;
2660 case 152:
2661 #line 425 "parser.y"
2662 { yyval.node = astnode_create_string(yyvsp[0].string, yyloc); }
2663 break;
2665 case 153:
2666 #line 429 "parser.y"
2667 { yyval.node = astnode_create_if(yyvsp[-6].node, yyvsp[-4].node, yyvsp[-3].node, yyvsp[-2].node, yyloc); }
2668 break;
2670 case 154:
2671 #line 433 "parser.y"
2672 { yyval.node = yyvsp[0].node; }
2673 break;
2675 case 155:
2676 #line 434 "parser.y"
2677 { yyval.node = NULL; }
2678 break;
2680 case 156:
2681 #line 438 "parser.y"
2682 { yyval.node = yyvsp[0].node; }
2683 break;
2685 case 157:
2686 #line 439 "parser.y"
2687 { yyval.node = yyvsp[-1].node; astnode_add_sibling(yyval.node, yyvsp[0].node); }
2688 break;
2690 case 158:
2691 #line 443 "parser.y"
2692 { yyval.node = astnode_create_case(yyvsp[-2].node, yyvsp[0].node, yyloc); }
2693 break;
2695 case 159:
2696 #line 447 "parser.y"
2697 { yyval.node = yyvsp[0].node; }
2698 break;
2700 case 160:
2701 #line 448 "parser.y"
2702 { yyval.node = NULL; }
2703 break;
2705 case 161:
2706 #line 452 "parser.y"
2707 { yyval.node = astnode_create_ifdef(yyvsp[-5].node, yyvsp[-3].node, yyvsp[-2].node, yyloc); }
2708 break;
2710 case 162:
2711 #line 456 "parser.y"
2712 { yyval.node = astnode_create_ifndef(yyvsp[-5].node, yyvsp[-3].node, yyvsp[-2].node, yyloc); }
2713 break;
2715 case 163:
2716 #line 460 "parser.y"
2717 { yyval.node = yyvsp[-1].node; }
2718 break;
2720 case 164:
2721 #line 461 "parser.y"
2722 { yyval.node = yyvsp[-1].node; }
2723 break;
2725 case 165:
2726 #line 465 "parser.y"
2727 { yyval.node = astnode_create_var_decl(0, yyvsp[-1].node, yyvsp[0].node, yyloc); }
2728 break;
2730 case 166:
2731 #line 466 "parser.y"
2732 { yyval.node = astnode_create_var_decl(ZEROPAGE_FLAG, yyvsp[-1].node, yyvsp[0].node, yyloc); }
2733 break;
2735 case 167:
2736 #line 467 "parser.y"
2737 { yyval.node = astnode_create_var_decl(PUBLIC_FLAG, yyvsp[-1].node, yyvsp[0].node, yyloc); }
2738 break;
2740 case 168:
2741 #line 468 "parser.y"
2742 { yyval.node = astnode_create_var_decl(ZEROPAGE_FLAG | PUBLIC_FLAG, yyvsp[-1].node, yyvsp[0].node, yyloc); }
2743 break;
2745 case 169:
2746 #line 469 "parser.y"
2747 { yyval.node = astnode_create_var_decl(PUBLIC_FLAG | ZEROPAGE_FLAG, yyvsp[-1].node, yyvsp[0].node, yyloc); }
2748 break;
2750 case 170:
2751 #line 473 "parser.y"
2752 { yyval.node = astnode_create_data(yyvsp[-1].node, yyvsp[0].node, yyloc); }
2753 break;
2755 case 171:
2756 #line 474 "parser.y"
2757 { yyval.node = astnode_create_storage(yyvsp[0].node, NULL, yyloc); }
2758 break;
2760 case 172:
2761 #line 475 "parser.y"
2762 { yyval.node = astnode_create_storage(yyvsp[-3].node, yyvsp[-1].node, yyloc); }
2763 break;
2765 case 173:
2766 #line 479 "parser.y"
2767 { yyval.node = astnode_create_datatype(BYTE_DATATYPE, NULL, yyloc); }
2768 break;
2770 case 174:
2771 #line 480 "parser.y"
2772 { yyval.node = astnode_create_datatype(CHAR_DATATYPE, NULL, yyloc); }
2773 break;
2775 case 175:
2776 #line 481 "parser.y"
2777 { yyval.node = astnode_create_datatype(WORD_DATATYPE, NULL, yyloc); }
2778 break;
2780 case 176:
2781 #line 482 "parser.y"
2782 { yyval.node = astnode_create_datatype(DWORD_DATATYPE, NULL, yyloc); }
2783 break;
2785 case 177:
2786 #line 483 "parser.y"
2787 { yyval.node = astnode_create_datatype(USER_DATATYPE, yyvsp[0].node, yyloc); }
2788 break;
2790 case 178:
2791 #line 484 "parser.y"
2792 { yyval.node = astnode_create_datatype(USER_DATATYPE, yyvsp[0].node, yyloc); }
2793 break;
2795 case 179:
2796 #line 488 "parser.y"
2797 { yyval.node = yyvsp[0].node; }
2798 break;
2800 case 180:
2801 #line 489 "parser.y"
2802 { yyval.node = yyvsp[-2].node; astnode_add_sibling(yyval.node, yyvsp[0].node); }
2803 break;
2805 case 181:
2806 #line 493 "parser.y"
2807 { yyval.node = astnode_create_incsrc(yyvsp[-1].node, yyloc); handle_incsrc(yyval.node); }
2808 break;
2810 case 182:
2811 #line 497 "parser.y"
2812 { yyval.node = astnode_create_incbin(yyvsp[-1].node, yyloc); handle_incbin(yyval.node); }
2813 break;
2815 case 183:
2816 #line 501 "parser.y"
2817 { yyval.node = astnode_create_string(yyvsp[0].string, yyloc); }
2818 break;
2820 case 184:
2821 #line 502 "parser.y"
2822 { yyval.node = astnode_create_file_path(scan_include('>'), yyloc); }
2823 break;
2825 case 185:
2826 #line 506 "parser.y"
2827 { yyval.node = astnode_create_macro_decl(yyvsp[-5].node, yyvsp[-4].node, yyvsp[-2].node, yyloc); }
2828 break;
2830 case 186:
2831 #line 510 "parser.y"
2832 { yyval.node = yyvsp[0].node; }
2833 break;
2835 case 187:
2836 #line 511 "parser.y"
2837 { yyval.node = NULL; }
2838 break;
2840 case 188:
2841 #line 515 "parser.y"
2842 { yyval.node = astnode_create_macro(yyvsp[-2].node, yyvsp[-1].node, yyloc); }
2843 break;
2845 case 189:
2846 #line 519 "parser.y"
2847 { yyval.node = yyvsp[0].node; }
2848 break;
2850 case 190:
2851 #line 520 "parser.y"
2852 { yyval.node = NULL; }
2853 break;
2855 case 191:
2856 #line 524 "parser.y"
2857 { yyval.node = yyvsp[0].node; }
2858 break;
2860 case 192:
2861 #line 525 "parser.y"
2862 { yyval.node = yyvsp[-2].node; astnode_add_sibling(yyval.node, yyvsp[0].node); }
2863 break;
2865 case 193:
2866 #line 529 "parser.y"
2867 { yyval.node = astnode_create_equ(yyvsp[-3].node, yyvsp[-1].node, yyloc); }
2868 break;
2870 case 194:
2871 #line 533 "parser.y"
2872 { yyval.node = astnode_create_assign(yyvsp[-3].node, yyvsp[-1].node, yyloc); }
2873 break;
2875 case 195:
2876 #line 537 "parser.y"
2877 { yyval.node = astnode_create_equ(yyvsp[-1].node, astnode_create_integer(0, yyloc), yyloc); }
2878 break;
2880 case 196:
2881 #line 538 "parser.y"
2882 { yyval.node = astnode_create_equ(yyvsp[-2].node, yyvsp[-1].node, yyloc); }
2883 break;
2885 case 197:
2886 #line 542 "parser.y"
2887 { yyval.node = astnode_create_public(yyvsp[-1].node, yyloc); }
2888 break;
2890 case 198:
2891 #line 546 "parser.y"
2892 { yyval.node = astnode_create_extrn(yyvsp[-4].node, yyvsp[-2].node, yyvsp[-1].node, yyloc); }
2893 break;
2895 case 199:
2896 #line 550 "parser.y"
2897 { yyval.node = yyvsp[0].node; }
2898 break;
2900 case 200:
2901 #line 551 "parser.y"
2902 { yyval.node = NULL; }
2903 break;
2905 case 201:
2906 #line 555 "parser.y"
2907 { yyval.node = yyvsp[0].node; }
2908 break;
2910 case 202:
2911 #line 556 "parser.y"
2912 { yyval.node = astnode_create_datatype(USER_DATATYPE, yyvsp[0].node, yyloc); }
2913 break;
2915 case 203:
2916 #line 557 "parser.y"
2917 { yyval.node = astnode_create_integer(PROC_SYMBOL, yyloc); }
2918 break;
2920 case 204:
2921 #line 558 "parser.y"
2922 { yyval.node = astnode_create_integer(LABEL_SYMBOL, yyloc); }
2923 break;
2925 case 205:
2926 #line 562 "parser.y"
2927 { yyval.node = yyvsp[0].node; }
2928 break;
2930 case 206:
2931 #line 563 "parser.y"
2932 { yyval.node = yyvsp[0].node; }
2933 break;
2935 case 207:
2936 #line 567 "parser.y"
2937 { yyval.node = astnode_create_var_decl(0, yyvsp[-1].node, yyvsp[0].node, yyloc); }
2938 break;
2940 case 208:
2941 #line 568 "parser.y"
2942 { yyval.node = astnode_create_var_decl(ZEROPAGE_FLAG, yyvsp[-1].node, yyvsp[0].node, yyloc); }
2943 break;
2945 case 209:
2946 #line 569 "parser.y"
2947 { yyval.node = astnode_create_var_decl(PUBLIC_FLAG, yyvsp[-1].node, yyvsp[0].node, yyloc); }
2948 break;
2950 case 210:
2951 #line 570 "parser.y"
2952 { yyval.node = astnode_create_var_decl(ZEROPAGE_FLAG | PUBLIC_FLAG, yyvsp[-1].node, yyvsp[0].node, yyloc); }
2953 break;
2955 case 211:
2956 #line 571 "parser.y"
2957 { yyval.node = astnode_create_var_decl(PUBLIC_FLAG | ZEROPAGE_FLAG, yyvsp[-1].node, yyvsp[0].node, yyloc); }
2958 break;
2960 case 212:
2961 #line 575 "parser.y"
2962 { yyval.node = astnode_create_storage(yyvsp[-2].node, yyvsp[-1].node, yyloc); }
2963 break;
2965 case 213:
2966 #line 579 "parser.y"
2967 { yyval.node = astnode_create_datatype(BYTE_DATATYPE, NULL, yyloc); }
2968 break;
2970 case 214:
2971 #line 580 "parser.y"
2972 { yyval.node = astnode_create_datatype(WORD_DATATYPE, NULL, yyloc); }
2973 break;
2975 case 215:
2976 #line 581 "parser.y"
2977 { yyval.node = astnode_create_datatype(DWORD_DATATYPE, NULL, yyloc); }
2978 break;
2983 /* Line 991 of yacc.c. */
2984 #line 2984 "parser.c"
2986 yyvsp -= yylen;
2987 yyssp -= yylen;
2988 yylsp -= yylen;
2990 YY_STACK_PRINT (yyss, yyssp);
2992 *++yyvsp = yyval;
2993 *++yylsp = yyloc;
2995 /* Now `shift' the result of the reduction. Determine what state
2996 that goes to, based on the state we popped back to and the rule
2997 number reduced by. */
2999 yyn = yyr1[yyn];
3001 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
3002 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
3003 yystate = yytable[yystate];
3004 else
3005 yystate = yydefgoto[yyn - YYNTOKENS];
3007 goto yynewstate;
3010 /*------------------------------------.
3011 | yyerrlab -- here on detecting error |
3012 `------------------------------------*/
3013 yyerrlab:
3014 /* If not already recovering from an error, report this error. */
3015 if (!yyerrstatus)
3017 ++yynerrs;
3018 #if YYERROR_VERBOSE
3019 yyn = yypact[yystate];
3021 if (YYPACT_NINF < yyn && yyn < YYLAST)
3023 YYSIZE_T yysize = 0;
3024 int yytype = YYTRANSLATE (yychar);
3025 char *yymsg;
3026 int yyx, yycount;
3028 yycount = 0;
3029 /* Start YYX at -YYN if negative to avoid negative indexes in
3030 YYCHECK. */
3031 for (yyx = yyn < 0 ? -yyn : 0;
3032 yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++)
3033 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
3034 yysize += yystrlen (yytname[yyx]) + 15, yycount++;
3035 yysize += yystrlen ("syntax error, unexpected ") + 1;
3036 yysize += yystrlen (yytname[yytype]);
3037 yymsg = (char *) YYSTACK_ALLOC (yysize);
3038 if (yymsg != 0)
3040 char *yyp = yystpcpy (yymsg, "syntax error, unexpected ");
3041 yyp = yystpcpy (yyp, yytname[yytype]);
3043 if (yycount < 5)
3045 yycount = 0;
3046 for (yyx = yyn < 0 ? -yyn : 0;
3047 yyx < (int) (sizeof (yytname) / sizeof (char *));
3048 yyx++)
3049 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
3051 const char *yyq = ! yycount ? ", expecting " : " or ";
3052 yyp = yystpcpy (yyp, yyq);
3053 yyp = yystpcpy (yyp, yytname[yyx]);
3054 yycount++;
3057 yyerror (yymsg);
3058 YYSTACK_FREE (yymsg);
3060 else
3061 yyerror ("syntax error; also virtual memory exhausted");
3063 else
3064 #endif /* YYERROR_VERBOSE */
3065 yyerror ("syntax error");
3068 yylerrsp = yylsp;
3070 if (yyerrstatus == 3)
3072 /* If just tried and failed to reuse lookahead token after an
3073 error, discard it. */
3075 /* Return failure if at end of input. */
3076 if (yychar == YYEOF)
3078 /* Pop the error token. */
3079 YYPOPSTACK;
3080 /* Pop the rest of the stack. */
3081 while (yyss < yyssp)
3083 YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
3084 yydestruct (yystos[*yyssp], yyvsp, yylsp);
3085 YYPOPSTACK;
3087 YYABORT;
3090 YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc);
3091 yydestruct (yytoken, &yylval, &yylloc);
3092 yychar = YYEMPTY;
3093 *++yylerrsp = yylloc;
3096 /* Else will try to reuse lookahead token after shifting the error
3097 token. */
3098 goto yyerrlab2;
3101 /*----------------------------------------------------.
3102 | yyerrlab1 -- error raised explicitly by an action. |
3103 `----------------------------------------------------*/
3104 yyerrlab1:
3106 /* Suppress GCC warning that yyerrlab1 is unused when no action
3107 invokes YYERROR. */
3108 #if defined (__GNUC_MINOR__) && 2093 <= (__GNUC__ * 1000 + __GNUC_MINOR__)
3109 __attribute__ ((__unused__))
3110 #endif
3112 yylerrsp = yylsp;
3113 *++yylerrsp = yyloc;
3114 goto yyerrlab2;
3117 /*---------------------------------------------------------------.
3118 | yyerrlab2 -- pop states until the error token can be shifted. |
3119 `---------------------------------------------------------------*/
3120 yyerrlab2:
3121 yyerrstatus = 3; /* Each real token shifted decrements this. */
3123 for (;;)
3125 yyn = yypact[yystate];
3126 if (yyn != YYPACT_NINF)
3128 yyn += YYTERROR;
3129 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
3131 yyn = yytable[yyn];
3132 if (0 < yyn)
3133 break;
3137 /* Pop the current state because it cannot handle the error token. */
3138 if (yyssp == yyss)
3139 YYABORT;
3141 YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
3142 yydestruct (yystos[yystate], yyvsp, yylsp);
3143 yyvsp--;
3144 yystate = *--yyssp;
3145 yylsp--;
3146 YY_STACK_PRINT (yyss, yyssp);
3149 if (yyn == YYFINAL)
3150 YYACCEPT;
3152 YYDPRINTF ((stderr, "Shifting error token, "));
3154 *++yyvsp = yylval;
3155 YYLLOC_DEFAULT (yyloc, yylsp, (yylerrsp - yylsp));
3156 *++yylsp = yyloc;
3158 yystate = yyn;
3159 goto yynewstate;
3162 /*-------------------------------------.
3163 | yyacceptlab -- YYACCEPT comes here. |
3164 `-------------------------------------*/
3165 yyacceptlab:
3166 yyresult = 0;
3167 goto yyreturn;
3169 /*-----------------------------------.
3170 | yyabortlab -- YYABORT comes here. |
3171 `-----------------------------------*/
3172 yyabortlab:
3173 yyresult = 1;
3174 goto yyreturn;
3176 #ifndef yyoverflow
3177 /*----------------------------------------------.
3178 | yyoverflowlab -- parser overflow comes here. |
3179 `----------------------------------------------*/
3180 yyoverflowlab:
3181 yyerror ("parser stack overflow");
3182 yyresult = 2;
3183 /* Fall through. */
3184 #endif
3186 yyreturn:
3187 #ifndef yyoverflow
3188 if (yyss != yyssa)
3189 YYSTACK_FREE (yyss);
3190 #endif
3191 return yyresult;
3195 #line 581 "parser.y"
3198 * Takes care of switching to a new scanner input stream when a "incsrc" statement
3199 * has been encountered.
3200 * The current stream is pushed on a stack, and will be popped when EOF is reached
3201 * in the new stream.
3202 * @param n A node of type INCSRC_NODE
3204 void handle_incsrc(astnode *n)
3206 char errs[512];
3207 /* Get the node which describes the file to include */
3208 astnode *file = astnode_get_child(n, 0);
3209 int quoted_form = (astnode_get_type(file) == STRING_NODE) ? 1 : 0;
3210 switch (yypushandrestart(file->string, quoted_form)) {
3211 case 0:
3212 /* Success */
3213 break;
3214 case 1:
3215 /* Failed to open file */
3216 sprintf(errs, "could not open '%s' for reading", file->string);
3217 yyerror(errs);
3218 break;
3219 case 2:
3220 /* Stack overflow */
3221 yyerror("Maximum include nesting level reached");
3222 break;
3226 // TODO: This shouldn't be done here but rather in astproc module.
3228 FILE *open_included_file(const char *, int, char **);
3231 * Takes care of including the binary contents of the file specified by a parsed
3232 * "incbin" statement.
3233 * Calls yyerror() if the file can't be included for some reason.
3234 * @param n A node of type INCBIN_NODE
3236 void handle_incbin(astnode *n)
3238 FILE *fp;
3239 unsigned char *data;
3240 int size;
3241 char errs[512];
3242 /* Get the node which describes the file to include */
3243 astnode *file = astnode_get_child(n, 0);
3244 const char *filename = file->string;
3245 int quoted_form = (astnode_get_type(file) == STRING_NODE) ? 1 : 0;
3246 /* Try to open it */
3247 fp = open_included_file(filename, quoted_form, NULL);
3248 if (fp) {
3249 /* Get filesize */
3250 fseek(fp, 0, SEEK_END);
3251 size = ftell(fp);
3252 rewind(fp);
3253 if (size > 0) {
3254 /* Allocate buffer to hold file contents */
3255 data = (unsigned char *)malloc(size);
3256 /* Read file contents into buffer */
3257 fread(data, 1, size, fp);
3258 /* Insert binary node */
3259 astnode_add_sibling(n, astnode_create_binary(data, size, n->loc) );
3261 /* Close file */
3262 fclose(fp);
3263 } else {
3264 /* Couldn't open file */
3265 sprintf(errs, "could not open '%s' for reading", file->string);
3266 yyerror(errs);