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
115 #define BLOCKNAME 268
126 #define FLOAT_FUNC 279
136 #define COLONCOLON 289
137 #define INTERNAL_VAR 290
138 #define ABOVE_COMMA 291
145 #define LOGICAL_AND 298
156 /* Copy the first part of user declarations. */
161 #include "gdb_string.h"
162 #include "expression.h"
163 #include "language.h"
165 #include "parser-defs.h"
167 #include "bfd.h" /* Required by objfiles.h. */
168 #include "symfile.h" /* Required by objfiles.h. */
169 #include "objfiles.h" /* For have_full_symbols and have_partial_symbols */
172 #define parse_type builtin_type (parse_gdbarch)
173 #define parse_m2_type builtin_m2_type (parse_gdbarch)
175 /* Remap normal yacc parser interface names (yyparse, yylex, yyerror, etc),
176 as well as gratuitiously global symbol names, so we can have multiple
177 yacc generated parsers in gdb. Note that these are only the variables
178 produced by yacc. If other parser generators (bison, byacc, etc) produce
179 additional global names that conflict at link time, then those parser
180 generators need to be fixed instead of adding those names to this list. */
182 #define yymaxdepth m2_maxdepth
183 #define yyparse m2_parse
185 #define yyerror m2_error
186 #define yylval m2_lval
187 #define yychar m2_char
188 #define yydebug m2_debug
189 #define yypact m2_pact
196 #define yyexca m2_exca
197 #define yyerrflag m2_errflag
198 #define yynerrs m2_nerrs
202 #define yy_yys m2_yys
203 #define yystate m2_state
206 #define yy_yyv m2_yyv
208 #define yylloc m2_lloc
209 #define yyreds m2_reds /* With YYDEBUG defined */
210 #define yytoks m2_toks /* With YYDEBUG defined */
211 #define yyname m2_name /* With YYDEBUG defined */
212 #define yyrule m2_rule /* With YYDEBUG defined */
213 #define yylhs m2_yylhs
214 #define yylen m2_yylen
215 #define yydefred m2_yydefred
216 #define yydgoto m2_yydgoto
217 #define yysindex m2_yysindex
218 #define yyrindex m2_yyrindex
219 #define yygindex m2_yygindex
220 #define yytable m2_yytable
221 #define yycheck m2_yycheck
224 #define YYDEBUG 1 /* Default to yydebug support */
227 #define YYFPRINTF parser_fprintf
231 static int yylex (void);
233 void yyerror (char *);
236 static char *make_qualname (char *, char *);
239 static int parse_number (int);
241 /* The sign of the number being parsed. */
242 static int number_sign = 1;
244 /* The block that the module specified by the qualifer on an identifer is
247 static struct block *modblock=0;
252 /* Enabling traces. */
257 /* Enabling verbose error messages. */
258 #ifdef YYERROR_VERBOSE
259 # undef YYERROR_VERBOSE
260 # define YYERROR_VERBOSE 1
262 # define YYERROR_VERBOSE 0
265 #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
267 typedef union YYSTYPE {
276 enum exp_opcode opcode;
277 struct internalvar *ivar;
282 /* Line 191 of yacc.c. */
283 #line 284 "m2-exp.c.tmp"
284 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
285 # define YYSTYPE_IS_DECLARED 1
286 # define YYSTYPE_IS_TRIVIAL 1
291 /* Copy the second part of user declarations. */
294 /* Line 214 of yacc.c. */
295 #line 296 "m2-exp.c.tmp"
297 #if ! defined (yyoverflow) || YYERROR_VERBOSE
300 # define YYFREE xfree
303 # define YYMALLOC xmalloc
306 /* The parser invokes alloca or xmalloc; define the necessary symbols. */
308 # ifdef YYSTACK_USE_ALLOCA
309 # if YYSTACK_USE_ALLOCA
310 # define YYSTACK_ALLOC alloca
313 # if defined (alloca) || defined (_ALLOCA_H)
314 # define YYSTACK_ALLOC alloca
317 # define YYSTACK_ALLOC __builtin_alloca
322 # ifdef YYSTACK_ALLOC
323 /* Pacify GCC's `empty if-body' warning. */
324 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
326 # if defined (__STDC__) || defined (__cplusplus)
327 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
328 # define YYSIZE_T size_t
330 # define YYSTACK_ALLOC YYMALLOC
331 # define YYSTACK_FREE YYFREE
333 #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
336 #if (! defined (yyoverflow) \
337 && (! defined (__cplusplus) \
338 || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL)))
340 /* A type that is properly aligned for any stack member. */
347 /* The size of the maximum gap between one aligned stack and the next. */
348 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
350 /* The size of an array large to enough to hold all stacks, each with
352 # define YYSTACK_BYTES(N) \
353 ((N) * (sizeof (short) + sizeof (YYSTYPE)) \
354 + YYSTACK_GAP_MAXIMUM)
356 /* Copy COUNT objects from FROM to TO. The source and destination do
359 # if defined (__GNUC__) && 1 < __GNUC__
360 # define YYCOPY(To, From, Count) \
361 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
363 # define YYCOPY(To, From, Count) \
366 register YYSIZE_T yyi; \
367 for (yyi = 0; yyi < (Count); yyi++) \
368 (To)[yyi] = (From)[yyi]; \
374 /* Relocate STACK from its old location to the new one. The
375 local variables YYSIZE and YYSTACKSIZE give the old and new number of
376 elements in the stack, and YYPTR gives the new location of the
377 stack. Advance YYPTR to a properly aligned location for the next
379 # define YYSTACK_RELOCATE(Stack) \
382 YYSIZE_T yynewbytes; \
383 YYCOPY (&yyptr->Stack, Stack, yysize); \
384 Stack = &yyptr->Stack; \
385 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
386 yyptr += yynewbytes / sizeof (*yyptr); \
392 #if defined (__STDC__) || defined (__cplusplus)
393 typedef signed char yysigned_char;
395 typedef short yysigned_char;
398 /* YYFINAL -- State number of the termination state. */
400 /* YYLAST -- Last index in YYTABLE. */
403 /* YYNTOKENS -- Number of terminals. */
405 /* YYNNTS -- Number of nonterminals. */
407 /* YYNRULES -- Number of rules. */
409 /* YYNRULES -- Number of states. */
410 #define YYNSTATES 187
412 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
414 #define YYMAXUTOK 304
416 #define YYTRANSLATE(YYX) \
417 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
419 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
420 static const unsigned char yytranslate[] =
422 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
423 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
424 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
425 2, 2, 2, 2, 2, 42, 2, 2, 48, 2,
426 60, 65, 53, 51, 36, 52, 2, 54, 2, 2,
427 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
428 39, 41, 40, 2, 50, 2, 2, 2, 2, 2,
429 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
430 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
431 2, 59, 2, 68, 58, 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, 66, 2, 67, 62, 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, 2, 2, 2, 2,
443 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
444 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
445 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
446 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
447 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
448 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
449 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
450 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
451 35, 37, 38, 43, 44, 45, 46, 47, 49, 55,
456 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
458 static const unsigned short yyprhs[] =
460 0, 0, 3, 5, 7, 9, 12, 13, 17, 20,
461 23, 25, 27, 32, 37, 42, 47, 52, 57, 62,
462 69, 74, 79, 84, 89, 92, 97, 104, 109, 116,
463 120, 122, 126, 133, 140, 144, 149, 150, 156, 161,
464 162, 168, 169, 171, 175, 177, 181, 186, 191, 195,
465 199, 203, 207, 211, 215, 219, 223, 227, 231, 235,
466 239, 243, 247, 251, 255, 259, 263, 265, 267, 269,
467 271, 273, 275, 277, 282, 284, 286, 288, 292, 294,
471 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
472 static const yysigned_char yyrhs[] =
474 70, 0, -1, 72, -1, 71, -1, 83, -1, 72,
475 58, -1, -1, 52, 73, 72, -1, 51, 72, -1,
476 74, 72, -1, 63, -1, 62, -1, 18, 60, 72,
477 65, -1, 19, 60, 72, 65, -1, 21, 60, 72,
478 65, -1, 20, 60, 72, 65, -1, 22, 60, 83,
479 65, -1, 23, 60, 83, 65, -1, 24, 60, 72,
480 65, -1, 25, 60, 83, 36, 72, 65, -1, 26,
481 60, 72, 65, -1, 27, 60, 72, 65, -1, 28,
482 60, 72, 65, -1, 29, 60, 72, 65, -1, 17,
483 72, -1, 30, 60, 72, 65, -1, 30, 60, 72,
484 36, 72, 65, -1, 31, 60, 72, 65, -1, 31,
485 60, 72, 36, 72, 65, -1, 72, 61, 12, -1,
486 75, -1, 72, 43, 75, -1, 32, 60, 72, 36,
487 72, 65, -1, 33, 60, 72, 36, 72, 65, -1,
488 66, 78, 67, -1, 83, 66, 78, 67, -1, -1,
489 72, 59, 76, 79, 68, -1, 72, 59, 72, 68,
490 -1, -1, 72, 60, 77, 78, 65, -1, -1, 72,
491 -1, 78, 36, 72, -1, 72, -1, 79, 36, 72,
492 -1, 66, 83, 67, 72, -1, 83, 60, 72, 65,
493 -1, 60, 72, 65, -1, 72, 50, 72, -1, 72,
494 53, 72, -1, 72, 54, 72, -1, 72, 56, 72,
495 -1, 72, 55, 72, -1, 72, 51, 72, -1, 72,
496 52, 72, -1, 72, 41, 72, -1, 72, 44, 72,
497 -1, 72, 42, 72, -1, 72, 46, 72, -1, 72,
498 45, 72, -1, 72, 39, 72, -1, 72, 40, 72,
499 -1, 72, 49, 72, -1, 72, 47, 72, -1, 72,
500 38, 72, -1, 7, -1, 8, -1, 3, -1, 6,
501 -1, 9, -1, 10, -1, 82, -1, 17, 60, 83,
502 65, -1, 11, -1, 81, -1, 13, -1, 80, 34,
503 13, -1, 81, -1, 35, -1, 80, 34, 12, -1,
507 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
508 static const unsigned short yyrline[] =
510 0, 207, 207, 208, 211, 220, 225, 224, 231, 235,
511 239, 240, 243, 247, 251, 255, 259, 265, 271, 275,
512 281, 285, 289, 293, 297, 302, 306, 312, 316, 322,
513 328, 331, 335, 339, 343, 345, 355, 351, 362, 369,
514 366, 376, 379, 383, 388, 393, 398, 404, 410, 418,
515 422, 426, 430, 434, 438, 442, 446, 450, 452, 456,
516 460, 464, 468, 472, 476, 480, 487, 493, 499, 506,
517 515, 523, 530, 533, 540, 547, 551, 560, 572, 580,
522 #if YYDEBUG || YYERROR_VERBOSE
523 /* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
524 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
525 static const char *const yytname[] =
527 "$end", "error", "$undefined", "INT", "HEX", "ERROR", "UINT", "M2_TRUE",
528 "M2_FALSE", "CHAR", "FLOAT", "STRING", "NAME", "BLOCKNAME", "IDENT",
529 "VARNAME", "TYPENAME", "SIZE", "CAP", "ORD", "HIGH", "ABS", "MIN_FUNC",
530 "MAX_FUNC", "FLOAT_FUNC", "VAL", "CHR", "ODD", "TRUNC", "TSIZE", "INC",
531 "DEC", "INCL", "EXCL", "COLONCOLON", "INTERNAL_VAR", "','",
532 "ABOVE_COMMA", "ASSIGN", "'<'", "'>'", "'='", "'#'", "IN", "NOTEQUAL",
533 "GEQ", "LEQ", "OROR", "'&'", "LOGICAL_AND", "'@'", "'+'", "'-'", "'*'",
534 "'/'", "MOD", "DIV", "UNARY", "'^'", "'['", "'('", "DOT", "'~'", "NOT",
535 "QID", "')'", "'{'", "'}'", "']'", "$accept", "start", "type_exp", "exp",
536 "@1", "not_exp", "set", "@2", "@3", "arglist", "non_empty_arglist",
537 "block", "fblock", "variable", "type", 0
542 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
544 static const unsigned short yytoknum[] =
546 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
547 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
548 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
549 285, 286, 287, 288, 289, 290, 44, 291, 292, 60,
550 62, 61, 35, 293, 294, 295, 296, 297, 38, 298,
551 64, 43, 45, 42, 47, 299, 300, 301, 94, 91,
552 40, 302, 126, 303, 304, 41, 123, 125, 93
556 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
557 static const unsigned char yyr1[] =
559 0, 69, 70, 70, 71, 72, 73, 72, 72, 72,
560 74, 74, 72, 72, 72, 72, 72, 72, 72, 72,
561 72, 72, 72, 72, 72, 72, 72, 72, 72, 72,
562 72, 72, 72, 72, 75, 75, 76, 72, 72, 77,
563 72, 78, 78, 78, 79, 79, 72, 72, 72, 72,
564 72, 72, 72, 72, 72, 72, 72, 72, 72, 72,
565 72, 72, 72, 72, 72, 72, 72, 72, 72, 72,
566 72, 72, 72, 72, 72, 80, 81, 81, 82, 82,
570 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
571 static const unsigned char yyr2[] =
573 0, 2, 1, 1, 1, 2, 0, 3, 2, 2,
574 1, 1, 4, 4, 4, 4, 4, 4, 4, 6,
575 4, 4, 4, 4, 2, 4, 6, 4, 6, 3,
576 1, 3, 6, 6, 3, 4, 0, 5, 4, 0,
577 5, 0, 1, 3, 1, 3, 4, 4, 3, 3,
578 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
579 3, 3, 3, 3, 3, 3, 1, 1, 1, 1,
580 1, 1, 1, 4, 1, 1, 1, 3, 1, 1,
584 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
585 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
586 means the default is an error. */
587 static const unsigned char yydefact[] =
589 0, 68, 69, 66, 67, 70, 71, 74, 81, 76,
590 82, 0, 0, 0, 0, 0, 0, 0, 0, 0,
591 0, 0, 0, 0, 0, 0, 0, 0, 79, 0,
592 6, 0, 11, 10, 41, 0, 3, 2, 0, 30,
593 0, 78, 72, 4, 0, 24, 0, 0, 0, 0,
594 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
595 0, 0, 0, 8, 0, 0, 42, 0, 0, 1,
596 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
597 0, 0, 0, 0, 0, 0, 0, 0, 5, 0,
598 39, 0, 9, 0, 0, 41, 0, 0, 0, 0,
599 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
600 0, 0, 0, 7, 48, 0, 34, 0, 65, 61,
601 62, 56, 58, 41, 31, 0, 57, 60, 59, 64,
602 63, 49, 54, 55, 50, 51, 53, 52, 0, 0,
603 41, 29, 80, 77, 0, 0, 73, 12, 13, 15,
604 14, 16, 17, 18, 0, 20, 21, 22, 23, 0,
605 25, 0, 27, 0, 0, 43, 46, 38, 44, 0,
606 0, 47, 35, 0, 0, 0, 0, 0, 0, 37,
607 40, 19, 26, 28, 32, 33, 45
610 /* YYDEFGOTO[NTERM-NUM]. */
611 static const short yydefgoto[] =
613 -1, 35, 36, 66, 64, 38, 39, 139, 140, 67,
617 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
619 #define YYPACT_NINF -89
620 static const short yypact[] =
622 163, -89, -89, -89, -89, -89, -89, -89, -89, -89,
623 -89, 224, -54, -35, -30, -20, -19, -14, 3, 9,
624 15, 30, 31, 32, 33, 35, 36, 37, -89, 163,
625 -89, 163, -89, -89, 163, 28, -89, 838, 163, -89,
626 11, 65, -89, -27, 163, 7, -27, 163, 163, 163,
627 163, 84, 84, 163, 84, 163, 163, 163, 163, 163,
628 163, 163, 163, 7, 163, 340, 838, -32, -40, -89,
629 163, 163, 163, 163, 163, -15, 163, 163, 163, 163,
630 163, 163, 163, 163, 163, 163, 163, 163, -89, 163,
631 -89, 89, 7, -4, 163, 163, -23, 368, 396, 424,
632 452, 38, 39, 480, 66, 508, 536, 564, 592, 284,
633 312, 788, 814, 7, -89, 163, -89, 163, 862, -37,
634 -37, -37, -37, 163, -89, 41, -37, -37, -37, 72,
635 90, 148, 207, 207, 7, 7, 7, 7, 253, 163,
636 163, -89, -89, -89, 620, -31, -89, -89, -89, -89,
637 -89, -89, -89, -89, 163, -89, -89, -89, -89, 163,
638 -89, 163, -89, 163, 163, 838, 7, -89, 838, -34,
639 -33, -89, -89, 648, 676, 704, 732, 760, 163, -89,
640 -89, -89, -89, -89, -89, -89, 838
643 /* YYPGOTO[NTERM-NUM]. */
644 static const yysigned_char yypgoto[] =
646 -89, -89, -89, 0, -89, -89, 34, -89, -89, -88,
647 -89, -89, -89, -89, 54
650 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
651 positive, shift that token. If negative, reduce the rule which
652 number is the opposite. If zero, do what YYDEFACT says.
653 If YYTABLE_NINF, syntax error. */
654 #define YYTABLE_NINF -76
655 static const short yytable[] =
657 37, 10, 178, 115, 115, 115, 47, 145, 142, 143,
658 79, 45, 80, 81, 82, 83, 84, 85, 86, 87,
659 94, 88, 89, 90, 91, 48, 95, 117, 69, 63,
660 49, 65, 180, 94, 179, 116, 172, 94, 92, 95,
661 50, 51, 146, 95, 65, 93, 52, 97, 98, 99,
662 100, 123, 170, 103, 43, 105, 106, 107, 108, 109,
663 110, 111, 112, 53, 113, 88, 89, 90, 91, 54,
664 118, 119, 120, 121, 122, 55, 126, 127, 128, 129,
665 130, 131, 132, 133, 134, 135, 136, 137, 68, 138,
666 56, 57, 58, 59, 144, 60, 61, 62, 96, -75,
667 10, 141, 154, 151, 152, 101, 102, 95, 104, 124,
668 0, 0, 0, 0, 0, 165, 0, 166, 0, 0,
669 0, 80, 81, 82, 83, 84, 85, 86, 87, 125,
670 88, 89, 90, 91, 0, 0, 0, 0, 0, 168,
671 81, 82, 83, 84, 85, 86, 87, 0, 88, 89,
672 90, 91, 0, 0, 173, 0, 0, 0, 0, 174,
673 0, 175, 0, 176, 177, 0, 1, 0, 0, 2,
674 3, 4, 5, 6, 7, 8, 9, 0, 186, 10,
675 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
676 21, 22, 23, 24, 25, 26, 27, 0, 28, 82,
677 83, 84, 85, 86, 87, 0, 88, 89, 90, 91,
678 0, 0, 0, 0, 29, 30, 0, 0, 0, 0,
679 0, 0, 0, 31, 0, 32, 33, 1, 0, 34,
680 2, 3, 4, 5, 6, 7, 8, 9, 0, 0,
681 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
682 20, 21, 22, 23, 24, 25, 26, 27, 0, 28,
683 84, 85, 86, 87, 0, 88, 89, 90, 91, 0,
684 0, 0, 0, 0, 0, 29, 30, 0, 0, 0,
685 0, 0, 0, 0, 44, 0, 32, 33, 0, 0,
686 34, 70, 71, 72, 73, 74, 75, 76, 77, 78,
687 79, 0, 80, 81, 82, 83, 84, 85, 86, 87,
688 0, 88, 89, 90, 91, 0, 0, 0, 0, 0,
689 159, 167, 70, 71, 72, 73, 74, 75, 76, 77,
690 78, 79, 0, 80, 81, 82, 83, 84, 85, 86,
691 87, 0, 88, 89, 90, 91, 0, 0, 161, 160,
692 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
693 0, 80, 81, 82, 83, 84, 85, 86, 87, 0,
694 88, 89, 90, 91, 0, 0, 0, 162, 70, 71,
695 72, 73, 74, 75, 76, 77, 78, 79, 0, 80,
696 81, 82, 83, 84, 85, 86, 87, 0, 88, 89,
697 90, 91, 0, 0, 0, 114, 70, 71, 72, 73,
698 74, 75, 76, 77, 78, 79, 0, 80, 81, 82,
699 83, 84, 85, 86, 87, 0, 88, 89, 90, 91,
700 0, 0, 0, 147, 70, 71, 72, 73, 74, 75,
701 76, 77, 78, 79, 0, 80, 81, 82, 83, 84,
702 85, 86, 87, 0, 88, 89, 90, 91, 0, 0,
703 0, 148, 70, 71, 72, 73, 74, 75, 76, 77,
704 78, 79, 0, 80, 81, 82, 83, 84, 85, 86,
705 87, 0, 88, 89, 90, 91, 0, 0, 0, 149,
706 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
707 0, 80, 81, 82, 83, 84, 85, 86, 87, 0,
708 88, 89, 90, 91, 0, 0, 0, 150, 70, 71,
709 72, 73, 74, 75, 76, 77, 78, 79, 0, 80,
710 81, 82, 83, 84, 85, 86, 87, 0, 88, 89,
711 90, 91, 0, 0, 0, 153, 70, 71, 72, 73,
712 74, 75, 76, 77, 78, 79, 0, 80, 81, 82,
713 83, 84, 85, 86, 87, 0, 88, 89, 90, 91,
714 0, 0, 0, 155, 70, 71, 72, 73, 74, 75,
715 76, 77, 78, 79, 0, 80, 81, 82, 83, 84,
716 85, 86, 87, 0, 88, 89, 90, 91, 0, 0,
717 0, 156, 70, 71, 72, 73, 74, 75, 76, 77,
718 78, 79, 0, 80, 81, 82, 83, 84, 85, 86,
719 87, 0, 88, 89, 90, 91, 0, 0, 0, 157,
720 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
721 0, 80, 81, 82, 83, 84, 85, 86, 87, 0,
722 88, 89, 90, 91, 0, 0, 0, 158, 70, 71,
723 72, 73, 74, 75, 76, 77, 78, 79, 0, 80,
724 81, 82, 83, 84, 85, 86, 87, 0, 88, 89,
725 90, 91, 0, 0, 0, 171, 70, 71, 72, 73,
726 74, 75, 76, 77, 78, 79, 0, 80, 81, 82,
727 83, 84, 85, 86, 87, 0, 88, 89, 90, 91,
728 0, 0, 0, 181, 70, 71, 72, 73, 74, 75,
729 76, 77, 78, 79, 0, 80, 81, 82, 83, 84,
730 85, 86, 87, 0, 88, 89, 90, 91, 0, 0,
731 0, 182, 70, 71, 72, 73, 74, 75, 76, 77,
732 78, 79, 0, 80, 81, 82, 83, 84, 85, 86,
733 87, 0, 88, 89, 90, 91, 0, 0, 0, 183,
734 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
735 0, 80, 81, 82, 83, 84, 85, 86, 87, 0,
736 88, 89, 90, 91, 0, 0, 0, 184, 70, 71,
737 72, 73, 74, 75, 76, 77, 78, 79, 0, 80,
738 81, 82, 83, 84, 85, 86, 87, 0, 88, 89,
739 90, 91, 0, 0, 163, 185, 70, 71, 72, 73,
740 74, 75, 76, 77, 78, 79, 0, 80, 81, 82,
741 83, 84, 85, 86, 87, 0, 88, 89, 90, 91,
742 164, 0, 70, 71, 72, 73, 74, 75, 76, 77,
743 78, 79, 0, 80, 81, 82, 83, 84, 85, 86,
744 87, 0, 88, 89, 90, 91, 70, 71, 72, 73,
745 74, 75, 76, 77, 78, 79, 0, 80, 81, 82,
746 83, 84, 85, 86, 87, 0, 88, 89, 90, 91,
747 -76, 71, 72, 73, 74, 75, 76, 77, 78, 79,
748 0, 80, 81, 82, 83, 84, 85, 86, 87, 0,
752 static const short yycheck[] =
754 0, 16, 36, 36, 36, 36, 60, 95, 12, 13,
755 47, 11, 49, 50, 51, 52, 53, 54, 55, 56,
756 60, 58, 59, 60, 61, 60, 66, 67, 0, 29,
757 60, 31, 65, 60, 68, 67, 67, 60, 38, 66,
758 60, 60, 65, 66, 44, 34, 60, 47, 48, 49,
759 50, 66, 140, 53, 0, 55, 56, 57, 58, 59,
760 60, 61, 62, 60, 64, 58, 59, 60, 61, 60,
761 70, 71, 72, 73, 74, 60, 76, 77, 78, 79,
762 80, 81, 82, 83, 84, 85, 86, 87, 34, 89,
763 60, 60, 60, 60, 94, 60, 60, 60, 44, 34,
764 16, 12, 36, 65, 65, 51, 52, 66, 54, 75,
765 -1, -1, -1, -1, -1, 115, -1, 117, -1, -1,
766 -1, 49, 50, 51, 52, 53, 54, 55, 56, 75,
767 58, 59, 60, 61, -1, -1, -1, -1, -1, 139,
768 50, 51, 52, 53, 54, 55, 56, -1, 58, 59,
769 60, 61, -1, -1, 154, -1, -1, -1, -1, 159,
770 -1, 161, -1, 163, 164, -1, 3, -1, -1, 6,
771 7, 8, 9, 10, 11, 12, 13, -1, 178, 16,
772 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
773 27, 28, 29, 30, 31, 32, 33, -1, 35, 51,
774 52, 53, 54, 55, 56, -1, 58, 59, 60, 61,
775 -1, -1, -1, -1, 51, 52, -1, -1, -1, -1,
776 -1, -1, -1, 60, -1, 62, 63, 3, -1, 66,
777 6, 7, 8, 9, 10, 11, 12, 13, -1, -1,
778 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
779 26, 27, 28, 29, 30, 31, 32, 33, -1, 35,
780 53, 54, 55, 56, -1, 58, 59, 60, 61, -1,
781 -1, -1, -1, -1, -1, 51, 52, -1, -1, -1,
782 -1, -1, -1, -1, 60, -1, 62, 63, -1, -1,
783 66, 38, 39, 40, 41, 42, 43, 44, 45, 46,
784 47, -1, 49, 50, 51, 52, 53, 54, 55, 56,
785 -1, 58, 59, 60, 61, -1, -1, -1, -1, -1,
786 36, 68, 38, 39, 40, 41, 42, 43, 44, 45,
787 46, 47, -1, 49, 50, 51, 52, 53, 54, 55,
788 56, -1, 58, 59, 60, 61, -1, -1, 36, 65,
789 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
790 -1, 49, 50, 51, 52, 53, 54, 55, 56, -1,
791 58, 59, 60, 61, -1, -1, -1, 65, 38, 39,
792 40, 41, 42, 43, 44, 45, 46, 47, -1, 49,
793 50, 51, 52, 53, 54, 55, 56, -1, 58, 59,
794 60, 61, -1, -1, -1, 65, 38, 39, 40, 41,
795 42, 43, 44, 45, 46, 47, -1, 49, 50, 51,
796 52, 53, 54, 55, 56, -1, 58, 59, 60, 61,
797 -1, -1, -1, 65, 38, 39, 40, 41, 42, 43,
798 44, 45, 46, 47, -1, 49, 50, 51, 52, 53,
799 54, 55, 56, -1, 58, 59, 60, 61, -1, -1,
800 -1, 65, 38, 39, 40, 41, 42, 43, 44, 45,
801 46, 47, -1, 49, 50, 51, 52, 53, 54, 55,
802 56, -1, 58, 59, 60, 61, -1, -1, -1, 65,
803 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
804 -1, 49, 50, 51, 52, 53, 54, 55, 56, -1,
805 58, 59, 60, 61, -1, -1, -1, 65, 38, 39,
806 40, 41, 42, 43, 44, 45, 46, 47, -1, 49,
807 50, 51, 52, 53, 54, 55, 56, -1, 58, 59,
808 60, 61, -1, -1, -1, 65, 38, 39, 40, 41,
809 42, 43, 44, 45, 46, 47, -1, 49, 50, 51,
810 52, 53, 54, 55, 56, -1, 58, 59, 60, 61,
811 -1, -1, -1, 65, 38, 39, 40, 41, 42, 43,
812 44, 45, 46, 47, -1, 49, 50, 51, 52, 53,
813 54, 55, 56, -1, 58, 59, 60, 61, -1, -1,
814 -1, 65, 38, 39, 40, 41, 42, 43, 44, 45,
815 46, 47, -1, 49, 50, 51, 52, 53, 54, 55,
816 56, -1, 58, 59, 60, 61, -1, -1, -1, 65,
817 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
818 -1, 49, 50, 51, 52, 53, 54, 55, 56, -1,
819 58, 59, 60, 61, -1, -1, -1, 65, 38, 39,
820 40, 41, 42, 43, 44, 45, 46, 47, -1, 49,
821 50, 51, 52, 53, 54, 55, 56, -1, 58, 59,
822 60, 61, -1, -1, -1, 65, 38, 39, 40, 41,
823 42, 43, 44, 45, 46, 47, -1, 49, 50, 51,
824 52, 53, 54, 55, 56, -1, 58, 59, 60, 61,
825 -1, -1, -1, 65, 38, 39, 40, 41, 42, 43,
826 44, 45, 46, 47, -1, 49, 50, 51, 52, 53,
827 54, 55, 56, -1, 58, 59, 60, 61, -1, -1,
828 -1, 65, 38, 39, 40, 41, 42, 43, 44, 45,
829 46, 47, -1, 49, 50, 51, 52, 53, 54, 55,
830 56, -1, 58, 59, 60, 61, -1, -1, -1, 65,
831 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
832 -1, 49, 50, 51, 52, 53, 54, 55, 56, -1,
833 58, 59, 60, 61, -1, -1, -1, 65, 38, 39,
834 40, 41, 42, 43, 44, 45, 46, 47, -1, 49,
835 50, 51, 52, 53, 54, 55, 56, -1, 58, 59,
836 60, 61, -1, -1, 36, 65, 38, 39, 40, 41,
837 42, 43, 44, 45, 46, 47, -1, 49, 50, 51,
838 52, 53, 54, 55, 56, -1, 58, 59, 60, 61,
839 36, -1, 38, 39, 40, 41, 42, 43, 44, 45,
840 46, 47, -1, 49, 50, 51, 52, 53, 54, 55,
841 56, -1, 58, 59, 60, 61, 38, 39, 40, 41,
842 42, 43, 44, 45, 46, 47, -1, 49, 50, 51,
843 52, 53, 54, 55, 56, -1, 58, 59, 60, 61,
844 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
845 -1, 49, 50, 51, 52, 53, 54, 55, 56, -1,
849 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
850 symbol of state STATE-NUM. */
851 static const unsigned char yystos[] =
853 0, 3, 6, 7, 8, 9, 10, 11, 12, 13,
854 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
855 26, 27, 28, 29, 30, 31, 32, 33, 35, 51,
856 52, 60, 62, 63, 66, 70, 71, 72, 74, 75,
857 80, 81, 82, 83, 60, 72, 83, 60, 60, 60,
858 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
859 60, 60, 60, 72, 73, 72, 72, 78, 83, 0,
860 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
861 49, 50, 51, 52, 53, 54, 55, 56, 58, 59,
862 60, 61, 72, 34, 60, 66, 83, 72, 72, 72,
863 72, 83, 83, 72, 83, 72, 72, 72, 72, 72,
864 72, 72, 72, 72, 65, 36, 67, 67, 72, 72,
865 72, 72, 72, 66, 75, 83, 72, 72, 72, 72,
866 72, 72, 72, 72, 72, 72, 72, 72, 72, 76,
867 77, 12, 12, 13, 72, 78, 65, 65, 65, 65,
868 65, 65, 65, 65, 36, 65, 65, 65, 65, 36,
869 65, 36, 65, 36, 36, 72, 72, 68, 72, 79,
870 78, 65, 67, 72, 72, 72, 72, 72, 36, 68,
871 65, 65, 65, 65, 65, 65, 72
874 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
875 # define YYSIZE_T __SIZE_TYPE__
877 #if ! defined (YYSIZE_T) && defined (size_t)
878 # define YYSIZE_T size_t
880 #if ! defined (YYSIZE_T)
881 # if defined (__STDC__) || defined (__cplusplus)
882 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
883 # define YYSIZE_T size_t
886 #if ! defined (YYSIZE_T)
887 # define YYSIZE_T unsigned int
890 #define yyerrok (yyerrstatus = 0)
891 #define yyclearin (yychar = YYEMPTY)
895 #define YYACCEPT goto yyacceptlab
896 #define YYABORT goto yyabortlab
897 #define YYERROR goto yyerrorlab
900 /* Like YYERROR except do call yyerror. This remains here temporarily
901 to ease the transition to the new meaning of YYERROR, for GCC.
902 Once GCC version 2 has supplanted version 1, this can go. */
904 #define YYFAIL goto yyerrlab
906 #define YYRECOVERING() (!!yyerrstatus)
908 #define YYBACKUP(Token, Value) \
910 if (yychar == YYEMPTY && yylen == 1) \
914 yytoken = YYTRANSLATE (yychar); \
920 yyerror ("syntax error: cannot back up");\
926 #define YYERRCODE 256
928 /* YYLLOC_DEFAULT -- Compute the default location (before the actions
931 #ifndef YYLLOC_DEFAULT
932 # define YYLLOC_DEFAULT(Current, Rhs, N) \
933 ((Current).first_line = (Rhs)[1].first_line, \
934 (Current).first_column = (Rhs)[1].first_column, \
935 (Current).last_line = (Rhs)[N].last_line, \
936 (Current).last_column = (Rhs)[N].last_column)
939 /* YYLEX -- calling `yylex' with the right arguments. */
942 # define YYLEX yylex (YYLEX_PARAM)
944 # define YYLEX yylex ()
947 /* Enable debugging if requested. */
951 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
952 # define YYFPRINTF fprintf
955 # define YYDPRINTF(Args) \
961 # define YYDSYMPRINT(Args) \
967 # define YYDSYMPRINTF(Title, Token, Value, Location) \
971 YYFPRINTF (stderr, "%s ", Title); \
972 yysymprint (stderr, \
974 YYFPRINTF (stderr, "\n"); \
978 /*------------------------------------------------------------------.
979 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
981 `------------------------------------------------------------------*/
983 #if defined (__STDC__) || defined (__cplusplus)
985 yy_stack_print (short *bottom, short *top)
988 yy_stack_print (bottom, top)
993 YYFPRINTF (stderr, "Stack now");
994 for (/* Nothing. */; bottom <= top; ++bottom)
995 YYFPRINTF (stderr, " %d", *bottom);
996 YYFPRINTF (stderr, "\n");
999 # define YY_STACK_PRINT(Bottom, Top) \
1002 yy_stack_print ((Bottom), (Top)); \
1006 /*------------------------------------------------.
1007 | Report that the YYRULE is going to be reduced. |
1008 `------------------------------------------------*/
1010 #if defined (__STDC__) || defined (__cplusplus)
1012 yy_reduce_print (int yyrule)
1015 yy_reduce_print (yyrule)
1020 unsigned int yylno = yyrline[yyrule];
1021 YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ",
1023 /* Print the symbols being reduced, and their result. */
1024 for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
1025 YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]);
1026 YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]);
1029 # define YY_REDUCE_PRINT(Rule) \
1032 yy_reduce_print (Rule); \
1035 /* Nonzero means print parse trace. It is left uninitialized so that
1036 multiple parsers can coexist. */
1038 #else /* !YYDEBUG */
1039 # define YYDPRINTF(Args)
1040 # define YYDSYMPRINT(Args)
1041 # define YYDSYMPRINTF(Title, Token, Value, Location)
1042 # define YY_STACK_PRINT(Bottom, Top)
1043 # define YY_REDUCE_PRINT(Rule)
1044 #endif /* !YYDEBUG */
1047 /* YYINITDEPTH -- initial size of the parser's stacks. */
1049 # define YYINITDEPTH 200
1052 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1053 if the built-in stack extension method is used).
1055 Do not make this value too large; the results are undefined if
1056 SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
1057 evaluated with infinite-precision integer arithmetic. */
1059 #if defined (YYMAXDEPTH) && YYMAXDEPTH == 0
1064 # define YYMAXDEPTH 10000
1072 # if defined (__GLIBC__) && defined (_STRING_H)
1073 # define yystrlen strlen
1075 /* Return the length of YYSTR. */
1077 # if defined (__STDC__) || defined (__cplusplus)
1078 yystrlen (const char *yystr)
1084 register const char *yys = yystr;
1086 while (*yys++ != '\0')
1089 return yys - yystr - 1;
1095 # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
1096 # define yystpcpy stpcpy
1098 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1101 # if defined (__STDC__) || defined (__cplusplus)
1102 yystpcpy (char *yydest, const char *yysrc)
1104 yystpcpy (yydest, yysrc)
1109 register char *yyd = yydest;
1110 register const char *yys = yysrc;
1112 while ((*yyd++ = *yys++) != '\0')
1120 #endif /* !YYERROR_VERBOSE */
1125 /*--------------------------------.
1126 | Print this symbol on YYOUTPUT. |
1127 `--------------------------------*/
1129 #if defined (__STDC__) || defined (__cplusplus)
1131 yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
1134 yysymprint (yyoutput, yytype, yyvaluep)
1140 /* Pacify ``unused variable'' warnings. */
1143 if (yytype < YYNTOKENS)
1145 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
1147 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
1151 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
1158 YYFPRINTF (yyoutput, ")");
1161 #endif /* ! YYDEBUG */
1162 /*-----------------------------------------------.
1163 | Release the memory associated to this symbol. |
1164 `-----------------------------------------------*/
1166 #if defined (__STDC__) || defined (__cplusplus)
1168 yydestruct (int yytype, YYSTYPE *yyvaluep)
1171 yydestruct (yytype, yyvaluep)
1176 /* Pacify ``unused variable'' warnings. */
1188 /* Prevent warnings from -Wmissing-prototypes. */
1190 #ifdef YYPARSE_PARAM
1191 # if defined (__STDC__) || defined (__cplusplus)
1192 int yyparse (void *YYPARSE_PARAM);
1196 #else /* ! YYPARSE_PARAM */
1197 #if defined (__STDC__) || defined (__cplusplus)
1202 #endif /* ! YYPARSE_PARAM */
1206 /* The lookahead symbol. */
1209 /* The semantic value of the lookahead symbol. */
1212 /* Number of syntax errors so far. */
1221 #ifdef YYPARSE_PARAM
1222 # if defined (__STDC__) || defined (__cplusplus)
1223 int yyparse (void *YYPARSE_PARAM)
1225 int yyparse (YYPARSE_PARAM)
1226 void *YYPARSE_PARAM;
1228 #else /* ! YYPARSE_PARAM */
1229 #if defined (__STDC__) || defined (__cplusplus)
1240 register int yystate;
1243 /* Number of tokens to shift before error messages enabled. */
1245 /* Lookahead token as an internal (translated) token number. */
1248 /* Three stacks and their tools:
1249 `yyss': related to states,
1250 `yyvs': related to semantic values,
1251 `yyls': related to locations.
1253 Refer to the stacks thru separate pointers, to allow yyoverflow
1254 to xreallocate them elsewhere. */
1256 /* The state stack. */
1257 short yyssa[YYINITDEPTH];
1258 short *yyss = yyssa;
1259 register short *yyssp;
1261 /* The semantic value stack. */
1262 YYSTYPE yyvsa[YYINITDEPTH];
1263 YYSTYPE *yyvs = yyvsa;
1264 register YYSTYPE *yyvsp;
1268 #define YYPOPSTACK (yyvsp--, yyssp--)
1270 YYSIZE_T yystacksize = YYINITDEPTH;
1272 /* The variables used to return semantic value and location from the
1277 /* When reducing, the number of symbols on the RHS of the reduced
1281 YYDPRINTF ((stderr, "Starting parse\n"));
1286 yychar = YYEMPTY; /* Cause a token to be read. */
1288 /* Initialize stack pointers.
1289 Waste one element of value and location stack
1290 so that they stay on the same level as the state stack.
1291 The wasted elements are never initialized. */
1298 /*------------------------------------------------------------.
1299 | yynewstate -- Push a new state, which is found in yystate. |
1300 `------------------------------------------------------------*/
1302 /* In all cases, when you get here, the value and location stacks
1303 have just been pushed. so pushing a state here evens the stacks.
1310 if (yyss + yystacksize - 1 <= yyssp)
1312 /* Get the current used size of the three stacks, in elements. */
1313 YYSIZE_T yysize = yyssp - yyss + 1;
1317 /* Give user a chance to xreallocate the stack. Use copies of
1318 these so that the &'s don't force the real ones into
1320 YYSTYPE *yyvs1 = yyvs;
1321 short *yyss1 = yyss;
1324 /* Each stack pointer address is followed by the size of the
1325 data in use in that stack, in bytes. This used to be a
1326 conditional around just the two extra args, but that might
1327 be undefined if yyoverflow is a macro. */
1328 yyoverflow ("parser stack overflow",
1329 &yyss1, yysize * sizeof (*yyssp),
1330 &yyvs1, yysize * sizeof (*yyvsp),
1337 #else /* no yyoverflow */
1338 # ifndef YYSTACK_RELOCATE
1341 /* Extend the stack our own way. */
1342 if (YYMAXDEPTH <= yystacksize)
1345 if (YYMAXDEPTH < yystacksize)
1346 yystacksize = YYMAXDEPTH;
1349 short *yyss1 = yyss;
1350 union yyalloc *yyptr =
1351 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1354 YYSTACK_RELOCATE (yyss);
1355 YYSTACK_RELOCATE (yyvs);
1357 # undef YYSTACK_RELOCATE
1359 YYSTACK_FREE (yyss1);
1362 #endif /* no yyoverflow */
1364 yyssp = yyss + yysize - 1;
1365 yyvsp = yyvs + yysize - 1;
1368 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1369 (unsigned long int) yystacksize));
1371 if (yyss + yystacksize - 1 <= yyssp)
1375 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1384 /* Do appropriate processing given the current state. */
1385 /* Read a lookahead token if we need one and don't already have one. */
1388 /* First try to decide what to do without reference to lookahead token. */
1390 yyn = yypact[yystate];
1391 if (yyn == YYPACT_NINF)
1394 /* Not known => get a lookahead token if don't already have one. */
1396 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1397 if (yychar == YYEMPTY)
1399 YYDPRINTF ((stderr, "Reading a token: "));
1403 if (yychar <= YYEOF)
1405 yychar = yytoken = YYEOF;
1406 YYDPRINTF ((stderr, "Now at end of input.\n"));
1410 yytoken = YYTRANSLATE (yychar);
1411 YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc);
1414 /* If the proper action on seeing token YYTOKEN is to reduce or to
1415 detect an error, take that action. */
1417 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1422 if (yyn == 0 || yyn == YYTABLE_NINF)
1431 /* Shift the lookahead token. */
1432 YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken]));
1434 /* Discard the token being shifted unless it is eof. */
1435 if (yychar != YYEOF)
1441 /* Count tokens shifted since error; after three, turn off error
1450 /*-----------------------------------------------------------.
1451 | yydefault -- do the default action for the current state. |
1452 `-----------------------------------------------------------*/
1454 yyn = yydefact[yystate];
1460 /*-----------------------------.
1461 | yyreduce -- Do a reduction. |
1462 `-----------------------------*/
1464 /* yyn is the number of a rule to reduce with. */
1467 /* If YYLEN is nonzero, implement the default value of the action:
1470 Otherwise, the following line sets YYVAL to garbage.
1471 This behavior is undocumented and Bison
1472 users should not rely upon it. Assigning to YYVAL
1473 unconditionally makes the parser a bit smaller, and it avoids a
1474 GCC warning that YYVAL may be used uninitialized. */
1475 yyval = yyvsp[1-yylen];
1478 YY_REDUCE_PRINT (yyn);
1482 #line 212 "m2-exp.y"
1483 { write_exp_elt_opcode(OP_TYPE);
1484 write_exp_elt_type(yyvsp[0].tval);
1485 write_exp_elt_opcode(OP_TYPE);
1490 #line 221 "m2-exp.y"
1491 { write_exp_elt_opcode (UNOP_IND); }
1495 #line 225 "m2-exp.y"
1496 { number_sign = -1; }
1500 #line 227 "m2-exp.y"
1502 write_exp_elt_opcode (UNOP_NEG); }
1506 #line 232 "m2-exp.y"
1507 { write_exp_elt_opcode(UNOP_PLUS); }
1511 #line 236 "m2-exp.y"
1512 { write_exp_elt_opcode (UNOP_LOGICAL_NOT); }
1516 #line 244 "m2-exp.y"
1517 { write_exp_elt_opcode (UNOP_CAP); }
1521 #line 248 "m2-exp.y"
1522 { write_exp_elt_opcode (UNOP_ORD); }
1526 #line 252 "m2-exp.y"
1527 { write_exp_elt_opcode (UNOP_ABS); }
1531 #line 256 "m2-exp.y"
1532 { write_exp_elt_opcode (UNOP_HIGH); }
1536 #line 260 "m2-exp.y"
1537 { write_exp_elt_opcode (UNOP_MIN);
1538 write_exp_elt_type (yyvsp[-1].tval);
1539 write_exp_elt_opcode (UNOP_MIN); }
1543 #line 266 "m2-exp.y"
1544 { write_exp_elt_opcode (UNOP_MAX);
1545 write_exp_elt_type (yyvsp[-1].tval);
1546 write_exp_elt_opcode (UNOP_MAX); }
1550 #line 272 "m2-exp.y"
1551 { write_exp_elt_opcode (UNOP_FLOAT); }
1555 #line 276 "m2-exp.y"
1556 { write_exp_elt_opcode (BINOP_VAL);
1557 write_exp_elt_type (yyvsp[-3].tval);
1558 write_exp_elt_opcode (BINOP_VAL); }
1562 #line 282 "m2-exp.y"
1563 { write_exp_elt_opcode (UNOP_CHR); }
1567 #line 286 "m2-exp.y"
1568 { write_exp_elt_opcode (UNOP_ODD); }
1572 #line 290 "m2-exp.y"
1573 { write_exp_elt_opcode (UNOP_TRUNC); }
1577 #line 294 "m2-exp.y"
1578 { write_exp_elt_opcode (UNOP_SIZEOF); }
1582 #line 298 "m2-exp.y"
1583 { write_exp_elt_opcode (UNOP_SIZEOF); }
1587 #line 303 "m2-exp.y"
1588 { write_exp_elt_opcode(UNOP_PREINCREMENT); }
1592 #line 307 "m2-exp.y"
1593 { write_exp_elt_opcode(BINOP_ASSIGN_MODIFY);
1594 write_exp_elt_opcode(BINOP_ADD);
1595 write_exp_elt_opcode(BINOP_ASSIGN_MODIFY); }
1599 #line 313 "m2-exp.y"
1600 { write_exp_elt_opcode(UNOP_PREDECREMENT);}
1604 #line 317 "m2-exp.y"
1605 { write_exp_elt_opcode(BINOP_ASSIGN_MODIFY);
1606 write_exp_elt_opcode(BINOP_SUB);
1607 write_exp_elt_opcode(BINOP_ASSIGN_MODIFY); }
1611 #line 323 "m2-exp.y"
1612 { write_exp_elt_opcode (STRUCTOP_STRUCT);
1613 write_exp_string (yyvsp[0].sval);
1614 write_exp_elt_opcode (STRUCTOP_STRUCT); }
1618 #line 332 "m2-exp.y"
1619 { error("Sets are not implemented.");}
1623 #line 336 "m2-exp.y"
1624 { error("Sets are not implemented.");}
1628 #line 340 "m2-exp.y"
1629 { error("Sets are not implemented.");}
1633 #line 344 "m2-exp.y"
1634 { error("Sets are not implemented.");}
1638 #line 346 "m2-exp.y"
1639 { error("Sets are not implemented.");}
1643 #line 355 "m2-exp.y"
1644 { start_arglist(); }
1648 #line 357 "m2-exp.y"
1649 { write_exp_elt_opcode (MULTI_SUBSCRIPT);
1650 write_exp_elt_longcst ((LONGEST) end_arglist());
1651 write_exp_elt_opcode (MULTI_SUBSCRIPT); }
1655 #line 363 "m2-exp.y"
1656 { write_exp_elt_opcode (BINOP_SUBSCRIPT); }
1660 #line 369 "m2-exp.y"
1661 { start_arglist (); }
1665 #line 371 "m2-exp.y"
1666 { write_exp_elt_opcode (OP_FUNCALL);
1667 write_exp_elt_longcst ((LONGEST) end_arglist ());
1668 write_exp_elt_opcode (OP_FUNCALL); }
1672 #line 380 "m2-exp.y"
1673 { arglist_len = 1; }
1677 #line 384 "m2-exp.y"
1682 #line 389 "m2-exp.y"
1683 { arglist_len = 1; }
1687 #line 394 "m2-exp.y"
1692 #line 399 "m2-exp.y"
1693 { write_exp_elt_opcode (UNOP_MEMVAL);
1694 write_exp_elt_type (yyvsp[-2].tval);
1695 write_exp_elt_opcode (UNOP_MEMVAL); }
1699 #line 405 "m2-exp.y"
1700 { write_exp_elt_opcode (UNOP_CAST);
1701 write_exp_elt_type (yyvsp[-3].tval);
1702 write_exp_elt_opcode (UNOP_CAST); }
1706 #line 411 "m2-exp.y"
1711 #line 419 "m2-exp.y"
1712 { write_exp_elt_opcode (BINOP_REPEAT); }
1716 #line 423 "m2-exp.y"
1717 { write_exp_elt_opcode (BINOP_MUL); }
1721 #line 427 "m2-exp.y"
1722 { write_exp_elt_opcode (BINOP_DIV); }
1726 #line 431 "m2-exp.y"
1727 { write_exp_elt_opcode (BINOP_INTDIV); }
1731 #line 435 "m2-exp.y"
1732 { write_exp_elt_opcode (BINOP_REM); }
1736 #line 439 "m2-exp.y"
1737 { write_exp_elt_opcode (BINOP_ADD); }
1741 #line 443 "m2-exp.y"
1742 { write_exp_elt_opcode (BINOP_SUB); }
1746 #line 447 "m2-exp.y"
1747 { write_exp_elt_opcode (BINOP_EQUAL); }
1751 #line 451 "m2-exp.y"
1752 { write_exp_elt_opcode (BINOP_NOTEQUAL); }
1756 #line 453 "m2-exp.y"
1757 { write_exp_elt_opcode (BINOP_NOTEQUAL); }
1761 #line 457 "m2-exp.y"
1762 { write_exp_elt_opcode (BINOP_LEQ); }
1766 #line 461 "m2-exp.y"
1767 { write_exp_elt_opcode (BINOP_GEQ); }
1771 #line 465 "m2-exp.y"
1772 { write_exp_elt_opcode (BINOP_LESS); }
1776 #line 469 "m2-exp.y"
1777 { write_exp_elt_opcode (BINOP_GTR); }
1781 #line 473 "m2-exp.y"
1782 { write_exp_elt_opcode (BINOP_LOGICAL_AND); }
1786 #line 477 "m2-exp.y"
1787 { write_exp_elt_opcode (BINOP_LOGICAL_OR); }
1791 #line 481 "m2-exp.y"
1792 { write_exp_elt_opcode (BINOP_ASSIGN); }
1796 #line 488 "m2-exp.y"
1797 { write_exp_elt_opcode (OP_BOOL);
1798 write_exp_elt_longcst ((LONGEST) yyvsp[0].ulval);
1799 write_exp_elt_opcode (OP_BOOL); }
1803 #line 494 "m2-exp.y"
1804 { write_exp_elt_opcode (OP_BOOL);
1805 write_exp_elt_longcst ((LONGEST) yyvsp[0].ulval);
1806 write_exp_elt_opcode (OP_BOOL); }
1810 #line 500 "m2-exp.y"
1811 { write_exp_elt_opcode (OP_LONG);
1812 write_exp_elt_type (parse_m2_type->builtin_int);
1813 write_exp_elt_longcst ((LONGEST) yyvsp[0].lval);
1814 write_exp_elt_opcode (OP_LONG); }
1818 #line 507 "m2-exp.y"
1820 write_exp_elt_opcode (OP_LONG);
1821 write_exp_elt_type (parse_m2_type->builtin_card);
1822 write_exp_elt_longcst ((LONGEST) yyvsp[0].ulval);
1823 write_exp_elt_opcode (OP_LONG);
1828 #line 516 "m2-exp.y"
1829 { write_exp_elt_opcode (OP_LONG);
1830 write_exp_elt_type (parse_m2_type->builtin_char);
1831 write_exp_elt_longcst ((LONGEST) yyvsp[0].ulval);
1832 write_exp_elt_opcode (OP_LONG); }
1836 #line 524 "m2-exp.y"
1837 { write_exp_elt_opcode (OP_DOUBLE);
1838 write_exp_elt_type (parse_m2_type->builtin_real);
1839 write_exp_elt_dblcst (yyvsp[0].dval);
1840 write_exp_elt_opcode (OP_DOUBLE); }
1844 #line 534 "m2-exp.y"
1845 { write_exp_elt_opcode (OP_LONG);
1846 write_exp_elt_type (parse_type->builtin_int);
1847 write_exp_elt_longcst ((LONGEST) TYPE_LENGTH (yyvsp[-1].tval));
1848 write_exp_elt_opcode (OP_LONG); }
1852 #line 541 "m2-exp.y"
1853 { write_exp_elt_opcode (OP_M2_STRING);
1854 write_exp_string (yyvsp[0].sval);
1855 write_exp_elt_opcode (OP_M2_STRING); }
1859 #line 548 "m2-exp.y"
1860 { yyval.bval = SYMBOL_BLOCK_VALUE(yyvsp[0].sym); }
1864 #line 552 "m2-exp.y"
1865 { struct symbol *sym
1866 = lookup_symbol (copy_name (yyvsp[0].sval), expression_context_block,
1872 #line 561 "m2-exp.y"
1873 { struct symbol *tem
1874 = lookup_symbol (copy_name (yyvsp[0].sval), yyvsp[-2].bval,
1876 if (!tem || SYMBOL_CLASS (tem) != LOC_BLOCK)
1877 error ("No function \"%s\" in specified context.",
1878 copy_name (yyvsp[0].sval));
1884 #line 573 "m2-exp.y"
1885 { write_exp_elt_opcode(OP_VAR_VALUE);
1886 write_exp_elt_block (NULL);
1887 write_exp_elt_sym (yyvsp[0].sym);
1888 write_exp_elt_opcode (OP_VAR_VALUE); }
1892 #line 585 "m2-exp.y"
1893 { struct symbol *sym;
1894 sym = lookup_symbol (copy_name (yyvsp[0].sval), yyvsp[-2].bval,
1897 error ("No symbol \"%s\" in specified context.",
1898 copy_name (yyvsp[0].sval));
1900 write_exp_elt_opcode (OP_VAR_VALUE);
1901 /* block_found is set by lookup_symbol. */
1902 write_exp_elt_block (block_found);
1903 write_exp_elt_sym (sym);
1904 write_exp_elt_opcode (OP_VAR_VALUE); }
1908 #line 601 "m2-exp.y"
1909 { struct symbol *sym;
1910 int is_a_field_of_this;
1912 sym = lookup_symbol (copy_name (yyvsp[0].sval),
1913 expression_context_block,
1915 &is_a_field_of_this);
1918 if (symbol_read_needs_frame (sym))
1920 if (innermost_block == 0 ||
1921 contained_in (block_found,
1923 innermost_block = block_found;
1926 write_exp_elt_opcode (OP_VAR_VALUE);
1927 /* We want to use the selected frame, not
1928 another more inner frame which happens to
1929 be in the same block. */
1930 write_exp_elt_block (NULL);
1931 write_exp_elt_sym (sym);
1932 write_exp_elt_opcode (OP_VAR_VALUE);
1936 struct minimal_symbol *msymbol;
1937 char *arg = copy_name (yyvsp[0].sval);
1940 lookup_minimal_symbol (arg, NULL, NULL);
1941 if (msymbol != NULL)
1942 write_exp_msymbol (msymbol);
1943 else if (!have_full_symbols () && !have_partial_symbols ())
1944 error ("No symbol table is loaded. Use the \"symbol-file\" command.");
1946 error ("No symbol \"%s\" in current context.",
1947 copy_name (yyvsp[0].sval));
1953 #line 646 "m2-exp.y"
1954 { yyval.tval = lookup_typename (parse_language, parse_gdbarch,
1955 copy_name (yyvsp[0].sval),
1956 expression_context_block, 0); }
1962 /* Line 1000 of yacc.c. */
1963 #line 1964 "m2-exp.c.tmp"
1969 YY_STACK_PRINT (yyss, yyssp);
1974 /* Now `shift' the result of the reduction. Determine what state
1975 that goes to, based on the state we popped back to and the rule
1976 number reduced by. */
1980 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1981 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1982 yystate = yytable[yystate];
1984 yystate = yydefgoto[yyn - YYNTOKENS];
1989 /*------------------------------------.
1990 | yyerrlab -- here on detecting error |
1991 `------------------------------------*/
1993 /* If not already recovering from an error, report this error. */
1998 yyn = yypact[yystate];
2000 if (YYPACT_NINF < yyn && yyn < YYLAST)
2002 YYSIZE_T yysize = 0;
2003 int yytype = YYTRANSLATE (yychar);
2004 const char* yyprefix;
2008 /* Start YYX at -YYN if negative to avoid negative indexes in
2010 int yyxbegin = yyn < 0 ? -yyn : 0;
2012 /* Stay within bounds of both yycheck and yytname. */
2013 int yychecklim = YYLAST - yyn;
2014 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
2017 yyprefix = ", expecting ";
2018 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
2019 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
2021 yysize += yystrlen (yyprefix) + yystrlen (yytname [yyx]);
2029 yysize += (sizeof ("syntax error, unexpected ")
2030 + yystrlen (yytname[yytype]));
2031 yymsg = (char *) YYSTACK_ALLOC (yysize);
2034 char *yyp = yystpcpy (yymsg, "syntax error, unexpected ");
2035 yyp = yystpcpy (yyp, yytname[yytype]);
2039 yyprefix = ", expecting ";
2040 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
2041 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
2043 yyp = yystpcpy (yyp, yyprefix);
2044 yyp = yystpcpy (yyp, yytname[yyx]);
2049 YYSTACK_FREE (yymsg);
2052 yyerror ("syntax error; also virtual memory exhausted");
2055 #endif /* YYERROR_VERBOSE */
2056 yyerror ("syntax error");
2061 if (yyerrstatus == 3)
2063 /* If just tried and failed to reuse lookahead token after an
2064 error, discard it. */
2066 if (yychar <= YYEOF)
2068 /* If at end of input, pop the error token,
2069 then the rest of the stack, then return failure. */
2070 if (yychar == YYEOF)
2076 YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
2077 yydestruct (yystos[*yyssp], yyvsp);
2082 YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc);
2083 yydestruct (yytoken, &yylval);
2089 /* Else will try to reuse lookahead token after shifting the error
2094 /*---------------------------------------------------.
2095 | yyerrorlab -- error raised explicitly by YYERROR. |
2096 `---------------------------------------------------*/
2100 /* Pacify GCC when the user code never invokes YYERROR and the label
2101 yyerrorlab therefore never appears in user code. */
2112 /*-------------------------------------------------------------.
2113 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2114 `-------------------------------------------------------------*/
2116 yyerrstatus = 3; /* Each real token shifted decrements this. */
2120 yyn = yypact[yystate];
2121 if (yyn != YYPACT_NINF)
2124 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
2132 /* Pop the current state because it cannot handle the error token. */
2136 YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
2137 yydestruct (yystos[yystate], yyvsp);
2140 YY_STACK_PRINT (yyss, yyssp);
2146 YYDPRINTF ((stderr, "Shifting error token, "));
2155 /*-------------------------------------.
2156 | yyacceptlab -- YYACCEPT comes here. |
2157 `-------------------------------------*/
2162 /*-----------------------------------.
2163 | yyabortlab -- YYABORT comes here. |
2164 `-----------------------------------*/
2170 /*----------------------------------------------.
2171 | yyoverflowlab -- parser overflow comes here. |
2172 `----------------------------------------------*/
2174 yyerror ("parser stack overflow");
2182 YYSTACK_FREE (yyss);
2188 #line 652 "m2-exp.y"
2191 /* Take care of parsing a number (anything that starts with a digit).
2192 Set yylval and return the token type; update lexptr.
2193 LEN is the number of characters in it. */
2195 /*** Needs some error checking for the float case ***/
2205 int base = input_radix;
2207 int unsigned_p = number_sign == 1 ? 1 : 0;
2214 else if(p[len-1] == 'C' || p[len-1] == 'B')
2217 ischar = p[len-1] == 'C';
2221 /* Scan the number */
2222 for (c = 0; c < len; c++)
2224 if (p[c] == '.' && base == 10)
2226 /* It's a float since it contains a point. */
2227 yylval.dval = atof (p);
2231 if (p[c] == '.' && base != 10)
2232 error("Floating point numbers must be base 10.");
2233 if (base == 10 && (p[c] < '0' || p[c] > '9'))
2234 error("Invalid digit \'%c\' in number.",p[c]);
2241 if( base == 8 && (c == '8' || c == '9'))
2242 error("Invalid digit \'%c\' in octal number.",c);
2243 if (c >= '0' && c <= '9')
2247 if (base == 16 && c >= 'A' && c <= 'F')
2255 if(!unsigned_p && number_sign == 1 && (prevn >= n))
2256 unsigned_p=1; /* Try something unsigned */
2257 /* Don't do the range check if n==i and i==0, since that special
2258 case will give an overflow error. */
2259 if(RANGE_CHECK && n!=i && i)
2261 if((unsigned_p && (unsigned)prevn >= (unsigned)n) ||
2262 ((!unsigned_p && number_sign==-1) && -prevn <= -n))
2263 range_error("Overflow on numeric constant.");
2269 if(*p == 'B' || *p == 'C' || *p == 'H')
2270 lexptr++; /* Advance past B,C or H */
2277 else if ( unsigned_p && number_sign == 1)
2282 else if((unsigned_p && (n<0))) {
2283 range_error("Overflow on numeric constant -- number too large.");
2284 /* But, this can return if range_check == range_warn. */
2299 { {'<', '>'}, NOTEQUAL },
2300 { {':', '='}, ASSIGN },
2301 { {'<', '='}, LEQ },
2302 { {'>', '='}, GEQ },
2303 { {':', ':'}, COLONCOLON },
2307 /* Some specific keywords */
2314 static struct keyword keytab[] =
2317 {"IN", IN },/* Note space after IN */
2318 {"AND", LOGICAL_AND},
2336 {"FLOAT", FLOAT_FUNC },
2342 /* Read one token, getting characters through lexptr. */
2344 /* This is where we will check to make sure that the language and the operators used are
2358 prev_lexptr = lexptr;
2363 /* See if it is a special token of length 2 */
2364 for( i = 0 ; i < (int) (sizeof tokentab2 / sizeof tokentab2[0]) ; i++)
2365 if (strncmp (tokentab2[i].name, tokstart, 2) == 0)
2368 return tokentab2[i].token;
2371 switch (c = *tokstart)
2388 if (paren_depth == 0)
2395 if (comma_terminates && paren_depth == 0)
2401 /* Might be a floating point number. */
2402 if (lexptr[1] >= '0' && lexptr[1] <= '9')
2403 break; /* Falls into number code. */
2410 /* These are character tokens that appear as-is in the YACC grammar */
2433 for (namelen = 1; (c = tokstart[namelen]) != quote && c != '\0'; namelen++)
2436 c = tokstart[++namelen];
2437 if (c >= '0' && c <= '9')
2439 c = tokstart[++namelen];
2440 if (c >= '0' && c <= '9')
2441 c = tokstart[++namelen];
2445 error("Unterminated string or character constant.");
2446 yylval.sval.ptr = tokstart + 1;
2447 yylval.sval.length = namelen - 1;
2448 lexptr += namelen + 1;
2450 if(namelen == 2) /* Single character */
2452 yylval.ulval = tokstart[1];
2459 /* Is it a number? */
2460 /* Note: We have already dealt with the case of the token '.'.
2461 See case '.' above. */
2462 if ((c >= '0' && c <= '9'))
2464 /* It's a number. */
2465 int got_dot = 0, got_e = 0;
2471 if (!got_e && (*p == 'e' || *p == 'E'))
2472 got_dot = got_e = 1;
2473 else if (!got_dot && *p == '.')
2475 else if (got_e && (p[-1] == 'e' || p[-1] == 'E')
2476 && (*p == '-' || *p == '+'))
2477 /* This is the sign of the exponent, not the end of the
2480 else if ((*p < '0' || *p > '9') &&
2481 (*p < 'A' || *p > 'F') &&
2482 (*p != 'H')) /* Modula-2 hexadecimal number */
2485 toktype = parse_number (p - tokstart);
2486 if (toktype == ERROR)
2488 char *err_copy = (char *) alloca (p - tokstart + 1);
2490 memcpy (err_copy, tokstart, p - tokstart);
2491 err_copy[p - tokstart] = 0;
2492 error ("Invalid number \"%s\".", err_copy);
2498 if (!(c == '_' || c == '$'
2499 || (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')))
2500 /* We must have come across a bad character (e.g. ';'). */
2501 error ("Invalid character '%c' in expression.", c);
2503 /* It's a name. See how long it is. */
2505 for (c = tokstart[namelen];
2506 (c == '_' || c == '$' || (c >= '0' && c <= '9')
2507 || (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'));
2508 c = tokstart[++namelen])
2511 /* The token "if" terminates the expression and is NOT
2512 removed from the input stream. */
2513 if (namelen == 2 && tokstart[0] == 'i' && tokstart[1] == 'f')
2520 /* Lookup special keywords */
2521 for(i = 0 ; i < (int) (sizeof(keytab) / sizeof(keytab[0])) ; i++)
2522 if (namelen == strlen (keytab[i].keyw)
2523 && strncmp (tokstart, keytab[i].keyw, namelen) == 0)
2524 return keytab[i].token;
2526 yylval.sval.ptr = tokstart;
2527 yylval.sval.length = namelen;
2529 if (*tokstart == '$')
2531 write_dollar_variable (yylval.sval);
2532 return INTERNAL_VAR;
2535 /* Use token-type BLOCKNAME for symbols that happen to be defined as
2536 functions. If this is not so, then ...
2537 Use token-type TYPENAME for symbols that happen to be defined
2538 currently as names of types; NAME for other symbols.
2539 The caller is not constrained to care about the distinction. */
2543 char *tmp = copy_name (yylval.sval);
2546 if (lookup_symtab (tmp))
2548 sym = lookup_symbol (tmp, expression_context_block, VAR_DOMAIN, 0);
2549 if (sym && SYMBOL_CLASS (sym) == LOC_BLOCK)
2551 if (lookup_typename (parse_language, parse_gdbarch,
2552 copy_name (yylval.sval), expression_context_block, 1))
2557 switch(SYMBOL_CLASS (sym))
2563 case LOC_REGPARM_ADDR:
2566 case LOC_CONST_BYTES:
2567 case LOC_OPTIMIZED_OUT:
2578 error("internal: Undefined class in m2lex()");
2581 case LOC_UNRESOLVED:
2582 error("internal: Unforseen case in m2lex()");
2585 error ("unhandled token in m2lex()");
2591 /* Built-in BOOLEAN type. This is sort of a hack. */
2592 if (strncmp (tokstart, "TRUE", 4) == 0)
2597 else if (strncmp (tokstart, "FALSE", 5) == 0)
2604 /* Must be another type of name... */
2611 make_qualname(mod,ident)
2614 char *new = xmalloc(strlen(mod)+strlen(ident)+2);
2628 lexptr = prev_lexptr;
2630 error ("A %s in expression, near `%s'.", (msg ? msg : "error"), lexptr);