GDB (API)
|
00001 /* A Bison parser, made by GNU Bison 2.5. */ 00002 00003 /* Bison implementation for Yacc-like parsers in C 00004 00005 Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc. 00006 00007 This program is free software: you can redistribute it and/or modify 00008 it under the terms of the GNU General Public License as published by 00009 the Free Software Foundation, either version 3 of the License, or 00010 (at your option) any later version. 00011 00012 This program is distributed in the hope that it will be useful, 00013 but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 GNU General Public License for more details. 00016 00017 You should have received a copy of the GNU General Public License 00018 along with this program. If not, see <http://www.gnu.org/licenses/>. */ 00019 00020 /* As a special exception, you may create a larger work that contains 00021 part or all of the Bison parser skeleton and distribute that work 00022 under terms of your choice, so long as that work isn't itself a 00023 parser generator using the skeleton or a modified version thereof 00024 as a parser skeleton. Alternatively, if you modify or redistribute 00025 the parser skeleton itself, you may (at your option) remove this 00026 special exception, which will cause the skeleton and the resulting 00027 Bison output files to be licensed under the GNU General Public 00028 License without this special exception. 00029 00030 This special exception was added by the Free Software Foundation in 00031 version 2.2 of Bison. */ 00032 00033 /* C LALR(1) parser skeleton written by Richard Stallman, by 00034 simplifying the original so-called "semantic" parser. */ 00035 00036 /* All symbols defined below should begin with yy or YY, to avoid 00037 infringing on user name space. This should be done even for local 00038 variables, as they might otherwise be expanded by user macros. 00039 There are some unavoidable exceptions within include files to 00040 define necessary library symbols; they are noted "INFRINGES ON 00041 USER NAME SPACE" below. */ 00042 00043 /* Identify Bison output. */ 00044 #define YYBISON 1 00045 00046 /* Bison version. */ 00047 #define YYBISON_VERSION "2.5" 00048 00049 /* Skeleton name. */ 00050 #define YYSKELETON_NAME "yacc.c" 00051 00052 /* Pure parsers. */ 00053 #define YYPURE 0 00054 00055 /* Push parsers. */ 00056 #define YYPUSH 0 00057 00058 /* Pull parsers. */ 00059 #define YYPULL 1 00060 00061 /* Using locations. */ 00062 #define YYLSP_NEEDED 0 00063 00064 00065 00066 /* Copy the first part of user declarations. */ 00067 00068 /* Line 268 of yacc.c */ 00069 #line 38 "../../src/gdb/m2-exp.y" 00070 00071 00072 #include "defs.h" 00073 #include "gdb_string.h" 00074 #include "expression.h" 00075 #include "language.h" 00076 #include "value.h" 00077 #include "parser-defs.h" 00078 #include "m2-lang.h" 00079 #include "bfd.h" /* Required by objfiles.h. */ 00080 #include "symfile.h" /* Required by objfiles.h. */ 00081 #include "objfiles.h" /* For have_full_symbols and have_partial_symbols */ 00082 #include "block.h" 00083 00084 #define parse_type builtin_type (parse_gdbarch) 00085 #define parse_m2_type builtin_m2_type (parse_gdbarch) 00086 00087 /* Remap normal yacc parser interface names (yyparse, yylex, yyerror, etc), 00088 as well as gratuitiously global symbol names, so we can have multiple 00089 yacc generated parsers in gdb. Note that these are only the variables 00090 produced by yacc. If other parser generators (bison, byacc, etc) produce 00091 additional global names that conflict at link time, then those parser 00092 generators need to be fixed instead of adding those names to this list. */ 00093 00094 #define yymaxdepth m2_maxdepth 00095 #define yyparse m2_parse 00096 #define yylex m2_lex 00097 #define yyerror m2_error 00098 #define yylval m2_lval 00099 #define yychar m2_char 00100 #define yydebug m2_debug 00101 #define yypact m2_pact 00102 #define yyr1 m2_r1 00103 #define yyr2 m2_r2 00104 #define yydef m2_def 00105 #define yychk m2_chk 00106 #define yypgo m2_pgo 00107 #define yyact m2_act 00108 #define yyexca m2_exca 00109 #define yyerrflag m2_errflag 00110 #define yynerrs m2_nerrs 00111 #define yyps m2_ps 00112 #define yypv m2_pv 00113 #define yys m2_s 00114 #define yy_yys m2_yys 00115 #define yystate m2_state 00116 #define yytmp m2_tmp 00117 #define yyv m2_v 00118 #define yy_yyv m2_yyv 00119 #define yyval m2_val 00120 #define yylloc m2_lloc 00121 #define yyreds m2_reds /* With YYDEBUG defined */ 00122 #define yytoks m2_toks /* With YYDEBUG defined */ 00123 #define yyname m2_name /* With YYDEBUG defined */ 00124 #define yyrule m2_rule /* With YYDEBUG defined */ 00125 #define yylhs m2_yylhs 00126 #define yylen m2_yylen 00127 #define yydefred m2_yydefred 00128 #define yydgoto m2_yydgoto 00129 #define yysindex m2_yysindex 00130 #define yyrindex m2_yyrindex 00131 #define yygindex m2_yygindex 00132 #define yytable m2_yytable 00133 #define yycheck m2_yycheck 00134 #define yyss m2_yyss 00135 #define yysslim m2_yysslim 00136 #define yyssp m2_yyssp 00137 #define yystacksize m2_yystacksize 00138 #define yyvs m2_yyvs 00139 #define yyvsp m2_yyvsp 00140 00141 #ifndef YYDEBUG 00142 #define YYDEBUG 1 /* Default to yydebug support */ 00143 #endif 00144 00145 #define YYFPRINTF parser_fprintf 00146 00147 int yyparse (void); 00148 00149 static int yylex (void); 00150 00151 void yyerror (char *); 00152 00153 static int parse_number (int); 00154 00155 /* The sign of the number being parsed. */ 00156 static int number_sign = 1; 00157 00158 00159 00160 /* Line 268 of yacc.c */ 00161 #line 162 "m2-exp.c" 00162 00163 /* Enabling traces. */ 00164 #ifndef YYDEBUG 00165 # define YYDEBUG 0 00166 #endif 00167 00168 /* Enabling verbose error messages. */ 00169 #ifdef YYERROR_VERBOSE 00170 # undef YYERROR_VERBOSE 00171 # define YYERROR_VERBOSE 1 00172 #else 00173 # define YYERROR_VERBOSE 0 00174 #endif 00175 00176 /* Enabling the token table. */ 00177 #ifndef YYTOKEN_TABLE 00178 # define YYTOKEN_TABLE 0 00179 #endif 00180 00181 00182 /* Tokens. */ 00183 #ifndef YYTOKENTYPE 00184 # define YYTOKENTYPE 00185 /* Put the tokens into the symbol table, so that GDB and other debuggers 00186 know about them. */ 00187 enum yytokentype { 00188 INT = 258, 00189 HEX = 259, 00190 ERROR = 260, 00191 UINT = 261, 00192 M2_TRUE = 262, 00193 M2_FALSE = 263, 00194 CHAR = 264, 00195 FLOAT = 265, 00196 STRING = 266, 00197 NAME = 267, 00198 BLOCKNAME = 268, 00199 IDENT = 269, 00200 VARNAME = 270, 00201 TYPENAME = 271, 00202 SIZE = 272, 00203 CAP = 273, 00204 ORD = 274, 00205 HIGH = 275, 00206 ABS = 276, 00207 MIN_FUNC = 277, 00208 MAX_FUNC = 278, 00209 FLOAT_FUNC = 279, 00210 VAL = 280, 00211 CHR = 281, 00212 ODD = 282, 00213 TRUNC = 283, 00214 TSIZE = 284, 00215 INC = 285, 00216 DEC = 286, 00217 INCL = 287, 00218 EXCL = 288, 00219 COLONCOLON = 289, 00220 INTERNAL_VAR = 290, 00221 ABOVE_COMMA = 291, 00222 ASSIGN = 292, 00223 IN = 293, 00224 NOTEQUAL = 294, 00225 GEQ = 295, 00226 LEQ = 296, 00227 OROR = 297, 00228 LOGICAL_AND = 298, 00229 MOD = 299, 00230 DIV = 300, 00231 UNARY = 301, 00232 DOT = 302, 00233 NOT = 303, 00234 QID = 304 00235 }; 00236 #endif 00237 /* Tokens. */ 00238 #define INT 258 00239 #define HEX 259 00240 #define ERROR 260 00241 #define UINT 261 00242 #define M2_TRUE 262 00243 #define M2_FALSE 263 00244 #define CHAR 264 00245 #define FLOAT 265 00246 #define STRING 266 00247 #define NAME 267 00248 #define BLOCKNAME 268 00249 #define IDENT 269 00250 #define VARNAME 270 00251 #define TYPENAME 271 00252 #define SIZE 272 00253 #define CAP 273 00254 #define ORD 274 00255 #define HIGH 275 00256 #define ABS 276 00257 #define MIN_FUNC 277 00258 #define MAX_FUNC 278 00259 #define FLOAT_FUNC 279 00260 #define VAL 280 00261 #define CHR 281 00262 #define ODD 282 00263 #define TRUNC 283 00264 #define TSIZE 284 00265 #define INC 285 00266 #define DEC 286 00267 #define INCL 287 00268 #define EXCL 288 00269 #define COLONCOLON 289 00270 #define INTERNAL_VAR 290 00271 #define ABOVE_COMMA 291 00272 #define ASSIGN 292 00273 #define IN 293 00274 #define NOTEQUAL 294 00275 #define GEQ 295 00276 #define LEQ 296 00277 #define OROR 297 00278 #define LOGICAL_AND 298 00279 #define MOD 299 00280 #define DIV 300 00281 #define UNARY 301 00282 #define DOT 302 00283 #define NOT 303 00284 #define QID 304 00285 00286 00287 00288 00289 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED 00290 typedef union YYSTYPE 00291 { 00292 00293 /* Line 293 of yacc.c */ 00294 #line 133 "../../src/gdb/m2-exp.y" 00295 00296 LONGEST lval; 00297 ULONGEST ulval; 00298 DOUBLEST dval; 00299 struct symbol *sym; 00300 struct type *tval; 00301 struct stoken sval; 00302 int voidval; 00303 struct block *bval; 00304 enum exp_opcode opcode; 00305 struct internalvar *ivar; 00306 00307 struct type **tvec; 00308 int *ivec; 00309 00310 00311 00312 /* Line 293 of yacc.c */ 00313 #line 314 "m2-exp.c" 00314 } YYSTYPE; 00315 # define YYSTYPE_IS_TRIVIAL 1 00316 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ 00317 # define YYSTYPE_IS_DECLARED 1 00318 #endif 00319 00320 00321 /* Copy the second part of user declarations. */ 00322 00323 00324 /* Line 343 of yacc.c */ 00325 #line 326 "m2-exp.c" 00326 00327 #ifdef short 00328 # undef short 00329 #endif 00330 00331 #ifdef YYTYPE_UINT8 00332 typedef YYTYPE_UINT8 yytype_uint8; 00333 #else 00334 typedef unsigned char yytype_uint8; 00335 #endif 00336 00337 #ifdef YYTYPE_INT8 00338 typedef YYTYPE_INT8 yytype_int8; 00339 #elif (defined __STDC__ || defined __C99__FUNC__ \ 00340 || defined __cplusplus || defined _MSC_VER) 00341 typedef signed char yytype_int8; 00342 #else 00343 typedef short int yytype_int8; 00344 #endif 00345 00346 #ifdef YYTYPE_UINT16 00347 typedef YYTYPE_UINT16 yytype_uint16; 00348 #else 00349 typedef unsigned short int yytype_uint16; 00350 #endif 00351 00352 #ifdef YYTYPE_INT16 00353 typedef YYTYPE_INT16 yytype_int16; 00354 #else 00355 typedef short int yytype_int16; 00356 #endif 00357 00358 #ifndef YYSIZE_T 00359 # ifdef __SIZE_TYPE__ 00360 # define YYSIZE_T __SIZE_TYPE__ 00361 # elif defined size_t 00362 # define YYSIZE_T size_t 00363 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ 00364 || defined __cplusplus || defined _MSC_VER) 00365 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */ 00366 # define YYSIZE_T size_t 00367 # else 00368 # define YYSIZE_T unsigned int 00369 # endif 00370 #endif 00371 00372 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1) 00373 00374 #ifndef YY_ 00375 # if defined YYENABLE_NLS && YYENABLE_NLS 00376 # if ENABLE_NLS 00377 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */ 00378 # define YY_(msgid) dgettext ("bison-runtime", msgid) 00379 # endif 00380 # endif 00381 # ifndef YY_ 00382 # define YY_(msgid) msgid 00383 # endif 00384 #endif 00385 00386 /* Suppress unused-variable warnings by "using" E. */ 00387 #if ! defined lint || defined __GNUC__ 00388 # define YYUSE(e) ((void) (e)) 00389 #else 00390 # define YYUSE(e) /* empty */ 00391 #endif 00392 00393 /* Identity function, used to suppress warnings about constant conditions. */ 00394 #ifndef lint 00395 # define YYID(n) (n) 00396 #else 00397 #if (defined __STDC__ || defined __C99__FUNC__ \ 00398 || defined __cplusplus || defined _MSC_VER) 00399 static int 00400 YYID (int yyi) 00401 #else 00402 static int 00403 YYID (yyi) 00404 int yyi; 00405 #endif 00406 { 00407 return yyi; 00408 } 00409 #endif 00410 00411 #if ! defined yyoverflow || YYERROR_VERBOSE 00412 00413 /* The parser invokes alloca or xmalloc; define the necessary symbols. */ 00414 00415 # ifdef YYSTACK_USE_ALLOCA 00416 # if YYSTACK_USE_ALLOCA 00417 # ifdef __GNUC__ 00418 # define YYSTACK_ALLOC __builtin_alloca 00419 # elif defined __BUILTIN_VA_ARG_INCR 00420 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */ 00421 # elif defined _AIX 00422 # define YYSTACK_ALLOC __alloca 00423 # elif defined _MSC_VER 00424 # define alloca _alloca 00425 # else 00426 # define YYSTACK_ALLOC alloca 00427 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ 00428 || defined __cplusplus || defined _MSC_VER) 00429 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ 00430 # ifndef EXIT_SUCCESS 00431 # define EXIT_SUCCESS 0 00432 # endif 00433 # endif 00434 # endif 00435 # endif 00436 # endif 00437 00438 # ifdef YYSTACK_ALLOC 00439 /* Pacify GCC's `empty if-body' warning. */ 00440 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) 00441 # ifndef YYSTACK_ALLOC_MAXIMUM 00442 /* The OS might guarantee only one guard page at the bottom of the stack, 00443 and a page size can be as small as 4096 bytes. So we cannot safely 00444 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number 00445 to allow for a few compiler-allocated temporary stack slots. */ 00446 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ 00447 # endif 00448 # else 00449 # define YYSTACK_ALLOC YYMALLOC 00450 # define YYSTACK_FREE YYFREE 00451 # ifndef YYSTACK_ALLOC_MAXIMUM 00452 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM 00453 # endif 00454 # if (defined __cplusplus && ! defined EXIT_SUCCESS \ 00455 && ! ((defined YYMALLOC || defined xmalloc) \ 00456 && (defined YYFREE || defined xfree))) 00457 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ 00458 # ifndef EXIT_SUCCESS 00459 # define EXIT_SUCCESS 0 00460 # endif 00461 # endif 00462 # ifndef YYMALLOC 00463 # define YYMALLOC xmalloc 00464 # if ! defined xmalloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ 00465 || defined __cplusplus || defined _MSC_VER) 00466 void *xmalloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ 00467 # endif 00468 # endif 00469 # ifndef YYFREE 00470 # define YYFREE xfree 00471 # if ! defined xfree && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ 00472 || defined __cplusplus || defined _MSC_VER) 00473 void xfree (void *); /* INFRINGES ON USER NAME SPACE */ 00474 # endif 00475 # endif 00476 # endif 00477 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */ 00478 00479 00480 #if (! defined yyoverflow \ 00481 && (! defined __cplusplus \ 00482 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) 00483 00484 /* A type that is properly aligned for any stack member. */ 00485 union yyalloc 00486 { 00487 yytype_int16 yyss_alloc; 00488 YYSTYPE yyvs_alloc; 00489 }; 00490 00491 /* The size of the maximum gap between one aligned stack and the next. */ 00492 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) 00493 00494 /* The size of an array large to enough to hold all stacks, each with 00495 N elements. */ 00496 # define YYSTACK_BYTES(N) \ 00497 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ 00498 + YYSTACK_GAP_MAXIMUM) 00499 00500 # define YYCOPY_NEEDED 1 00501 00502 /* Relocate STACK from its old location to the new one. The 00503 local variables YYSIZE and YYSTACKSIZE give the old and new number of 00504 elements in the stack, and YYPTR gives the new location of the 00505 stack. Advance YYPTR to a properly aligned location for the next 00506 stack. */ 00507 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \ 00508 do \ 00509 { \ 00510 YYSIZE_T yynewbytes; \ 00511 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ 00512 Stack = &yyptr->Stack_alloc; \ 00513 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ 00514 yyptr += yynewbytes / sizeof (*yyptr); \ 00515 } \ 00516 while (YYID (0)) 00517 00518 #endif 00519 00520 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED 00521 /* Copy COUNT objects from FROM to TO. The source and destination do 00522 not overlap. */ 00523 # ifndef YYCOPY 00524 # if defined __GNUC__ && 1 < __GNUC__ 00525 # define YYCOPY(To, From, Count) \ 00526 __builtin_memcpy (To, From, (Count) * sizeof (*(From))) 00527 # else 00528 # define YYCOPY(To, From, Count) \ 00529 do \ 00530 { \ 00531 YYSIZE_T yyi; \ 00532 for (yyi = 0; yyi < (Count); yyi++) \ 00533 (To)[yyi] = (From)[yyi]; \ 00534 } \ 00535 while (YYID (0)) 00536 # endif 00537 # endif 00538 #endif /* !YYCOPY_NEEDED */ 00539 00540 /* YYFINAL -- State number of the termination state. */ 00541 #define YYFINAL 69 00542 /* YYLAST -- Last index in YYTABLE. */ 00543 #define YYLAST 923 00544 00545 /* YYNTOKENS -- Number of terminals. */ 00546 #define YYNTOKENS 69 00547 /* YYNNTS -- Number of nonterminals. */ 00548 #define YYNNTS 15 00549 /* YYNRULES -- Number of rules. */ 00550 #define YYNRULES 82 00551 /* YYNRULES -- Number of states. */ 00552 #define YYNSTATES 187 00553 00554 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ 00555 #define YYUNDEFTOK 2 00556 #define YYMAXUTOK 304 00557 00558 #define YYTRANSLATE(YYX) \ 00559 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) 00560 00561 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ 00562 static const yytype_uint8 yytranslate[] = 00563 { 00564 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00565 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00566 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00567 2, 2, 2, 2, 2, 42, 2, 2, 48, 2, 00568 60, 65, 53, 51, 36, 52, 2, 54, 2, 2, 00569 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00570 39, 41, 40, 2, 50, 2, 2, 2, 2, 2, 00571 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00572 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00573 2, 59, 2, 68, 58, 2, 2, 2, 2, 2, 00574 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00575 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00576 2, 2, 2, 66, 2, 67, 62, 2, 2, 2, 00577 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00578 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00579 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00580 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00581 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00582 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00583 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00584 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00585 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00586 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00587 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00588 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00589 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 00590 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 00591 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 00592 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 00593 35, 37, 38, 43, 44, 45, 46, 47, 49, 55, 00594 56, 57, 61, 63, 64 00595 }; 00596 00597 #if YYDEBUG 00598 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in 00599 YYRHS. */ 00600 static const yytype_uint16 yyprhs[] = 00601 { 00602 0, 0, 3, 5, 7, 9, 12, 13, 17, 20, 00603 23, 25, 27, 32, 37, 42, 47, 52, 57, 62, 00604 69, 74, 79, 84, 89, 92, 97, 104, 109, 116, 00605 120, 122, 126, 133, 140, 144, 149, 150, 156, 161, 00606 162, 168, 169, 171, 175, 177, 181, 186, 191, 195, 00607 199, 203, 207, 211, 215, 219, 223, 227, 231, 235, 00608 239, 243, 247, 251, 255, 259, 263, 265, 267, 269, 00609 271, 273, 275, 277, 282, 284, 286, 288, 292, 294, 00610 296, 300, 302 00611 }; 00612 00613 /* YYRHS -- A `-1'-separated list of the rules' RHS. */ 00614 static const yytype_int8 yyrhs[] = 00615 { 00616 70, 0, -1, 72, -1, 71, -1, 83, -1, 72, 00617 58, -1, -1, 52, 73, 72, -1, 51, 72, -1, 00618 74, 72, -1, 63, -1, 62, -1, 18, 60, 72, 00619 65, -1, 19, 60, 72, 65, -1, 21, 60, 72, 00620 65, -1, 20, 60, 72, 65, -1, 22, 60, 83, 00621 65, -1, 23, 60, 83, 65, -1, 24, 60, 72, 00622 65, -1, 25, 60, 83, 36, 72, 65, -1, 26, 00623 60, 72, 65, -1, 27, 60, 72, 65, -1, 28, 00624 60, 72, 65, -1, 29, 60, 72, 65, -1, 17, 00625 72, -1, 30, 60, 72, 65, -1, 30, 60, 72, 00626 36, 72, 65, -1, 31, 60, 72, 65, -1, 31, 00627 60, 72, 36, 72, 65, -1, 72, 61, 12, -1, 00628 75, -1, 72, 43, 75, -1, 32, 60, 72, 36, 00629 72, 65, -1, 33, 60, 72, 36, 72, 65, -1, 00630 66, 78, 67, -1, 83, 66, 78, 67, -1, -1, 00631 72, 59, 76, 79, 68, -1, 72, 59, 72, 68, 00632 -1, -1, 72, 60, 77, 78, 65, -1, -1, 72, 00633 -1, 78, 36, 72, -1, 72, -1, 79, 36, 72, 00634 -1, 66, 83, 67, 72, -1, 83, 60, 72, 65, 00635 -1, 60, 72, 65, -1, 72, 50, 72, -1, 72, 00636 53, 72, -1, 72, 54, 72, -1, 72, 56, 72, 00637 -1, 72, 55, 72, -1, 72, 51, 72, -1, 72, 00638 52, 72, -1, 72, 41, 72, -1, 72, 44, 72, 00639 -1, 72, 42, 72, -1, 72, 46, 72, -1, 72, 00640 45, 72, -1, 72, 39, 72, -1, 72, 40, 72, 00641 -1, 72, 49, 72, -1, 72, 47, 72, -1, 72, 00642 38, 72, -1, 7, -1, 8, -1, 3, -1, 6, 00643 -1, 9, -1, 10, -1, 82, -1, 17, 60, 83, 00644 65, -1, 11, -1, 81, -1, 13, -1, 80, 34, 00645 13, -1, 81, -1, 35, -1, 80, 34, 12, -1, 00646 12, -1, 16, -1 00647 }; 00648 00649 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ 00650 static const yytype_uint16 yyrline[] = 00651 { 00652 0, 202, 202, 203, 206, 215, 220, 219, 226, 230, 00653 234, 235, 238, 242, 246, 250, 254, 260, 266, 270, 00654 276, 280, 284, 288, 292, 297, 301, 307, 311, 317, 00655 323, 326, 330, 334, 338, 340, 350, 346, 357, 364, 00656 361, 371, 374, 378, 383, 388, 393, 399, 405, 413, 00657 417, 421, 425, 429, 433, 437, 441, 445, 447, 451, 00658 455, 459, 463, 467, 471, 475, 482, 488, 494, 501, 00659 510, 518, 525, 528, 535, 542, 546, 555, 567, 575, 00660 579, 602, 647 00661 }; 00662 #endif 00663 00664 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE 00665 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. 00666 First, the terminals, then, starting at YYNTOKENS, nonterminals. */ 00667 static const char *const yytname[] = 00668 { 00669 "$end", "error", "$undefined", "INT", "HEX", "ERROR", "UINT", "M2_TRUE", 00670 "M2_FALSE", "CHAR", "FLOAT", "STRING", "NAME", "BLOCKNAME", "IDENT", 00671 "VARNAME", "TYPENAME", "SIZE", "CAP", "ORD", "HIGH", "ABS", "MIN_FUNC", 00672 "MAX_FUNC", "FLOAT_FUNC", "VAL", "CHR", "ODD", "TRUNC", "TSIZE", "INC", 00673 "DEC", "INCL", "EXCL", "COLONCOLON", "INTERNAL_VAR", "','", 00674 "ABOVE_COMMA", "ASSIGN", "'<'", "'>'", "'='", "'#'", "IN", "NOTEQUAL", 00675 "GEQ", "LEQ", "OROR", "'&'", "LOGICAL_AND", "'@'", "'+'", "'-'", "'*'", 00676 "'/'", "MOD", "DIV", "UNARY", "'^'", "'['", "'('", "DOT", "'~'", "NOT", 00677 "QID", "')'", "'{'", "'}'", "']'", "$accept", "start", "type_exp", "exp", 00678 "$@1", "not_exp", "set", "$@2", "$@3", "arglist", "non_empty_arglist", 00679 "block", "fblock", "variable", "type", 0 00680 }; 00681 #endif 00682 00683 # ifdef YYPRINT 00684 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to 00685 token YYLEX-NUM. */ 00686 static const yytype_uint16 yytoknum[] = 00687 { 00688 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 00689 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 00690 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 00691 285, 286, 287, 288, 289, 290, 44, 291, 292, 60, 00692 62, 61, 35, 293, 294, 295, 296, 297, 38, 298, 00693 64, 43, 45, 42, 47, 299, 300, 301, 94, 91, 00694 40, 302, 126, 303, 304, 41, 123, 125, 93 00695 }; 00696 # endif 00697 00698 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ 00699 static const yytype_uint8 yyr1[] = 00700 { 00701 0, 69, 70, 70, 71, 72, 73, 72, 72, 72, 00702 74, 74, 72, 72, 72, 72, 72, 72, 72, 72, 00703 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 00704 72, 72, 72, 72, 75, 75, 76, 72, 72, 77, 00705 72, 78, 78, 78, 79, 79, 72, 72, 72, 72, 00706 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 00707 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 00708 72, 72, 72, 72, 72, 80, 81, 81, 82, 82, 00709 82, 82, 83 00710 }; 00711 00712 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ 00713 static const yytype_uint8 yyr2[] = 00714 { 00715 0, 2, 1, 1, 1, 2, 0, 3, 2, 2, 00716 1, 1, 4, 4, 4, 4, 4, 4, 4, 6, 00717 4, 4, 4, 4, 2, 4, 6, 4, 6, 3, 00718 1, 3, 6, 6, 3, 4, 0, 5, 4, 0, 00719 5, 0, 1, 3, 1, 3, 4, 4, 3, 3, 00720 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 00721 3, 3, 3, 3, 3, 3, 1, 1, 1, 1, 00722 1, 1, 1, 4, 1, 1, 1, 3, 1, 1, 00723 3, 1, 1 00724 }; 00725 00726 /* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM. 00727 Performed when YYTABLE doesn't specify something else to do. Zero 00728 means the default is an error. */ 00729 static const yytype_uint8 yydefact[] = 00730 { 00731 0, 68, 69, 66, 67, 70, 71, 74, 81, 76, 00732 82, 0, 0, 0, 0, 0, 0, 0, 0, 0, 00733 0, 0, 0, 0, 0, 0, 0, 0, 79, 0, 00734 6, 0, 11, 10, 41, 0, 3, 2, 0, 30, 00735 0, 78, 72, 4, 0, 24, 0, 0, 0, 0, 00736 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 00737 0, 0, 0, 8, 0, 0, 42, 0, 0, 1, 00738 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 00739 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 00740 39, 0, 9, 0, 0, 41, 0, 0, 0, 0, 00741 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 00742 0, 0, 0, 7, 48, 0, 34, 0, 65, 61, 00743 62, 56, 58, 41, 31, 0, 57, 60, 59, 64, 00744 63, 49, 54, 55, 50, 51, 53, 52, 0, 0, 00745 41, 29, 80, 77, 0, 0, 73, 12, 13, 15, 00746 14, 16, 17, 18, 0, 20, 21, 22, 23, 0, 00747 25, 0, 27, 0, 0, 43, 46, 38, 44, 0, 00748 0, 47, 35, 0, 0, 0, 0, 0, 0, 37, 00749 40, 19, 26, 28, 32, 33, 45 00750 }; 00751 00752 /* YYDEFGOTO[NTERM-NUM]. */ 00753 static const yytype_int16 yydefgoto[] = 00754 { 00755 -1, 35, 36, 66, 64, 38, 39, 139, 140, 67, 00756 169, 40, 41, 42, 46 00757 }; 00758 00759 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing 00760 STATE-NUM. */ 00761 #define YYPACT_NINF -89 00762 static const yytype_int16 yypact[] = 00763 { 00764 163, -89, -89, -89, -89, -89, -89, -89, -89, -89, 00765 -89, 224, -54, -35, -30, -20, -19, -14, 3, 9, 00766 15, 30, 31, 32, 33, 35, 36, 37, -89, 163, 00767 -89, 163, -89, -89, 163, 28, -89, 838, 163, -89, 00768 11, 65, -89, -27, 163, 7, -27, 163, 163, 163, 00769 163, 84, 84, 163, 84, 163, 163, 163, 163, 163, 00770 163, 163, 163, 7, 163, 340, 838, -32, -40, -89, 00771 163, 163, 163, 163, 163, -15, 163, 163, 163, 163, 00772 163, 163, 163, 163, 163, 163, 163, 163, -89, 163, 00773 -89, 89, 7, -4, 163, 163, -23, 368, 396, 424, 00774 452, 38, 39, 480, 66, 508, 536, 564, 592, 284, 00775 312, 788, 814, 7, -89, 163, -89, 163, 862, -37, 00776 -37, -37, -37, 163, -89, 41, -37, -37, -37, 72, 00777 90, 148, 207, 207, 7, 7, 7, 7, 253, 163, 00778 163, -89, -89, -89, 620, -31, -89, -89, -89, -89, 00779 -89, -89, -89, -89, 163, -89, -89, -89, -89, 163, 00780 -89, 163, -89, 163, 163, 838, 7, -89, 838, -34, 00781 -33, -89, -89, 648, 676, 704, 732, 760, 163, -89, 00782 -89, -89, -89, -89, -89, -89, 838 00783 }; 00784 00785 /* YYPGOTO[NTERM-NUM]. */ 00786 static const yytype_int8 yypgoto[] = 00787 { 00788 -89, -89, -89, 0, -89, -89, 34, -89, -89, -88, 00789 -89, -89, -89, -89, 54 00790 }; 00791 00792 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If 00793 positive, shift that token. If negative, reduce the rule which 00794 number is the opposite. If YYTABLE_NINF, syntax error. */ 00795 #define YYTABLE_NINF -76 00796 static const yytype_int16 yytable[] = 00797 { 00798 37, 10, 178, 115, 115, 115, 47, 145, 142, 143, 00799 79, 45, 80, 81, 82, 83, 84, 85, 86, 87, 00800 94, 88, 89, 90, 91, 48, 95, 117, 69, 63, 00801 49, 65, 180, 94, 179, 116, 172, 94, 92, 95, 00802 50, 51, 146, 95, 65, 93, 52, 97, 98, 99, 00803 100, 123, 170, 103, 43, 105, 106, 107, 108, 109, 00804 110, 111, 112, 53, 113, 88, 89, 90, 91, 54, 00805 118, 119, 120, 121, 122, 55, 126, 127, 128, 129, 00806 130, 131, 132, 133, 134, 135, 136, 137, 68, 138, 00807 56, 57, 58, 59, 144, 60, 61, 62, 96, -75, 00808 10, 141, 154, 151, 152, 101, 102, 95, 104, 124, 00809 0, 0, 0, 0, 0, 165, 0, 166, 0, 0, 00810 0, 80, 81, 82, 83, 84, 85, 86, 87, 125, 00811 88, 89, 90, 91, 0, 0, 0, 0, 0, 168, 00812 81, 82, 83, 84, 85, 86, 87, 0, 88, 89, 00813 90, 91, 0, 0, 173, 0, 0, 0, 0, 174, 00814 0, 175, 0, 176, 177, 0, 1, 0, 0, 2, 00815 3, 4, 5, 6, 7, 8, 9, 0, 186, 10, 00816 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 00817 21, 22, 23, 24, 25, 26, 27, 0, 28, 82, 00818 83, 84, 85, 86, 87, 0, 88, 89, 90, 91, 00819 0, 0, 0, 0, 29, 30, 0, 0, 0, 0, 00820 0, 0, 0, 31, 0, 32, 33, 1, 0, 34, 00821 2, 3, 4, 5, 6, 7, 8, 9, 0, 0, 00822 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 00823 20, 21, 22, 23, 24, 25, 26, 27, 0, 28, 00824 84, 85, 86, 87, 0, 88, 89, 90, 91, 0, 00825 0, 0, 0, 0, 0, 29, 30, 0, 0, 0, 00826 0, 0, 0, 0, 44, 0, 32, 33, 0, 0, 00827 34, 70, 71, 72, 73, 74, 75, 76, 77, 78, 00828 79, 0, 80, 81, 82, 83, 84, 85, 86, 87, 00829 0, 88, 89, 90, 91, 0, 0, 0, 0, 0, 00830 159, 167, 70, 71, 72, 73, 74, 75, 76, 77, 00831 78, 79, 0, 80, 81, 82, 83, 84, 85, 86, 00832 87, 0, 88, 89, 90, 91, 0, 0, 161, 160, 00833 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 00834 0, 80, 81, 82, 83, 84, 85, 86, 87, 0, 00835 88, 89, 90, 91, 0, 0, 0, 162, 70, 71, 00836 72, 73, 74, 75, 76, 77, 78, 79, 0, 80, 00837 81, 82, 83, 84, 85, 86, 87, 0, 88, 89, 00838 90, 91, 0, 0, 0, 114, 70, 71, 72, 73, 00839 74, 75, 76, 77, 78, 79, 0, 80, 81, 82, 00840 83, 84, 85, 86, 87, 0, 88, 89, 90, 91, 00841 0, 0, 0, 147, 70, 71, 72, 73, 74, 75, 00842 76, 77, 78, 79, 0, 80, 81, 82, 83, 84, 00843 85, 86, 87, 0, 88, 89, 90, 91, 0, 0, 00844 0, 148, 70, 71, 72, 73, 74, 75, 76, 77, 00845 78, 79, 0, 80, 81, 82, 83, 84, 85, 86, 00846 87, 0, 88, 89, 90, 91, 0, 0, 0, 149, 00847 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 00848 0, 80, 81, 82, 83, 84, 85, 86, 87, 0, 00849 88, 89, 90, 91, 0, 0, 0, 150, 70, 71, 00850 72, 73, 74, 75, 76, 77, 78, 79, 0, 80, 00851 81, 82, 83, 84, 85, 86, 87, 0, 88, 89, 00852 90, 91, 0, 0, 0, 153, 70, 71, 72, 73, 00853 74, 75, 76, 77, 78, 79, 0, 80, 81, 82, 00854 83, 84, 85, 86, 87, 0, 88, 89, 90, 91, 00855 0, 0, 0, 155, 70, 71, 72, 73, 74, 75, 00856 76, 77, 78, 79, 0, 80, 81, 82, 83, 84, 00857 85, 86, 87, 0, 88, 89, 90, 91, 0, 0, 00858 0, 156, 70, 71, 72, 73, 74, 75, 76, 77, 00859 78, 79, 0, 80, 81, 82, 83, 84, 85, 86, 00860 87, 0, 88, 89, 90, 91, 0, 0, 0, 157, 00861 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 00862 0, 80, 81, 82, 83, 84, 85, 86, 87, 0, 00863 88, 89, 90, 91, 0, 0, 0, 158, 70, 71, 00864 72, 73, 74, 75, 76, 77, 78, 79, 0, 80, 00865 81, 82, 83, 84, 85, 86, 87, 0, 88, 89, 00866 90, 91, 0, 0, 0, 171, 70, 71, 72, 73, 00867 74, 75, 76, 77, 78, 79, 0, 80, 81, 82, 00868 83, 84, 85, 86, 87, 0, 88, 89, 90, 91, 00869 0, 0, 0, 181, 70, 71, 72, 73, 74, 75, 00870 76, 77, 78, 79, 0, 80, 81, 82, 83, 84, 00871 85, 86, 87, 0, 88, 89, 90, 91, 0, 0, 00872 0, 182, 70, 71, 72, 73, 74, 75, 76, 77, 00873 78, 79, 0, 80, 81, 82, 83, 84, 85, 86, 00874 87, 0, 88, 89, 90, 91, 0, 0, 0, 183, 00875 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 00876 0, 80, 81, 82, 83, 84, 85, 86, 87, 0, 00877 88, 89, 90, 91, 0, 0, 0, 184, 70, 71, 00878 72, 73, 74, 75, 76, 77, 78, 79, 0, 80, 00879 81, 82, 83, 84, 85, 86, 87, 0, 88, 89, 00880 90, 91, 0, 0, 163, 185, 70, 71, 72, 73, 00881 74, 75, 76, 77, 78, 79, 0, 80, 81, 82, 00882 83, 84, 85, 86, 87, 0, 88, 89, 90, 91, 00883 164, 0, 70, 71, 72, 73, 74, 75, 76, 77, 00884 78, 79, 0, 80, 81, 82, 83, 84, 85, 86, 00885 87, 0, 88, 89, 90, 91, 70, 71, 72, 73, 00886 74, 75, 76, 77, 78, 79, 0, 80, 81, 82, 00887 83, 84, 85, 86, 87, 0, 88, 89, 90, 91, 00888 -76, 71, 72, 73, 74, 75, 76, 77, 78, 79, 00889 0, 80, 81, 82, 83, 84, 85, 86, 87, 0, 00890 88, 89, 90, 91 00891 }; 00892 00893 #define yypact_value_is_default(yystate) \ 00894 ((yystate) == (-89)) 00895 00896 #define yytable_value_is_error(yytable_value) \ 00897 ((yytable_value) == (-76)) 00898 00899 static const yytype_int16 yycheck[] = 00900 { 00901 0, 16, 36, 36, 36, 36, 60, 95, 12, 13, 00902 47, 11, 49, 50, 51, 52, 53, 54, 55, 56, 00903 60, 58, 59, 60, 61, 60, 66, 67, 0, 29, 00904 60, 31, 65, 60, 68, 67, 67, 60, 38, 66, 00905 60, 60, 65, 66, 44, 34, 60, 47, 48, 49, 00906 50, 66, 140, 53, 0, 55, 56, 57, 58, 59, 00907 60, 61, 62, 60, 64, 58, 59, 60, 61, 60, 00908 70, 71, 72, 73, 74, 60, 76, 77, 78, 79, 00909 80, 81, 82, 83, 84, 85, 86, 87, 34, 89, 00910 60, 60, 60, 60, 94, 60, 60, 60, 44, 34, 00911 16, 12, 36, 65, 65, 51, 52, 66, 54, 75, 00912 -1, -1, -1, -1, -1, 115, -1, 117, -1, -1, 00913 -1, 49, 50, 51, 52, 53, 54, 55, 56, 75, 00914 58, 59, 60, 61, -1, -1, -1, -1, -1, 139, 00915 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 00916 60, 61, -1, -1, 154, -1, -1, -1, -1, 159, 00917 -1, 161, -1, 163, 164, -1, 3, -1, -1, 6, 00918 7, 8, 9, 10, 11, 12, 13, -1, 178, 16, 00919 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 00920 27, 28, 29, 30, 31, 32, 33, -1, 35, 51, 00921 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 00922 -1, -1, -1, -1, 51, 52, -1, -1, -1, -1, 00923 -1, -1, -1, 60, -1, 62, 63, 3, -1, 66, 00924 6, 7, 8, 9, 10, 11, 12, 13, -1, -1, 00925 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 00926 26, 27, 28, 29, 30, 31, 32, 33, -1, 35, 00927 53, 54, 55, 56, -1, 58, 59, 60, 61, -1, 00928 -1, -1, -1, -1, -1, 51, 52, -1, -1, -1, 00929 -1, -1, -1, -1, 60, -1, 62, 63, -1, -1, 00930 66, 38, 39, 40, 41, 42, 43, 44, 45, 46, 00931 47, -1, 49, 50, 51, 52, 53, 54, 55, 56, 00932 -1, 58, 59, 60, 61, -1, -1, -1, -1, -1, 00933 36, 68, 38, 39, 40, 41, 42, 43, 44, 45, 00934 46, 47, -1, 49, 50, 51, 52, 53, 54, 55, 00935 56, -1, 58, 59, 60, 61, -1, -1, 36, 65, 00936 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 00937 -1, 49, 50, 51, 52, 53, 54, 55, 56, -1, 00938 58, 59, 60, 61, -1, -1, -1, 65, 38, 39, 00939 40, 41, 42, 43, 44, 45, 46, 47, -1, 49, 00940 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 00941 60, 61, -1, -1, -1, 65, 38, 39, 40, 41, 00942 42, 43, 44, 45, 46, 47, -1, 49, 50, 51, 00943 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 00944 -1, -1, -1, 65, 38, 39, 40, 41, 42, 43, 00945 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, 00946 54, 55, 56, -1, 58, 59, 60, 61, -1, -1, 00947 -1, 65, 38, 39, 40, 41, 42, 43, 44, 45, 00948 46, 47, -1, 49, 50, 51, 52, 53, 54, 55, 00949 56, -1, 58, 59, 60, 61, -1, -1, -1, 65, 00950 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 00951 -1, 49, 50, 51, 52, 53, 54, 55, 56, -1, 00952 58, 59, 60, 61, -1, -1, -1, 65, 38, 39, 00953 40, 41, 42, 43, 44, 45, 46, 47, -1, 49, 00954 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 00955 60, 61, -1, -1, -1, 65, 38, 39, 40, 41, 00956 42, 43, 44, 45, 46, 47, -1, 49, 50, 51, 00957 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 00958 -1, -1, -1, 65, 38, 39, 40, 41, 42, 43, 00959 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, 00960 54, 55, 56, -1, 58, 59, 60, 61, -1, -1, 00961 -1, 65, 38, 39, 40, 41, 42, 43, 44, 45, 00962 46, 47, -1, 49, 50, 51, 52, 53, 54, 55, 00963 56, -1, 58, 59, 60, 61, -1, -1, -1, 65, 00964 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 00965 -1, 49, 50, 51, 52, 53, 54, 55, 56, -1, 00966 58, 59, 60, 61, -1, -1, -1, 65, 38, 39, 00967 40, 41, 42, 43, 44, 45, 46, 47, -1, 49, 00968 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 00969 60, 61, -1, -1, -1, 65, 38, 39, 40, 41, 00970 42, 43, 44, 45, 46, 47, -1, 49, 50, 51, 00971 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 00972 -1, -1, -1, 65, 38, 39, 40, 41, 42, 43, 00973 44, 45, 46, 47, -1, 49, 50, 51, 52, 53, 00974 54, 55, 56, -1, 58, 59, 60, 61, -1, -1, 00975 -1, 65, 38, 39, 40, 41, 42, 43, 44, 45, 00976 46, 47, -1, 49, 50, 51, 52, 53, 54, 55, 00977 56, -1, 58, 59, 60, 61, -1, -1, -1, 65, 00978 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 00979 -1, 49, 50, 51, 52, 53, 54, 55, 56, -1, 00980 58, 59, 60, 61, -1, -1, -1, 65, 38, 39, 00981 40, 41, 42, 43, 44, 45, 46, 47, -1, 49, 00982 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, 00983 60, 61, -1, -1, 36, 65, 38, 39, 40, 41, 00984 42, 43, 44, 45, 46, 47, -1, 49, 50, 51, 00985 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 00986 36, -1, 38, 39, 40, 41, 42, 43, 44, 45, 00987 46, 47, -1, 49, 50, 51, 52, 53, 54, 55, 00988 56, -1, 58, 59, 60, 61, 38, 39, 40, 41, 00989 42, 43, 44, 45, 46, 47, -1, 49, 50, 51, 00990 52, 53, 54, 55, 56, -1, 58, 59, 60, 61, 00991 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 00992 -1, 49, 50, 51, 52, 53, 54, 55, 56, -1, 00993 58, 59, 60, 61 00994 }; 00995 00996 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing 00997 symbol of state STATE-NUM. */ 00998 static const yytype_uint8 yystos[] = 00999 { 01000 0, 3, 6, 7, 8, 9, 10, 11, 12, 13, 01001 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 01002 26, 27, 28, 29, 30, 31, 32, 33, 35, 51, 01003 52, 60, 62, 63, 66, 70, 71, 72, 74, 75, 01004 80, 81, 82, 83, 60, 72, 83, 60, 60, 60, 01005 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 01006 60, 60, 60, 72, 73, 72, 72, 78, 83, 0, 01007 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 01008 49, 50, 51, 52, 53, 54, 55, 56, 58, 59, 01009 60, 61, 72, 34, 60, 66, 83, 72, 72, 72, 01010 72, 83, 83, 72, 83, 72, 72, 72, 72, 72, 01011 72, 72, 72, 72, 65, 36, 67, 67, 72, 72, 01012 72, 72, 72, 66, 75, 83, 72, 72, 72, 72, 01013 72, 72, 72, 72, 72, 72, 72, 72, 72, 76, 01014 77, 12, 12, 13, 72, 78, 65, 65, 65, 65, 01015 65, 65, 65, 65, 36, 65, 65, 65, 65, 36, 01016 65, 36, 65, 36, 36, 72, 72, 68, 72, 79, 01017 78, 65, 67, 72, 72, 72, 72, 72, 36, 68, 01018 65, 65, 65, 65, 65, 65, 72 01019 }; 01020 01021 #define yyerrok (yyerrstatus = 0) 01022 #define yyclearin (yychar = YYEMPTY) 01023 #define YYEMPTY (-2) 01024 #define YYEOF 0 01025 01026 #define YYACCEPT goto yyacceptlab 01027 #define YYABORT goto yyabortlab 01028 #define YYERROR goto yyerrorlab 01029 01030 01031 /* Like YYERROR except do call yyerror. This remains here temporarily 01032 to ease the transition to the new meaning of YYERROR, for GCC. 01033 Once GCC version 2 has supplanted version 1, this can go. However, 01034 YYFAIL appears to be in use. Nevertheless, it is formally deprecated 01035 in Bison 2.4.2's NEWS entry, where a plan to phase it out is 01036 discussed. */ 01037 01038 #define YYFAIL goto yyerrlab 01039 #if defined YYFAIL 01040 /* This is here to suppress warnings from the GCC cpp's 01041 -Wunused-macros. Normally we don't worry about that warning, but 01042 some users do, and we want to make it easy for users to remove 01043 YYFAIL uses, which will produce warnings from Bison 2.5. */ 01044 #endif 01045 01046 #define YYRECOVERING() (!!yyerrstatus) 01047 01048 #define YYBACKUP(Token, Value) \ 01049 do \ 01050 if (yychar == YYEMPTY && yylen == 1) \ 01051 { \ 01052 yychar = (Token); \ 01053 yylval = (Value); \ 01054 YYPOPSTACK (1); \ 01055 goto yybackup; \ 01056 } \ 01057 else \ 01058 { \ 01059 yyerror (YY_("syntax error: cannot back up")); \ 01060 YYERROR; \ 01061 } \ 01062 while (YYID (0)) 01063 01064 01065 #define YYTERROR 1 01066 #define YYERRCODE 256 01067 01068 01069 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. 01070 If N is 0, then set CURRENT to the empty location which ends 01071 the previous symbol: RHS[0] (always defined). */ 01072 01073 #define YYRHSLOC(Rhs, K) ((Rhs)[K]) 01074 #ifndef YYLLOC_DEFAULT 01075 # define YYLLOC_DEFAULT(Current, Rhs, N) \ 01076 do \ 01077 if (YYID (N)) \ 01078 { \ 01079 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ 01080 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ 01081 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ 01082 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ 01083 } \ 01084 else \ 01085 { \ 01086 (Current).first_line = (Current).last_line = \ 01087 YYRHSLOC (Rhs, 0).last_line; \ 01088 (Current).first_column = (Current).last_column = \ 01089 YYRHSLOC (Rhs, 0).last_column; \ 01090 } \ 01091 while (YYID (0)) 01092 #endif 01093 01094 01095 /* This macro is provided for backward compatibility. */ 01096 01097 #ifndef YY_LOCATION_PRINT 01098 # define YY_LOCATION_PRINT(File, Loc) ((void) 0) 01099 #endif 01100 01101 01102 /* YYLEX -- calling `yylex' with the right arguments. */ 01103 01104 #ifdef YYLEX_PARAM 01105 # define YYLEX yylex (YYLEX_PARAM) 01106 #else 01107 # define YYLEX yylex () 01108 #endif 01109 01110 /* Enable debugging if requested. */ 01111 #if YYDEBUG 01112 01113 # ifndef YYFPRINTF 01114 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */ 01115 # define YYFPRINTF fprintf 01116 # endif 01117 01118 # define YYDPRINTF(Args) \ 01119 do { \ 01120 if (yydebug) \ 01121 YYFPRINTF Args; \ 01122 } while (YYID (0)) 01123 01124 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ 01125 do { \ 01126 if (yydebug) \ 01127 { \ 01128 YYFPRINTF (stderr, "%s ", Title); \ 01129 yy_symbol_print (stderr, \ 01130 Type, Value); \ 01131 YYFPRINTF (stderr, "\n"); \ 01132 } \ 01133 } while (YYID (0)) 01134 01135 01136 /*--------------------------------. 01137 | Print this symbol on YYOUTPUT. | 01138 `--------------------------------*/ 01139 01140 /*ARGSUSED*/ 01141 #if (defined __STDC__ || defined __C99__FUNC__ \ 01142 || defined __cplusplus || defined _MSC_VER) 01143 static void 01144 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) 01145 #else 01146 static void 01147 yy_symbol_value_print (yyoutput, yytype, yyvaluep) 01148 FILE *yyoutput; 01149 int yytype; 01150 YYSTYPE const * const yyvaluep; 01151 #endif 01152 { 01153 if (!yyvaluep) 01154 return; 01155 # ifdef YYPRINT 01156 if (yytype < YYNTOKENS) 01157 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); 01158 # else 01159 YYUSE (yyoutput); 01160 # endif 01161 switch (yytype) 01162 { 01163 default: 01164 break; 01165 } 01166 } 01167 01168 01169 /*--------------------------------. 01170 | Print this symbol on YYOUTPUT. | 01171 `--------------------------------*/ 01172 01173 #if (defined __STDC__ || defined __C99__FUNC__ \ 01174 || defined __cplusplus || defined _MSC_VER) 01175 static void 01176 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) 01177 #else 01178 static void 01179 yy_symbol_print (yyoutput, yytype, yyvaluep) 01180 FILE *yyoutput; 01181 int yytype; 01182 YYSTYPE const * const yyvaluep; 01183 #endif 01184 { 01185 if (yytype < YYNTOKENS) 01186 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); 01187 else 01188 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); 01189 01190 yy_symbol_value_print (yyoutput, yytype, yyvaluep); 01191 YYFPRINTF (yyoutput, ")"); 01192 } 01193 01194 /*------------------------------------------------------------------. 01195 | yy_stack_print -- Print the state stack from its BOTTOM up to its | 01196 | TOP (included). | 01197 `------------------------------------------------------------------*/ 01198 01199 #if (defined __STDC__ || defined __C99__FUNC__ \ 01200 || defined __cplusplus || defined _MSC_VER) 01201 static void 01202 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) 01203 #else 01204 static void 01205 yy_stack_print (yybottom, yytop) 01206 yytype_int16 *yybottom; 01207 yytype_int16 *yytop; 01208 #endif 01209 { 01210 YYFPRINTF (stderr, "Stack now"); 01211 for (; yybottom <= yytop; yybottom++) 01212 { 01213 int yybot = *yybottom; 01214 YYFPRINTF (stderr, " %d", yybot); 01215 } 01216 YYFPRINTF (stderr, "\n"); 01217 } 01218 01219 # define YY_STACK_PRINT(Bottom, Top) \ 01220 do { \ 01221 if (yydebug) \ 01222 yy_stack_print ((Bottom), (Top)); \ 01223 } while (YYID (0)) 01224 01225 01226 /*------------------------------------------------. 01227 | Report that the YYRULE is going to be reduced. | 01228 `------------------------------------------------*/ 01229 01230 #if (defined __STDC__ || defined __C99__FUNC__ \ 01231 || defined __cplusplus || defined _MSC_VER) 01232 static void 01233 yy_reduce_print (YYSTYPE *yyvsp, int yyrule) 01234 #else 01235 static void 01236 yy_reduce_print (yyvsp, yyrule) 01237 YYSTYPE *yyvsp; 01238 int yyrule; 01239 #endif 01240 { 01241 int yynrhs = yyr2[yyrule]; 01242 int yyi; 01243 unsigned long int yylno = yyrline[yyrule]; 01244 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", 01245 yyrule - 1, yylno); 01246 /* The symbols being reduced. */ 01247 for (yyi = 0; yyi < yynrhs; yyi++) 01248 { 01249 YYFPRINTF (stderr, " $%d = ", yyi + 1); 01250 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], 01251 &(yyvsp[(yyi + 1) - (yynrhs)]) 01252 ); 01253 YYFPRINTF (stderr, "\n"); 01254 } 01255 } 01256 01257 # define YY_REDUCE_PRINT(Rule) \ 01258 do { \ 01259 if (yydebug) \ 01260 yy_reduce_print (yyvsp, Rule); \ 01261 } while (YYID (0)) 01262 01263 /* Nonzero means print parse trace. It is left uninitialized so that 01264 multiple parsers can coexist. */ 01265 int yydebug; 01266 #else /* !YYDEBUG */ 01267 # define YYDPRINTF(Args) 01268 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) 01269 # define YY_STACK_PRINT(Bottom, Top) 01270 # define YY_REDUCE_PRINT(Rule) 01271 #endif /* !YYDEBUG */ 01272 01273 01274 /* YYINITDEPTH -- initial size of the parser's stacks. */ 01275 #ifndef YYINITDEPTH 01276 # define YYINITDEPTH 200 01277 #endif 01278 01279 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only 01280 if the built-in stack extension method is used). 01281 01282 Do not make this value too large; the results are undefined if 01283 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) 01284 evaluated with infinite-precision integer arithmetic. */ 01285 01286 #ifndef YYMAXDEPTH 01287 # define YYMAXDEPTH 10000 01288 #endif 01289 01290 01291 #if YYERROR_VERBOSE 01292 01293 # ifndef yystrlen 01294 # if defined __GLIBC__ && defined _STRING_H 01295 # define yystrlen strlen 01296 # else 01297 /* Return the length of YYSTR. */ 01298 #if (defined __STDC__ || defined __C99__FUNC__ \ 01299 || defined __cplusplus || defined _MSC_VER) 01300 static YYSIZE_T 01301 yystrlen (const char *yystr) 01302 #else 01303 static YYSIZE_T 01304 yystrlen (yystr) 01305 const char *yystr; 01306 #endif 01307 { 01308 YYSIZE_T yylen; 01309 for (yylen = 0; yystr[yylen]; yylen++) 01310 continue; 01311 return yylen; 01312 } 01313 # endif 01314 # endif 01315 01316 # ifndef yystpcpy 01317 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE 01318 # define yystpcpy stpcpy 01319 # else 01320 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in 01321 YYDEST. */ 01322 #if (defined __STDC__ || defined __C99__FUNC__ \ 01323 || defined __cplusplus || defined _MSC_VER) 01324 static char * 01325 yystpcpy (char *yydest, const char *yysrc) 01326 #else 01327 static char * 01328 yystpcpy (yydest, yysrc) 01329 char *yydest; 01330 const char *yysrc; 01331 #endif 01332 { 01333 char *yyd = yydest; 01334 const char *yys = yysrc; 01335 01336 while ((*yyd++ = *yys++) != '\0') 01337 continue; 01338 01339 return yyd - 1; 01340 } 01341 # endif 01342 # endif 01343 01344 # ifndef yytnamerr 01345 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary 01346 quotes and backslashes, so that it's suitable for yyerror. The 01347 heuristic is that double-quoting is unnecessary unless the string 01348 contains an apostrophe, a comma, or backslash (other than 01349 backslash-backslash). YYSTR is taken from yytname. If YYRES is 01350 null, do not copy; instead, return the length of what the result 01351 would have been. */ 01352 static YYSIZE_T 01353 yytnamerr (char *yyres, const char *yystr) 01354 { 01355 if (*yystr == '"') 01356 { 01357 YYSIZE_T yyn = 0; 01358 char const *yyp = yystr; 01359 01360 for (;;) 01361 switch (*++yyp) 01362 { 01363 case '\'': 01364 case ',': 01365 goto do_not_strip_quotes; 01366 01367 case '\\': 01368 if (*++yyp != '\\') 01369 goto do_not_strip_quotes; 01370 /* Fall through. */ 01371 default: 01372 if (yyres) 01373 yyres[yyn] = *yyp; 01374 yyn++; 01375 break; 01376 01377 case '"': 01378 if (yyres) 01379 yyres[yyn] = '\0'; 01380 return yyn; 01381 } 01382 do_not_strip_quotes: ; 01383 } 01384 01385 if (! yyres) 01386 return yystrlen (yystr); 01387 01388 return yystpcpy (yyres, yystr) - yyres; 01389 } 01390 # endif 01391 01392 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message 01393 about the unexpected token YYTOKEN for the state stack whose top is 01394 YYSSP. 01395 01396 Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is 01397 not large enough to hold the message. In that case, also set 01398 *YYMSG_ALLOC to the required number of bytes. Return 2 if the 01399 required number of bytes is too large to store. */ 01400 static int 01401 yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, 01402 yytype_int16 *yyssp, int yytoken) 01403 { 01404 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytoken]); 01405 YYSIZE_T yysize = yysize0; 01406 YYSIZE_T yysize1; 01407 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; 01408 /* Internationalized format string. */ 01409 const char *yyformat = 0; 01410 /* Arguments of yyformat. */ 01411 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; 01412 /* Number of reported tokens (one for the "unexpected", one per 01413 "expected"). */ 01414 int yycount = 0; 01415 01416 /* There are many possibilities here to consider: 01417 - Assume YYFAIL is not used. It's too flawed to consider. See 01418 <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html> 01419 for details. YYERROR is fine as it does not invoke this 01420 function. 01421 - If this state is a consistent state with a default action, then 01422 the only way this function was invoked is if the default action 01423 is an error action. In that case, don't check for expected 01424 tokens because there are none. 01425 - The only way there can be no lookahead present (in yychar) is if 01426 this state is a consistent state with a default action. Thus, 01427 detecting the absence of a lookahead is sufficient to determine 01428 that there is no unexpected or expected token to report. In that 01429 case, just report a simple "syntax error". 01430 - Don't assume there isn't a lookahead just because this state is a 01431 consistent state with a default action. There might have been a 01432 previous inconsistent state, consistent state with a non-default 01433 action, or user semantic action that manipulated yychar. 01434 - Of course, the expected token list depends on states to have 01435 correct lookahead information, and it depends on the parser not 01436 to perform extra reductions after fetching a lookahead from the 01437 scanner and before detecting a syntax error. Thus, state merging 01438 (from LALR or IELR) and default reductions corrupt the expected 01439 token list. However, the list is correct for canonical LR with 01440 one exception: it will still contain any token that will not be 01441 accepted due to an error action in a later state. 01442 */ 01443 if (yytoken != YYEMPTY) 01444 { 01445 int yyn = yypact[*yyssp]; 01446 yyarg[yycount++] = yytname[yytoken]; 01447 if (!yypact_value_is_default (yyn)) 01448 { 01449 /* Start YYX at -YYN if negative to avoid negative indexes in 01450 YYCHECK. In other words, skip the first -YYN actions for 01451 this state because they are default actions. */ 01452 int yyxbegin = yyn < 0 ? -yyn : 0; 01453 /* Stay within bounds of both yycheck and yytname. */ 01454 int yychecklim = YYLAST - yyn + 1; 01455 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; 01456 int yyx; 01457 01458 for (yyx = yyxbegin; yyx < yyxend; ++yyx) 01459 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR 01460 && !yytable_value_is_error (yytable[yyx + yyn])) 01461 { 01462 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) 01463 { 01464 yycount = 1; 01465 yysize = yysize0; 01466 break; 01467 } 01468 yyarg[yycount++] = yytname[yyx]; 01469 yysize1 = yysize + yytnamerr (0, yytname[yyx]); 01470 if (! (yysize <= yysize1 01471 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) 01472 return 2; 01473 yysize = yysize1; 01474 } 01475 } 01476 } 01477 01478 switch (yycount) 01479 { 01480 # define YYCASE_(N, S) \ 01481 case N: \ 01482 yyformat = S; \ 01483 break 01484 YYCASE_(0, YY_("syntax error")); 01485 YYCASE_(1, YY_("syntax error, unexpected %s")); 01486 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); 01487 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); 01488 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); 01489 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); 01490 # undef YYCASE_ 01491 } 01492 01493 yysize1 = yysize + yystrlen (yyformat); 01494 if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) 01495 return 2; 01496 yysize = yysize1; 01497 01498 if (*yymsg_alloc < yysize) 01499 { 01500 *yymsg_alloc = 2 * yysize; 01501 if (! (yysize <= *yymsg_alloc 01502 && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) 01503 *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; 01504 return 1; 01505 } 01506 01507 /* Avoid sprintf, as that infringes on the user's name space. 01508 Don't have undefined behavior even if the translation 01509 produced a string with the wrong number of "%s"s. */ 01510 { 01511 char *yyp = *yymsg; 01512 int yyi = 0; 01513 while ((*yyp = *yyformat) != '\0') 01514 if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) 01515 { 01516 yyp += yytnamerr (yyp, yyarg[yyi++]); 01517 yyformat += 2; 01518 } 01519 else 01520 { 01521 yyp++; 01522 yyformat++; 01523 } 01524 } 01525 return 0; 01526 } 01527 #endif /* YYERROR_VERBOSE */ 01528 01529 /*-----------------------------------------------. 01530 | Release the memory associated to this symbol. | 01531 `-----------------------------------------------*/ 01532 01533 /*ARGSUSED*/ 01534 #if (defined __STDC__ || defined __C99__FUNC__ \ 01535 || defined __cplusplus || defined _MSC_VER) 01536 static void 01537 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) 01538 #else 01539 static void 01540 yydestruct (yymsg, yytype, yyvaluep) 01541 const char *yymsg; 01542 int yytype; 01543 YYSTYPE *yyvaluep; 01544 #endif 01545 { 01546 YYUSE (yyvaluep); 01547 01548 if (!yymsg) 01549 yymsg = "Deleting"; 01550 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); 01551 01552 switch (yytype) 01553 { 01554 01555 default: 01556 break; 01557 } 01558 } 01559 01560 01561 /* Prevent warnings from -Wmissing-prototypes. */ 01562 #ifdef YYPARSE_PARAM 01563 #if defined __STDC__ || defined __cplusplus 01564 int yyparse (void *YYPARSE_PARAM); 01565 #else 01566 int yyparse (); 01567 #endif 01568 #else /* ! YYPARSE_PARAM */ 01569 #if defined __STDC__ || defined __cplusplus 01570 int yyparse (void); 01571 #else 01572 int yyparse (); 01573 #endif 01574 #endif /* ! YYPARSE_PARAM */ 01575 01576 01577 /* The lookahead symbol. */ 01578 int yychar; 01579 01580 /* The semantic value of the lookahead symbol. */ 01581 YYSTYPE yylval; 01582 01583 /* Number of syntax errors so far. */ 01584 int yynerrs; 01585 01586 01587 /*----------. 01588 | yyparse. | 01589 `----------*/ 01590 01591 #ifdef YYPARSE_PARAM 01592 #if (defined __STDC__ || defined __C99__FUNC__ \ 01593 || defined __cplusplus || defined _MSC_VER) 01594 int 01595 yyparse (void *YYPARSE_PARAM) 01596 #else 01597 int 01598 yyparse (YYPARSE_PARAM) 01599 void *YYPARSE_PARAM; 01600 #endif 01601 #else /* ! YYPARSE_PARAM */ 01602 #if (defined __STDC__ || defined __C99__FUNC__ \ 01603 || defined __cplusplus || defined _MSC_VER) 01604 int 01605 yyparse (void) 01606 #else 01607 int 01608 yyparse () 01609 01610 #endif 01611 #endif 01612 { 01613 int yystate; 01614 /* Number of tokens to shift before error messages enabled. */ 01615 int yyerrstatus; 01616 01617 /* The stacks and their tools: 01618 `yyss': related to states. 01619 `yyvs': related to semantic values. 01620 01621 Refer to the stacks thru separate pointers, to allow yyoverflow 01622 to xreallocate them elsewhere. */ 01623 01624 /* The state stack. */ 01625 yytype_int16 yyssa[YYINITDEPTH]; 01626 yytype_int16 *yyss; 01627 yytype_int16 *yyssp; 01628 01629 /* The semantic value stack. */ 01630 YYSTYPE yyvsa[YYINITDEPTH]; 01631 YYSTYPE *yyvs; 01632 YYSTYPE *yyvsp; 01633 01634 YYSIZE_T yystacksize; 01635 01636 int yyn; 01637 int yyresult; 01638 /* Lookahead token as an internal (translated) token number. */ 01639 int yytoken; 01640 /* The variables used to return semantic value and location from the 01641 action routines. */ 01642 YYSTYPE yyval; 01643 01644 #if YYERROR_VERBOSE 01645 /* Buffer for error messages, and its allocated size. */ 01646 char yymsgbuf[128]; 01647 char *yymsg = yymsgbuf; 01648 YYSIZE_T yymsg_alloc = sizeof yymsgbuf; 01649 #endif 01650 01651 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) 01652 01653 /* The number of symbols on the RHS of the reduced rule. 01654 Keep to zero when no symbol should be popped. */ 01655 int yylen = 0; 01656 01657 yytoken = 0; 01658 yyss = yyssa; 01659 yyvs = yyvsa; 01660 yystacksize = YYINITDEPTH; 01661 01662 YYDPRINTF ((stderr, "Starting parse\n")); 01663 01664 yystate = 0; 01665 yyerrstatus = 0; 01666 yynerrs = 0; 01667 yychar = YYEMPTY; /* Cause a token to be read. */ 01668 01669 /* Initialize stack pointers. 01670 Waste one element of value and location stack 01671 so that they stay on the same level as the state stack. 01672 The wasted elements are never initialized. */ 01673 yyssp = yyss; 01674 yyvsp = yyvs; 01675 01676 goto yysetstate; 01677 01678 /*------------------------------------------------------------. 01679 | yynewstate -- Push a new state, which is found in yystate. | 01680 `------------------------------------------------------------*/ 01681 yynewstate: 01682 /* In all cases, when you get here, the value and location stacks 01683 have just been pushed. So pushing a state here evens the stacks. */ 01684 yyssp++; 01685 01686 yysetstate: 01687 *yyssp = yystate; 01688 01689 if (yyss + yystacksize - 1 <= yyssp) 01690 { 01691 /* Get the current used size of the three stacks, in elements. */ 01692 YYSIZE_T yysize = yyssp - yyss + 1; 01693 01694 #ifdef yyoverflow 01695 { 01696 /* Give user a chance to xreallocate the stack. Use copies of 01697 these so that the &'s don't force the real ones into 01698 memory. */ 01699 YYSTYPE *yyvs1 = yyvs; 01700 yytype_int16 *yyss1 = yyss; 01701 01702 /* Each stack pointer address is followed by the size of the 01703 data in use in that stack, in bytes. This used to be a 01704 conditional around just the two extra args, but that might 01705 be undefined if yyoverflow is a macro. */ 01706 yyoverflow (YY_("memory exhausted"), 01707 &yyss1, yysize * sizeof (*yyssp), 01708 &yyvs1, yysize * sizeof (*yyvsp), 01709 &yystacksize); 01710 01711 yyss = yyss1; 01712 yyvs = yyvs1; 01713 } 01714 #else /* no yyoverflow */ 01715 # ifndef YYSTACK_RELOCATE 01716 goto yyexhaustedlab; 01717 # else 01718 /* Extend the stack our own way. */ 01719 if (YYMAXDEPTH <= yystacksize) 01720 goto yyexhaustedlab; 01721 yystacksize *= 2; 01722 if (YYMAXDEPTH < yystacksize) 01723 yystacksize = YYMAXDEPTH; 01724 01725 { 01726 yytype_int16 *yyss1 = yyss; 01727 union yyalloc *yyptr = 01728 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); 01729 if (! yyptr) 01730 goto yyexhaustedlab; 01731 YYSTACK_RELOCATE (yyss_alloc, yyss); 01732 YYSTACK_RELOCATE (yyvs_alloc, yyvs); 01733 # undef YYSTACK_RELOCATE 01734 if (yyss1 != yyssa) 01735 YYSTACK_FREE (yyss1); 01736 } 01737 # endif 01738 #endif /* no yyoverflow */ 01739 01740 yyssp = yyss + yysize - 1; 01741 yyvsp = yyvs + yysize - 1; 01742 01743 YYDPRINTF ((stderr, "Stack size increased to %lu\n", 01744 (unsigned long int) yystacksize)); 01745 01746 if (yyss + yystacksize - 1 <= yyssp) 01747 YYABORT; 01748 } 01749 01750 YYDPRINTF ((stderr, "Entering state %d\n", yystate)); 01751 01752 if (yystate == YYFINAL) 01753 YYACCEPT; 01754 01755 goto yybackup; 01756 01757 /*-----------. 01758 | yybackup. | 01759 `-----------*/ 01760 yybackup: 01761 01762 /* Do appropriate processing given the current state. Read a 01763 lookahead token if we need one and don't already have one. */ 01764 01765 /* First try to decide what to do without reference to lookahead token. */ 01766 yyn = yypact[yystate]; 01767 if (yypact_value_is_default (yyn)) 01768 goto yydefault; 01769 01770 /* Not known => get a lookahead token if don't already have one. */ 01771 01772 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ 01773 if (yychar == YYEMPTY) 01774 { 01775 YYDPRINTF ((stderr, "Reading a token: ")); 01776 yychar = YYLEX; 01777 } 01778 01779 if (yychar <= YYEOF) 01780 { 01781 yychar = yytoken = YYEOF; 01782 YYDPRINTF ((stderr, "Now at end of input.\n")); 01783 } 01784 else 01785 { 01786 yytoken = YYTRANSLATE (yychar); 01787 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); 01788 } 01789 01790 /* If the proper action on seeing token YYTOKEN is to reduce or to 01791 detect an error, take that action. */ 01792 yyn += yytoken; 01793 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) 01794 goto yydefault; 01795 yyn = yytable[yyn]; 01796 if (yyn <= 0) 01797 { 01798 if (yytable_value_is_error (yyn)) 01799 goto yyerrlab; 01800 yyn = -yyn; 01801 goto yyreduce; 01802 } 01803 01804 /* Count tokens shifted since error; after three, turn off error 01805 status. */ 01806 if (yyerrstatus) 01807 yyerrstatus--; 01808 01809 /* Shift the lookahead token. */ 01810 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); 01811 01812 /* Discard the shifted token. */ 01813 yychar = YYEMPTY; 01814 01815 yystate = yyn; 01816 *++yyvsp = yylval; 01817 01818 goto yynewstate; 01819 01820 01821 /*-----------------------------------------------------------. 01822 | yydefault -- do the default action for the current state. | 01823 `-----------------------------------------------------------*/ 01824 yydefault: 01825 yyn = yydefact[yystate]; 01826 if (yyn == 0) 01827 goto yyerrlab; 01828 goto yyreduce; 01829 01830 01831 /*-----------------------------. 01832 | yyreduce -- Do a reduction. | 01833 `-----------------------------*/ 01834 yyreduce: 01835 /* yyn is the number of a rule to reduce with. */ 01836 yylen = yyr2[yyn]; 01837 01838 /* If YYLEN is nonzero, implement the default value of the action: 01839 `$$ = $1'. 01840 01841 Otherwise, the following line sets YYVAL to garbage. 01842 This behavior is undocumented and Bison 01843 users should not rely upon it. Assigning to YYVAL 01844 unconditionally makes the parser a bit smaller, and it avoids a 01845 GCC warning that YYVAL may be used uninitialized. */ 01846 yyval = yyvsp[1-yylen]; 01847 01848 01849 YY_REDUCE_PRINT (yyn); 01850 switch (yyn) 01851 { 01852 case 4: 01853 01854 /* Line 1806 of yacc.c */ 01855 #line 207 "../../src/gdb/m2-exp.y" 01856 { write_exp_elt_opcode(OP_TYPE); 01857 write_exp_elt_type((yyvsp[(1) - (1)].tval)); 01858 write_exp_elt_opcode(OP_TYPE); 01859 } 01860 break; 01861 01862 case 5: 01863 01864 /* Line 1806 of yacc.c */ 01865 #line 216 "../../src/gdb/m2-exp.y" 01866 { write_exp_elt_opcode (UNOP_IND); } 01867 break; 01868 01869 case 6: 01870 01871 /* Line 1806 of yacc.c */ 01872 #line 220 "../../src/gdb/m2-exp.y" 01873 { number_sign = -1; } 01874 break; 01875 01876 case 7: 01877 01878 /* Line 1806 of yacc.c */ 01879 #line 222 "../../src/gdb/m2-exp.y" 01880 { number_sign = 1; 01881 write_exp_elt_opcode (UNOP_NEG); } 01882 break; 01883 01884 case 8: 01885 01886 /* Line 1806 of yacc.c */ 01887 #line 227 "../../src/gdb/m2-exp.y" 01888 { write_exp_elt_opcode(UNOP_PLUS); } 01889 break; 01890 01891 case 9: 01892 01893 /* Line 1806 of yacc.c */ 01894 #line 231 "../../src/gdb/m2-exp.y" 01895 { write_exp_elt_opcode (UNOP_LOGICAL_NOT); } 01896 break; 01897 01898 case 12: 01899 01900 /* Line 1806 of yacc.c */ 01901 #line 239 "../../src/gdb/m2-exp.y" 01902 { write_exp_elt_opcode (UNOP_CAP); } 01903 break; 01904 01905 case 13: 01906 01907 /* Line 1806 of yacc.c */ 01908 #line 243 "../../src/gdb/m2-exp.y" 01909 { write_exp_elt_opcode (UNOP_ORD); } 01910 break; 01911 01912 case 14: 01913 01914 /* Line 1806 of yacc.c */ 01915 #line 247 "../../src/gdb/m2-exp.y" 01916 { write_exp_elt_opcode (UNOP_ABS); } 01917 break; 01918 01919 case 15: 01920 01921 /* Line 1806 of yacc.c */ 01922 #line 251 "../../src/gdb/m2-exp.y" 01923 { write_exp_elt_opcode (UNOP_HIGH); } 01924 break; 01925 01926 case 16: 01927 01928 /* Line 1806 of yacc.c */ 01929 #line 255 "../../src/gdb/m2-exp.y" 01930 { write_exp_elt_opcode (UNOP_MIN); 01931 write_exp_elt_type ((yyvsp[(3) - (4)].tval)); 01932 write_exp_elt_opcode (UNOP_MIN); } 01933 break; 01934 01935 case 17: 01936 01937 /* Line 1806 of yacc.c */ 01938 #line 261 "../../src/gdb/m2-exp.y" 01939 { write_exp_elt_opcode (UNOP_MAX); 01940 write_exp_elt_type ((yyvsp[(3) - (4)].tval)); 01941 write_exp_elt_opcode (UNOP_MAX); } 01942 break; 01943 01944 case 18: 01945 01946 /* Line 1806 of yacc.c */ 01947 #line 267 "../../src/gdb/m2-exp.y" 01948 { write_exp_elt_opcode (UNOP_FLOAT); } 01949 break; 01950 01951 case 19: 01952 01953 /* Line 1806 of yacc.c */ 01954 #line 271 "../../src/gdb/m2-exp.y" 01955 { write_exp_elt_opcode (BINOP_VAL); 01956 write_exp_elt_type ((yyvsp[(3) - (6)].tval)); 01957 write_exp_elt_opcode (BINOP_VAL); } 01958 break; 01959 01960 case 20: 01961 01962 /* Line 1806 of yacc.c */ 01963 #line 277 "../../src/gdb/m2-exp.y" 01964 { write_exp_elt_opcode (UNOP_CHR); } 01965 break; 01966 01967 case 21: 01968 01969 /* Line 1806 of yacc.c */ 01970 #line 281 "../../src/gdb/m2-exp.y" 01971 { write_exp_elt_opcode (UNOP_ODD); } 01972 break; 01973 01974 case 22: 01975 01976 /* Line 1806 of yacc.c */ 01977 #line 285 "../../src/gdb/m2-exp.y" 01978 { write_exp_elt_opcode (UNOP_TRUNC); } 01979 break; 01980 01981 case 23: 01982 01983 /* Line 1806 of yacc.c */ 01984 #line 289 "../../src/gdb/m2-exp.y" 01985 { write_exp_elt_opcode (UNOP_SIZEOF); } 01986 break; 01987 01988 case 24: 01989 01990 /* Line 1806 of yacc.c */ 01991 #line 293 "../../src/gdb/m2-exp.y" 01992 { write_exp_elt_opcode (UNOP_SIZEOF); } 01993 break; 01994 01995 case 25: 01996 01997 /* Line 1806 of yacc.c */ 01998 #line 298 "../../src/gdb/m2-exp.y" 01999 { write_exp_elt_opcode(UNOP_PREINCREMENT); } 02000 break; 02001 02002 case 26: 02003 02004 /* Line 1806 of yacc.c */ 02005 #line 302 "../../src/gdb/m2-exp.y" 02006 { write_exp_elt_opcode(BINOP_ASSIGN_MODIFY); 02007 write_exp_elt_opcode(BINOP_ADD); 02008 write_exp_elt_opcode(BINOP_ASSIGN_MODIFY); } 02009 break; 02010 02011 case 27: 02012 02013 /* Line 1806 of yacc.c */ 02014 #line 308 "../../src/gdb/m2-exp.y" 02015 { write_exp_elt_opcode(UNOP_PREDECREMENT);} 02016 break; 02017 02018 case 28: 02019 02020 /* Line 1806 of yacc.c */ 02021 #line 312 "../../src/gdb/m2-exp.y" 02022 { write_exp_elt_opcode(BINOP_ASSIGN_MODIFY); 02023 write_exp_elt_opcode(BINOP_SUB); 02024 write_exp_elt_opcode(BINOP_ASSIGN_MODIFY); } 02025 break; 02026 02027 case 29: 02028 02029 /* Line 1806 of yacc.c */ 02030 #line 318 "../../src/gdb/m2-exp.y" 02031 { write_exp_elt_opcode (STRUCTOP_STRUCT); 02032 write_exp_string ((yyvsp[(3) - (3)].sval)); 02033 write_exp_elt_opcode (STRUCTOP_STRUCT); } 02034 break; 02035 02036 case 31: 02037 02038 /* Line 1806 of yacc.c */ 02039 #line 327 "../../src/gdb/m2-exp.y" 02040 { error (_("Sets are not implemented."));} 02041 break; 02042 02043 case 32: 02044 02045 /* Line 1806 of yacc.c */ 02046 #line 331 "../../src/gdb/m2-exp.y" 02047 { error (_("Sets are not implemented."));} 02048 break; 02049 02050 case 33: 02051 02052 /* Line 1806 of yacc.c */ 02053 #line 335 "../../src/gdb/m2-exp.y" 02054 { error (_("Sets are not implemented."));} 02055 break; 02056 02057 case 34: 02058 02059 /* Line 1806 of yacc.c */ 02060 #line 339 "../../src/gdb/m2-exp.y" 02061 { error (_("Sets are not implemented."));} 02062 break; 02063 02064 case 35: 02065 02066 /* Line 1806 of yacc.c */ 02067 #line 341 "../../src/gdb/m2-exp.y" 02068 { error (_("Sets are not implemented."));} 02069 break; 02070 02071 case 36: 02072 02073 /* Line 1806 of yacc.c */ 02074 #line 350 "../../src/gdb/m2-exp.y" 02075 { start_arglist(); } 02076 break; 02077 02078 case 37: 02079 02080 /* Line 1806 of yacc.c */ 02081 #line 352 "../../src/gdb/m2-exp.y" 02082 { write_exp_elt_opcode (MULTI_SUBSCRIPT); 02083 write_exp_elt_longcst ((LONGEST) end_arglist()); 02084 write_exp_elt_opcode (MULTI_SUBSCRIPT); } 02085 break; 02086 02087 case 38: 02088 02089 /* Line 1806 of yacc.c */ 02090 #line 358 "../../src/gdb/m2-exp.y" 02091 { write_exp_elt_opcode (BINOP_SUBSCRIPT); } 02092 break; 02093 02094 case 39: 02095 02096 /* Line 1806 of yacc.c */ 02097 #line 364 "../../src/gdb/m2-exp.y" 02098 { start_arglist (); } 02099 break; 02100 02101 case 40: 02102 02103 /* Line 1806 of yacc.c */ 02104 #line 366 "../../src/gdb/m2-exp.y" 02105 { write_exp_elt_opcode (OP_FUNCALL); 02106 write_exp_elt_longcst ((LONGEST) end_arglist ()); 02107 write_exp_elt_opcode (OP_FUNCALL); } 02108 break; 02109 02110 case 42: 02111 02112 /* Line 1806 of yacc.c */ 02113 #line 375 "../../src/gdb/m2-exp.y" 02114 { arglist_len = 1; } 02115 break; 02116 02117 case 43: 02118 02119 /* Line 1806 of yacc.c */ 02120 #line 379 "../../src/gdb/m2-exp.y" 02121 { arglist_len++; } 02122 break; 02123 02124 case 44: 02125 02126 /* Line 1806 of yacc.c */ 02127 #line 384 "../../src/gdb/m2-exp.y" 02128 { arglist_len = 1; } 02129 break; 02130 02131 case 45: 02132 02133 /* Line 1806 of yacc.c */ 02134 #line 389 "../../src/gdb/m2-exp.y" 02135 { arglist_len++; } 02136 break; 02137 02138 case 46: 02139 02140 /* Line 1806 of yacc.c */ 02141 #line 394 "../../src/gdb/m2-exp.y" 02142 { write_exp_elt_opcode (UNOP_MEMVAL); 02143 write_exp_elt_type ((yyvsp[(2) - (4)].tval)); 02144 write_exp_elt_opcode (UNOP_MEMVAL); } 02145 break; 02146 02147 case 47: 02148 02149 /* Line 1806 of yacc.c */ 02150 #line 400 "../../src/gdb/m2-exp.y" 02151 { write_exp_elt_opcode (UNOP_CAST); 02152 write_exp_elt_type ((yyvsp[(1) - (4)].tval)); 02153 write_exp_elt_opcode (UNOP_CAST); } 02154 break; 02155 02156 case 48: 02157 02158 /* Line 1806 of yacc.c */ 02159 #line 406 "../../src/gdb/m2-exp.y" 02160 { } 02161 break; 02162 02163 case 49: 02164 02165 /* Line 1806 of yacc.c */ 02166 #line 414 "../../src/gdb/m2-exp.y" 02167 { write_exp_elt_opcode (BINOP_REPEAT); } 02168 break; 02169 02170 case 50: 02171 02172 /* Line 1806 of yacc.c */ 02173 #line 418 "../../src/gdb/m2-exp.y" 02174 { write_exp_elt_opcode (BINOP_MUL); } 02175 break; 02176 02177 case 51: 02178 02179 /* Line 1806 of yacc.c */ 02180 #line 422 "../../src/gdb/m2-exp.y" 02181 { write_exp_elt_opcode (BINOP_DIV); } 02182 break; 02183 02184 case 52: 02185 02186 /* Line 1806 of yacc.c */ 02187 #line 426 "../../src/gdb/m2-exp.y" 02188 { write_exp_elt_opcode (BINOP_INTDIV); } 02189 break; 02190 02191 case 53: 02192 02193 /* Line 1806 of yacc.c */ 02194 #line 430 "../../src/gdb/m2-exp.y" 02195 { write_exp_elt_opcode (BINOP_REM); } 02196 break; 02197 02198 case 54: 02199 02200 /* Line 1806 of yacc.c */ 02201 #line 434 "../../src/gdb/m2-exp.y" 02202 { write_exp_elt_opcode (BINOP_ADD); } 02203 break; 02204 02205 case 55: 02206 02207 /* Line 1806 of yacc.c */ 02208 #line 438 "../../src/gdb/m2-exp.y" 02209 { write_exp_elt_opcode (BINOP_SUB); } 02210 break; 02211 02212 case 56: 02213 02214 /* Line 1806 of yacc.c */ 02215 #line 442 "../../src/gdb/m2-exp.y" 02216 { write_exp_elt_opcode (BINOP_EQUAL); } 02217 break; 02218 02219 case 57: 02220 02221 /* Line 1806 of yacc.c */ 02222 #line 446 "../../src/gdb/m2-exp.y" 02223 { write_exp_elt_opcode (BINOP_NOTEQUAL); } 02224 break; 02225 02226 case 58: 02227 02228 /* Line 1806 of yacc.c */ 02229 #line 448 "../../src/gdb/m2-exp.y" 02230 { write_exp_elt_opcode (BINOP_NOTEQUAL); } 02231 break; 02232 02233 case 59: 02234 02235 /* Line 1806 of yacc.c */ 02236 #line 452 "../../src/gdb/m2-exp.y" 02237 { write_exp_elt_opcode (BINOP_LEQ); } 02238 break; 02239 02240 case 60: 02241 02242 /* Line 1806 of yacc.c */ 02243 #line 456 "../../src/gdb/m2-exp.y" 02244 { write_exp_elt_opcode (BINOP_GEQ); } 02245 break; 02246 02247 case 61: 02248 02249 /* Line 1806 of yacc.c */ 02250 #line 460 "../../src/gdb/m2-exp.y" 02251 { write_exp_elt_opcode (BINOP_LESS); } 02252 break; 02253 02254 case 62: 02255 02256 /* Line 1806 of yacc.c */ 02257 #line 464 "../../src/gdb/m2-exp.y" 02258 { write_exp_elt_opcode (BINOP_GTR); } 02259 break; 02260 02261 case 63: 02262 02263 /* Line 1806 of yacc.c */ 02264 #line 468 "../../src/gdb/m2-exp.y" 02265 { write_exp_elt_opcode (BINOP_LOGICAL_AND); } 02266 break; 02267 02268 case 64: 02269 02270 /* Line 1806 of yacc.c */ 02271 #line 472 "../../src/gdb/m2-exp.y" 02272 { write_exp_elt_opcode (BINOP_LOGICAL_OR); } 02273 break; 02274 02275 case 65: 02276 02277 /* Line 1806 of yacc.c */ 02278 #line 476 "../../src/gdb/m2-exp.y" 02279 { write_exp_elt_opcode (BINOP_ASSIGN); } 02280 break; 02281 02282 case 66: 02283 02284 /* Line 1806 of yacc.c */ 02285 #line 483 "../../src/gdb/m2-exp.y" 02286 { write_exp_elt_opcode (OP_BOOL); 02287 write_exp_elt_longcst ((LONGEST) (yyvsp[(1) - (1)].ulval)); 02288 write_exp_elt_opcode (OP_BOOL); } 02289 break; 02290 02291 case 67: 02292 02293 /* Line 1806 of yacc.c */ 02294 #line 489 "../../src/gdb/m2-exp.y" 02295 { write_exp_elt_opcode (OP_BOOL); 02296 write_exp_elt_longcst ((LONGEST) (yyvsp[(1) - (1)].ulval)); 02297 write_exp_elt_opcode (OP_BOOL); } 02298 break; 02299 02300 case 68: 02301 02302 /* Line 1806 of yacc.c */ 02303 #line 495 "../../src/gdb/m2-exp.y" 02304 { write_exp_elt_opcode (OP_LONG); 02305 write_exp_elt_type (parse_m2_type->builtin_int); 02306 write_exp_elt_longcst ((LONGEST) (yyvsp[(1) - (1)].lval)); 02307 write_exp_elt_opcode (OP_LONG); } 02308 break; 02309 02310 case 69: 02311 02312 /* Line 1806 of yacc.c */ 02313 #line 502 "../../src/gdb/m2-exp.y" 02314 { 02315 write_exp_elt_opcode (OP_LONG); 02316 write_exp_elt_type (parse_m2_type->builtin_card); 02317 write_exp_elt_longcst ((LONGEST) (yyvsp[(1) - (1)].ulval)); 02318 write_exp_elt_opcode (OP_LONG); 02319 } 02320 break; 02321 02322 case 70: 02323 02324 /* Line 1806 of yacc.c */ 02325 #line 511 "../../src/gdb/m2-exp.y" 02326 { write_exp_elt_opcode (OP_LONG); 02327 write_exp_elt_type (parse_m2_type->builtin_char); 02328 write_exp_elt_longcst ((LONGEST) (yyvsp[(1) - (1)].ulval)); 02329 write_exp_elt_opcode (OP_LONG); } 02330 break; 02331 02332 case 71: 02333 02334 /* Line 1806 of yacc.c */ 02335 #line 519 "../../src/gdb/m2-exp.y" 02336 { write_exp_elt_opcode (OP_DOUBLE); 02337 write_exp_elt_type (parse_m2_type->builtin_real); 02338 write_exp_elt_dblcst ((yyvsp[(1) - (1)].dval)); 02339 write_exp_elt_opcode (OP_DOUBLE); } 02340 break; 02341 02342 case 73: 02343 02344 /* Line 1806 of yacc.c */ 02345 #line 529 "../../src/gdb/m2-exp.y" 02346 { write_exp_elt_opcode (OP_LONG); 02347 write_exp_elt_type (parse_type->builtin_int); 02348 write_exp_elt_longcst ((LONGEST) TYPE_LENGTH ((yyvsp[(3) - (4)].tval))); 02349 write_exp_elt_opcode (OP_LONG); } 02350 break; 02351 02352 case 74: 02353 02354 /* Line 1806 of yacc.c */ 02355 #line 536 "../../src/gdb/m2-exp.y" 02356 { write_exp_elt_opcode (OP_M2_STRING); 02357 write_exp_string ((yyvsp[(1) - (1)].sval)); 02358 write_exp_elt_opcode (OP_M2_STRING); } 02359 break; 02360 02361 case 75: 02362 02363 /* Line 1806 of yacc.c */ 02364 #line 543 "../../src/gdb/m2-exp.y" 02365 { (yyval.bval) = SYMBOL_BLOCK_VALUE((yyvsp[(1) - (1)].sym)); } 02366 break; 02367 02368 case 76: 02369 02370 /* Line 1806 of yacc.c */ 02371 #line 547 "../../src/gdb/m2-exp.y" 02372 { struct symbol *sym 02373 = lookup_symbol (copy_name ((yyvsp[(1) - (1)].sval)), expression_context_block, 02374 VAR_DOMAIN, 0); 02375 (yyval.sym) = sym;} 02376 break; 02377 02378 case 77: 02379 02380 /* Line 1806 of yacc.c */ 02381 #line 556 "../../src/gdb/m2-exp.y" 02382 { struct symbol *tem 02383 = lookup_symbol (copy_name ((yyvsp[(3) - (3)].sval)), (yyvsp[(1) - (3)].bval), 02384 VAR_DOMAIN, 0); 02385 if (!tem || SYMBOL_CLASS (tem) != LOC_BLOCK) 02386 error (_("No function \"%s\" in specified context."), 02387 copy_name ((yyvsp[(3) - (3)].sval))); 02388 (yyval.sym) = tem; 02389 } 02390 break; 02391 02392 case 78: 02393 02394 /* Line 1806 of yacc.c */ 02395 #line 568 "../../src/gdb/m2-exp.y" 02396 { write_exp_elt_opcode(OP_VAR_VALUE); 02397 write_exp_elt_block (NULL); 02398 write_exp_elt_sym ((yyvsp[(1) - (1)].sym)); 02399 write_exp_elt_opcode (OP_VAR_VALUE); } 02400 break; 02401 02402 case 80: 02403 02404 /* Line 1806 of yacc.c */ 02405 #line 580 "../../src/gdb/m2-exp.y" 02406 { struct symbol *sym; 02407 sym = lookup_symbol (copy_name ((yyvsp[(3) - (3)].sval)), (yyvsp[(1) - (3)].bval), 02408 VAR_DOMAIN, 0); 02409 if (sym == 0) 02410 error (_("No symbol \"%s\" in specified context."), 02411 copy_name ((yyvsp[(3) - (3)].sval))); 02412 if (symbol_read_needs_frame (sym)) 02413 { 02414 if (innermost_block == 0 02415 || contained_in (block_found, 02416 innermost_block)) 02417 innermost_block = block_found; 02418 } 02419 02420 write_exp_elt_opcode (OP_VAR_VALUE); 02421 /* block_found is set by lookup_symbol. */ 02422 write_exp_elt_block (block_found); 02423 write_exp_elt_sym (sym); 02424 write_exp_elt_opcode (OP_VAR_VALUE); } 02425 break; 02426 02427 case 81: 02428 02429 /* Line 1806 of yacc.c */ 02430 #line 603 "../../src/gdb/m2-exp.y" 02431 { struct symbol *sym; 02432 struct field_of_this_result is_a_field_of_this; 02433 02434 sym = lookup_symbol (copy_name ((yyvsp[(1) - (1)].sval)), 02435 expression_context_block, 02436 VAR_DOMAIN, 02437 &is_a_field_of_this); 02438 if (sym) 02439 { 02440 if (symbol_read_needs_frame (sym)) 02441 { 02442 if (innermost_block == 0 || 02443 contained_in (block_found, 02444 innermost_block)) 02445 innermost_block = block_found; 02446 } 02447 02448 write_exp_elt_opcode (OP_VAR_VALUE); 02449 /* We want to use the selected frame, not 02450 another more inner frame which happens to 02451 be in the same block. */ 02452 write_exp_elt_block (NULL); 02453 write_exp_elt_sym (sym); 02454 write_exp_elt_opcode (OP_VAR_VALUE); 02455 } 02456 else 02457 { 02458 struct bound_minimal_symbol msymbol; 02459 char *arg = copy_name ((yyvsp[(1) - (1)].sval)); 02460 02461 msymbol = 02462 lookup_bound_minimal_symbol (arg); 02463 if (msymbol.minsym != NULL) 02464 write_exp_msymbol (msymbol); 02465 else if (!have_full_symbols () && !have_partial_symbols ()) 02466 error (_("No symbol table is loaded. Use the \"symbol-file\" command.")); 02467 else 02468 error (_("No symbol \"%s\" in current context."), 02469 copy_name ((yyvsp[(1) - (1)].sval))); 02470 } 02471 } 02472 break; 02473 02474 case 82: 02475 02476 /* Line 1806 of yacc.c */ 02477 #line 648 "../../src/gdb/m2-exp.y" 02478 { (yyval.tval) = lookup_typename (parse_language, parse_gdbarch, 02479 copy_name ((yyvsp[(1) - (1)].sval)), 02480 expression_context_block, 0); } 02481 break; 02482 02483 02484 02485 /* Line 1806 of yacc.c */ 02486 #line 2488 "m2-exp.c" 02487 default: break; 02488 } 02489 /* User semantic actions sometimes alter yychar, and that requires 02490 that yytoken be updated with the new translation. We take the 02491 approach of translating immediately before every use of yytoken. 02492 One alternative is translating here after every semantic action, 02493 but that translation would be missed if the semantic action invokes 02494 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or 02495 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an 02496 incorrect destructor might then be invoked immediately. In the 02497 case of YYERROR or YYBACKUP, subsequent parser actions might lead 02498 to an incorrect destructor call or verbose syntax error message 02499 before the lookahead is translated. */ 02500 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); 02501 02502 YYPOPSTACK (yylen); 02503 yylen = 0; 02504 YY_STACK_PRINT (yyss, yyssp); 02505 02506 *++yyvsp = yyval; 02507 02508 /* Now `shift' the result of the reduction. Determine what state 02509 that goes to, based on the state we popped back to and the rule 02510 number reduced by. */ 02511 02512 yyn = yyr1[yyn]; 02513 02514 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; 02515 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) 02516 yystate = yytable[yystate]; 02517 else 02518 yystate = yydefgoto[yyn - YYNTOKENS]; 02519 02520 goto yynewstate; 02521 02522 02523 /*------------------------------------. 02524 | yyerrlab -- here on detecting error | 02525 `------------------------------------*/ 02526 yyerrlab: 02527 /* Make sure we have latest lookahead translation. See comments at 02528 user semantic actions for why this is necessary. */ 02529 yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); 02530 02531 /* If not already recovering from an error, report this error. */ 02532 if (!yyerrstatus) 02533 { 02534 ++yynerrs; 02535 #if ! YYERROR_VERBOSE 02536 yyerror (YY_("syntax error")); 02537 #else 02538 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ 02539 yyssp, yytoken) 02540 { 02541 char const *yymsgp = YY_("syntax error"); 02542 int yysyntax_error_status; 02543 yysyntax_error_status = YYSYNTAX_ERROR; 02544 if (yysyntax_error_status == 0) 02545 yymsgp = yymsg; 02546 else if (yysyntax_error_status == 1) 02547 { 02548 if (yymsg != yymsgbuf) 02549 YYSTACK_FREE (yymsg); 02550 yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); 02551 if (!yymsg) 02552 { 02553 yymsg = yymsgbuf; 02554 yymsg_alloc = sizeof yymsgbuf; 02555 yysyntax_error_status = 2; 02556 } 02557 else 02558 { 02559 yysyntax_error_status = YYSYNTAX_ERROR; 02560 yymsgp = yymsg; 02561 } 02562 } 02563 yyerror (yymsgp); 02564 if (yysyntax_error_status == 2) 02565 goto yyexhaustedlab; 02566 } 02567 # undef YYSYNTAX_ERROR 02568 #endif 02569 } 02570 02571 02572 02573 if (yyerrstatus == 3) 02574 { 02575 /* If just tried and failed to reuse lookahead token after an 02576 error, discard it. */ 02577 02578 if (yychar <= YYEOF) 02579 { 02580 /* Return failure if at end of input. */ 02581 if (yychar == YYEOF) 02582 YYABORT; 02583 } 02584 else 02585 { 02586 yydestruct ("Error: discarding", 02587 yytoken, &yylval); 02588 yychar = YYEMPTY; 02589 } 02590 } 02591 02592 /* Else will try to reuse lookahead token after shifting the error 02593 token. */ 02594 goto yyerrlab1; 02595 02596 02597 /*---------------------------------------------------. 02598 | yyerrorlab -- error raised explicitly by YYERROR. | 02599 `---------------------------------------------------*/ 02600 yyerrorlab: 02601 02602 /* Pacify compilers like GCC when the user code never invokes 02603 YYERROR and the label yyerrorlab therefore never appears in user 02604 code. */ 02605 if (/*CONSTCOND*/ 0) 02606 goto yyerrorlab; 02607 02608 /* Do not reclaim the symbols of the rule which action triggered 02609 this YYERROR. */ 02610 YYPOPSTACK (yylen); 02611 yylen = 0; 02612 YY_STACK_PRINT (yyss, yyssp); 02613 yystate = *yyssp; 02614 goto yyerrlab1; 02615 02616 02617 /*-------------------------------------------------------------. 02618 | yyerrlab1 -- common code for both syntax error and YYERROR. | 02619 `-------------------------------------------------------------*/ 02620 yyerrlab1: 02621 yyerrstatus = 3; /* Each real token shifted decrements this. */ 02622 02623 for (;;) 02624 { 02625 yyn = yypact[yystate]; 02626 if (!yypact_value_is_default (yyn)) 02627 { 02628 yyn += YYTERROR; 02629 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) 02630 { 02631 yyn = yytable[yyn]; 02632 if (0 < yyn) 02633 break; 02634 } 02635 } 02636 02637 /* Pop the current state because it cannot handle the error token. */ 02638 if (yyssp == yyss) 02639 YYABORT; 02640 02641 02642 yydestruct ("Error: popping", 02643 yystos[yystate], yyvsp); 02644 YYPOPSTACK (1); 02645 yystate = *yyssp; 02646 YY_STACK_PRINT (yyss, yyssp); 02647 } 02648 02649 *++yyvsp = yylval; 02650 02651 02652 /* Shift the error token. */ 02653 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); 02654 02655 yystate = yyn; 02656 goto yynewstate; 02657 02658 02659 /*-------------------------------------. 02660 | yyacceptlab -- YYACCEPT comes here. | 02661 `-------------------------------------*/ 02662 yyacceptlab: 02663 yyresult = 0; 02664 goto yyreturn; 02665 02666 /*-----------------------------------. 02667 | yyabortlab -- YYABORT comes here. | 02668 `-----------------------------------*/ 02669 yyabortlab: 02670 yyresult = 1; 02671 goto yyreturn; 02672 02673 #if !defined(yyoverflow) || YYERROR_VERBOSE 02674 /*-------------------------------------------------. 02675 | yyexhaustedlab -- memory exhaustion comes here. | 02676 `-------------------------------------------------*/ 02677 yyexhaustedlab: 02678 yyerror (YY_("memory exhausted")); 02679 yyresult = 2; 02680 /* Fall through. */ 02681 #endif 02682 02683 yyreturn: 02684 if (yychar != YYEMPTY) 02685 { 02686 /* Make sure we have latest lookahead translation. See comments at 02687 user semantic actions for why this is necessary. */ 02688 yytoken = YYTRANSLATE (yychar); 02689 yydestruct ("Cleanup: discarding lookahead", 02690 yytoken, &yylval); 02691 } 02692 /* Do not reclaim the symbols of the rule which action triggered 02693 this YYABORT or YYACCEPT. */ 02694 YYPOPSTACK (yylen); 02695 YY_STACK_PRINT (yyss, yyssp); 02696 while (yyssp != yyss) 02697 { 02698 yydestruct ("Cleanup: popping", 02699 yystos[*yyssp], yyvsp); 02700 YYPOPSTACK (1); 02701 } 02702 #ifndef yyoverflow 02703 if (yyss != yyssa) 02704 YYSTACK_FREE (yyss); 02705 #endif 02706 #if YYERROR_VERBOSE 02707 if (yymsg != yymsgbuf) 02708 YYSTACK_FREE (yymsg); 02709 #endif 02710 /* Make sure YYID is used. */ 02711 return YYID (yyresult); 02712 } 02713 02714 02715 02716 /* Line 2067 of yacc.c */ 02717 #line 654 "../../src/gdb/m2-exp.y" 02718 02719 02720 /* Take care of parsing a number (anything that starts with a digit). 02721 Set yylval and return the token type; update lexptr. 02722 LEN is the number of characters in it. */ 02723 02724 /*** Needs some error checking for the float case ***/ 02725 02726 static int 02727 parse_number (int olen) 02728 { 02729 const char *p = lexptr; 02730 LONGEST n = 0; 02731 LONGEST prevn = 0; 02732 int c,i,ischar=0; 02733 int base = input_radix; 02734 int len = olen; 02735 int unsigned_p = number_sign == 1 ? 1 : 0; 02736 02737 if(p[len-1] == 'H') 02738 { 02739 base = 16; 02740 len--; 02741 } 02742 else if(p[len-1] == 'C' || p[len-1] == 'B') 02743 { 02744 base = 8; 02745 ischar = p[len-1] == 'C'; 02746 len--; 02747 } 02748 02749 /* Scan the number */ 02750 for (c = 0; c < len; c++) 02751 { 02752 if (p[c] == '.' && base == 10) 02753 { 02754 /* It's a float since it contains a point. */ 02755 yylval.dval = atof (p); 02756 lexptr += len; 02757 return FLOAT; 02758 } 02759 if (p[c] == '.' && base != 10) 02760 error (_("Floating point numbers must be base 10.")); 02761 if (base == 10 && (p[c] < '0' || p[c] > '9')) 02762 error (_("Invalid digit \'%c\' in number."),p[c]); 02763 } 02764 02765 while (len-- > 0) 02766 { 02767 c = *p++; 02768 n *= base; 02769 if( base == 8 && (c == '8' || c == '9')) 02770 error (_("Invalid digit \'%c\' in octal number."),c); 02771 if (c >= '0' && c <= '9') 02772 i = c - '0'; 02773 else 02774 { 02775 if (base == 16 && c >= 'A' && c <= 'F') 02776 i = c - 'A' + 10; 02777 else 02778 return ERROR; 02779 } 02780 n+=i; 02781 if(i >= base) 02782 return ERROR; 02783 if(!unsigned_p && number_sign == 1 && (prevn >= n)) 02784 unsigned_p=1; /* Try something unsigned */ 02785 /* Don't do the range check if n==i and i==0, since that special 02786 case will give an overflow error. */ 02787 if(RANGE_CHECK && n!=i && i) 02788 { 02789 if((unsigned_p && (unsigned)prevn >= (unsigned)n) || 02790 ((!unsigned_p && number_sign==-1) && -prevn <= -n)) 02791 range_error (_("Overflow on numeric constant.")); 02792 } 02793 prevn=n; 02794 } 02795 02796 lexptr = p; 02797 if(*p == 'B' || *p == 'C' || *p == 'H') 02798 lexptr++; /* Advance past B,C or H */ 02799 02800 if (ischar) 02801 { 02802 yylval.ulval = n; 02803 return CHAR; 02804 } 02805 else if ( unsigned_p && number_sign == 1) 02806 { 02807 yylval.ulval = n; 02808 return UINT; 02809 } 02810 else if((unsigned_p && (n<0))) { 02811 range_error (_("Overflow on numeric constant -- number too large.")); 02812 /* But, this can return if range_check == range_warn. */ 02813 } 02814 yylval.lval = n; 02815 return INT; 02816 } 02817 02818 02819 /* Some tokens */ 02820 02821 static struct 02822 { 02823 char name[2]; 02824 int token; 02825 } tokentab2[] = 02826 { 02827 { {'<', '>'}, NOTEQUAL }, 02828 { {':', '='}, ASSIGN }, 02829 { {'<', '='}, LEQ }, 02830 { {'>', '='}, GEQ }, 02831 { {':', ':'}, COLONCOLON }, 02832 02833 }; 02834 02835 /* Some specific keywords */ 02836 02837 struct keyword { 02838 char keyw[10]; 02839 int token; 02840 }; 02841 02842 static struct keyword keytab[] = 02843 { 02844 {"OR" , OROR }, 02845 {"IN", IN },/* Note space after IN */ 02846 {"AND", LOGICAL_AND}, 02847 {"ABS", ABS }, 02848 {"CHR", CHR }, 02849 {"DEC", DEC }, 02850 {"NOT", NOT }, 02851 {"DIV", DIV }, 02852 {"INC", INC }, 02853 {"MAX", MAX_FUNC }, 02854 {"MIN", MIN_FUNC }, 02855 {"MOD", MOD }, 02856 {"ODD", ODD }, 02857 {"CAP", CAP }, 02858 {"ORD", ORD }, 02859 {"VAL", VAL }, 02860 {"EXCL", EXCL }, 02861 {"HIGH", HIGH }, 02862 {"INCL", INCL }, 02863 {"SIZE", SIZE }, 02864 {"FLOAT", FLOAT_FUNC }, 02865 {"TRUNC", TRUNC }, 02866 {"TSIZE", SIZE }, 02867 }; 02868 02869 02870 /* Read one token, getting characters through lexptr. */ 02871 02872 /* This is where we will check to make sure that the language and the operators used are 02873 compatible */ 02874 02875 static int 02876 yylex (void) 02877 { 02878 int c; 02879 int namelen; 02880 int i; 02881 const char *tokstart; 02882 char quote; 02883 02884 retry: 02885 02886 prev_lexptr = lexptr; 02887 02888 tokstart = lexptr; 02889 02890 02891 /* See if it is a special token of length 2 */ 02892 for( i = 0 ; i < (int) (sizeof tokentab2 / sizeof tokentab2[0]) ; i++) 02893 if (strncmp (tokentab2[i].name, tokstart, 2) == 0) 02894 { 02895 lexptr += 2; 02896 return tokentab2[i].token; 02897 } 02898 02899 switch (c = *tokstart) 02900 { 02901 case 0: 02902 return 0; 02903 02904 case ' ': 02905 case '\t': 02906 case '\n': 02907 lexptr++; 02908 goto retry; 02909 02910 case '(': 02911 paren_depth++; 02912 lexptr++; 02913 return c; 02914 02915 case ')': 02916 if (paren_depth == 0) 02917 return 0; 02918 paren_depth--; 02919 lexptr++; 02920 return c; 02921 02922 case ',': 02923 if (comma_terminates && paren_depth == 0) 02924 return 0; 02925 lexptr++; 02926 return c; 02927 02928 case '.': 02929 /* Might be a floating point number. */ 02930 if (lexptr[1] >= '0' && lexptr[1] <= '9') 02931 break; /* Falls into number code. */ 02932 else 02933 { 02934 lexptr++; 02935 return DOT; 02936 } 02937 02938 /* These are character tokens that appear as-is in the YACC grammar */ 02939 case '+': 02940 case '-': 02941 case '*': 02942 case '/': 02943 case '^': 02944 case '<': 02945 case '>': 02946 case '[': 02947 case ']': 02948 case '=': 02949 case '{': 02950 case '}': 02951 case '#': 02952 case '@': 02953 case '~': 02954 case '&': 02955 lexptr++; 02956 return c; 02957 02958 case '\'' : 02959 case '"': 02960 quote = c; 02961 for (namelen = 1; (c = tokstart[namelen]) != quote && c != '\0'; namelen++) 02962 if (c == '\\') 02963 { 02964 c = tokstart[++namelen]; 02965 if (c >= '0' && c <= '9') 02966 { 02967 c = tokstart[++namelen]; 02968 if (c >= '0' && c <= '9') 02969 c = tokstart[++namelen]; 02970 } 02971 } 02972 if(c != quote) 02973 error (_("Unterminated string or character constant.")); 02974 yylval.sval.ptr = tokstart + 1; 02975 yylval.sval.length = namelen - 1; 02976 lexptr += namelen + 1; 02977 02978 if(namelen == 2) /* Single character */ 02979 { 02980 yylval.ulval = tokstart[1]; 02981 return CHAR; 02982 } 02983 else 02984 return STRING; 02985 } 02986 02987 /* Is it a number? */ 02988 /* Note: We have already dealt with the case of the token '.'. 02989 See case '.' above. */ 02990 if ((c >= '0' && c <= '9')) 02991 { 02992 /* It's a number. */ 02993 int got_dot = 0, got_e = 0; 02994 const char *p = tokstart; 02995 int toktype; 02996 02997 for (++p ;; ++p) 02998 { 02999 if (!got_e && (*p == 'e' || *p == 'E')) 03000 got_dot = got_e = 1; 03001 else if (!got_dot && *p == '.') 03002 got_dot = 1; 03003 else if (got_e && (p[-1] == 'e' || p[-1] == 'E') 03004 && (*p == '-' || *p == '+')) 03005 /* This is the sign of the exponent, not the end of the 03006 number. */ 03007 continue; 03008 else if ((*p < '0' || *p > '9') && 03009 (*p < 'A' || *p > 'F') && 03010 (*p != 'H')) /* Modula-2 hexadecimal number */ 03011 break; 03012 } 03013 toktype = parse_number (p - tokstart); 03014 if (toktype == ERROR) 03015 { 03016 char *err_copy = (char *) alloca (p - tokstart + 1); 03017 03018 memcpy (err_copy, tokstart, p - tokstart); 03019 err_copy[p - tokstart] = 0; 03020 error (_("Invalid number \"%s\"."), err_copy); 03021 } 03022 lexptr = p; 03023 return toktype; 03024 } 03025 03026 if (!(c == '_' || c == '$' 03027 || (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'))) 03028 /* We must have come across a bad character (e.g. ';'). */ 03029 error (_("Invalid character '%c' in expression."), c); 03030 03031 /* It's a name. See how long it is. */ 03032 namelen = 0; 03033 for (c = tokstart[namelen]; 03034 (c == '_' || c == '$' || (c >= '0' && c <= '9') 03035 || (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')); 03036 c = tokstart[++namelen]) 03037 ; 03038 03039 /* The token "if" terminates the expression and is NOT 03040 removed from the input stream. */ 03041 if (namelen == 2 && tokstart[0] == 'i' && tokstart[1] == 'f') 03042 { 03043 return 0; 03044 } 03045 03046 lexptr += namelen; 03047 03048 /* Lookup special keywords */ 03049 for(i = 0 ; i < (int) (sizeof(keytab) / sizeof(keytab[0])) ; i++) 03050 if (namelen == strlen (keytab[i].keyw) 03051 && strncmp (tokstart, keytab[i].keyw, namelen) == 0) 03052 return keytab[i].token; 03053 03054 yylval.sval.ptr = tokstart; 03055 yylval.sval.length = namelen; 03056 03057 if (*tokstart == '$') 03058 { 03059 write_dollar_variable (yylval.sval); 03060 return INTERNAL_VAR; 03061 } 03062 03063 /* Use token-type BLOCKNAME for symbols that happen to be defined as 03064 functions. If this is not so, then ... 03065 Use token-type TYPENAME for symbols that happen to be defined 03066 currently as names of types; NAME for other symbols. 03067 The caller is not constrained to care about the distinction. */ 03068 { 03069 03070 03071 char *tmp = copy_name (yylval.sval); 03072 struct symbol *sym; 03073 03074 if (lookup_symtab (tmp)) 03075 return BLOCKNAME; 03076 sym = lookup_symbol (tmp, expression_context_block, VAR_DOMAIN, 0); 03077 if (sym && SYMBOL_CLASS (sym) == LOC_BLOCK) 03078 return BLOCKNAME; 03079 if (lookup_typename (parse_language, parse_gdbarch, 03080 copy_name (yylval.sval), expression_context_block, 1)) 03081 return TYPENAME; 03082 03083 if(sym) 03084 { 03085 switch(SYMBOL_CLASS (sym)) 03086 { 03087 case LOC_STATIC: 03088 case LOC_REGISTER: 03089 case LOC_ARG: 03090 case LOC_REF_ARG: 03091 case LOC_REGPARM_ADDR: 03092 case LOC_LOCAL: 03093 case LOC_CONST: 03094 case LOC_CONST_BYTES: 03095 case LOC_OPTIMIZED_OUT: 03096 case LOC_COMPUTED: 03097 return NAME; 03098 03099 case LOC_TYPEDEF: 03100 return TYPENAME; 03101 03102 case LOC_BLOCK: 03103 return BLOCKNAME; 03104 03105 case LOC_UNDEF: 03106 error (_("internal: Undefined class in m2lex()")); 03107 03108 case LOC_LABEL: 03109 case LOC_UNRESOLVED: 03110 error (_("internal: Unforseen case in m2lex()")); 03111 03112 default: 03113 error (_("unhandled token in m2lex()")); 03114 break; 03115 } 03116 } 03117 else 03118 { 03119 /* Built-in BOOLEAN type. This is sort of a hack. */ 03120 if (strncmp (tokstart, "TRUE", 4) == 0) 03121 { 03122 yylval.ulval = 1; 03123 return M2_TRUE; 03124 } 03125 else if (strncmp (tokstart, "FALSE", 5) == 0) 03126 { 03127 yylval.ulval = 0; 03128 return M2_FALSE; 03129 } 03130 } 03131 03132 /* Must be another type of name... */ 03133 return NAME; 03134 } 03135 } 03136 03137 void 03138 yyerror (char *msg) 03139 { 03140 if (prev_lexptr) 03141 lexptr = prev_lexptr; 03142 03143 error (_("A %s in expression, near `%s'."), (msg ? msg : "error"), lexptr); 03144 } 03145