1 /* A Bison parser, made by GNU Bison 2.1. */
3 /* Skeleton parser for Yacc-like parsing with Bison,
4 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 Boston, MA 02110-1301, USA. */
21 /* As a special exception, when this file is copied by Bison into a
22 Bison output file, you may use that output file without restriction.
23 This special exception was added by the Free Software Foundation
24 in version 1.24 of Bison. */
26 /* Written by Richard Stallman by simplifying the original so called
27 ``semantic'' parser. */
29 /* All symbols defined below should begin with yy or YY, to avoid
30 infringing on user name space. This should be done even for local
31 variables, as they might otherwise be expanded by user macros.
32 There are some unavoidable exceptions within include files to
33 define necessary library symbols; they are noted "INFRINGES ON
34 USER NAME SPACE" below. */
36 /* Identify Bison output. */
40 #define YYBISON_VERSION "2.1"
43 #define YYSKELETON_NAME "yacc.c"
48 /* Using locations. */
49 #define YYLSP_NEEDED 0
56 /* Put the tokens into the symbol table, so that GDB and other debuggers
88 /* Copy the first part of user declarations. */
89 #line 28 "m68k-parse.y"
94 #include "m68k-parse.h"
95 #include "safe-ctype.h"
97 /* Remap normal yacc parser interface names (yyparse, yylex, yyerror,
98 etc), as well as gratuitously global symbol names If other parser
99 generators (bison, byacc, etc) produce additional global names that
100 conflict at link time, then those parser generators need to be
101 fixed instead of adding those names to this list. */
103 #define yymaxdepth m68k_maxdepth
104 #define yyparse m68k_parse
105 #define yylex m68k_lex
106 #define yyerror m68k_error
107 #define yylval m68k_lval
108 #define yychar m68k_char
109 #define yydebug m68k_debug
110 #define yypact m68k_pact
113 #define yydef m68k_def
114 #define yychk m68k_chk
115 #define yypgo m68k_pgo
116 #define yyact m68k_act
117 #define yyexca m68k_exca
118 #define yyerrflag m68k_errflag
119 #define yynerrs m68k_nerrs
123 #define yy_yys m68k_yys
124 #define yystate m68k_state
125 #define yytmp m68k_tmp
127 #define yy_yyv m68k_yyv
128 #define yyval m68k_val
129 #define yylloc m68k_lloc
130 #define yyreds m68k_reds /* With YYDEBUG defined */
131 #define yytoks m68k_toks /* With YYDEBUG defined */
132 #define yylhs m68k_yylhs
133 #define yylen m68k_yylen
134 #define yydefred m68k_yydefred
135 #define yydgoto m68k_yydgoto
136 #define yysindex m68k_yysindex
137 #define yyrindex m68k_yyrindex
138 #define yygindex m68k_yygindex
139 #define yytable m68k_yytable
140 #define yycheck m68k_yycheck
146 /* Internal functions. */
148 static enum m68k_register
m68k_reg_parse (char **);
149 static int yylex (void);
150 static void yyerror (const char *);
152 /* The parser sets fields pointed to by this global variable. */
153 static struct m68k_op
*op
;
157 /* Enabling traces. */
162 /* Enabling verbose error messages. */
163 #ifdef YYERROR_VERBOSE
164 # undef YYERROR_VERBOSE
165 # define YYERROR_VERBOSE 1
167 # define YYERROR_VERBOSE 0
170 /* Enabling the token table. */
171 #ifndef YYTOKEN_TABLE
172 # define YYTOKEN_TABLE 0
175 #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
176 #line 96 "m68k-parse.y"
177 typedef union YYSTYPE
{
178 struct m68k_indexreg indexreg
;
179 enum m68k_register reg
;
183 int trailing_ampersand
;
185 /* Line 196 of yacc.c. */
186 #line 187 "m68k-parse.c"
187 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
188 # define YYSTYPE_IS_DECLARED 1
189 # define YYSTYPE_IS_TRIVIAL 1
194 /* Copy the second part of user declarations. */
197 /* Line 219 of yacc.c. */
198 #line 199 "m68k-parse.c"
200 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
201 # define YYSIZE_T __SIZE_TYPE__
203 #if ! defined (YYSIZE_T) && defined (size_t)
204 # define YYSIZE_T size_t
206 #if ! defined (YYSIZE_T) && (defined (__STDC__) || defined (__cplusplus))
207 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
208 # define YYSIZE_T size_t
210 #if ! defined (YYSIZE_T)
211 # define YYSIZE_T unsigned int
217 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
218 # define YY_(msgid) dgettext ("bison-runtime", msgid)
222 # define YY_(msgid) msgid
226 #if ! defined (yyoverflow) || YYERROR_VERBOSE
228 /* The parser invokes alloca or malloc; define the necessary symbols. */
230 # ifdef YYSTACK_USE_ALLOCA
231 # if YYSTACK_USE_ALLOCA
233 # define YYSTACK_ALLOC __builtin_alloca
235 # define YYSTACK_ALLOC alloca
236 # if defined (__STDC__) || defined (__cplusplus)
237 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
238 # define YYINCLUDED_STDLIB_H
244 # ifdef YYSTACK_ALLOC
245 /* Pacify GCC's `empty if-body' warning. */
246 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
247 # ifndef YYSTACK_ALLOC_MAXIMUM
248 /* The OS might guarantee only one guard page at the bottom of the stack,
249 and a page size can be as small as 4096 bytes. So we cannot safely
250 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
251 to allow for a few compiler-allocated temporary stack slots. */
252 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2005 */
255 # define YYSTACK_ALLOC YYMALLOC
256 # define YYSTACK_FREE YYFREE
257 # ifndef YYSTACK_ALLOC_MAXIMUM
258 # define YYSTACK_ALLOC_MAXIMUM ((YYSIZE_T) -1)
264 # define YYMALLOC malloc
265 # if (! defined (malloc) && ! defined (YYINCLUDED_STDLIB_H) \
266 && (defined (__STDC__) || defined (__cplusplus)))
267 void *malloc (YYSIZE_T
); /* INFRINGES ON USER NAME SPACE */
272 # if (! defined (free) && ! defined (YYINCLUDED_STDLIB_H) \
273 && (defined (__STDC__) || defined (__cplusplus)))
274 void free (void *); /* INFRINGES ON USER NAME SPACE */
281 #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
284 #if (! defined (yyoverflow) \
285 && (! defined (__cplusplus) \
286 || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL)))
288 /* A type that is properly aligned for any stack member. */
295 /* The size of the maximum gap between one aligned stack and the next. */
296 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
298 /* The size of an array large to enough to hold all stacks, each with
300 # define YYSTACK_BYTES(N) \
301 ((N) * (sizeof (short int) + sizeof (YYSTYPE)) \
302 + YYSTACK_GAP_MAXIMUM)
304 /* Copy COUNT objects from FROM to TO. The source and destination do
307 # if defined (__GNUC__) && 1 < __GNUC__
308 # define YYCOPY(To, From, Count) \
309 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
311 # define YYCOPY(To, From, Count) \
315 for (yyi = 0; yyi < (Count); yyi++) \
316 (To)[yyi] = (From)[yyi]; \
322 /* Relocate STACK from its old location to the new one. The
323 local variables YYSIZE and YYSTACKSIZE give the old and new number of
324 elements in the stack, and YYPTR gives the new location of the
325 stack. Advance YYPTR to a properly aligned location for the next
327 # define YYSTACK_RELOCATE(Stack) \
330 YYSIZE_T yynewbytes; \
331 YYCOPY (&yyptr->Stack, Stack, yysize); \
332 Stack = &yyptr->Stack; \
333 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
334 yyptr += yynewbytes / sizeof (*yyptr); \
340 #if defined (__STDC__) || defined (__cplusplus)
341 typedef signed char yysigned_char
;
343 typedef short int yysigned_char
;
346 /* YYFINAL -- State number of the termination state. */
348 /* YYLAST -- Last index in YYTABLE. */
351 /* YYNTOKENS -- Number of terminals. */
353 /* YYNNTS -- Number of nonterminals. */
355 /* YYNRULES -- Number of rules. */
357 /* YYNRULES -- Number of states. */
358 #define YYNSTATES 180
360 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
362 #define YYMAXUTOK 268
364 #define YYTRANSLATE(YYX) \
365 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
367 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
368 static const unsigned char yytranslate
[] =
370 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
371 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
372 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
373 2, 2, 2, 2, 2, 17, 2, 2, 14, 2,
374 18, 19, 2, 20, 22, 21, 2, 26, 2, 2,
375 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
376 15, 2, 16, 2, 25, 2, 2, 2, 2, 2,
377 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
378 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
379 2, 23, 2, 24, 2, 2, 2, 2, 2, 2,
380 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
381 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
382 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
383 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
384 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
385 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
386 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
387 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
388 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
389 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
390 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
391 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
392 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
393 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
394 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
395 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
396 5, 6, 7, 8, 9, 10, 11, 12, 13
400 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
402 static const unsigned short int yyprhs
[] =
404 0, 0, 3, 5, 8, 11, 12, 14, 17, 20,
405 22, 24, 26, 28, 30, 32, 35, 38, 40, 44,
406 49, 54, 60, 66, 71, 75, 79, 83, 91, 99,
407 106, 112, 119, 125, 132, 138, 144, 149, 159, 167,
408 176, 183, 194, 203, 214, 223, 232, 235, 239, 243,
409 249, 256, 267, 277, 288, 290, 292, 294, 296, 298,
410 300, 302, 304, 306, 308, 310, 312, 314, 316, 317,
411 319, 321, 323, 324, 327, 328, 331, 332, 335, 337,
412 341, 345, 347, 349, 353, 357, 361, 363, 365, 367
415 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
416 static const yysigned_char yyrhs
[] =
418 28, 0, -1, 30, -1, 31, 29, -1, 32, 29,
419 -1, -1, 14, -1, 15, 15, -1, 16, 16, -1,
420 3, -1, 4, -1, 5, -1, 6, -1, 11, -1,
421 13, -1, 17, 13, -1, 14, 13, -1, 44, -1,
422 18, 4, 19, -1, 18, 4, 19, 20, -1, 21,
423 18, 4, 19, -1, 18, 13, 22, 38, 19, -1,
424 18, 38, 22, 13, 19, -1, 13, 18, 38, 19,
425 -1, 18, 7, 19, -1, 18, 8, 19, -1, 18,
426 10, 19, -1, 18, 13, 22, 38, 22, 33, 19,
427 -1, 18, 13, 22, 38, 22, 40, 19, -1, 18,
428 13, 22, 34, 41, 19, -1, 18, 34, 22, 13,
429 19, -1, 13, 18, 38, 22, 33, 19, -1, 18,
430 38, 22, 33, 19, -1, 13, 18, 38, 22, 40,
431 19, -1, 18, 38, 22, 40, 19, -1, 13, 18,
432 34, 41, 19, -1, 18, 34, 41, 19, -1, 18,
433 23, 13, 41, 24, 22, 33, 42, 19, -1, 18,
434 23, 13, 41, 24, 42, 19, -1, 18, 23, 38,
435 24, 22, 33, 42, 19, -1, 18, 23, 38, 24,
436 42, 19, -1, 18, 23, 13, 22, 38, 22, 33,
437 24, 42, 19, -1, 18, 23, 38, 22, 33, 24,
438 42, 19, -1, 18, 23, 13, 22, 38, 22, 40,
439 24, 42, 19, -1, 18, 23, 38, 22, 40, 24,
440 42, 19, -1, 18, 23, 43, 34, 41, 24, 42,
441 19, -1, 39, 25, -1, 39, 25, 20, -1, 39,
442 25, 21, -1, 39, 25, 18, 13, 19, -1, 39,
443 25, 18, 43, 33, 19, -1, 39, 25, 18, 13,
444 19, 25, 18, 43, 33, 19, -1, 39, 25, 18,
445 13, 19, 25, 18, 13, 19, -1, 39, 25, 18,
446 43, 33, 19, 25, 18, 13, 19, -1, 12, -1,
447 35, -1, 12, -1, 36, -1, 36, -1, 4, -1,
448 8, -1, 3, -1, 9, -1, 4, -1, 7, -1,
449 37, -1, 10, -1, 8, -1, -1, 38, -1, 7,
450 -1, 10, -1, -1, 22, 38, -1, -1, 22, 13,
451 -1, -1, 13, 22, -1, 46, -1, 46, 26, 45,
452 -1, 47, 26, 45, -1, 47, -1, 46, -1, 46,
453 26, 45, -1, 47, 26, 45, -1, 47, 21, 47,
454 -1, 3, -1, 4, -1, 5, -1, 6, -1
457 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
458 static const unsigned short int yyrline
[] =
460 0, 121, 121, 122, 126, 135, 136, 143, 148, 153,
461 158, 163, 168, 173, 178, 183, 188, 193, 206, 211,
462 216, 221, 231, 241, 251, 256, 261, 266, 273, 284,
463 291, 297, 304, 310, 321, 331, 338, 344, 352, 359,
464 366, 372, 380, 387, 399, 410, 423, 431, 439, 447,
465 457, 464, 472, 479, 493, 494, 507, 508, 520, 521,
466 522, 528, 529, 535, 536, 543, 544, 545, 552, 555,
467 561, 562, 569, 572, 582, 586, 596, 600, 609, 610,
468 614, 626, 630, 631, 635, 642, 652, 656, 660, 664
472 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
473 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
474 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
475 static const char *const yytname
[] =
477 "$end", "error", "$undefined", "DR", "AR", "FPR", "FPCR", "LPC", "ZAR",
478 "ZDR", "LZPC", "CREG", "INDEXREG", "EXPR", "'&'", "'<'", "'>'", "'#'",
479 "'('", "')'", "'+'", "'-'", "','", "'['", "']'", "'@'", "'/'", "$accept",
480 "operand", "optional_ampersand", "generic_operand", "motorola_operand",
481 "mit_operand", "zireg", "zdireg", "zadr", "zdr", "apc", "zapc",
482 "optzapc", "zpc", "optczapc", "optcexpr", "optexprc", "reglist",
483 "ireglist", "reglistpair", "reglistreg", 0
488 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
490 static const unsigned short int yytoknum
[] =
492 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
493 265, 266, 267, 268, 38, 60, 62, 35, 40, 41,
494 43, 45, 44, 91, 93, 64, 47
498 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
499 static const unsigned char yyr1
[] =
501 0, 27, 28, 28, 28, 29, 29, 30, 30, 30,
502 30, 30, 30, 30, 30, 30, 30, 30, 31, 31,
503 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
504 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
505 31, 31, 31, 31, 31, 31, 32, 32, 32, 32,
506 32, 32, 32, 32, 33, 33, 34, 34, 35, 35,
507 35, 36, 36, 37, 37, 38, 38, 38, 39, 39,
508 40, 40, 41, 41, 42, 42, 43, 43, 44, 44,
509 44, 45, 45, 45, 45, 46, 47, 47, 47, 47
512 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
513 static const unsigned char yyr2
[] =
515 0, 2, 1, 2, 2, 0, 1, 2, 2, 1,
516 1, 1, 1, 1, 1, 2, 2, 1, 3, 4,
517 4, 5, 5, 4, 3, 3, 3, 7, 7, 6,
518 5, 6, 5, 6, 5, 5, 4, 9, 7, 8,
519 6, 10, 8, 10, 8, 8, 2, 3, 3, 5,
520 6, 10, 9, 10, 1, 1, 1, 1, 1, 1,
521 1, 1, 1, 1, 1, 1, 1, 1, 0, 1,
522 1, 1, 0, 2, 0, 2, 0, 2, 1, 3,
523 3, 1, 1, 3, 3, 3, 1, 1, 1, 1
526 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
527 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
528 means the default is an error. */
529 static const unsigned char yydefact
[] =
531 68, 86, 87, 88, 89, 64, 67, 66, 13, 14,
532 0, 0, 0, 0, 0, 0, 0, 2, 5, 5,
533 65, 69, 0, 17, 78, 0, 0, 16, 7, 8,
534 15, 61, 63, 64, 67, 62, 66, 56, 0, 76,
535 72, 57, 0, 0, 1, 6, 3, 4, 46, 0,
536 0, 0, 63, 72, 0, 18, 24, 25, 26, 0,
537 72, 0, 0, 0, 0, 0, 0, 76, 47, 48,
538 86, 87, 88, 89, 79, 82, 81, 85, 80, 0,
539 0, 23, 0, 19, 72, 0, 77, 0, 0, 74,
540 72, 0, 73, 36, 59, 70, 60, 71, 54, 0,
541 0, 55, 58, 0, 20, 0, 0, 0, 0, 35,
542 0, 0, 0, 21, 0, 73, 74, 0, 0, 0,
543 0, 0, 30, 22, 32, 34, 49, 77, 0, 83,
544 84, 31, 33, 29, 0, 0, 0, 0, 0, 74,
545 74, 75, 74, 40, 74, 0, 50, 27, 28, 0,
546 0, 74, 38, 0, 0, 0, 0, 0, 76, 0,
547 74, 74, 0, 42, 44, 39, 45, 0, 0, 0,
548 0, 0, 37, 52, 0, 0, 41, 43, 51, 53
551 /* YYDEFGOTO[NTERM-NUM]. */
552 static const yysigned_char yydefgoto
[] =
554 -1, 16, 46, 17, 18, 19, 100, 40, 101, 102,
555 20, 92, 22, 103, 64, 120, 62, 23, 74, 75,
559 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
561 #define YYPACT_NINF -98
562 static const short int yypact
[] =
564 89, 14, 9, 31, 35, -98, -98, -98, -98, 0,
565 36, 42, 28, 56, 63, 67, 90, -98, 75, 75,
566 -98, -98, 86, -98, 96, -15, 123, -98, -98, -98,
567 -98, -98, 97, 115, 119, -98, 120, -98, 122, 16,
568 126, -98, 127, 157, -98, -98, -98, -98, 19, 154,
569 154, 154, -98, 140, 29, 144, -98, -98, -98, 123,
570 141, 99, 18, 70, 147, 105, 148, 152, -98, -98,
571 -98, -98, -98, -98, -98, 142, -13, -98, -98, 146,
572 150, -98, 133, -98, 140, 60, 146, 149, 133, 153,
573 140, 151, -98, -98, -98, -98, -98, -98, -98, 155,
574 158, -98, -98, 159, -98, 62, 143, 154, 154, -98,
575 160, 161, 162, -98, 133, 163, 164, 165, 166, 116,
576 168, 167, -98, -98, -98, -98, 169, -98, 173, -98,
577 -98, -98, -98, -98, 174, 176, 133, 116, 177, 175,
578 175, -98, 175, -98, 175, 170, 178, -98, -98, 180,
579 181, 175, -98, 171, 179, 182, 183, 187, 186, 189,
580 175, 175, 190, -98, -98, -98, -98, 79, 143, 195,
581 191, 192, -98, -98, 193, 194, -98, -98, -98, -98
584 /* YYPGOTO[NTERM-NUM]. */
585 static const short int yypgoto
[] =
587 -98, -98, 196, -98, -98, -98, -81, 6, -98, -9,
588 -98, 2, -98, -78, -38, -97, -67, -98, -48, 172,
592 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
593 positive, shift that token. If negative, reduce the rule which
594 number is the opposite. If zero, do what YYDEFACT says.
595 If YYTABLE_NINF, syntax error. */
596 #define YYTABLE_NINF -64
597 static const short int yytable
[] =
599 106, 110, 21, 78, 111, 41, 50, 117, 50, -10,
600 118, 51, 25, 108, -9, 80, 42, 41, 26, 138,
601 52, 31, 87, 5, 6, 128, 7, 35, 54, 60,
602 37, -11, 53, 134, -63, -12, 135, 67, 142, 68,
603 69, 61, 154, 155, 29, 156, 112, 157, 81, 27,
604 41, 82, 121, 41, 162, 149, 151, 28, 150, 129,
605 130, 85, 77, 170, 171, 84, 31, 32, 90, 30,
606 33, 34, 35, 36, 52, 37, 38, 5, 6, 113,
607 7, 126, 114, 91, 127, 43, 39, 174, 115, 45,
608 44, 168, 1, 2, 3, 4, 5, 6, 173, 7,
609 8, 127, 9, 10, 11, 12, 13, 14, 31, 94,
610 15, 48, 95, 96, 35, 97, 55, 98, 99, 31,
611 94, 88, 49, 89, 96, 35, 31, 52, 98, 141,
612 5, 6, 35, 7, 56, 37, 31, 94, 57, 58,
613 95, 96, 35, 97, 59, 98, 31, 94, 63, 65,
614 52, 96, 35, 5, 6, 98, 7, 70, 71, 72,
615 73, 66, 79, 86, 83, 105, 93, 104, 107, 109,
616 122, 0, 24, 116, 123, 119, 0, 124, 125, 131,
617 132, 133, 0, 0, 141, 136, 137, 143, 158, 139,
618 140, 144, 146, 147, 145, 148, 152, 153, 163, 167,
619 0, 164, 165, 159, 160, 161, 166, 169, 175, 172,
620 176, 177, 178, 179, 0, 47
623 static const short int yycheck
[] =
625 67, 82, 0, 51, 82, 14, 21, 88, 21, 0,
626 88, 26, 0, 26, 0, 53, 14, 26, 18, 116,
627 4, 3, 60, 7, 8, 106, 10, 9, 26, 13,
628 12, 0, 26, 114, 25, 0, 114, 18, 119, 20,
629 21, 39, 139, 140, 16, 142, 84, 144, 19, 13,
630 59, 22, 90, 62, 151, 136, 137, 15, 136, 107,
631 108, 59, 50, 160, 161, 59, 3, 4, 62, 13,
632 7, 8, 9, 10, 4, 12, 13, 7, 8, 19,
633 10, 19, 22, 13, 22, 18, 23, 168, 86, 14,
634 0, 158, 3, 4, 5, 6, 7, 8, 19, 10,
635 11, 22, 13, 14, 15, 16, 17, 18, 3, 4,
636 21, 25, 7, 8, 9, 10, 19, 12, 13, 3,
637 4, 22, 26, 24, 8, 9, 3, 4, 12, 13,
638 7, 8, 9, 10, 19, 12, 3, 4, 19, 19,
639 7, 8, 9, 10, 22, 12, 3, 4, 22, 22,
640 4, 8, 9, 7, 8, 12, 10, 3, 4, 5,
641 6, 4, 22, 22, 20, 13, 19, 19, 26, 19,
642 19, -1, 0, 24, 19, 22, -1, 19, 19, 19,
643 19, 19, -1, -1, 13, 22, 22, 19, 18, 24,
644 24, 24, 19, 19, 25, 19, 19, 22, 19, 13,
645 -1, 19, 19, 25, 24, 24, 19, 18, 13, 19,
646 19, 19, 19, 19, -1, 19
649 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
650 symbol of state STATE-NUM. */
651 static const unsigned char yystos
[] =
653 0, 3, 4, 5, 6, 7, 8, 10, 11, 13,
654 14, 15, 16, 17, 18, 21, 28, 30, 31, 32,
655 37, 38, 39, 44, 46, 47, 18, 13, 15, 16,
656 13, 3, 4, 7, 8, 9, 10, 12, 13, 23,
657 34, 36, 38, 18, 0, 14, 29, 29, 25, 26,
658 21, 26, 4, 34, 38, 19, 19, 19, 19, 22,
659 13, 38, 43, 22, 41, 22, 4, 18, 20, 21,
660 3, 4, 5, 6, 45, 46, 47, 47, 45, 22,
661 41, 19, 22, 20, 34, 38, 22, 41, 22, 24,
662 34, 13, 38, 19, 4, 7, 8, 10, 12, 13,
663 33, 35, 36, 40, 19, 13, 43, 26, 26, 19,
664 33, 40, 41, 19, 22, 38, 24, 33, 40, 22,
665 42, 41, 19, 19, 19, 19, 19, 22, 33, 45,
666 45, 19, 19, 19, 33, 40, 22, 22, 42, 24,
667 24, 13, 33, 19, 24, 25, 19, 19, 19, 33,
668 40, 33, 19, 22, 42, 42, 42, 42, 18, 25,
669 24, 24, 42, 19, 19, 19, 19, 13, 43, 18,
670 42, 42, 19, 19, 33, 13, 19, 19, 19, 19
673 #define yyerrok (yyerrstatus = 0)
674 #define yyclearin (yychar = YYEMPTY)
678 #define YYACCEPT goto yyacceptlab
679 #define YYABORT goto yyabortlab
680 #define YYERROR goto yyerrorlab
683 /* Like YYERROR except do call yyerror. This remains here temporarily
684 to ease the transition to the new meaning of YYERROR, for GCC.
685 Once GCC version 2 has supplanted version 1, this can go. */
687 #define YYFAIL goto yyerrlab
689 #define YYRECOVERING() (!!yyerrstatus)
691 #define YYBACKUP(Token, Value) \
693 if (yychar == YYEMPTY && yylen == 1) \
697 yytoken = YYTRANSLATE (yychar); \
703 yyerror (YY_("syntax error: cannot back up")); \
710 #define YYERRCODE 256
713 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
714 If N is 0, then set CURRENT to the empty location which ends
715 the previous symbol: RHS[0] (always defined). */
717 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
718 #ifndef YYLLOC_DEFAULT
719 # define YYLLOC_DEFAULT(Current, Rhs, N) \
723 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
724 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
725 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
726 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
730 (Current).first_line = (Current).last_line = \
731 YYRHSLOC (Rhs, 0).last_line; \
732 (Current).first_column = (Current).last_column = \
733 YYRHSLOC (Rhs, 0).last_column; \
739 /* YY_LOCATION_PRINT -- Print the location on the stream.
740 This macro was not mandated originally: define only if we know
741 we won't break user code: when these are the locations we know. */
743 #ifndef YY_LOCATION_PRINT
744 # if YYLTYPE_IS_TRIVIAL
745 # define YY_LOCATION_PRINT(File, Loc) \
746 fprintf (File, "%d.%d-%d.%d", \
747 (Loc).first_line, (Loc).first_column, \
748 (Loc).last_line, (Loc).last_column)
750 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
755 /* YYLEX -- calling `yylex' with the right arguments. */
758 # define YYLEX yylex (YYLEX_PARAM)
760 # define YYLEX yylex ()
763 /* Enable debugging if requested. */
767 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
768 # define YYFPRINTF fprintf
771 # define YYDPRINTF(Args) \
777 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
781 YYFPRINTF (stderr, "%s ", Title); \
782 yysymprint (stderr, \
784 YYFPRINTF (stderr, "\n"); \
788 /*------------------------------------------------------------------.
789 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
791 `------------------------------------------------------------------*/
793 #if defined (__STDC__) || defined (__cplusplus)
795 yy_stack_print (short int *bottom
, short int *top
)
798 yy_stack_print (bottom
, top
)
803 YYFPRINTF (stderr
, "Stack now");
804 for (/* Nothing. */; bottom
<= top
; ++bottom
)
805 YYFPRINTF (stderr
, " %d", *bottom
);
806 YYFPRINTF (stderr
, "\n");
809 # define YY_STACK_PRINT(Bottom, Top) \
812 yy_stack_print ((Bottom), (Top)); \
816 /*------------------------------------------------.
817 | Report that the YYRULE is going to be reduced. |
818 `------------------------------------------------*/
820 #if defined (__STDC__) || defined (__cplusplus)
822 yy_reduce_print (int yyrule
)
825 yy_reduce_print (yyrule
)
830 unsigned long int yylno
= yyrline
[yyrule
];
831 YYFPRINTF (stderr
, "Reducing stack by rule %d (line %lu), ",
833 /* Print the symbols being reduced, and their result. */
834 for (yyi
= yyprhs
[yyrule
]; 0 <= yyrhs
[yyi
]; yyi
++)
835 YYFPRINTF (stderr
, "%s ", yytname
[yyrhs
[yyi
]]);
836 YYFPRINTF (stderr
, "-> %s\n", yytname
[yyr1
[yyrule
]]);
839 # define YY_REDUCE_PRINT(Rule) \
842 yy_reduce_print (Rule); \
845 /* Nonzero means print parse trace. It is left uninitialized so that
846 multiple parsers can coexist. */
849 # define YYDPRINTF(Args)
850 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
851 # define YY_STACK_PRINT(Bottom, Top)
852 # define YY_REDUCE_PRINT(Rule)
853 #endif /* !YYDEBUG */
856 /* YYINITDEPTH -- initial size of the parser's stacks. */
858 # define YYINITDEPTH 200
861 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
862 if the built-in stack extension method is used).
864 Do not make this value too large; the results are undefined if
865 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
866 evaluated with infinite-precision integer arithmetic. */
869 # define YYMAXDEPTH 10000
877 # if defined (__GLIBC__) && defined (_STRING_H)
878 # define yystrlen strlen
880 /* Return the length of YYSTR. */
882 # if defined (__STDC__) || defined (__cplusplus)
883 yystrlen (const char *yystr
)
889 const char *yys
= yystr
;
891 while (*yys
++ != '\0')
894 return yys
- yystr
- 1;
900 # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
901 # define yystpcpy stpcpy
903 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
906 # if defined (__STDC__) || defined (__cplusplus)
907 yystpcpy (char *yydest
, const char *yysrc
)
909 yystpcpy (yydest
, yysrc
)
915 const char *yys
= yysrc
;
917 while ((*yyd
++ = *yys
++) != '\0')
926 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
927 quotes and backslashes, so that it's suitable for yyerror. The
928 heuristic is that double-quoting is unnecessary unless the string
929 contains an apostrophe, a comma, or backslash (other than
930 backslash-backslash). YYSTR is taken from yytname. If YYRES is
931 null, do not copy; instead, return the length of what the result
934 yytnamerr (char *yyres
, const char *yystr
)
939 char const *yyp
= yystr
;
946 goto do_not_strip_quotes
;
950 goto do_not_strip_quotes
;
963 do_not_strip_quotes
: ;
967 return yystrlen (yystr
);
969 return yystpcpy (yyres
, yystr
) - yyres
;
973 #endif /* YYERROR_VERBOSE */
978 /*--------------------------------.
979 | Print this symbol on YYOUTPUT. |
980 `--------------------------------*/
982 #if defined (__STDC__) || defined (__cplusplus)
984 yysymprint (FILE *yyoutput
, int yytype
, YYSTYPE
*yyvaluep
)
987 yysymprint (yyoutput
, yytype
, yyvaluep
)
993 /* Pacify ``unused variable'' warnings. */
996 if (yytype
< YYNTOKENS
)
997 YYFPRINTF (yyoutput
, "token %s (", yytname
[yytype
]);
999 YYFPRINTF (yyoutput
, "nterm %s (", yytname
[yytype
]);
1003 if (yytype
< YYNTOKENS
)
1004 YYPRINT (yyoutput
, yytoknum
[yytype
], *yyvaluep
);
1011 YYFPRINTF (yyoutput
, ")");
1014 #endif /* ! YYDEBUG */
1015 /*-----------------------------------------------.
1016 | Release the memory associated to this symbol. |
1017 `-----------------------------------------------*/
1019 #if defined (__STDC__) || defined (__cplusplus)
1021 yydestruct (const char *yymsg
, int yytype
, YYSTYPE
*yyvaluep
)
1024 yydestruct (yymsg
, yytype
, yyvaluep
)
1030 /* Pacify ``unused variable'' warnings. */
1035 YY_SYMBOL_PRINT (yymsg
, yytype
, yyvaluep
, yylocationp
);
1046 /* Prevent warnings from -Wmissing-prototypes. */
1048 #ifdef YYPARSE_PARAM
1049 # if defined (__STDC__) || defined (__cplusplus)
1050 int yyparse (void *YYPARSE_PARAM
);
1054 #else /* ! YYPARSE_PARAM */
1055 #if defined (__STDC__) || defined (__cplusplus)
1060 #endif /* ! YYPARSE_PARAM */
1064 /* The look-ahead symbol. */
1067 /* The semantic value of the look-ahead symbol. */
1070 /* Number of syntax errors so far. */
1079 #ifdef YYPARSE_PARAM
1080 # if defined (__STDC__) || defined (__cplusplus)
1081 int yyparse (void *YYPARSE_PARAM
)
1083 int yyparse (YYPARSE_PARAM
)
1084 void *YYPARSE_PARAM
;
1086 #else /* ! YYPARSE_PARAM */
1087 #if defined (__STDC__) || defined (__cplusplus)
1101 /* Number of tokens to shift before error messages enabled. */
1103 /* Look-ahead token as an internal (translated) token number. */
1106 /* Three stacks and their tools:
1107 `yyss': related to states,
1108 `yyvs': related to semantic values,
1109 `yyls': related to locations.
1111 Refer to the stacks thru separate pointers, to allow yyoverflow
1112 to reallocate them elsewhere. */
1114 /* The state stack. */
1115 short int yyssa
[YYINITDEPTH
];
1116 short int *yyss
= yyssa
;
1119 /* The semantic value stack. */
1120 YYSTYPE yyvsa
[YYINITDEPTH
];
1121 YYSTYPE
*yyvs
= yyvsa
;
1126 #define YYPOPSTACK (yyvsp--, yyssp--)
1128 YYSIZE_T yystacksize
= YYINITDEPTH
;
1130 /* The variables used to return semantic value and location from the
1135 /* When reducing, the number of symbols on the RHS of the reduced
1139 YYDPRINTF ((stderr
, "Starting parse\n"));
1144 yychar
= YYEMPTY
; /* Cause a token to be read. */
1146 /* Initialize stack pointers.
1147 Waste one element of value and location stack
1148 so that they stay on the same level as the state stack.
1149 The wasted elements are never initialized. */
1156 /*------------------------------------------------------------.
1157 | yynewstate -- Push a new state, which is found in yystate. |
1158 `------------------------------------------------------------*/
1160 /* In all cases, when you get here, the value and location stacks
1161 have just been pushed. so pushing a state here evens the stacks.
1168 if (yyss
+ yystacksize
- 1 <= yyssp
)
1170 /* Get the current used size of the three stacks, in elements. */
1171 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
1175 /* Give user a chance to reallocate the stack. Use copies of
1176 these so that the &'s don't force the real ones into
1178 YYSTYPE
*yyvs1
= yyvs
;
1179 short int *yyss1
= yyss
;
1182 /* Each stack pointer address is followed by the size of the
1183 data in use in that stack, in bytes. This used to be a
1184 conditional around just the two extra args, but that might
1185 be undefined if yyoverflow is a macro. */
1186 yyoverflow (YY_("memory exhausted"),
1187 &yyss1
, yysize
* sizeof (*yyssp
),
1188 &yyvs1
, yysize
* sizeof (*yyvsp
),
1195 #else /* no yyoverflow */
1196 # ifndef YYSTACK_RELOCATE
1197 goto yyexhaustedlab
;
1199 /* Extend the stack our own way. */
1200 if (YYMAXDEPTH
<= yystacksize
)
1201 goto yyexhaustedlab
;
1203 if (YYMAXDEPTH
< yystacksize
)
1204 yystacksize
= YYMAXDEPTH
;
1207 short int *yyss1
= yyss
;
1208 union yyalloc
*yyptr
=
1209 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
1211 goto yyexhaustedlab
;
1212 YYSTACK_RELOCATE (yyss
);
1213 YYSTACK_RELOCATE (yyvs
);
1215 # undef YYSTACK_RELOCATE
1217 YYSTACK_FREE (yyss1
);
1220 #endif /* no yyoverflow */
1222 yyssp
= yyss
+ yysize
- 1;
1223 yyvsp
= yyvs
+ yysize
- 1;
1226 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
1227 (unsigned long int) yystacksize
));
1229 if (yyss
+ yystacksize
- 1 <= yyssp
)
1233 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
1242 /* Do appropriate processing given the current state. */
1243 /* Read a look-ahead token if we need one and don't already have one. */
1246 /* First try to decide what to do without reference to look-ahead token. */
1248 yyn
= yypact
[yystate
];
1249 if (yyn
== YYPACT_NINF
)
1252 /* Not known => get a look-ahead token if don't already have one. */
1254 /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
1255 if (yychar
== YYEMPTY
)
1257 YYDPRINTF ((stderr
, "Reading a token: "));
1261 if (yychar
<= YYEOF
)
1263 yychar
= yytoken
= YYEOF
;
1264 YYDPRINTF ((stderr
, "Now at end of input.\n"));
1268 yytoken
= YYTRANSLATE (yychar
);
1269 YY_SYMBOL_PRINT ("Next token is", yytoken
, &yylval
, &yylloc
);
1272 /* If the proper action on seeing token YYTOKEN is to reduce or to
1273 detect an error, take that action. */
1275 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yytoken
)
1280 if (yyn
== 0 || yyn
== YYTABLE_NINF
)
1289 /* Shift the look-ahead token. */
1290 YY_SYMBOL_PRINT ("Shifting", yytoken
, &yylval
, &yylloc
);
1292 /* Discard the token being shifted unless it is eof. */
1293 if (yychar
!= YYEOF
)
1299 /* Count tokens shifted since error; after three, turn off error
1308 /*-----------------------------------------------------------.
1309 | yydefault -- do the default action for the current state. |
1310 `-----------------------------------------------------------*/
1312 yyn
= yydefact
[yystate
];
1318 /*-----------------------------.
1319 | yyreduce -- Do a reduction. |
1320 `-----------------------------*/
1322 /* yyn is the number of a rule to reduce with. */
1325 /* If YYLEN is nonzero, implement the default value of the action:
1328 Otherwise, the following line sets YYVAL to garbage.
1329 This behavior is undocumented and Bison
1330 users should not rely upon it. Assigning to YYVAL
1331 unconditionally makes the parser a bit smaller, and it avoids a
1332 GCC warning that YYVAL may be used uninitialized. */
1333 yyval
= yyvsp
[1-yylen
];
1336 YY_REDUCE_PRINT (yyn
);
1340 #line 123 "m68k-parse.y"
1342 op
->trailing_ampersand
= (yyvsp
[0].trailing_ampersand
);
1347 #line 127 "m68k-parse.y"
1349 op
->trailing_ampersand
= (yyvsp
[0].trailing_ampersand
);
1354 #line 135 "m68k-parse.y"
1355 { (yyval
.trailing_ampersand
) = 0; }
1359 #line 137 "m68k-parse.y"
1360 { (yyval
.trailing_ampersand
) = 1; }
1364 #line 144 "m68k-parse.y"
1371 #line 149 "m68k-parse.y"
1378 #line 154 "m68k-parse.y"
1381 op
->reg
= (yyvsp
[0].reg
);
1386 #line 159 "m68k-parse.y"
1389 op
->reg
= (yyvsp
[0].reg
);
1394 #line 164 "m68k-parse.y"
1397 op
->reg
= (yyvsp
[0].reg
);
1402 #line 169 "m68k-parse.y"
1405 op
->reg
= (yyvsp
[0].reg
);
1410 #line 174 "m68k-parse.y"
1413 op
->reg
= (yyvsp
[0].reg
);
1418 #line 179 "m68k-parse.y"
1421 op
->disp
= (yyvsp
[0].exp
);
1426 #line 184 "m68k-parse.y"
1429 op
->disp
= (yyvsp
[0].exp
);
1434 #line 189 "m68k-parse.y"
1437 op
->disp
= (yyvsp
[0].exp
);
1442 #line 194 "m68k-parse.y"
1445 op
->mask
= (yyvsp
[0].mask
);
1450 #line 207 "m68k-parse.y"
1453 op
->reg
= (yyvsp
[-1].reg
);
1458 #line 212 "m68k-parse.y"
1461 op
->reg
= (yyvsp
[-2].reg
);
1466 #line 217 "m68k-parse.y"
1469 op
->reg
= (yyvsp
[-1].reg
);
1474 #line 222 "m68k-parse.y"
1476 op
->reg
= (yyvsp
[-1].reg
);
1477 op
->disp
= (yyvsp
[-3].exp
);
1478 if (((yyvsp
[-1].reg
) >= ZADDR0
&& (yyvsp
[-1].reg
) <= ZADDR7
)
1479 || (yyvsp
[-1].reg
) == ZPC
)
1487 #line 232 "m68k-parse.y"
1489 op
->reg
= (yyvsp
[-3].reg
);
1490 op
->disp
= (yyvsp
[-1].exp
);
1491 if (((yyvsp
[-3].reg
) >= ZADDR0
&& (yyvsp
[-3].reg
) <= ZADDR7
)
1492 || (yyvsp
[-3].reg
) == ZPC
)
1500 #line 242 "m68k-parse.y"
1502 op
->reg
= (yyvsp
[-1].reg
);
1503 op
->disp
= (yyvsp
[-3].exp
);
1504 if (((yyvsp
[-1].reg
) >= ZADDR0
&& (yyvsp
[-1].reg
) <= ZADDR7
)
1505 || (yyvsp
[-1].reg
) == ZPC
)
1513 #line 252 "m68k-parse.y"
1516 op
->reg
= (yyvsp
[-1].reg
);
1521 #line 257 "m68k-parse.y"
1524 op
->reg
= (yyvsp
[-1].reg
);
1529 #line 262 "m68k-parse.y"
1532 op
->reg
= (yyvsp
[-1].reg
);
1537 #line 267 "m68k-parse.y"
1540 op
->reg
= (yyvsp
[-3].reg
);
1541 op
->disp
= (yyvsp
[-5].exp
);
1542 op
->index
= (yyvsp
[-1].indexreg
);
1547 #line 274 "m68k-parse.y"
1549 if ((yyvsp
[-3].reg
) == PC
|| (yyvsp
[-3].reg
) == ZPC
)
1550 yyerror (_("syntax error"));
1552 op
->reg
= (yyvsp
[-1].reg
);
1553 op
->disp
= (yyvsp
[-5].exp
);
1554 op
->index
.reg
= (yyvsp
[-3].reg
);
1555 op
->index
.size
= SIZE_UNSPEC
;
1556 op
->index
.scale
= 1;
1561 #line 285 "m68k-parse.y"
1564 op
->reg
= (yyvsp
[-1].reg
);
1565 op
->disp
= (yyvsp
[-4].exp
);
1566 op
->index
= (yyvsp
[-2].indexreg
);
1571 #line 292 "m68k-parse.y"
1574 op
->disp
= (yyvsp
[-1].exp
);
1575 op
->index
= (yyvsp
[-3].indexreg
);
1580 #line 298 "m68k-parse.y"
1583 op
->reg
= (yyvsp
[-3].reg
);
1584 op
->disp
= (yyvsp
[-5].exp
);
1585 op
->index
= (yyvsp
[-1].indexreg
);
1590 #line 305 "m68k-parse.y"
1593 op
->reg
= (yyvsp
[-3].reg
);
1594 op
->index
= (yyvsp
[-1].indexreg
);
1599 #line 311 "m68k-parse.y"
1601 if ((yyvsp
[-3].reg
) == PC
|| (yyvsp
[-3].reg
) == ZPC
)
1602 yyerror (_("syntax error"));
1604 op
->reg
= (yyvsp
[-1].reg
);
1605 op
->disp
= (yyvsp
[-5].exp
);
1606 op
->index
.reg
= (yyvsp
[-3].reg
);
1607 op
->index
.size
= SIZE_UNSPEC
;
1608 op
->index
.scale
= 1;
1613 #line 322 "m68k-parse.y"
1615 if ((yyvsp
[-3].reg
) == PC
|| (yyvsp
[-3].reg
) == ZPC
)
1616 yyerror (_("syntax error"));
1618 op
->reg
= (yyvsp
[-1].reg
);
1619 op
->index
.reg
= (yyvsp
[-3].reg
);
1620 op
->index
.size
= SIZE_UNSPEC
;
1621 op
->index
.scale
= 1;
1626 #line 332 "m68k-parse.y"
1629 op
->reg
= (yyvsp
[-1].reg
);
1630 op
->disp
= (yyvsp
[-4].exp
);
1631 op
->index
= (yyvsp
[-2].indexreg
);
1636 #line 339 "m68k-parse.y"
1639 op
->reg
= (yyvsp
[-1].reg
);
1640 op
->index
= (yyvsp
[-2].indexreg
);
1645 #line 345 "m68k-parse.y"
1648 op
->reg
= (yyvsp
[-5].reg
);
1649 op
->disp
= (yyvsp
[-6].exp
);
1650 op
->index
= (yyvsp
[-2].indexreg
);
1651 op
->odisp
= (yyvsp
[-1].exp
);
1656 #line 353 "m68k-parse.y"
1659 op
->reg
= (yyvsp
[-3].reg
);
1660 op
->disp
= (yyvsp
[-4].exp
);
1661 op
->odisp
= (yyvsp
[-1].exp
);
1666 #line 360 "m68k-parse.y"
1669 op
->reg
= (yyvsp
[-5].reg
);
1670 op
->index
= (yyvsp
[-2].indexreg
);
1671 op
->odisp
= (yyvsp
[-1].exp
);
1676 #line 367 "m68k-parse.y"
1679 op
->reg
= (yyvsp
[-3].reg
);
1680 op
->odisp
= (yyvsp
[-1].exp
);
1685 #line 373 "m68k-parse.y"
1688 op
->reg
= (yyvsp
[-5].reg
);
1689 op
->disp
= (yyvsp
[-7].exp
);
1690 op
->index
= (yyvsp
[-3].indexreg
);
1691 op
->odisp
= (yyvsp
[-1].exp
);
1696 #line 381 "m68k-parse.y"
1699 op
->reg
= (yyvsp
[-5].reg
);
1700 op
->index
= (yyvsp
[-3].indexreg
);
1701 op
->odisp
= (yyvsp
[-1].exp
);
1706 #line 388 "m68k-parse.y"
1708 if ((yyvsp
[-5].reg
) == PC
|| (yyvsp
[-5].reg
) == ZPC
)
1709 yyerror (_("syntax error"));
1711 op
->reg
= (yyvsp
[-3].reg
);
1712 op
->disp
= (yyvsp
[-7].exp
);
1713 op
->index
.reg
= (yyvsp
[-5].reg
);
1714 op
->index
.size
= SIZE_UNSPEC
;
1715 op
->index
.scale
= 1;
1716 op
->odisp
= (yyvsp
[-1].exp
);
1721 #line 400 "m68k-parse.y"
1723 if ((yyvsp
[-5].reg
) == PC
|| (yyvsp
[-5].reg
) == ZPC
)
1724 yyerror (_("syntax error"));
1726 op
->reg
= (yyvsp
[-3].reg
);
1727 op
->index
.reg
= (yyvsp
[-5].reg
);
1728 op
->index
.size
= SIZE_UNSPEC
;
1729 op
->index
.scale
= 1;
1730 op
->odisp
= (yyvsp
[-1].exp
);
1735 #line 411 "m68k-parse.y"
1738 op
->reg
= (yyvsp
[-3].reg
);
1739 op
->disp
= (yyvsp
[-5].exp
);
1740 op
->index
= (yyvsp
[-4].indexreg
);
1741 op
->odisp
= (yyvsp
[-1].exp
);
1746 #line 424 "m68k-parse.y"
1748 /* We use optzapc to avoid a shift/reduce conflict. */
1749 if ((yyvsp
[-1].reg
) < ADDR0
|| (yyvsp
[-1].reg
) > ADDR7
)
1750 yyerror (_("syntax error"));
1752 op
->reg
= (yyvsp
[-1].reg
);
1757 #line 432 "m68k-parse.y"
1759 /* We use optzapc to avoid a shift/reduce conflict. */
1760 if ((yyvsp
[-2].reg
) < ADDR0
|| (yyvsp
[-2].reg
) > ADDR7
)
1761 yyerror (_("syntax error"));
1763 op
->reg
= (yyvsp
[-2].reg
);
1768 #line 440 "m68k-parse.y"
1770 /* We use optzapc to avoid a shift/reduce conflict. */
1771 if ((yyvsp
[-2].reg
) < ADDR0
|| (yyvsp
[-2].reg
) > ADDR7
)
1772 yyerror (_("syntax error"));
1774 op
->reg
= (yyvsp
[-2].reg
);
1779 #line 448 "m68k-parse.y"
1781 op
->reg
= (yyvsp
[-4].reg
);
1782 op
->disp
= (yyvsp
[-1].exp
);
1783 if (((yyvsp
[-4].reg
) >= ZADDR0
&& (yyvsp
[-4].reg
) <= ZADDR7
)
1784 || (yyvsp
[-4].reg
) == ZPC
)
1792 #line 458 "m68k-parse.y"
1795 op
->reg
= (yyvsp
[-5].reg
);
1796 op
->disp
= (yyvsp
[-2].exp
);
1797 op
->index
= (yyvsp
[-1].indexreg
);
1802 #line 465 "m68k-parse.y"
1805 op
->reg
= (yyvsp
[-9].reg
);
1806 op
->disp
= (yyvsp
[-6].exp
);
1807 op
->index
= (yyvsp
[-1].indexreg
);
1808 op
->odisp
= (yyvsp
[-2].exp
);
1813 #line 473 "m68k-parse.y"
1816 op
->reg
= (yyvsp
[-8].reg
);
1817 op
->disp
= (yyvsp
[-5].exp
);
1818 op
->odisp
= (yyvsp
[-1].exp
);
1823 #line 480 "m68k-parse.y"
1826 op
->reg
= (yyvsp
[-9].reg
);
1827 op
->disp
= (yyvsp
[-6].exp
);
1828 op
->index
= (yyvsp
[-5].indexreg
);
1829 op
->odisp
= (yyvsp
[-1].exp
);
1834 #line 495 "m68k-parse.y"
1836 (yyval
.indexreg
).reg
= (yyvsp
[0].reg
);
1837 (yyval
.indexreg
).size
= SIZE_UNSPEC
;
1838 (yyval
.indexreg
).scale
= 1;
1843 #line 509 "m68k-parse.y"
1845 (yyval
.indexreg
).reg
= (yyvsp
[0].reg
);
1846 (yyval
.indexreg
).size
= SIZE_UNSPEC
;
1847 (yyval
.indexreg
).scale
= 1;
1852 #line 552 "m68k-parse.y"
1854 (yyval
.reg
) = ZADDR0
;
1859 #line 569 "m68k-parse.y"
1861 (yyval
.reg
) = ZADDR0
;
1866 #line 573 "m68k-parse.y"
1868 (yyval
.reg
) = (yyvsp
[0].reg
);
1873 #line 582 "m68k-parse.y"
1875 (yyval
.exp
).exp
.X_op
= O_absent
;
1876 (yyval
.exp
).size
= SIZE_UNSPEC
;
1881 #line 587 "m68k-parse.y"
1883 (yyval
.exp
) = (yyvsp
[0].exp
);
1888 #line 596 "m68k-parse.y"
1890 (yyval
.exp
).exp
.X_op
= O_absent
;
1891 (yyval
.exp
).size
= SIZE_UNSPEC
;
1896 #line 601 "m68k-parse.y"
1898 (yyval
.exp
) = (yyvsp
[-1].exp
);
1903 #line 611 "m68k-parse.y"
1905 (yyval
.mask
) = (yyvsp
[-2].mask
) | (yyvsp
[0].mask
);
1910 #line 615 "m68k-parse.y"
1912 (yyval
.mask
) = (1 << (yyvsp
[-2].onereg
)) | (yyvsp
[0].mask
);
1917 #line 627 "m68k-parse.y"
1919 (yyval
.mask
) = 1 << (yyvsp
[0].onereg
);
1924 #line 632 "m68k-parse.y"
1926 (yyval
.mask
) = (yyvsp
[-2].mask
) | (yyvsp
[0].mask
);
1931 #line 636 "m68k-parse.y"
1933 (yyval
.mask
) = (1 << (yyvsp
[-2].onereg
)) | (yyvsp
[0].mask
);
1938 #line 643 "m68k-parse.y"
1940 if ((yyvsp
[-2].onereg
) <= (yyvsp
[0].onereg
))
1941 (yyval
.mask
) = (1 << ((yyvsp
[0].onereg
) + 1)) - 1 - ((1 << (yyvsp
[-2].onereg
)) - 1);
1943 (yyval
.mask
) = (1 << ((yyvsp
[-2].onereg
) + 1)) - 1 - ((1 << (yyvsp
[0].onereg
)) - 1);
1948 #line 653 "m68k-parse.y"
1950 (yyval
.onereg
) = (yyvsp
[0].reg
) - DATA0
;
1955 #line 657 "m68k-parse.y"
1957 (yyval
.onereg
) = (yyvsp
[0].reg
) - ADDR0
+ 8;
1962 #line 661 "m68k-parse.y"
1964 (yyval
.onereg
) = (yyvsp
[0].reg
) - FP0
+ 16;
1969 #line 665 "m68k-parse.y"
1971 if ((yyvsp
[0].reg
) == FPI
)
1972 (yyval
.onereg
) = 24;
1973 else if ((yyvsp
[0].reg
) == FPS
)
1974 (yyval
.onereg
) = 25;
1976 (yyval
.onereg
) = 26;
1984 /* Line 1126 of yacc.c. */
1985 #line 1986 "m68k-parse.c"
1991 YY_STACK_PRINT (yyss
, yyssp
);
1996 /* Now `shift' the result of the reduction. Determine what state
1997 that goes to, based on the state we popped back to and the rule
1998 number reduced by. */
2002 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
2003 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
2004 yystate
= yytable
[yystate
];
2006 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
2011 /*------------------------------------.
2012 | yyerrlab -- here on detecting error |
2013 `------------------------------------*/
2015 /* If not already recovering from an error, report this error. */
2020 yyn
= yypact
[yystate
];
2022 if (YYPACT_NINF
< yyn
&& yyn
< YYLAST
)
2024 int yytype
= YYTRANSLATE (yychar
);
2025 YYSIZE_T yysize0
= yytnamerr (0, yytname
[yytype
]);
2026 YYSIZE_T yysize
= yysize0
;
2028 int yysize_overflow
= 0;
2030 # define YYERROR_VERBOSE_ARGS_MAXIMUM 5
2031 char const *yyarg
[YYERROR_VERBOSE_ARGS_MAXIMUM
];
2035 /* This is so xgettext sees the translatable formats that are
2036 constructed on the fly. */
2037 YY_("syntax error, unexpected %s");
2038 YY_("syntax error, unexpected %s, expecting %s");
2039 YY_("syntax error, unexpected %s, expecting %s or %s");
2040 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
2041 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
2045 static char const yyunexpected
[] = "syntax error, unexpected %s";
2046 static char const yyexpecting
[] = ", expecting %s";
2047 static char const yyor
[] = " or %s";
2048 char yyformat
[sizeof yyunexpected
2049 + sizeof yyexpecting
- 1
2050 + ((YYERROR_VERBOSE_ARGS_MAXIMUM
- 2)
2051 * (sizeof yyor
- 1))];
2052 char const *yyprefix
= yyexpecting
;
2054 /* Start YYX at -YYN if negative to avoid negative indexes in
2056 int yyxbegin
= yyn
< 0 ? -yyn
: 0;
2058 /* Stay within bounds of both yycheck and yytname. */
2059 int yychecklim
= YYLAST
- yyn
;
2060 int yyxend
= yychecklim
< YYNTOKENS
? yychecklim
: YYNTOKENS
;
2063 yyarg
[0] = yytname
[yytype
];
2064 yyfmt
= yystpcpy (yyformat
, yyunexpected
);
2066 for (yyx
= yyxbegin
; yyx
< yyxend
; ++yyx
)
2067 if (yycheck
[yyx
+ yyn
] == yyx
&& yyx
!= YYTERROR
)
2069 if (yycount
== YYERROR_VERBOSE_ARGS_MAXIMUM
)
2073 yyformat
[sizeof yyunexpected
- 1] = '\0';
2076 yyarg
[yycount
++] = yytname
[yyx
];
2077 yysize1
= yysize
+ yytnamerr (0, yytname
[yyx
]);
2078 yysize_overflow
|= yysize1
< yysize
;
2080 yyfmt
= yystpcpy (yyfmt
, yyprefix
);
2084 yyf
= YY_(yyformat
);
2085 yysize1
= yysize
+ yystrlen (yyf
);
2086 yysize_overflow
|= yysize1
< yysize
;
2089 if (!yysize_overflow
&& yysize
<= YYSTACK_ALLOC_MAXIMUM
)
2090 yymsg
= (char *) YYSTACK_ALLOC (yysize
);
2093 /* Avoid sprintf, as that infringes on the user's name space.
2094 Don't have undefined behavior even if the translation
2095 produced a string with the wrong number of "%s"s. */
2098 while ((*yyp
= *yyf
))
2100 if (*yyp
== '%' && yyf
[1] == 's' && yyi
< yycount
)
2102 yyp
+= yytnamerr (yyp
, yyarg
[yyi
++]);
2112 YYSTACK_FREE (yymsg
);
2116 yyerror (YY_("syntax error"));
2117 goto yyexhaustedlab
;
2121 #endif /* YYERROR_VERBOSE */
2122 yyerror (YY_("syntax error"));
2127 if (yyerrstatus
== 3)
2129 /* If just tried and failed to reuse look-ahead token after an
2130 error, discard it. */
2132 if (yychar
<= YYEOF
)
2134 /* Return failure if at end of input. */
2135 if (yychar
== YYEOF
)
2140 yydestruct ("Error: discarding", yytoken
, &yylval
);
2145 /* Else will try to reuse look-ahead token after shifting the error
2150 /*---------------------------------------------------.
2151 | yyerrorlab -- error raised explicitly by YYERROR. |
2152 `---------------------------------------------------*/
2155 /* Pacify compilers like GCC when the user code never invokes
2156 YYERROR and the label yyerrorlab therefore never appears in user
2167 /*-------------------------------------------------------------.
2168 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2169 `-------------------------------------------------------------*/
2171 yyerrstatus
= 3; /* Each real token shifted decrements this. */
2175 yyn
= yypact
[yystate
];
2176 if (yyn
!= YYPACT_NINF
)
2179 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
2187 /* Pop the current state because it cannot handle the error token. */
2192 yydestruct ("Error: popping", yystos
[yystate
], yyvsp
);
2195 YY_STACK_PRINT (yyss
, yyssp
);
2204 /* Shift the error token. */
2205 YY_SYMBOL_PRINT ("Shifting", yystos
[yyn
], yyvsp
, yylsp
);
2211 /*-------------------------------------.
2212 | yyacceptlab -- YYACCEPT comes here. |
2213 `-------------------------------------*/
2218 /*-----------------------------------.
2219 | yyabortlab -- YYABORT comes here. |
2220 `-----------------------------------*/
2226 /*-------------------------------------------------.
2227 | yyexhaustedlab -- memory exhaustion comes here. |
2228 `-------------------------------------------------*/
2230 yyerror (YY_("memory exhausted"));
2236 if (yychar
!= YYEOF
&& yychar
!= YYEMPTY
)
2237 yydestruct ("Cleanup: discarding lookahead",
2239 while (yyssp
!= yyss
)
2241 yydestruct ("Cleanup: popping",
2242 yystos
[*yyssp
], yyvsp
);
2247 YYSTACK_FREE (yyss
);
2253 #line 675 "m68k-parse.y"
2256 /* The string to parse is stored here, and modified by yylex. */
2260 /* The original string pointer. */
2262 static char *strorig
;
2264 /* If *CCP could be a register, return the register number and advance
2265 *CCP. Otherwise don't change *CCP, and return 0. */
2267 static enum m68k_register
2268 m68k_reg_parse (ccp
)
2269 register char **ccp
;
2276 if (flag_reg_prefix_optional
)
2278 if (*start
== REGISTER_PREFIX
)
2284 if (*start
!= REGISTER_PREFIX
)
2289 if (! is_name_beginner (*p
))
2293 while (is_part_of_name (*p
) && *p
!= '.' && *p
!= ':' && *p
!= '*')
2298 symbolp
= symbol_find (start
);
2301 if (symbolp
!= NULL
&& S_GET_SEGMENT (symbolp
) == reg_section
)
2304 return S_GET_VALUE (symbolp
);
2307 /* In MRI mode, something like foo.bar can be equated to a register
2309 while (flag_mri
&& c
== '.')
2312 while (is_part_of_name (*p
) && *p
!= '.' && *p
!= ':' && *p
!= '*')
2316 symbolp
= symbol_find (start
);
2318 if (symbolp
!= NULL
&& S_GET_SEGMENT (symbolp
) == reg_section
)
2321 return S_GET_VALUE (symbolp
);
2333 enum m68k_register reg
;
2346 /* Various special characters are just returned directly. */
2350 /* In MRI mode, this can be the start of an octal number. */
2353 if (ISDIGIT (str
[1])
2354 || ((str
[1] == '+' || str
[1] == '-')
2355 && ISDIGIT (str
[2])))
2370 /* It so happens that a '+' can only appear at the end of an
2371 operand, or if it is trailed by an '&'(see mac load insn).
2372 If it appears anywhere else, it must be a unary. */
2373 if (str
[1] == '\0' || (str
[1] == '&' && str
[2] == '\0'))
2377 /* A '-' can only appear in -(ar), rn-rn, or ar@-. If it
2378 appears anywhere else, it must be a unary minus on an
2379 expression, unless it it trailed by a '&'(see mac load insn). */
2380 if (str
[1] == '\0' || (str
[1] == '&' && str
[2] == '\0'))
2385 if (m68k_reg_parse (&s
) != 0)
2389 /* A '(' can only appear in `(reg)', `(expr,...', `([', `@(', or
2390 `)('. If it appears anywhere else, it must be starting an
2395 || str
[-1] == ')')))
2398 if (m68k_reg_parse (&s
) != 0)
2400 /* Check for the case of '(expr,...' by scanning ahead. If we
2401 find a comma outside of balanced parentheses, we return '('.
2402 If we find an unbalanced right parenthesis, then presumably
2403 the '(' really starts an expression. */
2405 for (s
= str
+ 1; *s
!= '\0'; s
++)
2415 else if (*s
== ',' && parens
== 0)
2417 /* A comma can not normally appear in an expression, so
2418 this is a case of '(expr,...'. */
2424 /* See if it's a register. */
2426 reg
= m68k_reg_parse (&str
);
2433 if (reg
>= DATA0
&& reg
<= DATA7
)
2435 else if (reg
>= ADDR0
&& reg
<= ADDR7
)
2437 else if (reg
>= FP0
&& reg
<= FP7
)
2445 else if (reg
>= ZDATA0
&& reg
<= ZDATA7
)
2447 else if (reg
>= ZADDR0
&& reg
<= ZADDR7
)
2449 else if (reg
== ZPC
)
2454 /* If we get here, we have a data or address register. We
2455 must check for a size or scale; if we find one, we must
2460 if (*s
!= '.' && *s
!= ':' && *s
!= '*')
2463 yylval
.indexreg
.reg
= reg
;
2465 if (*s
!= '.' && *s
!= ':')
2466 yylval
.indexreg
.size
= SIZE_UNSPEC
;
2474 yylval
.indexreg
.size
= SIZE_WORD
;
2479 yylval
.indexreg
.size
= SIZE_LONG
;
2483 yyerror (_("illegal size specification"));
2484 yylval
.indexreg
.size
= SIZE_UNSPEC
;
2489 yylval
.indexreg
.scale
= 1;
2491 if (*s
== '*' || *s
== ':')
2497 hold
= input_line_pointer
;
2498 input_line_pointer
= s
;
2499 expression (&scale
);
2500 s
= input_line_pointer
;
2501 input_line_pointer
= hold
;
2503 if (scale
.X_op
!= O_constant
)
2504 yyerror (_("scale specification must resolve to a number"));
2507 switch (scale
.X_add_number
)
2513 yylval
.indexreg
.scale
= scale
.X_add_number
;
2516 yyerror (_("invalid scale value"));
2527 /* It must be an expression. Before we call expression, we need to
2528 look ahead to see if there is a size specification. We must do
2529 that first, because otherwise foo.l will be treated as the symbol
2530 foo.l, rather than as the symbol foo with a long size
2531 specification. The grammar requires that all expressions end at
2532 the end of the operand, or with ',', '(', ']', ')'. */
2535 for (s
= str
; *s
!= '\0'; s
++)
2541 && (s
[-1] == ')' || ISALNUM (s
[-1])))
2551 else if (parens
== 0
2552 && (*s
== ',' || *s
== ']'))
2556 yylval
.exp
.size
= SIZE_UNSPEC
;
2558 || (s
[-2] != '.' && s
[-2] != ':'))
2568 yylval
.exp
.size
= SIZE_BYTE
;
2572 yylval
.exp
.size
= SIZE_WORD
;
2576 yylval
.exp
.size
= SIZE_LONG
;
2581 if (yylval
.exp
.size
!= SIZE_UNSPEC
)
2587 /* Look for @PLTPC, etc. */
2590 yylval
.exp
.pic_reloc
= pic_none
;
2592 if (cp
- 6 > str
&& cp
[-6] == '@')
2594 if (strncmp (cp
- 6, "@PLTPC", 6) == 0)
2596 yylval
.exp
.pic_reloc
= pic_plt_pcrel
;
2599 else if (strncmp (cp
- 6, "@GOTPC", 6) == 0)
2601 yylval
.exp
.pic_reloc
= pic_got_pcrel
;
2605 else if (cp
- 4 > str
&& cp
[-4] == '@')
2607 if (strncmp (cp
- 4, "@PLT", 4) == 0)
2609 yylval
.exp
.pic_reloc
= pic_plt_off
;
2612 else if (strncmp (cp
- 4, "@GOT", 4) == 0)
2614 yylval
.exp
.pic_reloc
= pic_got_off
;
2627 hold
= input_line_pointer
;
2628 input_line_pointer
= str
;
2629 expression (&yylval
.exp
.exp
);
2630 str
= input_line_pointer
;
2631 input_line_pointer
= hold
;
2642 /* Parse an m68k operand. This is the only function which is called
2643 from outside this file. */
2646 m68k_ip_op (s
, oparg
)
2648 struct m68k_op
*oparg
;
2650 memset (oparg
, 0, sizeof *oparg
);
2651 oparg
->error
= NULL
;
2652 oparg
->index
.reg
= ZDATA0
;
2653 oparg
->index
.scale
= 1;
2654 oparg
->disp
.exp
.X_op
= O_absent
;
2655 oparg
->odisp
.exp
.X_op
= O_absent
;
2663 /* The error handler. */