1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
21 /* A Bison parser, made from grammar.y
22 by GNU Bison version 1.28 */
35 #include "grammar.hxx"
39 std::list
<Node
*> nodelist
;
41 void yyerror(const char *);
50 int debug(const char *format
, ...);
73 #define YYTRANSLATE(x) ((unsigned)(x) <= 285 ? yytranslate[x] : 66)
75 static const char yytranslate
[] = { 0,
76 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
77 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
78 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
79 2, 2, 2, 2, 2, 2, 2, 2, 2, 33,
80 37, 2, 2, 2, 2, 2, 2, 2, 2, 2,
81 2, 2, 2, 2, 2, 2, 2, 2, 2, 36,
82 2, 40, 2, 2, 2, 2, 2, 2, 2, 2,
83 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
84 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
85 34, 2, 38, 42, 41, 2, 2, 2, 2, 2,
86 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
87 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
88 2, 2, 35, 32, 39, 2, 2, 2, 2, 2,
89 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
90 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
91 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
92 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
93 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
94 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
95 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
96 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
97 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
98 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
99 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
100 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
101 2, 2, 2, 2, 2, 1, 3, 4, 5, 6,
102 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
103 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
108 static const short yyprhs
[] = { 0,
109 0, 2, 4, 6, 8, 10, 12, 14, 16, 18,
110 20, 22, 24, 26, 28, 30, 32, 34, 36, 39,
111 42, 45, 48, 51, 54, 58, 60, 63, 66, 69,
112 72, 75, 79, 81, 85, 89, 92, 96, 99, 103,
113 106, 110, 114, 120, 124, 130, 132, 135, 137, 140,
114 143, 147, 150, 154, 157, 159, 161, 165, 167, 169,
115 172, 174, 176, 178, 180, 182, 184, 186, 188, 190,
119 static const short yyrhs
[] = { 4,
120 0, 9, 0, 10, 0, 5, 0, 11, 0, 12,
121 0, 20, 0, 21, 0, 7, 0, 6, 0, 23,
122 0, 17, 0, 18, 0, 8, 0, 32, 0, 31,
123 0, 22, 0, 43, 0, 44, 43, 0, 26, 33,
124 0, 26, 34, 0, 26, 35, 0, 26, 36, 0,
125 26, 32, 0, 26, 32, 32, 0, 29, 0, 27,
126 37, 0, 27, 38, 0, 27, 39, 0, 27, 40,
127 0, 27, 32, 0, 27, 32, 32, 0, 30, 0,
128 45, 64, 46, 0, 33, 64, 37, 0, 33, 37,
129 0, 35, 64, 39, 0, 35, 39, 0, 34, 64,
130 38, 0, 34, 38, 0, 65, 41, 65, 0, 65,
131 42, 65, 0, 65, 41, 49, 42, 49, 0, 14,
132 49, 49, 0, 35, 64, 16, 64, 39, 0, 3,
133 0, 54, 49, 0, 19, 0, 56, 49, 0, 13,
134 49, 0, 13, 50, 49, 0, 24, 49, 0, 24,
135 49, 49, 0, 25, 49, 0, 62, 0, 63, 0,
136 62, 28, 63, 0, 64, 0, 65, 0, 64, 65,
137 0, 49, 0, 48, 0, 47, 0, 51, 0, 52,
138 0, 53, 0, 57, 0, 58, 0, 55, 0, 44,
145 static const short yyrline
[] = { 0,
146 59, 61, 62, 63, 64, 65, 66, 67, 68, 69,
147 70, 71, 72, 73, 74, 75, 76, 79, 81, 84,
148 86, 87, 88, 89, 90, 91, 94, 96, 97, 98,
149 99, 100, 101, 104, 108, 110, 113, 115, 118, 120,
150 123, 125, 126, 129, 133, 138, 142, 145, 149, 153,
151 155, 158, 160, 163, 168, 172, 174, 177, 181, 183,
152 186, 188, 189, 190, 191, 192, 193, 194, 195, 196,
158 #if YYDEBUG != 0 || defined (YYERROR_VERBOSE)
160 static const char * const yytname
[] = { "$","error","$undefined.","ACCENT",
161 "SMALL_GREEK","CAPITAL_GREEK","BINARY_OPERATOR","RELATION_OPERATOR","ARROW",
162 "GENERAL_IDEN","GENERAL_OPER","BIG_SYMBOL","FUNCTION","ROOT","FRACTION","SUBSUP",
163 "EQOVER","DELIMETER","LARGE_DELIM","DECORATION","SPACE_SYMBOL","CHARACTER","STRING",
164 "OPERATOR","EQBEGIN","EQEND","EQLEFT","EQRIGHT","NEWLINE","LEFT_DELIM","RIGHT_DELIM",
165 "DIGIT","'|'","'('","'['","'{'","'<'","')'","']'","'}'","'>'","'_'","'^'","Identifier",
166 "PrimaryExpr","EQLeft","EQRight","Fence","Parenth","Block","Bracket","SubSupExpr",
167 "FractionExpr","OverExpr","Accent","AccentExpr","Decoration","DecorationExpr",
168 "RootExpr","BeginExpr","EndExpr","MathML","Lines","Line","ExprList","Expr", NULL
172 static const short yyr1
[] = { 0,
173 43, 43, 43, 43, 43, 43, 43, 43, 43, 43,
174 43, 43, 43, 43, 43, 43, 43, 44, 44, 45,
175 45, 45, 45, 45, 45, 45, 46, 46, 46, 46,
176 46, 46, 46, 47, 48, 48, 49, 49, 50, 50,
177 51, 51, 51, 52, 53, 54, 55, 56, 57, 58,
178 58, 59, 59, 60, 61, 62, 62, 63, 64, 64,
179 65, 65, 65, 65, 65, 65, 65, 65, 65, 65,
183 static const short yyr2
[] = { 0,
184 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
185 1, 1, 1, 1, 1, 1, 1, 1, 2, 2,
186 2, 2, 2, 2, 3, 1, 2, 2, 2, 2,
187 2, 3, 1, 3, 3, 2, 3, 2, 3, 2,
188 3, 3, 5, 3, 5, 1, 2, 1, 2, 2,
189 3, 2, 3, 2, 1, 1, 3, 1, 1, 2,
190 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
194 static const short yydefact
[] = { 0,
195 46, 1, 4, 10, 9, 14, 2, 3, 5, 6,
196 0, 0, 12, 13, 48, 7, 8, 17, 11, 0,
197 0, 0, 26, 16, 15, 0, 0, 18, 70, 0,
198 63, 62, 61, 64, 65, 66, 0, 69, 0, 67,
199 68, 71, 72, 55, 56, 58, 59, 0, 0, 50,
200 0, 0, 52, 54, 24, 20, 21, 22, 23, 36,
201 0, 38, 0, 19, 0, 47, 49, 0, 60, 0,
202 0, 40, 0, 0, 51, 44, 53, 25, 35, 0,
203 37, 0, 33, 34, 57, 61, 41, 42, 39, 0,
204 31, 27, 28, 29, 30, 0, 45, 32, 43, 0,
208 static const short yydefgoto
[] = { 28,
209 29, 30, 84, 31, 32, 33, 51, 34, 35, 36,
210 37, 38, 39, 40, 41, 42, 43, 100, 44, 45,
214 static const short yypact
[] = { 393,
215 -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
216 -30, -19,-32768,-32768,-32768,-32768,-32768,-32768,-32768, -19,
217 -19, -3,-32768,-32768,-32768, 290, 107,-32768, 425, 393,
218 -32768,-32768,-32768,-32768,-32768,-32768, -19,-32768, -19,-32768,
219 -32768,-32768,-32768, -20,-32768, 393, -21, 218, 107,-32768,
220 -19, -19, -19,-32768, -15,-32768,-32768,-32768,-32768,-32768,
221 325,-32768, 70,-32768, 360,-32768,-32768, 393, -21, 393,
222 393,-32768, 254, 144,-32768,-32768,-32768,-32768,-32768, 393,
223 -32768, -25,-32768,-32768,-32768, -31, -21, -21,-32768, 181,
224 -14,-32768,-32768,-32768,-32768, -19,-32768,-32768,-32768, 22,
228 static const short yypgoto
[] = { -2,
229 -32768,-32768,-32768,-32768,-32768, -11,-32768,-32768,-32768,-32768,
230 -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, -33,
238 static const short yytable
[] = { 50,
239 52, 61, 63, 48, 49, 65, 91, 68, 53, 54,
240 96, 92, 93, 94, 95, 49, 78, 98, 69, 70,
241 71, 101, 102, 73, 74, 66, 64, 67, 55, 56,
242 57, 58, 59, 69, 85, 69, 0, 69, 0, 75,
243 76, 77, 87, 88, 0, 69, 69, 0, 0, 0,
244 0, 0, 0, 0, 0, 90, 0, 0, 86, 0,
245 0, 0, 69, 0, 0, 0, 0, 0, 0, 0,
246 0, 0, 1, 2, 3, 4, 5, 6, 7, 8,
247 9, 10, 11, 12, 99, 80, 13, 14, 15, 16,
248 17, 18, 19, 20, 21, 22, 0, 0, 23, 0,
249 24, 25, 26, 0, 27, 0, 0, 0, 81, 1,
250 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,
251 12, 0, 0, 13, 14, 15, 16, 17, 18, 19,
252 20, 21, 22, 0, 0, 23, 0, 24, 25, 26,
253 0, 27, 0, 0, 0, 62, 1, 2, 3, 4,
254 5, 6, 7, 8, 9, 10, 11, 12, 0, 0,
255 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
256 0, 0, 23, 0, 24, 25, 26, 0, 27, 0,
257 0, 0, 81, 1, 2, 3, 4, 5, 6, 7,
258 8, 9, 10, 11, 12, 0, 0, 13, 14, 15,
259 16, 17, 18, 19, 20, 21, 22, 0, 0, 23,
260 0, 24, 25, 26, 0, 27, 0, 0, 0, 97,
261 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
262 11, 12, 0, 0, 13, 14, 15, 16, 17, 18,
263 19, 20, 21, 22, 0, 0, 23, 0, 24, 25,
264 26, 0, 27, 0, 0, 72, 1, 2, 3, 4,
265 5, 6, 7, 8, 9, 10, 11, 12, 0, 0,
266 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
267 0, 0, 23, 0, 24, 25, 26, 0, 27, 0,
268 0, 89, 1, 2, 3, 4, 5, 6, 7, 8,
269 9, 10, 11, 12, 0, 0, 13, 14, 15, 16,
270 17, 18, 19, 20, 21, 22, 0, 0, 23, 0,
271 24, 25, 26, 0, 27, 0, 60, 1, 2, 3,
272 4, 5, 6, 7, 8, 9, 10, 11, 12, 0,
273 0, 13, 14, 15, 16, 17, 18, 19, 20, 21,
274 22, 0, 0, 23, 0, 24, 25, 26, 0, 27,
275 0, 79, 1, 2, 3, 4, 5, 6, 7, 8,
276 9, 10, 11, 12, 0, 0, 13, 14, 15, 16,
277 17, 18, 19, 20, 21, 22, 82, 0, 23, 83,
278 24, 25, 26, 0, 27, 1, 2, 3, 4, 5,
279 6, 7, 8, 9, 10, 11, 12, 0, 0, 13,
280 14, 15, 16, 17, 18, 19, 20, 21, 22, 0,
281 0, 23, 0, 24, 25, 26, 0, 27, 2, 3,
282 4, 5, 6, 7, 8, 9, 10, 0, 0, 0,
283 0, 13, 14, 0, 16, 17, 18, 19, 0, 0,
284 0, 0, 0, 0, 0, 24, 25
287 static const short yycheck
[] = { 11,
288 12, 26, 27, 34, 35, 30, 32, 28, 20, 21,
289 42, 37, 38, 39, 40, 35, 32, 32, 46, 41,
290 42, 0, 0, 48, 49, 37, 29, 39, 32, 33,
291 34, 35, 36, 61, 68, 63, -1, 65, -1, 51,
292 52, 53, 70, 71, -1, 73, 74, -1, -1, -1,
293 -1, -1, -1, -1, -1, 80, -1, -1, 70, -1,
294 -1, -1, 90, -1, -1, -1, -1, -1, -1, -1,
295 -1, -1, 3, 4, 5, 6, 7, 8, 9, 10,
296 11, 12, 13, 14, 96, 16, 17, 18, 19, 20,
297 21, 22, 23, 24, 25, 26, -1, -1, 29, -1,
298 31, 32, 33, -1, 35, -1, -1, -1, 39, 3,
299 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
300 14, -1, -1, 17, 18, 19, 20, 21, 22, 23,
301 24, 25, 26, -1, -1, 29, -1, 31, 32, 33,
302 -1, 35, -1, -1, -1, 39, 3, 4, 5, 6,
303 7, 8, 9, 10, 11, 12, 13, 14, -1, -1,
304 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
305 -1, -1, 29, -1, 31, 32, 33, -1, 35, -1,
306 -1, -1, 39, 3, 4, 5, 6, 7, 8, 9,
307 10, 11, 12, 13, 14, -1, -1, 17, 18, 19,
308 20, 21, 22, 23, 24, 25, 26, -1, -1, 29,
309 -1, 31, 32, 33, -1, 35, -1, -1, -1, 39,
310 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
311 13, 14, -1, -1, 17, 18, 19, 20, 21, 22,
312 23, 24, 25, 26, -1, -1, 29, -1, 31, 32,
313 33, -1, 35, -1, -1, 38, 3, 4, 5, 6,
314 7, 8, 9, 10, 11, 12, 13, 14, -1, -1,
315 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
316 -1, -1, 29, -1, 31, 32, 33, -1, 35, -1,
317 -1, 38, 3, 4, 5, 6, 7, 8, 9, 10,
318 11, 12, 13, 14, -1, -1, 17, 18, 19, 20,
319 21, 22, 23, 24, 25, 26, -1, -1, 29, -1,
320 31, 32, 33, -1, 35, -1, 37, 3, 4, 5,
321 6, 7, 8, 9, 10, 11, 12, 13, 14, -1,
322 -1, 17, 18, 19, 20, 21, 22, 23, 24, 25,
323 26, -1, -1, 29, -1, 31, 32, 33, -1, 35,
324 -1, 37, 3, 4, 5, 6, 7, 8, 9, 10,
325 11, 12, 13, 14, -1, -1, 17, 18, 19, 20,
326 21, 22, 23, 24, 25, 26, 27, -1, 29, 30,
327 31, 32, 33, -1, 35, 3, 4, 5, 6, 7,
328 8, 9, 10, 11, 12, 13, 14, -1, -1, 17,
329 18, 19, 20, 21, 22, 23, 24, 25, 26, -1,
330 -1, 29, -1, 31, 32, 33, -1, 35, 4, 5,
331 6, 7, 8, 9, 10, 11, 12, -1, -1, -1,
332 -1, 17, 18, -1, 20, 21, 22, 23, -1, -1,
333 -1, -1, -1, -1, -1, 31, 32
335 /* This file comes from bison-1.28. */
337 /* Skeleton output parser for bison,
338 Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
340 This program is free software; you can redistribute it and/or modify
341 it under the terms of the GNU General Public License as published by
342 the Free Software Foundation; either version 2, or (at your option)
345 This program is distributed in the hope that it will be useful,
346 but WITHOUT ANY WARRANTY; without even the implied warranty of
347 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
348 GNU General Public License for more details.
350 You should have received a copy of the GNU General Public License
351 along with this program; if not, write to the Free Software
352 Foundation, Inc., 59 Temple Place - Suite 330,
353 Boston, MA 02111-1307, USA. */
355 /* As a special exception, when this file is copied by Bison into a
356 Bison output file, you may use that output file without restriction.
357 This special exception was added by the Free Software Foundation
358 in version 1.24 of Bison. */
360 /* This is the parser code that is written into each bison parser
361 when the %semantic_parser declaration is not specified in the grammar.
362 It was written by Richard Stallman by simplifying the hairy parser
363 used when %semantic_parser is specified. */
365 #ifndef YYSTACK_USE_ALLOCA
367 #define YYSTACK_USE_ALLOCA
368 #else /* alloca not defined */
370 #define YYSTACK_USE_ALLOCA
371 #define alloca __builtin_alloca
372 #else /* not GNU C. */
373 #if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || (defined (__sun) && defined (__i386))
374 #define YYSTACK_USE_ALLOCA
375 #include <sal/alloca.h>
376 #else /* not sparc */
379 #define YYSTACK_USE_ALLOCA
380 #endif /* not _AIX */
381 #endif /* not sparc */
382 #endif /* not GNU C */
383 #endif /* alloca not defined */
384 #endif /* YYSTACK_USE_ALLOCA not defined */
386 #ifdef YYSTACK_USE_ALLOCA
387 #define YYSTACK_ALLOC alloca
389 #define YYSTACK_ALLOC malloc
392 /* Note: there must be only one dollar sign in this file.
393 It is replaced by the list of actions, each action
394 as one case of the switch. */
398 #define YYACCEPT goto yyacceptlab
399 #define YYABORT goto yyabortlab
404 #define YYLEX yylex()
410 #define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM)
412 #define YYLEX yylex(&yylval, &yylloc)
414 #else /* not YYLSP_NEEDED */
416 #define YYLEX yylex(&yylval, YYLEX_PARAM)
418 #define YYLEX yylex(&yylval)
420 #endif /* not YYLSP_NEEDED */
423 /* If nonreentrant, generate the variables here */
427 int yychar
; /* the lookahead symbol */
428 YYSTYPE yylval
; /* the semantic value of the */
429 /* lookahead symbol */
432 YYLTYPE yylloc
; /* location data for the lookahead */
436 int yynerrs
; /* number of parse errors so far */
437 #endif /* not YYPURE */
440 int yydebug
; /* nonzero means print parse trace */
441 /* Since this is uninitialized, it does not stop multiple parsers
445 /* YYINITDEPTH indicates the initial size of the parser's stacks */
448 #define YYINITDEPTH 200
451 /* YYMAXDEPTH is the maximum size the stacks can grow to
452 (effective only if the built-in stack extension method is used). */
459 #define YYMAXDEPTH 10000
462 /* The user can define YYPARSE_PARAM as the name of an argument to be passed
463 into yyparse. The argument should have type void *.
464 It should actually point to an object.
465 Grammar actions can access the variable by casting it
466 to the proper pointer type. */
470 #define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
471 #define YYPARSE_PARAM_DECL
472 #else /* not __cplusplus */
473 #define YYPARSE_PARAM_ARG YYPARSE_PARAM
474 #define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
475 #endif /* not __cplusplus */
476 #else /* not YYPARSE_PARAM */
477 #define YYPARSE_PARAM_ARG
478 #define YYPARSE_PARAM_DECL
479 #endif /* not YYPARSE_PARAM */
481 /* Prevent warning if -Wstrict-prototypes. */
484 int yyparse (void *);
491 yyparse(YYPARSE_PARAM_ARG
)
498 int yyerrstatus
; /* number of tokens to shift before error messages enabled */
499 int yychar1
= 0; /* lookahead token as an internal (translated) token number */
501 short yyssa
[YYINITDEPTH
]; /* the state stack */
502 YYSTYPE yyvsa
[YYINITDEPTH
]; /* the semantic value stack */
504 short *yyss
= yyssa
; /* refer to the stacks through separate pointers */
505 YYSTYPE
*yyvs
= yyvsa
; /* to allow yyoverflow to reallocate them elsewhere */
508 YYLTYPE yylsa
[YYINITDEPTH
]; /* the location stack */
509 YYLTYPE
*yyls
= yylsa
;
512 #define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
515 int yystacksize
= YYINITDEPTH
;
516 int yyfree_stacks
= 0;
527 YYSTYPE yyval
; /* the variable used to return */
529 /* semantic values from the action */
536 fprintf(stderr
, "Starting parse\n");
542 yychar
= YYEMPTY
; /* Cause a token to be read. */
544 /* Initialize stack pointers.
545 Waste one element of value and location stack
546 so that they stay on the same level as the state stack.
547 The wasted elements are never initialized. */
555 /* Push a new state, which is found in yystate . */
556 /* In all cases, when you get here, the value and location stacks
557 have just been pushed. so pushing a state here evens the stacks. */
560 *++yyssp
= sal::static_int_cast
<short>(yystate
);
562 if (yyssp
>= yyss
+ yystacksize
- 1)
564 /* Give user a chance to reallocate the stack */
565 /* Use copies of these so that the &'s don't force the real ones into memory. */
566 YYSTYPE
*yyvs1
= yyvs
;
569 YYLTYPE
*yyls1
= yyls
;
572 /* Get the current used size of the three stacks, in elements. */
573 int size
= yyssp
- yyss
+ 1;
576 /* Each stack pointer address is followed by the size of
577 the data in use in that stack, in bytes. */
579 /* This used to be a conditional around just the two extra args,
580 but that might be undefined if yyoverflow is a macro. */
581 yyoverflow("parser stack overflow",
582 &yyss1
, size
* sizeof (*yyssp
),
583 &yyvs1
, size
* sizeof (*yyvsp
),
584 &yyls1
, size
* sizeof (*yylsp
),
587 yyoverflow("parser stack overflow",
588 &yyss1
, size
* sizeof (*yyssp
),
589 &yyvs1
, size
* sizeof (*yyvsp
),
593 yyss
= yyss1
; yyvs
= yyvs1
;
597 #else /* no yyoverflow */
598 /* Extend the stack our own way. */
599 if (yystacksize
>= YYMAXDEPTH
)
601 yyerror("parser stack overflow");
613 if (yystacksize
> YYMAXDEPTH
)
614 yystacksize
= YYMAXDEPTH
;
615 #ifndef YYSTACK_USE_ALLOCA
618 yyss
= static_cast<short *>(YYSTACK_ALLOC (yystacksize
* sizeof (*yyssp
)));
620 size
* (unsigned int) sizeof (*yyssp
));
621 yyvs
= static_cast<YYSTYPE
*>(YYSTACK_ALLOC (yystacksize
* sizeof (*yyvsp
)));
623 size
* (unsigned int) sizeof (*yyvsp
));
625 yyls
= (YYLTYPE
*) YYSTACK_ALLOC (yystacksize
* sizeof (*yylsp
));
626 memcpy ((char *)yyls
, (char *)yyls1
,
627 size
* (unsigned int) sizeof (*yylsp
));
629 #endif /* no yyoverflow */
631 yyssp
= yyss
+ size
- 1;
632 yyvsp
= yyvs
+ size
- 1;
634 yylsp
= yyls
+ size
- 1;
639 fprintf(stderr
, "Stack size increased to %d\n", yystacksize
);
642 if (yyssp
>= yyss
+ yystacksize
- 1)
648 fprintf(stderr
, "Entering state %d\n", yystate
);
654 /* Do appropriate processing given the current state. */
655 /* Read a lookahead token if we need one and don't already have one. */
658 /* First try to decide what to do without reference to lookahead token. */
660 yyn
= yypact
[yystate
];
664 /* Not known => get a lookahead token if don't already have one. */
666 /* yychar is either YYEMPTY or YYEOF
667 or a valid token in external form. */
669 if (yychar
== YYEMPTY
)
673 fprintf(stderr
, "Reading a token: ");
678 /* Convert token to internal form (in yychar1) for indexing tables with */
680 if (yychar
<= 0) /* This means end of input. */
683 yychar
= YYEOF
; /* Don't call YYLEX any more */
687 fprintf(stderr
, "Now at end of input.\n");
692 yychar1
= YYTRANSLATE(yychar
);
697 fprintf (stderr
, "Next token is %d (%s", yychar
, yytname
[yychar1
]);
698 /* Give the individual parser a way to print the precise meaning
699 of a token, for further debugging info. */
701 YYPRINT (stderr
, yychar
, yylval
);
703 fprintf (stderr
, ")\n");
709 if (yyn
< 0 || yyn
> YYLAST
|| yycheck
[yyn
] != yychar1
)
714 /* yyn is what to do for this token type in this state.
715 Negative => reduce, -yyn is rule number.
716 Positive => shift, yyn is new state.
717 New state is final state => don't bother to shift,
719 0, or most negative number => error. */
734 /* Shift the lookahead token. */
738 fprintf(stderr
, "Shifting token %d (%s), ", yychar
, yytname
[yychar1
]);
741 /* Discard the token being shifted unless it is eof. */
750 /* count tokens shifted since error; after three, turn off error status. */
751 if (yyerrstatus
) yyerrstatus
--;
756 /* Do the default action for the current state. */
759 yyn
= yydefact
[yystate
];
763 /* Do a reduction. yyn is the number of a rule to reduce with. */
767 yyval
= yyvsp
[1-yylen
]; /* implement default value of the action */
774 fprintf (stderr
, "Reducing via rule %d (line %d), ",
777 /* Print the symbols being reduced, and their result. */
778 for (i
= yyprhs
[yyn
]; yyrhs
[i
] > 0; i
++)
779 fprintf (stderr
, "%s ", yytname
[yyrhs
[i
]]);
780 fprintf (stderr
, " -> %s\n", yytname
[yyr1
[yyn
]]);
788 { yyval
.ptr
= new Node(ID_IDENTIFIER
); yyval
.ptr
->value
= strdup(yyvsp
[0].str
); debug("Identifier : %s\n",yyvsp
[0].str
); nodelist
.push_back(yyval
.ptr
); ;
791 { yyval
.ptr
= new Node(ID_IDENTIFIER
); yyval
.ptr
->value
= strdup(yyvsp
[0].str
); debug("Identifier : %s\n",yyvsp
[0].str
); nodelist
.push_back(yyval
.ptr
); ;
794 { yyval
.ptr
= new Node(ID_IDENTIFIER
); yyval
.ptr
->value
= strdup(yyvsp
[0].str
); debug("Identifier : %s\n",yyvsp
[0].str
); nodelist
.push_back(yyval
.ptr
); ;
797 { yyval
.ptr
= new Node(ID_IDENTIFIER
); yyval
.ptr
->value
= strdup(yyvsp
[0].str
); debug("Identifier : %s\n",yyvsp
[0].str
); nodelist
.push_back(yyval
.ptr
); ;
800 { yyval
.ptr
= new Node(ID_IDENTIFIER
); yyval
.ptr
->value
= strdup(yyvsp
[0].str
); debug("Identifier : %s\n",yyvsp
[0].str
); nodelist
.push_back(yyval
.ptr
); ;
803 { yyval
.ptr
= new Node(ID_IDENTIFIER
); yyval
.ptr
->value
= strdup(yyvsp
[0].str
); debug("Identifier : %s\n",yyvsp
[0].str
); nodelist
.push_back(yyval
.ptr
); ;
806 { yyval
.ptr
= new Node(ID_IDENTIFIER
); yyval
.ptr
->value
= strdup(yyvsp
[0].str
); debug("Identifier : %s\n",yyvsp
[0].str
); nodelist
.push_back(yyval
.ptr
); ;
809 { yyval
.ptr
= new Node(ID_CHARACTER
); yyval
.ptr
->value
= strdup(yyvsp
[0].str
); debug("Identifier : %s\n",yyvsp
[0].str
); nodelist
.push_back(yyval
.ptr
); ;
812 { yyval
.ptr
= new Node(ID_OPERATOR
); yyval
.ptr
->value
= strdup(yyvsp
[0].str
); debug("Identifier : %s\n",yyvsp
[0].str
); nodelist
.push_back(yyval
.ptr
); ;
815 { yyval
.ptr
= new Node(ID_OPERATOR
); yyval
.ptr
->value
= strdup(yyvsp
[0].str
); debug("Identifier : %s\n",yyvsp
[0].str
); nodelist
.push_back(yyval
.ptr
); ;
818 { yyval
.ptr
= new Node(ID_IDENTIFIER
); yyval
.ptr
->value
= strdup(yyvsp
[0].str
); debug("Identifier : %s\n",yyvsp
[0].str
); nodelist
.push_back(yyval
.ptr
); ;
821 { yyval
.ptr
= new Node(ID_DELIMETER
); yyval
.ptr
->value
= strdup(yyvsp
[0].str
); debug("Identifier : %s\n",yyvsp
[0].str
); nodelist
.push_back(yyval
.ptr
); ;
824 { yyval
.ptr
= new Node(ID_DELIMETER
); yyval
.ptr
->value
= strdup(yyvsp
[0].str
); debug("Identifier : %s\n",yyvsp
[0].str
); nodelist
.push_back(yyval
.ptr
); ;
827 { yyval
.ptr
= new Node(ID_IDENTIFIER
); yyval
.ptr
->value
= strdup(yyvsp
[0].str
); debug("Identifier : %s\n",yyvsp
[0].str
); nodelist
.push_back(yyval
.ptr
); ;
830 { yyval
.ptr
= new Node(ID_CHARACTER
); yyval
.ptr
->value
= strdup("|"); debug("Identifier : '|'\n"); nodelist
.push_back(yyval
.ptr
); ;
833 { yyval
.ptr
= new Node(ID_NUMBER
); yyval
.ptr
->value
= strdup(yyvsp
[0].dval
); debug("Number : %s\n",yyvsp
[0].dval
); nodelist
.push_back(yyval
.ptr
); ;
836 { yyval
.ptr
= new Node(ID_STRING
); yyval
.ptr
->value
= strdup(yyvsp
[0].str
); debug("String : %s\n",yyvsp
[0].str
); nodelist
.push_back(yyval
.ptr
); ;
839 { yyval
.ptr
= new Node(ID_PRIMARYEXPR
); yyval
.ptr
->child
= yyvsp
[0].ptr
; debug("PrimaryExpr\n"); nodelist
.push_back(yyval
.ptr
); ;
842 { yyval
.ptr
= new Node(ID_PRIMARYEXPR
); yyval
.ptr
->child
= yyvsp
[-1].ptr
; yyval
.ptr
->next
= yyvsp
[0].ptr
; debug("PrimaryExpr : PrimaryExpr Identifier\n"); nodelist
.push_back(yyval
.ptr
); ;
845 { yyval
.ptr
= new Node(ID_LEFT
); yyval
.ptr
->value
= strdup("("); debug("EQLeft \n"); nodelist
.push_back(yyval
.ptr
); ;
848 { yyval
.ptr
= new Node(ID_LEFT
); yyval
.ptr
->value
= strdup("["); debug("EQLeft \n"); nodelist
.push_back(yyval
.ptr
); ;
851 { yyval
.ptr
= new Node(ID_LEFT
); yyval
.ptr
->value
= strdup("{"); debug("EQLeft \n"); nodelist
.push_back(yyval
.ptr
); ;
854 { yyval
.ptr
= new Node(ID_LEFT
); yyval
.ptr
->value
= strdup("<"); debug("EQLeft \n"); nodelist
.push_back(yyval
.ptr
); ;
857 { yyval
.ptr
= new Node(ID_LEFT
); yyval
.ptr
->value
= strdup("|"); debug("EQLeft \n"); nodelist
.push_back(yyval
.ptr
); ;
860 { yyval
.ptr
= new Node(ID_LEFT
); yyval
.ptr
->value
=strdup("||"); debug("EQLeft \n"); nodelist
.push_back(yyval
.ptr
); ;
863 { yyval
.ptr
= new Node(ID_LEFT
); yyval
.ptr
->value
= strdup(yyvsp
[0].str
); debug("EQLeft \n"); nodelist
.push_back(yyval
.ptr
); ;
866 { yyval
.ptr
= new Node(ID_RIGHT
); yyval
.ptr
->value
= strdup(")"); debug("EQRight \n"); nodelist
.push_back(yyval
.ptr
); ;
869 { yyval
.ptr
= new Node(ID_RIGHT
); yyval
.ptr
->value
= strdup("]"); debug("EQRight \n"); nodelist
.push_back(yyval
.ptr
); ;
872 { yyval
.ptr
= new Node(ID_RIGHT
); yyval
.ptr
->value
= strdup("}"); debug("EQRight \n"); nodelist
.push_back(yyval
.ptr
); ;
875 { yyval
.ptr
= new Node(ID_RIGHT
); yyval
.ptr
->value
= strdup(">"); debug("EQRight \n"); nodelist
.push_back(yyval
.ptr
); ;
878 { yyval
.ptr
= new Node(ID_RIGHT
); yyval
.ptr
->value
= strdup("|"); debug("EQRight \n"); nodelist
.push_back(yyval
.ptr
); ;
881 { yyval
.ptr
= new Node(ID_RIGHT
); yyval
.ptr
->value
= strdup("||"); debug("EQRight \n"); nodelist
.push_back(yyval
.ptr
); ;
884 { yyval
.ptr
= new Node(ID_RIGHT
); yyval
.ptr
->value
= strdup(yyvsp
[0].str
); debug("EQRight \n"); nodelist
.push_back(yyval
.ptr
); ;
887 { yyval
.ptr
= new Node(ID_FENCE
); yyval
.ptr
->child
=yyvsp
[-2].ptr
; yyvsp
[-2].ptr
->next
=yyvsp
[-1].ptr
; yyvsp
[-1].ptr
->next
=yyvsp
[0].ptr
; debug("Fence \n"); nodelist
.push_back(yyval
.ptr
); ;
890 { yyval
.ptr
= new Node(ID_PARENTH
); yyval
.ptr
->child
= yyvsp
[-1].ptr
; debug("Parenth: '(' ExprList ')' \n"); nodelist
.push_back(yyval
.ptr
); ;
893 { yyval
.ptr
= new Node(ID_PARENTH
); debug("Parenth: '(' ')' \n"); nodelist
.push_back(yyval
.ptr
); ;
896 { yyval
.ptr
= new Node(ID_BLOCK
); yyval
.ptr
->child
= yyvsp
[-1].ptr
; debug("Block: '{' ExprList '}' \n"); nodelist
.push_back(yyval
.ptr
); ;
899 { yyval
.ptr
= new Node(ID_BLOCK
); debug("Block: '{' '}' \n"); nodelist
.push_back(yyval
.ptr
); ;
902 { yyval
.ptr
= new Node(ID_BRACKET
); yyval
.ptr
->child
= yyvsp
[-1].ptr
; debug("Bracket \n"); nodelist
.push_back(yyval
.ptr
); ;
905 { yyval
.ptr
= new Node(ID_BRACKET
); debug("Bracket \n"); nodelist
.push_back(yyval
.ptr
); ;
908 { yyval
.ptr
= new Node(ID_SUBEXPR
); yyval
.ptr
->child
= yyvsp
[-2].ptr
; yyvsp
[-2].ptr
->next
= yyvsp
[0].ptr
; debug("SubSupExpr : ID_SUBEXPR\n"); nodelist
.push_back(yyval
.ptr
); ;
911 { yyval
.ptr
= new Node(ID_SUPEXPR
); yyval
.ptr
->child
= yyvsp
[-2].ptr
; yyvsp
[-2].ptr
->next
= yyvsp
[0].ptr
; debug("SubSupExpr : ID_SUPEXPR\n"); nodelist
.push_back(yyval
.ptr
); ;
914 { yyval
.ptr
= new Node(ID_SUBSUPEXPR
); yyval
.ptr
->child
=yyvsp
[-4].ptr
; yyvsp
[-4].ptr
->next
=yyvsp
[-2].ptr
; yyvsp
[-2].ptr
->next
=yyvsp
[0].ptr
; debug("SubSupExpr : ID_SUBSUPEXPR\n"); nodelist
.push_back(yyval
.ptr
); ;
917 { yyval
.ptr
= new Node(ID_FRACTIONEXPR
); yyval
.ptr
->child
= yyvsp
[-1].ptr
; yyvsp
[-1].ptr
->next
= yyvsp
[0].ptr
; debug("FractionExpr : %s\n",yyvsp
[-2].str
); nodelist
.push_back(yyval
.ptr
); ;
920 { yyval
.ptr
= new Node(ID_OVER
); yyval
.ptr
->child
= yyvsp
[-3].ptr
; yyvsp
[-3].ptr
->next
= yyvsp
[-1].ptr
; debug("OverExpr\n"); nodelist
.push_back(yyval
.ptr
); ;
923 { yyval
.ptr
= new Node(ID_ACCENTEXPR
); yyval
.ptr
->value
= strdup(yyvsp
[0].str
); debug("Accent : %s\n", yyvsp
[0].str
); nodelist
.push_back(yyval
.ptr
); ;
926 { yyval
.ptr
= new Node(ID_ACCENTEXPR
); yyval
.ptr
->child
=yyvsp
[-1].ptr
; yyvsp
[-1].ptr
->next
= yyvsp
[0].ptr
; debug("AccentExpr \n"); nodelist
.push_back(yyval
.ptr
); ;
929 { yyval
.ptr
= new Node(ID_DECORATIONEXPR
); yyval
.ptr
->value
= strdup(yyvsp
[0].str
); debug("Decoration : %s\n", yyvsp
[0].str
); nodelist
.push_back(yyval
.ptr
); ;
932 { yyval
.ptr
= new Node(ID_DECORATIONEXPR
); yyval
.ptr
->child
= yyvsp
[-1].ptr
; yyvsp
[-1].ptr
->next
= yyvsp
[0].ptr
; debug("DecorationExpr \n"); nodelist
.push_back(yyval
.ptr
); ;
935 { yyval
.ptr
= new Node(ID_SQRTEXPR
); yyval
.ptr
->child
= yyvsp
[0].ptr
; debug("RootExpr : %s\n", yyvsp
[-1].str
); nodelist
.push_back(yyval
.ptr
); ;
938 { yyval
.ptr
= new Node(ID_ROOTEXPR
); yyval
.ptr
->child
= yyvsp
[-1].ptr
; yyvsp
[-1].ptr
->next
= yyvsp
[0].ptr
; debug("RootExpr : %s\n", yyvsp
[-2].str
); nodelist
.push_back(yyval
.ptr
); ;
941 { yyval
.ptr
= new Node(ID_BEGIN
); yyval
.ptr
->child
= yyvsp
[0].ptr
; nodelist
.push_back(yyval
.ptr
); debug("BeginExpr\n"); ;
944 { yyval
.ptr
= new Node(ID_BEGIN
); yyval
.ptr
->child
= yyvsp
[-1].ptr
; yyvsp
[-1].ptr
->next
= yyvsp
[0].ptr
; nodelist
.push_back(yyval
.ptr
); debug("BeginExpr\n"); ;
947 { yyval
.ptr
= new Node(ID_END
); yyval
.ptr
->child
= yyvsp
[0].ptr
; nodelist
.push_back(yyval
.ptr
); debug("EndExpr\n"); ;
950 { yyval
.ptr
= new Node(ID_MATHML
); yyval
.ptr
->child
= yyvsp
[0].ptr
; nodelist
.push_back(yyval
.ptr
); top
= yyval
.ptr
; debug("MathML\n"); ;
953 { yyval
.ptr
= new Node(ID_LINES
); yyval
.ptr
->child
= yyvsp
[0].ptr
; nodelist
.push_back(yyval
.ptr
); debug("Lines\n"); ;
956 { yyval
.ptr
= new Node(ID_LINES
); yyval
.ptr
->child
= yyvsp
[-2].ptr
; yyvsp
[-2].ptr
->next
= yyvsp
[0].ptr
; nodelist
.push_back(yyval
.ptr
); debug("Lines\n"); ;
959 { yyval
.ptr
= new Node(ID_LINE
); yyval
.ptr
->child
= yyvsp
[0].ptr
; nodelist
.push_back(yyval
.ptr
); debug("Line\n"); ;
962 { yyval
.ptr
= new Node(ID_EXPRLIST
); yyval
.ptr
->child
= yyvsp
[0].ptr
; debug("ExprList : Expr\n"); nodelist
.push_back(yyval
.ptr
); ;
965 { yyval
.ptr
= new Node(ID_EXPRLIST
); yyval
.ptr
->child
= yyvsp
[-1].ptr
; yyvsp
[-1].ptr
->next
= yyvsp
[0].ptr
; debug("ExprList : ExprList Expr\n"); nodelist
.push_back(yyval
.ptr
); ;
968 { yyval
.ptr
= new Node(ID_EXPR
); yyval
.ptr
->child
= yyvsp
[0].ptr
; debug("Expr : Block\n"); nodelist
.push_back(yyval
.ptr
);;
971 { yyval
.ptr
= new Node(ID_EXPR
); yyval
.ptr
->child
= yyvsp
[0].ptr
; debug("Expr : Parenth\n"); nodelist
.push_back(yyval
.ptr
);;
974 { yyval
.ptr
= new Node(ID_EXPR
); yyval
.ptr
->child
= yyvsp
[0].ptr
; debug("Expr : Fence\n"); nodelist
.push_back(yyval
.ptr
);;
977 { yyval
.ptr
= new Node(ID_EXPR
); yyval
.ptr
->child
= yyvsp
[0].ptr
; debug("Expr : SubSupExpr\n"); nodelist
.push_back(yyval
.ptr
);;
980 { yyval
.ptr
= new Node(ID_EXPR
); yyval
.ptr
->child
= yyvsp
[0].ptr
; debug("Expr : FractionExpr\n"); nodelist
.push_back(yyval
.ptr
);;
983 { yyval
.ptr
= new Node(ID_EXPR
); yyval
.ptr
->child
= yyvsp
[0].ptr
; debug("Expr : OverExpr\n"); nodelist
.push_back(yyval
.ptr
);;
986 { yyval
.ptr
= new Node(ID_EXPR
); yyval
.ptr
->child
= yyvsp
[0].ptr
; debug("Expr : DecorationExpr\n"); nodelist
.push_back(yyval
.ptr
);;
989 { yyval
.ptr
= new Node(ID_EXPR
); yyval
.ptr
->child
= yyvsp
[0].ptr
; debug("Expr : RootExpr\n"); nodelist
.push_back(yyval
.ptr
);;
992 { yyval
.ptr
= new Node(ID_EXPR
); yyval
.ptr
->child
= yyvsp
[0].ptr
; debug("Expr : AccentExpr\n"); nodelist
.push_back(yyval
.ptr
);;
995 { yyval
.ptr
= new Node(ID_EXPR
); yyval
.ptr
->child
= yyvsp
[0].ptr
; debug("Expr : PrimaryExpr\n"); nodelist
.push_back(yyval
.ptr
);;
998 { yyval
.ptr
= new Node(ID_EXPR
); yyval
.ptr
->child
= yyvsp
[0].ptr
; debug("Expr : BeginExpr\n"); nodelist
.push_back(yyval
.ptr
);;
1001 { yyval
.ptr
= new Node(ID_EXPR
); yyval
.ptr
->child
= yyvsp
[0].ptr
; debug("Expr : EndExpr\n"); nodelist
.push_back(yyval
.ptr
);;
1004 /* the action file gets copied in place of this dollarsign */
1015 short *ssp1
= yyss
- 1;
1016 fprintf (stderr
, "state stack now");
1017 while (ssp1
!= yyssp
)
1018 fprintf (stderr
, " %d", *++ssp1
);
1019 fprintf (stderr
, "\n");
1029 yylsp
->first_line
= yylloc
.first_line
;
1030 yylsp
->first_column
= yylloc
.first_column
;
1031 yylsp
->last_line
= (yylsp
-1)->last_line
;
1032 yylsp
->last_column
= (yylsp
-1)->last_column
;
1037 yylsp
->last_line
= (yylsp
+yylen
-1)->last_line
;
1038 yylsp
->last_column
= (yylsp
+yylen
-1)->last_column
;
1042 /* Now "shift" the result of the reduction.
1043 Determine what state that goes to,
1044 based on the state we popped back to
1045 and the rule number reduced by. */
1049 yystate
= yypgoto
[yyn
- YYNTBASE
] + *yyssp
;
1050 if (yystate
>= 0 && yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
1051 yystate
= yytable
[yystate
];
1053 yystate
= yydefgoto
[yyn
- YYNTBASE
];
1057 yyerrlab
: /* here on detecting error */
1060 /* If not already recovering from an error, report this error. */
1064 #ifdef YYERROR_VERBOSE
1065 yyn
= yypact
[yystate
];
1067 if (yyn
> YYFLAG
&& yyn
< YYLAST
)
1074 /* Start X at -yyn if nec to avoid negative indexes in yycheck. */
1075 for (x
= ((yyn
< 0) ? -yyn
: 0);
1076 x
< (sizeof(yytname
) / sizeof(char *)); x
++)
1077 if (yycheck
[x
+ yyn
] == x
)
1078 size
+= strlen(yytname
[x
]) + 15, count
++;
1079 msg
= (char *) malloc(size
+ 15);
1082 strcpy(msg
, "parse error");
1087 for (x
= ((yyn
< 0) ? -yyn
: 0);
1088 x
< (sizeof(yytname
) / sizeof(char *)); x
++)
1089 if (yycheck
[x
+ yyn
] == x
)
1091 strcat(msg
, count
== 0 ? ", expecting `" : " or `");
1092 strcat(msg
, yytname
[x
]);
1101 yyerror ("parse error; also virtual memory exceeded");
1104 #endif /* YYERROR_VERBOSE */
1105 yyerror("parse error");
1109 yyerrlab1
: /* here on error raised explicitly by an action */
1111 if (yyerrstatus
== 3)
1113 /* if just tried and failed to reuse lookahead token after an error, discard it. */
1115 /* return failure if at end of input */
1116 if (yychar
== YYEOF
)
1121 fprintf(stderr
, "Discarding token %d (%s).\n", yychar
, yytname
[yychar1
]);
1127 /* Else will try to reuse lookahead token
1128 after shifting the error token. */
1130 yyerrstatus
= 3; /* Each real token shifted decrements this */
1134 yyerrdefault
: /* current state does not do anything special for the error token. */
1137 /* This is wrong; only states that explicitly want error tokens
1138 should shift them. */
1139 yyn
= yydefact
[yystate
]; /* If its default is to accept any token, ok. Otherwise pop it.*/
1140 if (yyn
) goto yydefault
;
1143 yyerrpop
: /* pop the current state because it cannot handle the error token */
1145 if (yyssp
== yyss
) YYABORT
;
1155 short *ssp1
= yyss
- 1;
1156 fprintf (stderr
, "Error: state stack now");
1157 while (ssp1
!= yyssp
)
1158 fprintf (stderr
, " %d", *++ssp1
);
1159 fprintf (stderr
, "\n");
1165 yyn
= yypact
[yystate
];
1170 if (yyn
< 0 || yyn
> YYLAST
|| yycheck
[yyn
] != YYTERROR
)
1189 fprintf(stderr
, "Shifting error token, ");
1201 /* YYACCEPT comes here. */
1213 /* YYABORT comes here. */
1226 Node
*mainParse(const char *_code
)
1237 void yyerror(const char * /*err*/)
1239 // printf("REALKING ERR[%s]\n",err);
1240 // if error, delete all nodes.
1242 int ncount
= nodelist
.size();
1243 for( int i
= 0 ; i
< ncount
; i
++){
1244 pNode
= nodelist
.front();
1245 nodelist
.pop_front();
1252 int debug(const char * /*format*/, ...)
1258 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */