1 /* A Bison parser, made by GNU Bison 2.3. */
3 /* Skeleton implementation for Bison's Yacc-like parsers in C
5 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
6 Free Software Foundation, Inc.
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2, or (at your option)
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 Boston, MA 02110-1301, USA. */
23 /* As a special exception, you may create a larger work that contains
24 part or all of the Bison parser skeleton and distribute that work
25 under terms of your choice, so long as that work isn't itself a
26 parser generator using the skeleton or a modified version thereof
27 as a parser skeleton. Alternatively, if you modify or redistribute
28 the parser skeleton itself, you may (at your option) remove this
29 special exception, which will cause the skeleton and the resulting
30 Bison output files to be licensed under the GNU General Public
31 License without this special exception.
33 This special exception was added by the Free Software Foundation in
34 version 2.2 of Bison. */
36 /* C LALR(1) parser skeleton written by Richard Stallman, by
37 simplifying the original so-called "semantic" parser. */
39 /* All symbols defined below should begin with yy or YY, to avoid
40 infringing on user name space. This should be done even for local
41 variables, as they might otherwise be expanded by user macros.
42 There are some unavoidable exceptions within include files to
43 define necessary library symbols; they are noted "INFRINGES ON
44 USER NAME SPACE" below. */
46 /* Identify Bison output. */
50 #define YYBISON_VERSION "2.3"
53 #define YYSKELETON_NAME "yacc.c"
58 /* Using locations. */
59 #define YYLSP_NEEDED 0
66 /* Put the tokens into the symbol table, so that GDB and other debuggers
98 /* Copy the first part of user declarations. */
99 #line 28 "m68k-parse.y"
104 #include "m68k-parse.h"
105 #include "safe-ctype.h"
107 /* Remap normal yacc parser interface names (yyparse, yylex, yyerror,
108 etc), as well as gratuitously global symbol names If other parser
109 generators (bison, byacc, etc) produce additional global names that
110 conflict at link time, then those parser generators need to be
111 fixed instead of adding those names to this list. */
113 #define yymaxdepth m68k_maxdepth
114 #define yyparse m68k_parse
115 #define yylex m68k_lex
116 #define yyerror m68k_error
117 #define yylval m68k_lval
118 #define yychar m68k_char
119 #define yydebug m68k_debug
120 #define yypact m68k_pact
123 #define yydef m68k_def
124 #define yychk m68k_chk
125 #define yypgo m68k_pgo
126 #define yyact m68k_act
127 #define yyexca m68k_exca
128 #define yyerrflag m68k_errflag
129 #define yynerrs m68k_nerrs
133 #define yy_yys m68k_yys
134 #define yystate m68k_state
135 #define yytmp m68k_tmp
137 #define yy_yyv m68k_yyv
138 #define yyval m68k_val
139 #define yylloc m68k_lloc
140 #define yyreds m68k_reds /* With YYDEBUG defined */
141 #define yytoks m68k_toks /* With YYDEBUG defined */
142 #define yylhs m68k_yylhs
143 #define yylen m68k_yylen
144 #define yydefred m68k_yydefred
145 #define yydgoto m68k_yydgoto
146 #define yysindex m68k_yysindex
147 #define yyrindex m68k_yyrindex
148 #define yygindex m68k_yygindex
149 #define yytable m68k_yytable
150 #define yycheck m68k_yycheck
156 /* Internal functions. */
158 static enum m68k_register
m68k_reg_parse (char **);
159 static int yylex (void);
160 static void yyerror (const char *);
162 /* The parser sets fields pointed to by this global variable. */
163 static struct m68k_op
*op
;
167 /* Enabling traces. */
172 /* Enabling verbose error messages. */
173 #ifdef YYERROR_VERBOSE
174 # undef YYERROR_VERBOSE
175 # define YYERROR_VERBOSE 1
177 # define YYERROR_VERBOSE 0
180 /* Enabling the token table. */
181 #ifndef YYTOKEN_TABLE
182 # define YYTOKEN_TABLE 0
185 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
186 typedef union YYSTYPE
187 #line 96 "m68k-parse.y"
189 struct m68k_indexreg indexreg
;
190 enum m68k_register reg
;
194 int trailing_ampersand
;
196 /* Line 187 of yacc.c. */
197 #line 198 "m68k-parse.c"
199 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
200 # define YYSTYPE_IS_DECLARED 1
201 # define YYSTYPE_IS_TRIVIAL 1
206 /* Copy the second part of user declarations. */
209 /* Line 216 of yacc.c. */
210 #line 211 "m68k-parse.c"
217 typedef YYTYPE_UINT8 yytype_uint8
;
219 typedef unsigned char yytype_uint8
;
223 typedef YYTYPE_INT8 yytype_int8
;
224 #elif (defined __STDC__ || defined __C99__FUNC__ \
225 || defined __cplusplus || defined _MSC_VER)
226 typedef signed char yytype_int8
;
228 typedef short int yytype_int8
;
232 typedef YYTYPE_UINT16 yytype_uint16
;
234 typedef unsigned short int yytype_uint16
;
238 typedef YYTYPE_INT16 yytype_int16
;
240 typedef short int yytype_int16
;
244 # ifdef __SIZE_TYPE__
245 # define YYSIZE_T __SIZE_TYPE__
246 # elif defined size_t
247 # define YYSIZE_T size_t
248 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
249 || defined __cplusplus || defined _MSC_VER)
250 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
251 # define YYSIZE_T size_t
253 # define YYSIZE_T unsigned int
257 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
262 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
263 # define YY_(msgid) dgettext ("bison-runtime", msgid)
267 # define YY_(msgid) msgid
271 /* Suppress unused-variable warnings by "using" E. */
272 #if ! defined lint || defined __GNUC__
273 # define YYUSE(e) ((void) (e))
275 # define YYUSE(e) /* empty */
278 /* Identity function, used to suppress warnings about constant conditions. */
282 #if (defined __STDC__ || defined __C99__FUNC__ \
283 || defined __cplusplus || defined _MSC_VER)
296 #if ! defined yyoverflow || YYERROR_VERBOSE
298 /* The parser invokes alloca or malloc; define the necessary symbols. */
300 # ifdef YYSTACK_USE_ALLOCA
301 # if YYSTACK_USE_ALLOCA
303 # define YYSTACK_ALLOC __builtin_alloca
304 # elif defined __BUILTIN_VA_ARG_INCR
305 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
307 # define YYSTACK_ALLOC __alloca
308 # elif defined _MSC_VER
309 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
310 # define alloca _alloca
312 # define YYSTACK_ALLOC alloca
313 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
314 || defined __cplusplus || defined _MSC_VER)
315 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
324 # ifdef YYSTACK_ALLOC
325 /* Pacify GCC's `empty if-body' warning. */
326 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
327 # ifndef YYSTACK_ALLOC_MAXIMUM
328 /* The OS might guarantee only one guard page at the bottom of the stack,
329 and a page size can be as small as 4096 bytes. So we cannot safely
330 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
331 to allow for a few compiler-allocated temporary stack slots. */
332 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
335 # define YYSTACK_ALLOC YYMALLOC
336 # define YYSTACK_FREE YYFREE
337 # ifndef YYSTACK_ALLOC_MAXIMUM
338 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
340 # if (defined __cplusplus && ! defined _STDLIB_H \
341 && ! ((defined YYMALLOC || defined malloc) \
342 && (defined YYFREE || defined free)))
343 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
349 # define YYMALLOC malloc
350 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
351 || defined __cplusplus || defined _MSC_VER)
352 void *malloc (YYSIZE_T
); /* INFRINGES ON USER NAME SPACE */
357 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
358 || defined __cplusplus || defined _MSC_VER)
359 void free (void *); /* INFRINGES ON USER NAME SPACE */
363 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
366 #if (! defined yyoverflow \
367 && (! defined __cplusplus \
368 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
370 /* A type that is properly aligned for any stack member. */
377 /* The size of the maximum gap between one aligned stack and the next. */
378 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
380 /* The size of an array large to enough to hold all stacks, each with
382 # define YYSTACK_BYTES(N) \
383 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
384 + YYSTACK_GAP_MAXIMUM)
386 /* Copy COUNT objects from FROM to TO. The source and destination do
389 # if defined __GNUC__ && 1 < __GNUC__
390 # define YYCOPY(To, From, Count) \
391 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
393 # define YYCOPY(To, From, Count) \
397 for (yyi = 0; yyi < (Count); yyi++) \
398 (To)[yyi] = (From)[yyi]; \
404 /* Relocate STACK from its old location to the new one. The
405 local variables YYSIZE and YYSTACKSIZE give the old and new number of
406 elements in the stack, and YYPTR gives the new location of the
407 stack. Advance YYPTR to a properly aligned location for the next
409 # define YYSTACK_RELOCATE(Stack) \
412 YYSIZE_T yynewbytes; \
413 YYCOPY (&yyptr->Stack, Stack, yysize); \
414 Stack = &yyptr->Stack; \
415 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
416 yyptr += yynewbytes / sizeof (*yyptr); \
422 /* YYFINAL -- State number of the termination state. */
424 /* YYLAST -- Last index in YYTABLE. */
427 /* YYNTOKENS -- Number of terminals. */
429 /* YYNNTS -- Number of nonterminals. */
431 /* YYNRULES -- Number of rules. */
433 /* YYNRULES -- Number of states. */
434 #define YYNSTATES 180
436 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
438 #define YYMAXUTOK 268
440 #define YYTRANSLATE(YYX) \
441 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
443 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
444 static const yytype_uint8 yytranslate
[] =
446 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
447 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
448 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
449 2, 2, 2, 2, 2, 17, 2, 2, 14, 2,
450 18, 19, 2, 20, 22, 21, 2, 26, 2, 2,
451 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
452 15, 2, 16, 2, 25, 2, 2, 2, 2, 2,
453 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
454 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
455 2, 23, 2, 24, 2, 2, 2, 2, 2, 2,
456 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
457 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
458 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
459 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
460 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
461 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
462 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
463 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
464 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
465 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
466 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
467 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
468 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
469 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
470 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
471 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
472 5, 6, 7, 8, 9, 10, 11, 12, 13
476 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
478 static const yytype_uint16 yyprhs
[] =
480 0, 0, 3, 5, 8, 11, 12, 14, 17, 20,
481 22, 24, 26, 28, 30, 32, 35, 38, 40, 44,
482 49, 54, 60, 66, 71, 75, 79, 83, 91, 99,
483 106, 112, 119, 125, 132, 138, 144, 149, 159, 167,
484 176, 183, 194, 203, 214, 223, 232, 235, 239, 243,
485 249, 256, 267, 277, 288, 290, 292, 294, 296, 298,
486 300, 302, 304, 306, 308, 310, 312, 314, 316, 317,
487 319, 321, 323, 324, 327, 328, 331, 332, 335, 337,
488 341, 345, 347, 349, 353, 357, 361, 363, 365, 367
491 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
492 static const yytype_int8 yyrhs
[] =
494 28, 0, -1, 30, -1, 31, 29, -1, 32, 29,
495 -1, -1, 14, -1, 15, 15, -1, 16, 16, -1,
496 3, -1, 4, -1, 5, -1, 6, -1, 11, -1,
497 13, -1, 17, 13, -1, 14, 13, -1, 44, -1,
498 18, 4, 19, -1, 18, 4, 19, 20, -1, 21,
499 18, 4, 19, -1, 18, 13, 22, 38, 19, -1,
500 18, 38, 22, 13, 19, -1, 13, 18, 38, 19,
501 -1, 18, 7, 19, -1, 18, 8, 19, -1, 18,
502 10, 19, -1, 18, 13, 22, 38, 22, 33, 19,
503 -1, 18, 13, 22, 38, 22, 40, 19, -1, 18,
504 13, 22, 34, 41, 19, -1, 18, 34, 22, 13,
505 19, -1, 13, 18, 38, 22, 33, 19, -1, 18,
506 38, 22, 33, 19, -1, 13, 18, 38, 22, 40,
507 19, -1, 18, 38, 22, 40, 19, -1, 13, 18,
508 34, 41, 19, -1, 18, 34, 41, 19, -1, 18,
509 23, 13, 41, 24, 22, 33, 42, 19, -1, 18,
510 23, 13, 41, 24, 42, 19, -1, 18, 23, 38,
511 24, 22, 33, 42, 19, -1, 18, 23, 38, 24,
512 42, 19, -1, 18, 23, 13, 22, 38, 22, 33,
513 24, 42, 19, -1, 18, 23, 38, 22, 33, 24,
514 42, 19, -1, 18, 23, 13, 22, 38, 22, 40,
515 24, 42, 19, -1, 18, 23, 38, 22, 40, 24,
516 42, 19, -1, 18, 23, 43, 34, 41, 24, 42,
517 19, -1, 39, 25, -1, 39, 25, 20, -1, 39,
518 25, 21, -1, 39, 25, 18, 13, 19, -1, 39,
519 25, 18, 43, 33, 19, -1, 39, 25, 18, 13,
520 19, 25, 18, 43, 33, 19, -1, 39, 25, 18,
521 13, 19, 25, 18, 13, 19, -1, 39, 25, 18,
522 43, 33, 19, 25, 18, 13, 19, -1, 12, -1,
523 35, -1, 12, -1, 36, -1, 36, -1, 4, -1,
524 8, -1, 3, -1, 9, -1, 4, -1, 7, -1,
525 37, -1, 10, -1, 8, -1, -1, 38, -1, 7,
526 -1, 10, -1, -1, 22, 38, -1, -1, 22, 13,
527 -1, -1, 13, 22, -1, 46, -1, 46, 26, 45,
528 -1, 47, 26, 45, -1, 47, -1, 46, -1, 46,
529 26, 45, -1, 47, 26, 45, -1, 47, 21, 47,
530 -1, 3, -1, 4, -1, 5, -1, 6, -1
533 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
534 static const yytype_uint16 yyrline
[] =
536 0, 121, 121, 122, 126, 135, 136, 143, 148, 153,
537 158, 163, 168, 173, 178, 183, 188, 193, 206, 211,
538 216, 221, 231, 241, 251, 256, 261, 266, 273, 284,
539 291, 297, 304, 310, 321, 331, 338, 344, 352, 359,
540 366, 372, 380, 387, 399, 410, 423, 431, 439, 447,
541 457, 464, 472, 479, 493, 494, 507, 508, 520, 521,
542 522, 528, 529, 535, 536, 543, 544, 545, 552, 555,
543 561, 562, 569, 572, 582, 586, 596, 600, 609, 610,
544 614, 626, 630, 631, 635, 642, 652, 656, 660, 664
548 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
549 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
550 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
551 static const char *const yytname
[] =
553 "$end", "error", "$undefined", "DR", "AR", "FPR", "FPCR", "LPC", "ZAR",
554 "ZDR", "LZPC", "CREG", "INDEXREG", "EXPR", "'&'", "'<'", "'>'", "'#'",
555 "'('", "')'", "'+'", "'-'", "','", "'['", "']'", "'@'", "'/'", "$accept",
556 "operand", "optional_ampersand", "generic_operand", "motorola_operand",
557 "mit_operand", "zireg", "zdireg", "zadr", "zdr", "apc", "zapc",
558 "optzapc", "zpc", "optczapc", "optcexpr", "optexprc", "reglist",
559 "ireglist", "reglistpair", "reglistreg", 0
564 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
566 static const yytype_uint16 yytoknum
[] =
568 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
569 265, 266, 267, 268, 38, 60, 62, 35, 40, 41,
570 43, 45, 44, 91, 93, 64, 47
574 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
575 static const yytype_uint8 yyr1
[] =
577 0, 27, 28, 28, 28, 29, 29, 30, 30, 30,
578 30, 30, 30, 30, 30, 30, 30, 30, 31, 31,
579 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
580 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
581 31, 31, 31, 31, 31, 31, 32, 32, 32, 32,
582 32, 32, 32, 32, 33, 33, 34, 34, 35, 35,
583 35, 36, 36, 37, 37, 38, 38, 38, 39, 39,
584 40, 40, 41, 41, 42, 42, 43, 43, 44, 44,
585 44, 45, 45, 45, 45, 46, 47, 47, 47, 47
588 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
589 static const yytype_uint8 yyr2
[] =
591 0, 2, 1, 2, 2, 0, 1, 2, 2, 1,
592 1, 1, 1, 1, 1, 2, 2, 1, 3, 4,
593 4, 5, 5, 4, 3, 3, 3, 7, 7, 6,
594 5, 6, 5, 6, 5, 5, 4, 9, 7, 8,
595 6, 10, 8, 10, 8, 8, 2, 3, 3, 5,
596 6, 10, 9, 10, 1, 1, 1, 1, 1, 1,
597 1, 1, 1, 1, 1, 1, 1, 1, 0, 1,
598 1, 1, 0, 2, 0, 2, 0, 2, 1, 3,
599 3, 1, 1, 3, 3, 3, 1, 1, 1, 1
602 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
603 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
604 means the default is an error. */
605 static const yytype_uint8 yydefact
[] =
607 68, 86, 87, 88, 89, 64, 67, 66, 13, 14,
608 0, 0, 0, 0, 0, 0, 0, 2, 5, 5,
609 65, 69, 0, 17, 78, 0, 0, 16, 7, 8,
610 15, 61, 63, 64, 67, 62, 66, 56, 0, 76,
611 72, 57, 0, 0, 1, 6, 3, 4, 46, 0,
612 0, 0, 63, 72, 0, 18, 24, 25, 26, 0,
613 72, 0, 0, 0, 0, 0, 0, 76, 47, 48,
614 86, 87, 88, 89, 79, 82, 81, 85, 80, 0,
615 0, 23, 0, 19, 72, 0, 77, 0, 0, 74,
616 72, 0, 73, 36, 59, 70, 60, 71, 54, 0,
617 0, 55, 58, 0, 20, 0, 0, 0, 0, 35,
618 0, 0, 0, 21, 0, 73, 74, 0, 0, 0,
619 0, 0, 30, 22, 32, 34, 49, 77, 0, 83,
620 84, 31, 33, 29, 0, 0, 0, 0, 0, 74,
621 74, 75, 74, 40, 74, 0, 50, 27, 28, 0,
622 0, 74, 38, 0, 0, 0, 0, 0, 76, 0,
623 74, 74, 0, 42, 44, 39, 45, 0, 0, 0,
624 0, 0, 37, 52, 0, 0, 41, 43, 51, 53
627 /* YYDEFGOTO[NTERM-NUM]. */
628 static const yytype_int8 yydefgoto
[] =
630 -1, 16, 46, 17, 18, 19, 100, 40, 101, 102,
631 20, 92, 22, 103, 64, 120, 62, 23, 74, 75,
635 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
637 #define YYPACT_NINF -98
638 static const yytype_int16 yypact
[] =
640 89, 14, 9, 31, 35, -98, -98, -98, -98, 0,
641 36, 42, 28, 56, 63, 67, 90, -98, 75, 75,
642 -98, -98, 86, -98, 96, -15, 123, -98, -98, -98,
643 -98, -98, 97, 115, 119, -98, 120, -98, 122, 16,
644 126, -98, 127, 157, -98, -98, -98, -98, 19, 154,
645 154, 154, -98, 140, 29, 144, -98, -98, -98, 123,
646 141, 99, 18, 70, 147, 105, 148, 152, -98, -98,
647 -98, -98, -98, -98, -98, 142, -13, -98, -98, 146,
648 150, -98, 133, -98, 140, 60, 146, 149, 133, 153,
649 140, 151, -98, -98, -98, -98, -98, -98, -98, 155,
650 158, -98, -98, 159, -98, 62, 143, 154, 154, -98,
651 160, 161, 162, -98, 133, 163, 164, 165, 166, 116,
652 168, 167, -98, -98, -98, -98, 169, -98, 173, -98,
653 -98, -98, -98, -98, 174, 176, 133, 116, 177, 175,
654 175, -98, 175, -98, 175, 170, 178, -98, -98, 180,
655 181, 175, -98, 171, 179, 182, 183, 187, 186, 189,
656 175, 175, 190, -98, -98, -98, -98, 79, 143, 195,
657 191, 192, -98, -98, 193, 194, -98, -98, -98, -98
660 /* YYPGOTO[NTERM-NUM]. */
661 static const yytype_int16 yypgoto
[] =
663 -98, -98, 196, -98, -98, -98, -81, 6, -98, -9,
664 -98, 2, -98, -78, -38, -97, -67, -98, -48, 172,
668 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
669 positive, shift that token. If negative, reduce the rule which
670 number is the opposite. If zero, do what YYDEFACT says.
671 If YYTABLE_NINF, syntax error. */
672 #define YYTABLE_NINF -64
673 static const yytype_int16 yytable
[] =
675 106, 110, 21, 78, 111, 41, 50, 117, 50, -10,
676 118, 51, 25, 108, -9, 80, 42, 41, 26, 138,
677 52, 31, 87, 5, 6, 128, 7, 35, 54, 60,
678 37, -11, 53, 134, -63, -12, 135, 67, 142, 68,
679 69, 61, 154, 155, 29, 156, 112, 157, 81, 27,
680 41, 82, 121, 41, 162, 149, 151, 28, 150, 129,
681 130, 85, 77, 170, 171, 84, 31, 32, 90, 30,
682 33, 34, 35, 36, 52, 37, 38, 5, 6, 113,
683 7, 126, 114, 91, 127, 43, 39, 174, 115, 45,
684 44, 168, 1, 2, 3, 4, 5, 6, 173, 7,
685 8, 127, 9, 10, 11, 12, 13, 14, 31, 94,
686 15, 48, 95, 96, 35, 97, 55, 98, 99, 31,
687 94, 88, 49, 89, 96, 35, 31, 52, 98, 141,
688 5, 6, 35, 7, 56, 37, 31, 94, 57, 58,
689 95, 96, 35, 97, 59, 98, 31, 94, 63, 65,
690 52, 96, 35, 5, 6, 98, 7, 70, 71, 72,
691 73, 66, 79, 86, 83, 105, 93, 104, 107, 109,
692 122, 0, 24, 116, 123, 119, 0, 124, 125, 131,
693 132, 133, 0, 0, 141, 136, 137, 143, 158, 139,
694 140, 144, 146, 147, 145, 148, 152, 153, 163, 167,
695 0, 164, 165, 159, 160, 161, 166, 169, 175, 172,
696 176, 177, 178, 179, 0, 47
699 static const yytype_int16 yycheck
[] =
701 67, 82, 0, 51, 82, 14, 21, 88, 21, 0,
702 88, 26, 0, 26, 0, 53, 14, 26, 18, 116,
703 4, 3, 60, 7, 8, 106, 10, 9, 26, 13,
704 12, 0, 26, 114, 25, 0, 114, 18, 119, 20,
705 21, 39, 139, 140, 16, 142, 84, 144, 19, 13,
706 59, 22, 90, 62, 151, 136, 137, 15, 136, 107,
707 108, 59, 50, 160, 161, 59, 3, 4, 62, 13,
708 7, 8, 9, 10, 4, 12, 13, 7, 8, 19,
709 10, 19, 22, 13, 22, 18, 23, 168, 86, 14,
710 0, 158, 3, 4, 5, 6, 7, 8, 19, 10,
711 11, 22, 13, 14, 15, 16, 17, 18, 3, 4,
712 21, 25, 7, 8, 9, 10, 19, 12, 13, 3,
713 4, 22, 26, 24, 8, 9, 3, 4, 12, 13,
714 7, 8, 9, 10, 19, 12, 3, 4, 19, 19,
715 7, 8, 9, 10, 22, 12, 3, 4, 22, 22,
716 4, 8, 9, 7, 8, 12, 10, 3, 4, 5,
717 6, 4, 22, 22, 20, 13, 19, 19, 26, 19,
718 19, -1, 0, 24, 19, 22, -1, 19, 19, 19,
719 19, 19, -1, -1, 13, 22, 22, 19, 18, 24,
720 24, 24, 19, 19, 25, 19, 19, 22, 19, 13,
721 -1, 19, 19, 25, 24, 24, 19, 18, 13, 19,
722 19, 19, 19, 19, -1, 19
725 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
726 symbol of state STATE-NUM. */
727 static const yytype_uint8 yystos
[] =
729 0, 3, 4, 5, 6, 7, 8, 10, 11, 13,
730 14, 15, 16, 17, 18, 21, 28, 30, 31, 32,
731 37, 38, 39, 44, 46, 47, 18, 13, 15, 16,
732 13, 3, 4, 7, 8, 9, 10, 12, 13, 23,
733 34, 36, 38, 18, 0, 14, 29, 29, 25, 26,
734 21, 26, 4, 34, 38, 19, 19, 19, 19, 22,
735 13, 38, 43, 22, 41, 22, 4, 18, 20, 21,
736 3, 4, 5, 6, 45, 46, 47, 47, 45, 22,
737 41, 19, 22, 20, 34, 38, 22, 41, 22, 24,
738 34, 13, 38, 19, 4, 7, 8, 10, 12, 13,
739 33, 35, 36, 40, 19, 13, 43, 26, 26, 19,
740 33, 40, 41, 19, 22, 38, 24, 33, 40, 22,
741 42, 41, 19, 19, 19, 19, 19, 22, 33, 45,
742 45, 19, 19, 19, 33, 40, 22, 22, 42, 24,
743 24, 13, 33, 19, 24, 25, 19, 19, 19, 33,
744 40, 33, 19, 22, 42, 42, 42, 42, 18, 25,
745 24, 24, 42, 19, 19, 19, 19, 13, 43, 18,
746 42, 42, 19, 19, 33, 13, 19, 19, 19, 19
749 #define yyerrok (yyerrstatus = 0)
750 #define yyclearin (yychar = YYEMPTY)
754 #define YYACCEPT goto yyacceptlab
755 #define YYABORT goto yyabortlab
756 #define YYERROR goto yyerrorlab
759 /* Like YYERROR except do call yyerror. This remains here temporarily
760 to ease the transition to the new meaning of YYERROR, for GCC.
761 Once GCC version 2 has supplanted version 1, this can go. */
763 #define YYFAIL goto yyerrlab
765 #define YYRECOVERING() (!!yyerrstatus)
767 #define YYBACKUP(Token, Value) \
769 if (yychar == YYEMPTY && yylen == 1) \
773 yytoken = YYTRANSLATE (yychar); \
779 yyerror (YY_("syntax error: cannot back up")); \
786 #define YYERRCODE 256
789 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
790 If N is 0, then set CURRENT to the empty location which ends
791 the previous symbol: RHS[0] (always defined). */
793 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
794 #ifndef YYLLOC_DEFAULT
795 # define YYLLOC_DEFAULT(Current, Rhs, N) \
799 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
800 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
801 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
802 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
806 (Current).first_line = (Current).last_line = \
807 YYRHSLOC (Rhs, 0).last_line; \
808 (Current).first_column = (Current).last_column = \
809 YYRHSLOC (Rhs, 0).last_column; \
815 /* YY_LOCATION_PRINT -- Print the location on the stream.
816 This macro was not mandated originally: define only if we know
817 we won't break user code: when these are the locations we know. */
819 #ifndef YY_LOCATION_PRINT
820 # if YYLTYPE_IS_TRIVIAL
821 # define YY_LOCATION_PRINT(File, Loc) \
822 fprintf (File, "%d.%d-%d.%d", \
823 (Loc).first_line, (Loc).first_column, \
824 (Loc).last_line, (Loc).last_column)
826 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
831 /* YYLEX -- calling `yylex' with the right arguments. */
834 # define YYLEX yylex (YYLEX_PARAM)
836 # define YYLEX yylex ()
839 /* Enable debugging if requested. */
843 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
844 # define YYFPRINTF fprintf
847 # define YYDPRINTF(Args) \
853 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
857 YYFPRINTF (stderr, "%s ", Title); \
858 yy_symbol_print (stderr, \
860 YYFPRINTF (stderr, "\n"); \
865 /*--------------------------------.
866 | Print this symbol on YYOUTPUT. |
867 `--------------------------------*/
870 #if (defined __STDC__ || defined __C99__FUNC__ \
871 || defined __cplusplus || defined _MSC_VER)
873 yy_symbol_value_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
)
876 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
)
879 YYSTYPE
const * const yyvaluep
;
885 if (yytype
< YYNTOKENS
)
886 YYPRINT (yyoutput
, yytoknum
[yytype
], *yyvaluep
);
898 /*--------------------------------.
899 | Print this symbol on YYOUTPUT. |
900 `--------------------------------*/
902 #if (defined __STDC__ || defined __C99__FUNC__ \
903 || defined __cplusplus || defined _MSC_VER)
905 yy_symbol_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
)
908 yy_symbol_print (yyoutput
, yytype
, yyvaluep
)
911 YYSTYPE
const * const yyvaluep
;
914 if (yytype
< YYNTOKENS
)
915 YYFPRINTF (yyoutput
, "token %s (", yytname
[yytype
]);
917 YYFPRINTF (yyoutput
, "nterm %s (", yytname
[yytype
]);
919 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
);
920 YYFPRINTF (yyoutput
, ")");
923 /*------------------------------------------------------------------.
924 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
926 `------------------------------------------------------------------*/
928 #if (defined __STDC__ || defined __C99__FUNC__ \
929 || defined __cplusplus || defined _MSC_VER)
931 yy_stack_print (yytype_int16
*bottom
, yytype_int16
*top
)
934 yy_stack_print (bottom
, top
)
935 yytype_int16
*bottom
;
939 YYFPRINTF (stderr
, "Stack now");
940 for (; bottom
<= top
; ++bottom
)
941 YYFPRINTF (stderr
, " %d", *bottom
);
942 YYFPRINTF (stderr
, "\n");
945 # define YY_STACK_PRINT(Bottom, Top) \
948 yy_stack_print ((Bottom), (Top)); \
952 /*------------------------------------------------.
953 | Report that the YYRULE is going to be reduced. |
954 `------------------------------------------------*/
956 #if (defined __STDC__ || defined __C99__FUNC__ \
957 || defined __cplusplus || defined _MSC_VER)
959 yy_reduce_print (YYSTYPE
*yyvsp
, int yyrule
)
962 yy_reduce_print (yyvsp
, yyrule
)
967 int yynrhs
= yyr2
[yyrule
];
969 unsigned long int yylno
= yyrline
[yyrule
];
970 YYFPRINTF (stderr
, "Reducing stack by rule %d (line %lu):\n",
972 /* The symbols being reduced. */
973 for (yyi
= 0; yyi
< yynrhs
; yyi
++)
975 fprintf (stderr
, " $%d = ", yyi
+ 1);
976 yy_symbol_print (stderr
, yyrhs
[yyprhs
[yyrule
] + yyi
],
977 &(yyvsp
[(yyi
+ 1) - (yynrhs
)])
979 fprintf (stderr
, "\n");
983 # define YY_REDUCE_PRINT(Rule) \
986 yy_reduce_print (yyvsp, Rule); \
989 /* Nonzero means print parse trace. It is left uninitialized so that
990 multiple parsers can coexist. */
993 # define YYDPRINTF(Args)
994 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
995 # define YY_STACK_PRINT(Bottom, Top)
996 # define YY_REDUCE_PRINT(Rule)
997 #endif /* !YYDEBUG */
1000 /* YYINITDEPTH -- initial size of the parser's stacks. */
1002 # define YYINITDEPTH 200
1005 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1006 if the built-in stack extension method is used).
1008 Do not make this value too large; the results are undefined if
1009 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1010 evaluated with infinite-precision integer arithmetic. */
1013 # define YYMAXDEPTH 10000
1021 # if defined __GLIBC__ && defined _STRING_H
1022 # define yystrlen strlen
1024 /* Return the length of YYSTR. */
1025 #if (defined __STDC__ || defined __C99__FUNC__ \
1026 || defined __cplusplus || defined _MSC_VER)
1028 yystrlen (const char *yystr
)
1036 for (yylen
= 0; yystr
[yylen
]; yylen
++)
1044 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1045 # define yystpcpy stpcpy
1047 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1049 #if (defined __STDC__ || defined __C99__FUNC__ \
1050 || defined __cplusplus || defined _MSC_VER)
1052 yystpcpy (char *yydest
, const char *yysrc
)
1055 yystpcpy (yydest
, yysrc
)
1061 const char *yys
= yysrc
;
1063 while ((*yyd
++ = *yys
++) != '\0')
1072 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1073 quotes and backslashes, so that it's suitable for yyerror. The
1074 heuristic is that double-quoting is unnecessary unless the string
1075 contains an apostrophe, a comma, or backslash (other than
1076 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1077 null, do not copy; instead, return the length of what the result
1080 yytnamerr (char *yyres
, const char *yystr
)
1085 char const *yyp
= yystr
;
1092 goto do_not_strip_quotes
;
1096 goto do_not_strip_quotes
;
1109 do_not_strip_quotes
: ;
1113 return yystrlen (yystr
);
1115 return yystpcpy (yyres
, yystr
) - yyres
;
1119 /* Copy into YYRESULT an error message about the unexpected token
1120 YYCHAR while in state YYSTATE. Return the number of bytes copied,
1121 including the terminating null byte. If YYRESULT is null, do not
1122 copy anything; just return the number of bytes that would be
1123 copied. As a special case, return 0 if an ordinary "syntax error"
1124 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
1125 size calculation. */
1127 yysyntax_error (char *yyresult
, int yystate
, int yychar
)
1129 int yyn
= yypact
[yystate
];
1131 if (! (YYPACT_NINF
< yyn
&& yyn
<= YYLAST
))
1135 int yytype
= YYTRANSLATE (yychar
);
1136 YYSIZE_T yysize0
= yytnamerr (0, yytname
[yytype
]);
1137 YYSIZE_T yysize
= yysize0
;
1139 int yysize_overflow
= 0;
1140 enum { YYERROR_VERBOSE_ARGS_MAXIMUM
= 5 };
1141 char const *yyarg
[YYERROR_VERBOSE_ARGS_MAXIMUM
];
1145 /* This is so xgettext sees the translatable formats that are
1146 constructed on the fly. */
1147 YY_("syntax error, unexpected %s");
1148 YY_("syntax error, unexpected %s, expecting %s");
1149 YY_("syntax error, unexpected %s, expecting %s or %s");
1150 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
1151 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
1155 static char const yyunexpected
[] = "syntax error, unexpected %s";
1156 static char const yyexpecting
[] = ", expecting %s";
1157 static char const yyor
[] = " or %s";
1158 char yyformat
[sizeof yyunexpected
1159 + sizeof yyexpecting
- 1
1160 + ((YYERROR_VERBOSE_ARGS_MAXIMUM
- 2)
1161 * (sizeof yyor
- 1))];
1162 char const *yyprefix
= yyexpecting
;
1164 /* Start YYX at -YYN if negative to avoid negative indexes in
1166 int yyxbegin
= yyn
< 0 ? -yyn
: 0;
1168 /* Stay within bounds of both yycheck and yytname. */
1169 int yychecklim
= YYLAST
- yyn
+ 1;
1170 int yyxend
= yychecklim
< YYNTOKENS
? yychecklim
: YYNTOKENS
;
1173 yyarg
[0] = yytname
[yytype
];
1174 yyfmt
= yystpcpy (yyformat
, yyunexpected
);
1176 for (yyx
= yyxbegin
; yyx
< yyxend
; ++yyx
)
1177 if (yycheck
[yyx
+ yyn
] == yyx
&& yyx
!= YYTERROR
)
1179 if (yycount
== YYERROR_VERBOSE_ARGS_MAXIMUM
)
1183 yyformat
[sizeof yyunexpected
- 1] = '\0';
1186 yyarg
[yycount
++] = yytname
[yyx
];
1187 yysize1
= yysize
+ yytnamerr (0, yytname
[yyx
]);
1188 yysize_overflow
|= (yysize1
< yysize
);
1190 yyfmt
= yystpcpy (yyfmt
, yyprefix
);
1194 yyf
= YY_(yyformat
);
1195 yysize1
= yysize
+ yystrlen (yyf
);
1196 yysize_overflow
|= (yysize1
< yysize
);
1199 if (yysize_overflow
)
1200 return YYSIZE_MAXIMUM
;
1204 /* Avoid sprintf, as that infringes on the user's name space.
1205 Don't have undefined behavior even if the translation
1206 produced a string with the wrong number of "%s"s. */
1207 char *yyp
= yyresult
;
1209 while ((*yyp
= *yyf
) != '\0')
1211 if (*yyp
== '%' && yyf
[1] == 's' && yyi
< yycount
)
1213 yyp
+= yytnamerr (yyp
, yyarg
[yyi
++]);
1226 #endif /* YYERROR_VERBOSE */
1229 /*-----------------------------------------------.
1230 | Release the memory associated to this symbol. |
1231 `-----------------------------------------------*/
1234 #if (defined __STDC__ || defined __C99__FUNC__ \
1235 || defined __cplusplus || defined _MSC_VER)
1237 yydestruct (const char *yymsg
, int yytype
, YYSTYPE
*yyvaluep
)
1240 yydestruct (yymsg
, yytype
, yyvaluep
)
1250 YY_SYMBOL_PRINT (yymsg
, yytype
, yyvaluep
, yylocationp
);
1261 /* Prevent warnings from -Wmissing-prototypes. */
1263 #ifdef YYPARSE_PARAM
1264 #if defined __STDC__ || defined __cplusplus
1265 int yyparse (void *YYPARSE_PARAM
);
1269 #else /* ! YYPARSE_PARAM */
1270 #if defined __STDC__ || defined __cplusplus
1275 #endif /* ! YYPARSE_PARAM */
1279 /* The look-ahead symbol. */
1282 /* The semantic value of the look-ahead symbol. */
1285 /* Number of syntax errors so far. */
1294 #ifdef YYPARSE_PARAM
1295 #if (defined __STDC__ || defined __C99__FUNC__ \
1296 || defined __cplusplus || defined _MSC_VER)
1298 yyparse (void *YYPARSE_PARAM
)
1301 yyparse (YYPARSE_PARAM
)
1302 void *YYPARSE_PARAM
;
1304 #else /* ! YYPARSE_PARAM */
1305 #if (defined __STDC__ || defined __C99__FUNC__ \
1306 || defined __cplusplus || defined _MSC_VER)
1320 /* Number of tokens to shift before error messages enabled. */
1322 /* Look-ahead token as an internal (translated) token number. */
1325 /* Buffer for error messages, and its allocated size. */
1327 char *yymsg
= yymsgbuf
;
1328 YYSIZE_T yymsg_alloc
= sizeof yymsgbuf
;
1331 /* Three stacks and their tools:
1332 `yyss': related to states,
1333 `yyvs': related to semantic values,
1334 `yyls': related to locations.
1336 Refer to the stacks thru separate pointers, to allow yyoverflow
1337 to reallocate them elsewhere. */
1339 /* The state stack. */
1340 yytype_int16 yyssa
[YYINITDEPTH
];
1341 yytype_int16
*yyss
= yyssa
;
1342 yytype_int16
*yyssp
;
1344 /* The semantic value stack. */
1345 YYSTYPE yyvsa
[YYINITDEPTH
];
1346 YYSTYPE
*yyvs
= yyvsa
;
1351 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1353 YYSIZE_T yystacksize
= YYINITDEPTH
;
1355 /* The variables used to return semantic value and location from the
1360 /* The number of symbols on the RHS of the reduced rule.
1361 Keep to zero when no symbol should be popped. */
1364 YYDPRINTF ((stderr
, "Starting parse\n"));
1369 yychar
= YYEMPTY
; /* Cause a token to be read. */
1371 /* Initialize stack pointers.
1372 Waste one element of value and location stack
1373 so that they stay on the same level as the state stack.
1374 The wasted elements are never initialized. */
1381 /*------------------------------------------------------------.
1382 | yynewstate -- Push a new state, which is found in yystate. |
1383 `------------------------------------------------------------*/
1385 /* In all cases, when you get here, the value and location stacks
1386 have just been pushed. So pushing a state here evens the stacks. */
1392 if (yyss
+ yystacksize
- 1 <= yyssp
)
1394 /* Get the current used size of the three stacks, in elements. */
1395 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
1399 /* Give user a chance to reallocate the stack. Use copies of
1400 these so that the &'s don't force the real ones into
1402 YYSTYPE
*yyvs1
= yyvs
;
1403 yytype_int16
*yyss1
= yyss
;
1406 /* Each stack pointer address is followed by the size of the
1407 data in use in that stack, in bytes. This used to be a
1408 conditional around just the two extra args, but that might
1409 be undefined if yyoverflow is a macro. */
1410 yyoverflow (YY_("memory exhausted"),
1411 &yyss1
, yysize
* sizeof (*yyssp
),
1412 &yyvs1
, yysize
* sizeof (*yyvsp
),
1419 #else /* no yyoverflow */
1420 # ifndef YYSTACK_RELOCATE
1421 goto yyexhaustedlab
;
1423 /* Extend the stack our own way. */
1424 if (YYMAXDEPTH
<= yystacksize
)
1425 goto yyexhaustedlab
;
1427 if (YYMAXDEPTH
< yystacksize
)
1428 yystacksize
= YYMAXDEPTH
;
1431 yytype_int16
*yyss1
= yyss
;
1432 union yyalloc
*yyptr
=
1433 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
1435 goto yyexhaustedlab
;
1436 YYSTACK_RELOCATE (yyss
);
1437 YYSTACK_RELOCATE (yyvs
);
1439 # undef YYSTACK_RELOCATE
1441 YYSTACK_FREE (yyss1
);
1444 #endif /* no yyoverflow */
1446 yyssp
= yyss
+ yysize
- 1;
1447 yyvsp
= yyvs
+ yysize
- 1;
1450 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
1451 (unsigned long int) yystacksize
));
1453 if (yyss
+ yystacksize
- 1 <= yyssp
)
1457 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
1466 /* Do appropriate processing given the current state. Read a
1467 look-ahead token if we need one and don't already have one. */
1469 /* First try to decide what to do without reference to look-ahead token. */
1470 yyn
= yypact
[yystate
];
1471 if (yyn
== YYPACT_NINF
)
1474 /* Not known => get a look-ahead token if don't already have one. */
1476 /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
1477 if (yychar
== YYEMPTY
)
1479 YYDPRINTF ((stderr
, "Reading a token: "));
1483 if (yychar
<= YYEOF
)
1485 yychar
= yytoken
= YYEOF
;
1486 YYDPRINTF ((stderr
, "Now at end of input.\n"));
1490 yytoken
= YYTRANSLATE (yychar
);
1491 YY_SYMBOL_PRINT ("Next token is", yytoken
, &yylval
, &yylloc
);
1494 /* If the proper action on seeing token YYTOKEN is to reduce or to
1495 detect an error, take that action. */
1497 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yytoken
)
1502 if (yyn
== 0 || yyn
== YYTABLE_NINF
)
1511 /* Count tokens shifted since error; after three, turn off error
1516 /* Shift the look-ahead token. */
1517 YY_SYMBOL_PRINT ("Shifting", yytoken
, &yylval
, &yylloc
);
1519 /* Discard the shifted token unless it is eof. */
1520 if (yychar
!= YYEOF
)
1529 /*-----------------------------------------------------------.
1530 | yydefault -- do the default action for the current state. |
1531 `-----------------------------------------------------------*/
1533 yyn
= yydefact
[yystate
];
1539 /*-----------------------------.
1540 | yyreduce -- Do a reduction. |
1541 `-----------------------------*/
1543 /* yyn is the number of a rule to reduce with. */
1546 /* If YYLEN is nonzero, implement the default value of the action:
1549 Otherwise, the following line sets YYVAL to garbage.
1550 This behavior is undocumented and Bison
1551 users should not rely upon it. Assigning to YYVAL
1552 unconditionally makes the parser a bit smaller, and it avoids a
1553 GCC warning that YYVAL may be used uninitialized. */
1554 yyval
= yyvsp
[1-yylen
];
1557 YY_REDUCE_PRINT (yyn
);
1561 #line 123 "m68k-parse.y"
1563 op
->trailing_ampersand
= (yyvsp
[(2) - (2)].trailing_ampersand
);
1568 #line 127 "m68k-parse.y"
1570 op
->trailing_ampersand
= (yyvsp
[(2) - (2)].trailing_ampersand
);
1575 #line 135 "m68k-parse.y"
1576 { (yyval
.trailing_ampersand
) = 0; }
1580 #line 137 "m68k-parse.y"
1581 { (yyval
.trailing_ampersand
) = 1; }
1585 #line 144 "m68k-parse.y"
1592 #line 149 "m68k-parse.y"
1599 #line 154 "m68k-parse.y"
1602 op
->reg
= (yyvsp
[(1) - (1)].reg
);
1607 #line 159 "m68k-parse.y"
1610 op
->reg
= (yyvsp
[(1) - (1)].reg
);
1615 #line 164 "m68k-parse.y"
1618 op
->reg
= (yyvsp
[(1) - (1)].reg
);
1623 #line 169 "m68k-parse.y"
1626 op
->reg
= (yyvsp
[(1) - (1)].reg
);
1631 #line 174 "m68k-parse.y"
1634 op
->reg
= (yyvsp
[(1) - (1)].reg
);
1639 #line 179 "m68k-parse.y"
1642 op
->disp
= (yyvsp
[(1) - (1)].exp
);
1647 #line 184 "m68k-parse.y"
1650 op
->disp
= (yyvsp
[(2) - (2)].exp
);
1655 #line 189 "m68k-parse.y"
1658 op
->disp
= (yyvsp
[(2) - (2)].exp
);
1663 #line 194 "m68k-parse.y"
1666 op
->mask
= (yyvsp
[(1) - (1)].mask
);
1671 #line 207 "m68k-parse.y"
1674 op
->reg
= (yyvsp
[(2) - (3)].reg
);
1679 #line 212 "m68k-parse.y"
1682 op
->reg
= (yyvsp
[(2) - (4)].reg
);
1687 #line 217 "m68k-parse.y"
1690 op
->reg
= (yyvsp
[(3) - (4)].reg
);
1695 #line 222 "m68k-parse.y"
1697 op
->reg
= (yyvsp
[(4) - (5)].reg
);
1698 op
->disp
= (yyvsp
[(2) - (5)].exp
);
1699 if (((yyvsp
[(4) - (5)].reg
) >= ZADDR0
&& (yyvsp
[(4) - (5)].reg
) <= ZADDR7
)
1700 || (yyvsp
[(4) - (5)].reg
) == ZPC
)
1708 #line 232 "m68k-parse.y"
1710 op
->reg
= (yyvsp
[(2) - (5)].reg
);
1711 op
->disp
= (yyvsp
[(4) - (5)].exp
);
1712 if (((yyvsp
[(2) - (5)].reg
) >= ZADDR0
&& (yyvsp
[(2) - (5)].reg
) <= ZADDR7
)
1713 || (yyvsp
[(2) - (5)].reg
) == ZPC
)
1721 #line 242 "m68k-parse.y"
1723 op
->reg
= (yyvsp
[(3) - (4)].reg
);
1724 op
->disp
= (yyvsp
[(1) - (4)].exp
);
1725 if (((yyvsp
[(3) - (4)].reg
) >= ZADDR0
&& (yyvsp
[(3) - (4)].reg
) <= ZADDR7
)
1726 || (yyvsp
[(3) - (4)].reg
) == ZPC
)
1734 #line 252 "m68k-parse.y"
1737 op
->reg
= (yyvsp
[(2) - (3)].reg
);
1742 #line 257 "m68k-parse.y"
1745 op
->reg
= (yyvsp
[(2) - (3)].reg
);
1750 #line 262 "m68k-parse.y"
1753 op
->reg
= (yyvsp
[(2) - (3)].reg
);
1758 #line 267 "m68k-parse.y"
1761 op
->reg
= (yyvsp
[(4) - (7)].reg
);
1762 op
->disp
= (yyvsp
[(2) - (7)].exp
);
1763 op
->index
= (yyvsp
[(6) - (7)].indexreg
);
1768 #line 274 "m68k-parse.y"
1770 if ((yyvsp
[(4) - (7)].reg
) == PC
|| (yyvsp
[(4) - (7)].reg
) == ZPC
)
1771 yyerror (_("syntax error"));
1773 op
->reg
= (yyvsp
[(6) - (7)].reg
);
1774 op
->disp
= (yyvsp
[(2) - (7)].exp
);
1775 op
->index
.reg
= (yyvsp
[(4) - (7)].reg
);
1776 op
->index
.size
= SIZE_UNSPEC
;
1777 op
->index
.scale
= 1;
1782 #line 285 "m68k-parse.y"
1785 op
->reg
= (yyvsp
[(5) - (6)].reg
);
1786 op
->disp
= (yyvsp
[(2) - (6)].exp
);
1787 op
->index
= (yyvsp
[(4) - (6)].indexreg
);
1792 #line 292 "m68k-parse.y"
1795 op
->disp
= (yyvsp
[(4) - (5)].exp
);
1796 op
->index
= (yyvsp
[(2) - (5)].indexreg
);
1801 #line 298 "m68k-parse.y"
1804 op
->reg
= (yyvsp
[(3) - (6)].reg
);
1805 op
->disp
= (yyvsp
[(1) - (6)].exp
);
1806 op
->index
= (yyvsp
[(5) - (6)].indexreg
);
1811 #line 305 "m68k-parse.y"
1814 op
->reg
= (yyvsp
[(2) - (5)].reg
);
1815 op
->index
= (yyvsp
[(4) - (5)].indexreg
);
1820 #line 311 "m68k-parse.y"
1822 if ((yyvsp
[(3) - (6)].reg
) == PC
|| (yyvsp
[(3) - (6)].reg
) == ZPC
)
1823 yyerror (_("syntax error"));
1825 op
->reg
= (yyvsp
[(5) - (6)].reg
);
1826 op
->disp
= (yyvsp
[(1) - (6)].exp
);
1827 op
->index
.reg
= (yyvsp
[(3) - (6)].reg
);
1828 op
->index
.size
= SIZE_UNSPEC
;
1829 op
->index
.scale
= 1;
1834 #line 322 "m68k-parse.y"
1836 if ((yyvsp
[(2) - (5)].reg
) == PC
|| (yyvsp
[(2) - (5)].reg
) == ZPC
)
1837 yyerror (_("syntax error"));
1839 op
->reg
= (yyvsp
[(4) - (5)].reg
);
1840 op
->index
.reg
= (yyvsp
[(2) - (5)].reg
);
1841 op
->index
.size
= SIZE_UNSPEC
;
1842 op
->index
.scale
= 1;
1847 #line 332 "m68k-parse.y"
1850 op
->reg
= (yyvsp
[(4) - (5)].reg
);
1851 op
->disp
= (yyvsp
[(1) - (5)].exp
);
1852 op
->index
= (yyvsp
[(3) - (5)].indexreg
);
1857 #line 339 "m68k-parse.y"
1860 op
->reg
= (yyvsp
[(3) - (4)].reg
);
1861 op
->index
= (yyvsp
[(2) - (4)].indexreg
);
1866 #line 345 "m68k-parse.y"
1869 op
->reg
= (yyvsp
[(4) - (9)].reg
);
1870 op
->disp
= (yyvsp
[(3) - (9)].exp
);
1871 op
->index
= (yyvsp
[(7) - (9)].indexreg
);
1872 op
->odisp
= (yyvsp
[(8) - (9)].exp
);
1877 #line 353 "m68k-parse.y"
1880 op
->reg
= (yyvsp
[(4) - (7)].reg
);
1881 op
->disp
= (yyvsp
[(3) - (7)].exp
);
1882 op
->odisp
= (yyvsp
[(6) - (7)].exp
);
1887 #line 360 "m68k-parse.y"
1890 op
->reg
= (yyvsp
[(3) - (8)].reg
);
1891 op
->index
= (yyvsp
[(6) - (8)].indexreg
);
1892 op
->odisp
= (yyvsp
[(7) - (8)].exp
);
1897 #line 367 "m68k-parse.y"
1900 op
->reg
= (yyvsp
[(3) - (6)].reg
);
1901 op
->odisp
= (yyvsp
[(5) - (6)].exp
);
1906 #line 373 "m68k-parse.y"
1909 op
->reg
= (yyvsp
[(5) - (10)].reg
);
1910 op
->disp
= (yyvsp
[(3) - (10)].exp
);
1911 op
->index
= (yyvsp
[(7) - (10)].indexreg
);
1912 op
->odisp
= (yyvsp
[(9) - (10)].exp
);
1917 #line 381 "m68k-parse.y"
1920 op
->reg
= (yyvsp
[(3) - (8)].reg
);
1921 op
->index
= (yyvsp
[(5) - (8)].indexreg
);
1922 op
->odisp
= (yyvsp
[(7) - (8)].exp
);
1927 #line 388 "m68k-parse.y"
1929 if ((yyvsp
[(5) - (10)].reg
) == PC
|| (yyvsp
[(5) - (10)].reg
) == ZPC
)
1930 yyerror (_("syntax error"));
1932 op
->reg
= (yyvsp
[(7) - (10)].reg
);
1933 op
->disp
= (yyvsp
[(3) - (10)].exp
);
1934 op
->index
.reg
= (yyvsp
[(5) - (10)].reg
);
1935 op
->index
.size
= SIZE_UNSPEC
;
1936 op
->index
.scale
= 1;
1937 op
->odisp
= (yyvsp
[(9) - (10)].exp
);
1942 #line 400 "m68k-parse.y"
1944 if ((yyvsp
[(3) - (8)].reg
) == PC
|| (yyvsp
[(3) - (8)].reg
) == ZPC
)
1945 yyerror (_("syntax error"));
1947 op
->reg
= (yyvsp
[(5) - (8)].reg
);
1948 op
->index
.reg
= (yyvsp
[(3) - (8)].reg
);
1949 op
->index
.size
= SIZE_UNSPEC
;
1950 op
->index
.scale
= 1;
1951 op
->odisp
= (yyvsp
[(7) - (8)].exp
);
1956 #line 411 "m68k-parse.y"
1959 op
->reg
= (yyvsp
[(5) - (8)].reg
);
1960 op
->disp
= (yyvsp
[(3) - (8)].exp
);
1961 op
->index
= (yyvsp
[(4) - (8)].indexreg
);
1962 op
->odisp
= (yyvsp
[(7) - (8)].exp
);
1967 #line 424 "m68k-parse.y"
1969 /* We use optzapc to avoid a shift/reduce conflict. */
1970 if ((yyvsp
[(1) - (2)].reg
) < ADDR0
|| (yyvsp
[(1) - (2)].reg
) > ADDR7
)
1971 yyerror (_("syntax error"));
1973 op
->reg
= (yyvsp
[(1) - (2)].reg
);
1978 #line 432 "m68k-parse.y"
1980 /* We use optzapc to avoid a shift/reduce conflict. */
1981 if ((yyvsp
[(1) - (3)].reg
) < ADDR0
|| (yyvsp
[(1) - (3)].reg
) > ADDR7
)
1982 yyerror (_("syntax error"));
1984 op
->reg
= (yyvsp
[(1) - (3)].reg
);
1989 #line 440 "m68k-parse.y"
1991 /* We use optzapc to avoid a shift/reduce conflict. */
1992 if ((yyvsp
[(1) - (3)].reg
) < ADDR0
|| (yyvsp
[(1) - (3)].reg
) > ADDR7
)
1993 yyerror (_("syntax error"));
1995 op
->reg
= (yyvsp
[(1) - (3)].reg
);
2000 #line 448 "m68k-parse.y"
2002 op
->reg
= (yyvsp
[(1) - (5)].reg
);
2003 op
->disp
= (yyvsp
[(4) - (5)].exp
);
2004 if (((yyvsp
[(1) - (5)].reg
) >= ZADDR0
&& (yyvsp
[(1) - (5)].reg
) <= ZADDR7
)
2005 || (yyvsp
[(1) - (5)].reg
) == ZPC
)
2013 #line 458 "m68k-parse.y"
2016 op
->reg
= (yyvsp
[(1) - (6)].reg
);
2017 op
->disp
= (yyvsp
[(4) - (6)].exp
);
2018 op
->index
= (yyvsp
[(5) - (6)].indexreg
);
2023 #line 465 "m68k-parse.y"
2026 op
->reg
= (yyvsp
[(1) - (10)].reg
);
2027 op
->disp
= (yyvsp
[(4) - (10)].exp
);
2028 op
->index
= (yyvsp
[(9) - (10)].indexreg
);
2029 op
->odisp
= (yyvsp
[(8) - (10)].exp
);
2034 #line 473 "m68k-parse.y"
2037 op
->reg
= (yyvsp
[(1) - (9)].reg
);
2038 op
->disp
= (yyvsp
[(4) - (9)].exp
);
2039 op
->odisp
= (yyvsp
[(8) - (9)].exp
);
2044 #line 480 "m68k-parse.y"
2047 op
->reg
= (yyvsp
[(1) - (10)].reg
);
2048 op
->disp
= (yyvsp
[(4) - (10)].exp
);
2049 op
->index
= (yyvsp
[(5) - (10)].indexreg
);
2050 op
->odisp
= (yyvsp
[(9) - (10)].exp
);
2055 #line 495 "m68k-parse.y"
2057 (yyval
.indexreg
).reg
= (yyvsp
[(1) - (1)].reg
);
2058 (yyval
.indexreg
).size
= SIZE_UNSPEC
;
2059 (yyval
.indexreg
).scale
= 1;
2064 #line 509 "m68k-parse.y"
2066 (yyval
.indexreg
).reg
= (yyvsp
[(1) - (1)].reg
);
2067 (yyval
.indexreg
).size
= SIZE_UNSPEC
;
2068 (yyval
.indexreg
).scale
= 1;
2073 #line 552 "m68k-parse.y"
2075 (yyval
.reg
) = ZADDR0
;
2080 #line 569 "m68k-parse.y"
2082 (yyval
.reg
) = ZADDR0
;
2087 #line 573 "m68k-parse.y"
2089 (yyval
.reg
) = (yyvsp
[(2) - (2)].reg
);
2094 #line 582 "m68k-parse.y"
2096 (yyval
.exp
).exp
.X_op
= O_absent
;
2097 (yyval
.exp
).size
= SIZE_UNSPEC
;
2102 #line 587 "m68k-parse.y"
2104 (yyval
.exp
) = (yyvsp
[(2) - (2)].exp
);
2109 #line 596 "m68k-parse.y"
2111 (yyval
.exp
).exp
.X_op
= O_absent
;
2112 (yyval
.exp
).size
= SIZE_UNSPEC
;
2117 #line 601 "m68k-parse.y"
2119 (yyval
.exp
) = (yyvsp
[(1) - (2)].exp
);
2124 #line 611 "m68k-parse.y"
2126 (yyval
.mask
) = (yyvsp
[(1) - (3)].mask
) | (yyvsp
[(3) - (3)].mask
);
2131 #line 615 "m68k-parse.y"
2133 (yyval
.mask
) = (1 << (yyvsp
[(1) - (3)].onereg
)) | (yyvsp
[(3) - (3)].mask
);
2138 #line 627 "m68k-parse.y"
2140 (yyval
.mask
) = 1 << (yyvsp
[(1) - (1)].onereg
);
2145 #line 632 "m68k-parse.y"
2147 (yyval
.mask
) = (yyvsp
[(1) - (3)].mask
) | (yyvsp
[(3) - (3)].mask
);
2152 #line 636 "m68k-parse.y"
2154 (yyval
.mask
) = (1 << (yyvsp
[(1) - (3)].onereg
)) | (yyvsp
[(3) - (3)].mask
);
2159 #line 643 "m68k-parse.y"
2161 if ((yyvsp
[(1) - (3)].onereg
) <= (yyvsp
[(3) - (3)].onereg
))
2162 (yyval
.mask
) = (1 << ((yyvsp
[(3) - (3)].onereg
) + 1)) - 1 - ((1 << (yyvsp
[(1) - (3)].onereg
)) - 1);
2164 (yyval
.mask
) = (1 << ((yyvsp
[(1) - (3)].onereg
) + 1)) - 1 - ((1 << (yyvsp
[(3) - (3)].onereg
)) - 1);
2169 #line 653 "m68k-parse.y"
2171 (yyval
.onereg
) = (yyvsp
[(1) - (1)].reg
) - DATA0
;
2176 #line 657 "m68k-parse.y"
2178 (yyval
.onereg
) = (yyvsp
[(1) - (1)].reg
) - ADDR0
+ 8;
2183 #line 661 "m68k-parse.y"
2185 (yyval
.onereg
) = (yyvsp
[(1) - (1)].reg
) - FP0
+ 16;
2190 #line 665 "m68k-parse.y"
2192 if ((yyvsp
[(1) - (1)].reg
) == FPI
)
2193 (yyval
.onereg
) = 24;
2194 else if ((yyvsp
[(1) - (1)].reg
) == FPS
)
2195 (yyval
.onereg
) = 25;
2197 (yyval
.onereg
) = 26;
2202 /* Line 1267 of yacc.c. */
2203 #line 2204 "m68k-parse.c"
2206 YY_SYMBOL_PRINT ("-> $$ =", yyr1
[yyn
], &yyval
, &yyloc
);
2210 YY_STACK_PRINT (yyss
, yyssp
);
2215 /* Now `shift' the result of the reduction. Determine what state
2216 that goes to, based on the state we popped back to and the rule
2217 number reduced by. */
2221 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
2222 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
2223 yystate
= yytable
[yystate
];
2225 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
2230 /*------------------------------------.
2231 | yyerrlab -- here on detecting error |
2232 `------------------------------------*/
2234 /* If not already recovering from an error, report this error. */
2238 #if ! YYERROR_VERBOSE
2239 yyerror (YY_("syntax error"));
2242 YYSIZE_T yysize
= yysyntax_error (0, yystate
, yychar
);
2243 if (yymsg_alloc
< yysize
&& yymsg_alloc
< YYSTACK_ALLOC_MAXIMUM
)
2245 YYSIZE_T yyalloc
= 2 * yysize
;
2246 if (! (yysize
<= yyalloc
&& yyalloc
<= YYSTACK_ALLOC_MAXIMUM
))
2247 yyalloc
= YYSTACK_ALLOC_MAXIMUM
;
2248 if (yymsg
!= yymsgbuf
)
2249 YYSTACK_FREE (yymsg
);
2250 yymsg
= (char *) YYSTACK_ALLOC (yyalloc
);
2252 yymsg_alloc
= yyalloc
;
2256 yymsg_alloc
= sizeof yymsgbuf
;
2260 if (0 < yysize
&& yysize
<= yymsg_alloc
)
2262 (void) yysyntax_error (yymsg
, yystate
, yychar
);
2267 yyerror (YY_("syntax error"));
2269 goto yyexhaustedlab
;
2277 if (yyerrstatus
== 3)
2279 /* If just tried and failed to reuse look-ahead token after an
2280 error, discard it. */
2282 if (yychar
<= YYEOF
)
2284 /* Return failure if at end of input. */
2285 if (yychar
== YYEOF
)
2290 yydestruct ("Error: discarding",
2296 /* Else will try to reuse look-ahead token after shifting the error
2301 /*---------------------------------------------------.
2302 | yyerrorlab -- error raised explicitly by YYERROR. |
2303 `---------------------------------------------------*/
2306 /* Pacify compilers like GCC when the user code never invokes
2307 YYERROR and the label yyerrorlab therefore never appears in user
2309 if (/*CONSTCOND*/ 0)
2312 /* Do not reclaim the symbols of the rule which action triggered
2316 YY_STACK_PRINT (yyss
, yyssp
);
2321 /*-------------------------------------------------------------.
2322 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2323 `-------------------------------------------------------------*/
2325 yyerrstatus
= 3; /* Each real token shifted decrements this. */
2329 yyn
= yypact
[yystate
];
2330 if (yyn
!= YYPACT_NINF
)
2333 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
2341 /* Pop the current state because it cannot handle the error token. */
2346 yydestruct ("Error: popping",
2347 yystos
[yystate
], yyvsp
);
2350 YY_STACK_PRINT (yyss
, yyssp
);
2359 /* Shift the error token. */
2360 YY_SYMBOL_PRINT ("Shifting", yystos
[yyn
], yyvsp
, yylsp
);
2366 /*-------------------------------------.
2367 | yyacceptlab -- YYACCEPT comes here. |
2368 `-------------------------------------*/
2373 /*-----------------------------------.
2374 | yyabortlab -- YYABORT comes here. |
2375 `-----------------------------------*/
2381 /*-------------------------------------------------.
2382 | yyexhaustedlab -- memory exhaustion comes here. |
2383 `-------------------------------------------------*/
2385 yyerror (YY_("memory exhausted"));
2391 if (yychar
!= YYEOF
&& yychar
!= YYEMPTY
)
2392 yydestruct ("Cleanup: discarding lookahead",
2394 /* Do not reclaim the symbols of the rule which action triggered
2395 this YYABORT or YYACCEPT. */
2397 YY_STACK_PRINT (yyss
, yyssp
);
2398 while (yyssp
!= yyss
)
2400 yydestruct ("Cleanup: popping",
2401 yystos
[*yyssp
], yyvsp
);
2406 YYSTACK_FREE (yyss
);
2409 if (yymsg
!= yymsgbuf
)
2410 YYSTACK_FREE (yymsg
);
2412 /* Make sure YYID is used. */
2413 return YYID (yyresult
);
2417 #line 675 "m68k-parse.y"
2420 /* The string to parse is stored here, and modified by yylex. */
2424 /* The original string pointer. */
2426 static char *strorig
;
2428 /* If *CCP could be a register, return the register number and advance
2429 *CCP. Otherwise don't change *CCP, and return 0. */
2431 static enum m68k_register
2432 m68k_reg_parse (ccp
)
2433 register char **ccp
;
2440 if (flag_reg_prefix_optional
)
2442 if (*start
== REGISTER_PREFIX
)
2448 if (*start
!= REGISTER_PREFIX
)
2453 if (! is_name_beginner (*p
))
2457 while (is_part_of_name (*p
) && *p
!= '.' && *p
!= ':' && *p
!= '*')
2462 symbolp
= symbol_find (start
);
2465 if (symbolp
!= NULL
&& S_GET_SEGMENT (symbolp
) == reg_section
)
2468 return S_GET_VALUE (symbolp
);
2471 /* In MRI mode, something like foo.bar can be equated to a register
2473 while (flag_mri
&& c
== '.')
2476 while (is_part_of_name (*p
) && *p
!= '.' && *p
!= ':' && *p
!= '*')
2480 symbolp
= symbol_find (start
);
2482 if (symbolp
!= NULL
&& S_GET_SEGMENT (symbolp
) == reg_section
)
2485 return S_GET_VALUE (symbolp
);
2497 enum m68k_register reg
;
2510 /* Various special characters are just returned directly. */
2514 /* In MRI mode, this can be the start of an octal number. */
2517 if (ISDIGIT (str
[1])
2518 || ((str
[1] == '+' || str
[1] == '-')
2519 && ISDIGIT (str
[2])))
2534 /* It so happens that a '+' can only appear at the end of an
2535 operand, or if it is trailed by an '&'(see mac load insn).
2536 If it appears anywhere else, it must be a unary. */
2537 if (str
[1] == '\0' || (str
[1] == '&' && str
[2] == '\0'))
2541 /* A '-' can only appear in -(ar), rn-rn, or ar@-. If it
2542 appears anywhere else, it must be a unary minus on an
2543 expression, unless it it trailed by a '&'(see mac load insn). */
2544 if (str
[1] == '\0' || (str
[1] == '&' && str
[2] == '\0'))
2549 if (m68k_reg_parse (&s
) != 0)
2553 /* A '(' can only appear in `(reg)', `(expr,...', `([', `@(', or
2554 `)('. If it appears anywhere else, it must be starting an
2559 || str
[-1] == ')')))
2562 if (m68k_reg_parse (&s
) != 0)
2564 /* Check for the case of '(expr,...' by scanning ahead. If we
2565 find a comma outside of balanced parentheses, we return '('.
2566 If we find an unbalanced right parenthesis, then presumably
2567 the '(' really starts an expression. */
2569 for (s
= str
+ 1; *s
!= '\0'; s
++)
2579 else if (*s
== ',' && parens
== 0)
2581 /* A comma can not normally appear in an expression, so
2582 this is a case of '(expr,...'. */
2588 /* See if it's a register. */
2590 reg
= m68k_reg_parse (&str
);
2597 if (reg
>= DATA0
&& reg
<= DATA7
)
2599 else if (reg
>= ADDR0
&& reg
<= ADDR7
)
2601 else if (reg
>= FP0
&& reg
<= FP7
)
2609 else if (reg
>= ZDATA0
&& reg
<= ZDATA7
)
2611 else if (reg
>= ZADDR0
&& reg
<= ZADDR7
)
2613 else if (reg
== ZPC
)
2618 /* If we get here, we have a data or address register. We
2619 must check for a size or scale; if we find one, we must
2624 if (*s
!= '.' && *s
!= ':' && *s
!= '*')
2627 yylval
.indexreg
.reg
= reg
;
2629 if (*s
!= '.' && *s
!= ':')
2630 yylval
.indexreg
.size
= SIZE_UNSPEC
;
2638 yylval
.indexreg
.size
= SIZE_WORD
;
2643 yylval
.indexreg
.size
= SIZE_LONG
;
2647 yyerror (_("illegal size specification"));
2648 yylval
.indexreg
.size
= SIZE_UNSPEC
;
2653 yylval
.indexreg
.scale
= 1;
2655 if (*s
== '*' || *s
== ':')
2661 hold
= input_line_pointer
;
2662 input_line_pointer
= s
;
2663 expression (&scale
);
2664 s
= input_line_pointer
;
2665 input_line_pointer
= hold
;
2667 if (scale
.X_op
!= O_constant
)
2668 yyerror (_("scale specification must resolve to a number"));
2671 switch (scale
.X_add_number
)
2677 yylval
.indexreg
.scale
= scale
.X_add_number
;
2680 yyerror (_("invalid scale value"));
2691 /* It must be an expression. Before we call expression, we need to
2692 look ahead to see if there is a size specification. We must do
2693 that first, because otherwise foo.l will be treated as the symbol
2694 foo.l, rather than as the symbol foo with a long size
2695 specification. The grammar requires that all expressions end at
2696 the end of the operand, or with ',', '(', ']', ')'. */
2699 for (s
= str
; *s
!= '\0'; s
++)
2705 && (s
[-1] == ')' || ISALNUM (s
[-1])))
2715 else if (parens
== 0
2716 && (*s
== ',' || *s
== ']'))
2720 yylval
.exp
.size
= SIZE_UNSPEC
;
2722 || (s
[-2] != '.' && s
[-2] != ':'))
2732 yylval
.exp
.size
= SIZE_BYTE
;
2736 yylval
.exp
.size
= SIZE_WORD
;
2740 yylval
.exp
.size
= SIZE_LONG
;
2745 if (yylval
.exp
.size
!= SIZE_UNSPEC
)
2751 /* Look for @PLTPC, etc. */
2754 yylval
.exp
.pic_reloc
= pic_none
;
2756 if (cp
- 6 > str
&& cp
[-6] == '@')
2758 if (strncmp (cp
- 6, "@PLTPC", 6) == 0)
2760 yylval
.exp
.pic_reloc
= pic_plt_pcrel
;
2763 else if (strncmp (cp
- 6, "@GOTPC", 6) == 0)
2765 yylval
.exp
.pic_reloc
= pic_got_pcrel
;
2769 else if (cp
- 4 > str
&& cp
[-4] == '@')
2771 if (strncmp (cp
- 4, "@PLT", 4) == 0)
2773 yylval
.exp
.pic_reloc
= pic_plt_off
;
2776 else if (strncmp (cp
- 4, "@GOT", 4) == 0)
2778 yylval
.exp
.pic_reloc
= pic_got_off
;
2791 hold
= input_line_pointer
;
2792 input_line_pointer
= str
;
2793 expression (&yylval
.exp
.exp
);
2794 str
= input_line_pointer
;
2795 input_line_pointer
= hold
;
2806 /* Parse an m68k operand. This is the only function which is called
2807 from outside this file. */
2810 m68k_ip_op (s
, oparg
)
2812 struct m68k_op
*oparg
;
2814 memset (oparg
, 0, sizeof *oparg
);
2815 oparg
->error
= NULL
;
2816 oparg
->index
.reg
= ZDATA0
;
2817 oparg
->index
.scale
= 1;
2818 oparg
->disp
.exp
.X_op
= O_absent
;
2819 oparg
->odisp
.exp
.X_op
= O_absent
;
2827 /* The error handler. */