source: webkit/trunk/JavaScriptCore/kjs/grammar.cpp@ 2740

Last change on this file since 2740 was 2735, checked in by mjs, 23 years ago

Change ArgumentListNode operations to be iterative instead of
recursive. This probably fixes 3095446 (Crash in
KJS::ArgumentListNode::ref()) but I can't reproduce it myself so
I'm not 100% sure. I think the original bug was a stack overflow
and this change would remove that possibility.

  • kjs/nodes.cpp: (ArgumentListNode::ref): Make iterative. (ArgumentListNode::deref): Make iterative. (ArgumentListNode::evaluateList): Make iterative.
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 78.2 KB
Line 
1
2/* A Bison parser, made from grammar.y
3 by GNU Bison version 1.28 */
4
5#define YYBISON 1 /* Identify Bison output. */
6
7#define yyparse kjsyyparse
8#define yylex kjsyylex
9#define yyerror kjsyyerror
10#define yylval kjsyylval
11#define yychar kjsyychar
12#define yydebug kjsyydebug
13#define yynerrs kjsyynerrs
14#define YYLSP_NEEDED
15
16#define NULLTOKEN 257
17#define TRUETOKEN 258
18#define FALSETOKEN 259
19#define STRING 260
20#define NUMBER 261
21#define BREAK 262
22#define CASE 263
23#define DEFAULT 264
24#define FOR 265
25#define NEW 266
26#define VAR 267
27#define CONTINUE 268
28#define FUNCTION 269
29#define RETURN 270
30#define VOID 271
31#define DELETE 272
32#define IF 273
33#define THIS 274
34#define DO 275
35#define WHILE 276
36#define ELSE 277
37#define IN 278
38#define INSTANCEOF 279
39#define TYPEOF 280
40#define SWITCH 281
41#define WITH 282
42#define RESERVED 283
43#define THROW 284
44#define TRY 285
45#define CATCH 286
46#define FINALLY 287
47#define EQEQ 288
48#define NE 289
49#define STREQ 290
50#define STRNEQ 291
51#define LE 292
52#define GE 293
53#define OR 294
54#define AND 295
55#define PLUSPLUS 296
56#define MINUSMINUS 297
57#define LSHIFT 298
58#define RSHIFT 299
59#define URSHIFT 300
60#define PLUSEQUAL 301
61#define MINUSEQUAL 302
62#define MULTEQUAL 303
63#define DIVEQUAL 304
64#define LSHIFTEQUAL 305
65#define RSHIFTEQUAL 306
66#define URSHIFTEQUAL 307
67#define ANDEQUAL 308
68#define MODEQUAL 309
69#define XOREQUAL 310
70#define OREQUAL 311
71#define IDENT 312
72#define AUTOPLUSPLUS 313
73#define AUTOMINUSMINUS 314
74
75#line 1 "grammar.y"
76
77
78/*
79 * This file is part of the KDE libraries
80 * Copyright (C) 1999-2000 Harri Porten ([email protected])
81 *
82 * This library is free software; you can redistribute it and/or
83 * modify it under the terms of the GNU Lesser General Public
84 * License as published by the Free Software Foundation; either
85 * version 2 of the License, or (at your option) any later version.
86 *
87 * This library is distributed in the hope that it will be useful,
88 * but WITHOUT ANY WARRANTY; without even the implied warranty of
89 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
90 * Lesser General Public License for more details.
91 *
92 * You should have received a copy of the GNU Lesser General Public
93 * License along with this library; if not, write to the Free Software
94 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
95 *
96 */
97
98#ifdef HAVE_CONFIG_H
99#include <config.h>
100#endif
101#include <string.h>
102#include <stdlib.h>
103#include "value.h"
104#include "object.h"
105#include "types.h"
106#include "interpreter.h"
107#include "nodes.h"
108#include "lexer.h"
109#include "internal.h"
110
111/* default values for bison */
112#define YYDEBUG 0
113#define YYMAXDEPTH 0
114#if !APPLE_CHANGES
115#define YYERROR_VERBOSE
116#endif
117#define DBG(l, s, e) { l->setLoc(s.first_line, e.last_line, Parser::sid); } // location
118
119extern int yylex();
120int yyerror (const char *);
121bool automatic();
122
123using namespace KJS;
124
125
126#line 52 "grammar.y"
127typedef union {
128 int ival;
129 double dval;
130 UString *ustr;
131 Node *node;
132 StatementNode *stat;
133 ParameterNode *param;
134 FunctionBodyNode *body;
135 FuncDeclNode *func;
136 ProgramNode *prog;
137 AssignExprNode *init;
138 SourceElementNode *src;
139 SourceElementsNode *srcs;
140 StatListNode *slist;
141 ArgumentsNode *args;
142 ArgumentListNode *alist;
143 VarDeclNode *decl;
144 VarDeclListNode *vlist;
145 CaseBlockNode *cblk;
146 ClauseListNode *clist;
147 CaseClauseNode *ccl;
148 ElementNode *elm;
149 ElisionNode *eli;
150 Operator op;
151} YYSTYPE;
152
153#ifndef YYLTYPE
154typedef
155 struct yyltype
156 {
157 int timestamp;
158 int first_line;
159 int first_column;
160 int last_line;
161 int last_column;
162 char *text;
163 }
164 yyltype;
165
166#define YYLTYPE yyltype
167#endif
168
169#include <stdio.h>
170
171#ifndef __cplusplus
172#ifndef __STDC__
173#define const
174#endif
175#endif
176
177
178
179#define YYFINAL 358
180#define YYFLAG -32768
181#define YYNTBASE 85
182
183#define YYTRANSLATE(x) ((unsigned)(x) <= 314 ? yytranslate[x] : 149)
184
185static const char yytranslate[] = { 0,
186 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
187 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
188 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
189 2, 2, 74, 2, 2, 2, 76, 79, 2, 62,
190 63, 75, 71, 68, 72, 70, 61, 2, 2, 2,
191 2, 2, 2, 2, 2, 2, 2, 69, 84, 77,
192 83, 78, 82, 2, 2, 2, 2, 2, 2, 2,
193 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
194 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
195 66, 2, 67, 80, 2, 2, 2, 2, 2, 2,
196 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
197 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
198 2, 2, 64, 81, 65, 73, 2, 2, 2, 2,
199 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
200 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
201 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
202 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
203 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
204 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
205 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
206 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
207 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
208 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
209 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
210 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
211 2, 2, 2, 2, 2, 1, 3, 4, 5, 6,
212 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
213 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
214 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
215 37, 38, 39, 40, 41, 42, 43, 44, 45, 46,
216 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
217 57, 58, 59, 60
218};
219
220#if YYDEBUG != 0
221static const short yyprhs[] = { 0,
222 0, 2, 4, 6, 8, 10, 12, 14, 16, 18,
223 20, 22, 26, 29, 33, 37, 41, 47, 50, 55,
224 56, 58, 60, 63, 67, 73, 75, 77, 79, 81,
225 83, 88, 92, 96, 98, 101, 104, 107, 112, 116,
226 119, 123, 125, 129, 131, 133, 135, 138, 141, 143,
227 146, 149, 152, 155, 158, 161, 164, 167, 170, 173,
228 176, 178, 182, 186, 190, 192, 196, 200, 202, 206,
229 210, 214, 216, 220, 224, 228, 232, 236, 240, 242,
230 246, 250, 254, 258, 260, 264, 266, 270, 272, 276,
231 278, 282, 284, 288, 290, 296, 298, 302, 304, 306,
232 308, 310, 312, 314, 316, 318, 320, 322, 324, 326,
233 328, 332, 334, 336, 338, 340, 342, 344, 346, 348,
234 350, 352, 354, 356, 358, 360, 363, 367, 369, 372,
235 376, 380, 382, 386, 388, 391, 394, 396, 399, 402,
236 408, 416, 423, 429, 439, 450, 458, 467, 477, 478,
237 480, 483, 486, 490, 494, 497, 500, 504, 508, 511,
238 514, 518, 522, 528, 534, 538, 544, 545, 547, 549,
239 552, 556, 561, 564, 568, 572, 576, 580, 584, 589,
240 595, 598, 604, 611, 616, 622, 624, 628, 631, 635,
241 636, 638, 640, 643, 645
242};
243
244static const short yyrhs[] = { 3,
245 0, 4, 0, 5, 0, 7, 0, 6, 0, 61,
246 0, 50, 0, 20, 0, 58, 0, 85, 0, 87,
247 0, 62, 114, 63, 0, 64, 65, 0, 64, 91,
248 65, 0, 66, 89, 67, 0, 66, 88, 67, 0,
249 66, 88, 68, 89, 67, 0, 89, 112, 0, 88,
250 68, 89, 112, 0, 0, 90, 0, 68, 0, 90,
251 68, 0, 92, 69, 112, 0, 91, 68, 92, 69,
252 112, 0, 58, 0, 6, 0, 7, 0, 86, 0,
253 143, 0, 93, 66, 114, 67, 0, 93, 70, 58,
254 0, 12, 93, 96, 0, 93, 0, 12, 94, 0,
255 93, 96, 0, 95, 96, 0, 95, 66, 114, 67,
256 0, 95, 70, 58, 0, 62, 63, 0, 62, 97,
257 63, 0, 112, 0, 112, 68, 97, 0, 94, 0,
258 95, 0, 98, 0, 98, 42, 0, 98, 43, 0,
259 99, 0, 18, 100, 0, 17, 100, 0, 26, 100,
260 0, 42, 100, 0, 59, 100, 0, 43, 100, 0,
261 60, 100, 0, 71, 100, 0, 72, 100, 0, 73,
262 100, 0, 74, 100, 0, 100, 0, 101, 75, 100,
263 0, 101, 61, 100, 0, 101, 76, 100, 0, 101,
264 0, 102, 71, 101, 0, 102, 72, 101, 0, 102,
265 0, 103, 44, 102, 0, 103, 45, 102, 0, 103,
266 46, 102, 0, 103, 0, 104, 77, 103, 0, 104,
267 78, 103, 0, 104, 38, 103, 0, 104, 39, 103,
268 0, 104, 25, 103, 0, 104, 24, 103, 0, 104,
269 0, 105, 34, 104, 0, 105, 35, 104, 0, 105,
270 36, 104, 0, 105, 37, 104, 0, 105, 0, 106,
271 79, 105, 0, 106, 0, 107, 80, 105, 0, 107,
272 0, 108, 81, 105, 0, 108, 0, 109, 41, 108,
273 0, 109, 0, 110, 40, 109, 0, 110, 0, 110,
274 82, 112, 69, 112, 0, 111, 0, 98, 113, 112,
275 0, 83, 0, 47, 0, 48, 0, 49, 0, 50,
276 0, 51, 0, 52, 0, 53, 0, 54, 0, 56,
277 0, 57, 0, 55, 0, 112, 0, 114, 68, 112,
278 0, 116, 0, 118, 0, 122, 0, 123, 0, 124,
279 0, 125, 0, 127, 0, 128, 0, 129, 0, 130,
280 0, 131, 0, 137, 0, 138, 0, 139, 0, 64,
281 65, 0, 64, 147, 65, 0, 115, 0, 117, 115,
282 0, 13, 119, 84, 0, 13, 119, 1, 0, 120,
283 0, 119, 68, 120, 0, 58, 0, 58, 121, 0,
284 83, 112, 0, 84, 0, 114, 84, 0, 114, 1,
285 0, 19, 62, 114, 63, 115, 0, 19, 62, 114,
286 63, 115, 23, 115, 0, 21, 115, 22, 62, 114,
287 63, 0, 22, 62, 114, 63, 115, 0, 11, 62,
288 126, 84, 126, 84, 126, 63, 115, 0, 11, 62,
289 13, 119, 84, 126, 84, 126, 63, 115, 0, 11,
290 62, 98, 24, 114, 63, 115, 0, 11, 62, 13,
291 58, 24, 114, 63, 115, 0, 11, 62, 13, 58,
292 121, 24, 114, 63, 115, 0, 0, 114, 0, 14,
293 84, 0, 14, 1, 0, 14, 58, 84, 0, 14,
294 58, 1, 0, 8, 84, 0, 8, 1, 0, 8,
295 58, 84, 0, 8, 58, 1, 0, 16, 84, 0,
296 16, 1, 0, 16, 114, 84, 0, 16, 114, 1,
297 0, 28, 62, 114, 63, 115, 0, 27, 62, 114,
298 63, 132, 0, 64, 133, 65, 0, 64, 133, 136,
299 133, 65, 0, 0, 134, 0, 135, 0, 134, 135,
300 0, 9, 114, 69, 0, 9, 114, 69, 117, 0,
301 10, 69, 0, 10, 69, 117, 0, 58, 69, 115,
302 0, 30, 114, 84, 0, 31, 116, 140, 0, 31,
303 116, 141, 0, 31, 116, 140, 141, 0, 32, 62,
304 58, 63, 116, 0, 33, 116, 0, 15, 58, 62,
305 63, 145, 0, 15, 58, 62, 144, 63, 145, 0,
306 15, 62, 63, 145, 0, 15, 62, 144, 63, 145,
307 0, 58, 0, 144, 68, 58, 0, 64, 65, 0,
308 64, 147, 65, 0, 0, 147, 0, 148, 0, 148,
309 147, 0, 115, 0, 142, 0
310};
311
312#endif
313
314#if YYDEBUG != 0
315static const short yyrline[] = { 0,
316 159, 161, 162, 163, 164, 165, 168, 174, 176, 178,
317 179, 180, 181, 182, 185, 187, 188, 191, 193, 197,
318 199, 202, 204, 207, 209, 213, 216, 217, 220, 222,
319 223, 224, 226, 229, 231, 234, 236, 237, 238, 242,
320 244, 247, 250, 256, 258, 261, 263, 264, 267, 269,
321 270, 271, 272, 273, 274, 275, 276, 277, 278, 279,
322 282, 284, 285, 286, 289, 291, 292, 295, 297, 298,
323 299, 302, 304, 306, 308, 310, 312, 314, 318, 320,
324 321, 322, 323, 326, 328, 331, 333, 336, 338, 341,
325 343, 347, 349, 353, 355, 359, 361, 365, 367, 368,
326 369, 370, 371, 372, 373, 374, 375, 376, 377, 380,
327 382, 385, 387, 388, 389, 390, 391, 392, 393, 394,
328 395, 396, 397, 398, 399, 402, 404, 407, 409, 412,
329 415, 424, 426, 430, 432, 435, 439, 443, 446, 453,
330 455, 459, 461, 462, 465, 468, 471, 475, 481, 483,
331 486, 488, 492, 494, 501, 503, 507, 509, 517, 519,
332 523, 524, 530, 535, 540, 542, 546, 548, 551, 553,
333 556, 558, 561, 563, 566, 572, 576, 578, 579, 582,
334 586, 590, 593, 597, 599, 604, 606, 610, 613, 617,
335 620, 624, 627, 633, 635
336};
337#endif
338
339
340#if YYDEBUG != 0 || defined (YYERROR_VERBOSE)
341
342static const char * const yytname[] = { "$","error","$undefined.","NULLTOKEN",
343"TRUETOKEN","FALSETOKEN","STRING","NUMBER","BREAK","CASE","DEFAULT","FOR","NEW",
344"VAR","CONTINUE","FUNCTION","RETURN","VOID","DELETE","IF","THIS","DO","WHILE",
345"ELSE","IN","INSTANCEOF","TYPEOF","SWITCH","WITH","RESERVED","THROW","TRY","CATCH",
346"FINALLY","EQEQ","NE","STREQ","STRNEQ","LE","GE","OR","AND","PLUSPLUS","MINUSMINUS",
347"LSHIFT","RSHIFT","URSHIFT","PLUSEQUAL","MINUSEQUAL","MULTEQUAL","DIVEQUAL",
348"LSHIFTEQUAL","RSHIFTEQUAL","URSHIFTEQUAL","ANDEQUAL","MODEQUAL","XOREQUAL",
349"OREQUAL","IDENT","AUTOPLUSPLUS","AUTOMINUSMINUS","'/'","'('","')'","'{'","'}'",
350"'['","']'","','","':'","'.'","'+'","'-'","'~'","'!'","'*'","'%'","'<'","'>'",
351"'&'","'^'","'|'","'?'","'='","';'","Literal","PrimaryExpr","ArrayLiteral","ElementList",
352"ElisionOpt","Elision","PropertyNameAndValueList","PropertyName","MemberExpr",
353"NewExpr","CallExpr","Arguments","ArgumentList","LeftHandSideExpr","PostfixExpr",
354"UnaryExpr","MultiplicativeExpr","AdditiveExpr","ShiftExpr","RelationalExpr",
355"EqualityExpr","BitwiseANDExpr","BitwiseXORExpr","BitwiseORExpr","LogicalANDExpr",
356"LogicalORExpr","ConditionalExpr","AssignmentExpr","AssignmentOperator","Expr",
357"Statement","Block","StatementList","VariableStatement","VariableDeclarationList",
358"VariableDeclaration","Initializer","EmptyStatement","ExprStatement","IfStatement",
359"IterationStatement","ExprOpt","ContinueStatement","BreakStatement","ReturnStatement",
360"WithStatement","SwitchStatement","CaseBlock","CaseClausesOpt","CaseClauses",
361"CaseClause","DefaultClause","LabelledStatement","ThrowStatement","TryStatement",
362"Catch","Finally","FunctionDeclaration","FunctionExpr","FormalParameterList",
363"FunctionBody","Program","SourceElements","SourceElement", NULL
364};
365#endif
366
367static const short yyr1[] = { 0,
368 85, 85, 85, 85, 85, 85, 85, 86, 86, 86,
369 86, 86, 86, 86, 87, 87, 87, 88, 88, 89,
370 89, 90, 90, 91, 91, 92, 92, 92, 93, 93,
371 93, 93, 93, 94, 94, 95, 95, 95, 95, 96,
372 96, 97, 97, 98, 98, 99, 99, 99, 100, 100,
373 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
374 101, 101, 101, 101, 102, 102, 102, 103, 103, 103,
375 103, 104, 104, 104, 104, 104, 104, 104, 105, 105,
376 105, 105, 105, 106, 106, 107, 107, 108, 108, 109,
377 109, 110, 110, 111, 111, 112, 112, 113, 113, 113,
378 113, 113, 113, 113, 113, 113, 113, 113, 113, 114,
379 114, 115, 115, 115, 115, 115, 115, 115, 115, 115,
380 115, 115, 115, 115, 115, 116, 116, 117, 117, 118,
381 118, 119, 119, 120, 120, 121, 122, 123, 123, 124,
382 124, 125, 125, 125, 125, 125, 125, 125, 126, 126,
383 127, 127, 127, 127, 128, 128, 128, 128, 129, 129,
384 129, 129, 130, 131, 132, 132, 133, 133, 134, 134,
385 135, 135, 136, 136, 137, 138, 139, 139, 139, 140,
386 141, 142, 142, 143, 143, 144, 144, 145, 145, 146,
387 146, 147, 147, 148, 148
388};
389
390static const short yyr2[] = { 0,
391 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
392 1, 3, 2, 3, 3, 3, 5, 2, 4, 0,
393 1, 1, 2, 3, 5, 1, 1, 1, 1, 1,
394 4, 3, 3, 1, 2, 2, 2, 4, 3, 2,
395 3, 1, 3, 1, 1, 1, 2, 2, 1, 2,
396 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
397 1, 3, 3, 3, 1, 3, 3, 1, 3, 3,
398 3, 1, 3, 3, 3, 3, 3, 3, 1, 3,
399 3, 3, 3, 1, 3, 1, 3, 1, 3, 1,
400 3, 1, 3, 1, 5, 1, 3, 1, 1, 1,
401 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
402 3, 1, 1, 1, 1, 1, 1, 1, 1, 1,
403 1, 1, 1, 1, 1, 2, 3, 1, 2, 3,
404 3, 1, 3, 1, 2, 2, 1, 2, 2, 5,
405 7, 6, 5, 9, 10, 7, 8, 9, 0, 1,
406 2, 2, 3, 3, 2, 2, 3, 3, 2, 2,
407 3, 3, 5, 5, 3, 5, 0, 1, 1, 2,
408 3, 4, 2, 3, 3, 3, 3, 3, 4, 5,
409 2, 5, 6, 4, 5, 1, 3, 2, 3, 0,
410 1, 1, 2, 1, 1
411};
412
413static const short yydefact[] = { 190,
414 1, 2, 3, 5, 4, 0, 0, 0, 0, 0,
415 0, 0, 0, 0, 0, 8, 0, 0, 0, 0,
416 0, 0, 0, 0, 0, 7, 9, 0, 0, 6,
417 0, 0, 20, 0, 0, 0, 0, 137, 10, 29,
418 11, 34, 44, 45, 46, 49, 61, 65, 68, 72,
419 79, 84, 86, 88, 90, 92, 94, 96, 110, 0,
420 194, 112, 113, 114, 115, 116, 117, 118, 119, 120,
421 121, 122, 123, 124, 125, 195, 30, 191, 192, 156,
422 0, 155, 149, 0, 9, 0, 34, 35, 134, 0,
423 132, 152, 0, 151, 0, 0, 160, 159, 0, 46,
424 51, 50, 0, 0, 0, 52, 0, 0, 0, 0,
425 0, 53, 55, 0, 54, 56, 0, 5, 4, 9,
426 13, 0, 0, 0, 22, 0, 0, 21, 57, 58,
427 59, 60, 0, 0, 0, 36, 0, 0, 37, 47,
428 48, 99, 100, 101, 102, 103, 104, 105, 106, 109,
429 107, 108, 98, 0, 0, 0, 0, 0, 0, 0,
430 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
431 0, 0, 0, 0, 0, 0, 0, 0, 139, 0,
432 138, 193, 158, 157, 0, 46, 150, 0, 27, 28,
433 26, 13, 33, 0, 135, 131, 0, 130, 154, 153,
434 0, 186, 0, 0, 162, 161, 0, 0, 0, 0,
435 0, 176, 126, 0, 0, 177, 178, 175, 12, 14,
436 0, 0, 127, 16, 20, 15, 18, 23, 40, 0,
437 42, 0, 32, 0, 39, 97, 63, 62, 64, 66,
438 67, 69, 70, 71, 78, 77, 75, 76, 73, 74,
439 80, 81, 82, 83, 85, 87, 89, 91, 93, 0,
440 111, 134, 0, 0, 149, 136, 133, 0, 0, 0,
441 184, 0, 0, 0, 0, 0, 0, 0, 0, 181,
442 179, 0, 24, 0, 41, 0, 31, 38, 0, 0,
443 135, 149, 0, 0, 182, 0, 188, 0, 185, 187,
444 140, 0, 143, 167, 164, 163, 0, 0, 17, 19,
445 43, 95, 0, 0, 0, 0, 149, 183, 189, 0,
446 142, 0, 0, 168, 169, 0, 25, 0, 0, 149,
447 146, 0, 141, 0, 0, 165, 167, 170, 180, 147,
448 0, 0, 0, 171, 173, 0, 148, 0, 144, 128,
449 172, 174, 166, 145, 129, 0, 0, 0
450};
451
452static const short yydefgoto[] = { 39,
453 40, 41, 126, 127, 128, 122, 123, 42, 43, 44,
454 136, 230, 45, 46, 47, 48, 49, 50, 51, 52,
455 53, 54, 55, 56, 57, 58, 59, 154, 60, 61,
456 62, 351, 63, 90, 91, 195, 64, 65, 66, 67,
457 188, 68, 69, 70, 71, 72, 305, 323, 324, 325,
458 337, 73, 74, 75, 216, 217, 76, 77, 204, 271,
459 356, 124, 79
460};
461
462static const short yypact[] = { 631,
463-32768,-32768,-32768,-32768,-32768, 3, -38, 111, -24, 5,
464 -14, 335, 1066, 1066, -12,-32768, 705, 9, 1066, 47,
465 51, 1066, 0, 1066, 1066,-32768, 50, 1066, 1066,-32768,
466 1066, 409, 12, 1066, 1066, 1066, 1066,-32768,-32768,-32768,
467-32768, 42,-32768, 83, 315,-32768,-32768, 71, -25, 38,
468 82, 239, 54, 68, 84, 133, -23,-32768,-32768, 11,
469-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
470-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 631,-32768,
471 6,-32768, 778, 114,-32768, 45, 42,-32768, 105, 17,
472-32768,-32768, 7,-32768, 129, -42,-32768,-32768, 18, 112,
473-32768,-32768, 1066, 230, 1066,-32768, 1066, 1066, -45, 483,
474 162,-32768,-32768, 705,-32768,-32768, -6, 150, 176, 50,
475 220, -37, 185, 212,-32768, 154, 850, 196,-32768,-32768,
476-32768,-32768, 922, 1066, 224,-32768, 1066, 234,-32768,-32768,
477-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
478-32768,-32768,-32768, 1066, 1066, 1066, 1066, 1066, 1066, 1066,
479 1066, 1066, 1066, 1066, 1066, 1066, 1066, 1066, 1066, 1066,
480 1066, 1066, 1066, 1066, 1066, 1066, 1066, 1066,-32768, 1066,
481-32768,-32768,-32768,-32768, 244, 87, 238, 225,-32768,-32768,
482-32768,-32768,-32768, 1066,-32768,-32768, -24,-32768,-32768,-32768,
483 64,-32768, 243, 100,-32768,-32768, 103, 248, 121, 122,
484 124,-32768,-32768, 250, 0, 281,-32768,-32768,-32768,-32768,
485 35, 1066,-32768,-32768, 12,-32768,-32768,-32768,-32768, 252,
486 249, 223,-32768, 228,-32768,-32768,-32768,-32768,-32768, 71,
487 71, -25, -25, -25, 38, 38, 38, 38, 38, 38,
488 82, 82, 82, 82, 239, 239, 239, 84, 133, 247,
489-32768, -15, -41, 1066, 1066,-32768,-32768, 243, 181, 557,
490-32768, 243, 260, 705, 1066, 705, 255, 705, 262,-32768,
491-32768, 253,-32768, 994,-32768, 1066,-32768,-32768, 1066, 1066,
492 299, 1066, 190, 241,-32768, 243,-32768, 264,-32768,-32768,
493 307, 197,-32768, 323,-32768,-32768, 270, 1066,-32768,-32768,
494-32768,-32768, 199, 1066, 259, 705, 1066,-32768,-32768, 705,
495-32768, 1066, 23, 323,-32768, 0,-32768, 705, 200, 1066,
496-32768, 274,-32768, 229, 275,-32768, 323,-32768,-32768,-32768,
497 705, 282, 705, 705, 705, 283,-32768, 705,-32768,-32768,
498 705, 705,-32768,-32768,-32768, 346, 349,-32768
499};
500
501static const short yypgoto[] = {-32768,
502-32768,-32768,-32768, 126,-32768,-32768, 135, 351, 352,-32768,
503 -34, 88, 41,-32768, 1, 142, -10, 15, 117, 96,
504-32768,-32768, 178, 198,-32768,-32768, -122,-32768, -9, -17,
505 -22, 28,-32768, 191, 182, 118,-32768,-32768,-32768,-32768,
506 -225,-32768,-32768,-32768,-32768,-32768,-32768, 44,-32768, 58,
507-32768,-32768,-32768,-32768,-32768, 167,-32768,-32768, 183, -223,
508-32768, 2,-32768
509};
510
511
512#define YYLAST 1140
513
514
515static const short yytable[] = { 104,
516 111, 78, 99, 80, 227, 92, 183, 199, 290, 139,
517 231, 179, 109, 101, 102, 202, 177, 196, 205, 106,
518 203, 117, 180, 83, 112, 113, 197, 220, 115, 116,
519 221, 236, 335, 89, 129, 130, 131, 132, 212, 294,
520 189, 190, 292, 95, 295, 158, 159, 96, 299, 103,
521 189, 190, 193, 100, 100, 260, 219, 261, 178, 100,
522 81, 180, 93, 110, 100, 100, 315, 194, 100, 100,
523 105, 266, 318, 187, 100, 100, 100, 100, 180, 125,
524 182, 160, 161, 162, 197, 180, 82, 336, 94, 184,
525 200, 332, 191, 207, 181, 209, 218, 210, 211, 283,
526 198, 206, 191, 133, 342, 163, 164, 134, 107, 192,
527 264, 135, 108, 1, 2, 3, 4, 5, 114, 165,
528 166, 202, 8, 186, 232, 84, 268, 234, 140, 141,
529 16, 155, 173, 142, 143, 144, 145, 146, 147, 148,
530 149, 150, 151, 152, 133, 156, 157, 174, 137, 242,
531 243, 244, 138, 140, 141, 237, 238, 239, 167, 168,
532 26, 310, 272, 231, 175, 274, 312, 273, 85, 153,
533 180, 30, 31, 176, 86, 96, 33, 245, 246, 247,
534 248, 249, 250, 276, 277, 327, 278, 194, 180, 180,
535 201, 180, 280, 214, 215, 100, 100, 100, 100, 100,
536 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
537 100, 100, 100, 100, 100, 100, 100, 100, -27, -126,
538 224, 225, -126, -126, -126, -126, -126, -126, -126, -126,
539 -126, -126, -126, -126, -126, -126, -126, -126, -126, -126,
540 -126, -126, -126, 296, -28, -126, -126, -126, 273, -126,
541 -126, 208, 316, 222, 293, 187, 301, 180, 303, 321,
542 306, 328, 341, 228, 180, 302, 180, 180, 255, 256,
543 257, 298, 169, 170, 171, 172, 223, -126, -126, -126,
544 313, 233, 187, -126, -126, 251, 252, 253, 254, 287,
545 180, 235, -126, -126, 288, 180, 180, 344, 331, 240,
546 241, 262, 333, 339, 329, 180, 270, 187, 265, 275,
547 340, 279, 334, 215, 285, 289, 286, 300, 304, 307,
548 187, 308, 314, 347, 317, 349, 350, 350, 319, 320,
549 354, 322, 326, 355, 355, 97, 343, 1, 2, 3,
550 4, 5, 330, 345, 348, 357, 8, 353, 358, 84,
551 284, 13, 14, 258, 16, 282, 140, 141, 87, 88,
552 19, 142, 143, 144, 145, 146, 147, 148, 149, 150,
553 151, 152, 352, 311, 259, 263, 24, 25, 267, 291,
554 346, 338, 281, 269, 26, 0, 0, 0, 0, 0,
555 0, 0, 85, 28, 29, 30, 31, 153, 86, 0,
556 33, 0, 0, 0, 0, 34, 35, 36, 37, 0,
557 0, 1, 2, 3, 118, 119, 6, 0, 98, 7,
558 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
559 18, 0, 0, 0, 19, 20, 21, 0, 22, 23,
560 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
561 24, 25, 0, 0, 0, 0, 0, 0, 26, 0,
562 0, 0, 0, 0, 0, 0, 120, 28, 29, 30,
563 31, 0, 32, 121, 33, 0, 0, 0, 0, 34,
564 35, 36, 37, 0, 0, 1, 2, 3, 4, 5,
565 6, 0, 38, 7, 8, 9, 10, 11, 12, 13,
566 14, 15, 16, 17, 18, 0, 0, 0, 19, 20,
567 21, 0, 22, 23, 0, 0, 0, 0, 0, 0,
568 0, 0, 0, 0, 24, 25, 0, 0, 0, 0,
569 0, 0, 26, 0, 0, 0, 0, 0, 0, 0,
570 27, 28, 29, 30, 31, 0, 32, 213, 33, 0,
571 0, 0, 0, 34, 35, 36, 37, 0, 0, 1,
572 2, 3, 4, 5, 6, 0, 38, 7, 8, 9,
573 10, 11, 12, 13, 14, 15, 16, 17, 18, 0,
574 0, 0, 19, 20, 21, 0, 22, 23, 0, 0,
575 0, 0, 0, 0, 0, 0, 0, 0, 24, 25,
576 0, 0, 0, 0, 0, 0, 26, 0, 0, 0,
577 0, 0, 0, 0, 27, 28, 29, 30, 31, 0,
578 32, 297, 33, 0, 0, 0, 0, 34, 35, 36,
579 37, 0, 0, 1, 2, 3, 4, 5, 6, 0,
580 38, 7, 8, 9, 10, 11, 12, 13, 14, 15,
581 16, 17, 18, 0, 0, 0, 19, 20, 21, 0,
582 22, 23, 0, 0, 0, 0, 0, 0, 0, 0,
583 0, 0, 24, 25, 0, 0, 0, 0, 0, 0,
584 26, 0, 0, 0, 0, 0, 0, 0, 27, 28,
585 29, 30, 31, 0, 32, 0, 33, 0, 0, 0,
586 0, 34, 35, 36, 37, 0, 0, 1, 2, 3,
587 4, 5, 6, 0, 38, 7, 8, 9, 10, 84,
588 12, 13, 14, 15, 16, 17, 18, 0, 0, 0,
589 19, 20, 21, 0, 22, 23, 0, 0, 0, 0,
590 0, 0, 0, 0, 0, 0, 24, 25, 0, 0,
591 0, 0, 0, 0, 26, 0, 0, 0, 0, 0,
592 0, 0, 27, 28, 29, 30, 31, 0, 32, 0,
593 33, 0, 0, 0, 0, 34, 35, 36, 37, 0,
594 1, 2, 3, 4, 5, 0, 0, 0, 38, 8,
595 185, 0, 84, 0, 13, 14, 0, 16, 0, 0,
596 0, 0, 0, 19, 0, 0, 0, 0, 0, 0,
597 0, 0, 0, 0, 0, 0, 0, 0, 0, 24,
598 25, 0, 0, 0, 0, 0, 0, 26, 0, 0,
599 0, 0, 0, 0, 0, 85, 28, 29, 30, 31,
600 0, 86, 0, 33, 0, 0, 0, 0, 34, 35,
601 36, 37, 1, 2, 3, 4, 5, 0, 0, 0,
602 0, 8, 0, 0, 84, 0, 13, 14, 0, 16,
603 0, 0, 0, 0, 0, 19, 0, 0, 0, 0,
604 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
605 0, 24, 25, 0, 0, 0, 0, 0, 0, 26,
606 0, 0, 0, 0, 0, 0, 0, 85, 28, 29,
607 30, 31, 0, 86, 0, 33, 226, 0, 0, 0,
608 34, 35, 36, 37, 1, 2, 3, 4, 5, 0,
609 0, 0, 0, 8, 0, 0, 84, 0, 13, 14,
610 0, 16, 0, 0, 0, 0, 0, 19, 0, 0,
611 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
612 0, 0, 0, 24, 25, 0, 0, 0, 0, 0,
613 0, 26, 0, 0, 0, 0, 0, 0, 0, 85,
614 28, 29, 30, 31, 229, 86, 0, 33, 0, 0,
615 0, 0, 34, 35, 36, 37, 1, 2, 3, 4,
616 5, 0, 0, 0, 0, 8, 0, 0, 84, 0,
617 13, 14, 0, 16, 0, 0, 0, 0, 0, 19,
618 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
619 0, 0, 0, 0, 0, 24, 25, 0, 0, 0,
620 0, 0, 0, 26, 0, 0, 0, 0, 0, 0,
621 0, 85, 28, 29, 30, 31, 0, 86, 0, 33,
622 309, 0, 0, 0, 34, 35, 36, 37, 1, 2,
623 3, 4, 5, 0, 0, 0, 0, 8, 0, 0,
624 84, 0, 13, 14, 0, 16, 0, 0, 0, 0,
625 0, 19, 0, 0, 0, 0, 0, 0, 0, 0,
626 0, 0, 0, 0, 0, 0, 0, 24, 25, 0,
627 0, 0, 0, 0, 0, 26, 0, 0, 0, 0,
628 0, 0, 0, 85, 28, 29, 30, 31, 0, 86,
629 0, 33, 0, 0, 0, 0, 34, 35, 36, 37
630};
631
632static const short yycheck[] = { 17,
633 23, 0, 12, 1, 127, 1, 1, 1, 24, 44,
634 133, 1, 22, 13, 14, 58, 40, 1, 1, 19,
635 63, 31, 68, 62, 24, 25, 68, 65, 28, 29,
636 68, 154, 10, 58, 34, 35, 36, 37, 84, 265,
637 6, 7, 84, 58, 268, 71, 72, 62, 272, 62,
638 6, 7, 87, 13, 14, 178, 63, 180, 82, 19,
639 58, 68, 58, 64, 24, 25, 292, 83, 28, 29,
640 62, 194, 296, 83, 34, 35, 36, 37, 68, 68,
641 79, 44, 45, 46, 68, 68, 84, 65, 84, 84,
642 84, 317, 58, 103, 84, 105, 114, 107, 108, 222,
643 84, 84, 58, 62, 330, 24, 25, 66, 62, 65,
644 24, 70, 62, 3, 4, 5, 6, 7, 69, 38,
645 39, 58, 12, 83, 134, 15, 63, 137, 42, 43,
646 20, 61, 79, 47, 48, 49, 50, 51, 52, 53,
647 54, 55, 56, 57, 62, 75, 76, 80, 66, 160,
648 161, 162, 70, 42, 43, 155, 156, 157, 77, 78,
649 50, 284, 63, 286, 81, 63, 289, 68, 58, 83,
650 68, 61, 62, 41, 64, 62, 66, 163, 164, 165,
651 166, 167, 168, 63, 63, 308, 63, 83, 68, 68,
652 62, 68, 215, 32, 33, 155, 156, 157, 158, 159,
653 160, 161, 162, 163, 164, 165, 166, 167, 168, 169,
654 170, 171, 172, 173, 174, 175, 176, 177, 69, 0,
655 67, 68, 3, 4, 5, 6, 7, 8, 9, 10,
656 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
657 21, 22, 23, 63, 69, 26, 27, 28, 68, 30,
658 31, 22, 63, 69, 264, 265, 274, 68, 276, 63,
659 278, 63, 63, 68, 68, 275, 68, 68, 173, 174,
660 175, 270, 34, 35, 36, 37, 65, 58, 59, 60,
661 290, 58, 292, 64, 65, 169, 170, 171, 172, 67,
662 68, 58, 73, 74, 67, 68, 68, 69, 316, 158,
663 159, 58, 320, 326, 314, 68, 64, 317, 84, 62,
664 328, 62, 322, 33, 63, 69, 68, 58, 64, 58,
665 330, 69, 24, 341, 84, 343, 344, 345, 65, 23,
666 348, 9, 63, 351, 352, 1, 63, 3, 4, 5,
667 6, 7, 84, 69, 63, 0, 12, 65, 0, 15,
668 225, 17, 18, 176, 20, 221, 42, 43, 8, 8,
669 26, 47, 48, 49, 50, 51, 52, 53, 54, 55,
670 56, 57, 345, 286, 177, 185, 42, 43, 197, 262,
671 337, 324, 216, 201, 50, -1, -1, -1, -1, -1,
672 -1, -1, 58, 59, 60, 61, 62, 83, 64, -1,
673 66, -1, -1, -1, -1, 71, 72, 73, 74, -1,
674 -1, 3, 4, 5, 6, 7, 8, -1, 84, 11,
675 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
676 22, -1, -1, -1, 26, 27, 28, -1, 30, 31,
677 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
678 42, 43, -1, -1, -1, -1, -1, -1, 50, -1,
679 -1, -1, -1, -1, -1, -1, 58, 59, 60, 61,
680 62, -1, 64, 65, 66, -1, -1, -1, -1, 71,
681 72, 73, 74, -1, -1, 3, 4, 5, 6, 7,
682 8, -1, 84, 11, 12, 13, 14, 15, 16, 17,
683 18, 19, 20, 21, 22, -1, -1, -1, 26, 27,
684 28, -1, 30, 31, -1, -1, -1, -1, -1, -1,
685 -1, -1, -1, -1, 42, 43, -1, -1, -1, -1,
686 -1, -1, 50, -1, -1, -1, -1, -1, -1, -1,
687 58, 59, 60, 61, 62, -1, 64, 65, 66, -1,
688 -1, -1, -1, 71, 72, 73, 74, -1, -1, 3,
689 4, 5, 6, 7, 8, -1, 84, 11, 12, 13,
690 14, 15, 16, 17, 18, 19, 20, 21, 22, -1,
691 -1, -1, 26, 27, 28, -1, 30, 31, -1, -1,
692 -1, -1, -1, -1, -1, -1, -1, -1, 42, 43,
693 -1, -1, -1, -1, -1, -1, 50, -1, -1, -1,
694 -1, -1, -1, -1, 58, 59, 60, 61, 62, -1,
695 64, 65, 66, -1, -1, -1, -1, 71, 72, 73,
696 74, -1, -1, 3, 4, 5, 6, 7, 8, -1,
697 84, 11, 12, 13, 14, 15, 16, 17, 18, 19,
698 20, 21, 22, -1, -1, -1, 26, 27, 28, -1,
699 30, 31, -1, -1, -1, -1, -1, -1, -1, -1,
700 -1, -1, 42, 43, -1, -1, -1, -1, -1, -1,
701 50, -1, -1, -1, -1, -1, -1, -1, 58, 59,
702 60, 61, 62, -1, 64, -1, 66, -1, -1, -1,
703 -1, 71, 72, 73, 74, -1, -1, 3, 4, 5,
704 6, 7, 8, -1, 84, 11, 12, 13, 14, 15,
705 16, 17, 18, 19, 20, 21, 22, -1, -1, -1,
706 26, 27, 28, -1, 30, 31, -1, -1, -1, -1,
707 -1, -1, -1, -1, -1, -1, 42, 43, -1, -1,
708 -1, -1, -1, -1, 50, -1, -1, -1, -1, -1,
709 -1, -1, 58, 59, 60, 61, 62, -1, 64, -1,
710 66, -1, -1, -1, -1, 71, 72, 73, 74, -1,
711 3, 4, 5, 6, 7, -1, -1, -1, 84, 12,
712 13, -1, 15, -1, 17, 18, -1, 20, -1, -1,
713 -1, -1, -1, 26, -1, -1, -1, -1, -1, -1,
714 -1, -1, -1, -1, -1, -1, -1, -1, -1, 42,
715 43, -1, -1, -1, -1, -1, -1, 50, -1, -1,
716 -1, -1, -1, -1, -1, 58, 59, 60, 61, 62,
717 -1, 64, -1, 66, -1, -1, -1, -1, 71, 72,
718 73, 74, 3, 4, 5, 6, 7, -1, -1, -1,
719 -1, 12, -1, -1, 15, -1, 17, 18, -1, 20,
720 -1, -1, -1, -1, -1, 26, -1, -1, -1, -1,
721 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
722 -1, 42, 43, -1, -1, -1, -1, -1, -1, 50,
723 -1, -1, -1, -1, -1, -1, -1, 58, 59, 60,
724 61, 62, -1, 64, -1, 66, 67, -1, -1, -1,
725 71, 72, 73, 74, 3, 4, 5, 6, 7, -1,
726 -1, -1, -1, 12, -1, -1, 15, -1, 17, 18,
727 -1, 20, -1, -1, -1, -1, -1, 26, -1, -1,
728 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
729 -1, -1, -1, 42, 43, -1, -1, -1, -1, -1,
730 -1, 50, -1, -1, -1, -1, -1, -1, -1, 58,
731 59, 60, 61, 62, 63, 64, -1, 66, -1, -1,
732 -1, -1, 71, 72, 73, 74, 3, 4, 5, 6,
733 7, -1, -1, -1, -1, 12, -1, -1, 15, -1,
734 17, 18, -1, 20, -1, -1, -1, -1, -1, 26,
735 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
736 -1, -1, -1, -1, -1, 42, 43, -1, -1, -1,
737 -1, -1, -1, 50, -1, -1, -1, -1, -1, -1,
738 -1, 58, 59, 60, 61, 62, -1, 64, -1, 66,
739 67, -1, -1, -1, 71, 72, 73, 74, 3, 4,
740 5, 6, 7, -1, -1, -1, -1, 12, -1, -1,
741 15, -1, 17, 18, -1, 20, -1, -1, -1, -1,
742 -1, 26, -1, -1, -1, -1, -1, -1, -1, -1,
743 -1, -1, -1, -1, -1, -1, -1, 42, 43, -1,
744 -1, -1, -1, -1, -1, 50, -1, -1, -1, -1,
745 -1, -1, -1, 58, 59, 60, 61, 62, -1, 64,
746 -1, 66, -1, -1, -1, -1, 71, 72, 73, 74
747};
748/* -*-C-*- Note some compilers choke on comments on `#line' lines. */
749#line 3 "/usr/share/bison.simple"
750/* This file comes from bison-1.28. */
751
752/* Skeleton output parser for bison,
753 Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
754
755 This program is free software; you can redistribute it and/or modify
756 it under the terms of the GNU General Public License as published by
757 the Free Software Foundation; either version 2, or (at your option)
758 any later version.
759
760 This program is distributed in the hope that it will be useful,
761 but WITHOUT ANY WARRANTY; without even the implied warranty of
762 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
763 GNU General Public License for more details.
764
765 You should have received a copy of the GNU General Public License
766 along with this program; if not, write to the Free Software
767 Foundation, Inc., 59 Temple Place - Suite 330,
768 Boston, MA 02111-1307, USA. */
769
770/* As a special exception, when this file is copied by Bison into a
771 Bison output file, you may use that output file without restriction.
772 This special exception was added by the Free Software Foundation
773 in version 1.24 of Bison. */
774
775/* This is the parser code that is written into each bison parser
776 when the %semantic_parser declaration is not specified in the grammar.
777 It was written by Richard Stallman by simplifying the hairy parser
778 used when %semantic_parser is specified. */
779
780#ifndef YYSTACK_USE_ALLOCA
781#ifdef alloca
782#define YYSTACK_USE_ALLOCA
783#else /* alloca not defined */
784#ifdef __GNUC__
785#define YYSTACK_USE_ALLOCA
786#define alloca __builtin_alloca
787#else /* not GNU C. */
788#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386))
789#define YYSTACK_USE_ALLOCA
790#include <alloca.h>
791#else /* not sparc */
792/* We think this test detects Watcom and Microsoft C. */
793/* This used to test MSDOS, but that is a bad idea
794 since that symbol is in the user namespace. */
795#if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__)
796#if 0 /* No need for malloc.h, which pollutes the namespace;
797 instead, just don't use alloca. */
798#include <malloc.h>
799#endif
800#else /* not MSDOS, or __TURBOC__ */
801#if defined(_AIX)
802/* I don't know what this was needed for, but it pollutes the namespace.
803 So I turned it off. rms, 2 May 1997. */
804/* #include <malloc.h> */
805 #pragma alloca
806#define YYSTACK_USE_ALLOCA
807#else /* not MSDOS, or __TURBOC__, or _AIX */
808#if 0
809#ifdef __hpux /* [email protected] says this works for HPUX 9.05 and up,
810 and on HPUX 10. Eventually we can turn this on. */
811#define YYSTACK_USE_ALLOCA
812#define alloca __builtin_alloca
813#endif /* __hpux */
814#endif
815#endif /* not _AIX */
816#endif /* not MSDOS, or __TURBOC__ */
817#endif /* not sparc */
818#endif /* not GNU C */
819#endif /* alloca not defined */
820#endif /* YYSTACK_USE_ALLOCA not defined */
821
822#ifdef YYSTACK_USE_ALLOCA
823#define YYSTACK_ALLOC alloca
824#else
825#define YYSTACK_ALLOC malloc
826#endif
827
828/* Note: there must be only one dollar sign in this file.
829 It is replaced by the list of actions, each action
830 as one case of the switch. */
831
832#define yyerrok (yyerrstatus = 0)
833#define yyclearin (yychar = YYEMPTY)
834#define YYEMPTY -2
835#define YYEOF 0
836#define YYACCEPT goto yyacceptlab
837#define YYABORT goto yyabortlab
838#define YYERROR goto yyerrlab1
839/* Like YYERROR except do call yyerror.
840 This remains here temporarily to ease the
841 transition to the new meaning of YYERROR, for GCC.
842 Once GCC version 2 has supplanted version 1, this can go. */
843#define YYFAIL goto yyerrlab
844#define YYRECOVERING() (!!yyerrstatus)
845#define YYBACKUP(token, value) \
846do \
847 if (yychar == YYEMPTY && yylen == 1) \
848 { yychar = (token), yylval = (value); \
849 yychar1 = YYTRANSLATE (yychar); \
850 YYPOPSTACK; \
851 goto yybackup; \
852 } \
853 else \
854 { yyerror ("syntax error: cannot back up"); YYERROR; } \
855while (0)
856
857#define YYTERROR 1
858#define YYERRCODE 256
859
860#ifndef YYPURE
861#define YYLEX yylex()
862#endif
863
864#ifdef YYPURE
865#ifdef YYLSP_NEEDED
866#ifdef YYLEX_PARAM
867#define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM)
868#else
869#define YYLEX yylex(&yylval, &yylloc)
870#endif
871#else /* not YYLSP_NEEDED */
872#ifdef YYLEX_PARAM
873#define YYLEX yylex(&yylval, YYLEX_PARAM)
874#else
875#define YYLEX yylex(&yylval)
876#endif
877#endif /* not YYLSP_NEEDED */
878#endif
879
880/* If nonreentrant, generate the variables here */
881
882#ifndef YYPURE
883
884int yychar; /* the lookahead symbol */
885YYSTYPE yylval; /* the semantic value of the */
886 /* lookahead symbol */
887
888#ifdef YYLSP_NEEDED
889YYLTYPE yylloc; /* location data for the lookahead */
890 /* symbol */
891#endif
892
893int yynerrs; /* number of parse errors so far */
894#endif /* not YYPURE */
895
896#if YYDEBUG != 0
897int yydebug; /* nonzero means print parse trace */
898/* Since this is uninitialized, it does not stop multiple parsers
899 from coexisting. */
900#endif
901
902/* YYINITDEPTH indicates the initial size of the parser's stacks */
903
904#ifndef YYINITDEPTH
905#define YYINITDEPTH 200
906#endif
907
908/* YYMAXDEPTH is the maximum size the stacks can grow to
909 (effective only if the built-in stack extension method is used). */
910
911#if YYMAXDEPTH == 0
912#undef YYMAXDEPTH
913#endif
914
915#ifndef YYMAXDEPTH
916#define YYMAXDEPTH 10000
917#endif
918
919
920/* Define __yy_memcpy. Note that the size argument
921 should be passed with type unsigned int, because that is what the non-GCC
922 definitions require. With GCC, __builtin_memcpy takes an arg
923 of type size_t, but it can handle unsigned int. */
924
925#if __GNUC__ > 1 /* GNU C and GNU C++ define this. */
926#define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT)
927#else /* not GNU C or C++ */
928#ifndef __cplusplus
929
930/* This is the most reliable way to avoid incompatibilities
931 in available built-in functions on various systems. */
932static void
933__yy_memcpy (to, from, count)
934 char *to;
935 char *from;
936 unsigned int count;
937{
938 register char *f = from;
939 register char *t = to;
940 register int i = count;
941
942 while (i-- > 0)
943 *t++ = *f++;
944}
945
946#else /* __cplusplus */
947
948/* This is the most reliable way to avoid incompatibilities
949 in available built-in functions on various systems. */
950static void
951__yy_memcpy (char *to, char *from, unsigned int count)
952{
953 register char *t = to;
954 register char *f = from;
955 register int i = count;
956
957 while (i-- > 0)
958 *t++ = *f++;
959}
960
961#endif
962#endif
963
964
965#line 217 "/usr/share/bison.simple"
966
967/* The user can define YYPARSE_PARAM as the name of an argument to be passed
968 into yyparse. The argument should have type void *.
969 It should actually point to an object.
970 Grammar actions can access the variable by casting it
971 to the proper pointer type. */
972
973#ifdef YYPARSE_PARAM
974#ifdef __cplusplus
975#define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
976#define YYPARSE_PARAM_DECL
977#else /* not __cplusplus */
978#define YYPARSE_PARAM_ARG YYPARSE_PARAM
979#define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
980#endif /* not __cplusplus */
981#else /* not YYPARSE_PARAM */
982#define YYPARSE_PARAM_ARG
983#define YYPARSE_PARAM_DECL
984#endif /* not YYPARSE_PARAM */
985
986/* Prevent warning if -Wstrict-prototypes. */
987#ifdef __GNUC__
988#ifdef YYPARSE_PARAM
989int yyparse (void *);
990#else
991int yyparse (void);
992#endif
993#endif
994
995int
996yyparse(YYPARSE_PARAM_ARG)
997 YYPARSE_PARAM_DECL
998{
999 register int yystate;
1000 register int yyn;
1001 register short *yyssp;
1002 register YYSTYPE *yyvsp;
1003 int yyerrstatus; /* number of tokens to shift before error messages enabled */
1004 int yychar1 = 0; /* lookahead token as an internal (translated) token number */
1005
1006 short yyssa[YYINITDEPTH]; /* the state stack */
1007 YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */
1008
1009 short *yyss = yyssa; /* refer to the stacks thru separate pointers */
1010 YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */
1011
1012#ifdef YYLSP_NEEDED
1013 YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */
1014 YYLTYPE *yyls = yylsa;
1015 YYLTYPE *yylsp;
1016
1017#define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
1018#else
1019#define YYPOPSTACK (yyvsp--, yyssp--)
1020#endif
1021
1022 int yystacksize = YYINITDEPTH;
1023 int yyfree_stacks = 0;
1024
1025#ifdef YYPURE
1026 int yychar;
1027 YYSTYPE yylval;
1028 int yynerrs;
1029#ifdef YYLSP_NEEDED
1030 YYLTYPE yylloc;
1031#endif
1032#endif
1033
1034 YYSTYPE yyval; /* the variable used to return */
1035 /* semantic values from the action */
1036 /* routines */
1037
1038 int yylen;
1039
1040#if YYDEBUG != 0
1041 if (yydebug)
1042 fprintf(stderr, "Starting parse\n");
1043#endif
1044
1045 yystate = 0;
1046 yyerrstatus = 0;
1047 yynerrs = 0;
1048 yychar = YYEMPTY; /* Cause a token to be read. */
1049
1050 /* Initialize stack pointers.
1051 Waste one element of value and location stack
1052 so that they stay on the same level as the state stack.
1053 The wasted elements are never initialized. */
1054
1055 yyssp = yyss - 1;
1056 yyvsp = yyvs;
1057#ifdef YYLSP_NEEDED
1058 yylsp = yyls;
1059#endif
1060
1061/* Push a new state, which is found in yystate . */
1062/* In all cases, when you get here, the value and location stacks
1063 have just been pushed. so pushing a state here evens the stacks. */
1064yynewstate:
1065
1066 *++yyssp = yystate;
1067
1068 if (yyssp >= yyss + yystacksize - 1)
1069 {
1070 /* Give user a chance to reallocate the stack */
1071 /* Use copies of these so that the &'s don't force the real ones into memory. */
1072 YYSTYPE *yyvs1 = yyvs;
1073 short *yyss1 = yyss;
1074#ifdef YYLSP_NEEDED
1075 YYLTYPE *yyls1 = yyls;
1076#endif
1077
1078 /* Get the current used size of the three stacks, in elements. */
1079 int size = yyssp - yyss + 1;
1080
1081#ifdef yyoverflow
1082 /* Each stack pointer address is followed by the size of
1083 the data in use in that stack, in bytes. */
1084#ifdef YYLSP_NEEDED
1085 /* This used to be a conditional around just the two extra args,
1086 but that might be undefined if yyoverflow is a macro. */
1087 yyoverflow("parser stack overflow",
1088 &yyss1, size * sizeof (*yyssp),
1089 &yyvs1, size * sizeof (*yyvsp),
1090 &yyls1, size * sizeof (*yylsp),
1091 &yystacksize);
1092#else
1093 yyoverflow("parser stack overflow",
1094 &yyss1, size * sizeof (*yyssp),
1095 &yyvs1, size * sizeof (*yyvsp),
1096 &yystacksize);
1097#endif
1098
1099 yyss = yyss1; yyvs = yyvs1;
1100#ifdef YYLSP_NEEDED
1101 yyls = yyls1;
1102#endif
1103#else /* no yyoverflow */
1104 /* Extend the stack our own way. */
1105 if (yystacksize >= YYMAXDEPTH)
1106 {
1107 yyerror("parser stack overflow");
1108 if (yyfree_stacks)
1109 {
1110 free (yyss);
1111 free (yyvs);
1112#ifdef YYLSP_NEEDED
1113 free (yyls);
1114#endif
1115 }
1116 return 2;
1117 }
1118 yystacksize *= 2;
1119 if (yystacksize > YYMAXDEPTH)
1120 yystacksize = YYMAXDEPTH;
1121#ifndef YYSTACK_USE_ALLOCA
1122 yyfree_stacks = 1;
1123#endif
1124 yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp));
1125 __yy_memcpy ((char *)yyss, (char *)yyss1,
1126 size * (unsigned int) sizeof (*yyssp));
1127 yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp));
1128 __yy_memcpy ((char *)yyvs, (char *)yyvs1,
1129 size * (unsigned int) sizeof (*yyvsp));
1130#ifdef YYLSP_NEEDED
1131 yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp));
1132 __yy_memcpy ((char *)yyls, (char *)yyls1,
1133 size * (unsigned int) sizeof (*yylsp));
1134#endif
1135#endif /* no yyoverflow */
1136
1137 yyssp = yyss + size - 1;
1138 yyvsp = yyvs + size - 1;
1139#ifdef YYLSP_NEEDED
1140 yylsp = yyls + size - 1;
1141#endif
1142
1143#if YYDEBUG != 0
1144 if (yydebug)
1145 fprintf(stderr, "Stack size increased to %d\n", yystacksize);
1146#endif
1147
1148 if (yyssp >= yyss + yystacksize - 1)
1149 YYABORT;
1150 }
1151
1152#if YYDEBUG != 0
1153 if (yydebug)
1154 fprintf(stderr, "Entering state %d\n", yystate);
1155#endif
1156
1157 goto yybackup;
1158 yybackup:
1159
1160/* Do appropriate processing given the current state. */
1161/* Read a lookahead token if we need one and don't already have one. */
1162/* yyresume: */
1163
1164 /* First try to decide what to do without reference to lookahead token. */
1165
1166 yyn = yypact[yystate];
1167 if (yyn == YYFLAG)
1168 goto yydefault;
1169
1170 /* Not known => get a lookahead token if don't already have one. */
1171
1172 /* yychar is either YYEMPTY or YYEOF
1173 or a valid token in external form. */
1174
1175 if (yychar == YYEMPTY)
1176 {
1177#if YYDEBUG != 0
1178 if (yydebug)
1179 fprintf(stderr, "Reading a token: ");
1180#endif
1181 yychar = YYLEX;
1182 }
1183
1184 /* Convert token to internal form (in yychar1) for indexing tables with */
1185
1186 if (yychar <= 0) /* This means end of input. */
1187 {
1188 yychar1 = 0;
1189 yychar = YYEOF; /* Don't call YYLEX any more */
1190
1191#if YYDEBUG != 0
1192 if (yydebug)
1193 fprintf(stderr, "Now at end of input.\n");
1194#endif
1195 }
1196 else
1197 {
1198 yychar1 = YYTRANSLATE(yychar);
1199
1200#if YYDEBUG != 0
1201 if (yydebug)
1202 {
1203 fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]);
1204 /* Give the individual parser a way to print the precise meaning
1205 of a token, for further debugging info. */
1206#ifdef YYPRINT
1207 YYPRINT (stderr, yychar, yylval);
1208#endif
1209 fprintf (stderr, ")\n");
1210 }
1211#endif
1212 }
1213
1214 yyn += yychar1;
1215 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
1216 goto yydefault;
1217
1218 yyn = yytable[yyn];
1219
1220 /* yyn is what to do for this token type in this state.
1221 Negative => reduce, -yyn is rule number.
1222 Positive => shift, yyn is new state.
1223 New state is final state => don't bother to shift,
1224 just return success.
1225 0, or most negative number => error. */
1226
1227 if (yyn < 0)
1228 {
1229 if (yyn == YYFLAG)
1230 goto yyerrlab;
1231 yyn = -yyn;
1232 goto yyreduce;
1233 }
1234 else if (yyn == 0)
1235 goto yyerrlab;
1236
1237 if (yyn == YYFINAL)
1238 YYACCEPT;
1239
1240 /* Shift the lookahead token. */
1241
1242#if YYDEBUG != 0
1243 if (yydebug)
1244 fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
1245#endif
1246
1247 /* Discard the token being shifted unless it is eof. */
1248 if (yychar != YYEOF)
1249 yychar = YYEMPTY;
1250
1251 *++yyvsp = yylval;
1252#ifdef YYLSP_NEEDED
1253 *++yylsp = yylloc;
1254#endif
1255
1256 /* count tokens shifted since error; after three, turn off error status. */
1257 if (yyerrstatus) yyerrstatus--;
1258
1259 yystate = yyn;
1260 goto yynewstate;
1261
1262/* Do the default action for the current state. */
1263yydefault:
1264
1265 yyn = yydefact[yystate];
1266 if (yyn == 0)
1267 goto yyerrlab;
1268
1269/* Do a reduction. yyn is the number of a rule to reduce with. */
1270yyreduce:
1271 yylen = yyr2[yyn];
1272 if (yylen > 0)
1273 yyval = yyvsp[1-yylen]; /* implement default value of the action */
1274
1275#if YYDEBUG != 0
1276 if (yydebug)
1277 {
1278 int i;
1279
1280 fprintf (stderr, "Reducing via rule %d (line %d), ",
1281 yyn, yyrline[yyn]);
1282
1283 /* Print the symbols being reduced, and their result. */
1284 for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
1285 fprintf (stderr, "%s ", yytname[yyrhs[i]]);
1286 fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
1287 }
1288#endif
1289
1290
1291 switch (yyn) {
1292
1293case 1:
1294#line 160 "grammar.y"
1295{ yyval.node = new NullNode(); ;
1296 break;}
1297case 2:
1298#line 161 "grammar.y"
1299{ yyval.node = new BooleanNode(true); ;
1300 break;}
1301case 3:
1302#line 162 "grammar.y"
1303{ yyval.node = new BooleanNode(false); ;
1304 break;}
1305case 4:
1306#line 163 "grammar.y"
1307{ yyval.node = new NumberNode(yyvsp[0].dval); ;
1308 break;}
1309case 5:
1310#line 164 "grammar.y"
1311{ yyval.node = new StringNode(yyvsp[0].ustr); delete yyvsp[0].ustr; ;
1312 break;}
1313case 6:
1314#line 165 "grammar.y"
1315{ Lexer *l = Lexer::curr();
1316 if (!l->scanRegExp()) YYABORT;
1317 yyval.node = new RegExpNode(l->pattern,l->flags);;
1318 break;}
1319case 7:
1320#line 169 "grammar.y"
1321{ Lexer *l = Lexer::curr();
1322 if (!l->scanRegExp()) YYABORT;
1323 yyval.node = new RegExpNode(UString('=')+l->pattern,l->flags);;
1324 break;}
1325case 8:
1326#line 175 "grammar.y"
1327{ yyval.node = new ThisNode(); ;
1328 break;}
1329case 9:
1330#line 176 "grammar.y"
1331{ yyval.node = new ResolveNode(yyvsp[0].ustr);
1332 delete yyvsp[0].ustr; ;
1333 break;}
1334case 12:
1335#line 180 "grammar.y"
1336{ yyval.node = new GroupNode(yyvsp[-1].node); ;
1337 break;}
1338case 13:
1339#line 181 "grammar.y"
1340{ yyval.node = new ObjectLiteralNode(0L); ;
1341 break;}
1342case 14:
1343#line 182 "grammar.y"
1344{ yyval.node = new ObjectLiteralNode(yyvsp[-1].node); ;
1345 break;}
1346case 15:
1347#line 186 "grammar.y"
1348{ yyval.node = new ArrayNode(yyvsp[-1].eli); ;
1349 break;}
1350case 16:
1351#line 187 "grammar.y"
1352{ yyval.node = new ArrayNode(yyvsp[-1].elm); ;
1353 break;}
1354case 17:
1355#line 188 "grammar.y"
1356{ yyval.node = new ArrayNode(yyvsp[-1].eli, yyvsp[-3].elm); ;
1357 break;}
1358case 18:
1359#line 192 "grammar.y"
1360{ yyval.elm = new ElementNode(yyvsp[-1].eli, yyvsp[0].node); ;
1361 break;}
1362case 19:
1363#line 194 "grammar.y"
1364{ yyval.elm = new ElementNode(yyvsp[-3].elm, yyvsp[-1].eli, yyvsp[0].node); ;
1365 break;}
1366case 20:
1367#line 198 "grammar.y"
1368{ yyval.eli = 0L; ;
1369 break;}
1370case 22:
1371#line 203 "grammar.y"
1372{ yyval.eli = new ElisionNode(0L); ;
1373 break;}
1374case 23:
1375#line 204 "grammar.y"
1376{ yyval.eli = new ElisionNode(yyvsp[-1].eli); ;
1377 break;}
1378case 24:
1379#line 208 "grammar.y"
1380{ yyval.node = new PropertyValueNode(yyvsp[-2].node, yyvsp[0].node); ;
1381 break;}
1382case 25:
1383#line 210 "grammar.y"
1384{ yyval.node = new PropertyValueNode(yyvsp[-2].node, yyvsp[0].node, yyvsp[-4].node); ;
1385 break;}
1386case 26:
1387#line 214 "grammar.y"
1388{ yyval.node = new PropertyNode(yyvsp[0].ustr);
1389 delete yyvsp[0].ustr; ;
1390 break;}
1391case 27:
1392#line 216 "grammar.y"
1393{ yyval.node = new PropertyNode(yyvsp[0].ustr); delete yyvsp[0].ustr; ;
1394 break;}
1395case 28:
1396#line 217 "grammar.y"
1397{ yyval.node = new PropertyNode(yyvsp[0].dval); ;
1398 break;}
1399case 31:
1400#line 223 "grammar.y"
1401{ yyval.node = new AccessorNode1(yyvsp[-3].node, yyvsp[-1].node); ;
1402 break;}
1403case 32:
1404#line 224 "grammar.y"
1405{ yyval.node = new AccessorNode2(yyvsp[-2].node, yyvsp[0].ustr);
1406 delete yyvsp[0].ustr; ;
1407 break;}
1408case 33:
1409#line 226 "grammar.y"
1410{ yyval.node = new NewExprNode(yyvsp[-1].node, yyvsp[0].args); ;
1411 break;}
1412case 35:
1413#line 231 "grammar.y"
1414{ yyval.node = new NewExprNode(yyvsp[0].node); ;
1415 break;}
1416case 36:
1417#line 235 "grammar.y"
1418{ yyval.node = new FunctionCallNode(yyvsp[-1].node, yyvsp[0].args); ;
1419 break;}
1420case 37:
1421#line 236 "grammar.y"
1422{ yyval.node = new FunctionCallNode(yyvsp[-1].node, yyvsp[0].args); ;
1423 break;}
1424case 38:
1425#line 237 "grammar.y"
1426{ yyval.node = new AccessorNode1(yyvsp[-3].node, yyvsp[-1].node); ;
1427 break;}
1428case 39:
1429#line 238 "grammar.y"
1430{ yyval.node = new AccessorNode2(yyvsp[-2].node, yyvsp[0].ustr);
1431 delete yyvsp[0].ustr; ;
1432 break;}
1433case 40:
1434#line 243 "grammar.y"
1435{ yyval.args = new ArgumentsNode(0L); ;
1436 break;}
1437case 41:
1438#line 244 "grammar.y"
1439{ yyval.args = new ArgumentsNode(yyvsp[-1].alist); ;
1440 break;}
1441case 42:
1442#line 248 "grammar.y"
1443{ yyval.alist = new ArgumentListNode(yyvsp[0].node); ;
1444 break;}
1445case 43:
1446#line 250 "grammar.y"
1447{ yyval.alist = new ArgumentListNode(yyvsp[0].alist, yyvsp[-2].node); ;
1448 break;}
1449case 47:
1450#line 263 "grammar.y"
1451{ yyval.node = new PostfixNode(yyvsp[-1].node, OpPlusPlus); ;
1452 break;}
1453case 48:
1454#line 264 "grammar.y"
1455{ yyval.node = new PostfixNode(yyvsp[-1].node, OpMinusMinus); ;
1456 break;}
1457case 50:
1458#line 269 "grammar.y"
1459{ yyval.node = new DeleteNode(yyvsp[0].node); ;
1460 break;}
1461case 51:
1462#line 270 "grammar.y"
1463{ yyval.node = new VoidNode(yyvsp[0].node); ;
1464 break;}
1465case 52:
1466#line 271 "grammar.y"
1467{ yyval.node = new TypeOfNode(yyvsp[0].node); ;
1468 break;}
1469case 53:
1470#line 272 "grammar.y"
1471{ yyval.node = new PrefixNode(OpPlusPlus, yyvsp[0].node); ;
1472 break;}
1473case 54:
1474#line 273 "grammar.y"
1475{ yyval.node = new PrefixNode(OpPlusPlus, yyvsp[0].node); ;
1476 break;}
1477case 55:
1478#line 274 "grammar.y"
1479{ yyval.node = new PrefixNode(OpMinusMinus, yyvsp[0].node); ;
1480 break;}
1481case 56:
1482#line 275 "grammar.y"
1483{ yyval.node = new PrefixNode(OpMinusMinus, yyvsp[0].node); ;
1484 break;}
1485case 57:
1486#line 276 "grammar.y"
1487{ yyval.node = new UnaryPlusNode(yyvsp[0].node); ;
1488 break;}
1489case 58:
1490#line 277 "grammar.y"
1491{ yyval.node = new NegateNode(yyvsp[0].node); ;
1492 break;}
1493case 59:
1494#line 278 "grammar.y"
1495{ yyval.node = new BitwiseNotNode(yyvsp[0].node); ;
1496 break;}
1497case 60:
1498#line 279 "grammar.y"
1499{ yyval.node = new LogicalNotNode(yyvsp[0].node); ;
1500 break;}
1501case 62:
1502#line 284 "grammar.y"
1503{ yyval.node = new MultNode(yyvsp[-2].node, yyvsp[0].node, '*'); ;
1504 break;}
1505case 63:
1506#line 285 "grammar.y"
1507{ yyval.node = new MultNode(yyvsp[-2].node, yyvsp[0].node, '/'); ;
1508 break;}
1509case 64:
1510#line 286 "grammar.y"
1511{ yyval.node = new MultNode(yyvsp[-2].node,yyvsp[0].node,'%'); ;
1512 break;}
1513case 66:
1514#line 291 "grammar.y"
1515{ yyval.node = new AddNode(yyvsp[-2].node, yyvsp[0].node, '+'); ;
1516 break;}
1517case 67:
1518#line 292 "grammar.y"
1519{ yyval.node = new AddNode(yyvsp[-2].node, yyvsp[0].node, '-'); ;
1520 break;}
1521case 69:
1522#line 297 "grammar.y"
1523{ yyval.node = new ShiftNode(yyvsp[-2].node, OpLShift, yyvsp[0].node); ;
1524 break;}
1525case 70:
1526#line 298 "grammar.y"
1527{ yyval.node = new ShiftNode(yyvsp[-2].node, OpRShift, yyvsp[0].node); ;
1528 break;}
1529case 71:
1530#line 299 "grammar.y"
1531{ yyval.node = new ShiftNode(yyvsp[-2].node, OpURShift, yyvsp[0].node); ;
1532 break;}
1533case 73:
1534#line 305 "grammar.y"
1535{ yyval.node = new RelationalNode(yyvsp[-2].node, OpLess, yyvsp[0].node); ;
1536 break;}
1537case 74:
1538#line 307 "grammar.y"
1539{ yyval.node = new RelationalNode(yyvsp[-2].node, OpGreater, yyvsp[0].node); ;
1540 break;}
1541case 75:
1542#line 309 "grammar.y"
1543{ yyval.node = new RelationalNode(yyvsp[-2].node, OpLessEq, yyvsp[0].node); ;
1544 break;}
1545case 76:
1546#line 311 "grammar.y"
1547{ yyval.node = new RelationalNode(yyvsp[-2].node, OpGreaterEq, yyvsp[0].node); ;
1548 break;}
1549case 77:
1550#line 313 "grammar.y"
1551{ yyval.node = new RelationalNode(yyvsp[-2].node, OpInstanceOf, yyvsp[0].node); ;
1552 break;}
1553case 78:
1554#line 315 "grammar.y"
1555{ yyval.node = new RelationalNode(yyvsp[-2].node, OpIn, yyvsp[0].node); ;
1556 break;}
1557case 80:
1558#line 320 "grammar.y"
1559{ yyval.node = new EqualNode(yyvsp[-2].node, OpEqEq, yyvsp[0].node); ;
1560 break;}
1561case 81:
1562#line 321 "grammar.y"
1563{ yyval.node = new EqualNode(yyvsp[-2].node, OpNotEq, yyvsp[0].node); ;
1564 break;}
1565case 82:
1566#line 322 "grammar.y"
1567{ yyval.node = new EqualNode(yyvsp[-2].node, OpStrEq, yyvsp[0].node); ;
1568 break;}
1569case 83:
1570#line 323 "grammar.y"
1571{ yyval.node = new EqualNode(yyvsp[-2].node, OpStrNEq, yyvsp[0].node);;
1572 break;}
1573case 85:
1574#line 328 "grammar.y"
1575{ yyval.node = new BitOperNode(yyvsp[-2].node, OpBitAnd, yyvsp[0].node); ;
1576 break;}
1577case 87:
1578#line 333 "grammar.y"
1579{ yyval.node = new BitOperNode(yyvsp[-2].node, OpBitXOr, yyvsp[0].node); ;
1580 break;}
1581case 89:
1582#line 338 "grammar.y"
1583{ yyval.node = new BitOperNode(yyvsp[-2].node, OpBitOr, yyvsp[0].node); ;
1584 break;}
1585case 91:
1586#line 344 "grammar.y"
1587{ yyval.node = new BinaryLogicalNode(yyvsp[-2].node, OpAnd, yyvsp[0].node); ;
1588 break;}
1589case 93:
1590#line 350 "grammar.y"
1591{ yyval.node = new BinaryLogicalNode(yyvsp[-2].node, OpOr, yyvsp[0].node); ;
1592 break;}
1593case 95:
1594#line 356 "grammar.y"
1595{ yyval.node = new ConditionalNode(yyvsp[-4].node, yyvsp[-2].node, yyvsp[0].node); ;
1596 break;}
1597case 97:
1598#line 362 "grammar.y"
1599{ yyval.node = new AssignNode(yyvsp[-2].node, yyvsp[-1].op, yyvsp[0].node);;
1600 break;}
1601case 98:
1602#line 366 "grammar.y"
1603{ yyval.op = OpEqual; ;
1604 break;}
1605case 99:
1606#line 367 "grammar.y"
1607{ yyval.op = OpPlusEq; ;
1608 break;}
1609case 100:
1610#line 368 "grammar.y"
1611{ yyval.op = OpMinusEq; ;
1612 break;}
1613case 101:
1614#line 369 "grammar.y"
1615{ yyval.op = OpMultEq; ;
1616 break;}
1617case 102:
1618#line 370 "grammar.y"
1619{ yyval.op = OpDivEq; ;
1620 break;}
1621case 103:
1622#line 371 "grammar.y"
1623{ yyval.op = OpLShift; ;
1624 break;}
1625case 104:
1626#line 372 "grammar.y"
1627{ yyval.op = OpRShift; ;
1628 break;}
1629case 105:
1630#line 373 "grammar.y"
1631{ yyval.op = OpURShift; ;
1632 break;}
1633case 106:
1634#line 374 "grammar.y"
1635{ yyval.op = OpAndEq; ;
1636 break;}
1637case 107:
1638#line 375 "grammar.y"
1639{ yyval.op = OpXOrEq; ;
1640 break;}
1641case 108:
1642#line 376 "grammar.y"
1643{ yyval.op = OpOrEq; ;
1644 break;}
1645case 109:
1646#line 377 "grammar.y"
1647{ yyval.op = OpModEq; ;
1648 break;}
1649case 111:
1650#line 382 "grammar.y"
1651{ yyval.node = new CommaNode(yyvsp[-2].node, yyvsp[0].node); ;
1652 break;}
1653case 126:
1654#line 403 "grammar.y"
1655{ yyval.stat = new BlockNode(0L); DBG(yyval.stat, yylsp[0], yylsp[0]); ;
1656 break;}
1657case 127:
1658#line 404 "grammar.y"
1659{ yyval.stat = new BlockNode(yyvsp[-1].srcs); DBG(yyval.stat, yylsp[0], yylsp[0]); ;
1660 break;}
1661case 128:
1662#line 408 "grammar.y"
1663{ yyval.slist = new StatListNode(yyvsp[0].stat); ;
1664 break;}
1665case 129:
1666#line 409 "grammar.y"
1667{ yyval.slist = new StatListNode(yyvsp[-1].slist, yyvsp[0].stat); ;
1668 break;}
1669case 130:
1670#line 413 "grammar.y"
1671{ yyval.stat = new VarStatementNode(yyvsp[-1].vlist);
1672 DBG(yyval.stat, yylsp[-2], yylsp[0]); ;
1673 break;}
1674case 131:
1675#line 415 "grammar.y"
1676{ if (automatic()) {
1677 yyval.stat = new VarStatementNode(yyvsp[-1].vlist);
1678 DBG(yyval.stat, yylsp[-2], yylsp[-1]);
1679 } else {
1680 YYABORT;
1681 }
1682 ;
1683 break;}
1684case 132:
1685#line 425 "grammar.y"
1686{ yyval.vlist = new VarDeclListNode(yyvsp[0].decl); ;
1687 break;}
1688case 133:
1689#line 427 "grammar.y"
1690{ yyval.vlist = new VarDeclListNode(yyvsp[-2].vlist, yyvsp[0].decl); ;
1691 break;}
1692case 134:
1693#line 431 "grammar.y"
1694{ yyval.decl = new VarDeclNode(yyvsp[0].ustr, 0); delete yyvsp[0].ustr; ;
1695 break;}
1696case 135:
1697#line 432 "grammar.y"
1698{ yyval.decl = new VarDeclNode(yyvsp[-1].ustr, yyvsp[0].init); delete yyvsp[-1].ustr; ;
1699 break;}
1700case 136:
1701#line 436 "grammar.y"
1702{ yyval.init = new AssignExprNode(yyvsp[0].node); ;
1703 break;}
1704case 137:
1705#line 440 "grammar.y"
1706{ yyval.stat = new EmptyStatementNode(); ;
1707 break;}
1708case 138:
1709#line 444 "grammar.y"
1710{ yyval.stat = new ExprStatementNode(yyvsp[-1].node);
1711 DBG(yyval.stat, yylsp[-1], yylsp[0]); ;
1712 break;}
1713case 139:
1714#line 446 "grammar.y"
1715{ if (automatic()) {
1716 yyval.stat = new ExprStatementNode(yyvsp[-1].node);
1717 DBG(yyval.stat, yylsp[-1], yylsp[-1]);
1718 } else
1719 YYABORT; ;
1720 break;}
1721case 140:
1722#line 454 "grammar.y"
1723{ yyval.stat = new IfNode(yyvsp[-2].node,yyvsp[0].stat,0L);DBG(yyval.stat,yylsp[-4],yylsp[-1]); ;
1724 break;}
1725case 141:
1726#line 456 "grammar.y"
1727{ yyval.stat = new IfNode(yyvsp[-4].node,yyvsp[-2].stat,yyvsp[0].stat);DBG(yyval.stat,yylsp[-6],yylsp[-3]); ;
1728 break;}
1729case 142:
1730#line 460 "grammar.y"
1731{ yyval.stat=new DoWhileNode(yyvsp[-4].stat,yyvsp[-1].node);DBG(yyval.stat,yylsp[-5],yylsp[-3]);;
1732 break;}
1733case 143:
1734#line 461 "grammar.y"
1735{ yyval.stat = new WhileNode(yyvsp[-2].node,yyvsp[0].stat);DBG(yyval.stat,yylsp[-4],yylsp[-1]); ;
1736 break;}
1737case 144:
1738#line 463 "grammar.y"
1739{ yyval.stat = new ForNode(yyvsp[-6].node,yyvsp[-4].node,yyvsp[-2].node,yyvsp[0].stat);
1740 DBG(yyval.stat,yylsp[-8],yylsp[-1]); ;
1741 break;}
1742case 145:
1743#line 466 "grammar.y"
1744{ yyval.stat = new ForNode(yyvsp[-6].vlist,yyvsp[-4].node,yyvsp[-2].node,yyvsp[0].stat);
1745 DBG(yyval.stat,yylsp[-9],yylsp[-1]); ;
1746 break;}
1747case 146:
1748#line 469 "grammar.y"
1749{ yyval.stat = new ForInNode(yyvsp[-4].node, yyvsp[-2].node, yyvsp[0].stat);
1750 DBG(yyval.stat,yylsp[-6],yylsp[-1]); ;
1751 break;}
1752case 147:
1753#line 472 "grammar.y"
1754{ yyval.stat = new ForInNode(yyvsp[-4].ustr,0L,yyvsp[-2].node,yyvsp[0].stat);
1755 DBG(yyval.stat,yylsp[-7],yylsp[-1]);
1756 delete yyvsp[-4].ustr; ;
1757 break;}
1758case 148:
1759#line 476 "grammar.y"
1760{ yyval.stat = new ForInNode(yyvsp[-5].ustr,yyvsp[-4].init,yyvsp[-2].node,yyvsp[0].stat);
1761 DBG(yyval.stat,yylsp[-8],yylsp[-1]);
1762 delete yyvsp[-5].ustr; ;
1763 break;}
1764case 149:
1765#line 482 "grammar.y"
1766{ yyval.node = 0L; ;
1767 break;}
1768case 151:
1769#line 487 "grammar.y"
1770{ yyval.stat = new ContinueNode(); DBG(yyval.stat,yylsp[-1],yylsp[0]); ;
1771 break;}
1772case 152:
1773#line 488 "grammar.y"
1774{ if (automatic()) {
1775 yyval.stat = new ContinueNode(); DBG(yyval.stat,yylsp[-1],yylsp[0]);
1776 } else
1777 YYABORT; ;
1778 break;}
1779case 153:
1780#line 492 "grammar.y"
1781{ yyval.stat = new ContinueNode(yyvsp[-1].ustr); DBG(yyval.stat,yylsp[-2],yylsp[0]);
1782 delete yyvsp[-1].ustr; ;
1783 break;}
1784case 154:
1785#line 494 "grammar.y"
1786{ if (automatic()) {
1787 yyval.stat = new ContinueNode(yyvsp[-1].ustr);DBG(yyval.stat,yylsp[-2],yylsp[-1]);
1788 delete yyvsp[-1].ustr;
1789 } else
1790 YYABORT; ;
1791 break;}
1792case 155:
1793#line 502 "grammar.y"
1794{ yyval.stat = new BreakNode();DBG(yyval.stat,yylsp[-1],yylsp[0]); ;
1795 break;}
1796case 156:
1797#line 503 "grammar.y"
1798{ if (automatic()) {
1799 yyval.stat = new BreakNode(); DBG(yyval.stat,yylsp[-1],yylsp[-1]);
1800 } else
1801 YYABORT; ;
1802 break;}
1803case 157:
1804#line 507 "grammar.y"
1805{ yyval.stat = new BreakNode(yyvsp[-1].ustr); DBG(yyval.stat,yylsp[-2],yylsp[0]);
1806 delete yyvsp[-1].ustr; ;
1807 break;}
1808case 158:
1809#line 509 "grammar.y"
1810{ if (automatic()) {
1811 yyval.stat = new BreakNode(yyvsp[-1].ustr); DBG(yyval.stat,yylsp[-2],yylsp[-1]);
1812 delete yyvsp[-1].ustr;
1813 } else
1814 YYABORT;
1815 ;
1816 break;}
1817case 159:
1818#line 518 "grammar.y"
1819{ yyval.stat = new ReturnNode(0L); DBG(yyval.stat,yylsp[-1],yylsp[0]); ;
1820 break;}
1821case 160:
1822#line 519 "grammar.y"
1823{ if (automatic()) {
1824 yyval.stat = new ReturnNode(0L); DBG(yyval.stat,yylsp[-1],yylsp[-1]);
1825 } else
1826 YYABORT; ;
1827 break;}
1828case 161:
1829#line 523 "grammar.y"
1830{ yyval.stat = new ReturnNode(yyvsp[-1].node); ;
1831 break;}
1832case 162:
1833#line 524 "grammar.y"
1834{ if (automatic())
1835 yyval.stat = new ReturnNode(yyvsp[-1].node);
1836 else
1837 YYABORT; ;
1838 break;}
1839case 163:
1840#line 531 "grammar.y"
1841{ yyval.stat = new WithNode(yyvsp[-2].node,yyvsp[0].stat);
1842 DBG(yyval.stat, yylsp[-4], yylsp[-1]); ;
1843 break;}
1844case 164:
1845#line 536 "grammar.y"
1846{ yyval.stat = new SwitchNode(yyvsp[-2].node, yyvsp[0].cblk);
1847 DBG(yyval.stat, yylsp[-4], yylsp[-1]); ;
1848 break;}
1849case 165:
1850#line 541 "grammar.y"
1851{ yyval.cblk = new CaseBlockNode(yyvsp[-1].clist, 0L, 0L); ;
1852 break;}
1853case 166:
1854#line 543 "grammar.y"
1855{ yyval.cblk = new CaseBlockNode(yyvsp[-3].clist, yyvsp[-2].ccl, yyvsp[-1].clist); ;
1856 break;}
1857case 167:
1858#line 547 "grammar.y"
1859{ yyval.clist = 0L; ;
1860 break;}
1861case 169:
1862#line 552 "grammar.y"
1863{ yyval.clist = new ClauseListNode(yyvsp[0].ccl); ;
1864 break;}
1865case 170:
1866#line 553 "grammar.y"
1867{ yyval.clist = yyvsp[-1].clist->append(yyvsp[0].ccl); ;
1868 break;}
1869case 171:
1870#line 557 "grammar.y"
1871{ yyval.ccl = new CaseClauseNode(yyvsp[-1].node, 0L); ;
1872 break;}
1873case 172:
1874#line 558 "grammar.y"
1875{ yyval.ccl = new CaseClauseNode(yyvsp[-2].node, yyvsp[0].slist); ;
1876 break;}
1877case 173:
1878#line 562 "grammar.y"
1879{ yyval.ccl = new CaseClauseNode(0L, 0L);; ;
1880 break;}
1881case 174:
1882#line 563 "grammar.y"
1883{ yyval.ccl = new CaseClauseNode(0L, yyvsp[0].slist); ;
1884 break;}
1885case 175:
1886#line 567 "grammar.y"
1887{ yyvsp[0].stat->pushLabel(yyvsp[-2].ustr);
1888 yyval.stat = new LabelNode(yyvsp[-2].ustr, yyvsp[0].stat);
1889 delete yyvsp[-2].ustr; ;
1890 break;}
1891case 176:
1892#line 573 "grammar.y"
1893{ yyval.stat = new ThrowNode(yyvsp[-1].node); ;
1894 break;}
1895case 177:
1896#line 577 "grammar.y"
1897{ yyval.stat = new TryNode(yyvsp[-1].stat, yyvsp[0].node); ;
1898 break;}
1899case 178:
1900#line 578 "grammar.y"
1901{ yyval.stat = new TryNode(yyvsp[-1].stat, 0L, yyvsp[0].node); ;
1902 break;}
1903case 179:
1904#line 579 "grammar.y"
1905{ yyval.stat = new TryNode(yyvsp[-2].stat, yyvsp[-1].node, yyvsp[0].node); ;
1906 break;}
1907case 180:
1908#line 583 "grammar.y"
1909{ yyval.node = new CatchNode(yyvsp[-2].ustr, yyvsp[0].stat); delete yyvsp[-2].ustr; ;
1910 break;}
1911case 181:
1912#line 587 "grammar.y"
1913{ yyval.node = new FinallyNode(yyvsp[0].stat); ;
1914 break;}
1915case 182:
1916#line 591 "grammar.y"
1917{ yyval.func = new FuncDeclNode(yyvsp[-3].ustr, 0L, yyvsp[0].body);
1918 delete yyvsp[-3].ustr; ;
1919 break;}
1920case 183:
1921#line 594 "grammar.y"
1922{ yyval.func = new FuncDeclNode(yyvsp[-4].ustr, yyvsp[-2].param, yyvsp[0].body);
1923 delete yyvsp[-4].ustr; ;
1924 break;}
1925case 184:
1926#line 598 "grammar.y"
1927{ yyval.node = new FuncExprNode(0L, yyvsp[0].body); ;
1928 break;}
1929case 185:
1930#line 600 "grammar.y"
1931{ yyval.node = new FuncExprNode(yyvsp[-2].param, yyvsp[0].body); ;
1932 break;}
1933case 186:
1934#line 605 "grammar.y"
1935{ yyval.param = new ParameterNode(yyvsp[0].ustr); delete yyvsp[0].ustr; ;
1936 break;}
1937case 187:
1938#line 606 "grammar.y"
1939{ yyval.param = yyvsp[-2].param->append(yyvsp[0].ustr);
1940 delete yyvsp[0].ustr; ;
1941 break;}
1942case 188:
1943#line 611 "grammar.y"
1944{ yyval.body = new FunctionBodyNode(0L);
1945 DBG(yyval.body, yylsp[-1], yylsp[0]);;
1946 break;}
1947case 189:
1948#line 613 "grammar.y"
1949{ yyval.body = new FunctionBodyNode(yyvsp[-1].srcs);
1950 DBG(yyval.body, yylsp[-2], yylsp[0]);;
1951 break;}
1952case 190:
1953#line 618 "grammar.y"
1954{ yyval.prog = new ProgramNode(0L);
1955 Parser::progNode = yyval.prog; ;
1956 break;}
1957case 191:
1958#line 620 "grammar.y"
1959{ yyval.prog = new ProgramNode(yyvsp[0].srcs);
1960 Parser::progNode = yyval.prog; ;
1961 break;}
1962case 192:
1963#line 625 "grammar.y"
1964{ yyval.srcs = new SourceElementsNode(yyvsp[0].src); ;
1965 break;}
1966case 193:
1967#line 627 "grammar.y"
1968{ yyval.srcs = new SourceElementsNode(yyvsp[0].srcs, yyvsp[-1].src); ;
1969 break;}
1970case 194:
1971#line 634 "grammar.y"
1972{ yyval.src = new SourceElementNode(yyvsp[0].stat); ;
1973 break;}
1974case 195:
1975#line 635 "grammar.y"
1976{ yyval.src = new SourceElementNode(yyvsp[0].func); ;
1977 break;}
1978}
1979 /* the action file gets copied in in place of this dollarsign */
1980#line 543 "/usr/share/bison.simple"
1981
1982
1983 yyvsp -= yylen;
1984 yyssp -= yylen;
1985#ifdef YYLSP_NEEDED
1986 yylsp -= yylen;
1987#endif
1988
1989#if YYDEBUG != 0
1990 if (yydebug)
1991 {
1992 short *ssp1 = yyss - 1;
1993 fprintf (stderr, "state stack now");
1994 while (ssp1 != yyssp)
1995 fprintf (stderr, " %d", *++ssp1);
1996 fprintf (stderr, "\n");
1997 }
1998#endif
1999
2000 *++yyvsp = yyval;
2001
2002#ifdef YYLSP_NEEDED
2003 yylsp++;
2004 if (yylen == 0)
2005 {
2006 yylsp->first_line = yylloc.first_line;
2007 yylsp->first_column = yylloc.first_column;
2008 yylsp->last_line = (yylsp-1)->last_line;
2009 yylsp->last_column = (yylsp-1)->last_column;
2010 yylsp->text = 0;
2011 }
2012 else
2013 {
2014 yylsp->last_line = (yylsp+yylen-1)->last_line;
2015 yylsp->last_column = (yylsp+yylen-1)->last_column;
2016 }
2017#endif
2018
2019 /* Now "shift" the result of the reduction.
2020 Determine what state that goes to,
2021 based on the state we popped back to
2022 and the rule number reduced by. */
2023
2024 yyn = yyr1[yyn];
2025
2026 yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
2027 if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
2028 yystate = yytable[yystate];
2029 else
2030 yystate = yydefgoto[yyn - YYNTBASE];
2031
2032 goto yynewstate;
2033
2034yyerrlab: /* here on detecting error */
2035
2036 if (! yyerrstatus)
2037 /* If not already recovering from an error, report this error. */
2038 {
2039 ++yynerrs;
2040
2041#ifdef YYERROR_VERBOSE
2042 yyn = yypact[yystate];
2043
2044 if (yyn > YYFLAG && yyn < YYLAST)
2045 {
2046 int size = 0;
2047 char *msg;
2048 int x, count;
2049
2050 count = 0;
2051 /* Start X at -yyn if nec to avoid negative indexes in yycheck. */
2052 for (x = (yyn < 0 ? -yyn : 0);
2053 x < (sizeof(yytname) / sizeof(char *)); x++)
2054 if (yycheck[x + yyn] == x)
2055 size += strlen(yytname[x]) + 15, count++;
2056 msg = (char *) malloc(size + 15);
2057 if (msg != 0)
2058 {
2059 strcpy(msg, "parse error");
2060
2061 if (count < 5)
2062 {
2063 count = 0;
2064 for (x = (yyn < 0 ? -yyn : 0);
2065 x < (sizeof(yytname) / sizeof(char *)); x++)
2066 if (yycheck[x + yyn] == x)
2067 {
2068 strcat(msg, count == 0 ? ", expecting `" : " or `");
2069 strcat(msg, yytname[x]);
2070 strcat(msg, "'");
2071 count++;
2072 }
2073 }
2074 yyerror(msg);
2075 free(msg);
2076 }
2077 else
2078 yyerror ("parse error; also virtual memory exceeded");
2079 }
2080 else
2081#endif /* YYERROR_VERBOSE */
2082 yyerror("parse error");
2083 }
2084
2085 goto yyerrlab1;
2086yyerrlab1: /* here on error raised explicitly by an action */
2087
2088 if (yyerrstatus == 3)
2089 {
2090 /* if just tried and failed to reuse lookahead token after an error, discard it. */
2091
2092 /* return failure if at end of input */
2093 if (yychar == YYEOF)
2094 YYABORT;
2095
2096#if YYDEBUG != 0
2097 if (yydebug)
2098 fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
2099#endif
2100
2101 yychar = YYEMPTY;
2102 }
2103
2104 /* Else will try to reuse lookahead token
2105 after shifting the error token. */
2106
2107 yyerrstatus = 3; /* Each real token shifted decrements this */
2108
2109 goto yyerrhandle;
2110
2111yyerrdefault: /* current state does not do anything special for the error token. */
2112
2113#if 0
2114 /* This is wrong; only states that explicitly want error tokens
2115 should shift them. */
2116 yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/
2117 if (yyn) goto yydefault;
2118#endif
2119
2120yyerrpop: /* pop the current state because it cannot handle the error token */
2121
2122 if (yyssp == yyss) YYABORT;
2123 yyvsp--;
2124 yystate = *--yyssp;
2125#ifdef YYLSP_NEEDED
2126 yylsp--;
2127#endif
2128
2129#if YYDEBUG != 0
2130 if (yydebug)
2131 {
2132 short *ssp1 = yyss - 1;
2133 fprintf (stderr, "Error: state stack now");
2134 while (ssp1 != yyssp)
2135 fprintf (stderr, " %d", *++ssp1);
2136 fprintf (stderr, "\n");
2137 }
2138#endif
2139
2140yyerrhandle:
2141
2142 yyn = yypact[yystate];
2143 if (yyn == YYFLAG)
2144 goto yyerrdefault;
2145
2146 yyn += YYTERROR;
2147 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
2148 goto yyerrdefault;
2149
2150 yyn = yytable[yyn];
2151 if (yyn < 0)
2152 {
2153 if (yyn == YYFLAG)
2154 goto yyerrpop;
2155 yyn = -yyn;
2156 goto yyreduce;
2157 }
2158 else if (yyn == 0)
2159 goto yyerrpop;
2160
2161 if (yyn == YYFINAL)
2162 YYACCEPT;
2163
2164#if YYDEBUG != 0
2165 if (yydebug)
2166 fprintf(stderr, "Shifting error token, ");
2167#endif
2168
2169 *++yyvsp = yylval;
2170#ifdef YYLSP_NEEDED
2171 *++yylsp = yylloc;
2172#endif
2173
2174 yystate = yyn;
2175 goto yynewstate;
2176
2177 yyacceptlab:
2178 /* YYACCEPT comes here. */
2179 if (yyfree_stacks)
2180 {
2181 free (yyss);
2182 free (yyvs);
2183#ifdef YYLSP_NEEDED
2184 free (yyls);
2185#endif
2186 }
2187 return 0;
2188
2189 yyabortlab:
2190 /* YYABORT comes here. */
2191 if (yyfree_stacks)
2192 {
2193 free (yyss);
2194 free (yyvs);
2195#ifdef YYLSP_NEEDED
2196 free (yyls);
2197#endif
2198 }
2199 return 1;
2200}
2201#line 638 "grammar.y"
2202
2203
2204int yyerror (const char *) /* Called by yyparse on error */
2205{
2206// fprintf(stderr, "ERROR: %s at line %d\n",
2207// s, KJScript::lexer()->lineNo());
2208 return 1;
2209}
2210
2211/* may we automatically insert a semicolon ? */
2212bool automatic()
2213{
2214 if (yychar == '}' || yychar == 0)
2215 return true;
2216 else if (Lexer::curr()->prevTerminator())
2217 return true;
2218
2219 return false;
2220}
Note: See TracBrowser for help on using the repository browser.