/[ascend]/trunk/base/generic/compiler/ascParse.c.no.yacc
ViewVC logotype

Contents of /trunk/base/generic/compiler/ascParse.c.no.yacc

Parent Directory Parent Directory | Revision Log Revision Log


Revision 473 - (show annotations) (download)
Mon Apr 17 04:52:34 2006 UTC (14 years, 2 months ago) by ben.allan
File size: 181554 byte(s)
restored the bypass missing yacc capability.
1 /* A Bison parser, made by GNU Bison 2.0. */
2
3 /* Skeleton parser for Yacc-like parsing with Bison,
4 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
9 any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. */
20
21 /* As a special exception, when this file is copied by Bison into a
22 Bison output file, you may use that output file without restriction.
23 This special exception was added by the Free Software Foundation
24 in version 1.24 of Bison. */
25
26 /* Written by Richard Stallman by simplifying the original so called
27 ``semantic'' parser. */
28
29 /* All symbols defined below should begin with zz_ or ZZ_, to avoid
30 infringing on user name space. This should be done even for local
31 variables, as they might otherwise be expanded by user macros.
32 There are some unavoidable exceptions within include files to
33 define necessary library symbols; they are noted "INFRINGES ON
34 USER NAME SPACE" below. */
35
36 /* Identify Bison output. */
37 #define ZZ_BISON 1
38
39 /* Skeleton name. */
40 #define ZZ_SKELETON_NAME "yacc.c"
41
42 /* Pure parsers. */
43 #define ZZ_PURE 0
44
45 /* Using locations. */
46 #define ZZ_LSP_NEEDED 0
47
48
49
50 /* Tokens. */
51 #ifndef ZZ_TOKENTYPE
52 # define ZZ_TOKENTYPE
53 /* Put the tokens into the symbol table, so that GDB and other debuggers
54 know about them. */
55 enum zz_tokentype {
56 ADD_T = 258,
57 ALIASES_T = 259,
58 AND_T = 260,
59 ANY_T = 261,
60 AREALIKE_T = 262,
61 ARETHESAME_T = 263,
62 ARRAY_T = 264,
63 ASSERT_T = 265,
64 ATOM_T = 266,
65 BEQ_T = 267,
66 BNE_T = 268,
67 BREAK_T = 269,
68 CALL_T = 270,
69 CARD_T = 271,
70 CASE_T = 272,
71 CHOICE_T = 273,
72 CHECK_T = 274,
73 CONDITIONAL_T = 275,
74 CONSTANT_T = 276,
75 CONTINUE_T = 277,
76 CREATE_T = 278,
77 DATA_T = 279,
78 DECREASING_T = 280,
79 DEFAULT_T = 281,
80 DEFINITION_T = 282,
81 DIMENSION_T = 283,
82 DIMENSIONLESS_T = 284,
83 DO_T = 285,
84 ELSE_T = 286,
85 END_T = 287,
86 EXPECT_T = 288,
87 EXTERNAL_T = 289,
88 FALSE_T = 290,
89 FALLTHRU_T = 291,
90 FIX_T = 292,
91 FOR_T = 293,
92 FREE_T = 294,
93 FROM_T = 295,
94 GLOBAL_T = 296,
95 IF_T = 297,
96 IMPORT_T = 298,
97 IN_T = 299,
98 INPUT_T = 300,
99 INCREASING_T = 301,
100 INTERACTIVE_T = 302,
101 INTERSECTION_T = 303,
102 ISA_T = 304,
103 _IS_T = 305,
104 ISREFINEDTO_T = 306,
105 MAXIMIZE_T = 307,
106 MAXINTEGER_T = 308,
107 MAXREAL_T = 309,
108 METHODS_T = 310,
109 METHOD_T = 311,
110 MINIMIZE_T = 312,
111 MODEL_T = 313,
112 NOT_T = 314,
113 NOTES_T = 315,
114 OF_T = 316,
115 OR_T = 317,
116 OTHERWISE_T = 318,
117 OUTPUT_T = 319,
118 PATCH_T = 320,
119 PROD_T = 321,
120 PROVIDE_T = 322,
121 REFINES_T = 323,
122 REPLACE_T = 324,
123 REQUIRE_T = 325,
124 RETURN_T = 326,
125 RUN_T = 327,
126 SATISFIED_T = 328,
127 SELECT_T = 329,
128 SIZE_T = 330,
129 STOP_T = 331,
130 SUCHTHAT_T = 332,
131 SUM_T = 333,
132 SWITCH_T = 334,
133 THEN_T = 335,
134 TRUE_T = 336,
135 UNION_T = 337,
136 UNITS_T = 338,
137 UNIVERSAL_T = 339,
138 WHEN_T = 340,
139 WHERE_T = 341,
140 WHILE_T = 342,
141 WILLBE_T = 343,
142 WILLBETHESAME_T = 344,
143 WILLNOTBETHESAME_T = 345,
144 ASSIGN_T = 346,
145 CASSIGN_T = 347,
146 DBLCOLON_T = 348,
147 USE_T = 349,
148 LEQ_T = 350,
149 GEQ_T = 351,
150 NEQ_T = 352,
151 DOTDOT_T = 353,
152 WITH_T = 354,
153 VALUE_T = 355,
154 WITH_VALUE_T = 356,
155 REAL_T = 357,
156 INTEGER_T = 358,
157 IDENTIFIER_T = 359,
158 BRACEDTEXT_T = 360,
159 SYMBOL_T = 361,
160 DQUOTE_T = 362,
161 UPLUS_T = 363,
162 UMINUS_T = 364
163 };
164 #endif
165 #define ADD_T 258
166 #define ALIASES_T 259
167 #define AND_T 260
168 #define ANY_T 261
169 #define AREALIKE_T 262
170 #define ARETHESAME_T 263
171 #define ARRAY_T 264
172 #define ASSERT_T 265
173 #define ATOM_T 266
174 #define BEQ_T 267
175 #define BNE_T 268
176 #define BREAK_T 269
177 #define CALL_T 270
178 #define CARD_T 271
179 #define CASE_T 272
180 #define CHOICE_T 273
181 #define CHECK_T 274
182 #define CONDITIONAL_T 275
183 #define CONSTANT_T 276
184 #define CONTINUE_T 277
185 #define CREATE_T 278
186 #define DATA_T 279
187 #define DECREASING_T 280
188 #define DEFAULT_T 281
189 #define DEFINITION_T 282
190 #define DIMENSION_T 283
191 #define DIMENSIONLESS_T 284
192 #define DO_T 285
193 #define ELSE_T 286
194 #define END_T 287
195 #define EXPECT_T 288
196 #define EXTERNAL_T 289
197 #define FALSE_T 290
198 #define FALLTHRU_T 291
199 #define FIX_T 292
200 #define FOR_T 293
201 #define FREE_T 294
202 #define FROM_T 295
203 #define GLOBAL_T 296
204 #define IF_T 297
205 #define IMPORT_T 298
206 #define IN_T 299
207 #define INPUT_T 300
208 #define INCREASING_T 301
209 #define INTERACTIVE_T 302
210 #define INTERSECTION_T 303
211 #define ISA_T 304
212 #define _IS_T 305
213 #define ISREFINEDTO_T 306
214 #define MAXIMIZE_T 307
215 #define MAXINTEGER_T 308
216 #define MAXREAL_T 309
217 #define METHODS_T 310
218 #define METHOD_T 311
219 #define MINIMIZE_T 312
220 #define MODEL_T 313
221 #define NOT_T 314
222 #define NOTES_T 315
223 #define OF_T 316
224 #define OR_T 317
225 #define OTHERWISE_T 318
226 #define OUTPUT_T 319
227 #define PATCH_T 320
228 #define PROD_T 321
229 #define PROVIDE_T 322
230 #define REFINES_T 323
231 #define REPLACE_T 324
232 #define REQUIRE_T 325
233 #define RETURN_T 326
234 #define RUN_T 327
235 #define SATISFIED_T 328
236 #define SELECT_T 329
237 #define SIZE_T 330
238 #define STOP_T 331
239 #define SUCHTHAT_T 332
240 #define SUM_T 333
241 #define SWITCH_T 334
242 #define THEN_T 335
243 #define TRUE_T 336
244 #define UNION_T 337
245 #define UNITS_T 338
246 #define UNIVERSAL_T 339
247 #define WHEN_T 340
248 #define WHERE_T 341
249 #define WHILE_T 342
250 #define WILLBE_T 343
251 #define WILLBETHESAME_T 344
252 #define WILLNOTBETHESAME_T 345
253 #define ASSIGN_T 346
254 #define CASSIGN_T 347
255 #define DBLCOLON_T 348
256 #define USE_T 349
257 #define LEQ_T 350
258 #define GEQ_T 351
259 #define NEQ_T 352
260 #define DOTDOT_T 353
261 #define WITH_T 354
262 #define VALUE_T 355
263 #define WITH_VALUE_T 356
264 #define REAL_T 357
265 #define INTEGER_T 358
266 #define IDENTIFIER_T 359
267 #define BRACEDTEXT_T 360
268 #define SYMBOL_T 361
269 #define DQUOTE_T 362
270 #define UPLUS_T 363
271 #define UMINUS_T 364
272
273
274
275
276 /* Copy the first part of user declarations. */
277 #line 1 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y"
278
279 /*
280 * Ascend Grammar file
281 * by Tom Epperly
282 * Version: $Revision: 1.23 $
283 * Version control file: $RCSfile: ascParse.y,v $
284 * Date last modified: $Date: 2000/01/25 02:25:59 $
285 * Last modified by: $Author: ballan $
286 *
287 * This file is part of the Ascend Language Interpreter.
288 *
289 * Copyright (C) 1990, 1993, 1994 Thomas Guthrie Epperly
290 * Copyright (C) 1997 Benjamin Andrew Allan & Vicente Rico-Ramirez
291 * Copyright (C) 1998 Carnegie Mellon University
292 *
293 * The Ascend Language Interpreter is free software; you can redistribute
294 * it and/or modify it under the terms of the GNU General Public License as
295 * published by the Free Software Foundation; either version 2 of the
296 * License, or (at your option) any later version.
297 *
298 * The Ascend Language Interpreter is distributed in hope that it will be
299 * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
300 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
301 * General Public License for more details.
302 *
303 * You should have received a copy of the GNU General Public License
304 * along with the program; if not, write to the Free Software Foundation,
305 * Inc., 675 Mass Ave, Cambridge, MA 02139 USA. Check the file named
306 * COPYING.
307 *
308 */
309 #include <stdio.h>
310 #include <stdarg.h>
311 #include <limits.h> /* need DBL_MAX and LONG_MAX */
312 #include <float.h> /* on a NeXT they are in here */
313
314 #include "utilities/ascConfig.h"
315 #include "utilities/ascMalloc.h"
316 #include "general/list.h"
317 #include "general/dstring.h"
318 #include "compiler/compiler.h"
319 #include "compiler/scanner.h"
320 #include "compiler/symtab.h" /* the global string/symbol table */
321 #include "compiler/notate.h" /* notes database wrapper */
322 #include "compiler/braced.h"
323 #include "compiler/fractions.h"
324 #include "compiler/dimen.h"
325 #include "compiler/functype.h"
326 #include "compiler/func.h"
327 #include "compiler/types.h"
328 #include "compiler/name.h"
329 #include "compiler/nameio.h"
330 #include "compiler/instance_enum.h"
331 #include "compiler/extfunc.h"
332 #include "compiler/packages.h"
333 #include "compiler/sets.h"
334 #include "compiler/exprs.h"
335 #include "compiler/exprio.h"
336 #include "compiler/vlist.h"
337 #include "compiler/vlistio.h" /* for debugging only */
338 #include "compiler/stattypes.h"
339 #include "compiler/slist.h"
340 #include "compiler/statement.h"
341 #include "compiler/statio.h"
342 #include "compiler/units.h"
343 #include "compiler/when.h"
344 #include "compiler/select.h"
345 #include "compiler/switch.h"
346 #include "compiler/proc.h"
347 #include "compiler/watchpt.h"
348 #include "compiler/module.h"
349 #include "compiler/child.h"
350 #include "compiler/type_desc.h"
351 #include "compiler/type_descio.h"
352 #include "compiler/typedef.h"
353 #include "compiler/library.h"
354 #include "compiler/syntax.h"
355 #include "compiler/lexer.h"
356 /* 1 ==> expr can find missing , w/o shift/reduce conflicts */
357 #define COMMAEXPR_NOTBUGGY 0
358 #if COMMAEXPR_NOTBUGGY
359 #include "compiler/exprio.h"
360 #endif /* for CommaExpr if working. */
361
362 #ifndef lint
363 static CONST char ParserID[] = "$Id: ascParse.y,v 1.23 2000/01/25 02:25:59 ballan Exp $";
364 #endif
365
366 int g_compiler_warnings = 1; /* level of whine to allow */
367
368 #include "compiler/redirectFile.h"
369 #ifndef ASCERR
370 #define ASCERR g_ascend_errors
371 #define ASCWAR g_ascend_warnings
372 #define ASCINF g_ascend_information
373 #endif
374
375 extern int zz_error(char *);
376 /* provided at the end of this file.
377 * it increments g_untrapped_error, the global defined below
378 */
379
380 static unsigned long g_header_linenum = 0;
381 static unsigned int g_untrapped_error = 0;
382 /* if g_untrapped_error is set to 1, the current definition
383 * should be abandoned even if nothing else detectable by
384 * typedef.c exists. basically any syntax error should cause a type
385 * to be abandoned, but not all cause the parser to barf.
386 */
387
388 /* the last seen method name while processing a method */
389 static symchar *g_proc_name=NULL;
390
391 /* the last seen ATOM/MODEL/constant type and refinement base */
392 static symchar *g_type_name=NULL;
393 static symchar *g_refines_name=NULL;
394 /*********************************************************************\
395 * g_type_name is used by the scanner when closing a module to check if
396 * the parser is in the middle of parsing a MODEL or ATOM type
397 * definition.
398 * g_type_name == NULL implies that the parser is in between
399 * definitions. This depends on proper
400 * resets to NULL at END of type productions.
401 * g_type_name != NULL implies that the parser is in the middle
402 * of a type definition and gives the name
403 * of that type.
404 \*********************************************************************/
405
406 static symchar *g_end_identifier = NULL;
407 /* This variable gets reset every time we see an ``END_T''. If the
408 * token after END_T is missing (i.e., ``END;'') or if it is recognized
409 * (e.g., FOR_T), set this variable to NULL. When we see an
410 * ``END_T IDENTIFIER_T'', set this variable to the pointer into the
411 * symbol table returned by the scanner.
412 */
413
414 static struct StatementList *g_model_parameters=NULL;
415 /* this is the statementlist of the parameterized type
416 */
417
418 static struct StatementList *g_parameter_wheres=NULL;
419 /* this is the where list of a parameterized type. restrictions on args
420 */
421
422 static struct StatementList *g_parameter_reduction=NULL;
423 /* this is the statementlist of the REFINES clause
424 * at present both might be null, which is bad.
425 */
426
427 static struct Set *g_typeargs=NULL;
428 /* optional args to a typename in part declaration.
429 * it is set in the production type_identifier. in
430 * contexts where args are not allowed, use IDENTIFIER_T instead of the
431 * type_identifier production.
432 */
433
434 static struct Set *g_callargs=NULL;
435 /* optional args to a user defined method.
436 * it is set in the production call_identifier. in
437 * contexts where args are not allowed, use IDENTIFIER_T instead of the
438 * type_identifier production.
439 */
440
441 static struct gl_list_t *g_notelist = NULL;
442 /*
443 * Notes accumulator until a type commits or destroys it.
444 */
445
446 static int g_defaulted; /* used for atoms,constants */
447
448 static CONST dim_type *g_dim_ptr; /* dim of last units parsed, or so */
449 static CONST dim_type *g_atom_dim_ptr; /* dim of DIMENSION decl */
450 static CONST dim_type *g_default_dim_ptr; /* dim of default value parsed */
451
452 static double g_default_double;
453 static long g_default_long;
454 symchar *g_default_symbol;
455 #define DOUBLECONSTANT 0
456 #define LONGCONSTANT 1
457 #define BOOLEANCONSTANT 2
458 #define SYMBOLCONSTANT 3
459 static int g_constant_type = DOUBLECONSTANT;
460 static CONST struct Units *g_units_ptr;
461
462 int g_parse_relns = 1;
463 /* Should we parse relations?
464 * 0 indicates don't parse relations
465 * 1 indicates process them
466 */
467
468 /* Forward declaration of error message reporting
469 * functions provided at the end of this file.
470 */
471 static void ErrMsg_Generic(CONST char *);
472 static void ErrMsg_CommaName(CONST char *, struct Name *);
473 #if COMMAEXPR_NOTBUGGY
474 static void ErrMsg_CommaExpr(CONST char *, struct Expr *);
475 #endif /* COMMAEXPR_NOTBUGGY */
476 static void ErrMsg_NullDefPointer(CONST char *);
477 static void ErrMsg_ProcTypeMissing(CONST char *, CONST char *);
478 static void ErrMsg_ProcsRejected(CONST char *, CONST char *);
479 static void ErrMsg_DuplicateProc(struct InitProcedure *);
480 static void ErrMsg_ParensBrackets(CONST char *);
481 static void WarnMsg_MismatchEnd(CONST char *, CONST char *,
482 unsigned long, CONST char *);
483 static CONST char *TokenAsString(unsigned long);
484
485 static void error_reporter_current_line(const error_severity_t sev, const char *fmt,...);
486
487 /** @page ascend-notes About 'NOTES' in ASCEND
488 *
489 * The parser will now parse a NOTES block as well as in-lined NOTES. As
490 * a matter of fact, the parser would probably parse FORTRAN now since it
491 * is very lenient. For the in-lined NOTES, I accept any "doubly-quoted"
492 * string after an `fname'. I am currently dropping the NOTE on the
493 * floor. Ideally, we should only accept an inline NOTE when we are
494 * creating a new thing, like in an IS_A statement or a labeled relation.
495 * That means either adding the optional_note to fname and whining at the
496 * user when he/she uses the in-lined notes incorrectly, or coming up
497 * with a fvarnotelist and fnamenote that accepts fnames and
498 * optional_notes in a list or a stand-alone form.
499 *
500 * For the block NOTES statement, the symtax is
501 *
502 * NOTES ( SYMBOL_T ( fvarlist BRACEDTEXT_T )+ )+ END NOTES ';'
503 *
504 * Here I am using () as part of the meta-language to describe the syntax
505 * to you, they are not part of the formal grammer. An example is
506 *
507 * NOTES
508 * 'text' a,b,c { Here is some text }
509 * d { Here is more text }
510 * 'html' SELF { <bold>html sucks</bold> }
511 * END NOTES;
512 *
513 * Note that the only punctuation is the `,' between the members of the
514 * fvarlist and the closing `;'. Right now, the term `SELF' would be
515 * eaten in the fvarlist production. I'm not sure if this is what we
516 * should do (which requires having the notes processing do something
517 * special when it sees SELF in the fvarlist), or if we should create
518 * a SELF_T token. The latter is certainly easier to implement from
519 * the parser's perspective, which is why I did it that way.
520 *
521 * The block NOTES statement doesn't do anything with its stuff either,
522 * the symbols and {bracedText} get dropped on the floor and I destroy
523 * the fvarlist, but that all that happens.
524 *
525 * The `notes_body' and `noteslist' productions return `notes_ptr', which
526 * right now is a `void*' until we can decide what type of data structure
527 * we want to handle NOTES.
528 *
529 * As an amusing side note, the parser will currently eat the following:
530 *
531 * NOTES
532 * 'fun' name "put some text here" {put more text here}
533 * END NOTES;
534 *
535 * Like I said, this is so the parser will eat them; it's not being real
536 * smart about what it does with them.
537 *
538 * For debugging the NOTES stuff, set the DEBUG_NOTES macro to the
539 * following:
540 *
541 * #define DEBUG_NOTES(s) FPRINTF(stderr,"****DISCARDED NOTES:\n%s****\n",(s))
542 *
543 * To completely ignore the NOTES, set DEBUG_NOTES to the following:
544 *
545 * #define DEBUG_NOTES(s) 0
546 *
547 * Note that if you do the latter, you'll get `statement with no effect'
548 * warnings from gcc -Wall.
549 *
550 * -- Mark Thomas Thursday, 13 March 1997
551 */
552 #define DEBUG_NOTES(s) 0
553
554 /*
555 * Because the ascend types and notes are not tightly bound to each other,
556 * what with notes being stored in a database,
557 * We collect notes locally until the type associated with a batch of notes
558 * is approved by typedef and other error checks. Then we process the
559 * collected notes, commiting them to the database.
560 *
561 * NOTES made via ADD NOTES do not require a type check first and the
562 * type may not even exist yet in the library.
563 *
564 * ProcessNotes(keep); Clear up collected list, commit them if keep != 0.
565 * CollectNote(note); Add a note to the collected list.
566 */
567 static void ProcessNotes(int);
568 static void CollectNote(struct Note *);
569
570 /* For 'inline' notes, note on DQUOTE_T from scanner.l:
571 * Remember that DQUOTE_T is a string value which is local to the
572 * production that finds it. It must be copied if you want to
573 * keep it.
574 */
575
576
577 /* Enabling traces. */
578 #ifndef ZZ_DEBUG
579 # define ZZ_DEBUG 0
580 #endif
581
582 /* Enabling verbose error messages. */
583 #ifdef ZZ_ERROR_VERBOSE
584 # undef ZZ_ERROR_VERBOSE
585 # define ZZ_ERROR_VERBOSE 1
586 #else
587 # define ZZ_ERROR_VERBOSE 0
588 #endif
589
590 #if ! defined (ZZ_STYPE) && ! defined (ZZ_STYPE_IS_DECLARED)
591 #line 300 "/tmp/trunk/base/autotools/../generic/compiler/ascParse.y"
592 typedef union ZZ_STYPE {
593 double real_value;
594 long int_value;
595 struct fraction frac_value;
596 symchar *id_ptr;
597 CONST char *braced_ptr; /* pointer for units, explanations, tables */
598 symchar *sym_ptr; /* pointer for symbols */
599 CONST char *dquote_ptr; /* for text in "double quotes" */
600 struct Name *nptr;
601 struct Expr *eptr;
602 struct Set *sptr;
603 struct VariableList *lptr;
604 struct Statement *statptr;
605 struct StatementList *slptr;
606 struct SelectList *septr;
607 struct SwitchList *swptr;
608 struct WhenList *wptr;
609 struct NoteTmp *notesptr; /* change this once struct Notes is defined */
610 struct gl_list_t *listp;
611 struct InitProcedure *procptr;
612 CONST dim_type *dimp;
613 struct TypeDescription *tptr;
614 struct UnitDefinition *udefptr;
615 dim_type dimen;
616 enum ForOrder order;
617 enum ForKind fkind;
618 } ZZ_STYPE;
619 /* Line 190 of yacc.c. */
620 #line 621 "y.tab.c"
621 # define zz_stype ZZ_STYPE /* obsolescent; will be withdrawn */
622 # define ZZ_STYPE_IS_DECLARED 1
623 # define ZZ_STYPE_IS_TRIVIAL 1
624 #endif
625
626
627
628 /* Copy the second part of user declarations. */
629
630
631 /* Line 213 of yacc.c. */
632 #line 633 "y.tab.c"
633
634 #if ! defined (zz_overflow) || ZZ_ERROR_VERBOSE
635
636 # ifndef ZZ_FREE
637 # define ZZ_FREE free
638 # endif
639 # ifndef ZZ_MALLOC
640 # define ZZ_MALLOC malloc
641 # endif
642
643 /* The parser invokes alloca or malloc; define the necessary symbols. */
644
645 # ifdef ZZ_STACK_USE_ALLOCA
646 # if ZZ_STACK_USE_ALLOCA
647 # ifdef __GNUC__
648 # define ZZ_STACK_ALLOC __builtin_alloca
649 # else
650 # define ZZ_STACK_ALLOC alloca
651 # endif
652 # endif
653 # endif
654
655 # ifdef ZZ_STACK_ALLOC
656 /* Pacify GCC's `empty if-body' warning. */
657 # define ZZ_STACK_FREE(Ptr) do { /* empty */; } while (0)
658 # else
659 # if defined (__STDC__) || defined (__cplusplus)
660 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
661 # define ZZ_SIZE_T size_t
662 # endif
663 # define ZZ_STACK_ALLOC ZZ_MALLOC
664 # define ZZ_STACK_FREE ZZ_FREE
665 # endif
666 #endif /* ! defined (zz_overflow) || ZZ_ERROR_VERBOSE */
667
668
669 #if (! defined (zz_overflow) \
670 && (! defined (__cplusplus) \
671 || (defined (ZZ_STYPE_IS_TRIVIAL) && ZZ_STYPE_IS_TRIVIAL)))
672
673 /* A type that is properly aligned for any stack member. */
674 union zz_alloc
675 {
676 short int zz_ss;
677 ZZ_STYPE zz_vs;
678 };
679
680 /* The size of the maximum gap between one aligned stack and the next. */
681 # define ZZ_STACK_GAP_MAXIMUM (sizeof (union zz_alloc) - 1)
682
683 /* The size of an array large to enough to hold all stacks, each with
684 N elements. */
685 # define ZZ_STACK_BYTES(N) \
686 ((N) * (sizeof (short int) + sizeof (ZZ_STYPE)) \
687 + ZZ_STACK_GAP_MAXIMUM)
688
689 /* Copy COUNT objects from FROM to TO. The source and destination do
690 not overlap. */
691 # ifndef ZZ_COPY
692 # if defined (__GNUC__) && 1 < __GNUC__
693 # define ZZ_COPY(To, From, Count) \
694 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
695 # else
696 # define ZZ_COPY(To, From, Count) \
697 do \
698 { \
699 register ZZ_SIZE_T zz_i; \
700 for (zz_i = 0; zz_i < (Count); zz_i++) \
701 (To)[zz_i] = (From)[zz_i]; \
702 } \
703 while (0)
704 # endif
705 # endif
706
707 /* Relocate STACK from its old location to the new one. The
708 local variables ZZ_SIZE and ZZ_STACKSIZE give the old and new number of
709 elements in the stack, and ZZ_PTR gives the new location of the
710 stack. Advance ZZ_PTR to a properly aligned location for the next
711 stack. */
712 # define ZZ_STACK_RELOCATE(Stack) \
713 do \
714 { \
715 ZZ_SIZE_T zz_newbytes; \
716 ZZ_COPY (&zz_ptr->Stack, Stack, zz_size); \
717 Stack = &zz_ptr->Stack; \
718 zz_newbytes = zz_stacksize * sizeof (*Stack) + ZZ_STACK_GAP_MAXIMUM; \
719 zz_ptr += zz_newbytes / sizeof (*zz_ptr); \
720 } \
721 while (0)
722
723 #endif
724
725 #if defined (__STDC__) || defined (__cplusplus)
726 typedef signed char zz_signed_char;
727 #else
728 typedef short int zz_signed_char;
729 #endif
730
731 /* ZZ_FINAL -- State number of the termination state. */
732 #define ZZ_FINAL 2
733 /* ZZ_LAST -- Last index in ZZ_TABLE. */
734 #define ZZ_LAST 1180
735
736 /* ZZ_NTOKENS -- Number of terminals. */
737 #define ZZ_NTOKENS 127
738 /* ZZ_NNTS -- Number of nonterminals. */
739 #define ZZ_NNTS 116
740 /* ZZ_NRULES -- Number of rules. */
741 #define ZZ_NRULES 307
742 /* ZZ_NRULES -- Number of states. */
743 #define ZZ_NSTATES 615
744
745 /* ZZ_TRANSLATE(ZZ_LEX) -- Bison symbol number corresponding to ZZ_LEX. */
746 #define ZZ_UNDEFTOK 2
747 #define ZZ_MAXUTOK 364
748
749 #define ZZ_TRANSLATE(ZZ_X) \
750 ((unsigned int) (ZZ_X) <= ZZ_MAXUTOK ? zz_translate[ZZ_X] : ZZ_UNDEFTOK)
751
752 /* ZZ_TRANSLATE[ZZ_LEX] -- Bison symbol number corresponding to ZZ_LEX. */
753 static const unsigned char zz_translate[] =
754 {
755 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
756 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
757 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
758 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
759 121, 122, 116, 113, 108, 114, 124, 115, 2, 2,
760 2, 2, 2, 2, 2, 2, 2, 2, 123, 120,
761 110, 111, 112, 2, 2, 2, 2, 2, 2, 2,
762 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
763 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
764 2, 125, 2, 126, 119, 2, 2, 2, 2, 2,
765 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
766 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
767 2, 2, 2, 2, 109, 2, 2, 2, 2, 2,
768 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
769 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
770 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
771 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
772 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
773 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
774 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
775 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
776 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
777 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
778 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
779 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
780 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
781 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
782 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
783 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
784 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
785 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
786 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
787 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
788 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
789 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
790 95, 96, 97, 98, 99, 100, 101, 102, 103, 104,
791 105, 106, 107, 117, 118
792 };
793
794 #if ZZ_DEBUG
795 /* ZZ_PRHS[ZZ_N] -- Index of the first RHS symbol of rule number ZZ_N in
796 ZZ_RHS. */
797 static const unsigned short int zz_prhs[] =
798 {
799 0, 0, 3, 4, 7, 9, 11, 13, 15, 17,
800 19, 21, 23, 25, 27, 29, 31, 33, 35, 41,
801 45, 49, 52, 56, 60, 63, 69, 73, 78, 85,
802 90, 96, 103, 108, 114, 121, 128, 135, 138, 139,
803 143, 146, 149, 152, 155, 164, 165, 169, 172, 175,
804 178, 185, 190, 198, 201, 202, 206, 207, 212, 213,
805 217, 223, 229, 230, 232, 238, 241, 244, 248, 249,
806 252, 257, 258, 259, 263, 265, 266, 269, 275, 278,
807 280, 281, 285, 289, 291, 293, 295, 297, 299, 301,
808 303, 305, 307, 309, 311, 313, 315, 317, 319, 321,
809 323, 325, 327, 329, 331, 333, 335, 337, 339, 341,
810 343, 345, 347, 349, 355, 361, 365, 378, 379, 384,
811 389, 393, 395, 400, 402, 407, 408, 411, 412, 415,
812 416, 419, 422, 425, 428, 431, 435, 439, 441, 445,
813 447, 450, 453, 463, 467, 471, 472, 477, 487, 488,
814 491, 500, 501, 503, 505, 507, 509, 511, 513, 516,
815 521, 524, 527, 533, 536, 539, 546, 552, 553, 556,
816 561, 568, 575, 584, 586, 591, 595, 601, 606, 608,
817 610, 612, 614, 617, 620, 625, 632, 634, 639, 643,
818 649, 654, 659, 666, 668, 673, 677, 683, 688, 692,
819 696, 699, 703, 706, 710, 712, 714, 718, 721, 724,
820 726, 730, 735, 738, 741, 744, 747, 750, 753, 756,
821 759, 762, 765, 768, 771, 774, 776, 777, 779, 780,
822 782, 784, 785, 787, 791, 795, 801, 803, 805, 808,
823 811, 812, 814, 817, 819, 820, 822, 824, 826, 828,
824 832, 836, 840, 844, 847, 849, 855, 856, 858, 860,
825 862, 864, 866, 868, 870, 872, 874, 876, 878, 882,
826 886, 890, 894, 898, 902, 906, 910, 913, 917, 921,
827 925, 929, 933, 936, 939, 946, 951, 956, 961, 966,
828 971, 976, 981, 986, 991, 996, 1001, 1006, 1011, 1016,
829 1020, 1022, 1024, 1026, 1028, 1030, 1032, 1034
830 };
831
832 /* ZZ_RHS -- A `-1'-separated list of the rules' RHS. */
833 static const short int zz_rhs[] =
834 {
835 128, 0, -1, -1, 128, 129, -1, 131, -1, 132,
836 -1, 133, -1, 136, -1, 138, -1, 134, -1, 144,
837 -1, 140, -1, 147, -1, 156, -1, 153, -1, 158,
838 -1, 130, -1, 1, -1, 41, 120, 168, 226, 120,
839 -1, 70, 107, 120, -1, 70, 225, 120, -1, 70,
840 225, -1, 67, 107, 120, -1, 67, 225, 120, -1,
841 67, 225, -1, 43, 104, 40, 107, 120, -1, 43,
842 104, 120, -1, 135, 220, 226, 120, -1, 3, 60,
843 44, 104, 179, 120, -1, 137, 164, 226, 120, -1,
844 3, 55, 44, 104, 120, -1, 3, 55, 44, 27,
845 58, 120, -1, 139, 164, 226, 120, -1, 69, 55,
846 44, 104, 120, -1, 69, 55, 44, 27, 58, 120,
847 -1, 155, 141, 168, 162, 226, 120, -1, 142, 68,
848 104, 234, 143, 120, -1, 11, 104, -1, -1, 26,
849 239, 231, -1, 26, 35, -1, 26, 81, -1, 26,
850 106, -1, 155, 145, -1, 21, 104, 68, 104, 234,
851 146, 228, 120, -1, -1, 92, 239, 231, -1, 92,
852 81, -1, 92, 35, -1, 92, 106, -1, 155, 148,
853 168, 162, 226, 120, -1, 149, 150, 151, 120, -1,
854 149, 150, 151, 68, 104, 152, 120, -1, 58, 104,
855 -1, -1, 121, 168, 122, -1, -1, 86, 121, 168,
856 122, -1, -1, 121, 168, 122, -1, 154, 168, 162,
857 226, 120, -1, 65, 104, 38, 104, 120, -1, -1,
858 84, -1, 157, 168, 162, 226, 120, -1, 27, 104,
859 -1, 159, 120, -1, 83, 160, 226, -1, -1, 160,
860 161, -1, 104, 111, 105, 120, -1, -1, -1, 55,
861 163, 164, -1, 165, -1, -1, 165, 166, -1, 167,
862 120, 168, 226, 120, -1, 56, 104, -1, 169, -1,
863 -1, 169, 170, 120, -1, 169, 1, 120, -1, 171,
864 -1, 172, -1, 173, -1, 175, -1, 176, -1, 182,
865 -1, 183, -1, 184, -1, 185, -1, 186, -1, 187,
866 -1, 193, -1, 189, -1, 202, -1, 201, -1, 195,
867 -1, 198, -1, 199, -1, 200, -1, 203, -1, 204,
868 -1, 205, -1, 207, -1, 211, -1, 210, -1, 212,
869 -1, 215, -1, 218, -1, 219, -1, 159, -1, 222,
870 49, 178, 180, 181, -1, 222, 88, 178, 180, 181,
871 -1, 222, 4, 224, -1, 222, 4, 121, 222, 122,
872 86, 222, 49, 104, 61, 104, 174, -1, -1, 101,
873 121, 229, 122, -1, 222, 50, 104, 180, -1, 222,
874 51, 178, -1, 104, -1, 104, 121, 229, 122, -1,
875 104, -1, 104, 121, 229, 122, -1, -1, 56, 104,
876 -1, -1, 61, 104, -1, -1, 101, 240, -1, 222,
877 7, -1, 222, 8, -1, 222, 89, -1, 222, 90,
878 -1, 224, 91, 240, -1, 224, 92, 240, -1, 188,
879 -1, 224, 123, 188, -1, 240, -1, 57, 240, -1,
880 52, 240, -1, 224, 123, 104, 121, 190, 120, 191,
881 192, 122, -1, 222, 123, 45, -1, 222, 123, 64,
882 -1, -1, 120, 224, 123, 24, -1, 224, 123, 104,
883 121, 222, 120, 103, 122, 194, -1, -1, 44, 224,
884 -1, 38, 104, 44, 240, 196, 197, 168, 226, -1,
885 -1, 46, -1, 25, -1, 23, -1, 33, -1, 19,
886 -1, 30, -1, 72, 224, -1, 72, 224, 93, 224,
887 -1, 37, 222, -1, 39, 222, -1, 34, 104, 121,
888 222, 122, -1, 15, 177, -1, 10, 240, -1, 42,
889 240, 80, 168, 206, 226, -1, 87, 240, 30, 168,
890 226, -1, -1, 31, 168, -1, 85, 222, 208, 226,
891 -1, 224, 123, 85, 222, 208, 226, -1, 85, 121,
892 222, 122, 208, 226, -1, 224, 123, 85, 121, 222,
893 122, 208, 226, -1, 209, -1, 17, 229, 123, 168,
894 -1, 63, 123, 168, -1, 209, 17, 229, 123, 168,
895 -1, 209, 63, 123, 168, -1, 14, -1, 22, -1,
896 36, -1, 71, -1, 76, 227, -1, 94, 224, -1,
897 74, 222, 213, 226, -1, 74, 121, 222, 122, 213,
898 226, -1, 214, -1, 17, 229, 123, 168, -1, 63,
899 123, 168, -1, 214, 17, 229, 123, 168, -1, 214,
900 63, 123, 168, -1, 79, 222, 216, 226, -1, 79,
901 121, 222, 122, 216, 226, -1, 217, -1, 17, 229,
902 123, 168, -1, 63, 123, 168, -1, 217, 17, 229,
903 123, 168, -1, 217, 63, 123, 168, -1, 20, 168,
904 226, -1, 60, 220, 226, -1, 106, 221, -1, 220,
905 106, 221, -1, 222, 105, -1, 221, 222, 105, -1,
906 223, -1, 224, -1, 223, 108, 224, -1, 223, 224,
907 -1, 225, 228, -1, 104, -1, 225, 124, 104, -1,
908 225, 125, 229, 126, -1, 32, 20, -1, 32, 38,
909 -1, 32, 42, -1, 32, 47, -1, 32, 55, -1,
910 32, 60, -1, 32, 74, -1, 32, 79, -1, 32,
911 83, -1, 32, 41, -1, 32, 85, -1, 32, 87,
912 -1, 32, 104, -1, 32, -1, -1, 105, -1, -1,
913 107, -1, 230, -1, -1, 240, -1, 240, 98, 240,
914 -1, 230, 108, 240, -1, 230, 108, 240, 98, 240,
915 -1, 103, -1, 232, -1, 102, 233, -1, 103, 105,
916 -1, -1, 105, -1, 28, 235, -1, 29, -1, -1,
917 116, -1, 236, -1, 104, -1, 103, -1, 236, 115,
918 236, -1, 236, 116, 236, -1, 236, 119, 237, -1,
919 121, 236, 122, -1, 239, 238, -1, 103, -1, 121,
920 103, 115, 103, 122, -1, -1, 113, -1, 114, -1,
921 103, -1, 53, -1, 232, -1, 54, -1, 81, -1,
922 35, -1, 6, -1, 106, -1, 224, -1, 125, 229,
923 126, -1, 240, 113, 240, -1, 240, 114, 240, -1,
924 240, 116, 240, -1, 240, 115, 240, -1, 240, 119,
925 240, -1, 240, 5, 240, -1, 240, 62, 240, -1,
926 59, 240, -1, 240, 241, 240, -1, 240, 242, 240,
927 -1, 240, 44, 240, -1, 240, 109, 240, -1, 240,
928 77, 240, -1, 113, 240, -1, 114, 240, -1, 73,
929 121, 224, 108, 232, 122, -1, 73, 121, 224, 122,
930 -1, 78, 121, 229, 122, -1, 78, 125, 229, 126,
931 -1, 66, 121, 229, 122, -1, 66, 125, 229, 126,
932 -1, 82, 121, 229, 122, -1, 82, 125, 229, 126,
933 -1, 48, 121, 229, 122, -1, 48, 125, 229, 126,
934 -1, 16, 121, 229, 122, -1, 16, 125, 229, 126,
935 -1, 18, 121, 229, 122, -1, 18, 125, 229, 126,
936 -1, 104, 121, 240, 122, -1, 121, 240, 122, -1,
937 111, -1, 110, -1, 112, -1, 95, -1, 96, -1,
938 97, -1, 12, -1, 13, -1
939 };
940
941 /* ZZ_RLINE[ZZ_N] -- source line where rule number ZZ_N was defined. */
942 static const unsigned short int zz_rline[] =
943 {
944 0, 409, 409, 411, 415, 416, 417, 418, 419, 420,
945 421, 422, 423, 424, 425, 426, 427, 428, 435, 480,
946 484, 489, 497, 501, 506, 514, 518, 525, 556, 564,
947 584, 594, 602, 620, 629, 637, 690, 701, 710, 715,
948 720, 727, 734, 744, 783, 818, 823, 828, 835, 842,
949 852, 893, 902, 915, 924, 927, 935, 938, 946, 949,
950 956, 988, 1002, 1005, 1012, 1042, 1051, 1056, 1076, 1079,
951 1087, 1097, 1101, 1100, 1114, 1122, 1125, 1148, 1162, 1171,
952 1179, 1182, 1190, 1198, 1199, 1200, 1201, 1202, 1203, 1204,
953 1205, 1206, 1207, 1208, 1209, 1210, 1211, 1212, 1213, 1214,
954 1215, 1216, 1217, 1218, 1219, 1220, 1221, 1222, 1223, 1224,
955 1225, 1226, 1227, 1231, 1272, 1301, 1305, 1356, 1359, 1366,
956 1378, 1405, 1410, 1418, 1423, 1432, 1435, 1443, 1446, 1454,
957 1457, 1464, 1471, 1478, 1485, 1492, 1496, 1503, 1516, 1533,
958 1543, 1551, 1562, 1575, 1582, 1590, 1593, 1600, 1621, 1624,
959 1631, 1653, 1656, 1660, 1667, 1671, 1675, 1679, 1686, 1690,
960 1697, 1704, 1711, 1722, 1733, 1739, 1749, 1759, 1762, 1769,
961 1780, 1792, 1799, 1809, 1816, 1820, 1824, 1828, 1835, 1839,
962 1843, 1847, 1851, 1858, 1865, 1876, 1886, 1893, 1897, 1901,
963 1905, 1912, 1923, 1933, 1940, 1944, 1948, 1952, 1959, 1969,
964 2006, 2015, 2030, 2035, 2044, 2055, 2059, 2064, 2077, 2097,
965 2101, 2106, 2121, 2126, 2131, 2136, 2141, 2146, 2151, 2156,
966 2161, 2166, 2171, 2176, 2181, 2186, 2195, 2198, 2206, 2209,
967 2216, 2221, 2227, 2231, 2235, 2240, 2248, 2254, 2263, 2267,
968 2289, 2293, 2314, 2318, 2323, 2329, 2333, 2340, 2344, 2348,
969 2352, 2356, 2360, 2367, 2374, 2378, 2386, 2389, 2393, 2400,
970 2404, 2408, 2412, 2416, 2420, 2424, 2428, 2432, 2436, 2440,
971 2445, 2450, 2455, 2460, 2465, 2470, 2475, 2479, 2484, 2489,
972 2494, 2499, 2504, 2508, 2512, 2516, 2520, 2527, 2531, 2538,
973 2542, 2549, 2553, 2560, 2564, 2571, 2575, 2582, 2586, 2597,
974 2604, 2608, 2612, 2616, 2620, 2624, 2631, 2635
975 };
976 #endif
977
978 #if ZZ_DEBUG || ZZ_ERROR_VERBOSE
979 /* ZZ_TNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
980 First, the terminals, then, starting at ZZ_NTOKENS, nonterminals. */
981 static const char *const zz_tname[] =
982 {
983 "$end", "error", "$undefined", "ADD_T", "ALIASES_T", "AND_T", "ANY_T",
984 "AREALIKE_T", "ARETHESAME_T", "ARRAY_T", "ASSERT_T", "ATOM_T", "BEQ_T",
985 "BNE_T", "BREAK_T", "CALL_T", "CARD_T", "CASE_T", "CHOICE_T", "CHECK_T",
986 "CONDITIONAL_T", "CONSTANT_T", "CONTINUE_T", "CREATE_T", "DATA_T",
987 "DECREASING_T", "DEFAULT_T", "DEFINITION_T", "DIMENSION_T",
988 "DIMENSIONLESS_T", "DO_T", "ELSE_T", "END_T", "EXPECT_T", "EXTERNAL_T",
989 "FALSE_T", "FALLTHRU_T", "FIX_T", "FOR_T", "FREE_T", "FROM_T",
990 "GLOBAL_T", "IF_T", "IMPORT_T", "IN_T", "INPUT_T", "INCREASING_T",
991 "INTERACTIVE_T", "INTERSECTION_T", "ISA_T", "_IS_T", "ISREFINEDTO_T",
992 "MAXIMIZE_T", "MAXINTEGER_T", "MAXREAL_T", "METHODS_T", "METHOD_T",
993 "MINIMIZE_T", "MODEL_T", "NOT_T", "NOTES_T", "OF_T", "OR_T",
994 "OTHERWISE_T", "OUTPUT_T", "PATCH_T", "PROD_T", "PROVIDE_T", "REFINES_T",
995 "REPLACE_T", "REQUIRE_T", "RETURN_T", "RUN_T", "SATISFIED_T", "SELECT_T",
996 "SIZE_T", "STOP_T", "SUCHTHAT_T", "SUM_T", "SWITCH_T", "THEN_T",
997 "TRUE_T", "UNION_T", "UNITS_T", "UNIVERSAL_T", "WHEN_T", "WHERE_T",
998 "WHILE_T", "WILLBE_T", "WILLBETHESAME_T", "WILLNOTBETHESAME_T",
999 "ASSIGN_T", "CASSIGN_T", "DBLCOLON_T", "USE_T", "LEQ_T", "GEQ_T",
1000 "NEQ_T", "DOTDOT_T", "WITH_T", "VALUE_T", "WITH_VALUE_T", "REAL_T",
1001 "INTEGER_T", "IDENTIFIER_T", "BRACEDTEXT_T", "SYMBOL_T", "DQUOTE_T",
1002 "','", "'|'", "'<'", "'='", "'>'", "'+'", "'-'", "'/'", "'*'", "UPLUS_T",
1003 "UMINUS_T", "'^'", "';'", "'('", "')'", "':'", "'.'", "'['", "']'",
1004 "$accept", "definitions", "definition", "global_def", "require_file",
1005 "provide_module", "import", "add_notes_def", "add_notes_head",
1006 "add_method_def", "add_method_head", "replace_method_def",
1007 "replace_method_head", "atom_def", "atom_head", "atom_id", "default_val",
1008 "constant_def", "constant_head", "constant_val", "model_def",
1009 "model_head", "model_id", "optional_model_parameters",
1010 "optional_parameter_wheres", "optional_parameter_reduction", "patch_def",
1011 "patch_head", "universal", "definition_def", "definition_id",
1012 "units_def", "units_statement", "unitdeflist", "unitdef", "methods",
1013 "@1", "proclist", "proclistf", "procedure", "procedure_id",
1014 "fstatements", "statements", "statement", "isa_statement",
1015 "willbe_statement", "aliases_statement", "optional_set_values",
1016 "is_statement", "isrefinedto_statement", "call_identifier",
1017 "type_identifier", "optional_method", "optional_of",
1018 "optional_with_value", "arealike_statement", "arethesame_statement",
1019 "willbethesame_statement", "willnotbethesame_statement",
1020 "assignment_statement", "relation_statement", "relation",
1021 "blackbox_statement", "input_args", "output_args", "data_args",
1022 "glassbox_statement", "optional_scope", "for_statement",
1023 "optional_direction", "forexprend", "run_statement", "fix_statement",
1024 "free_statement", "external_statement", "call_statement",
1025 "assert_statement", "if_statement", "while_statement", "optional_else",
1026 "when_statement", "whenlist", "whenlistf", "flow_statement",
1027 "use_statement", "select_statement", "selectlist", "selectlistf",
1028 "switch_statement", "switchlist", "switchlistf", "conditional_statement",
1029 "notes_statement", "notes_body", "noteslist", "fvarlist", "varlist",
1030 "fname", "name", "end", "optional_bracedtext", "optional_notes", "set",
1031 "setexprlist", "number", "realnumber", "opunits", "dims", "dimensions",
1032 "dimexpr", "fraction", "fractail", "optional_sign", "expr", "relop",
1033 "logrelop", 0
1034 };
1035 #endif
1036
1037 # ifdef ZZ_PRINT
1038 /* ZZ_TOKNUM[ZZ_LEX-NUM] -- Internal token number corresponding to
1039 token ZZ_LEX-NUM. */
1040 static const unsigned short int zz_toknum[] =
1041 {
1042 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
1043 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
1044 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
1045 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
1046 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
1047 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
1048 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
1049 325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
1050 335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
1051 345, 346, 347, 348, 349, 350, 351, 352, 353, 354,
1052 355, 356, 357, 358, 359, 360, 361, 362, 44, 124,
1053 60, 61, 62, 43, 45, 47, 42, 363, 364, 94,
1054 59, 40, 41, 58, 46, 91, 93
1055 };
1056 # endif
1057
1058 /* ZZ_R1[ZZ_N] -- Symbol number of symbol that rule ZZ_N derives. */
1059 static const unsigned char zz_r1[] =
1060 {
1061 0, 127, 128, 128, 129, 129, 129, 129, 129, 129,
1062 129, 129, 129, 129, 129, 129, 129, 129, 130, 131,
1063 131, 131, 132, 132, 132, 133, 133, 134, 135, 136,
1064 137, 137, 138, 139, 139, 140, 141, 142, 143, 143,
1065 143, 143, 143, 144, 145, 146, 146, 146, 146, 146,
1066 147, 148, 148, 149, 150, 150, 151, 151, 152, 152,
1067 153, 154, 155, 155, 156, 157, 158, 159, 160, 160,
1068 161, 162, 163, 162, 164, 165, 165, 166, 167, 168,
1069 169, 169, 169, 170, 170, 170, 170, 170, 170, 170,
1070 170, 170, 170, 170, 170, 170, 170, 170, 170, 170,
1071 170, 170, 170, 170, 170, 170, 170, 170, 170, 170,
1072 170, 170, 170, 171, 172, 173, 173, 174, 174, 175,
1073 176, 177, 177, 178, 178, 179, 179, 180, 180, 181,
1074 181, 182, 183, 184, 185, 186, 186, 187, 187, 188,
1075 188, 188, 189, 190, 191, 192, 192, 193, 194, 194,
1076 195, 196, 196, 196, 197, 197, 197, 197, 198, 198,
1077 199, 200, 201, 202, 203, 204, 205, 206, 206, 207,
1078 207, 207, 207, 208, 209, 209, 209, 209, 210, 210,
1079 210, 210, 210, 211, 212, 212, 213, 214, 214, 214,
1080 214, 215, 215, 216, 217, 217, 217, 217, 218, 219,
1081 220, 220, 221, 221, 222, 223, 223, 223, 224, 225,
1082 225, 225, 226, 226, 226, 226, 226, 226, 226, 226,
1083 226, 226, 226, 226, 226, 226, 227, 227, 228, 228,
1084 229, 229, 230, 230, 230, 230, 231, 231, 232, 232,
1085 233, 233, 234, 234, 234, 235, 235, 236, 236, 236,
1086 236, 236, 236, 237, 238, 238, 239, 239, 239, 240,
1087 240, 240, 240, 240, 240, 240, 240, 240, 240, 240,
1088 240, 240, 240, 240, 240, 240, 240, 240, 240, 240,
1089 240, 240, 240, 240, 240, 240, 240, 240, 240, 240,
1090 240, 240, 240, 240, 240, 240, 240, 240, 240, 240,
1091 241, 241, 241, 241, 241, 241, 242, 242
1092 };
1093
1094 /* ZZ_R2[ZZ_N] -- Number of symbols composing right hand side of rule ZZ_N. */
1095 static const unsigned char zz_r2[] =
1096 {
1097 0, 2, 0, 2, 1, 1, 1, 1, 1, 1,
1098 1, 1, 1, 1, 1, 1, 1, 1, 5, 3,
1099 3, 2, 3, 3, 2, 5, 3, 4, 6, 4,
1100 5, 6, 4, 5, 6, 6, 6, 2, 0, 3,
1101 2, 2, 2, 2, 8, 0, 3, 2, 2, 2,
1102 6, 4, 7, 2, 0, 3, 0, 4, 0, 3,
1103 5, 5, 0, 1, 5, 2, 2, 3, 0, 2,
1104 4, 0, 0, 3, 1, 0, 2, 5, 2, 1,
1105 0, 3, 3, 1, 1, 1, 1, 1, 1, 1,
1106 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1107 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1108 1, 1, 1, 5, 5, 3, 12, 0, 4, 4,
1109 3, 1, 4, 1, 4, 0, 2, 0, 2, 0,
1110 2, 2, 2, 2, 2, 3, 3, 1, 3, 1,
1111 2, 2, 9, 3, 3, 0, 4, 9, 0, 2,
1112 8, 0, 1, 1, 1, 1, 1, 1, 2, 4,
1113 2, 2, 5, 2, 2, 6, 5, 0, 2, 4,
1114 6, 6, 8, 1, 4, 3, 5, 4, 1, 1,
1115 1, 1, 2, 2, 4, 6, 1, 4, 3, 5,
1116 4, 4, 6, 1, 4, 3, 5, 4, 3, 3,
1117 2, 3, 2, 3, 1, 1, 3, 2, 2, 1,
1118 3, 4, 2, 2, 2, 2, 2, 2, 2, 2,
1119 2, 2, 2, 2, 2, 1, 0, 1, 0, 1,
1120 1, 0, 1, 3, 3, 5, 1, 1, 2, 2,
1121 0, 1, 2, 1, 0, 1, 1, 1, 1, 3,
1122 3, 3, 3, 2, 1, 5, 0, 1, 1, 1,
1123 1, 1, 1, 1, 1, 1, 1, 1, 3, 3,
1124 3, 3, 3, 3, 3, 3, 2, 3, 3, 3,
1125 3, 3, 2, 2, 6, 4, 4, 4, 4, 4,
1126 4, 4, 4, 4, 4, 4, 4, 4, 4, 3,
1127 1, 1, 1, 1, 1, 1, 1, 1
1128 };
1129
1130 /* ZZ_DEFACT[STATE-NAME] -- Default rule to reduce with in state
1131 STATE-NUM when ZZ_TABLE doesn't specify something else to do. Zero
1132 means the default is an error. */
1133 static const unsigned short int zz_defact[] =
1134 {
1135 2, 0, 1, 17, 0, 0, 0, 0, 0, 0,
1136 0, 0, 68, 63, 3, 16, 4, 5, 6, 9,
1137 0, 7, 75, 8, 75, 11, 10, 12, 14, 80,
1138 0, 13, 80, 15, 0, 0, 0, 65, 80, 0,
1139 0, 209, 0, 24, 0, 0, 21, 0, 0, 0,
1140 0, 74, 0, 71, 0, 0, 0, 0, 80, 0,
1141 43, 80, 54, 71, 66, 0, 0, 0, 0, 26,
1142 0, 22, 23, 0, 231, 0, 19, 20, 225, 0,
1143 69, 67, 200, 0, 204, 205, 228, 0, 0, 0,
1144 0, 76, 0, 0, 72, 0, 0, 265, 0, 178,
1145 0, 0, 0, 80, 179, 0, 264, 180, 0, 0,
1146 0, 0, 0, 0, 260, 262, 0, 0, 0, 0,
1147 181, 0, 0, 0, 226, 0, 0, 263, 0, 0,
1148 0, 0, 240, 259, 209, 266, 0, 0, 0, 231,
1149 112, 0, 83, 84, 85, 86, 87, 88, 89, 90,
1150 91, 92, 93, 137, 95, 94, 98, 99, 100, 101,
1151 97, 96, 102, 103, 104, 105, 107, 106, 108, 109,
1152 110, 111, 0, 267, 261, 139, 37, 0, 53, 71,
1153 0, 71, 80, 56, 0, 0, 0, 125, 0, 0,
1154 0, 210, 267, 0, 230, 232, 0, 0, 212, 213,
1155 221, 214, 215, 216, 217, 218, 219, 220, 222, 223,
1156 224, 0, 0, 202, 0, 207, 229, 208, 201, 27,
1157 29, 78, 80, 32, 75, 0, 82, 164, 121, 163,
1158 231, 231, 231, 231, 0, 0, 160, 0, 161, 0,
1159 231, 231, 141, 140, 276, 0, 231, 231, 158, 0,
1160 0, 0, 227, 182, 231, 231, 0, 0, 231, 231,
1161 0, 0, 0, 183, 241, 238, 239, 0, 282, 283,
1162 0, 0, 81, 0, 131, 132, 0, 0, 0, 0,
1163 133, 134, 0, 0, 0, 0, 306, 307, 0, 0,
1164 0, 303, 304, 305, 0, 301, 300, 302, 0, 0,
1165 0, 0, 0, 0, 0, 0, 0, 244, 0, 0,
1166 0, 0, 0, 0, 30, 0, 0, 18, 25, 61,
1167 211, 0, 0, 0, 33, 0, 203, 206, 0, 73,
1168 60, 231, 0, 0, 0, 0, 198, 0, 0, 80,
1169 0, 0, 199, 0, 0, 0, 0, 0, 231, 0,
1170 0, 186, 0, 0, 0, 231, 0, 0, 193, 0,
1171 0, 0, 231, 0, 0, 173, 80, 0, 299, 268,
1172 0, 115, 123, 127, 127, 120, 127, 135, 136, 0,
1173 209, 138, 274, 279, 275, 281, 280, 269, 270, 272,
1174 271, 273, 277, 278, 244, 0, 0, 243, 38, 0,
1175 55, 80, 0, 51, 64, 31, 126, 28, 234, 233,
1176 34, 70, 0, 0, 294, 295, 296, 297, 0, 151,
1177 167, 292, 293, 288, 289, 159, 0, 285, 0, 0,
1178 80, 184, 231, 0, 286, 287, 0, 0, 80, 191,
1179 231, 0, 290, 291, 0, 0, 80, 169, 231, 0,
1180 0, 298, 0, 231, 0, 129, 119, 129, 0, 0,
1181 0, 45, 35, 248, 247, 245, 0, 242, 246, 256,
1182 0, 50, 0, 58, 0, 77, 122, 162, 153, 152,
1183 0, 80, 0, 0, 0, 0, 80, 188, 0, 80,
1184 0, 80, 195, 0, 80, 0, 80, 175, 0, 80,
1185 166, 0, 0, 128, 0, 113, 114, 0, 0, 0,
1186 0, 267, 256, 228, 0, 0, 0, 256, 40, 41,
1187 42, 257, 258, 0, 36, 57, 80, 0, 235, 156,
1188 154, 157, 155, 80, 168, 165, 284, 185, 187, 80,
1189 190, 192, 194, 80, 197, 171, 174, 80, 177, 0,
1190 124, 130, 0, 170, 0, 0, 0, 48, 47, 49,
1191 0, 0, 252, 249, 250, 251, 0, 236, 39, 237,
1192 0, 52, 0, 189, 196, 176, 0, 0, 145, 0,
1193 0, 143, 46, 44, 254, 0, 253, 59, 150, 0,
1194 172, 0, 0, 0, 148, 0, 0, 0, 142, 144,
1195 0, 147, 0, 0, 0, 149, 0, 117, 146, 255,
1196 0, 116, 231, 0, 118
1197 };
1198
1199 /* ZZ_DEFGOTO[NTERM-NUM]. */
1200 static const short int zz_defgoto[] =
1201 {
1202 -1, 1, 14, 15, 16, 17, 18, 19, 20, 21,
1203 22, 23, 24, 25, 58, 59, 470, 26, 60, 513,
1204 27, 61, 62, 183, 311, 527, 28, 29, 30, 31,
1205 32, 33, 34, 47, 80, 95, 224, 50, 51, 91,
1206 92, 53, 54, 141, 142, 143, 144, 611, 145, 146,
1207 229, 373, 316, 455, 505, 147, 148, 149, 150, 151,
1208 152, 153, 154, 509, 578, 592, 155, 601, 156, 480,
1209 533, 157, 158, 159, 160, 161, 162, 163, 164, 482,
1210 165, 364, 365, 166, 167, 168, 350, 351, 169, 357,
1211 358, 170, 171, 49, 82, 83, 84, 192, 86, 81,
1212 253, 217, 193, 194, 568, 174, 265, 398, 467, 468,
1213 565, 586, 523, 195, 303, 304
1214 };
1215
1216 /* ZZ_PACT[STATE-NUM] -- Index in ZZ_TABLE of the portion describing
1217 STATE-NUM. */
1218 #define ZZ_PACT_NINF -437
1219 static const short int zz_pact[] =
1220 {
1221 -437, 1096, -437, -437, 81, -59, 2, 25, 38, 57,
1222 1, 82, -437, -437, -437, -437, -437, -437, -437, -437,
1223 71, -437, -437, -437, -437, -437, -437, -437, -437, -437,
1224 10, -437, -437, -437, 77, 167, 179, -437, -437, -30,
1225 202, -437, 130, 43, 204, 133, 60, -18, 150, -19,
1226 223, 206, 223, 203, 593, 156, 159, 160, -437, 197,
1227 -437, -437, 145, 203, -437, -11, 166, 223, 168, -437,
1228 169, -437, -437, 170, 165, -10, -437, -437, 476, 161,
1229 -437, -437, 150, 171, -61, -437, 0, 150, 157, 162,
1230 176, -437, 163, 164, -437, 223, 172, -437, 165, -437,
1231 181, 33, 44, -437, -437, 183, -437, -437, 150, 189,
1232 150, 165, 89, 165, -437, -437, 165, 165, 71, 96,
1233 -437, 150, 173, -72, 186, 105, -64, -437, 108, -62,
1234 165, 150, 190, 191, 177, -437, 165, 165, 165, 165,
1235 -437, 180, -437, -437, -437, -437, -437, -437, -437, -437,
1236 -437, -437, -437, -437, -437, -437, -437, -437, -437, -437,
1237 -437, -437, -437, -437, -437, -437, -437, -437, -437, -437,
1238 -437, -437, 59, 84, -437, 960, -437, 231, -437, 203,
1239 198, 203, -437, 215, 223, 247, 193, 251, 194, 195,
1240 196, -437, -437, 185, 210, 801, 261, 207, -437, -437,
1241 -437, -437, -437, -437, -437, -437, -437, -437, -437, -437,
1242 -437, 218, 219, -437, 150, -437, -437, -437, 150, -437,
1243 -437, -437, -437, -437, -437, 212, -437, 960, 205, -437,
1244 165, 165, 165, 165, 223, 213, -437, 289, -437, 844,
1245 165, 165, 960, 960, -437, -19, 165, 165, 243, 150,
1246 150, -5, -437, -437, 165, 165, 150, -2, 165, 165,
1247 150, 7, 874, -437, -437, -437, -437, 165, 242, 242,
1248 244, 211, -437, -4, -437, -437, 246, 258, 246, 246,
1249 -437, -437, 165, 165, 694, 165, -437, -437, 165, 165,
1250 165, -437, -437, -437, 165, -437, -437, -437, 165, 165,
1251 165, 165, 165, 165, 165, 260, 223, 187, 223, 245,
1252 248, -49, 252, 253, -437, 264, 254, -437, -437, -437,
1253 -437, 165, 165, 255, -437, 256, -437, -437, 223, -437,
1254 -437, 165, 249, 239, 257, 259, -437, 150, 165, -437,
1255 262, 263, -437, 268, 265, 150, 6, 270, 165, 271,
1256 223, 16, 274, 267, 276, 165, 279, 223, 36, 282,
1257 280, 283, 165, 285, 223, 48, -437, 715, -437, -437,
1258 150, -437, 288, 316, 316, -437, 316, 960, 960, 11,
1259 290, -437, 233, 233, 233, 375, 375, 63, 63, 242,
1260 242, 242, 80, 990, 187, 266, -66, -437, 352, 293,
1261 -437, -437, 277, -437, -437, -437, -437, -437, 917, 960,
1262 -437, -437, 296, 295, -437, -437, -437, -437, 301, 758,
1263 387, -437, -437, -437, -437, -437, -26, -437, -5, 302,
1264 -437, -437, 165, 303, -437, -437, -2, 304, -437, -437,
1265 165, 305, -437, -437, 7, 306, -437, -437, 165, 308,
1266 223, -437, 311, 165, 320, 333, -437, 333, 150, 7,
1267 165, 291, -437, -437, -437, -437, -52, -437, 90, -17,
1268 319, -437, 314, 321, 165, -437, -437, -437, -437, -437,
1269 127, -437, 223, 191, 318, 223, -437, -437, 322, -437,
1270 223, -437, -437, 323, -437, 223, -437, -437, 324, -437,
1271 -437, 355, 327, -437, 165, -437, -437, 329, 223, 332,
1272 116, -79, 39, 337, 40, -52, -52, 128, -437, -437,
1273 -437, -437, -437, 142, -437, -437, -437, 334, 960, -437,
1274 -437, -437, -437, -437, -437, -437, -437, -437, -437, -437,
1275 -437, -437, -437, -437, -437, -437, -437, -437, -437, 150,
1276 -437, 960, 7, -437, 150, 350, 411, -437, -437, -437,
1277 142, 339, -437, 338, 338, -437, -75, 191, -437, -437,
1278 340, -437, 223, -437, -437, -437, 415, 223, 346, 344,
1279 347, -437, -437, -437, -437, 370, -437, -437, -437, 371,
1280 -437, 150, 354, 410, 433, 363, 418, 357, -437, -437,
1281 150, -437, 378, 379, 458, -437, 376, 391, -437, -437,
1282 372, -437, 165, 377, -437
1283 };
1284
1285 /* ZZ_PGOTO[NTERM-NUM]. */
1286 static const short int zz_pgoto[] =
1287 {
1288 -437, -437, -437, -437, -437, -437, -437, -437, -437, -437,
1289 -437, -437, -437, -437, -437, -437, -437, -437, -437, -437,
1290 -437, -437, -437, -437, -437, -437, -437, -437, -437, -437,
1291 -437, -437, 443, -437, -437, -41, -437, -20, -437, -437,
1292 -437, -31, -437, -437, -437, -437, -437, -437, -437, -437,
1293 -437, -27, -437, -253, 46, -437, -437, -437, -437, -437,
1294 -437, 216, -437, -437, -437, -437, -437, -437, -437, -437,
1295 -437, -437, -437, -437, -437, -437, -437, -437, -437, -437,
1296 -437, -436, -437, -437, -437, -437, 76, -437, -437, 69,
1297 -437, -437, -437, 389, 422, -28, -437, -48, 226, -47,
1298 -437, -3, -128, -437, -45, -417, -437, 117, -437, -431,
1299 -437, -437, -373, 284, -437, -437
1300 };
1301
1302 /* ZZ_TABLE[ZZ_PACT[STATE-NUM]]. What to do in state STATE-NUM. If
1303 positive, shift that token. If negative, reduce the rule which
1304 number is the opposite. If zero, do what ZZ_DEFACT says.
1305 If ZZ_TABLE_NINF, syntax error. */
1306 #define ZZ_TABLE_NINF -206
1307 static const short int zz_table[] =
1308 {
1309 85, 63, 88, 89, 52, 93, 173, 67, 495, 484,
1310 68, 271, 348, 78, 78, 355, 185, 196, 518, 402,
1311 188, 55, 184, 508, 362, -205, 172, 179, 584, -205,
1312 181, 56, 41, 432, 85, 514, 215, 463, 464, 85,
1313 41, -205, 41, 41, -205, 37, 585, 214, 225, 250,
1314 465, 463, 464, 440, 212, 466, 44, 256, 349, 260,
1315 85, 356, 85, 273, 519, 448, 274, 275, 57, 466,
1316 363, 403, 234, 248, 557, 85, 132, 483, 85, 433,
1317 236, 85, 238, 263, 563, 564, 79, 87, -205, 520,
1318 69, -205, -205, 186, 197, 251, 521, 522, 257, 441,
1319 41, 261, 332, 333, 334, 335, 569, 216, 276, 277,
1320 278, 449, 340, 341, 426, 41, 577, 370, 343, 344,
1321 558, 456, 38, 457, 73, 74, 352, 353, 427, 39,
1322 359, 360, 458, -205, -205, -205, 35, 312, 306, 560,
1323 308, 36, 40, 569, 566, 559, 529, 279, 280, 281,
1324 530, 309, 521, 522, 230, 515, 516, 531, 231, 517,
1325 532, 41, 562, 72, 42, 232, 327, 73, 74, 233,
1326 85, 97, -205, -205, -205, 282, 283, 48, 300, 301,
1327 77, 101, 302, 102, 73, 74, 41, 336, -205, 45,
1328 212, 328, -205, 298, 299, 300, 301, 64, 342, 302,
1329 106, 346, 85, 413, 329, 515, 516, 284, 85, 517,
1330 240, 65, 85, 112, 241, 396, 397, 246, 114, 115,
1331 429, 247, 347, 66, 117, 371, 254, 437, 354, 258,
1332 255, 119, 361, 259, 445, 43, 555, 46, 122, 556,
1333 70, 521, 522, 125, 132, 567, 127, 128, 75, 285,
1334 71, 375, 376, 76, 41, 78, 286, 287, 94, 395,
1335 176, 399, 90, 177, 178, 180, 182, 132, 133, 134,
1336 187, 135, 211, 190, 191, 189, 213, 219, 136, 137,
1337 221, 412, 220, 222, 223, 228, 138, 235, 288, 85,
1338 139, 252, 226, 237, 249, 264, 266, 425, 267, 305,
1339 272, 310, 307, 431, 488, 313, 289, 315, 420, 418,
1340 439, 320, 493, 314, 317, 318, 319, 447, 321, 323,
1341 498, 290, 85, 325, 326, 502, 331, 324, 291, 292,
1342 293, 85, 330, 338, 337, 450, 345, 369, 175, 291,
1343 292, 293, 452, 295, 296, 297, 298, 299, 300, 301,
1344 372, 459, 302, 294, 295, 296, 297, 298, 299, 300,
1345 301, 302, 374, 302, 394, 415, 368, 400, 406, 401,
1346 472, 414, 404, 405, 407, 410, 411, 454, 469, 416,
1347 285, 473, 227, 512, 421, 417, 462, 286, 287, 422,
1348 423, 424, 428, 435, 430, 239, 434, 242, 436, 487,
1349 243, 244, 438, 500, 442, 444, 443, 492, 446, 453,
1350 85, 460, 511, 471, 262, 497, 475, 476, 481, 288,
1351 268, 269, 270, 477, 503, 486, 489, 491, 494, 496,
1352 507, 499, 510, 501, 504, 535, 525, 289, 537, 524,
1353 536, 549, 526, 541, 216, 539, 543, 547, 545, 550,
1354 534, 552, 554, 580, 571, 538, 581, 517, 540, 583,
1355 542, 553, 587, 544, 589, 546, 591, 593, 548, 594,
1356 291, 292, 293, 595, 599, 596, 598, 600, 602, 603,
1357 604, 606, 608, 607, 613, 295, 296, 297, 298, 299,
1358 300, 301, 610, 612, 302, 570, 198, 140, 609, 614,
1359 381, 85, 572, 506, 485, 490, 85, 245, 573, 218,
1360 561, 461, 574, 0, 199, 582, 575, 200, 201, 0,
1361 0, 576, 0, 202, 0, 588, 579, 0, 0, 0,
1362 590, 203, 0, 0, 0, 0, 204, 0, 0, 0,
1363 0, 0, 0, 597, 0, 0, 0, 0, 0, 0,
1364 205, 367, 605, 0, 0, 206, 0, 0, 0, 207,
1365 0, 208, 0, 209, 0, 0, 377, 378, 175, 382,
1366 0, 0, 383, 384, 385, 0, 0, 0, 386, 0,
1367 210, 0, 387, 388, 389, 390, 391, 392, 393, 0,
1368 0, 0, 0, 0, 96, 0, 0, 0, 0, 97,
1369 0, 0, 0, 98, 0, 408, 409, 99, 100, 101,
1370 -79, 102, 0, 103, 0, 104, 0, 0, 0, 0,
1371 0, 0, 419, 0, -79, -79, 0, 105, 106, 107,
1372 108, 109, 110, 0, 0, 111, 0, 0, 0, 0,
1373 0, 112, 0, 0, 0, 113, 114, 115, -79, 0,
1374 116, 0, 117, 118, 0, 0, -79, 0, 0, 119,
1375 0, 0, 0, 0, 120, 121, 122, 123, 0, 124,
1376 0, 125, 126, 0, 127, 128, 12, 0, 129, 0,
1377 130, 0, 0, 0, 0, 0, 0, 131, 0, 0,
1378 0, 0, 0, 0, 0, 132, 133, 134, 0, 135,
1379 97, 0, 0, 0, 0, 0, 136, 137, 0, 0,
1380 101, 0, 102, 0, 138, -79, 0, 0, 139, 0,
1381 285, 0, 0, 0, 0, 0, 0, 286, 287, 106,
1382 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1383 0, 0, 112, 0, 367, 0, 113, 114, 115, 0,
1384 0, 116, 0, 117, 0, 0, 0, 0, 528, 288,
1385 119, 0, 0, 285, 0, 0, 0, 122, 0, 0,
1386 286, 287, 125, 0, 0, 127, 128, 289, 0, 379,
1387 0, 0, 0, 478, 0, 0, 0, 0, 551, 0,
1388 0, 0, 290, 0, 0, 0, 132, 133, 380, 0,
1389 135, 0, 288, 0, 479, 0, 285, 136, 137, 0,
1390 291, 292, 293, 286, 287, 138, 0, 0, 0, 139,
1391 289, 0, 0, 0, 294, 295, 296, 297, 298, 299,
1392 300, 301, 0, 0, 302, 290, 0, 451, 0, 0,
1393 0, 0, 0, 0, 0, 288, 0, 0, 0, 285,
1394 0, 0, 0, 291, 292, 293, 286, 287, 0, 0,
1395 0, 0, 0, 289, 0, 0, 0, 294, 295, 296,
1396 297, 298, 299, 300, 301, 0, 0, 302, 290, 285,
1397 0, 0, 0, 0, 0, 0, 286, 287, 288, 0,
1398 0, 0, 0, 0, 0, 0, 291, 292, 293, 322,
1399 0, 0, 0, 0, 366, 0, 289, 0, 0, 0,
1400 294, 295, 296, 297, 298, 299, 300, 301, 288, 0,
1401 302, 290, 285, 0, 339, 0, 0, 0, 0, 286,
1402 287, 0, 0, 0, 0, 0, 289, 0, 0, 291,
1403 292, 293, 0, 0, 0, 0, 0, 0, 0, 0,
1404 0, 290, 0, 294, 295, 296, 297, 298, 299, 300,
1405 301, 288, 0, 302, 0, 285, 0, 0, 0, 291,
1406 292, 293, 286, 287, 0, 0, 0, 0, 0, 289,
1407 0, 0, 0, 294, 295, 296, 297, 298, 299, 300,
1408 301, 0, 0, 302, 290, 285, 0, 0, 0, 0,
1409 0, 0, 0, 0, 288, 0, 0, 0, 0, 0,
1410 0, 0, 291, 292, 293, 474, 0, 0, 0, 0,
1411 0, 0, 289, 0, 0, 0, 294, 295, 296, 297,
1412 298, 299, 300, 301, 288, 0, 302, 290, 0, 0,
1413 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1414 0, 0, 289, 0, 0, 291, 292, 293, 0, 0,
1415 0, 0, 0, 0, 0, 0, 0, 0, 0, 294,
1416 295, 296, 297, 298, 299, 300, 301, 0, 0, 302,
1417 0, 0, 0, 0, 0, 291, 292, 293, 0, 0,
1418 0, 0, 0, 0, 0, 0, 2, 3, 0, 4,
1419 295, 296, 297, 298, 299, 300, 301, -62, 0, 302,
1420 0, 0, 0, 0, 0, 0, 0, -62, 0, 0,
1421 0, 0, 0, 5, 0, 0, 0, 0, 0, 0,
1422 0, 0, 0, 0, 0, 0, 0, 6, 0, 7,
1423 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1424 0, 0, 0, 0, -62, 0, 0, 0, 0, 0,
1425 0, 8, 0, 9, 0, 10, 11, 0, 0, 0,
1426 0, 0, 0, 0, 0, 0, 0, 0, 0, 12,
1427 13
1428 };
1429
1430 static const short int zz_check[] =
1431 {
1432 48, 32, 49, 50, 24, 52, 54, 38, 444, 426,
1433 40, 139, 17, 32, 32, 17, 27, 27, 35, 68,
1434 67, 11, 63, 459, 17, 104, 54, 58, 103, 108,
1435 61, 21, 104, 17, 82, 466, 84, 103, 104, 87,
1436 104, 120, 104, 104, 123, 104, 121, 108, 95, 121,
1437 116, 103, 104, 17, 82, 121, 55, 121, 63, 121,
1438 108, 63, 110, 4, 81, 17, 7, 8, 58, 121,
1439 63, 120, 103, 121, 35, 123, 102, 103, 126, 63,
1440 108, 129, 110, 131, 515, 516, 104, 106, 4, 106,
1441 120, 7, 8, 104, 104, 123, 113, 114, 126, 63,
1442 104, 129, 230, 231, 232, 233, 523, 107, 49, 50,
1443 51, 63, 240, 241, 108, 104, 552, 121, 246, 247,
1444 81, 374, 120, 376, 124, 125, 254, 255, 122, 104,
1445 258, 259, 121, 49, 50, 51, 55, 184, 179, 512,
1446 181, 60, 104, 560, 517, 106, 19, 88, 89, 90,
1447 23, 182, 113, 114, 121, 115, 116, 30, 125, 119,
1448 33, 104, 122, 120, 107, 121, 214, 124, 125, 125,
1449 218, 6, 88, 89, 90, 91, 92, 106, 115, 116,
1450 120, 16, 119, 18, 124, 125, 104, 234, 104, 107,
1451 218, 222, 108, 113, 114, 115, 116, 120, 245, 119,
1452 35, 249, 250, 331, 224, 115, 116, 123, 256, 119,
1453 121, 44, 260, 48, 125, 28, 29, 121, 53, 54,
1454 348, 125, 250, 44, 59, 273, 121, 355, 256, 121,
1455 125, 66, 260, 125, 362, 9, 120, 11, 73, 123,
1456 38, 113, 114, 78, 102, 103, 81, 82, 44, 5,
1457 120, 278, 279, 120, 104, 32, 12, 13, 55, 306,
1458 104, 308, 56, 104, 104, 68, 121, 102, 103, 104,
1459 104, 106, 111, 104, 104, 107, 105, 120, 113, 114,
1460 104, 328, 120, 120, 120, 104, 121, 104, 44, 337,
1461 125, 105, 120, 104, 121, 105, 105, 345, 121, 68,
1462 120, 86, 104, 350, 432, 58, 62, 56, 339, 337,
1463 357, 126, 440, 120, 120, 120, 120, 364, 108, 58,
1464 448, 77, 370, 105, 105, 453, 121, 120, 95, 96,
1465 97, 379, 120, 44, 121, 366, 93, 126, 54, 95,
1466 96, 97, 370, 110, 111, 112, 113, 114, 115, 116,
1467 104, 379, 119, 109, 110, 111, 112, 113, 114, 115,
1468 116, 119, 104, 119, 104, 126, 122, 122, 104, 121,
1469 401, 122, 120, 120, 120, 120, 120, 61, 26, 122,
1470 5, 104, 98, 92, 122, 126, 120, 12, 13, 126,
1471 122, 126, 122, 126, 123, 111, 122, 113, 122, 430,
1472 116, 117, 123, 450, 122, 122, 126, 438, 123, 121,
1473 458, 121, 460, 120, 130, 446, 120, 122, 31, 44,
1474 136, 137, 138, 122, 104, 123, 123, 123, 123, 123,
1475 458, 123, 460, 122, 101, 482, 122, 62, 485, 120,
1476 122, 86, 121, 490, 107, 123, 123, 123, 495, 122,
1477 481, 122, 120, 103, 120, 486, 45, 119, 489, 120,
1478 491, 508, 122, 494, 49, 496, 120, 123, 499, 122,
1479 95, 96, 97, 103, 64, 104, 122, 44, 115, 61,
1480 123, 103, 24, 104, 612, 110, 111, 112, 113, 114,
1481 115, 116, 101, 121, 119, 526, 20, 54, 122, 122,
1482 284, 549, 533, 457, 428, 436, 554, 118, 539, 87,
1483 513, 394, 543, -1, 38, 560, 547, 41, 42, -1,
1484 -1, 549, -1, 47, -1, 572, 554, -1, -1, -1,
1485 577, 55, -1, -1, -1, -1, 60, -1, -1, -1,
1486 -1, -1, -1, 591, -1, -1, -1, -1, -1, -1,
1487 74, 267, 600, -1, -1, 79, -1, -1, -1, 83,
1488 -1, 85, -1, 87, -1, -1, 282, 283, 284, 285,
1489 -1, -1, 288, 289, 290, -1, -1, -1, 294, -1,
1490 104, -1, 298, 299, 300, 301, 302, 303, 304, -1,
1491 -1, -1, -1, -1, 1, -1, -1, -1, -1, 6,
1492 -1, -1, -1, 10, -1, 321, 322, 14, 15, 16,
1493 17, 18, -1, 20, -1, 22, -1, -1, -1, -1,
1494 -1, -1, 338, -1, 31, 32, -1, 34, 35, 36,
1495 37, 38, 39, -1, -1, 42, -1, -1, -1, -1,
1496 -1, 48, -1, -1, -1, 52, 53, 54, 55, -1,
1497 57, -1, 59, 60, -1, -1, 63, -1, -1, 66,
1498 -1, -1, -1, -1, 71, 72, 73, 74, -1, 76,
1499 -1, 78, 79, -1, 81, 82, 83, -1, 85, -1,
1500 87, -1, -1, -1, -1, -1, -1, 94, -1, -1,
1501 -1, -1, -1, -1, -1, 102, 103, 104, -1, 106,
1502 6, -1, -1, -1, -1, -1, 113, 114, -1, -1,
1503 16, -1, 18, -1, 121, 122, -1, -1, 125, -1,
1504 5, -1, -1, -1, -1, -1, -1, 12, 13, 35,
1505 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1506 -1, -1, 48, -1, 460, -1, 52, 53, 54, -1,
1507 -1, 57, -1, 59, -1, -1, -1, -1, 474, 44,
1508 66, -1, -1, 5, -1, -1, -1, 73, -1, -1,
1509 12, 13, 78, -1, -1, 81, 82, 62, -1, 85,
1510 -1, -1, -1, 25, -1, -1, -1, -1, 504, -1,
1511 -1, -1, 77, -1, -1, -1, 102, 103, 104, -1,
1512 106, -1, 44, -1, 46, -1, 5, 113, 114, -1,
1513 95, 96, 97, 12, 13, 121, -1, -1, -1, 125,
1514 62, -1, -1, -1, 109, 110, 111, 112, 113, 114,
1515 115, 116, -1, -1, 119, 77, -1, 122, -1, -1,
1516 -1, -1, -1, -1, -1, 44, -1, -1, -1, 5,
1517 -1, -1, -1, 95, 96, 97, 12, 13, -1, -1,
1518 -1, -1, -1, 62, -1, -1, -1, 109, 110, 111,
1519 112, 113, 114, 115, 116, -1, -1, 119, 77, 5,
1520 -1, -1, -1, -1, -1, -1, 12, 13, 44, -1,
1521 -1, -1, -1, -1, -1, -1, 95, 96, 97, 98,
1522 -1, -1, -1, -1, 30, -1, 62, -1, -1, -1,
1523 109, 110, 111, 112, 113, 114, 115, 116, 44, -1,
1524 119, 77, 5, -1, 80, -1, -1, -1, -1, 12,
1525 13, -1, -1, -1, -1, -1, 62, -1, -1, 95,
1526 96, 97, -1, -1, -1, -1, -1, -1, -1, -1,
1527 -1, 77, -1, 109, 110, 111, 112, 113, 114, 115,
1528 116, 44, -1, 119, -1, 5, -1, -1, -1, 95,
1529 96, 97, 12, 13, -1, -1, -1, -1, -1, 62,
1530 -1, -1, -1, 109, 110, 111, 112, 113, 114, 115,
1531 116, -1, -1, 119, 77, 5, -1, -1, -1, -1,
1532 -1, -1, -1, -1, 44, -1, -1, -1, -1, -1,
1533 -1, -1, 95, 96, 97, 98, -1, -1, -1, -1,
1534 -1, -1, 62, -1, -1, -1, 109, 110, 111, 112,
1535 113, 114, 115, 116, 44, -1, 119, 77, -1, -1,
1536 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1537 -1, -1, 62, -1, -1, 95, 96, 97, -1, -1,
1538 -1, -1, -1, -1, -1, -1, -1, -1, -1, 109,
1539 110, 111, 112, 113, 114, 115, 116, -1, -1, 119,
1540 -1, -1, -1, -1, -1, 95, 96, 97, -1, -1,
1541 -1, -1, -1, -1, -1, -1, 0, 1, -1, 3,
1542 110, 111, 112, 113, 114, 115, 116, 11, -1, 119,
1543 -1, -1, -1, -1, -1, -1, -1, 21, -1, -1,
1544 -1, -1, -1, 27, -1, -1, -1, -1, -1, -1,
1545 -1, -1, -1, -1, -1, -1, -1, 41, -1, 43,
1546 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1547 -1, -1, -1, -1, 58, -1, -1, -1, -1, -1,
1548 -1, 65, -1, 67, -1, 69, 70, -1, -1, -1,
1549 -1, -1, -1, -1, -1, -1, -1, -1, -1, 83,
1550 84
1551 };
1552
1553 /* ZZ_STOS[STATE-NUM] -- The (internal number of the) accessing
1554 symbol of state STATE-NUM. */
1555 static const unsigned char zz_stos[] =
1556 {
1557 0, 128, 0, 1, 3, 27, 41, 43, 65, 67,
1558 69, 70, 83, 84, 129, 130, 131, 132, 133, 134,
1559 135, 136, 137, 138, 139, 140, 144, 147, 153, 154,
1560 155, 156, 157, 158, 159, 55, 60, 104, 120, 104,
1561 104, 104, 107, 225, 55, 107, 225, 160, 106, 220,
1562 164, 165, 164, 168, 169, 11, 21, 58, 141, 142,
1563 145, 148, 149, 168, 120, 44, 44, 168, 40, 120,
1564 38, 120, 120, 124, 125, 44, 120, 120, 32, 104,
1565 161, 226, 221, 222, 223, 224, 225, 106, 226, 226,
1566 56, 166, 167, 226, 55, 162, 1, 6, 10, 14,
1567 15, 16, 18, 20, 22, 34, 35, 36, 37, 38,
1568 39, 42, 48, 52, 53, 54, 57, 59, 60, 66,
1569 71, 72, 73, 74, 76, 78, 79, 81, 82, 85,
1570 87, 94, 102, 103, 104, 106, 113, 114, 121, 125,
1571 159, 170, 171, 172, 173, 175, 176, 182, 183, 184,
1572 185, 186, 187, 188, 189, 193, 195, 198, 199, 200,
1573 201, 202, 203, 204, 205, 207, 210, 211, 212, 215,
1574 218, 219, 222, 224, 232, 240, 104, 104, 104, 168,
1575 68, 168, 121, 150, 162, 27, 104, 104, 226, 107,
1576 104, 104, 224, 229, 230, 240, 27, 104, 20, 38,
1577 41, 42, 47, 55, 60, 74, 79, 83, 85, 87,
1578 104, 111, 222, 105, 108, 224, 107, 228, 221, 120,
1579 120, 104, 120, 120, 163, 226, 120, 240, 104, 177,
1580 121, 125, 121, 125, 168, 104, 222, 104, 222, 240,
1581 121, 125, 240, 240, 240, 220, 121, 125, 224, 121,
1582 121, 222, 105, 227, 121, 125, 121, 222, 121, 125,
1583 121, 222, 240, 224, 105, 233, 105, 121, 240, 240,
1584 240, 229, 120, 4, 7, 8, 49, 50, 51, 88,
1585 89, 90, 91, 92, 123, 5, 12, 13, 44, 62,
1586 77, 95, 96, 97, 109, 110, 111, 112, 113, 114,
1587 115, 116, 119, 241, 242, 68, 162, 104, 162, 168,
1588 86, 151, 226, 58, 120, 56, 179, 120, 120, 120,
1589 126, 108, 98, 58, 120, 105, 105, 224, 168, 164,
1590 120, 121, 229, 229, 229, 229, 226, 121, 44, 80,
1591 229, 229, 226, 229, 229, 93, 224, 222, 17, 63,
1592 213, 214, 229, 229, 222, 17, 63, 216, 217, 229,
1593 229, 222, 17, 63, 208, 209, 30, 240, 122, 126,
1594 121, 224, 104, 178, 104, 178, 178, 240, 240, 85,
1595 104, 188, 240, 240, 240, 240, 240, 240, 240, 240,
1596 240, 240, 240, 240, 104, 226, 28, 29, 234, 226,
1597 122, 121, 68, 120, 120, 120, 104, 120, 240, 240,
1598 120, 120, 226, 229, 122, 126, 122, 126, 222, 240,
1599 168, 122, 126, 122, 126, 224, 108, 122, 122, 229,
1600 123, 226, 17, 63, 122, 126, 122, 229, 123, 226,
1601 17, 63, 122, 126, 122, 229, 123, 226, 17, 63,
1602 168, 122, 222, 121, 61, 180, 180, 180, 121, 222,
1603 121, 234, 120, 103, 104, 116, 121, 235, 236, 26,
1604 143, 120, 168, 104, 98, 120, 122, 122, 25, 46,
1605 196, 31, 206, 103, 232, 213, 123, 168, 229, 123,
1606 216, 123, 168, 229, 123, 208, 123, 168, 229, 123,
1607 226, 122, 229, 104, 101, 181, 181, 222, 208, 190,
1608 222, 224, 92, 146, 236, 115, 116, 119, 35, 81,
1609 106, 113, 114, 239, 120, 122, 121, 152, 240, 19,
1610 23, 30, 33, 197, 168, 226, 122, 226, 168, 123,
1611 168, 226, 168, 123, 168, 226, 168, 123, 168, 86,
1612 122, 240, 122, 226, 120, 120, 123, 35, 81, 106,
1613 239, 228, 122, 236, 236, 237, 239, 103, 231, 232,
1614 168, 120, 168, 168, 168, 168, 222, 208, 191, 222,
1615 103, 45, 231, 120, 103, 121, 238, 122, 226, 49,
1616 226, 120, 192, 123, 122, 103, 104, 224, 122, 64,
1617 44, 194, 115, 61, 123, 224, 103, 104, 24, 122,
1618 101, 174, 121, 229, 122
1619 };
1620
1621 #if ! defined (ZZ_SIZE_T) && defined (__SIZE_TYPE__)
1622 # define ZZ_SIZE_T __SIZE_TYPE__
1623 #endif
1624 #if ! defined (ZZ_SIZE_T) && defined (size_t)
1625 # define ZZ_SIZE_T size_t
1626 #endif
1627 #if ! defined (ZZ_SIZE_T)
1628 # if defined (__STDC__) || defined (__cplusplus)
1629 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
1630 # define ZZ_SIZE_T size_t
1631 # endif
1632 #endif
1633 #if ! defined (ZZ_SIZE_T)
1634 # define ZZ_SIZE_T unsigned int
1635 #endif
1636
1637 #define zz_errok (zz_errstatus = 0)
1638 #define zz_clearin (zz_char = ZZ_EMPTY)
1639 #define ZZ_EMPTY (-2)
1640 #define ZZ_EOF 0
1641
1642 #define ZZ_ACCEPT goto zz_acceptlab
1643 #define ZZ_ABORT goto zz_abortlab
1644 #define ZZ_ERROR goto zz_errorlab
1645
1646
1647 /* Like ZZ_ERROR except do call zz_error. This remains here temporarily
1648 to ease the transition to the new meaning of ZZ_ERROR, for GCC.
1649 Once GCC version 2 has supplanted version 1, this can go. */
1650
1651 #define ZZ_FAIL goto zz_errlab
1652
1653 #define ZZ_RECOVERING() (!!zz_errstatus)
1654
1655 #define ZZ_BACKUP(Token, Value) \
1656 do \
1657 if (zz_char == ZZ_EMPTY && zz_len == 1) \
1658 { \
1659 zz_char = (Token); \
1660 zz_lval = (Value); \
1661 zz_token = ZZ_TRANSLATE (zz_char); \
1662 ZZ_POPSTACK; \
1663 goto zz_backup; \
1664 } \
1665 else \
1666 { \
1667 zz_error ("syntax error: cannot back up");\
1668 ZZ_ERROR; \
1669 } \
1670 while (0)
1671
1672
1673 #define ZZ_TERROR 1
1674 #define ZZ_ERRCODE 256
1675
1676
1677 /* ZZ_LLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
1678 If N is 0, then set CURRENT to the empty location which ends
1679 the previous symbol: RHS[0] (always defined). */
1680
1681 #define ZZ_RHSLOC(Rhs, K) ((Rhs)[K])
1682 #ifndef ZZ_LLOC_DEFAULT
1683 # define ZZ_LLOC_DEFAULT(Current, Rhs, N) \
1684 do \
1685 if (N) \
1686 { \
1687 (Current).first_line = ZZ_RHSLOC (Rhs, 1).first_line; \
1688 (Current).first_column = ZZ_RHSLOC (Rhs, 1).first_column; \
1689 (Current).last_line = ZZ_RHSLOC (Rhs, N).last_line; \
1690 (Current).last_column = ZZ_RHSLOC (Rhs, N).last_column; \
1691 } \
1692 else \
1693 { \
1694 (Current).first_line = (Current).last_line = \
1695 ZZ_RHSLOC (Rhs, 0).last_line; \
1696 (Current).first_column = (Current).last_column = \
1697 ZZ_RHSLOC (Rhs, 0).last_column; \
1698 } \
1699 while (0)
1700 #endif
1701
1702
1703 /* ZZ__LOCATION_PRINT -- Print the location on the stream.
1704 This macro was not mandated originally: define only if we know
1705 we won't break user code: when these are the locations we know. */
1706
1707 #ifndef ZZ__LOCATION_PRINT
1708 # if ZZ_LTYPE_IS_TRIVIAL
1709 # define ZZ__LOCATION_PRINT(File, Loc) \
1710 fprintf (File, "%d.%d-%d.%d", \
1711 (Loc).first_line, (Loc).first_column, \
1712 (Loc).last_line, (Loc).last_column)
1713 # else
1714 # define ZZ__LOCATION_PRINT(File, Loc) ((void) 0)
1715 # endif
1716 #endif
1717
1718
1719 /* ZZ_LEX -- calling `zz_lex' with the right arguments. */
1720
1721 #ifdef ZZ_LEX_PARAM
1722 # define ZZ_LEX zz_lex (ZZ_LEX_PARAM)
1723 #else
1724 # define ZZ_LEX zz_lex ()
1725 #endif
1726
1727 /* Enable debugging if requested. */
1728 #if ZZ_DEBUG
1729
1730 # ifndef ZZ_FPRINTF
1731 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1732 # define ZZ_FPRINTF fprintf
1733 # endif
1734
1735 # define ZZ_DPRINTF(Args) \
1736 do { \
1737 if (zz_debug) \
1738 ZZ_FPRINTF Args; \
1739 } while (0)
1740
1741 # define ZZ__SYMBOL_PRINT(Title, Type, Value, Location) \
1742 do { \
1743 if (zz_debug) \
1744 { \
1745 ZZ_FPRINTF (stderr, "%s ", Title); \
1746 zz_symprint (stderr, \
1747 Type, Value); \
1748 ZZ_FPRINTF (stderr, "\n"); \
1749 } \
1750 } while (0)
1751
1752 /*------------------------------------------------------------------.
1753 | zz__stack_print -- Print the state stack from its BOTTOM up to its |
1754 | TOP (included). |
1755 `------------------------------------------------------------------*/
1756
1757 #if defined (__STDC__) || defined (__cplusplus)
1758 static void
1759 zz__stack_print (short int *bottom, short int *top)
1760 #else
1761 static void
1762 zz__stack_print (bottom, top)
1763 short int *bottom;
1764 short int *top;
1765 #endif
1766 {
1767 ZZ_FPRINTF (stderr, "Stack now");
1768 for (/* Nothing. */; bottom <= top; ++bottom)
1769 ZZ_FPRINTF (stderr, " %d", *bottom);
1770 ZZ_FPRINTF (stderr, "\n");
1771 }
1772
1773 # define ZZ__STACK_PRINT(Bottom, Top) \
1774 do { \
1775 if (zz_debug) \
1776 zz__stack_print ((Bottom), (Top)); \
1777 } while (0)
1778
1779
1780 /*------------------------------------------------.
1781 | Report that the ZZ_RULE is going to be reduced. |
1782 `------------------------------------------------*/
1783
1784 #if defined (__STDC__) || defined (__cplusplus)
1785 static void
1786 zz__reduce_print (int zz_rule)
1787 #else
1788 static void
1789 zz__reduce_print (zz_rule)
1790 int zz_rule;
1791 #endif
1792 {
1793 int zz_i;
1794 unsigned int zz_lno = zz_rline[zz_rule];
1795 ZZ_FPRINTF (stderr, "Reducing stack by rule %d (line %u), ",
1796 zz_rule - 1, zz_lno);
1797 /* Print the symbols being reduced, and their result. */
1798 for (zz_i = zz_prhs[zz_rule]; 0 <= zz_rhs[zz_i]; zz_i++)
1799 ZZ_FPRINTF (stderr, "%s ", zz_tname [zz_rhs[zz_i]]);
1800 ZZ_FPRINTF (stderr, "-> %s\n", zz_tname [zz_r1[zz_rule]]);
1801 }
1802
1803 # define ZZ__REDUCE_PRINT(Rule) \
1804 do { \
1805 if (zz_debug) \
1806 zz__reduce_print (Rule); \
1807 } while (0)
1808
1809 /* Nonzero means print parse trace. It is left uninitialized so that
1810 multiple parsers can coexist. */
1811 int zz_debug;
1812 #else /* !ZZ_DEBUG */
1813 # define ZZ_DPRINTF(Args)
1814 # define ZZ__SYMBOL_PRINT(Title, Type, Value, Location)
1815 # define ZZ__STACK_PRINT(Bottom, Top)
1816 # define ZZ__REDUCE_PRINT(Rule)
1817 #endif /* !ZZ_DEBUG */
1818
1819
1820 /* ZZ_INITDEPTH -- initial size of the parser's stacks. */
1821 #ifndef ZZ_INITDEPTH
1822 # define ZZ_INITDEPTH 200
1823 #endif
1824
1825 /* ZZ_MAXDEPTH -- maximum size the stacks can grow to (effective only
1826 if the built-in stack extension method is used).
1827
1828 Do not make this value too large; the results are undefined if
1829 SIZE_MAX < ZZ_STACK_BYTES (ZZ_MAXDEPTH)
1830 evaluated with infinite-precision integer arithmetic. */
1831
1832 #ifndef ZZ_MAXDEPTH
1833 # define ZZ_MAXDEPTH 10000
1834 #endif
1835
1836
1837
1838 #if ZZ_ERROR_VERBOSE
1839
1840 # ifndef zz_strlen
1841 # if defined (__GLIBC__) && defined (_STRING_H)
1842 # define zz_strlen strlen
1843 # else
1844 /* Return the length of ZZ_STR. */
1845 static ZZ_SIZE_T
1846 # if defined (__STDC__) || defined (__cplusplus)
1847 zz_strlen (const char *zz_str)
1848 # else
1849 zz_strlen (zz_str)
1850 const char *zz_str;
1851 # endif
1852 {
1853 register const char *zz_s = zz_str;
1854
1855 while (*zz_s++ != '\0')
1856 continue;
1857
1858 return zz_s - zz_str - 1;
1859 }
1860 # endif
1861 # endif
1862
1863 # ifndef zz_stpcpy
1864 # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
1865 # define zz_stpcpy stpcpy
1866 # else
1867 /* Copy ZZ_SRC to ZZ_DEST, returning the address of the terminating '\0' in
1868 ZZ_DEST. */
1869 static char *
1870 # if defined (__STDC__) || defined (__cplusplus)
1871 zz_stpcpy (char *zz_dest, const char *zz_src)
1872 # else
1873 zz_stpcpy (zz_dest, zz_src)
1874 char *zz_dest;
1875 const char *zz_src;
1876 # endif
1877 {
1878 register char *zz_d = zz_dest;
1879 register const char *zz_s = zz_src;
1880
1881 while ((*zz_d++ = *zz_s++) != '\0')
1882 continue;
1883
1884 return zz_d - 1;
1885 }
1886 # endif
1887 # endif
1888
1889 #endif /* !ZZ_ERROR_VERBOSE */
1890
1891
1892
1893 #if ZZ_DEBUG
1894 /*--------------------------------.
1895 | Print this symbol on ZZ_OUTPUT. |
1896 `--------------------------------*/
1897
1898 #if defined (__STDC__) || defined (__cplusplus)
1899 static void
1900 zz_symprint (FILE *zz_output, int zz_type, ZZ_STYPE *zz_valuep)
1901 #else
1902 static void
1903 zz_symprint (zz_output, zz_type, zz_valuep)
1904 FILE *zz_output;
1905 int zz_type;
1906 ZZ_STYPE *zz_valuep;
1907 #endif
1908 {
1909 /* Pacify ``unused variable'' warnings. */
1910 (void) zz_valuep;
1911
1912 if (zz_type < ZZ_NTOKENS)
1913 ZZ_FPRINTF (zz_output, "token %s (", zz_tname[zz_type]);
1914 else
1915 ZZ_FPRINTF (zz_output, "nterm %s (", zz_tname[zz_type]);
1916
1917
1918 # ifdef ZZ_PRINT
1919 if (zz_type < ZZ_NTOKENS)
1920 ZZ_PRINT (zz_output, zz_toknum[zz_type], *zz_valuep);
1921 # endif
1922 switch (zz_type)
1923 {
1924 default:
1925 break;
1926 }
1927 ZZ_FPRINTF (zz_output, ")");
1928 }
1929
1930 #endif /* ! ZZ_DEBUG */
1931 /*-----------------------------------------------.
1932 | Release the memory associated to this symbol. |
1933 `-----------------------------------------------*/
1934
1935 #if defined (__STDC__) || defined (__cplusplus)
1936 static void
1937 zz_destruct (const char *zz_msg, int zz_type, ZZ_STYPE *zz_valuep)
1938 #else
1939 static void
1940 zz_destruct (zz_msg, zz_type, zz_valuep)
1941 const char *zz_msg;
1942 int zz_type;
1943 ZZ_STYPE *zz_valuep;
1944 #endif
1945 {
1946 /* Pacify ``unused variable'' warnings. */
1947 (void) zz_valuep;
1948
1949 if (!zz_msg)
1950 zz_msg = "Deleting";
1951 ZZ__SYMBOL_PRINT (zz_msg, zz_type, zz_valuep, zz_locationp);
1952
1953 switch (zz_type)
1954 {
1955
1956 default:
1957 break;
1958 }
1959 }
1960
1961
1962 /* Prevent warnings from -Wmissing-prototypes. */
1963
1964 #ifdef ZZ_PARSE_PARAM
1965 # if defined (__STDC__) || defined (__cplusplus)
1966 int zz_parse (void *ZZ_PARSE_PARAM);
1967 # else
1968 int zz_parse ();
1969 # endif
1970 #else /* ! ZZ_PARSE_PARAM */
1971 #if defined (__STDC__) || defined (__cplusplus)
1972 int zz_parse (void);
1973 #else
1974 int zz_parse ();
1975 #endif
1976 #endif /* ! ZZ_PARSE_PARAM */
1977
1978
1979
1980 /* The look-ahead symbol. */
1981 int zz_char;
1982
1983 /* The semantic value of the look-ahead symbol. */
1984 ZZ_STYPE zz_lval;
1985
1986 /* Number of syntax errors so far. */
1987 int zz_nerrs;
1988
1989
1990
1991 /*----------.
1992 | zz_parse. |
1993 `----------*/
1994
1995 #ifdef ZZ_PARSE_PARAM
1996 # if defined (__STDC__) || defined (__cplusplus)
1997 int zz_parse (void *ZZ_PARSE_PARAM)
1998 # else
1999 int zz_parse (ZZ_PARSE_PARAM)
2000 void *ZZ_PARSE_PARAM;
2001 # endif
2002 #else /* ! ZZ_PARSE_PARAM */
2003 #if defined (__STDC__) || defined (__cplusplus)
2004 int
2005 zz_parse (void)
2006 #else
2007 int
2008 zz_parse ()
2009
2010 #endif
2011 #endif
2012 {
2013
2014 register int zz_state;
2015 register int zz_n;
2016 int zz_result;
2017 /* Number of tokens to shift before error messages enabled. */
2018 int zz_errstatus;
2019 /* Look-ahead token as an internal (translated) token number. */
2020 int zz_token = 0;
2021
2022 /* Three stacks and their tools:
2023 `zz_ss': related to states,
2024 `zz_vs': related to semantic values,
2025 `zz_ls': related to locations.
2026
2027 Refer to the stacks thru separate pointers, to allow zz_overflow
2028 to reallocate them elsewhere. */
2029
2030 /* The state stack. */
2031 short int zz_ssa[ZZ_INITDEPTH];
2032 short int *zz_ss = zz_ssa;
2033 register short int *zz_ssp;
2034
2035 /* The semantic value stack. */
2036 ZZ_STYPE zz_vsa[ZZ_INITDEPTH];
2037 ZZ_STYPE *zz_vs = zz_vsa;
2038 register ZZ_STYPE *zz_vsp;
2039
2040
2041
2042 #define ZZ_POPSTACK (zz_vsp--, zz_ssp--)
2043
2044 ZZ_SIZE_T zz_stacksize = ZZ_INITDEPTH;
2045
2046 /* The variables used to return semantic value and location from the
2047 action routines. */
2048 ZZ_STYPE zz_val;
2049
2050
2051 /* When reducing, the number of symbols on the RHS of the reduced
2052 rule. */
2053 int zz_len;
2054
2055 ZZ_DPRINTF ((stderr, "Starting parse\n"));
2056
2057 zz_state = 0;
2058 zz_errstatus = 0;
2059 zz_nerrs = 0;
2060 zz_char = ZZ_EMPTY; /* Cause a token to be read. */
2061
2062 /* Initialize stack pointers.
2063 Waste one element of value and location stack
2064 so that they stay on the same level as the state stack.
2065 The wasted elements are never initialized. */
2066
2067 zz_ssp = zz_ss;
2068 zz_vsp = zz_vs;
2069
2070
2071 zz_vsp[0] = zz_lval;
2072
2073 goto zz_setstate;
2074
2075 /*------------------------------------------------------------.
2076 | zz_newstate -- Push a new state, which is found in zz_state. |
2077 `------------------------------------------------------------*/
2078 zz_newstate:
2079 /* In all cases, when you get here, the value and location stacks
2080 have just been pushed. so pushing a state here evens the stacks.
2081 */
2082 zz_ssp++;
2083
2084 zz_setstate:
2085 *zz_ssp = zz_state;
2086
2087 if (zz_ss + zz_stacksize - 1 <= zz_ssp)
2088 {
2089 /* Get the current used size of the three stacks, in elements. */
2090 ZZ_SIZE_T zz_size = zz_ssp - zz_ss + 1;
2091
2092 #ifdef zz_overflow
2093 {
2094 /* Give user a chance to reallocate the stack. Use copies of
2095 these so that the &'s don't force the real ones into
2096 memory. */
2097 ZZ_STYPE *zz_vs1 = zz_vs;
2098 short int *zz_ss1 = zz_ss;
2099
2100
2101 /* Each stack pointer address is followed by the size of the
2102 data in use in that stack, in bytes. This used to be a
2103 conditional around just the two extra args, but that might
2104 be undefined if zz_overflow is a macro. */
2105 zz_overflow ("parser stack overflow",
2106 &zz_ss1, zz_size * sizeof (*zz_ssp),
2107 &zz_vs1, zz_size * sizeof (*zz_vsp),
2108
2109