tge/engine/console/BASgram.cc
2017-04-17 06:17:10 -06:00

1952 lines
72 KiB
C++
Executable File
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/* A Bison parser, made from basgram.y with Bison version GNU Bison version 1.24
*/
#define YYBISON 1 /* Identify Bison output. */
#define yyparse BASparse
#define yylex BASlex
#define yyerror BASerror
#define yylval BASlval
#define yychar BASchar
#define yydebug BASdebug
#define yynerrs BASnerrs
#define rwDEFINE 258
#define rwENDDEF 259
#define rwDECLARE 260
#define rwBREAK 261
#define rwELSE 262
#define rwCONTINUE 263
#define rwGLOBAL 264
#define rwIF 265
#define rwNIL 266
#define rwRETURN 267
#define rwWHILE 268
#define rwENDIF 269
#define rwENDWHILE 270
#define rwENDFOR 271
#define rwDEFAULT 272
#define rwFOR 273
#define rwDATABLOCK 274
#define rwSWITCH 275
#define rwCASE 276
#define rwSWITCHSTR 277
#define rwCASEOR 278
#define rwPACKAGE 279
#define ILLEGAL_TOKEN 280
#define CHRCONST 281
#define INTCONST 282
#define TTAG 283
#define VAR 284
#define IDENT 285
#define STRATOM 286
#define TAGATOM 287
#define FLTCONST 288
#define opMINUSMINUS 289
#define opPLUSPLUS 290
#define STMT_SEP 291
#define opSHL 292
#define opSHR 293
#define opPLASN 294
#define opMIASN 295
#define opMLASN 296
#define opDVASN 297
#define opMODASN 298
#define opANDASN 299
#define opXORASN 300
#define opORASN 301
#define opSLASN 302
#define opSRASN 303
#define opCAT 304
#define opEQ 305
#define opNE 306
#define opGE 307
#define opLE 308
#define opAND 309
#define opOR 310
#define opSTREQ 311
#define opCOLONCOLON 312
#define opMDASN 313
#define opNDASN 314
#define opNTASN 315
#define opSTRNE 316
#define UNARY 317
#define rwTHEN 318
#define rwEND 319
#define rwBEGIN 320
#define rwCFOR 321
#define rwTO 322
#define rwSTEP 323
#line 1 "basgram.y"
// Make sure we don't get gram.h twice.
#define _BASGRAM_H_
#define _CMDGRAM_H_
#include <stdlib.h>
#include <stdio.h>
#include "console/console.h"
#include "console/compiler.h"
#include "console/consoleInternal.h"
#ifndef YYDEBUG
#define YYDEBUG 0
#endif
#define YYSSIZE 350
int outtext(char *fmt, ...);
extern int serrors;
#define nil 0
#undef YY_ARGS
#define YY_ARGS(x) x
int BASlex();
void BASerror(char *a, ...);
#define alloca dMalloc
#line 31 "basgram.y"
/* Reserved Word Definitions */
/* IMPORTANT: SEE COMMENTS BELOW IF YOU ARE THINKING ABOUT MODIFYING TOKENS */
/*
ALL TOKENS BETWEEN HERE AND ADDITIONAL TOKENS BELOW MUST BE IDENTICAL TO THOSE
IN CS_CMD.y OTHERWISE BAD STUFF HAPPENS
*/
#line 48 "basgram.y"
/* Constants and Identifier Definitions */
#line 60 "basgram.y"
/* Operator Definitions */
#line 72 "basgram.y"
typedef union {
char c;
int i;
const char *s;
char *str;
double f;
StmtNode *stmt;
ExprNode *expr;
SlotAssignNode *slist;
VarNode *var;
SlotDecl slot;
ObjectBlockDecl odcl;
ObjectDeclNode *od;
AssignDecl asn;
IfStmtNode *ifnode;
} YYSTYPE;
#line 143 "basgram.y"
/*
Additional tokens
NOTE: These MUST be here, otherwise the definitions of the usual TorqueScript tokens changes
which will break the compiler. Double check the standard TS tokens arent being redefined before
testing a build.
*/
#ifndef YYLTYPE
typedef
struct yyltype
{
int timestamp;
int first_line;
int first_column;
int last_line;
int last_column;
char *text;
}
yyltype;
#define YYLTYPE yyltype
#endif
#include <stdio.h>
#ifndef __cplusplus
#ifndef __STDC__
#define const
#endif
#endif
#define YYFINAL 278
#define YYFLAG -32768
#define YYNTBASE 94
#define YYTRANSLATE(x) ((unsigned)(x) <= 323 ? yytranslate[x] : 130)
static const char yytranslate[] = { 0,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 54, 2, 2, 2, 44, 43, 2, 45,
46, 36, 34, 47, 35, 41, 37, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 48, 49, 38,
40, 39, 84, 55, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
80, 2, 93, 52, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 50, 42, 51, 53, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 1, 2, 3, 4, 5,
6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
26, 27, 28, 29, 30, 31, 32, 33, 56, 57,
58, 59, 60, 61, 62, 63, 64, 65, 66, 67,
68, 69, 70, 71, 72, 73, 74, 75, 76, 77,
78, 79, 81, 82, 83, 85, 86, 87, 88, 89,
90, 91, 92
};
#if YYDEBUG != 0
static const short yyprhs[] = { 0,
0, 2, 3, 6, 8, 10, 12, 17, 19, 22,
23, 26, 28, 30, 32, 34, 36, 39, 42, 45,
49, 52, 57, 64, 72, 82, 83, 85, 87, 91,
100, 110, 119, 120, 123, 124, 126, 127, 130, 131,
133, 135, 138, 141, 145, 149, 151, 156, 161, 166,
174, 180, 182, 186, 192, 200, 206, 216, 218, 220,
224, 228, 232, 236, 240, 244, 248, 252, 256, 259,
262, 264, 270, 274, 278, 282, 286, 290, 294, 298,
302, 306, 310, 314, 318, 322, 325, 328, 330, 332,
334, 336, 338, 340, 342, 344, 349, 353, 360, 362,
366, 368, 370, 373, 376, 379, 382, 385, 388, 391,
394, 397, 400, 402, 404, 408, 415, 418, 424, 427,
431, 437, 442, 449, 456, 457, 459, 461, 465, 467,
470, 475, 480, 488, 490, 494, 495
};
static const short yyrhs[] = { 95,
0, 0, 95, 96, 0, 100, 0, 101, 0, 97,
0, 24, 30, 98, 88, 0, 101, 0, 98, 101,
0, 0, 99, 100, 0, 114, 0, 115, 0, 116,
0, 104, 0, 111, 0, 6, 129, 0, 8, 129,
0, 12, 129, 0, 12, 118, 129, 0, 117, 129,
0, 28, 40, 118, 129, 0, 28, 40, 118, 47,
118, 129, 0, 3, 30, 45, 102, 46, 99, 88,
0, 3, 30, 79, 30, 45, 102, 46, 99, 88,
0, 0, 103, 0, 29, 0, 103, 47, 29, 0,
19, 30, 45, 30, 106, 46, 126, 88, 0, 5,
120, 45, 107, 106, 108, 46, 109, 88, 0, 5,
120, 45, 107, 106, 108, 46, 88, 0, 0, 48,
30, 0, 0, 118, 0, 0, 47, 125, 0, 0,
126, 0, 110, 0, 126, 110, 0, 105, 129, 0,
110, 105, 129, 0, 89, 99, 88, 0, 100, 0,
20, 118, 112, 88, 0, 22, 118, 112, 88, 0,
21, 113, 48, 99, 0, 21, 113, 48, 99, 17,
48, 99, 0, 21, 113, 48, 99, 112, 0, 118,
0, 113, 23, 118, 0, 10, 118, 87, 99, 88,
0, 10, 118, 87, 99, 7, 99, 88, 0, 13,
118, 89, 99, 88, 0, 18, 118, 47, 118, 47,
118, 89, 99, 88, 0, 122, 0, 122, 0, 45,
118, 46, 0, 118, 52, 118, 0, 118, 44, 118,
0, 118, 43, 118, 0, 118, 42, 118, 0, 118,
34, 118, 0, 118, 35, 118, 0, 118, 36, 118,
0, 118, 37, 118, 0, 35, 118, 0, 36, 118,
0, 28, 0, 118, 84, 118, 48, 118, 0, 118,
38, 118, 0, 118, 39, 118, 0, 118, 74, 118,
0, 118, 75, 118, 0, 118, 72, 118, 0, 118,
73, 118, 0, 118, 77, 118, 0, 118, 59, 118,
0, 118, 60, 118, 0, 118, 76, 118, 0, 118,
78, 118, 0, 118, 85, 118, 0, 118, 55, 118,
0, 54, 118, 0, 53, 118, 0, 32, 0, 33,
0, 27, 0, 6, 0, 119, 0, 30, 0, 31,
0, 29, 0, 29, 80, 128, 93, 0, 118, 41,
30, 0, 118, 41, 30, 80, 128, 93, 0, 30,
0, 45, 118, 46, 0, 57, 0, 56, 0, 61,
118, 0, 62, 118, 0, 63, 118, 0, 64, 118,
0, 65, 118, 0, 66, 118, 0, 67, 118, 0,
68, 118, 0, 69, 118, 0, 70, 118, 0, 123,
0, 105, 0, 29, 40, 118, 0, 29, 80, 128,
93, 40, 118, 0, 29, 121, 0, 29, 80, 128,
93, 121, 0, 119, 121, 0, 119, 40, 118, 0,
119, 40, 50, 125, 51, 0, 30, 45, 124, 46,
0, 30, 79, 30, 45, 124, 46, 0, 118, 41,
30, 45, 124, 46, 0, 0, 125, 0, 118, 0,
125, 47, 118, 0, 127, 0, 126, 127, 0, 30,
40, 118, 129, 0, 19, 40, 118, 129, 0, 30,
80, 128, 93, 40, 118, 129, 0, 118, 0, 128,
47, 118, 0, 0, 129, 49, 0
};
#endif
#if YYDEBUG != 0
static const short yyrline[] = { 0,
157, 162, 164, 169, 171, 173, 178, 183, 185, 190,
192, 197, 198, 199, 200, 201, 202, 204, 206, 208,
210, 212, 214, 219, 221, 226, 228, 233, 235, 240,
245, 247, 252, 254, 259, 261, 266, 268, 273, 275,
277, 279, 284, 286, 291, 293, 298, 300, 305, 307,
309, 314, 316, 321, 323, 328, 333, 338, 343, 345,
347, 349, 351, 353, 355, 357, 359, 361, 363, 365,
367, 369, 371, 373, 375, 377, 379, 381, 383, 385,
387, 389, 391, 393, 395, 397, 399, 401, 403, 405,
407, 409, 411, 413, 415, 417, 422, 424, 429, 431,
436, 438, 440, 442, 444, 446, 448, 450, 452, 454,
456, 458, 463, 465, 467, 469, 471, 473, 475, 477,
479, 484, 486, 488, 493, 495, 500, 502, 507, 509,
514, 516, 518, 523, 525, 529, 530
};
static const char * const yytname[] = { "$","error","$undefined.","rwDEFINE",
"rwENDDEF","rwDECLARE","rwBREAK","rwELSE","rwCONTINUE","rwGLOBAL","rwIF","rwNIL",
"rwRETURN","rwWHILE","rwENDIF","rwENDWHILE","rwENDFOR","rwDEFAULT","rwFOR","rwDATABLOCK",
"rwSWITCH","rwCASE","rwSWITCHSTR","rwCASEOR","rwPACKAGE","ILLEGAL_TOKEN","CHRCONST",
"INTCONST","TTAG","VAR","IDENT","STRATOM","TAGATOM","FLTCONST","'+'","'-'","'*'",
"'/'","'<'","'>'","'='","'.'","'|'","'&'","'%'","'('","')'","','","':'","';'",
"'{'","'}'","'^'","'~'","'!'","'@'","opMINUSMINUS","opPLUSPLUS","STMT_SEP","opSHL",
"opSHR","opPLASN","opMIASN","opMLASN","opDVASN","opMODASN","opANDASN","opXORASN",
"opORASN","opSLASN","opSRASN","opCAT","opEQ","opNE","opGE","opLE","opAND","opOR",
"opSTREQ","opCOLONCOLON","'['","opMDASN","opNDASN","opNTASN","'?'","opSTRNE",
"UNARY","rwTHEN","rwEND","rwBEGIN","rwCFOR","rwTO","rwSTEP","']'","start","decl_list",
"decl","package_decl","fn_decl_list","statement_list","stmt","fn_decl_stmt",
"var_list_decl","var_list","datablock_decl","object_decl","parent_block","object_name",
"object_args","object_declare_block","object_decl_list","switch_stmt","case_block",
"case_expr","if_stmt","while_stmt","for_stmt","expression_stmt","expr","slot_acc",
"class_name_expr","assign_op_struct","stmt_expr","funcall_expr","expr_list_decl",
"expr_list","slot_assign_list","slot_assign","aidx_expr","semicolon","semicolon"
};
#endif
static const short yyr1[] = { 0,
94, 95, 95, 96, 96, 96, 97, 98, 98, 99,
99, 100, 100, 100, 100, 100, 100, 100, 100, 100,
100, 100, 100, 101, 101, 102, 102, 103, 103, 104,
105, 105, 106, 106, 107, 107, 108, 108, 109, 109,
109, 109, 110, 110, -1, -1, 111, 111, 112, 112,
112, 113, 113, 114, 114, 115, 116, 117, 118, 118,
118, 118, 118, 118, 118, 118, 118, 118, 118, 118,
118, 118, 118, 118, 118, 118, 118, 118, 118, 118,
118, 118, 118, 118, 118, 118, 118, 118, 118, 118,
118, 118, 118, 118, 118, 118, 119, 119, 120, 120,
121, 121, 121, 121, 121, 121, 121, 121, 121, 121,
121, 121, 122, 122, 122, 122, 122, 122, 122, 122,
122, 123, 123, 123, 124, 124, 125, 125, 126, 126,
127, 127, 127, 128, 128, 129, 129
};
static const short yyr2[] = { 0,
1, 0, 2, 1, 1, 1, 4, 1, 2, 0,
2, 1, 1, 1, 1, 1, 2, 2, 2, 3,
2, 4, 6, 7, 9, 0, 1, 1, 3, 8,
9, 8, 0, 2, 0, 1, 0, 2, 0, 1,
1, 2, 2, 3, 3, 1, 4, 4, 4, 7,
5, 1, 3, 5, 7, 5, 9, 1, 1, 3,
3, 3, 3, 3, 3, 3, 3, 3, 2, 2,
1, 5, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 2, 2, 1, 1, 1,
1, 1, 1, 1, 1, 4, 3, 6, 1, 3,
1, 1, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 1, 1, 3, 6, 2, 5, 2, 3,
5, 4, 6, 6, 0, 1, 1, 3, 1, 2,
4, 4, 7, 1, 3, 0, 2
};
static const short yydefact[] = { 2,
1, 0, 0, 136, 136, 0, 136, 0, 0, 0,
0, 0, 0, 90, 71, 95, 93, 94, 88, 89,
0, 0, 0, 0, 0, 3, 6, 4, 5, 15,
114, 16, 12, 13, 14, 136, 0, 92, 58, 113,
0, 99, 0, 0, 17, 18, 91, 71, 0, 59,
136, 19, 0, 0, 0, 0, 0, 0, 0, 0,
102, 101, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 117, 125, 0, 69, 70, 0, 87,
86, 21, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 119, 26, 0, 0,
35, 137, 10, 20, 10, 0, 0, 0, 0, 0,
0, 8, 136, 115, 103, 104, 105, 106, 107, 108,
109, 110, 111, 112, 134, 0, 127, 0, 126, 0,
60, 65, 66, 67, 68, 73, 74, 97, 64, 63,
62, 61, 85, 80, 81, 77, 78, 75, 76, 82,
79, 83, 0, 84, 0, 120, 28, 0, 27, 0,
100, 33, 36, 0, 0, 0, 33, 0, 52, 47,
48, 7, 9, 0, 22, 0, 96, 122, 0, 125,
125, 0, 0, 0, 10, 0, 26, 0, 37, 10,
54, 11, 56, 0, 0, 0, 10, 136, 135, 0,
118, 128, 0, 0, 0, 72, 121, 0, 29, 0,
34, 0, 0, 0, 0, 0, 53, 49, 23, 116,
123, 124, 98, 24, 10, 38, 0, 55, 10, 0,
0, 0, 129, 0, 51, 0, 32, 136, 0, 41,
40, 0, 0, 0, 0, 30, 130, 10, 25, 43,
31, 136, 42, 57, 136, 136, 0, 50, 44, 132,
131, 0, 0, 136, 133, 0, 0, 0
};
static const short yydefgoto[] = { 276,
1, 26, 27, 121, 174, 202, 29, 168, 169, 30,
31, 199, 172, 223, 249, 250, 32, 119, 178, 33,
34, 35, 36, 37, 38, 44, 74, 50, 40, 138,
139, 242, 243, 136, 45
};
static const short yypact[] = {-32768,
681, 3, 2, 973,-32768, 1341, 1341, 1341, 1341, 6,
1341, 1341, 10,-32768, 37, 66, -3,-32768,-32768,-32768,
1341, 1341, 1341, 1341, 1341,-32768,-32768,-32768,-32768,-32768,
-32768,-32768,-32768,-32768,-32768,-32768, 1000, 1342, 1054,-32768,
0,-32768, 1341, 33, 31, 31,-32768,-32768, 598,-32768,
1000, 31, 515, 686, 63, 488, 488, 110, 1341, 1341,
-32768,-32768, 1341, 1341, 1341, 1341, 1341, 1341, 1341, 1341,
1341, 1341, 1341,-32768, 1341, 85, 78, 78, 738, 78,
78, 31, 1341, 1341, 1341, 1341, 1341, 1341, 90, 1341,
1341, 1341, 1341, 1341, 1341, 1341, 1341, 1341, 1341, 1341,
1341, 1341, 1341, 1341, 1341, 1330,-32768, 92, 94, 790,
1341,-32768,-32768, 31,-32768, 1341, 109, 1341, 49, 52,
23,-32768, 842, 1000, 1000, 1000, 1000, 1000, 1000, 1000,
1000, 1000, 1000, 1000, 1000, -39, 1000, 101, 103, 108,
-32768, 133, 133, 78, 78, 177, 177, -28, 121, 1162,
78, 1135, 107, 189, 189, 1189, 1189, 177, 177, 1108,
1081, 107, 894, 107, 1341, 1000,-32768, 115, 124, 130,
-32768, 106, 1000, 269, 307, 946, 106, 5, 1000,-32768,
-32768,-32768,-32768, 1341, 31, 1341, 1357,-32768, 1341, 1341,
1341, 1341, 1341, -12,-32768, 149, 92, 153, 132,-32768,
-32768,-32768,-32768, 1341, 139, 1341,-32768, 1000, 1000, 1341,
-32768, 1000, 140, 146, -34, 1027,-32768, 357,-32768, 151,
-32768, 1341, 152, 395, 542, 18, 1000, 1260, 31, 1000,
-32768,-32768,-32768,-32768,-32768, 103, 19,-32768,-32768, 165,
-24, -1,-32768, 159,-32768, 445,-32768,-32768, 122, 204,
25, 483, 1341, 1341, 1341,-32768,-32768,-32768,-32768, 31,
-32768,-32768, 204,-32768, 1000, 1000, -33, 1298, 31, 31,
31, 175, 1341, 1000, 31, 216, 217,-32768
};
static const short yypgoto[] = {-32768,
-32768,-32768,-32768,-32768, -90, 218, -47, 30,-32768,-32768,
-125, 45,-32768,-32768,-32768, -23,-32768, -56,-32768,-32768,
-32768,-32768,-32768, -2,-32768,-32768, -35, 26,-32768, -140,
-150, -8, -208, -180, -5
};
#define YYLAST 1427
static const short yytable[] = { 46,
120, 52, 107, 49, 51, 53, 54, 186, 56, 57,
122, 215, 186, 186, 194, 254, 191, 240, 77, 78,
79, 80, 81, 3, 175, 2, 39, 206, 241, 3,
82, 42, 41, 257, 189, 55, 240, 240, 217, 58,
110, 75, 257, 240, 108, 114, 43, 241, 241, 213,
214, 192, 207, 187, 241, 255, 123, 124, 233, 272,
125, 126, 127, 128, 129, 130, 131, 132, 133, 134,
135, 236, 137, 183, 267, 76, 59, 111, 109, 112,
142, 143, 144, 145, 146, 147, 256, 149, 150, 151,
152, 153, 154, 155, 156, 157, 158, 159, 160, 161,
162, 163, 164, 166, 218, 60, 247, 117, 173, 224,
182, 248, 2, 176, 140, 179, 228, 185, 89, 148,
167, 61, 62, 170, 262, 248, 63, 64, 65, 66,
67, 68, 69, 70, 71, 72, 180, 262, 177, 181,
83, 84, 85, 86, 246, 73, 188, 89, 252, 189,
92, 211, 190, 198, 83, 84, 85, 86, 87, 88,
195, 89, 137, 91, 92, 95, 96, 268, 85, 86,
196, 245, 93, 89, 197, 94, 92, 219, 222, 95,
96, 208, 221, 209, 226, 231, 212, 137, 137, 135,
216, 232, 97, 98, 99, 100, 235, 237, 103, 39,
39, 225, 229, 227, 253, 105, 258, 230, 3, 261,
83, 84, 85, 86, 273, 277, 278, 89, 28, 137,
92, 205, 83, 84, 85, 86, 220, 263, 251, 89,
0, 94, 92, 0, 0, 95, 96, 0, 0, 0,
0, 0, 260, 39, 0, 0, 0, 0, 0, 39,
265, 266, 135, 39, 103, 0, 269, 0, 0, 270,
271, 105, 0, 0, 0, 0, 0, 0, 275, 0,
274, 39, 0, 3, 4, 200, 5, 39, 6, 0,
7, 8, 0, 0, 0, 0, 9, 10, 11, 0,
12, 0, 0, 39, 0, 14, 15, 16, 17, 18,
19, 20, 0, 21, 22, 0, 0, 0, 0, 0,
0, 3, 4, 23, 5, 0, 6, 0, 7, 8,
0, 24, 25, 0, 9, 10, 11, 0, 12, 0,
0, 0, 0, 14, 15, 16, 17, 18, 19, 20,
0, 21, 22, 0, 0, 0, 0, 0, 0, 0,
0, 23, 0, 0, 0, 0, 201, 0, 0, 24,
25, 3, 4, 0, 5, 0, 6, 0, 7, 8,
0, 0, 0, 0, 9, 10, 11, 0, 12, 0,
0, 0, 0, 14, 15, 16, 17, 18, 19, 20,
0, 21, 22, 0, 203, 0, 0, 0, 0, 3,
4, 23, 5, 0, 6, 0, 7, 8, 0, 24,
25, 0, 9, 10, 11, 0, 12, 0, 0, 0,
0, 14, 15, 16, 17, 18, 19, 20, 0, 21,
22, 0, 0, 0, 0, 0, 0, 0, 0, 23,
0, 0, 0, 0, 234, 0, 0, 24, 25, 3,
4, 0, 5, 0, 6, 0, 7, 8, 0, 0,
0, 0, 9, 10, 11, 0, 12, 0, 0, 0,
0, 14, 15, 16, 17, 18, 19, 20, 0, 21,
22, 0, 238, 0, 0, 0, 0, 3, 4, 23,
5, 0, 6, 0, 7, 8, 0, 24, 25, 0,
9, 10, 11, 0, 12, 0, 0, 0, 118, 14,
15, 16, 17, 18, 19, 20, 0, 21, 22, 0,
0, 83, 84, 85, 86, 87, 88, 23, 89, 90,
91, 92, 259, 0, 0, 24, 25, 0, 0, 93,
0, 0, 94, 0, 0, 0, 95, 96, 83, 84,
85, 86, 87, 88, 0, 89, 90, 91, 92, 97,
98, 99, 100, 101, 102, 103, 93, 0, 0, 94,
264, 104, 105, 95, 96, 83, 84, 85, 86, 87,
88, 0, 89, 90, 91, 92, 97, 98, 99, 100,
101, 102, 103, 93, 0, 0, 94, 0, 104, 105,
95, 96, 0, 115, 0, 0, 0, 0, 0, 0,
0, 0, 0, 97, 98, 99, 100, 101, 102, 103,
0, 0, 0, 0, 0, 104, 105, 0, 0, 0,
239, 83, 84, 85, 86, 87, 88, 0, 89, 90,
91, 92, 0, 0, 0, 0, 0, 0, 0, 93,
0, 0, 94, 0, 0, 0, 95, 96, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 97,
98, 99, 100, 101, 102, 103, 0, 0, 0, 0,
0, 104, 105, 2, 113, 3, 4, 0, 5, 0,
6, 0, 7, 8, 0, 0, 0, 0, 9, 10,
11, 0, 12, 0, 13, 0, 0, 14, 15, 16,
17, 18, 19, 20, 0, 21, 22, 0, 0, 83,
84, 85, 86, 87, 88, 23, 89, 90, 91, 92,
0, 0, 116, 24, 25, 0, 0, 93, 0, 0,
94, 0, 0, 0, 95, 96, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 97, 98, 99,
100, 101, 102, 103, 0, 0, 0, 0, 0, 104,
105, 83, 84, 85, 86, 87, 88, 0, 89, 90,
91, 92, 0, 141, 0, 0, 0, 0, 0, 93,
0, 0, 94, 0, 0, 0, 95, 96, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 97,
98, 99, 100, 101, 102, 103, 0, 0, 0, 0,
0, 104, 105, 83, 84, 85, 86, 87, 88, 0,
89, 90, 91, 92, 0, 171, 0, 0, 0, 0,
0, 93, 0, 0, 94, 0, 0, 0, 95, 96,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 97, 98, 99, 100, 101, 102, 103, 0, 0,
0, 0, 0, 104, 105, 83, 84, 85, 86, 87,
88, 0, 89, 90, 91, 92, 0, 0, 184, 0,
0, 0, 0, 93, 0, 0, 94, 0, 0, 0,
95, 96, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 97, 98, 99, 100, 101, 102, 103,
0, 0, 0, 0, 0, 104, 105, 83, 84, 85,
86, 87, 88, 0, 89, 90, 91, 92, 0, 0,
0, 193, 0, 0, 0, 93, 0, 0, 94, 0,
0, 0, 95, 96, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 97, 98, 99, 100, 101,
102, 103, 0, 0, 0, 0, 0, 104, 105, 83,
84, 85, 86, 87, 88, 0, 89, 90, 91, 92,
0, 0, 204, 0, 0, 0, 0, 93, 0, 0,
94, 0, 0, 0, 95, 96, -91, -91, -91, -91,
-91, -91, 0, -91, -91, -91, -91, 97, 98, 99,
100, 101, 102, 103, -91, 0, 0, -91, 0, 104,
105, -91, -91, 83, 84, 85, 86, 87, 88, 0,
89, 90, 91, 92, -91, -91, -91, -91, -91, -91,
-91, 93, 0, 0, 94, 0, -91, -91, 95, 96,
83, 84, 85, 86, 87, 88, 0, 89, 90, 91,
92, 97, 98, 99, 100, 101, 102, 103, 93, 0,
0, 94, 0, 104, 105, 95, 96, -59, 0, 0,
-59, -59, -59, 0, -59, -59, -59, -59, 97, 98,
99, 100, 101, 102, 103, -59, 0, 0, -59, 0,
0, 105, -59, -59, 83, 84, 85, 86, 87, 88,
0, 89, 90, 91, 92, -59, -59, -59, -59, -59,
-59, -59, 93, 0, 0, 94, 0, -59, -59, 95,
96, 83, 84, 85, 86, 87, 88, 0, 89, 90,
91, 92, 97, 98, 99, 100, 101, 0, 103, 93,
0, 0, 94, 0, 0, 105, 95, 96, 83, 84,
85, 86, 87, 88, 0, 89, 0, 91, 92, 97,
98, 99, 100, 0, 0, 103, 0, 0, 0, 94,
0, 0, 105, 95, 96, 83, 84, 85, 86, 87,
88, 0, 89, 0, 0, 92, 97, 98, 99, 100,
0, 0, 103, 0, 0, 0, 94, 0, 0, 105,
95, 96, 83, 84, 85, 86, 87, 88, 0, 89,
0, 0, 92, 97, 98, 99, 100, 0, 0, 103,
0, 0, 0, 94, 0, 0, 105, 95, 96, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 99, 100, 3, 4, 103, 5, 0, 6,
0, 7, 8, 105, 0, 0, 244, 9, 10, 11,
118, 12, 0, 0, 0, 0, 14, 15, 16, 17,
18, 19, 20, 0, 21, 22, 0, 0, 0, 0,
0, 0, 3, 4, 23, 5, 0, 6, 0, 7,
8, 0, 24, 25, 0, 9, 10, 11, 0, 12,
0, 0, 0, 0, 14, 15, 16, 17, 18, 19,
20, 0, 21, 22, 3, 47, 0, 0, 0, 0,
0, 0, 23, 0, 0, 3, 47, 0, 0, 0,
24, 25, 0, 0, 0, 0, 14, 48, 16, 17,
18, 19, 20, 0, 21, 22, 0, 14, 48, 16,
17, 18, 19, 20, 23, 21, 22, 0, 0, 165,
0, 106, 24, 25, 0, 23, 0, 0, 0, 0,
0, 0, 0, 24, 25, 0, 210, 61, 62, 0,
0, 0, 63, 64, 65, 66, 67, 68, 69, 70,
71, 72, 61, 62, 0, 0, 0, 63, 64, 65,
66, 67, 68, 69, 70, 71, 72
};
static const short yycheck[] = { 5,
57, 7, 38, 6, 7, 8, 9, 47, 11, 12,
58, 192, 47, 47, 165, 40, 45, 19, 21, 22,
23, 24, 25, 5, 115, 3, 1, 23, 30, 5,
36, 30, 30, 242, 47, 30, 19, 19, 51, 30,
43, 45, 251, 19, 45, 51, 45, 30, 30, 190,
191, 80, 48, 93, 30, 80, 59, 60, 93, 93,
63, 64, 65, 66, 67, 68, 69, 70, 71, 72,
73, 222, 75, 121, 255, 79, 40, 45, 79, 49,
83, 84, 85, 86, 87, 88, 88, 90, 91, 92,
93, 94, 95, 96, 97, 98, 99, 100, 101, 102,
103, 104, 105, 106, 195, 40, 88, 45, 111, 200,
88, 237, 3, 116, 30, 118, 207, 123, 41, 30,
29, 56, 57, 30, 250, 251, 61, 62, 63, 64,
65, 66, 67, 68, 69, 70, 88, 263, 30, 88,
34, 35, 36, 37, 235, 80, 46, 41, 239, 47,
44, 187, 45, 48, 34, 35, 36, 37, 38, 39,
46, 41, 165, 43, 44, 59, 60, 258, 36, 37,
47, 228, 52, 41, 45, 55, 44, 29, 47, 59,
60, 184, 30, 186, 46, 46, 189, 190, 191, 192,
193, 46, 72, 73, 74, 75, 46, 46, 78, 174,
175, 204, 208, 206, 40, 85, 48, 210, 5, 88,
34, 35, 36, 37, 40, 0, 0, 41, 1, 222,
44, 177, 34, 35, 36, 37, 197, 251, 237, 41,
-1, 55, 44, -1, -1, 59, 60, -1, -1, -1,
-1, -1, 248, 218, -1, -1, -1, -1, -1, 224,
253, 254, 255, 228, 78, -1, 262, -1, -1, 265,
266, 85, -1, -1, -1, -1, -1, -1, 274, -1,
273, 246, -1, 5, 6, 7, 8, 252, 10, -1,
12, 13, -1, -1, -1, -1, 18, 19, 20, -1,
22, -1, -1, 268, -1, 27, 28, 29, 30, 31,
32, 33, -1, 35, 36, -1, -1, -1, -1, -1,
-1, 5, 6, 45, 8, -1, 10, -1, 12, 13,
-1, 53, 54, -1, 18, 19, 20, -1, 22, -1,
-1, -1, -1, 27, 28, 29, 30, 31, 32, 33,
-1, 35, 36, -1, -1, -1, -1, -1, -1, -1,
-1, 45, -1, -1, -1, -1, 88, -1, -1, 53,
54, 5, 6, -1, 8, -1, 10, -1, 12, 13,
-1, -1, -1, -1, 18, 19, 20, -1, 22, -1,
-1, -1, -1, 27, 28, 29, 30, 31, 32, 33,
-1, 35, 36, -1, 88, -1, -1, -1, -1, 5,
6, 45, 8, -1, 10, -1, 12, 13, -1, 53,
54, -1, 18, 19, 20, -1, 22, -1, -1, -1,
-1, 27, 28, 29, 30, 31, 32, 33, -1, 35,
36, -1, -1, -1, -1, -1, -1, -1, -1, 45,
-1, -1, -1, -1, 88, -1, -1, 53, 54, 5,
6, -1, 8, -1, 10, -1, 12, 13, -1, -1,
-1, -1, 18, 19, 20, -1, 22, -1, -1, -1,
-1, 27, 28, 29, 30, 31, 32, 33, -1, 35,
36, -1, 88, -1, -1, -1, -1, 5, 6, 45,
8, -1, 10, -1, 12, 13, -1, 53, 54, -1,
18, 19, 20, -1, 22, -1, -1, -1, 21, 27,
28, 29, 30, 31, 32, 33, -1, 35, 36, -1,
-1, 34, 35, 36, 37, 38, 39, 45, 41, 42,
43, 44, 88, -1, -1, 53, 54, -1, -1, 52,
-1, -1, 55, -1, -1, -1, 59, 60, 34, 35,
36, 37, 38, 39, -1, 41, 42, 43, 44, 72,
73, 74, 75, 76, 77, 78, 52, -1, -1, 55,
88, 84, 85, 59, 60, 34, 35, 36, 37, 38,
39, -1, 41, 42, 43, 44, 72, 73, 74, 75,
76, 77, 78, 52, -1, -1, 55, -1, 84, 85,
59, 60, -1, 89, -1, -1, -1, -1, -1, -1,
-1, -1, -1, 72, 73, 74, 75, 76, 77, 78,
-1, -1, -1, -1, -1, 84, 85, -1, -1, -1,
89, 34, 35, 36, 37, 38, 39, -1, 41, 42,
43, 44, -1, -1, -1, -1, -1, -1, -1, 52,
-1, -1, 55, -1, -1, -1, 59, 60, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, 72,
73, 74, 75, 76, 77, 78, -1, -1, -1, -1,
-1, 84, 85, 3, 87, 5, 6, -1, 8, -1,
10, -1, 12, 13, -1, -1, -1, -1, 18, 19,
20, -1, 22, -1, 24, -1, -1, 27, 28, 29,
30, 31, 32, 33, -1, 35, 36, -1, -1, 34,
35, 36, 37, 38, 39, 45, 41, 42, 43, 44,
-1, -1, 47, 53, 54, -1, -1, 52, -1, -1,
55, -1, -1, -1, 59, 60, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, 72, 73, 74,
75, 76, 77, 78, -1, -1, -1, -1, -1, 84,
85, 34, 35, 36, 37, 38, 39, -1, 41, 42,
43, 44, -1, 46, -1, -1, -1, -1, -1, 52,
-1, -1, 55, -1, -1, -1, 59, 60, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, 72,
73, 74, 75, 76, 77, 78, -1, -1, -1, -1,
-1, 84, 85, 34, 35, 36, 37, 38, 39, -1,
41, 42, 43, 44, -1, 46, -1, -1, -1, -1,
-1, 52, -1, -1, 55, -1, -1, -1, 59, 60,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, 72, 73, 74, 75, 76, 77, 78, -1, -1,
-1, -1, -1, 84, 85, 34, 35, 36, 37, 38,
39, -1, 41, 42, 43, 44, -1, -1, 47, -1,
-1, -1, -1, 52, -1, -1, 55, -1, -1, -1,
59, 60, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, 72, 73, 74, 75, 76, 77, 78,
-1, -1, -1, -1, -1, 84, 85, 34, 35, 36,
37, 38, 39, -1, 41, 42, 43, 44, -1, -1,
-1, 48, -1, -1, -1, 52, -1, -1, 55, -1,
-1, -1, 59, 60, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, 72, 73, 74, 75, 76,
77, 78, -1, -1, -1, -1, -1, 84, 85, 34,
35, 36, 37, 38, 39, -1, 41, 42, 43, 44,
-1, -1, 47, -1, -1, -1, -1, 52, -1, -1,
55, -1, -1, -1, 59, 60, 34, 35, 36, 37,
38, 39, -1, 41, 42, 43, 44, 72, 73, 74,
75, 76, 77, 78, 52, -1, -1, 55, -1, 84,
85, 59, 60, 34, 35, 36, 37, 38, 39, -1,
41, 42, 43, 44, 72, 73, 74, 75, 76, 77,
78, 52, -1, -1, 55, -1, 84, 85, 59, 60,
34, 35, 36, 37, 38, 39, -1, 41, 42, 43,
44, 72, 73, 74, 75, 76, 77, 78, 52, -1,
-1, 55, -1, 84, 85, 59, 60, 34, -1, -1,
37, 38, 39, -1, 41, 42, 43, 44, 72, 73,
74, 75, 76, 77, 78, 52, -1, -1, 55, -1,
-1, 85, 59, 60, 34, 35, 36, 37, 38, 39,
-1, 41, 42, 43, 44, 72, 73, 74, 75, 76,
77, 78, 52, -1, -1, 55, -1, 84, 85, 59,
60, 34, 35, 36, 37, 38, 39, -1, 41, 42,
43, 44, 72, 73, 74, 75, 76, -1, 78, 52,
-1, -1, 55, -1, -1, 85, 59, 60, 34, 35,
36, 37, 38, 39, -1, 41, -1, 43, 44, 72,
73, 74, 75, -1, -1, 78, -1, -1, -1, 55,
-1, -1, 85, 59, 60, 34, 35, 36, 37, 38,
39, -1, 41, -1, -1, 44, 72, 73, 74, 75,
-1, -1, 78, -1, -1, -1, 55, -1, -1, 85,
59, 60, 34, 35, 36, 37, 38, 39, -1, 41,
-1, -1, 44, 72, 73, 74, 75, -1, -1, 78,
-1, -1, -1, 55, -1, -1, 85, 59, 60, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, 74, 75, 5, 6, 78, 8, -1, 10,
-1, 12, 13, 85, -1, -1, 17, 18, 19, 20,
21, 22, -1, -1, -1, -1, 27, 28, 29, 30,
31, 32, 33, -1, 35, 36, -1, -1, -1, -1,
-1, -1, 5, 6, 45, 8, -1, 10, -1, 12,
13, -1, 53, 54, -1, 18, 19, 20, -1, 22,
-1, -1, -1, -1, 27, 28, 29, 30, 31, 32,
33, -1, 35, 36, 5, 6, -1, -1, -1, -1,
-1, -1, 45, -1, -1, 5, 6, -1, -1, -1,
53, 54, -1, -1, -1, -1, 27, 28, 29, 30,
31, 32, 33, -1, 35, 36, -1, 27, 28, 29,
30, 31, 32, 33, 45, 35, 36, -1, -1, 50,
-1, 40, 53, 54, -1, 45, -1, -1, -1, -1,
-1, -1, -1, 53, 54, -1, 40, 56, 57, -1,
-1, -1, 61, 62, 63, 64, 65, 66, 67, 68,
69, 70, 56, 57, -1, -1, -1, 61, 62, 63,
64, 65, 66, 67, 68, 69, 70
};
/* -*-C-*- Note some compilers choke on comments on `#line' lines. */
#line 3 "bison.simple"
/* Skeleton output parser for bison,
Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
/* As a special exception, when this file is copied by Bison into a
Bison output file, you may use that output file without restriction.
This special exception was added by the Free Software Foundation
in version 1.24 of Bison. */
#ifndef alloca
#ifdef __GNUC__
#define alloca __builtin_alloca
#else /* not GNU C. */
#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi)
#include <alloca.h>
#else /* not sparc */
#if defined (MSDOS) && !defined (__TURBOC__)
#include <malloc.h>
#else /* not MSDOS, or __TURBOC__ */
#if defined(_AIX)
#include <malloc.h>
#pragma alloca
#else /* not MSDOS, __TURBOC__, or _AIX */
#ifdef __hpux
#ifdef __cplusplus
extern "C" {
void *alloca (unsigned int);
};
#else /* not __cplusplus */
void *alloca ();
#endif /* not __cplusplus */
#endif /* __hpux */
#endif /* not _AIX */
#endif /* not MSDOS, or __TURBOC__ */
#endif /* not sparc. */
#endif /* not GNU C. */
#endif /* alloca not defined. */
/* This is the parser code that is written into each bison parser
when the %semantic_parser declaration is not specified in the grammar.
It was written by Richard Stallman by simplifying the hairy parser
used when %semantic_parser is specified. */
/* Note: there must be only one dollar sign in this file.
It is replaced by the list of actions, each action
as one case of the switch. */
#define yyerrok (yyerrstatus = 0)
#define yyclearin (yychar = YYEMPTY)
#define YYEMPTY -2
#define YYEOF 0
#define YYACCEPT return(0)
#define YYABORT return(1)
#define YYERROR goto yyerrlab1
/* Like YYERROR except do call yyerror.
This remains here temporarily to ease the
transition to the new meaning of YYERROR, for GCC.
Once GCC version 2 has supplanted version 1, this can go. */
#define YYFAIL goto yyerrlab
#define YYRECOVERING() (!!yyerrstatus)
#define YYBACKUP(token, value) \
do \
if (yychar == YYEMPTY && yylen == 1) \
{ yychar = (token), yylval = (value); \
yychar1 = YYTRANSLATE (yychar); \
YYPOPSTACK; \
goto yybackup; \
} \
else \
{ yyerror ("syntax error: cannot back up"); YYERROR; } \
while (0)
#define YYTERROR 1
#define YYERRCODE 256
#ifndef YYPURE
#define YYLEX yylex()
#endif
#ifdef YYPURE
#ifdef YYLSP_NEEDED
#ifdef YYLEX_PARAM
#define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM)
#else
#define YYLEX yylex(&yylval, &yylloc)
#endif
#else /* not YYLSP_NEEDED */
#ifdef YYLEX_PARAM
#define YYLEX yylex(&yylval, YYLEX_PARAM)
#else
#define YYLEX yylex(&yylval)
#endif
#endif /* not YYLSP_NEEDED */
#endif
/* If nonreentrant, generate the variables here */
#ifndef YYPURE
int yychar; /* the lookahead symbol */
YYSTYPE yylval; /* the semantic value of the */
/* lookahead symbol */
#ifdef YYLSP_NEEDED
YYLTYPE yylloc; /* location data for the lookahead */
/* symbol */
#endif
int yynerrs; /* number of parse errors so far */
#endif /* not YYPURE */
#if YYDEBUG != 0
int yydebug; /* nonzero means print parse trace */
/* Since this is uninitialized, it does not stop multiple parsers
from coexisting. */
#endif
/* YYINITDEPTH indicates the initial size of the parser's stacks */
#ifndef YYINITDEPTH
#define YYINITDEPTH 200
#endif
/* YYMAXDEPTH is the maximum size the stacks can grow to
(effective only if the built-in stack extension method is used). */
#if YYMAXDEPTH == 0
#undef YYMAXDEPTH
#endif
#ifndef YYMAXDEPTH
#define YYMAXDEPTH 10000
#endif
/* Prevent warning if -Wstrict-prototypes. */
#ifdef __GNUC__
int yyparse (void);
#endif
#if __GNUC__ > 1 /* GNU C and GNU C++ define this. */
#define __yy_memcpy(FROM,TO,COUNT) __builtin_memcpy(TO,FROM,COUNT)
#else /* not GNU C or C++ */
#ifndef __cplusplus
/* This is the most reliable way to avoid incompatibilities
in available built-in functions on various systems. */
static void
__yy_memcpy (from, to, count)
char *from;
char *to;
int count;
{
register char *f = from;
register char *t = to;
register int i = count;
while (i-- > 0)
*t++ = *f++;
}
#else /* __cplusplus */
/* This is the most reliable way to avoid incompatibilities
in available built-in functions on various systems. */
static void
__yy_memcpy (char *from, char *to, int count)
{
register char *f = from;
register char *t = to;
register int i = count;
while (i-- > 0)
*t++ = *f++;
}
#endif
#endif
#line 192 "bison.simple"
/* The user can define YYPARSE_PARAM as the name of an argument to be passed
into yyparse. The argument should have type void *.
It should actually point to an object.
Grammar actions can access the variable by casting it
to the proper pointer type. */
#ifdef YYPARSE_PARAM
#define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
#else
#define YYPARSE_PARAM
#define YYPARSE_PARAM_DECL
#endif
int
yyparse(YYPARSE_PARAM)
YYPARSE_PARAM_DECL
{
register int yystate;
register int yyn;
register short *yyssp;
register YYSTYPE *yyvsp;
int yyerrstatus; /* number of tokens to shift before error messages enabled */
int yychar1 = 0; /* lookahead token as an internal (translated) token number */
short yyssa[YYINITDEPTH]; /* the state stack */
YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */
short *yyss = yyssa; /* refer to the stacks thru separate pointers */
YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */
#ifdef YYLSP_NEEDED
YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */
YYLTYPE *yyls = yylsa;
YYLTYPE *yylsp;
#define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
#else
#define YYPOPSTACK (yyvsp--, yyssp--)
#endif
int yystacksize = YYINITDEPTH;
#ifdef YYPURE
int yychar;
YYSTYPE yylval;
int yynerrs;
#ifdef YYLSP_NEEDED
YYLTYPE yylloc;
#endif
#endif
YYSTYPE yyval; /* the variable used to return */
/* semantic values from the action */
/* routines */
int yylen;
#if YYDEBUG != 0
if (yydebug)
fprintf(stderr, "Starting parse\n");
#endif
yystate = 0;
yyerrstatus = 0;
yynerrs = 0;
yychar = YYEMPTY; /* Cause a token to be read. */
/* Initialize stack pointers.
Waste one element of value and location stack
so that they stay on the same level as the state stack.
The wasted elements are never initialized. */
yyssp = yyss - 1;
yyvsp = yyvs;
#ifdef YYLSP_NEEDED
yylsp = yyls;
#endif
/* Push a new state, which is found in yystate . */
/* In all cases, when you get here, the value and location stacks
have just been pushed. so pushing a state here evens the stacks. */
yynewstate:
*++yyssp = yystate;
if (yyssp >= yyss + yystacksize - 1)
{
/* Give user a chance to reallocate the stack */
/* Use copies of these so that the &'s don't force the real ones into memory. */
YYSTYPE *yyvs1 = yyvs;
short *yyss1 = yyss;
#ifdef YYLSP_NEEDED
YYLTYPE *yyls1 = yyls;
#endif
/* Get the current used size of the three stacks, in elements. */
int size = yyssp - yyss + 1;
#ifdef yyoverflow
/* Each stack pointer address is followed by the size of
the data in use in that stack, in bytes. */
#ifdef YYLSP_NEEDED
/* This used to be a conditional around just the two extra args,
but that might be undefined if yyoverflow is a macro. */
yyoverflow("parser stack overflow",
&yyss1, size * sizeof (*yyssp),
&yyvs1, size * sizeof (*yyvsp),
&yyls1, size * sizeof (*yylsp),
&yystacksize);
#else
yyoverflow("parser stack overflow",
&yyss1, size * sizeof (*yyssp),
&yyvs1, size * sizeof (*yyvsp),
&yystacksize);
#endif
yyss = yyss1; yyvs = yyvs1;
#ifdef YYLSP_NEEDED
yyls = yyls1;
#endif
#else /* no yyoverflow */
/* Extend the stack our own way. */
if (yystacksize >= YYMAXDEPTH)
{
yyerror("parser stack overflow");
return 2;
}
yystacksize *= 2;
if (yystacksize > YYMAXDEPTH)
yystacksize = YYMAXDEPTH;
yyss = (short *) alloca (yystacksize * sizeof (*yyssp));
__yy_memcpy ((char *)yyss1, (char *)yyss, size * sizeof (*yyssp));
yyvs = (YYSTYPE *) alloca (yystacksize * sizeof (*yyvsp));
__yy_memcpy ((char *)yyvs1, (char *)yyvs, size * sizeof (*yyvsp));
#ifdef YYLSP_NEEDED
yyls = (YYLTYPE *) alloca (yystacksize * sizeof (*yylsp));
__yy_memcpy ((char *)yyls1, (char *)yyls, size * sizeof (*yylsp));
#endif
#endif /* no yyoverflow */
yyssp = yyss + size - 1;
yyvsp = yyvs + size - 1;
#ifdef YYLSP_NEEDED
yylsp = yyls + size - 1;
#endif
#if YYDEBUG != 0
if (yydebug)
fprintf(stderr, "Stack size increased to %d\n", yystacksize);
#endif
if (yyssp >= yyss + yystacksize - 1)
YYABORT;
}
#if YYDEBUG != 0
if (yydebug)
fprintf(stderr, "Entering state %d\n", yystate);
#endif
goto yybackup;
yybackup:
/* Do appropriate processing given the current state. */
/* Read a lookahead token if we need one and don't already have one. */
/* yyresume: */
/* First try to decide what to do without reference to lookahead token. */
yyn = yypact[yystate];
if (yyn == YYFLAG)
goto yydefault;
/* Not known => get a lookahead token if don't already have one. */
/* yychar is either YYEMPTY or YYEOF
or a valid token in external form. */
if (yychar == YYEMPTY)
{
#if YYDEBUG != 0
if (yydebug)
fprintf(stderr, "Reading a token: ");
#endif
yychar = YYLEX;
}
/* Convert token to internal form (in yychar1) for indexing tables with */
if (yychar <= 0) /* This means end of input. */
{
yychar1 = 0;
yychar = YYEOF; /* Don't call YYLEX any more */
#if YYDEBUG != 0
if (yydebug)
fprintf(stderr, "Now at end of input.\n");
#endif
}
else
{
yychar1 = YYTRANSLATE(yychar);
#if YYDEBUG != 0
if (yydebug)
{
fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]);
/* Give the individual parser a way to print the precise meaning
of a token, for further debugging info. */
#ifdef YYPRINT
YYPRINT (stderr, yychar, yylval);
#endif
fprintf (stderr, ")\n");
}
#endif
}
yyn += yychar1;
if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
goto yydefault;
yyn = yytable[yyn];
/* yyn is what to do for this token type in this state.
Negative => reduce, -yyn is rule number.
Positive => shift, yyn is new state.
New state is final state => don't bother to shift,
just return success.
0, or most negative number => error. */
if (yyn < 0)
{
if (yyn == YYFLAG)
goto yyerrlab;
yyn = -yyn;
goto yyreduce;
}
else if (yyn == 0)
goto yyerrlab;
if (yyn == YYFINAL)
YYACCEPT;
/* Shift the lookahead token. */
#if YYDEBUG != 0
if (yydebug)
fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
#endif
/* Discard the token being shifted unless it is eof. */
if (yychar != YYEOF)
yychar = YYEMPTY;
*++yyvsp = yylval;
#ifdef YYLSP_NEEDED
*++yylsp = yylloc;
#endif
/* count tokens shifted since error; after three, turn off error status. */
if (yyerrstatus) yyerrstatus--;
yystate = yyn;
goto yynewstate;
/* Do the default action for the current state. */
yydefault:
yyn = yydefact[yystate];
if (yyn == 0)
goto yyerrlab;
/* Do a reduction. yyn is the number of a rule to reduce with. */
yyreduce:
yylen = yyr2[yyn];
if (yylen > 0)
yyval = yyvsp[1-yylen]; /* implement default value of the action */
#if YYDEBUG != 0
if (yydebug)
{
int i;
fprintf (stderr, "Reducing via rule %d (line %d), ",
yyn, yyrline[yyn]);
/* Print the symbols being reduced, and their result. */
for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
fprintf (stderr, "%s ", yytname[yyrhs[i]]);
fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
}
#endif
switch (yyn) {
case 1:
#line 158 "basgram.y"
{ ;
break;}
case 2:
#line 163 "basgram.y"
{ yyval.stmt = nil; ;
break;}
case 3:
#line 165 "basgram.y"
{ if(!statementList) { statementList = yyvsp[0].stmt; } else { statementList->append(yyvsp[0].stmt); } ;
break;}
case 4:
#line 170 "basgram.y"
{ yyval.stmt = yyvsp[0].stmt; ;
break;}
case 5:
#line 172 "basgram.y"
{ yyval.stmt = yyvsp[0].stmt; ;
break;}
case 6:
#line 174 "basgram.y"
{ yyval.stmt = yyvsp[0].stmt; ;
break;}
case 7:
#line 179 "basgram.y"
{ yyval.stmt = yyvsp[-1].stmt; for(StmtNode *walk = (yyvsp[-1].stmt);walk;walk = walk->getNext() ) walk->setPackage(yyvsp[-2].s); ;
break;}
case 8:
#line 184 "basgram.y"
{ yyval.stmt = yyvsp[0].stmt; ;
break;}
case 9:
#line 186 "basgram.y"
{ yyval.stmt = yyvsp[-1].stmt; (yyvsp[-1].stmt)->append(yyvsp[0].stmt); ;
break;}
case 10:
#line 191 "basgram.y"
{ yyval.stmt = nil; ;
break;}
case 11:
#line 193 "basgram.y"
{ if(!yyvsp[-1].stmt) { yyval.stmt = yyvsp[0].stmt; } else { (yyvsp[-1].stmt)->append(yyvsp[0].stmt); yyval.stmt = yyvsp[-1].stmt; } ;
break;}
case 17:
#line 203 "basgram.y"
{ yyval.stmt = BreakStmtNode::alloc(); ;
break;}
case 18:
#line 205 "basgram.y"
{ yyval.stmt = ContinueStmtNode::alloc(); ;
break;}
case 19:
#line 207 "basgram.y"
{ yyval.stmt = ReturnStmtNode::alloc(NULL); ;
break;}
case 20:
#line 209 "basgram.y"
{ yyval.stmt = ReturnStmtNode::alloc(yyvsp[-1].expr); ;
break;}
case 21:
#line 211 "basgram.y"
{ yyval.stmt = yyvsp[-1].stmt; ;
break;}
case 22:
#line 213 "basgram.y"
{ yyval.stmt = TTagSetStmtNode::alloc(yyvsp[-3].s, yyvsp[-1].expr, NULL); ;
break;}
case 23:
#line 215 "basgram.y"
{ yyval.stmt = TTagSetStmtNode::alloc(yyvsp[-5].s, yyvsp[-3].expr, yyvsp[-1].expr); ;
break;}
case 24:
#line 220 "basgram.y"
{ yyval.stmt = FunctionDeclStmtNode::alloc(yyvsp[-5].s, NULL, yyvsp[-3].var, yyvsp[-1].stmt); ;
break;}
case 25:
#line 222 "basgram.y"
{ yyval.stmt = FunctionDeclStmtNode::alloc(yyvsp[-5].s, yyvsp[-7].s, yyvsp[-3].var, yyvsp[-1].stmt); ;
break;}
case 26:
#line 227 "basgram.y"
{ yyval.var = NULL; ;
break;}
case 27:
#line 229 "basgram.y"
{ yyval.var = yyvsp[0].var; ;
break;}
case 28:
#line 234 "basgram.y"
{ yyval.var = VarNode::alloc(yyvsp[0].s, NULL); ;
break;}
case 29:
#line 236 "basgram.y"
{ yyval.var = yyvsp[-2].var; ((StmtNode*)(yyvsp[-2].var))->append((StmtNode*)VarNode::alloc(yyvsp[0].s, NULL)); ;
break;}
case 30:
#line 241 "basgram.y"
{ yyval.stmt = ObjectDeclNode::alloc(ConstantNode::alloc(yyvsp[-6].s), ConstantNode::alloc(yyvsp[-4].s), NULL, yyvsp[-3].s, yyvsp[-1].slist, NULL, true); ;
break;}
case 31:
#line 246 "basgram.y"
{ yyval.od = ObjectDeclNode::alloc(yyvsp[-7].expr, yyvsp[-5].expr, yyvsp[-3].expr, yyvsp[-4].s, yyvsp[-1].odcl.slots, yyvsp[-1].odcl.decls, false); ;
break;}
case 32:
#line 248 "basgram.y"
{ yyval.od = ObjectDeclNode::alloc(yyvsp[-6].expr, yyvsp[-4].expr, yyvsp[-2].expr, yyvsp[-3].s, NULL, NULL, false); ;
break;}
case 33:
#line 253 "basgram.y"
{ yyval.s = NULL; ;
break;}
case 34:
#line 255 "basgram.y"
{ yyval.s = yyvsp[0].s; ;
break;}
case 35:
#line 260 "basgram.y"
{ yyval.expr = StrConstNode::alloc("", false); ;
break;}
case 36:
#line 262 "basgram.y"
{ yyval.expr = yyvsp[0].expr; ;
break;}
case 37:
#line 267 "basgram.y"
{ yyval.expr = NULL; ;
break;}
case 38:
#line 269 "basgram.y"
{ yyval.expr = yyvsp[0].expr; ;
break;}
case 39:
#line 274 "basgram.y"
{ yyval.odcl.slots = NULL; yyval.odcl.decls = NULL; ;
break;}
case 40:
#line 276 "basgram.y"
{ yyval.odcl.slots = yyvsp[0].slist; yyval.odcl.decls = NULL; ;
break;}
case 41:
#line 278 "basgram.y"
{ yyval.odcl.slots = NULL; yyval.odcl.decls = yyvsp[0].od; ;
break;}
case 42:
#line 280 "basgram.y"
{ yyval.odcl.slots = yyvsp[-1].slist; yyval.odcl.decls = yyvsp[0].od; ;
break;}
case 43:
#line 285 "basgram.y"
{ yyval.od = yyvsp[-1].od; ;
break;}
case 44:
#line 287 "basgram.y"
{ yyvsp[-2].od->append(yyvsp[-1].od); yyval.od = yyvsp[-2].od; ;
break;}
case 45:
#line 292 "basgram.y"
{ yyval.stmt = yyvsp[-1].stmt; ;
break;}
case 46:
#line 294 "basgram.y"
{ yyval.stmt = yyvsp[0].stmt; ;
break;}
case 47:
#line 299 "basgram.y"
{ yyval.stmt = yyvsp[-1].ifnode; yyvsp[-1].ifnode->propagateSwitchExpr(yyvsp[-2].expr, false); ;
break;}
case 48:
#line 301 "basgram.y"
{ yyval.stmt = yyvsp[-1].ifnode; yyvsp[-1].ifnode->propagateSwitchExpr(yyvsp[-2].expr, true); ;
break;}
case 49:
#line 306 "basgram.y"
{ yyval.ifnode = IfStmtNode::alloc(yyvsp[-3].i, yyvsp[-2].expr, yyvsp[0].stmt, NULL, false); ;
break;}
case 50:
#line 308 "basgram.y"
{ yyval.ifnode = IfStmtNode::alloc(yyvsp[-6].i, yyvsp[-5].expr, yyvsp[-3].stmt, yyvsp[0].stmt, false); ;
break;}
case 51:
#line 310 "basgram.y"
{ yyval.ifnode = IfStmtNode::alloc(yyvsp[-4].i, yyvsp[-3].expr, yyvsp[-1].stmt, yyvsp[0].ifnode, true); ;
break;}
case 52:
#line 315 "basgram.y"
{ yyval.expr = yyvsp[0].expr;;
break;}
case 53:
#line 317 "basgram.y"
{ (yyvsp[-2].expr)->append(yyvsp[0].expr); yyval.expr=yyvsp[-2].expr; ;
break;}
case 54:
#line 322 "basgram.y"
{ yyval.stmt = IfStmtNode::alloc(yyvsp[-4].i, yyvsp[-3].expr, yyvsp[-1].stmt, NULL, false); ;
break;}
case 55:
#line 324 "basgram.y"
{ yyval.stmt = IfStmtNode::alloc(yyvsp[-6].i, yyvsp[-5].expr, yyvsp[-3].stmt, yyvsp[-1].stmt, false); ;
break;}
case 56:
#line 329 "basgram.y"
{ yyval.stmt = LoopStmtNode::alloc(yyvsp[-4].i, nil, yyvsp[-3].expr, nil, yyvsp[-1].stmt, false); ;
break;}
case 57:
#line 334 "basgram.y"
{ yyval.stmt = LoopStmtNode::alloc(yyvsp[-8].i, yyvsp[-7].expr, yyvsp[-5].expr, yyvsp[-3].expr, yyvsp[-1].stmt, false); ;
break;}
case 58:
#line 339 "basgram.y"
{ yyval.stmt = yyvsp[0].expr; ;
break;}
case 59:
#line 344 "basgram.y"
{ yyval.expr = yyvsp[0].expr; ;
break;}
case 60:
#line 346 "basgram.y"
{ yyval.expr = yyvsp[-1].expr; ;
break;}
case 61:
#line 348 "basgram.y"
{ yyval.expr = IntBinaryExprNode::alloc(yyvsp[-1].i, yyvsp[-2].expr, yyvsp[0].expr); ;
break;}
case 62:
#line 350 "basgram.y"
{ yyval.expr = IntBinaryExprNode::alloc(yyvsp[-1].i, yyvsp[-2].expr, yyvsp[0].expr); ;
break;}
case 63:
#line 352 "basgram.y"
{ yyval.expr = IntBinaryExprNode::alloc(yyvsp[-1].i, yyvsp[-2].expr, yyvsp[0].expr); ;
break;}
case 64:
#line 354 "basgram.y"
{ yyval.expr = IntBinaryExprNode::alloc(yyvsp[-1].i, yyvsp[-2].expr, yyvsp[0].expr); ;
break;}
case 65:
#line 356 "basgram.y"
{ yyval.expr = FloatBinaryExprNode::alloc(yyvsp[-1].i, yyvsp[-2].expr, yyvsp[0].expr); ;
break;}
case 66:
#line 358 "basgram.y"
{ yyval.expr = FloatBinaryExprNode::alloc(yyvsp[-1].i, yyvsp[-2].expr, yyvsp[0].expr); ;
break;}
case 67:
#line 360 "basgram.y"
{ yyval.expr = FloatBinaryExprNode::alloc(yyvsp[-1].i, yyvsp[-2].expr, yyvsp[0].expr); ;
break;}
case 68:
#line 362 "basgram.y"
{ yyval.expr = FloatBinaryExprNode::alloc(yyvsp[-1].i, yyvsp[-2].expr, yyvsp[0].expr); ;
break;}
case 69:
#line 364 "basgram.y"
{ yyval.expr = FloatUnaryExprNode::alloc(yyvsp[-1].i, yyvsp[0].expr); ;
break;}
case 70:
#line 366 "basgram.y"
{ yyval.expr = TTagDerefNode::alloc(yyvsp[0].expr); ;
break;}
case 71:
#line 368 "basgram.y"
{ yyval.expr = TTagExprNode::alloc(yyvsp[0].s); ;
break;}
case 72:
#line 370 "basgram.y"
{ yyval.expr = ConditionalExprNode::alloc(yyvsp[-4].expr, yyvsp[-2].expr, yyvsp[0].expr); ;
break;}
case 73:
#line 372 "basgram.y"
{ yyval.expr = IntBinaryExprNode::alloc(yyvsp[-1].i, yyvsp[-2].expr, yyvsp[0].expr); ;
break;}
case 74:
#line 374 "basgram.y"
{ yyval.expr = IntBinaryExprNode::alloc(yyvsp[-1].i, yyvsp[-2].expr, yyvsp[0].expr); ;
break;}
case 75:
#line 376 "basgram.y"
{ yyval.expr = IntBinaryExprNode::alloc(yyvsp[-1].i, yyvsp[-2].expr, yyvsp[0].expr); ;
break;}
case 76:
#line 378 "basgram.y"
{ yyval.expr = IntBinaryExprNode::alloc(yyvsp[-1].i, yyvsp[-2].expr, yyvsp[0].expr); ;
break;}
case 77:
#line 380 "basgram.y"
{ yyval.expr = IntBinaryExprNode::alloc(yyvsp[-1].i, yyvsp[-2].expr, yyvsp[0].expr); ;
break;}
case 78:
#line 382 "basgram.y"
{ yyval.expr = IntBinaryExprNode::alloc(yyvsp[-1].i, yyvsp[-2].expr, yyvsp[0].expr); ;
break;}
case 79:
#line 384 "basgram.y"
{ yyval.expr = IntBinaryExprNode::alloc(yyvsp[-1].i, yyvsp[-2].expr, yyvsp[0].expr); ;
break;}
case 80:
#line 386 "basgram.y"
{ yyval.expr = IntBinaryExprNode::alloc(yyvsp[-1].i, yyvsp[-2].expr, yyvsp[0].expr); ;
break;}
case 81:
#line 388 "basgram.y"
{ yyval.expr = IntBinaryExprNode::alloc(yyvsp[-1].i, yyvsp[-2].expr, yyvsp[0].expr); ;
break;}
case 82:
#line 390 "basgram.y"
{ yyval.expr = IntBinaryExprNode::alloc(yyvsp[-1].i, yyvsp[-2].expr, yyvsp[0].expr); ;
break;}
case 83:
#line 392 "basgram.y"
{ yyval.expr = StreqExprNode::alloc(yyvsp[-2].expr, yyvsp[0].expr, true); ;
break;}
case 84:
#line 394 "basgram.y"
{ yyval.expr = StreqExprNode::alloc(yyvsp[-2].expr, yyvsp[0].expr, false); ;
break;}
case 85:
#line 396 "basgram.y"
{ yyval.expr = StrcatExprNode::alloc(yyvsp[-2].expr, yyvsp[0].expr, yyvsp[-1].i); ;
break;}
case 86:
#line 398 "basgram.y"
{ yyval.expr = IntUnaryExprNode::alloc(yyvsp[-1].i, yyvsp[0].expr); ;
break;}
case 87:
#line 400 "basgram.y"
{ yyval.expr = IntUnaryExprNode::alloc(yyvsp[-1].i, yyvsp[0].expr); ;
break;}
case 88:
#line 402 "basgram.y"
{ yyval.expr = StrConstNode::alloc(yyvsp[0].str, true); ;
break;}
case 89:
#line 404 "basgram.y"
{ yyval.expr = FloatNode::alloc(yyvsp[0].f); ;
break;}
case 90:
#line 406 "basgram.y"
{ yyval.expr = IntNode::alloc(yyvsp[0].i); ;
break;}
case 91:
#line 408 "basgram.y"
{ yyval.expr = ConstantNode::alloc(StringTable->insert("break")); ;
break;}
case 92:
#line 410 "basgram.y"
{ yyval.expr = SlotAccessNode::alloc(yyvsp[0].slot.object, yyvsp[0].slot.array, yyvsp[0].slot.slotName); ;
break;}
case 93:
#line 412 "basgram.y"
{ yyval.expr = ConstantNode::alloc(yyvsp[0].s); ;
break;}
case 94:
#line 414 "basgram.y"
{ yyval.expr = StrConstNode::alloc(yyvsp[0].str, false); ;
break;}
case 95:
#line 416 "basgram.y"
{ yyval.expr = (ExprNode*)VarNode::alloc(yyvsp[0].s, NULL); ;
break;}
case 96:
#line 418 "basgram.y"
{ yyval.expr = (ExprNode*)VarNode::alloc(yyvsp[-3].s, yyvsp[-1].expr); ;
break;}
case 97:
#line 423 "basgram.y"
{ yyval.slot.object = yyvsp[-2].expr; yyval.slot.slotName = yyvsp[0].s; yyval.slot.array = NULL; ;
break;}
case 98:
#line 425 "basgram.y"
{ yyval.slot.object = yyvsp[-5].expr; yyval.slot.slotName = yyvsp[-3].s; yyval.slot.array = yyvsp[-1].expr; ;
break;}
case 99:
#line 430 "basgram.y"
{ yyval.expr = ConstantNode::alloc(yyvsp[0].s); ;
break;}
case 100:
#line 432 "basgram.y"
{ yyval.expr = yyvsp[-1].expr; ;
break;}
case 101:
#line 437 "basgram.y"
{ yyval.asn.token = '+'; yyval.asn.expr = FloatNode::alloc(1); ;
break;}
case 102:
#line 439 "basgram.y"
{ yyval.asn.token = '-'; yyval.asn.expr = FloatNode::alloc(1); ;
break;}
case 103:
#line 441 "basgram.y"
{ yyval.asn.token = '+'; yyval.asn.expr = yyvsp[0].expr; ;
break;}
case 104:
#line 443 "basgram.y"
{ yyval.asn.token = '-'; yyval.asn.expr = yyvsp[0].expr; ;
break;}
case 105:
#line 445 "basgram.y"
{ yyval.asn.token = '*'; yyval.asn.expr = yyvsp[0].expr; ;
break;}
case 106:
#line 447 "basgram.y"
{ yyval.asn.token = '/'; yyval.asn.expr = yyvsp[0].expr; ;
break;}
case 107:
#line 449 "basgram.y"
{ yyval.asn.token = '%'; yyval.asn.expr = yyvsp[0].expr; ;
break;}
case 108:
#line 451 "basgram.y"
{ yyval.asn.token = '&'; yyval.asn.expr = yyvsp[0].expr; ;
break;}
case 109:
#line 453 "basgram.y"
{ yyval.asn.token = '^'; yyval.asn.expr = yyvsp[0].expr; ;
break;}
case 110:
#line 455 "basgram.y"
{ yyval.asn.token = '|'; yyval.asn.expr = yyvsp[0].expr; ;
break;}
case 111:
#line 457 "basgram.y"
{ yyval.asn.token = opSHL; yyval.asn.expr = yyvsp[0].expr; ;
break;}
case 112:
#line 459 "basgram.y"
{ yyval.asn.token = opSHR; yyval.asn.expr = yyvsp[0].expr; ;
break;}
case 113:
#line 464 "basgram.y"
{ yyval.expr = yyvsp[0].expr; ;
break;}
case 114:
#line 466 "basgram.y"
{ yyval.expr = yyvsp[0].od; ;
break;}
case 115:
#line 468 "basgram.y"
{ yyval.expr = AssignExprNode::alloc(yyvsp[-2].s, NULL, yyvsp[0].expr); ;
break;}
case 116:
#line 470 "basgram.y"
{ yyval.expr = AssignExprNode::alloc(yyvsp[-5].s, yyvsp[-3].expr, yyvsp[0].expr); ;
break;}
case 117:
#line 472 "basgram.y"
{ yyval.expr = AssignOpExprNode::alloc(yyvsp[-1].s, NULL, yyvsp[0].asn.expr, yyvsp[0].asn.token); ;
break;}
case 118:
#line 474 "basgram.y"
{ yyval.expr = AssignOpExprNode::alloc(yyvsp[-4].s, yyvsp[-2].expr, yyvsp[0].asn.expr, yyvsp[0].asn.token); ;
break;}
case 119:
#line 476 "basgram.y"
{ yyval.expr = SlotAssignOpNode::alloc(yyvsp[-1].slot.object, yyvsp[-1].slot.slotName, yyvsp[-1].slot.array, yyvsp[0].asn.token, yyvsp[0].asn.expr); ;
break;}
case 120:
#line 478 "basgram.y"
{ yyval.expr = SlotAssignNode::alloc(yyvsp[-2].slot.object, yyvsp[-2].slot.array, yyvsp[-2].slot.slotName, yyvsp[0].expr); ;
break;}
case 121:
#line 480 "basgram.y"
{ yyval.expr = SlotAssignNode::alloc(yyvsp[-4].slot.object, yyvsp[-4].slot.array, yyvsp[-4].slot.slotName, yyvsp[-1].expr); ;
break;}
case 122:
#line 485 "basgram.y"
{ yyval.expr = FuncCallExprNode::alloc(yyvsp[-3].s, NULL, yyvsp[-1].expr, false); ;
break;}
case 123:
#line 487 "basgram.y"
{ yyval.expr = FuncCallExprNode::alloc(yyvsp[-3].s, yyvsp[-5].s, yyvsp[-1].expr, false); ;
break;}
case 124:
#line 489 "basgram.y"
{ yyvsp[-5].expr->append(yyvsp[-1].expr); yyval.expr = FuncCallExprNode::alloc(yyvsp[-3].s, NULL, yyvsp[-5].expr, true); ;
break;}
case 125:
#line 494 "basgram.y"
{ yyval.expr = NULL; ;
break;}
case 126:
#line 496 "basgram.y"
{ yyval.expr = yyvsp[0].expr; ;
break;}
case 127:
#line 501 "basgram.y"
{ yyval.expr = yyvsp[0].expr; ;
break;}
case 128:
#line 503 "basgram.y"
{ (yyvsp[-2].expr)->append(yyvsp[0].expr); yyval.expr = yyvsp[-2].expr; ;
break;}
case 129:
#line 508 "basgram.y"
{ yyval.slist = yyvsp[0].slist; ;
break;}
case 130:
#line 510 "basgram.y"
{ yyvsp[-1].slist->append(yyvsp[0].slist); yyval.slist = yyvsp[-1].slist; ;
break;}
case 131:
#line 515 "basgram.y"
{ yyval.slist = SlotAssignNode::alloc(NULL, NULL, yyvsp[-3].s, yyvsp[-1].expr); ;
break;}
case 132:
#line 517 "basgram.y"
{ yyval.slist = SlotAssignNode::alloc(NULL, NULL, StringTable->insert("datablock"), yyvsp[-1].expr); ;
break;}
case 133:
#line 519 "basgram.y"
{ yyval.slist = SlotAssignNode::alloc(NULL, yyvsp[-4].expr, yyvsp[-6].s, yyvsp[-1].expr); ;
break;}
case 134:
#line 524 "basgram.y"
{ yyval.expr = yyvsp[0].expr; ;
break;}
case 135:
#line 526 "basgram.y"
{ yyval.expr = CommaCatExprNode::alloc(yyvsp[-2].expr, yyvsp[0].expr); ;
break;}
}
/* the action file gets copied in in place of this dollarsign */
#line 487 "bison.simple"
yyvsp -= yylen;
yyssp -= yylen;
#ifdef YYLSP_NEEDED
yylsp -= yylen;
#endif
#if YYDEBUG != 0
if (yydebug)
{
short *ssp1 = yyss - 1;
fprintf (stderr, "state stack now");
while (ssp1 != yyssp)
fprintf (stderr, " %d", *++ssp1);
fprintf (stderr, "\n");
}
#endif
*++yyvsp = yyval;
#ifdef YYLSP_NEEDED
yylsp++;
if (yylen == 0)
{
yylsp->first_line = yylloc.first_line;
yylsp->first_column = yylloc.first_column;
yylsp->last_line = (yylsp-1)->last_line;
yylsp->last_column = (yylsp-1)->last_column;
yylsp->text = 0;
}
else
{
yylsp->last_line = (yylsp+yylen-1)->last_line;
yylsp->last_column = (yylsp+yylen-1)->last_column;
}
#endif
/* Now "shift" the result of the reduction.
Determine what state that goes to,
based on the state we popped back to
and the rule number reduced by. */
yyn = yyr1[yyn];
yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
yystate = yytable[yystate];
else
yystate = yydefgoto[yyn - YYNTBASE];
goto yynewstate;
yyerrlab: /* here on detecting error */
if (! yyerrstatus)
/* If not already recovering from an error, report this error. */
{
++yynerrs;
#ifdef YYERROR_VERBOSE
yyn = yypact[yystate];
if (yyn > YYFLAG && yyn < YYLAST)
{
int size = 0;
char *msg;
int x, count;
count = 0;
/* Start X at -yyn if nec to avoid negative indexes in yycheck. */
for (x = (yyn < 0 ? -yyn : 0);
x < (sizeof(yytname) / sizeof(char *)); x++)
if (yycheck[x + yyn] == x)
size += strlen(yytname[x]) + 15, count++;
msg = (char *) malloc(size + 15);
if (msg != 0)
{
strcpy(msg, "parse error");
if (count < 5)
{
count = 0;
for (x = (yyn < 0 ? -yyn : 0);
x < (sizeof(yytname) / sizeof(char *)); x++)
if (yycheck[x + yyn] == x)
{
strcat(msg, count == 0 ? ", expecting `" : " or `");
strcat(msg, yytname[x]);
strcat(msg, "'");
count++;
}
}
yyerror(msg);
free(msg);
}
else
yyerror ("parse error; also virtual memory exceeded");
}
else
#endif /* YYERROR_VERBOSE */
yyerror("parse error");
}
goto yyerrlab1;
yyerrlab1: /* here on error raised explicitly by an action */
if (yyerrstatus == 3)
{
/* if just tried and failed to reuse lookahead token after an error, discard it. */
/* return failure if at end of input */
if (yychar == YYEOF)
YYABORT;
#if YYDEBUG != 0
if (yydebug)
fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
#endif
yychar = YYEMPTY;
}
/* Else will try to reuse lookahead token
after shifting the error token. */
yyerrstatus = 3; /* Each real token shifted decrements this */
goto yyerrhandle;
yyerrdefault: /* current state does not do anything special for the error token. */
#if 0
/* This is wrong; only states that explicitly want error tokens
should shift them. */
yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/
if (yyn) goto yydefault;
#endif
yyerrpop: /* pop the current state because it cannot handle the error token */
if (yyssp == yyss) YYABORT;
yyvsp--;
yystate = *--yyssp;
#ifdef YYLSP_NEEDED
yylsp--;
#endif
#if YYDEBUG != 0
if (yydebug)
{
short *ssp1 = yyss - 1;
fprintf (stderr, "Error: state stack now");
while (ssp1 != yyssp)
fprintf (stderr, " %d", *++ssp1);
fprintf (stderr, "\n");
}
#endif
yyerrhandle:
yyn = yypact[yystate];
if (yyn == YYFLAG)
goto yyerrdefault;
yyn += YYTERROR;
if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
goto yyerrdefault;
yyn = yytable[yyn];
if (yyn < 0)
{
if (yyn == YYFLAG)
goto yyerrpop;
yyn = -yyn;
goto yyreduce;
}
else if (yyn == 0)
goto yyerrpop;
if (yyn == YYFINAL)
YYACCEPT;
#if YYDEBUG != 0
if (yydebug)
fprintf(stderr, "Shifting error token, ");
#endif
*++yyvsp = yylval;
#ifdef YYLSP_NEEDED
*++yylsp = yylloc;
#endif
yystate = yyn;
goto yynewstate;
}
#line 532 "basgram.y"