1 #define YY_cl_ucsim_parser_h_included
4 /* A Bison++ parser, made from cmdpars.y */
6 /* with Bison++ version bison++ Version 1.21.9-1, adapted from GNU bison by coetmeur@icdc.fr
7 Maintained by Magnus Ekdahl <magnus@debian.org>
12 #line 1 "/usr/share/bison++/bison.cc"
13 /* -*-C-*- Note some compilers choke on comments on `#line' lines. */
14 /* Skeleton output parser for bison,
15 Copyright (C) 1984, 1989, 1990 Bob Corbett and Richard Stallman
17 This program is free software; you can redistribute it and/or modify
18 it under the terms of the GNU General Public License as published by
19 the Free Software Foundation; either version 1, or (at your option)
22 This program is distributed in the hope that it will be useful,
23 but WITHOUT ANY WARRANTY; without even the implied warranty of
24 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 GNU General Public License for more details.
27 You should have received a copy of the GNU General Public License
28 along with this program; if not, write to the Free Software
29 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
31 As a special exception, when this file is copied by Bison++ into a
32 Bison++ output file, you may use that output file without restriction.
33 This special exception was added by the Free Software Foundation
34 in version 1.24 of Bison, and has been in Bison++ since 1.21.9.
39 #if defined( _MSDOS ) || defined(MSDOS) || defined(__MSDOS__)
40 #define __MSDOS_AND_ALIKE
43 #if defined(_WINDOWS) && defined(_MSC_VER)
44 #define __HAVE_NO_ALLOCA
45 #define __MSDOS_AND_ALIKE
49 #if defined( __GNUC__)
50 #define alloca __builtin_alloca
52 #elif (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi)
55 #elif defined (__MSDOS_AND_ALIKE)
58 /* MS C runtime lib */
59 #define alloca _alloca
63 /* pragma must be put before any C/C++ instruction !! */
70 void *alloca (unsigned int);
72 #else /* not __cplusplus */
74 #endif /* not __cplusplus */
76 #endif /* not _AIX not MSDOS, or __TURBOC__ or _AIX, not sparc. */
77 #endif /* alloca not defined. */
87 /*#warning "For C++ its recomended to use bison++, otherwise classes won't be generated"*/
94 #error "This is a C++ header generated by bison++, please use a C++ compiler!"
101 #line 88 "/usr/share/bison++/bison.cc"
104 #include "cmdlexcl.h"
108 #define YY_cl_ucsim_parser_INHERIT : public cl_base
109 #define YY_cl_ucsim_parser_MEMBERS class cl_ucsim_lexer *lexer_object;\
110 virtual ~YY_cl_ucsim_parser_CLASS(void) { delete lexer_object; }
111 #define YY_cl_ucsim_parser_CONSTRUCTOR_PARAM \
112 class cl_ucsim_lexer *the_lexer
113 #define YY_cl_ucsim_parser_CONSTRUCTOR_CODE \
114 lexer_object= the_lexer;
119 class cl_memory *memory_object;
121 class cl_memory *memory;
125 class cl_memory *memory;
126 long mem_address, bit_address;
129 } yy_cl_ucsim_parser_stype;
130 #define YY_cl_ucsim_parser_STYPE yy_cl_ucsim_parser_stype
132 #line 88 "/usr/share/bison++/bison.cc"
133 /* %{ and %header{ and %union, during decl */
134 #define YY_cl_ucsim_parser_BISON 1
136 #ifndef YY_cl_ucsim_parser_COMPATIBILITY
138 #define YY_cl_ucsim_parser_COMPATIBILITY 1
140 #define YY_cl_ucsim_parser_COMPATIBILITY 0
144 #if YY_cl_ucsim_parser_COMPATIBILITY != 0
145 /* backward compatibility */
147 #ifndef YY_cl_ucsim_parser_LTYPE
148 #define YY_cl_ucsim_parser_LTYPE YYLTYPE
151 /* Testing alternative bison solution
153 #ifndef YY_cl_ucsim_parser_STYPE
154 #define YY_cl_ucsim_parser_STYPE YYSTYPE
158 #ifndef YY_cl_ucsim_parser_DEBUG
159 #define YY_cl_ucsim_parser_DEBUG YYDEBUG
163 /* use goto to be compatible */
164 #ifndef YY_cl_ucsim_parser_USE_GOTO
165 #define YY_cl_ucsim_parser_USE_GOTO 1
169 /* use no goto to be clean in C++ */
170 #ifndef YY_cl_ucsim_parser_USE_GOTO
171 #define YY_cl_ucsim_parser_USE_GOTO 0
174 #ifndef YY_cl_ucsim_parser_PURE
176 #line 130 "/usr/share/bison++/bison.cc"
177 #define YY_cl_ucsim_parser_PURE 1
179 #line 130 "/usr/share/bison++/bison.cc"
180 /* YY_cl_ucsim_parser_PURE */
183 /* section apres lecture def, avant lecture grammaire S2 */
185 #line 134 "/usr/share/bison++/bison.cc"
187 #line 134 "/usr/share/bison++/bison.cc"
189 #ifndef YY_cl_ucsim_parser_DEBUG
191 #line 136 "/usr/share/bison++/bison.cc"
193 #line 136 "/usr/share/bison++/bison.cc"
194 /* YY_cl_ucsim_parser_DEBUG */
198 #ifndef YY_cl_ucsim_parser_LSP_NEEDED
200 #line 141 "/usr/share/bison++/bison.cc"
202 #line 141 "/usr/share/bison++/bison.cc"
203 /* YY_cl_ucsim_parser_LSP_NEEDED*/
209 #ifdef YY_cl_ucsim_parser_LSP_NEEDED
210 #ifndef YY_cl_ucsim_parser_LTYPE
211 #ifndef BISON_YYLTYPE_ISDECLARED
212 #define BISON_YYLTYPE_ISDECLARED
226 #define YY_cl_ucsim_parser_LTYPE yyltype
230 /* We used to use `unsigned long' as YY_cl_ucsim_parser_STYPE on MSDOS,
231 but it seems better to be consistent.
232 Most programs should declare their own type anyway. */
234 #ifndef YY_cl_ucsim_parser_STYPE
235 #define YY_cl_ucsim_parser_STYPE int
237 /* DEFAULT MISCELANEOUS */
238 #ifndef YY_cl_ucsim_parser_PARSE
239 #define YY_cl_ucsim_parser_PARSE yyparse
241 #ifndef YY_cl_ucsim_parser_LEX
242 #define YY_cl_ucsim_parser_LEX yylex
244 #ifndef YY_cl_ucsim_parser_LVAL
245 #define YY_cl_ucsim_parser_LVAL yylval
247 #ifndef YY_cl_ucsim_parser_LLOC
248 #define YY_cl_ucsim_parser_LLOC yylloc
250 #ifndef YY_cl_ucsim_parser_CHAR
251 #define YY_cl_ucsim_parser_CHAR yychar
253 #ifndef YY_cl_ucsim_parser_NERRS
254 #define YY_cl_ucsim_parser_NERRS yynerrs
256 #ifndef YY_cl_ucsim_parser_DEBUG_FLAG
257 #define YY_cl_ucsim_parser_DEBUG_FLAG yydebug
259 #ifndef YY_cl_ucsim_parser_ERROR
260 #define YY_cl_ucsim_parser_ERROR yyerror
263 #ifndef YY_cl_ucsim_parser_PARSE_PARAM
266 #define YY_cl_ucsim_parser_PARSE_PARAM void* YYPARSE_PARAM
270 #define YY_cl_ucsim_parser_PARSE_PARAM
275 #ifndef YY_cl_ucsim_parser_PARSE_PARAM
276 #define YY_cl_ucsim_parser_PARSE_PARAM void
280 #if YY_cl_ucsim_parser_COMPATIBILITY != 0
281 /* backward compatibility */
282 #ifdef YY_cl_ucsim_parser_LTYPE
284 #define YYLTYPE YY_cl_ucsim_parser_LTYPE
286 /* WARNING obsolete !!! user defined YYLTYPE not reported into generated header */
290 /* Removed due to bison compabilityproblems
292 /#define YYSTYPE YY_cl_ucsim_parser_STYPE
294 /* WARNING obsolete !!! user defined YYSTYPE not reported into generated header */
297 #ifdef YY_cl_ucsim_parser_PURE
299 # define YYPURE YY_cl_ucsim_parser_PURE
303 #ifdef YY_cl_ucsim_parser_DEBUG
305 # define YYDEBUG YY_cl_ucsim_parser_DEBUG
309 #ifndef YY_cl_ucsim_parser_ERROR_VERBOSE
310 #ifdef YYERROR_VERBOSE
311 #define YY_cl_ucsim_parser_ERROR_VERBOSE YYERROR_VERBOSE
315 #ifndef YY_cl_ucsim_parser_LSP_NEEDED
317 # define YY_cl_ucsim_parser_LSP_NEEDED YYLSP_NEEDED
326 #line 263 "/usr/share/bison++/bison.cc"
327 #define PTOK_PLUS 258
328 #define PTOK_MINUS 259
329 #define PTOK_ASTERIX 260
330 #define PTOK_SLASH 261
331 #define PTOK_EQUAL 262
332 #define PTOK_LEFT_PAREN 263
333 #define PTOK_RIGHT_PAREN 264
334 #define PTOK_LEFT_BRACKET 265
335 #define PTOK_RIGHT_BRACKET 266
337 #define PTOK_AMPERSAND 268
338 #define PTOK_MEMORY_OBJECT 269
339 #define PTOK_MEMORY 270
340 #define PTOK_NUMBER 271
342 #define UNARYMINUS 273
345 #line 263 "/usr/share/bison++/bison.cc"
346 /* #defines tokens */
349 #ifndef YY_cl_ucsim_parser_CLASS
350 #define YY_cl_ucsim_parser_CLASS cl_ucsim_parser
352 #ifndef YY_cl_ucsim_parser_INHERIT
353 #define YY_cl_ucsim_parser_INHERIT
355 #ifndef YY_cl_ucsim_parser_MEMBERS
356 #define YY_cl_ucsim_parser_MEMBERS
358 #ifndef YY_cl_ucsim_parser_LEX_BODY
359 #define YY_cl_ucsim_parser_LEX_BODY
361 #ifndef YY_cl_ucsim_parser_ERROR_BODY
362 #define YY_cl_ucsim_parser_ERROR_BODY
364 #ifndef YY_cl_ucsim_parser_CONSTRUCTOR_PARAM
365 #define YY_cl_ucsim_parser_CONSTRUCTOR_PARAM
367 #ifndef YY_cl_ucsim_parser_CONSTRUCTOR_CODE
368 #define YY_cl_ucsim_parser_CONSTRUCTOR_CODE
370 #ifndef YY_cl_ucsim_parser_CONSTRUCTOR_INIT
371 #define YY_cl_ucsim_parser_CONSTRUCTOR_INIT
373 /* choose between enum and const */
374 #ifndef YY_cl_ucsim_parser_USE_CONST_TOKEN
375 #define YY_cl_ucsim_parser_USE_CONST_TOKEN 0
376 /* yes enum is more compatible with flex, */
377 /* so by default we use it */
379 #if YY_cl_ucsim_parser_USE_CONST_TOKEN != 0
380 #ifndef YY_cl_ucsim_parser_ENUM_TOKEN
381 #define YY_cl_ucsim_parser_ENUM_TOKEN yy_cl_ucsim_parser_enum_token
385 class YY_cl_ucsim_parser_CLASS YY_cl_ucsim_parser_INHERIT
388 #if YY_cl_ucsim_parser_USE_CONST_TOKEN != 0
389 /* static const int token ... */
391 #line 307 "/usr/share/bison++/bison.cc"
392 static const int PTOK_PLUS;
393 static const int PTOK_MINUS;
394 static const int PTOK_ASTERIX;
395 static const int PTOK_SLASH;
396 static const int PTOK_EQUAL;
397 static const int PTOK_LEFT_PAREN;
398 static const int PTOK_RIGHT_PAREN;
399 static const int PTOK_LEFT_BRACKET;
400 static const int PTOK_RIGHT_BRACKET;
401 static const int PTOK_DOT;
402 static const int PTOK_AMPERSAND;
403 static const int PTOK_MEMORY_OBJECT;
404 static const int PTOK_MEMORY;
405 static const int PTOK_NUMBER;
406 static const int PTOK_BIT;
407 static const int UNARYMINUS;
410 #line 307 "/usr/share/bison++/bison.cc"
413 enum YY_cl_ucsim_parser_ENUM_TOKEN { YY_cl_ucsim_parser_NULL_TOKEN=0
415 #line 310 "/usr/share/bison++/bison.cc"
422 ,PTOK_RIGHT_PAREN=264
423 ,PTOK_LEFT_BRACKET=265
424 ,PTOK_RIGHT_BRACKET=266
427 ,PTOK_MEMORY_OBJECT=269
434 #line 310 "/usr/share/bison++/bison.cc"
436 }; /* end of enum declaration */
439 int YY_cl_ucsim_parser_PARSE (YY_cl_ucsim_parser_PARSE_PARAM);
440 virtual void YY_cl_ucsim_parser_ERROR(char *msg) YY_cl_ucsim_parser_ERROR_BODY;
441 #ifdef YY_cl_ucsim_parser_PURE
442 #ifdef YY_cl_ucsim_parser_LSP_NEEDED
443 virtual int YY_cl_ucsim_parser_LEX (YY_cl_ucsim_parser_STYPE *YY_cl_ucsim_parser_LVAL,YY_cl_ucsim_parser_LTYPE *YY_cl_ucsim_parser_LLOC) YY_cl_ucsim_parser_LEX_BODY;
445 virtual int YY_cl_ucsim_parser_LEX (YY_cl_ucsim_parser_STYPE *YY_cl_ucsim_parser_LVAL) YY_cl_ucsim_parser_LEX_BODY;
448 virtual int YY_cl_ucsim_parser_LEX() YY_cl_ucsim_parser_LEX_BODY;
449 YY_cl_ucsim_parser_STYPE YY_cl_ucsim_parser_LVAL;
450 #ifdef YY_cl_ucsim_parser_LSP_NEEDED
451 YY_cl_ucsim_parser_LTYPE YY_cl_ucsim_parser_LLOC;
453 int YY_cl_ucsim_parser_NERRS;
454 int YY_cl_ucsim_parser_CHAR;
456 #if YY_cl_ucsim_parser_DEBUG != 0
457 int YY_cl_ucsim_parser_DEBUG_FLAG; /* nonzero means print parse trace */
460 YY_cl_ucsim_parser_CLASS(YY_cl_ucsim_parser_CONSTRUCTOR_PARAM);
462 YY_cl_ucsim_parser_MEMBERS
464 /* other declare folow */
465 #if YY_cl_ucsim_parser_USE_CONST_TOKEN != 0
467 #line 341 "/usr/share/bison++/bison.cc"
468 const int YY_cl_ucsim_parser_CLASS::PTOK_PLUS=258;
469 const int YY_cl_ucsim_parser_CLASS::PTOK_MINUS=259;
470 const int YY_cl_ucsim_parser_CLASS::PTOK_ASTERIX=260;
471 const int YY_cl_ucsim_parser_CLASS::PTOK_SLASH=261;
472 const int YY_cl_ucsim_parser_CLASS::PTOK_EQUAL=262;
473 const int YY_cl_ucsim_parser_CLASS::PTOK_LEFT_PAREN=263;
474 const int YY_cl_ucsim_parser_CLASS::PTOK_RIGHT_PAREN=264;
475 const int YY_cl_ucsim_parser_CLASS::PTOK_LEFT_BRACKET=265;
476 const int YY_cl_ucsim_parser_CLASS::PTOK_RIGHT_BRACKET=266;
477 const int YY_cl_ucsim_parser_CLASS::PTOK_DOT=267;
478 const int YY_cl_ucsim_parser_CLASS::PTOK_AMPERSAND=268;
479 const int YY_cl_ucsim_parser_CLASS::PTOK_MEMORY_OBJECT=269;
480 const int YY_cl_ucsim_parser_CLASS::PTOK_MEMORY=270;
481 const int YY_cl_ucsim_parser_CLASS::PTOK_NUMBER=271;
482 const int YY_cl_ucsim_parser_CLASS::PTOK_BIT=272;
483 const int YY_cl_ucsim_parser_CLASS::UNARYMINUS=273;
486 #line 341 "/usr/share/bison++/bison.cc"
487 /* const YY_cl_ucsim_parser_CLASS::token */
490 YY_cl_ucsim_parser_CLASS::YY_cl_ucsim_parser_CLASS(YY_cl_ucsim_parser_CONSTRUCTOR_PARAM) YY_cl_ucsim_parser_CONSTRUCTOR_INIT
492 #if YY_cl_ucsim_parser_DEBUG != 0
493 YY_cl_ucsim_parser_DEBUG_FLAG=0;
495 YY_cl_ucsim_parser_CONSTRUCTOR_CODE;
499 #line 352 "/usr/share/bison++/bison.cc"
503 #define YYFLAG -32768
506 #define YYTRANSLATE(x) ((unsigned)(x) <= 273 ? yytranslate[x] : 25)
508 static const char yytranslate[] = { 0,
509 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
510 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
511 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
512 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
513 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
514 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
515 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
516 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
517 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
518 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
519 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
520 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
521 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
522 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
523 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
524 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
525 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
526 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
527 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
528 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
529 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
530 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
531 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
532 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
533 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
534 2, 2, 2, 2, 2, 1, 2, 3, 4, 5,
535 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
539 #if YY_cl_ucsim_parser_DEBUG != 0
540 static const short yyprhs[] = { 0,
541 0, 2, 6, 10, 12, 16, 20, 24, 28, 31,
542 33, 37, 39, 41, 43, 46, 49, 51, 56, 58
545 static const short yyrhs[] = { 21,
546 0, 23, 7, 21, 0, 24, 7, 21, 0, 20,
547 0, 21, 3, 21, 0, 21, 4, 21, 0, 21,
548 5, 21, 0, 21, 6, 21, 0, 4, 21, 0,
549 22, 0, 8, 21, 9, 0, 16, 0, 23, 0,
550 24, 0, 13, 23, 0, 13, 24, 0, 15, 0,
551 14, 10, 21, 11, 0, 17, 0, 23, 12, 21,
557 #if (YY_cl_ucsim_parser_DEBUG != 0) || defined(YY_cl_ucsim_parser_ERROR_VERBOSE)
558 static const short yyrline[] = { 0,
559 59, 63, 69, 86, 88, 89, 90, 91, 98, 99,
560 100, 101, 102, 103, 106, 108, 119, 121, 127, 129
563 static const char * const yytname[] = { "$","error","$illegal.","PTOK_PLUS",
564 "PTOK_MINUS","PTOK_ASTERIX","PTOK_SLASH","PTOK_EQUAL","PTOK_LEFT_PAREN","PTOK_RIGHT_PAREN",
565 "PTOK_LEFT_BRACKET","PTOK_RIGHT_BRACKET","PTOK_DOT","PTOK_AMPERSAND","PTOK_MEMORY_OBJECT",
566 "PTOK_MEMORY","PTOK_NUMBER","PTOK_BIT","UNARYMINUS","ucsim_grammar","assignment",
567 "expression","address_of_expression","memory","bit",""
571 static const short yyr1[] = { 0,
572 19, 20, 20, 21, 21, 21, 21, 21, 21, 21,
573 21, 21, 21, 21, 22, 22, 23, 23, 24, 24
576 static const short yyr2[] = { 0,
577 1, 3, 3, 1, 3, 3, 3, 3, 2, 1,
578 3, 1, 1, 1, 2, 2, 1, 4, 1, 3
581 static const short yydefact[] = { 0,
582 0, 0, 0, 0, 17, 12, 19, 4, 1, 10,
583 13, 14, 9, 0, 15, 16, 0, 0, 0, 0,
584 0, 0, 0, 0, 11, 0, 5, 6, 7, 8,
585 2, 20, 3, 18, 0, 0, 0
588 static const short yydefgoto[] = { 35,
592 static const short yypact[] = { -2,
593 -2, -2, -10, 23,-32768,-32768,-32768,-32768, 32,-32768,
594 -4, 33,-32768, 25, 27,-32768, -2, -2, -2, -2,
595 -2, -2, -2, -2,-32768, 21, 4, 4,-32768,-32768,
596 32, 32, 32,-32768, 41, 42,-32768
599 static const short yypgoto[] = {-32768,
600 -32768, -1,-32768, 40, 43
607 static const short yytable[] = { 13,
608 14, 1, 22, 4, 5, 2, 7, 23, 20, 21,
609 3, 4, 5, 6, 7, 26, 27, 28, 29, 30,
610 31, 32, 33, 18, 19, 20, 21, 18, 19, 20,
611 21, 34, 17, 25, 18, 19, 20, 21, 23, 24,
615 static const short yycheck[] = { 1,
616 2, 4, 7, 14, 15, 8, 17, 12, 5, 6,
617 13, 14, 15, 16, 17, 17, 18, 19, 20, 21,
618 22, 23, 24, 3, 4, 5, 6, 3, 4, 5,
619 6, 11, 10, 9, 3, 4, 5, 6, 12, 7,
623 #line 352 "/usr/share/bison++/bison.cc"
624 /* fattrs + tables */
626 /* parser code folow */
629 /* This is the parser code that is written into each bison parser
630 when the %semantic_parser declaration is not specified in the grammar.
631 It was written by Richard Stallman by simplifying the hairy parser
632 used when %semantic_parser is specified. */
634 /* Note: dollar marks section change
635 the next is replaced by the list of actions, each action
636 as one case of the switch. */
638 #if YY_cl_ucsim_parser_USE_GOTO != 0
640 SUPRESSION OF GOTO : on some C++ compiler (sun c++)
641 the goto is strictly forbidden if any constructor/destructor
642 is used in the whole function (very stupid isn't it ?)
643 so goto are to be replaced with a 'while/switch/case construct'
644 here are the macro to keep some apparent compatibility
646 #define YYGOTO(lb) {yy_gotostate=lb;continue;}
647 #define YYBEGINGOTO enum yy_labels yy_gotostate=yygotostart; \
648 for(;;) switch(yy_gotostate) { case yygotostart: {
649 #define YYLABEL(lb) } case lb: {
650 #define YYENDGOTO } }
651 #define YYBEGINDECLARELABEL enum yy_labels {yygotostart
652 #define YYDECLARELABEL(lb) ,lb
653 #define YYENDDECLARELABEL };
655 /* macro to keep goto */
656 #define YYGOTO(lb) goto lb
658 #define YYLABEL(lb) lb:
660 #define YYBEGINDECLARELABEL
661 #define YYDECLARELABEL(lb)
662 #define YYENDDECLARELABEL
664 /* LABEL DECLARATION */
666 YYDECLARELABEL(yynewstate)
667 YYDECLARELABEL(yybackup)
668 /* YYDECLARELABEL(yyresume) */
669 YYDECLARELABEL(yydefault)
670 YYDECLARELABEL(yyreduce)
671 YYDECLARELABEL(yyerrlab) /* here on detecting error */
672 YYDECLARELABEL(yyerrlab1) /* here on error raised explicitly by an action */
673 YYDECLARELABEL(yyerrdefault) /* current state does not do anything special for the error token. */
674 YYDECLARELABEL(yyerrpop) /* pop the current state because it cannot handle the error token */
675 YYDECLARELABEL(yyerrhandle)
677 /* ALLOCA SIMULATION */
678 /* __HAVE_NO_ALLOCA */
679 #ifdef __HAVE_NO_ALLOCA
680 int __alloca_free_ptr(char *ptr,char *ref)
681 {if(ptr!=ref) free(ptr);
684 #define __ALLOCA_alloca(size) malloc(size)
685 #define __ALLOCA_free(ptr,ref) __alloca_free_ptr((char *)ptr,(char *)ref)
687 #ifdef YY_cl_ucsim_parser_LSP_NEEDED
688 #define __ALLOCA_return(num) \
689 do { return( __ALLOCA_free(yyss,yyssa)+\
690 __ALLOCA_free(yyvs,yyvsa)+\
691 __ALLOCA_free(yyls,yylsa)+\
694 #define __ALLOCA_return(num) \
695 do { return( __ALLOCA_free(yyss,yyssa)+\
696 __ALLOCA_free(yyvs,yyvsa)+\
700 #define __ALLOCA_return(num) do { return(num); } while(0)
701 #define __ALLOCA_alloca(size) alloca(size)
702 #define __ALLOCA_free(ptr,ref)
705 /* ENDALLOCA SIMULATION */
707 #define yyerrok (yyerrstatus = 0)
708 #define yyclearin (YY_cl_ucsim_parser_CHAR = YYEMPTY)
711 #define YYACCEPT __ALLOCA_return(0)
712 #define YYABORT __ALLOCA_return(1)
713 #define YYERROR YYGOTO(yyerrlab1)
714 /* Like YYERROR except do call yyerror.
715 This remains here temporarily to ease the
716 transition to the new meaning of YYERROR, for GCC.
717 Once GCC version 2 has supplanted version 1, this can go. */
718 #define YYFAIL YYGOTO(yyerrlab)
719 #define YYRECOVERING() (!!yyerrstatus)
720 #define YYBACKUP(token, value) \
722 if (YY_cl_ucsim_parser_CHAR == YYEMPTY && yylen == 1) \
723 { YY_cl_ucsim_parser_CHAR = (token), YY_cl_ucsim_parser_LVAL = (value); \
724 yychar1 = YYTRANSLATE (YY_cl_ucsim_parser_CHAR); \
729 { YY_cl_ucsim_parser_ERROR ("syntax error: cannot back up"); YYERROR; } \
733 #define YYERRCODE 256
735 #ifndef YY_cl_ucsim_parser_PURE
737 #define YYLEX YY_cl_ucsim_parser_LEX()
739 /* If nonreentrant, and not class , generate the variables here */
740 int YY_cl_ucsim_parser_CHAR; /* the lookahead symbol */
741 YY_cl_ucsim_parser_STYPE YY_cl_ucsim_parser_LVAL; /* the semantic value of the */
742 /* lookahead symbol */
743 int YY_cl_ucsim_parser_NERRS; /* number of parse errors so far */
744 #ifdef YY_cl_ucsim_parser_LSP_NEEDED
745 YY_cl_ucsim_parser_LTYPE YY_cl_ucsim_parser_LLOC; /* location data for the lookahead */
753 #ifdef YY_cl_ucsim_parser_LSP_NEEDED
754 #define YYLEX YY_cl_ucsim_parser_LEX(&YY_cl_ucsim_parser_LVAL, &YY_cl_ucsim_parser_LLOC)
756 #define YYLEX YY_cl_ucsim_parser_LEX(&YY_cl_ucsim_parser_LVAL)
760 #if YY_cl_ucsim_parser_DEBUG != 0
761 int YY_cl_ucsim_parser_DEBUG_FLAG; /* nonzero means print parse trace */
762 /* Since this is uninitialized, it does not stop multiple parsers
769 /* YYINITDEPTH indicates the initial size of the parser's stacks */
772 #define YYINITDEPTH 200
775 /* YYMAXDEPTH is the maximum size the stacks can grow to
776 (effective only if the built-in stack extension method is used). */
783 #define YYMAXDEPTH 10000
787 #if __GNUC__ > 1 /* GNU C and GNU C++ define this. */
788 #define __yy_bcopy(FROM,TO,COUNT) __builtin_memcpy(TO,FROM,COUNT)
789 #else /* not GNU C or C++ */
791 /* This is the most reliable way to avoid incompatibilities
792 in available built-in functions on various systems. */
795 static void __yy_bcopy (char *from, char *to, int count)
798 static void __yy_bcopy (char *from, char *to, int count)
800 static void __yy_bcopy (from, to, count)
807 register char *f = from;
808 register char *t = to;
809 register int i = count;
819 YY_cl_ucsim_parser_CLASS::
821 YY_cl_ucsim_parser_PARSE(YY_cl_ucsim_parser_PARSE_PARAM)
825 /* parameter definition without protypes */
826 YY_cl_ucsim_parser_PARSE_PARAM_DEF
831 register int yystate;
833 register short *yyssp;
834 register YY_cl_ucsim_parser_STYPE *yyvsp;
835 int yyerrstatus; /* number of tokens to shift before error messages enabled */
836 int yychar1=0; /* lookahead token as an internal (translated) token number */
838 short yyssa[YYINITDEPTH]; /* the state stack */
839 YY_cl_ucsim_parser_STYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */
841 short *yyss = yyssa; /* refer to the stacks thru separate pointers */
842 YY_cl_ucsim_parser_STYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */
844 #ifdef YY_cl_ucsim_parser_LSP_NEEDED
845 YY_cl_ucsim_parser_LTYPE yylsa[YYINITDEPTH]; /* the location stack */
846 YY_cl_ucsim_parser_LTYPE *yyls = yylsa;
847 YY_cl_ucsim_parser_LTYPE *yylsp;
849 #define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
851 #define YYPOPSTACK (yyvsp--, yyssp--)
854 int yystacksize = YYINITDEPTH;
856 #ifdef YY_cl_ucsim_parser_PURE
857 int YY_cl_ucsim_parser_CHAR;
858 YY_cl_ucsim_parser_STYPE YY_cl_ucsim_parser_LVAL;
859 int YY_cl_ucsim_parser_NERRS;
860 #ifdef YY_cl_ucsim_parser_LSP_NEEDED
861 YY_cl_ucsim_parser_LTYPE YY_cl_ucsim_parser_LLOC;
865 YY_cl_ucsim_parser_STYPE yyval; /* the variable used to return */
866 /* semantic values from the action */
870 /* start loop, in which YYGOTO may be used. */
873 #if YY_cl_ucsim_parser_DEBUG != 0
874 if (YY_cl_ucsim_parser_DEBUG_FLAG)
875 fprintf(stderr, "Starting parse\n");
879 YY_cl_ucsim_parser_NERRS = 0;
880 YY_cl_ucsim_parser_CHAR = YYEMPTY; /* Cause a token to be read. */
882 /* Initialize stack pointers.
883 Waste one element of value and location stack
884 so that they stay on the same level as the state stack.
885 The wasted elements are never initialized. */
889 #ifdef YY_cl_ucsim_parser_LSP_NEEDED
893 /* Push a new state, which is found in yystate . */
894 /* In all cases, when you get here, the value and location stacks
895 have just been pushed. so pushing a state here evens the stacks. */
900 if (yyssp >= yyss + yystacksize - 1)
902 /* Give user a chance to reallocate the stack */
903 /* Use copies of these so that the &'s don't force the real ones into memory. */
904 YY_cl_ucsim_parser_STYPE *yyvs1 = yyvs;
906 #ifdef YY_cl_ucsim_parser_LSP_NEEDED
907 YY_cl_ucsim_parser_LTYPE *yyls1 = yyls;
910 /* Get the current used size of the three stacks, in elements. */
911 int size = yyssp - yyss + 1;
914 /* Each stack pointer address is followed by the size of
915 the data in use in that stack, in bytes. */
916 #ifdef YY_cl_ucsim_parser_LSP_NEEDED
917 /* This used to be a conditional around just the two extra args,
918 but that might be undefined if yyoverflow is a macro. */
919 yyoverflow("parser stack overflow",
920 &yyss1, size * sizeof (*yyssp),
921 &yyvs1, size * sizeof (*yyvsp),
922 &yyls1, size * sizeof (*yylsp),
925 yyoverflow("parser stack overflow",
926 &yyss1, size * sizeof (*yyssp),
927 &yyvs1, size * sizeof (*yyvsp),
931 yyss = yyss1; yyvs = yyvs1;
932 #ifdef YY_cl_ucsim_parser_LSP_NEEDED
935 #else /* no yyoverflow */
936 /* Extend the stack our own way. */
937 if (yystacksize >= YYMAXDEPTH)
939 YY_cl_ucsim_parser_ERROR("parser stack overflow");
943 if (yystacksize > YYMAXDEPTH)
944 yystacksize = YYMAXDEPTH;
945 yyss = (short *) __ALLOCA_alloca (yystacksize * sizeof (*yyssp));
946 __yy_bcopy ((char *)yyss1, (char *)yyss, size * sizeof (*yyssp));
947 __ALLOCA_free(yyss1,yyssa);
948 yyvs = (YY_cl_ucsim_parser_STYPE *) __ALLOCA_alloca (yystacksize * sizeof (*yyvsp));
949 __yy_bcopy ((char *)yyvs1, (char *)yyvs, size * sizeof (*yyvsp));
950 __ALLOCA_free(yyvs1,yyvsa);
951 #ifdef YY_cl_ucsim_parser_LSP_NEEDED
952 yyls = (YY_cl_ucsim_parser_LTYPE *) __ALLOCA_alloca (yystacksize * sizeof (*yylsp));
953 __yy_bcopy ((char *)yyls1, (char *)yyls, size * sizeof (*yylsp));
954 __ALLOCA_free(yyls1,yylsa);
956 #endif /* no yyoverflow */
958 yyssp = yyss + size - 1;
959 yyvsp = yyvs + size - 1;
960 #ifdef YY_cl_ucsim_parser_LSP_NEEDED
961 yylsp = yyls + size - 1;
964 #if YY_cl_ucsim_parser_DEBUG != 0
965 if (YY_cl_ucsim_parser_DEBUG_FLAG)
966 fprintf(stderr, "Stack size increased to %d\n", yystacksize);
969 if (yyssp >= yyss + yystacksize - 1)
973 #if YY_cl_ucsim_parser_DEBUG != 0
974 if (YY_cl_ucsim_parser_DEBUG_FLAG)
975 fprintf(stderr, "Entering state %d\n", yystate);
981 /* Do appropriate processing given the current state. */
982 /* Read a lookahead token if we need one and don't already have one. */
983 /* YYLABEL(yyresume) */
985 /* First try to decide what to do without reference to lookahead token. */
987 yyn = yypact[yystate];
991 /* Not known => get a lookahead token if don't already have one. */
993 /* yychar is either YYEMPTY or YYEOF
994 or a valid token in external form. */
996 if (YY_cl_ucsim_parser_CHAR == YYEMPTY)
998 #if YY_cl_ucsim_parser_DEBUG != 0
999 if (YY_cl_ucsim_parser_DEBUG_FLAG)
1000 fprintf(stderr, "Reading a token: ");
1002 YY_cl_ucsim_parser_CHAR = YYLEX;
1005 /* Convert token to internal form (in yychar1) for indexing tables with */
1007 if (YY_cl_ucsim_parser_CHAR <= 0) /* This means end of input. */
1010 YY_cl_ucsim_parser_CHAR = YYEOF; /* Don't call YYLEX any more */
1012 #if YY_cl_ucsim_parser_DEBUG != 0
1013 if (YY_cl_ucsim_parser_DEBUG_FLAG)
1014 fprintf(stderr, "Now at end of input.\n");
1019 yychar1 = YYTRANSLATE(YY_cl_ucsim_parser_CHAR);
1021 #if YY_cl_ucsim_parser_DEBUG != 0
1022 if (YY_cl_ucsim_parser_DEBUG_FLAG)
1024 fprintf (stderr, "Next token is %d (%s", YY_cl_ucsim_parser_CHAR, yytname[yychar1]);
1025 /* Give the individual parser a way to print the precise meaning
1026 of a token, for further debugging info. */
1028 YYPRINT (stderr, YY_cl_ucsim_parser_CHAR, YY_cl_ucsim_parser_LVAL);
1030 fprintf (stderr, ")\n");
1036 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
1041 /* yyn is what to do for this token type in this state.
1042 Negative => reduce, -yyn is rule number.
1043 Positive => shift, yyn is new state.
1044 New state is final state => don't bother to shift,
1045 just return success.
1046 0, or most negative number => error. */
1061 /* Shift the lookahead token. */
1063 #if YY_cl_ucsim_parser_DEBUG != 0
1064 if (YY_cl_ucsim_parser_DEBUG_FLAG)
1065 fprintf(stderr, "Shifting token %d (%s), ", YY_cl_ucsim_parser_CHAR, yytname[yychar1]);
1068 /* Discard the token being shifted unless it is eof. */
1069 if (YY_cl_ucsim_parser_CHAR != YYEOF)
1070 YY_cl_ucsim_parser_CHAR = YYEMPTY;
1072 *++yyvsp = YY_cl_ucsim_parser_LVAL;
1073 #ifdef YY_cl_ucsim_parser_LSP_NEEDED
1074 *++yylsp = YY_cl_ucsim_parser_LLOC;
1077 /* count tokens shifted since error; after three, turn off error status. */
1078 if (yyerrstatus) yyerrstatus--;
1083 /* Do the default action for the current state. */
1086 yyn = yydefact[yystate];
1090 /* Do a reduction. yyn is the number of a rule to reduce with. */
1094 yyval = yyvsp[1-yylen]; /* implement default value of the action */
1096 #if YY_cl_ucsim_parser_DEBUG != 0
1097 if (YY_cl_ucsim_parser_DEBUG_FLAG)
1101 fprintf (stderr, "Reducing via rule %d (line %d), ",
1104 /* Print the symbols being reduced, and their result. */
1105 for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
1106 fprintf (stderr, "%s ", yytname[yyrhs[i]]);
1107 fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
1112 #line 839 "/usr/share/bison++/bison.cc"
1117 #line 60 "cmdpars.y"
1118 { application->dd_printf("%d\n", yyvsp[0].number); ;
1121 #line 65 "cmdpars.y"
1123 yyvsp[-2].memory.memory->write(yyvsp[-2].memory.address, yyvsp[0].number);
1124 yyval.number= yyvsp[0].number;
1128 #line 70 "cmdpars.y"
1130 if (yyvsp[0].number)
1132 yyvsp[-2].bit.memory->write(yyvsp[-2].bit.mem_address,
1133 yyvsp[-2].bit.memory->read(yyvsp[-2].bit.mem_address) | yyvsp[-2].bit.mask);
1138 yyvsp[-2].bit.memory->write(yyvsp[-2].bit.mem_address,
1139 yyvsp[-2].bit.memory->read(yyvsp[-2].bit.mem_address) & ~(yyvsp[-2].bit.mask));
1145 #line 87 "cmdpars.y"
1146 { yyval.number= yyvsp[0].number; ;
1149 #line 88 "cmdpars.y"
1150 { yyval.number= yyvsp[-2].number + yyvsp[0].number; ;
1153 #line 89 "cmdpars.y"
1154 { yyval.number= yyvsp[-2].number - yyvsp[0].number; ;
1157 #line 90 "cmdpars.y"
1158 { yyval.number= yyvsp[-2].number * yyvsp[0].number; ;
1161 #line 92 "cmdpars.y"
1163 if (yyvsp[0].number == 0)
1164 yyerror("Divide by zero");
1166 yyval.number= yyvsp[-2].number / yyvsp[0].number;
1170 #line 98 "cmdpars.y"
1171 { yyval.number= -yyvsp[0].number; ;
1174 #line 99 "cmdpars.y"
1175 { yyval.number= yyvsp[0].number; ;
1178 #line 100 "cmdpars.y"
1179 { yyval.number= yyvsp[-1].number; ;
1182 #line 101 "cmdpars.y"
1183 { yyval.number= yyvsp[0].number; ;
1186 #line 102 "cmdpars.y"
1187 { yyval.number= yyvsp[0].memory.memory->read(yyvsp[0].memory.address); ;
1190 #line 103 "cmdpars.y"
1191 { yyval.number= (yyvsp[0].bit.memory->read(yyvsp[0].bit.mem_address) & yyvsp[0].bit.mask)?1:0; ;
1194 #line 107 "cmdpars.y"
1195 { yyval.number= yyvsp[0].memory.address; ;
1198 #line 109 "cmdpars.y"
1200 yyval.number= yyvsp[0].bit.bit_address;
1201 if (yyval.number < 0)
1203 yyerror("Bit has no address.");
1209 #line 122 "cmdpars.y"
1211 yyval.memory.memory= yyvsp[-3].memory_object;
1212 yyval.memory.address= yyvsp[-1].number;
1216 #line 130 "cmdpars.y"
1218 yyval.bit.memory= yyvsp[-2].memory.memory;
1219 yyval.bit.mem_address= yyvsp[-2].memory.address;
1220 yyval.bit.mask= 1 << yyvsp[0].number;
1221 yyval.bit.bit_address= -1;
1222 class cl_uc *uc= application->get_uc();
1224 yyval.bit.bit_address= uc->bit_address(yyvsp[-2].memory.memory, yyvsp[-2].memory.address, yyvsp[0].number);
1229 #line 839 "/usr/share/bison++/bison.cc"
1230 /* the action file gets copied in in place of this dollarsign */
1233 #ifdef YY_cl_ucsim_parser_LSP_NEEDED
1237 #if YY_cl_ucsim_parser_DEBUG != 0
1238 if (YY_cl_ucsim_parser_DEBUG_FLAG)
1240 short *ssp1 = yyss - 1;
1241 fprintf (stderr, "state stack now");
1242 while (ssp1 != yyssp)
1243 fprintf (stderr, " %d", *++ssp1);
1244 fprintf (stderr, "\n");
1250 #ifdef YY_cl_ucsim_parser_LSP_NEEDED
1254 yylsp->first_line = YY_cl_ucsim_parser_LLOC.first_line;
1255 yylsp->first_column = YY_cl_ucsim_parser_LLOC.first_column;
1256 yylsp->last_line = (yylsp-1)->last_line;
1257 yylsp->last_column = (yylsp-1)->last_column;
1262 yylsp->last_line = (yylsp+yylen-1)->last_line;
1263 yylsp->last_column = (yylsp+yylen-1)->last_column;
1267 /* Now "shift" the result of the reduction.
1268 Determine what state that goes to,
1269 based on the state we popped back to
1270 and the rule number reduced by. */
1274 yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
1275 if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1276 yystate = yytable[yystate];
1278 yystate = yydefgoto[yyn - YYNTBASE];
1282 YYLABEL(yyerrlab) /* here on detecting error */
1285 /* If not already recovering from an error, report this error. */
1287 ++YY_cl_ucsim_parser_NERRS;
1289 #ifdef YY_cl_ucsim_parser_ERROR_VERBOSE
1290 yyn = yypact[yystate];
1292 if (yyn > YYFLAG && yyn < YYLAST)
1299 /* Start X at -yyn if nec to avoid negative indexes in yycheck. */
1300 for (x = (yyn < 0 ? -yyn : 0);
1301 x < (sizeof(yytname) / sizeof(char *)); x++)
1302 if (yycheck[x + yyn] == x)
1303 size += strlen(yytname[x]) + 15, count++;
1304 msg = (char *) malloc(size + 15);
1307 strcpy(msg, "parse error");
1312 for (x = (yyn < 0 ? -yyn : 0);
1313 x < (sizeof(yytname) / sizeof(char *)); x++)
1314 if (yycheck[x + yyn] == x)
1316 strcat(msg, count == 0 ? ", expecting `" : " or `");
1317 strcat(msg, yytname[x]);
1322 YY_cl_ucsim_parser_ERROR(msg);
1326 YY_cl_ucsim_parser_ERROR ("parse error; also virtual memory exceeded");
1329 #endif /* YY_cl_ucsim_parser_ERROR_VERBOSE */
1330 YY_cl_ucsim_parser_ERROR("parse error");
1334 YYLABEL(yyerrlab1) /* here on error raised explicitly by an action */
1336 if (yyerrstatus == 3)
1338 /* if just tried and failed to reuse lookahead token after an error, discard it. */
1340 /* return failure if at end of input */
1341 if (YY_cl_ucsim_parser_CHAR == YYEOF)
1344 #if YY_cl_ucsim_parser_DEBUG != 0
1345 if (YY_cl_ucsim_parser_DEBUG_FLAG)
1346 fprintf(stderr, "Discarding token %d (%s).\n", YY_cl_ucsim_parser_CHAR, yytname[yychar1]);
1349 YY_cl_ucsim_parser_CHAR = YYEMPTY;
1352 /* Else will try to reuse lookahead token
1353 after shifting the error token. */
1355 yyerrstatus = 3; /* Each real token shifted decrements this */
1357 YYGOTO(yyerrhandle);
1359 YYLABEL(yyerrdefault) /* current state does not do anything special for the error token. */
1362 /* This is wrong; only states that explicitly want error tokens
1363 should shift them. */
1364 yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/
1365 if (yyn) YYGOTO(yydefault);
1368 YYLABEL(yyerrpop) /* pop the current state because it cannot handle the error token */
1370 if (yyssp == yyss) YYABORT;
1373 #ifdef YY_cl_ucsim_parser_LSP_NEEDED
1377 #if YY_cl_ucsim_parser_DEBUG != 0
1378 if (YY_cl_ucsim_parser_DEBUG_FLAG)
1380 short *ssp1 = yyss - 1;
1381 fprintf (stderr, "Error: state stack now");
1382 while (ssp1 != yyssp)
1383 fprintf (stderr, " %d", *++ssp1);
1384 fprintf (stderr, "\n");
1388 YYLABEL(yyerrhandle)
1390 yyn = yypact[yystate];
1392 YYGOTO(yyerrdefault);
1395 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
1396 YYGOTO(yyerrdefault);
1412 #if YY_cl_ucsim_parser_DEBUG != 0
1413 if (YY_cl_ucsim_parser_DEBUG_FLAG)
1414 fprintf(stderr, "Shifting error token, ");
1417 *++yyvsp = YY_cl_ucsim_parser_LVAL;
1418 #ifdef YY_cl_ucsim_parser_LSP_NEEDED
1419 *++yylsp = YY_cl_ucsim_parser_LLOC;
1424 /* end loop, in which YYGOTO may be used. */
1430 #line 1038 "/usr/share/bison++/bison.cc"
1431 #line 141 "cmdpars.y"
1435 YY_cl_ucsim_parser_CLASS::yylex(YY_cl_ucsim_parser_STYPE *yylval)
1437 lexer_object->activate_lexer_to_parse_into(yylval);
1438 return(lexer_object->yylex());
1442 YY_cl_ucsim_parser_CLASS::yyerror(char *msg)
1444 application->dd_printf("Parser error: %s\n", msg);