1 /* A Bison parser, made by GNU Bison 1.875c. */
3 /* Skeleton parser for Yacc-like parsing with Bison,
4 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
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)
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.
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. */
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. */
26 /* Written by Richard Stallman by simplifying the original so called
27 ``semantic'' parser. */
29 /* All symbols defined below should begin with yy or YY, 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. */
36 /* Identify Bison output. */
40 #define YYSKELETON_NAME "yacc.c"
45 /* Using locations. */
46 #define YYLSP_NEEDED 0
53 /* Put the tokens into the symbol table, so that GDB and other debuggers
114 #define BLOCKNAME 268
125 #define FLOAT_FUNC 279
134 #define COLONCOLON 288
135 #define INTERNAL_VAR 289
136 #define ABOVE_COMMA 290
143 #define LOGICAL_AND 297
154 /* Copy the first part of user declarations. */
159 #include "gdb_string.h"
160 #include "expression.h"
161 #include "language.h"
163 #include "parser-defs.h"
165 #include "bfd.h" /* Required by objfiles.h. */
166 #include "symfile.h" /* Required by objfiles.h. */
167 #include "objfiles.h" /* For have_full_symbols and have_partial_symbols */
170 /* Remap normal yacc parser interface names (yyparse, yylex, yyerror, etc),
171 as well as gratuitiously global symbol names, so we can have multiple
172 yacc generated parsers in gdb. Note that these are only the variables
173 produced by yacc. If other parser generators (bison, byacc, etc) produce
174 additional global names that conflict at link time, then those parser
175 generators need to be fixed instead of adding those names to this list. */
177 #define yymaxdepth m2_maxdepth
178 #define yyparse m2_parse
180 #define yyerror m2_error
181 #define yylval m2_lval
182 #define yychar m2_char
183 #define yydebug m2_debug
184 #define yypact m2_pact
191 #define yyexca m2_exca
192 #define yyerrflag m2_errflag
193 #define yynerrs m2_nerrs
197 #define yy_yys m2_yys
198 #define yystate m2_state
201 #define yy_yyv m2_yyv
203 #define yylloc m2_lloc
204 #define yyreds m2_reds /* With YYDEBUG defined */
205 #define yytoks m2_toks /* With YYDEBUG defined */
206 #define yyname m2_name /* With YYDEBUG defined */
207 #define yyrule m2_rule /* With YYDEBUG defined */
208 #define yylhs m2_yylhs
209 #define yylen m2_yylen
210 #define yydefred m2_yydefred
211 #define yydgoto m2_yydgoto
212 #define yysindex m2_yysindex
213 #define yyrindex m2_yyrindex
214 #define yygindex m2_yygindex
215 #define yytable m2_yytable
216 #define yycheck m2_yycheck
219 #define YYDEBUG 1 /* Default to yydebug support */
222 #define YYFPRINTF parser_fprintf
226 static int yylex (void);
228 void yyerror (char *);
231 static char *make_qualname (char *, char *);
234 static int parse_number (int);
236 /* The sign of the number being parsed. */
237 static int number_sign
= 1;
239 /* The block that the module specified by the qualifer on an identifer is
242 static struct block
*modblock
=0;
247 /* Enabling traces. */
252 /* Enabling verbose error messages. */
253 #ifdef YYERROR_VERBOSE
254 # undef YYERROR_VERBOSE
255 # define YYERROR_VERBOSE 1
257 # define YYERROR_VERBOSE 0
260 #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
262 typedef union YYSTYPE
{
271 enum exp_opcode opcode
;
272 struct internalvar
*ivar
;
277 /* Line 191 of yacc.c. */
278 #line 279 "m2-exp.c.tmp"
279 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
280 # define YYSTYPE_IS_DECLARED 1
281 # define YYSTYPE_IS_TRIVIAL 1
286 /* Copy the second part of user declarations. */
289 /* Line 214 of yacc.c. */
290 #line 291 "m2-exp.c.tmp"
292 #if ! defined (yyoverflow) || YYERROR_VERBOSE
298 # define YYMALLOC xmalloc
301 /* The parser invokes alloca or xmalloc; define the necessary symbols. */
303 # ifdef YYSTACK_USE_ALLOCA
304 # if YYSTACK_USE_ALLOCA
305 # define YYSTACK_ALLOC alloca
308 # if defined (alloca) || defined (_ALLOCA_H)
309 # define YYSTACK_ALLOC alloca
312 # define YYSTACK_ALLOC __builtin_alloca
317 # ifdef YYSTACK_ALLOC
318 /* Pacify GCC's `empty if-body' warning. */
319 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
321 # if defined (__STDC__) || defined (__cplusplus)
322 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
323 # define YYSIZE_T size_t
325 # define YYSTACK_ALLOC YYMALLOC
326 # define YYSTACK_FREE YYFREE
328 #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
331 #if (! defined (yyoverflow) \
332 && (! defined (__cplusplus) \
333 || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL)))
335 /* A type that is properly aligned for any stack member. */
342 /* The size of the maximum gap between one aligned stack and the next. */
343 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
345 /* The size of an array large to enough to hold all stacks, each with
347 # define YYSTACK_BYTES(N) \
348 ((N) * (sizeof (short) + sizeof (YYSTYPE)) \
349 + YYSTACK_GAP_MAXIMUM)
351 /* Copy COUNT objects from FROM to TO. The source and destination do
354 # if defined (__GNUC__) && 1 < __GNUC__
355 # define YYCOPY(To, From, Count) \
356 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
358 # define YYCOPY(To, From, Count) \
361 register YYSIZE_T yyi; \
362 for (yyi = 0; yyi < (Count); yyi++) \
363 (To)[yyi] = (From)[yyi]; \
369 /* Relocate STACK from its old location to the new one. The
370 local variables YYSIZE and YYSTACKSIZE give the old and new number of
371 elements in the stack, and YYPTR gives the new location of the
372 stack. Advance YYPTR to a properly aligned location for the next
374 # define YYSTACK_RELOCATE(Stack) \
377 YYSIZE_T yynewbytes; \
378 YYCOPY (&yyptr->Stack, Stack, yysize); \
379 Stack = &yyptr->Stack; \
380 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
381 yyptr += yynewbytes / sizeof (*yyptr); \
387 #if defined (__STDC__) || defined (__cplusplus)
388 typedef signed char yysigned_char
;
390 typedef short yysigned_char
;
393 /* YYFINAL -- State number of the termination state. */
395 /* YYLAST -- Last index in YYTABLE. */
398 /* YYNTOKENS -- Number of terminals. */
400 /* YYNNTS -- Number of nonterminals. */
402 /* YYNRULES -- Number of rules. */
404 /* YYNRULES -- Number of states. */
405 #define YYNSTATES 181
407 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
409 #define YYMAXUTOK 303
411 #define YYTRANSLATE(YYX) \
412 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
414 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
415 static const unsigned char yytranslate
[] =
417 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
418 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
419 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
420 2, 2, 2, 2, 2, 41, 2, 2, 47, 2,
421 59, 64, 52, 50, 35, 51, 2, 53, 2, 2,
422 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
423 38, 40, 39, 2, 49, 2, 2, 2, 2, 2,
424 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
425 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
426 2, 58, 2, 67, 57, 2, 2, 2, 2, 2,
427 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
428 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
429 2, 2, 2, 65, 2, 66, 61, 2, 2, 2,
430 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
431 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
432 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
433 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
434 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
435 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
436 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
437 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
438 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
439 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
440 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
441 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
442 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
443 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
444 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
445 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
446 36, 37, 42, 43, 44, 45, 46, 48, 54, 55,
451 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
453 static const unsigned short yyprhs
[] =
455 0, 0, 3, 5, 7, 9, 12, 13, 17, 20,
456 23, 25, 27, 32, 37, 42, 47, 52, 57, 62,
457 69, 74, 79, 84, 87, 92, 99, 104, 111, 115,
458 117, 121, 128, 135, 139, 144, 145, 151, 152, 158,
459 159, 161, 165, 167, 171, 176, 181, 185, 189, 193,
460 197, 201, 205, 209, 213, 217, 221, 225, 229, 233,
461 237, 241, 245, 249, 253, 255, 257, 259, 261, 263,
462 265, 267, 272, 274, 276, 278, 282, 284, 286, 290,
466 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
467 static const yysigned_char yyrhs
[] =
469 69, 0, -1, 71, -1, 70, -1, 82, -1, 71,
470 57, -1, -1, 51, 72, 71, -1, 50, 71, -1,
471 73, 71, -1, 62, -1, 61, -1, 18, 59, 71,
472 64, -1, 19, 59, 71, 64, -1, 21, 59, 71,
473 64, -1, 20, 59, 71, 64, -1, 22, 59, 82,
474 64, -1, 23, 59, 82, 64, -1, 24, 59, 71,
475 64, -1, 25, 59, 82, 35, 71, 64, -1, 26,
476 59, 71, 64, -1, 27, 59, 71, 64, -1, 28,
477 59, 71, 64, -1, 17, 71, -1, 29, 59, 71,
478 64, -1, 29, 59, 71, 35, 71, 64, -1, 30,
479 59, 71, 64, -1, 30, 59, 71, 35, 71, 64,
480 -1, 71, 60, 12, -1, 74, -1, 71, 42, 74,
481 -1, 31, 59, 71, 35, 71, 64, -1, 32, 59,
482 71, 35, 71, 64, -1, 65, 77, 66, -1, 82,
483 65, 77, 66, -1, -1, 71, 58, 75, 78, 67,
484 -1, -1, 71, 59, 76, 77, 64, -1, -1, 71,
485 -1, 77, 35, 71, -1, 71, -1, 78, 35, 71,
486 -1, 65, 82, 66, 71, -1, 82, 59, 71, 64,
487 -1, 59, 71, 64, -1, 71, 49, 71, -1, 71,
488 52, 71, -1, 71, 53, 71, -1, 71, 55, 71,
489 -1, 71, 54, 71, -1, 71, 50, 71, -1, 71,
490 51, 71, -1, 71, 40, 71, -1, 71, 43, 71,
491 -1, 71, 41, 71, -1, 71, 45, 71, -1, 71,
492 44, 71, -1, 71, 38, 71, -1, 71, 39, 71,
493 -1, 71, 48, 71, -1, 71, 46, 71, -1, 71,
494 37, 71, -1, 7, -1, 8, -1, 3, -1, 6,
495 -1, 9, -1, 10, -1, 81, -1, 17, 59, 82,
496 64, -1, 11, -1, 80, -1, 13, -1, 79, 33,
497 13, -1, 80, -1, 34, -1, 79, 33, 12, -1,
501 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
502 static const unsigned short yyrline
[] =
504 0, 206, 206, 207, 210, 219, 224, 223, 230, 234,
505 238, 239, 242, 246, 250, 254, 258, 264, 270, 274,
506 280, 284, 288, 292, 297, 301, 307, 311, 317, 323,
507 326, 330, 334, 338, 340, 350, 346, 360, 357, 367,
508 370, 374, 379, 384, 389, 395, 401, 409, 413, 417,
509 421, 425, 429, 433, 437, 441, 443, 447, 451, 455,
510 459, 463, 467, 471, 478, 484, 490, 497, 506, 514,
511 521, 524, 531, 538, 542, 551, 563, 571, 575, 591,
516 #if YYDEBUG || YYERROR_VERBOSE
517 /* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
518 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
519 static const char *const yytname
[] =
521 "$end", "error", "$undefined", "INT", "HEX", "ERROR", "UINT", "M2_TRUE",
522 "M2_FALSE", "CHAR", "FLOAT", "STRING", "NAME", "BLOCKNAME", "IDENT",
523 "VARNAME", "TYPENAME", "SIZE", "CAP", "ORD", "HIGH", "ABS", "MIN_FUNC",
524 "MAX_FUNC", "FLOAT_FUNC", "VAL", "CHR", "ODD", "TRUNC", "INC", "DEC",
525 "INCL", "EXCL", "COLONCOLON", "INTERNAL_VAR", "','", "ABOVE_COMMA",
526 "ASSIGN", "'<'", "'>'", "'='", "'#'", "IN", "NOTEQUAL", "GEQ", "LEQ",
527 "OROR", "'&'", "LOGICAL_AND", "'@'", "'+'", "'-'", "'*'", "'/'", "MOD",
528 "DIV", "UNARY", "'^'", "'['", "'('", "DOT", "'~'", "NOT", "QID", "')'",
529 "'{'", "'}'", "']'", "$accept", "start", "type_exp", "exp", "@1",
530 "not_exp", "set", "@2", "@3", "arglist", "non_empty_arglist", "block",
531 "fblock", "variable", "type", 0
536 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
538 static const unsigned short yytoknum
[] =
540 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
541 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
542 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
543 285, 286, 287, 288, 289, 44, 290, 291, 60, 62,
544 61, 35, 292, 293, 294, 295, 296, 38, 297, 64,
545 43, 45, 42, 47, 298, 299, 300, 94, 91, 40,
546 301, 126, 302, 303, 41, 123, 125, 93
550 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
551 static const unsigned char yyr1
[] =
553 0, 68, 69, 69, 70, 71, 72, 71, 71, 71,
554 73, 73, 71, 71, 71, 71, 71, 71, 71, 71,
555 71, 71, 71, 71, 71, 71, 71, 71, 71, 71,
556 71, 71, 71, 74, 74, 75, 71, 76, 71, 77,
557 77, 77, 78, 78, 71, 71, 71, 71, 71, 71,
558 71, 71, 71, 71, 71, 71, 71, 71, 71, 71,
559 71, 71, 71, 71, 71, 71, 71, 71, 71, 71,
560 71, 71, 71, 79, 80, 80, 81, 81, 81, 81,
564 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
565 static const unsigned char yyr2
[] =
567 0, 2, 1, 1, 1, 2, 0, 3, 2, 2,
568 1, 1, 4, 4, 4, 4, 4, 4, 4, 6,
569 4, 4, 4, 2, 4, 6, 4, 6, 3, 1,
570 3, 6, 6, 3, 4, 0, 5, 0, 5, 0,
571 1, 3, 1, 3, 4, 4, 3, 3, 3, 3,
572 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
573 3, 3, 3, 3, 1, 1, 1, 1, 1, 1,
574 1, 4, 1, 1, 1, 3, 1, 1, 3, 1,
578 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
579 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
580 means the default is an error. */
581 static const unsigned char yydefact
[] =
583 0, 66, 67, 64, 65, 68, 69, 72, 79, 74,
584 80, 0, 0, 0, 0, 0, 0, 0, 0, 0,
585 0, 0, 0, 0, 0, 0, 0, 77, 0, 6,
586 0, 11, 10, 39, 0, 3, 2, 0, 29, 0,
587 76, 70, 4, 0, 23, 0, 0, 0, 0, 0,
588 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
589 0, 8, 0, 0, 40, 0, 0, 1, 0, 0,
590 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
591 0, 0, 0, 0, 0, 0, 5, 35, 37, 0,
592 9, 0, 0, 39, 0, 0, 0, 0, 0, 0,
593 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
594 7, 46, 0, 33, 0, 63, 59, 60, 54, 56,
595 39, 30, 0, 55, 58, 57, 62, 61, 47, 52,
596 53, 48, 49, 51, 50, 0, 39, 28, 78, 75,
597 0, 0, 71, 12, 13, 15, 14, 16, 17, 18,
598 0, 20, 21, 22, 0, 24, 0, 26, 0, 0,
599 41, 44, 42, 0, 0, 45, 34, 0, 0, 0,
600 0, 0, 0, 36, 38, 19, 25, 27, 31, 32,
604 /* YYDEFGOTO[NTERM-NUM]. */
605 static const short yydefgoto
[] =
607 -1, 34, 35, 64, 62, 37, 38, 135, 136, 65,
611 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
613 #define YYPACT_NINF -92
614 static const short yypact
[] =
616 157, -92, -92, -92, -92, -92, -92, -92, -92, -92,
617 -92, 217, -53, -27, -18, -17, -8, 2, 8, 14,
618 28, 29, 30, 31, 32, 34, 35, -92, 157, -92,
619 157, -92, -92, 157, 44, -92, 744, 157, -92, 62,
620 64, -92, -34, 157, 6, -34, 157, 157, 157, 157,
621 13, 13, 157, 13, 157, 157, 157, 157, 157, 157,
622 157, 6, 157, 79, 744, -30, -39, -92, 157, 157,
623 157, 157, 157, -15, 157, 157, 157, 157, 157, 157,
624 157, 157, 157, 157, 157, 157, -92, -92, -92, 86,
625 6, -4, 157, 157, -25, 302, 330, 358, 386, 36,
626 37, 414, 67, 442, 470, 498, 246, 274, 694, 720,
627 6, -92, 157, -92, 157, 768, -36, -36, -36, -36,
628 157, -92, 40, -36, -36, -36, 144, 203, 779, 788,
629 788, 6, 6, 6, 6, 157, 157, -92, -92, -92,
630 526, -28, -92, -92, -92, -92, -92, -92, -92, -92,
631 157, -92, -92, -92, 157, -92, 157, -92, 157, 157,
632 744, 6, 744, -32, -31, -92, -92, 554, 582, 610,
633 638, 666, 157, -92, -92, -92, -92, -92, -92, -92,
637 /* YYPGOTO[NTERM-NUM]. */
638 static const yysigned_char yypgoto
[] =
640 -92, -92, -92, 0, -92, -92, 26, -92, -92, -91,
641 -92, -92, -92, -92, 53
644 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
645 positive, shift that token. If negative, reduce the rule which
646 number is the opposite. If zero, do what YYDEFACT says.
647 If YYTABLE_NINF, syntax error. */
648 #define YYTABLE_NINF -74
649 static const short yytable
[] =
651 36, 10, 141, 172, 112, 112, 46, 112, 138, 139,
652 77, 44, 78, 79, 80, 81, 82, 83, 84, 85,
653 92, 86, 87, 88, 89, 92, 93, 114, 61, 10,
654 63, 93, 47, 174, 92, 173, 113, 90, 166, 142,
655 93, 48, 49, 63, 67, 164, 95, 96, 97, 98,
656 120, 50, 101, 42, 103, 104, 105, 106, 107, 108,
657 109, 51, 110, 86, 87, 88, 89, 52, 115, 116,
658 117, 118, 119, 53, 123, 124, 125, 126, 127, 128,
659 129, 130, 131, 132, 133, 134, 66, 54, 55, 56,
660 57, 58, 140, 59, 60, 91, 94, -73, 137, 121,
661 147, 148, 150, 99, 100, 93, 102, 0, 0, 0,
662 0, 0, 160, 0, 161, 0, 68, 69, 70, 71,
663 72, 73, 74, 75, 76, 77, 122, 78, 79, 80,
664 81, 82, 83, 84, 85, 162, 86, 87, 88, 89,
665 0, 0, 0, 111, 0, 0, 0, 0, 0, 0,
666 167, 0, 0, 0, 168, 0, 169, 0, 170, 171,
667 1, 0, 0, 2, 3, 4, 5, 6, 7, 8,
668 9, 0, 180, 10, 11, 12, 13, 14, 15, 16,
669 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
670 0, 27, 78, 79, 80, 81, 82, 83, 84, 85,
671 0, 86, 87, 88, 89, 0, 0, 28, 29, 0,
672 0, 0, 0, 0, 0, 0, 30, 0, 31, 32,
673 1, 0, 33, 2, 3, 4, 5, 6, 7, 8,
674 9, 0, 0, 10, 11, 12, 13, 14, 15, 16,
675 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
676 0, 27, 79, 80, 81, 82, 83, 84, 85, 0,
677 86, 87, 88, 89, 0, 0, 0, 28, 29, 0,
678 0, 0, 0, 0, 0, 0, 43, 0, 31, 32,
679 0, 154, 33, 68, 69, 70, 71, 72, 73, 74,
680 75, 76, 77, 0, 78, 79, 80, 81, 82, 83,
681 84, 85, 0, 86, 87, 88, 89, 0, 0, 156,
682 155, 68, 69, 70, 71, 72, 73, 74, 75, 76,
683 77, 0, 78, 79, 80, 81, 82, 83, 84, 85,
684 0, 86, 87, 88, 89, 0, 0, 0, 157, 68,
685 69, 70, 71, 72, 73, 74, 75, 76, 77, 0,
686 78, 79, 80, 81, 82, 83, 84, 85, 0, 86,
687 87, 88, 89, 0, 0, 0, 143, 68, 69, 70,
688 71, 72, 73, 74, 75, 76, 77, 0, 78, 79,
689 80, 81, 82, 83, 84, 85, 0, 86, 87, 88,
690 89, 0, 0, 0, 144, 68, 69, 70, 71, 72,
691 73, 74, 75, 76, 77, 0, 78, 79, 80, 81,
692 82, 83, 84, 85, 0, 86, 87, 88, 89, 0,
693 0, 0, 145, 68, 69, 70, 71, 72, 73, 74,
694 75, 76, 77, 0, 78, 79, 80, 81, 82, 83,
695 84, 85, 0, 86, 87, 88, 89, 0, 0, 0,
696 146, 68, 69, 70, 71, 72, 73, 74, 75, 76,
697 77, 0, 78, 79, 80, 81, 82, 83, 84, 85,
698 0, 86, 87, 88, 89, 0, 0, 0, 149, 68,
699 69, 70, 71, 72, 73, 74, 75, 76, 77, 0,
700 78, 79, 80, 81, 82, 83, 84, 85, 0, 86,
701 87, 88, 89, 0, 0, 0, 151, 68, 69, 70,
702 71, 72, 73, 74, 75, 76, 77, 0, 78, 79,
703 80, 81, 82, 83, 84, 85, 0, 86, 87, 88,
704 89, 0, 0, 0, 152, 68, 69, 70, 71, 72,
705 73, 74, 75, 76, 77, 0, 78, 79, 80, 81,
706 82, 83, 84, 85, 0, 86, 87, 88, 89, 0,
707 0, 0, 153, 68, 69, 70, 71, 72, 73, 74,
708 75, 76, 77, 0, 78, 79, 80, 81, 82, 83,
709 84, 85, 0, 86, 87, 88, 89, 0, 0, 0,
710 165, 68, 69, 70, 71, 72, 73, 74, 75, 76,
711 77, 0, 78, 79, 80, 81, 82, 83, 84, 85,
712 0, 86, 87, 88, 89, 0, 0, 0, 175, 68,
713 69, 70, 71, 72, 73, 74, 75, 76, 77, 0,
714 78, 79, 80, 81, 82, 83, 84, 85, 0, 86,
715 87, 88, 89, 0, 0, 0, 176, 68, 69, 70,
716 71, 72, 73, 74, 75, 76, 77, 0, 78, 79,
717 80, 81, 82, 83, 84, 85, 0, 86, 87, 88,
718 89, 0, 0, 0, 177, 68, 69, 70, 71, 72,
719 73, 74, 75, 76, 77, 0, 78, 79, 80, 81,
720 82, 83, 84, 85, 0, 86, 87, 88, 89, 0,
721 0, 0, 178, 68, 69, 70, 71, 72, 73, 74,
722 75, 76, 77, 0, 78, 79, 80, 81, 82, 83,
723 84, 85, 0, 86, 87, 88, 89, 0, 0, 158,
724 179, 68, 69, 70, 71, 72, 73, 74, 75, 76,
725 77, 0, 78, 79, 80, 81, 82, 83, 84, 85,
726 0, 86, 87, 88, 89, 159, 0, 68, 69, 70,
727 71, 72, 73, 74, 75, 76, 77, 0, 78, 79,
728 80, 81, 82, 83, 84, 85, 0, 86, 87, 88,
729 89, 68, 69, 70, 71, 72, 73, 74, 75, 76,
730 77, 0, 78, 79, 80, 81, 82, 83, 84, 85,
731 0, 86, 87, 88, 89, -74, 69, 70, 71, 72,
732 73, 74, 75, 76, 77, 0, 78, 79, 80, 81,
733 82, 83, 84, 85, 0, 86, 87, 88, 89, 80,
734 81, 82, 83, 84, 85, 0, 86, 87, 88, 89,
735 82, 83, 84, 85, 0, 86, 87, 88, 89
738 static const short yycheck
[] =
740 0, 16, 93, 35, 35, 35, 59, 35, 12, 13,
741 46, 11, 48, 49, 50, 51, 52, 53, 54, 55,
742 59, 57, 58, 59, 60, 59, 65, 66, 28, 16,
743 30, 65, 59, 64, 59, 67, 66, 37, 66, 64,
744 65, 59, 59, 43, 0, 136, 46, 47, 48, 49,
745 65, 59, 52, 0, 54, 55, 56, 57, 58, 59,
746 60, 59, 62, 57, 58, 59, 60, 59, 68, 69,
747 70, 71, 72, 59, 74, 75, 76, 77, 78, 79,
748 80, 81, 82, 83, 84, 85, 33, 59, 59, 59,
749 59, 59, 92, 59, 59, 33, 43, 33, 12, 73,
750 64, 64, 35, 50, 51, 65, 53, -1, -1, -1,
751 -1, -1, 112, -1, 114, -1, 37, 38, 39, 40,
752 41, 42, 43, 44, 45, 46, 73, 48, 49, 50,
753 51, 52, 53, 54, 55, 135, 57, 58, 59, 60,
754 -1, -1, -1, 64, -1, -1, -1, -1, -1, -1,
755 150, -1, -1, -1, 154, -1, 156, -1, 158, 159,
756 3, -1, -1, 6, 7, 8, 9, 10, 11, 12,
757 13, -1, 172, 16, 17, 18, 19, 20, 21, 22,
758 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
759 -1, 34, 48, 49, 50, 51, 52, 53, 54, 55,
760 -1, 57, 58, 59, 60, -1, -1, 50, 51, -1,
761 -1, -1, -1, -1, -1, -1, 59, -1, 61, 62,
762 3, -1, 65, 6, 7, 8, 9, 10, 11, 12,
763 13, -1, -1, 16, 17, 18, 19, 20, 21, 22,
764 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
765 -1, 34, 49, 50, 51, 52, 53, 54, 55, -1,
766 57, 58, 59, 60, -1, -1, -1, 50, 51, -1,
767 -1, -1, -1, -1, -1, -1, 59, -1, 61, 62,
768 -1, 35, 65, 37, 38, 39, 40, 41, 42, 43,
769 44, 45, 46, -1, 48, 49, 50, 51, 52, 53,
770 54, 55, -1, 57, 58, 59, 60, -1, -1, 35,
771 64, 37, 38, 39, 40, 41, 42, 43, 44, 45,
772 46, -1, 48, 49, 50, 51, 52, 53, 54, 55,
773 -1, 57, 58, 59, 60, -1, -1, -1, 64, 37,
774 38, 39, 40, 41, 42, 43, 44, 45, 46, -1,
775 48, 49, 50, 51, 52, 53, 54, 55, -1, 57,
776 58, 59, 60, -1, -1, -1, 64, 37, 38, 39,
777 40, 41, 42, 43, 44, 45, 46, -1, 48, 49,
778 50, 51, 52, 53, 54, 55, -1, 57, 58, 59,
779 60, -1, -1, -1, 64, 37, 38, 39, 40, 41,
780 42, 43, 44, 45, 46, -1, 48, 49, 50, 51,
781 52, 53, 54, 55, -1, 57, 58, 59, 60, -1,
782 -1, -1, 64, 37, 38, 39, 40, 41, 42, 43,
783 44, 45, 46, -1, 48, 49, 50, 51, 52, 53,
784 54, 55, -1, 57, 58, 59, 60, -1, -1, -1,
785 64, 37, 38, 39, 40, 41, 42, 43, 44, 45,
786 46, -1, 48, 49, 50, 51, 52, 53, 54, 55,
787 -1, 57, 58, 59, 60, -1, -1, -1, 64, 37,
788 38, 39, 40, 41, 42, 43, 44, 45, 46, -1,
789 48, 49, 50, 51, 52, 53, 54, 55, -1, 57,
790 58, 59, 60, -1, -1, -1, 64, 37, 38, 39,
791 40, 41, 42, 43, 44, 45, 46, -1, 48, 49,
792 50, 51, 52, 53, 54, 55, -1, 57, 58, 59,
793 60, -1, -1, -1, 64, 37, 38, 39, 40, 41,
794 42, 43, 44, 45, 46, -1, 48, 49, 50, 51,
795 52, 53, 54, 55, -1, 57, 58, 59, 60, -1,
796 -1, -1, 64, 37, 38, 39, 40, 41, 42, 43,
797 44, 45, 46, -1, 48, 49, 50, 51, 52, 53,
798 54, 55, -1, 57, 58, 59, 60, -1, -1, -1,
799 64, 37, 38, 39, 40, 41, 42, 43, 44, 45,
800 46, -1, 48, 49, 50, 51, 52, 53, 54, 55,
801 -1, 57, 58, 59, 60, -1, -1, -1, 64, 37,
802 38, 39, 40, 41, 42, 43, 44, 45, 46, -1,
803 48, 49, 50, 51, 52, 53, 54, 55, -1, 57,
804 58, 59, 60, -1, -1, -1, 64, 37, 38, 39,
805 40, 41, 42, 43, 44, 45, 46, -1, 48, 49,
806 50, 51, 52, 53, 54, 55, -1, 57, 58, 59,
807 60, -1, -1, -1, 64, 37, 38, 39, 40, 41,
808 42, 43, 44, 45, 46, -1, 48, 49, 50, 51,
809 52, 53, 54, 55, -1, 57, 58, 59, 60, -1,
810 -1, -1, 64, 37, 38, 39, 40, 41, 42, 43,
811 44, 45, 46, -1, 48, 49, 50, 51, 52, 53,
812 54, 55, -1, 57, 58, 59, 60, -1, -1, 35,
813 64, 37, 38, 39, 40, 41, 42, 43, 44, 45,
814 46, -1, 48, 49, 50, 51, 52, 53, 54, 55,
815 -1, 57, 58, 59, 60, 35, -1, 37, 38, 39,
816 40, 41, 42, 43, 44, 45, 46, -1, 48, 49,
817 50, 51, 52, 53, 54, 55, -1, 57, 58, 59,
818 60, 37, 38, 39, 40, 41, 42, 43, 44, 45,
819 46, -1, 48, 49, 50, 51, 52, 53, 54, 55,
820 -1, 57, 58, 59, 60, 37, 38, 39, 40, 41,
821 42, 43, 44, 45, 46, -1, 48, 49, 50, 51,
822 52, 53, 54, 55, -1, 57, 58, 59, 60, 50,
823 51, 52, 53, 54, 55, -1, 57, 58, 59, 60,
824 52, 53, 54, 55, -1, 57, 58, 59, 60
827 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
828 symbol of state STATE-NUM. */
829 static const unsigned char yystos
[] =
831 0, 3, 6, 7, 8, 9, 10, 11, 12, 13,
832 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
833 26, 27, 28, 29, 30, 31, 32, 34, 50, 51,
834 59, 61, 62, 65, 69, 70, 71, 73, 74, 79,
835 80, 81, 82, 59, 71, 82, 59, 59, 59, 59,
836 59, 59, 59, 59, 59, 59, 59, 59, 59, 59,
837 59, 71, 72, 71, 71, 77, 82, 0, 37, 38,
838 39, 40, 41, 42, 43, 44, 45, 46, 48, 49,
839 50, 51, 52, 53, 54, 55, 57, 58, 59, 60,
840 71, 33, 59, 65, 82, 71, 71, 71, 71, 82,
841 82, 71, 82, 71, 71, 71, 71, 71, 71, 71,
842 71, 64, 35, 66, 66, 71, 71, 71, 71, 71,
843 65, 74, 82, 71, 71, 71, 71, 71, 71, 71,
844 71, 71, 71, 71, 71, 75, 76, 12, 12, 13,
845 71, 77, 64, 64, 64, 64, 64, 64, 64, 64,
846 35, 64, 64, 64, 35, 64, 35, 64, 35, 35,
847 71, 71, 71, 78, 77, 64, 66, 71, 71, 71,
848 71, 71, 35, 67, 64, 64, 64, 64, 64, 64,
852 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
853 # define YYSIZE_T __SIZE_TYPE__
855 #if ! defined (YYSIZE_T) && defined (size_t)
856 # define YYSIZE_T size_t
858 #if ! defined (YYSIZE_T)
859 # if defined (__STDC__) || defined (__cplusplus)
860 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
861 # define YYSIZE_T size_t
864 #if ! defined (YYSIZE_T)
865 # define YYSIZE_T unsigned int
868 #define yyerrok (yyerrstatus = 0)
869 #define yyclearin (yychar = YYEMPTY)
873 #define YYACCEPT goto yyacceptlab
874 #define YYABORT goto yyabortlab
875 #define YYERROR goto yyerrorlab
878 /* Like YYERROR except do call yyerror. This remains here temporarily
879 to ease the transition to the new meaning of YYERROR, for GCC.
880 Once GCC version 2 has supplanted version 1, this can go. */
882 #define YYFAIL goto yyerrlab
884 #define YYRECOVERING() (!!yyerrstatus)
886 #define YYBACKUP(Token, Value) \
888 if (yychar == YYEMPTY && yylen == 1) \
892 yytoken = YYTRANSLATE (yychar); \
898 yyerror ("syntax error: cannot back up");\
904 #define YYERRCODE 256
906 /* YYLLOC_DEFAULT -- Compute the default location (before the actions
909 #ifndef YYLLOC_DEFAULT
910 # define YYLLOC_DEFAULT(Current, Rhs, N) \
911 ((Current).first_line = (Rhs)[1].first_line, \
912 (Current).first_column = (Rhs)[1].first_column, \
913 (Current).last_line = (Rhs)[N].last_line, \
914 (Current).last_column = (Rhs)[N].last_column)
917 /* YYLEX -- calling `yylex' with the right arguments. */
920 # define YYLEX yylex (YYLEX_PARAM)
922 # define YYLEX yylex ()
925 /* Enable debugging if requested. */
929 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
930 # define YYFPRINTF fprintf
933 # define YYDPRINTF(Args) \
939 # define YYDSYMPRINT(Args) \
945 # define YYDSYMPRINTF(Title, Token, Value, Location) \
949 YYFPRINTF (stderr, "%s ", Title); \
950 yysymprint (stderr, \
952 YYFPRINTF (stderr, "\n"); \
956 /*------------------------------------------------------------------.
957 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
959 `------------------------------------------------------------------*/
961 #if defined (__STDC__) || defined (__cplusplus)
963 yy_stack_print (short *bottom
, short *top
)
966 yy_stack_print (bottom
, top
)
971 YYFPRINTF (stderr
, "Stack now");
972 for (/* Nothing. */; bottom
<= top
; ++bottom
)
973 YYFPRINTF (stderr
, " %d", *bottom
);
974 YYFPRINTF (stderr
, "\n");
977 # define YY_STACK_PRINT(Bottom, Top) \
980 yy_stack_print ((Bottom), (Top)); \
984 /*------------------------------------------------.
985 | Report that the YYRULE is going to be reduced. |
986 `------------------------------------------------*/
988 #if defined (__STDC__) || defined (__cplusplus)
990 yy_reduce_print (int yyrule
)
993 yy_reduce_print (yyrule
)
998 unsigned int yylno
= yyrline
[yyrule
];
999 YYFPRINTF (stderr
, "Reducing stack by rule %d (line %u), ",
1001 /* Print the symbols being reduced, and their result. */
1002 for (yyi
= yyprhs
[yyrule
]; 0 <= yyrhs
[yyi
]; yyi
++)
1003 YYFPRINTF (stderr
, "%s ", yytname
[yyrhs
[yyi
]]);
1004 YYFPRINTF (stderr
, "-> %s\n", yytname
[yyr1
[yyrule
]]);
1007 # define YY_REDUCE_PRINT(Rule) \
1010 yy_reduce_print (Rule); \
1013 /* Nonzero means print parse trace. It is left uninitialized so that
1014 multiple parsers can coexist. */
1016 #else /* !YYDEBUG */
1017 # define YYDPRINTF(Args)
1018 # define YYDSYMPRINT(Args)
1019 # define YYDSYMPRINTF(Title, Token, Value, Location)
1020 # define YY_STACK_PRINT(Bottom, Top)
1021 # define YY_REDUCE_PRINT(Rule)
1022 #endif /* !YYDEBUG */
1025 /* YYINITDEPTH -- initial size of the parser's stacks. */
1027 # define YYINITDEPTH 200
1030 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1031 if the built-in stack extension method is used).
1033 Do not make this value too large; the results are undefined if
1034 SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
1035 evaluated with infinite-precision integer arithmetic. */
1037 #if defined (YYMAXDEPTH) && YYMAXDEPTH == 0
1042 # define YYMAXDEPTH 10000
1050 # if defined (__GLIBC__) && defined (_STRING_H)
1051 # define yystrlen strlen
1053 /* Return the length of YYSTR. */
1055 # if defined (__STDC__) || defined (__cplusplus)
1056 yystrlen (const char *yystr
)
1062 register const char *yys
= yystr
;
1064 while (*yys
++ != '\0')
1067 return yys
- yystr
- 1;
1073 # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
1074 # define yystpcpy stpcpy
1076 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1079 # if defined (__STDC__) || defined (__cplusplus)
1080 yystpcpy (char *yydest
, const char *yysrc
)
1082 yystpcpy (yydest
, yysrc
)
1087 register char *yyd
= yydest
;
1088 register const char *yys
= yysrc
;
1090 while ((*yyd
++ = *yys
++) != '\0')
1098 #endif /* !YYERROR_VERBOSE */
1103 /*--------------------------------.
1104 | Print this symbol on YYOUTPUT. |
1105 `--------------------------------*/
1107 #if defined (__STDC__) || defined (__cplusplus)
1109 yysymprint (FILE *yyoutput
, int yytype
, YYSTYPE
*yyvaluep
)
1112 yysymprint (yyoutput
, yytype
, yyvaluep
)
1118 /* Pacify ``unused variable'' warnings. */
1121 if (yytype
< YYNTOKENS
)
1123 YYFPRINTF (yyoutput
, "token %s (", yytname
[yytype
]);
1125 YYPRINT (yyoutput
, yytoknum
[yytype
], *yyvaluep
);
1129 YYFPRINTF (yyoutput
, "nterm %s (", yytname
[yytype
]);
1136 YYFPRINTF (yyoutput
, ")");
1139 #endif /* ! YYDEBUG */
1140 /*-----------------------------------------------.
1141 | Release the memory associated to this symbol. |
1142 `-----------------------------------------------*/
1144 #if defined (__STDC__) || defined (__cplusplus)
1146 yydestruct (int yytype
, YYSTYPE
*yyvaluep
)
1149 yydestruct (yytype
, yyvaluep
)
1154 /* Pacify ``unused variable'' warnings. */
1166 /* Prevent warnings from -Wmissing-prototypes. */
1168 #ifdef YYPARSE_PARAM
1169 # if defined (__STDC__) || defined (__cplusplus)
1170 int yyparse (void *YYPARSE_PARAM
);
1174 #else /* ! YYPARSE_PARAM */
1175 #if defined (__STDC__) || defined (__cplusplus)
1180 #endif /* ! YYPARSE_PARAM */
1184 /* The lookahead symbol. */
1187 /* The semantic value of the lookahead symbol. */
1190 /* Number of syntax errors so far. */
1199 #ifdef YYPARSE_PARAM
1200 # if defined (__STDC__) || defined (__cplusplus)
1201 int yyparse (void *YYPARSE_PARAM
)
1203 int yyparse (YYPARSE_PARAM
)
1204 void *YYPARSE_PARAM
;
1206 #else /* ! YYPARSE_PARAM */
1207 #if defined (__STDC__) || defined (__cplusplus)
1218 register int yystate
;
1221 /* Number of tokens to shift before error messages enabled. */
1223 /* Lookahead token as an internal (translated) token number. */
1226 /* Three stacks and their tools:
1227 `yyss': related to states,
1228 `yyvs': related to semantic values,
1229 `yyls': related to locations.
1231 Refer to the stacks thru separate pointers, to allow yyoverflow
1232 to xreallocate them elsewhere. */
1234 /* The state stack. */
1235 short yyssa
[YYINITDEPTH
];
1236 short *yyss
= yyssa
;
1237 register short *yyssp
;
1239 /* The semantic value stack. */
1240 YYSTYPE yyvsa
[YYINITDEPTH
];
1241 YYSTYPE
*yyvs
= yyvsa
;
1242 register YYSTYPE
*yyvsp
;
1246 #define YYPOPSTACK (yyvsp--, yyssp--)
1248 YYSIZE_T yystacksize
= YYINITDEPTH
;
1250 /* The variables used to return semantic value and location from the
1255 /* When reducing, the number of symbols on the RHS of the reduced
1259 YYDPRINTF ((stderr
, "Starting parse\n"));
1264 yychar
= YYEMPTY
; /* Cause a token to be read. */
1266 /* Initialize stack pointers.
1267 Waste one element of value and location stack
1268 so that they stay on the same level as the state stack.
1269 The wasted elements are never initialized. */
1276 /*------------------------------------------------------------.
1277 | yynewstate -- Push a new state, which is found in yystate. |
1278 `------------------------------------------------------------*/
1280 /* In all cases, when you get here, the value and location stacks
1281 have just been pushed. so pushing a state here evens the stacks.
1288 if (yyss
+ yystacksize
- 1 <= yyssp
)
1290 /* Get the current used size of the three stacks, in elements. */
1291 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
1295 /* Give user a chance to xreallocate the stack. Use copies of
1296 these so that the &'s don't force the real ones into
1298 YYSTYPE
*yyvs1
= yyvs
;
1299 short *yyss1
= yyss
;
1302 /* Each stack pointer address is followed by the size of the
1303 data in use in that stack, in bytes. This used to be a
1304 conditional around just the two extra args, but that might
1305 be undefined if yyoverflow is a macro. */
1306 yyoverflow ("parser stack overflow",
1307 &yyss1
, yysize
* sizeof (*yyssp
),
1308 &yyvs1
, yysize
* sizeof (*yyvsp
),
1315 #else /* no yyoverflow */
1316 # ifndef YYSTACK_RELOCATE
1319 /* Extend the stack our own way. */
1320 if (YYMAXDEPTH
<= yystacksize
)
1323 if (YYMAXDEPTH
< yystacksize
)
1324 yystacksize
= YYMAXDEPTH
;
1327 short *yyss1
= yyss
;
1328 union yyalloc
*yyptr
=
1329 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
1332 YYSTACK_RELOCATE (yyss
);
1333 YYSTACK_RELOCATE (yyvs
);
1335 # undef YYSTACK_RELOCATE
1337 YYSTACK_FREE (yyss1
);
1340 #endif /* no yyoverflow */
1342 yyssp
= yyss
+ yysize
- 1;
1343 yyvsp
= yyvs
+ yysize
- 1;
1346 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
1347 (unsigned long int) yystacksize
));
1349 if (yyss
+ yystacksize
- 1 <= yyssp
)
1353 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
1362 /* Do appropriate processing given the current state. */
1363 /* Read a lookahead token if we need one and don't already have one. */
1366 /* First try to decide what to do without reference to lookahead token. */
1368 yyn
= yypact
[yystate
];
1369 if (yyn
== YYPACT_NINF
)
1372 /* Not known => get a lookahead token if don't already have one. */
1374 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1375 if (yychar
== YYEMPTY
)
1377 YYDPRINTF ((stderr
, "Reading a token: "));
1381 if (yychar
<= YYEOF
)
1383 yychar
= yytoken
= YYEOF
;
1384 YYDPRINTF ((stderr
, "Now at end of input.\n"));
1388 yytoken
= YYTRANSLATE (yychar
);
1389 YYDSYMPRINTF ("Next token is", yytoken
, &yylval
, &yylloc
);
1392 /* If the proper action on seeing token YYTOKEN is to reduce or to
1393 detect an error, take that action. */
1395 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yytoken
)
1400 if (yyn
== 0 || yyn
== YYTABLE_NINF
)
1409 /* Shift the lookahead token. */
1410 YYDPRINTF ((stderr
, "Shifting token %s, ", yytname
[yytoken
]));
1412 /* Discard the token being shifted unless it is eof. */
1413 if (yychar
!= YYEOF
)
1419 /* Count tokens shifted since error; after three, turn off error
1428 /*-----------------------------------------------------------.
1429 | yydefault -- do the default action for the current state. |
1430 `-----------------------------------------------------------*/
1432 yyn
= yydefact
[yystate
];
1438 /*-----------------------------.
1439 | yyreduce -- Do a reduction. |
1440 `-----------------------------*/
1442 /* yyn is the number of a rule to reduce with. */
1445 /* If YYLEN is nonzero, implement the default value of the action:
1448 Otherwise, the following line sets YYVAL to garbage.
1449 This behavior is undocumented and Bison
1450 users should not rely upon it. Assigning to YYVAL
1451 unconditionally makes the parser a bit smaller, and it avoids a
1452 GCC warning that YYVAL may be used uninitialized. */
1453 yyval
= yyvsp
[1-yylen
];
1456 YY_REDUCE_PRINT (yyn
);
1460 #line 211 "m2-exp.y"
1461 { write_exp_elt_opcode(OP_TYPE
);
1462 write_exp_elt_type(yyvsp
[0].tval
);
1463 write_exp_elt_opcode(OP_TYPE
);
1468 #line 220 "m2-exp.y"
1469 { write_exp_elt_opcode (UNOP_IND
); }
1473 #line 224 "m2-exp.y"
1474 { number_sign
= -1; }
1478 #line 226 "m2-exp.y"
1480 write_exp_elt_opcode (UNOP_NEG
); }
1484 #line 231 "m2-exp.y"
1485 { write_exp_elt_opcode(UNOP_PLUS
); }
1489 #line 235 "m2-exp.y"
1490 { write_exp_elt_opcode (UNOP_LOGICAL_NOT
); }
1494 #line 243 "m2-exp.y"
1495 { write_exp_elt_opcode (UNOP_CAP
); }
1499 #line 247 "m2-exp.y"
1500 { write_exp_elt_opcode (UNOP_ORD
); }
1504 #line 251 "m2-exp.y"
1505 { write_exp_elt_opcode (UNOP_ABS
); }
1509 #line 255 "m2-exp.y"
1510 { write_exp_elt_opcode (UNOP_HIGH
); }
1514 #line 259 "m2-exp.y"
1515 { write_exp_elt_opcode (UNOP_MIN
);
1516 write_exp_elt_type (yyvsp
[-1].tval
);
1517 write_exp_elt_opcode (UNOP_MIN
); }
1521 #line 265 "m2-exp.y"
1522 { write_exp_elt_opcode (UNOP_MAX
);
1523 write_exp_elt_type (yyvsp
[-1].tval
);
1524 write_exp_elt_opcode (UNOP_MIN
); }
1528 #line 271 "m2-exp.y"
1529 { write_exp_elt_opcode (UNOP_FLOAT
); }
1533 #line 275 "m2-exp.y"
1534 { write_exp_elt_opcode (BINOP_VAL
);
1535 write_exp_elt_type (yyvsp
[-3].tval
);
1536 write_exp_elt_opcode (BINOP_VAL
); }
1540 #line 281 "m2-exp.y"
1541 { write_exp_elt_opcode (UNOP_CHR
); }
1545 #line 285 "m2-exp.y"
1546 { write_exp_elt_opcode (UNOP_ODD
); }
1550 #line 289 "m2-exp.y"
1551 { write_exp_elt_opcode (UNOP_TRUNC
); }
1555 #line 293 "m2-exp.y"
1556 { write_exp_elt_opcode (UNOP_SIZEOF
); }
1560 #line 298 "m2-exp.y"
1561 { write_exp_elt_opcode(UNOP_PREINCREMENT
); }
1565 #line 302 "m2-exp.y"
1566 { write_exp_elt_opcode(BINOP_ASSIGN_MODIFY
);
1567 write_exp_elt_opcode(BINOP_ADD
);
1568 write_exp_elt_opcode(BINOP_ASSIGN_MODIFY
); }
1572 #line 308 "m2-exp.y"
1573 { write_exp_elt_opcode(UNOP_PREDECREMENT
);}
1577 #line 312 "m2-exp.y"
1578 { write_exp_elt_opcode(BINOP_ASSIGN_MODIFY
);
1579 write_exp_elt_opcode(BINOP_SUB
);
1580 write_exp_elt_opcode(BINOP_ASSIGN_MODIFY
); }
1584 #line 318 "m2-exp.y"
1585 { write_exp_elt_opcode (STRUCTOP_STRUCT
);
1586 write_exp_string (yyvsp
[0].sval
);
1587 write_exp_elt_opcode (STRUCTOP_STRUCT
); }
1591 #line 327 "m2-exp.y"
1592 { error("Sets are not implemented.");}
1596 #line 331 "m2-exp.y"
1597 { error("Sets are not implemented.");}
1601 #line 335 "m2-exp.y"
1602 { error("Sets are not implemented.");}
1606 #line 339 "m2-exp.y"
1607 { error("Sets are not implemented.");}
1611 #line 341 "m2-exp.y"
1612 { error("Sets are not implemented.");}
1616 #line 350 "m2-exp.y"
1617 { start_arglist(); }
1621 #line 352 "m2-exp.y"
1622 { write_exp_elt_opcode (MULTI_SUBSCRIPT
);
1623 write_exp_elt_longcst ((LONGEST
) end_arglist());
1624 write_exp_elt_opcode (MULTI_SUBSCRIPT
); }
1628 #line 360 "m2-exp.y"
1629 { start_arglist (); }
1633 #line 362 "m2-exp.y"
1634 { write_exp_elt_opcode (OP_FUNCALL
);
1635 write_exp_elt_longcst ((LONGEST
) end_arglist ());
1636 write_exp_elt_opcode (OP_FUNCALL
); }
1640 #line 371 "m2-exp.y"
1641 { arglist_len
= 1; }
1645 #line 375 "m2-exp.y"
1650 #line 380 "m2-exp.y"
1651 { arglist_len
= 1; }
1655 #line 385 "m2-exp.y"
1660 #line 390 "m2-exp.y"
1661 { write_exp_elt_opcode (UNOP_MEMVAL
);
1662 write_exp_elt_type (yyvsp
[-2].tval
);
1663 write_exp_elt_opcode (UNOP_MEMVAL
); }
1667 #line 396 "m2-exp.y"
1668 { write_exp_elt_opcode (UNOP_CAST
);
1669 write_exp_elt_type (yyvsp
[-3].tval
);
1670 write_exp_elt_opcode (UNOP_CAST
); }
1674 #line 402 "m2-exp.y"
1679 #line 410 "m2-exp.y"
1680 { write_exp_elt_opcode (BINOP_REPEAT
); }
1684 #line 414 "m2-exp.y"
1685 { write_exp_elt_opcode (BINOP_MUL
); }
1689 #line 418 "m2-exp.y"
1690 { write_exp_elt_opcode (BINOP_DIV
); }
1694 #line 422 "m2-exp.y"
1695 { write_exp_elt_opcode (BINOP_INTDIV
); }
1699 #line 426 "m2-exp.y"
1700 { write_exp_elt_opcode (BINOP_REM
); }
1704 #line 430 "m2-exp.y"
1705 { write_exp_elt_opcode (BINOP_ADD
); }
1709 #line 434 "m2-exp.y"
1710 { write_exp_elt_opcode (BINOP_SUB
); }
1714 #line 438 "m2-exp.y"
1715 { write_exp_elt_opcode (BINOP_EQUAL
); }
1719 #line 442 "m2-exp.y"
1720 { write_exp_elt_opcode (BINOP_NOTEQUAL
); }
1724 #line 444 "m2-exp.y"
1725 { write_exp_elt_opcode (BINOP_NOTEQUAL
); }
1729 #line 448 "m2-exp.y"
1730 { write_exp_elt_opcode (BINOP_LEQ
); }
1734 #line 452 "m2-exp.y"
1735 { write_exp_elt_opcode (BINOP_GEQ
); }
1739 #line 456 "m2-exp.y"
1740 { write_exp_elt_opcode (BINOP_LESS
); }
1744 #line 460 "m2-exp.y"
1745 { write_exp_elt_opcode (BINOP_GTR
); }
1749 #line 464 "m2-exp.y"
1750 { write_exp_elt_opcode (BINOP_LOGICAL_AND
); }
1754 #line 468 "m2-exp.y"
1755 { write_exp_elt_opcode (BINOP_LOGICAL_OR
); }
1759 #line 472 "m2-exp.y"
1760 { write_exp_elt_opcode (BINOP_ASSIGN
); }
1764 #line 479 "m2-exp.y"
1765 { write_exp_elt_opcode (OP_BOOL
);
1766 write_exp_elt_longcst ((LONGEST
) yyvsp
[0].ulval
);
1767 write_exp_elt_opcode (OP_BOOL
); }
1771 #line 485 "m2-exp.y"
1772 { write_exp_elt_opcode (OP_BOOL
);
1773 write_exp_elt_longcst ((LONGEST
) yyvsp
[0].ulval
);
1774 write_exp_elt_opcode (OP_BOOL
); }
1778 #line 491 "m2-exp.y"
1779 { write_exp_elt_opcode (OP_LONG
);
1780 write_exp_elt_type (builtin_type_m2_int
);
1781 write_exp_elt_longcst ((LONGEST
) yyvsp
[0].lval
);
1782 write_exp_elt_opcode (OP_LONG
); }
1786 #line 498 "m2-exp.y"
1788 write_exp_elt_opcode (OP_LONG
);
1789 write_exp_elt_type (builtin_type_m2_card
);
1790 write_exp_elt_longcst ((LONGEST
) yyvsp
[0].ulval
);
1791 write_exp_elt_opcode (OP_LONG
);
1796 #line 507 "m2-exp.y"
1797 { write_exp_elt_opcode (OP_LONG
);
1798 write_exp_elt_type (builtin_type_m2_char
);
1799 write_exp_elt_longcst ((LONGEST
) yyvsp
[0].ulval
);
1800 write_exp_elt_opcode (OP_LONG
); }
1804 #line 515 "m2-exp.y"
1805 { write_exp_elt_opcode (OP_DOUBLE
);
1806 write_exp_elt_type (builtin_type_m2_real
);
1807 write_exp_elt_dblcst (yyvsp
[0].dval
);
1808 write_exp_elt_opcode (OP_DOUBLE
); }
1812 #line 525 "m2-exp.y"
1813 { write_exp_elt_opcode (OP_LONG
);
1814 write_exp_elt_type (builtin_type_int
);
1815 write_exp_elt_longcst ((LONGEST
) TYPE_LENGTH (yyvsp
[-1].tval
));
1816 write_exp_elt_opcode (OP_LONG
); }
1820 #line 532 "m2-exp.y"
1821 { write_exp_elt_opcode (OP_M2_STRING
);
1822 write_exp_string (yyvsp
[0].sval
);
1823 write_exp_elt_opcode (OP_M2_STRING
); }
1827 #line 539 "m2-exp.y"
1828 { yyval
.bval
= SYMBOL_BLOCK_VALUE(yyvsp
[0].sym
); }
1832 #line 543 "m2-exp.y"
1833 { struct symbol
*sym
1834 = lookup_symbol (copy_name (yyvsp
[0].sval
), expression_context_block
,
1835 VAR_DOMAIN
, 0, NULL
);
1840 #line 552 "m2-exp.y"
1841 { struct symbol
*tem
1842 = lookup_symbol (copy_name (yyvsp
[0].sval
), yyvsp
[-2].bval
,
1843 VAR_DOMAIN
, 0, NULL
);
1844 if (!tem
|| SYMBOL_CLASS (tem
) != LOC_BLOCK
)
1845 error ("No function \"%s\" in specified context.",
1846 copy_name (yyvsp
[0].sval
));
1852 #line 564 "m2-exp.y"
1853 { write_exp_elt_opcode(OP_VAR_VALUE
);
1854 write_exp_elt_block (NULL
);
1855 write_exp_elt_sym (yyvsp
[0].sym
);
1856 write_exp_elt_opcode (OP_VAR_VALUE
); }
1860 #line 576 "m2-exp.y"
1861 { struct symbol
*sym
;
1862 sym
= lookup_symbol (copy_name (yyvsp
[0].sval
), yyvsp
[-2].bval
,
1863 VAR_DOMAIN
, 0, NULL
);
1865 error ("No symbol \"%s\" in specified context.",
1866 copy_name (yyvsp
[0].sval
));
1868 write_exp_elt_opcode (OP_VAR_VALUE
);
1869 /* block_found is set by lookup_symbol. */
1870 write_exp_elt_block (block_found
);
1871 write_exp_elt_sym (sym
);
1872 write_exp_elt_opcode (OP_VAR_VALUE
); }
1876 #line 592 "m2-exp.y"
1877 { struct symbol
*sym
;
1878 int is_a_field_of_this
;
1880 sym
= lookup_symbol (copy_name (yyvsp
[0].sval
),
1881 expression_context_block
,
1883 &is_a_field_of_this
,
1887 if (symbol_read_needs_frame (sym
))
1889 if (innermost_block
== 0 ||
1890 contained_in (block_found
,
1892 innermost_block
= block_found
;
1895 write_exp_elt_opcode (OP_VAR_VALUE
);
1896 /* We want to use the selected frame, not
1897 another more inner frame which happens to
1898 be in the same block. */
1899 write_exp_elt_block (NULL
);
1900 write_exp_elt_sym (sym
);
1901 write_exp_elt_opcode (OP_VAR_VALUE
);
1905 struct minimal_symbol
*msymbol
;
1906 char *arg
= copy_name (yyvsp
[0].sval
);
1909 lookup_minimal_symbol (arg
, NULL
, NULL
);
1910 if (msymbol
!= NULL
)
1914 lookup_function_type (builtin_type_int
),
1917 else if (!have_full_symbols () && !have_partial_symbols ())
1918 error ("No symbol table is loaded. Use the \"symbol-file\" command.");
1920 error ("No symbol \"%s\" in current context.",
1921 copy_name (yyvsp
[0].sval
));
1927 #line 643 "m2-exp.y"
1928 { yyval
.tval
= lookup_typename (copy_name (yyvsp
[0].sval
),
1929 expression_context_block
, 0); }
1935 /* Line 1000 of yacc.c. */
1936 #line 1937 "m2-exp.c.tmp"
1942 YY_STACK_PRINT (yyss
, yyssp
);
1947 /* Now `shift' the result of the reduction. Determine what state
1948 that goes to, based on the state we popped back to and the rule
1949 number reduced by. */
1953 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
1954 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
1955 yystate
= yytable
[yystate
];
1957 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
1962 /*------------------------------------.
1963 | yyerrlab -- here on detecting error |
1964 `------------------------------------*/
1966 /* If not already recovering from an error, report this error. */
1971 yyn
= yypact
[yystate
];
1973 if (YYPACT_NINF
< yyn
&& yyn
< YYLAST
)
1975 YYSIZE_T yysize
= 0;
1976 int yytype
= YYTRANSLATE (yychar
);
1977 const char* yyprefix
;
1981 /* Start YYX at -YYN if negative to avoid negative indexes in
1983 int yyxbegin
= yyn
< 0 ? -yyn
: 0;
1985 /* Stay within bounds of both yycheck and yytname. */
1986 int yychecklim
= YYLAST
- yyn
;
1987 int yyxend
= yychecklim
< YYNTOKENS
? yychecklim
: YYNTOKENS
;
1990 yyprefix
= ", expecting ";
1991 for (yyx
= yyxbegin
; yyx
< yyxend
; ++yyx
)
1992 if (yycheck
[yyx
+ yyn
] == yyx
&& yyx
!= YYTERROR
)
1994 yysize
+= yystrlen (yyprefix
) + yystrlen (yytname
[yyx
]);
2002 yysize
+= (sizeof ("syntax error, unexpected ")
2003 + yystrlen (yytname
[yytype
]));
2004 yymsg
= (char *) YYSTACK_ALLOC (yysize
);
2007 char *yyp
= yystpcpy (yymsg
, "syntax error, unexpected ");
2008 yyp
= yystpcpy (yyp
, yytname
[yytype
]);
2012 yyprefix
= ", expecting ";
2013 for (yyx
= yyxbegin
; yyx
< yyxend
; ++yyx
)
2014 if (yycheck
[yyx
+ yyn
] == yyx
&& yyx
!= YYTERROR
)
2016 yyp
= yystpcpy (yyp
, yyprefix
);
2017 yyp
= yystpcpy (yyp
, yytname
[yyx
]);
2022 YYSTACK_FREE (yymsg
);
2025 yyerror ("syntax error; also virtual memory exhausted");
2028 #endif /* YYERROR_VERBOSE */
2029 yyerror ("syntax error");
2034 if (yyerrstatus
== 3)
2036 /* If just tried and failed to reuse lookahead token after an
2037 error, discard it. */
2039 if (yychar
<= YYEOF
)
2041 /* If at end of input, pop the error token,
2042 then the rest of the stack, then return failure. */
2043 if (yychar
== YYEOF
)
2049 YYDSYMPRINTF ("Error: popping", yystos
[*yyssp
], yyvsp
, yylsp
);
2050 yydestruct (yystos
[*yyssp
], yyvsp
);
2055 YYDSYMPRINTF ("Error: discarding", yytoken
, &yylval
, &yylloc
);
2056 yydestruct (yytoken
, &yylval
);
2062 /* Else will try to reuse lookahead token after shifting the error
2067 /*---------------------------------------------------.
2068 | yyerrorlab -- error raised explicitly by YYERROR. |
2069 `---------------------------------------------------*/
2073 /* Pacify GCC when the user code never invokes YYERROR and the label
2074 yyerrorlab therefore never appears in user code. */
2085 /*-------------------------------------------------------------.
2086 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2087 `-------------------------------------------------------------*/
2089 yyerrstatus
= 3; /* Each real token shifted decrements this. */
2093 yyn
= yypact
[yystate
];
2094 if (yyn
!= YYPACT_NINF
)
2097 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
2105 /* Pop the current state because it cannot handle the error token. */
2109 YYDSYMPRINTF ("Error: popping", yystos
[*yyssp
], yyvsp
, yylsp
);
2110 yydestruct (yystos
[yystate
], yyvsp
);
2113 YY_STACK_PRINT (yyss
, yyssp
);
2119 YYDPRINTF ((stderr
, "Shifting error token, "));
2128 /*-------------------------------------.
2129 | yyacceptlab -- YYACCEPT comes here. |
2130 `-------------------------------------*/
2135 /*-----------------------------------.
2136 | yyabortlab -- YYABORT comes here. |
2137 `-----------------------------------*/
2143 /*----------------------------------------------.
2144 | yyoverflowlab -- parser overflow comes here. |
2145 `----------------------------------------------*/
2147 yyerror ("parser stack overflow");
2155 YYSTACK_FREE (yyss
);
2161 #line 648 "m2-exp.y"
2169 return (MAX_OF_TYPE(builtin_type_m2_int
) - b
) < a
;
2176 return (MAX_OF_TYPE(builtin_type_m2_card
) - b
) < a
;
2180 /* Take care of parsing a number (anything that starts with a digit).
2181 Set yylval and return the token type; update lexptr.
2182 LEN is the number of characters in it. */
2184 /*** Needs some error checking for the float case ***/
2194 int base
= input_radix
;
2196 int unsigned_p
= number_sign
== 1 ? 1 : 0;
2203 else if(p
[len
-1] == 'C' || p
[len
-1] == 'B')
2206 ischar
= p
[len
-1] == 'C';
2210 /* Scan the number */
2211 for (c
= 0; c
< len
; c
++)
2213 if (p
[c
] == '.' && base
== 10)
2215 /* It's a float since it contains a point. */
2216 yylval
.dval
= atof (p
);
2220 if (p
[c
] == '.' && base
!= 10)
2221 error("Floating point numbers must be base 10.");
2222 if (base
== 10 && (p
[c
] < '0' || p
[c
] > '9'))
2223 error("Invalid digit \'%c\' in number.",p
[c
]);
2230 if( base
== 8 && (c
== '8' || c
== '9'))
2231 error("Invalid digit \'%c\' in octal number.",c
);
2232 if (c
>= '0' && c
<= '9')
2236 if (base
== 16 && c
>= 'A' && c
<= 'F')
2244 if(!unsigned_p
&& number_sign
== 1 && (prevn
>= n
))
2245 unsigned_p
=1; /* Try something unsigned */
2246 /* Don't do the range check if n==i and i==0, since that special
2247 case will give an overflow error. */
2248 if(RANGE_CHECK
&& n
!=i
&& i
)
2250 if((unsigned_p
&& (unsigned)prevn
>= (unsigned)n
) ||
2251 ((!unsigned_p
&& number_sign
==-1) && -prevn
<= -n
))
2252 range_error("Overflow on numeric constant.");
2258 if(*p
== 'B' || *p
== 'C' || *p
== 'H')
2259 lexptr
++; /* Advance past B,C or H */
2266 else if ( unsigned_p
&& number_sign
== 1)
2271 else if((unsigned_p
&& (n
<0))) {
2272 range_error("Overflow on numeric constant -- number too large.");
2273 /* But, this can return if range_check == range_warn. */
2288 { {'<', '>'}, NOTEQUAL
},
2289 { {':', '='}, ASSIGN
},
2290 { {'<', '='}, LEQ
},
2291 { {'>', '='}, GEQ
},
2292 { {':', ':'}, COLONCOLON
},
2296 /* Some specific keywords */
2303 static struct keyword keytab
[] =
2306 {"IN", IN
},/* Note space after IN */
2307 {"AND", LOGICAL_AND
},
2325 {"FLOAT", FLOAT_FUNC
},
2330 /* Read one token, getting characters through lexptr. */
2332 /* This is where we will check to make sure that the language and the operators used are
2346 prev_lexptr
= lexptr
;
2351 /* See if it is a special token of length 2 */
2352 for( i
= 0 ; i
< (int) (sizeof tokentab2
/ sizeof tokentab2
[0]) ; i
++)
2353 if(DEPRECATED_STREQN(tokentab2
[i
].name
, tokstart
, 2))
2356 return tokentab2
[i
].token
;
2359 switch (c
= *tokstart
)
2376 if (paren_depth
== 0)
2383 if (comma_terminates
&& paren_depth
== 0)
2389 /* Might be a floating point number. */
2390 if (lexptr
[1] >= '0' && lexptr
[1] <= '9')
2391 break; /* Falls into number code. */
2398 /* These are character tokens that appear as-is in the YACC grammar */
2421 for (namelen
= 1; (c
= tokstart
[namelen
]) != quote
&& c
!= '\0'; namelen
++)
2424 c
= tokstart
[++namelen
];
2425 if (c
>= '0' && c
<= '9')
2427 c
= tokstart
[++namelen
];
2428 if (c
>= '0' && c
<= '9')
2429 c
= tokstart
[++namelen
];
2433 error("Unterminated string or character constant.");
2434 yylval
.sval
.ptr
= tokstart
+ 1;
2435 yylval
.sval
.length
= namelen
- 1;
2436 lexptr
+= namelen
+ 1;
2438 if(namelen
== 2) /* Single character */
2440 yylval
.ulval
= tokstart
[1];
2447 /* Is it a number? */
2448 /* Note: We have already dealt with the case of the token '.'.
2449 See case '.' above. */
2450 if ((c
>= '0' && c
<= '9'))
2452 /* It's a number. */
2453 int got_dot
= 0, got_e
= 0;
2459 if (!got_e
&& (*p
== 'e' || *p
== 'E'))
2460 got_dot
= got_e
= 1;
2461 else if (!got_dot
&& *p
== '.')
2463 else if (got_e
&& (p
[-1] == 'e' || p
[-1] == 'E')
2464 && (*p
== '-' || *p
== '+'))
2465 /* This is the sign of the exponent, not the end of the
2468 else if ((*p
< '0' || *p
> '9') &&
2469 (*p
< 'A' || *p
> 'F') &&
2470 (*p
!= 'H')) /* Modula-2 hexadecimal number */
2473 toktype
= parse_number (p
- tokstart
);
2474 if (toktype
== ERROR
)
2476 char *err_copy
= (char *) alloca (p
- tokstart
+ 1);
2478 memcpy (err_copy
, tokstart
, p
- tokstart
);
2479 err_copy
[p
- tokstart
] = 0;
2480 error ("Invalid number \"%s\".", err_copy
);
2486 if (!(c
== '_' || c
== '$'
2487 || (c
>= 'a' && c
<= 'z') || (c
>= 'A' && c
<= 'Z')))
2488 /* We must have come across a bad character (e.g. ';'). */
2489 error ("Invalid character '%c' in expression.", c
);
2491 /* It's a name. See how long it is. */
2493 for (c
= tokstart
[namelen
];
2494 (c
== '_' || c
== '$' || (c
>= '0' && c
<= '9')
2495 || (c
>= 'a' && c
<= 'z') || (c
>= 'A' && c
<= 'Z'));
2496 c
= tokstart
[++namelen
])
2499 /* The token "if" terminates the expression and is NOT
2500 removed from the input stream. */
2501 if (namelen
== 2 && tokstart
[0] == 'i' && tokstart
[1] == 'f')
2508 /* Lookup special keywords */
2509 for(i
= 0 ; i
< (int) (sizeof(keytab
) / sizeof(keytab
[0])) ; i
++)
2510 if(namelen
== strlen(keytab
[i
].keyw
) && DEPRECATED_STREQN(tokstart
,keytab
[i
].keyw
,namelen
))
2511 return keytab
[i
].token
;
2513 yylval
.sval
.ptr
= tokstart
;
2514 yylval
.sval
.length
= namelen
;
2516 if (*tokstart
== '$')
2518 write_dollar_variable (yylval
.sval
);
2519 return INTERNAL_VAR
;
2522 /* Use token-type BLOCKNAME for symbols that happen to be defined as
2523 functions. If this is not so, then ...
2524 Use token-type TYPENAME for symbols that happen to be defined
2525 currently as names of types; NAME for other symbols.
2526 The caller is not constrained to care about the distinction. */
2530 char *tmp
= copy_name (yylval
.sval
);
2533 if (lookup_partial_symtab (tmp
))
2535 sym
= lookup_symbol (tmp
, expression_context_block
,
2536 VAR_DOMAIN
, 0, NULL
);
2537 if (sym
&& SYMBOL_CLASS (sym
) == LOC_BLOCK
)
2539 if (lookup_typename (copy_name (yylval
.sval
), expression_context_block
, 1))
2551 case LOC_REGPARM_ADDR
:
2555 case LOC_BASEREG_ARG
:
2557 case LOC_CONST_BYTES
:
2558 case LOC_OPTIMIZED_OUT
:
2560 case LOC_COMPUTED_ARG
:
2570 error("internal: Undefined class in m2lex()");
2573 case LOC_UNRESOLVED
:
2574 error("internal: Unforseen case in m2lex()");
2577 error ("unhandled token in m2lex()");
2583 /* Built-in BOOLEAN type. This is sort of a hack. */
2584 if(DEPRECATED_STREQN(tokstart
,"TRUE",4))
2589 else if(DEPRECATED_STREQN(tokstart
,"FALSE",5))
2596 /* Must be another type of name... */
2603 make_qualname(mod
,ident
)
2606 char *new = xmalloc(strlen(mod
)+strlen(ident
)+2);
2620 lexptr
= prev_lexptr
;
2622 error ("A %s in expression, near `%s'.", (msg
? msg
: "error"), lexptr
);