1 /* A Bison parser, made from m68k-parse.y
4 #define YYBISON 1 /* Identify Bison output. */
18 #line 27 "m68k-parse.y"
23 #include "m68k-parse.h"
24 #include "safe-ctype.h"
26 /* Remap normal yacc parser interface names (yyparse, yylex, yyerror,
27 etc), as well as gratuitiously global symbol names If other parser
28 generators (bison, byacc, etc) produce additional global names that
29 conflict at link time, then those parser generators need to be
30 fixed instead of adding those names to this list. */
32 #define yymaxdepth m68k_maxdepth
33 #define yyparse m68k_parse
34 #define yylex m68k_lex
35 #define yyerror m68k_error
36 #define yylval m68k_lval
37 #define yychar m68k_char
38 #define yydebug m68k_debug
39 #define yypact m68k_pact
42 #define yydef m68k_def
43 #define yychk m68k_chk
44 #define yypgo m68k_pgo
45 #define yyact m68k_act
46 #define yyexca m68k_exca
47 #define yyerrflag m68k_errflag
48 #define yynerrs m68k_nerrs
52 #define yy_yys m68k_yys
53 #define yystate m68k_state
54 #define yytmp m68k_tmp
56 #define yy_yyv m68k_yyv
57 #define yyval m68k_val
58 #define yylloc m68k_lloc
59 #define yyreds m68k_reds /* With YYDEBUG defined */
60 #define yytoks m68k_toks /* With YYDEBUG defined */
61 #define yylhs m68k_yylhs
62 #define yylen m68k_yylen
63 #define yydefred m68k_yydefred
64 #define yydgoto m68k_yydgoto
65 #define yysindex m68k_yysindex
66 #define yyrindex m68k_yyrindex
67 #define yygindex m68k_yygindex
68 #define yytable m68k_yytable
69 #define yycheck m68k_yycheck
75 /* Internal functions. */
77 static enum m68k_register m68k_reg_parse
PARAMS ((char **));
78 static int yylex
PARAMS ((void));
79 static void yyerror
PARAMS ((const char *));
81 /* The parser sets fields pointed to by this global variable. */
82 static struct m68k_op
*op
;
85 #line 94 "m68k-parse.y"
89 struct m68k_indexreg indexreg
;
90 enum m68k_register reg
;
95 # define YYSTYPE yystype
104 #define YYFLAG -32768
107 /* YYTRANSLATE(YYLEX) -- Bison token number corresponding to YYLEX. */
108 #define YYTRANSLATE(x) ((unsigned)(x) <= 267 ? yytranslate[x] : 44)
110 /* YYTRANSLATE[YYLEX] -- Bison token number corresponding to YYLEX. */
111 static const char yytranslate
[] =
113 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
114 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
115 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
116 2, 2, 2, 2, 2, 14, 2, 2, 15, 2,
117 16, 17, 2, 18, 20, 19, 2, 24, 2, 2,
118 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
119 2, 2, 2, 2, 23, 2, 2, 2, 2, 2,
120 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
121 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
122 2, 21, 2, 22, 2, 2, 2, 2, 2, 2,
123 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
124 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
125 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
126 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
127 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
128 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
129 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
130 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
131 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
132 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
133 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
134 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
135 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
136 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
137 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
138 2, 2, 2, 2, 2, 2, 1, 3, 4, 5,
139 6, 7, 8, 9, 10, 11, 12, 13
143 static const short yyprhs
[] =
145 0, 0, 2, 4, 6, 8, 10, 12, 14, 16,
146 18, 21, 24, 26, 30, 35, 40, 46, 52, 57,
147 61, 65, 69, 77, 85, 92, 98, 105, 111, 118,
148 124, 130, 135, 145, 153, 162, 169, 180, 189, 200,
149 209, 218, 221, 225, 229, 235, 242, 253, 263, 274,
150 276, 278, 280, 282, 284, 286, 288, 290, 292, 294,
151 296, 298, 300, 302, 303, 305, 307, 309, 310, 313,
152 314, 317, 318, 321, 323, 327, 331, 333, 335, 339,
153 343, 347, 349, 351, 353
155 static const short yyrhs
[] =
157 26, 0, 27, 0, 28, 0, 3, 0, 4, 0,
158 5, 0, 6, 0, 11, 0, 13, 0, 14, 13,
159 0, 15, 13, 0, 40, 0, 16, 4, 17, 0,
160 16, 4, 17, 18, 0, 19, 16, 4, 17, 0,
161 16, 13, 20, 34, 17, 0, 16, 34, 20, 13,
162 17, 0, 13, 16, 34, 17, 0, 16, 7, 17,
163 0, 16, 8, 17, 0, 16, 10, 17, 0, 16,
164 13, 20, 34, 20, 29, 17, 0, 16, 13, 20,
165 34, 20, 36, 17, 0, 16, 13, 20, 30, 37,
166 17, 0, 16, 30, 20, 13, 17, 0, 13, 16,
167 34, 20, 29, 17, 0, 16, 34, 20, 29, 17,
168 0, 13, 16, 34, 20, 36, 17, 0, 16, 34,
169 20, 36, 17, 0, 13, 16, 30, 37, 17, 0,
170 16, 30, 37, 17, 0, 16, 21, 13, 37, 22,
171 20, 29, 38, 17, 0, 16, 21, 13, 37, 22,
172 38, 17, 0, 16, 21, 34, 22, 20, 29, 38,
173 17, 0, 16, 21, 34, 22, 38, 17, 0, 16,
174 21, 13, 20, 34, 20, 29, 22, 38, 17, 0,
175 16, 21, 34, 20, 29, 22, 38, 17, 0, 16,
176 21, 13, 20, 34, 20, 36, 22, 38, 17, 0,
177 16, 21, 34, 20, 36, 22, 38, 17, 0, 16,
178 21, 39, 30, 37, 22, 38, 17, 0, 35, 23,
179 0, 35, 23, 18, 0, 35, 23, 19, 0, 35,
180 23, 16, 13, 17, 0, 35, 23, 16, 39, 29,
181 17, 0, 35, 23, 16, 13, 17, 23, 16, 39,
182 29, 17, 0, 35, 23, 16, 13, 17, 23, 16,
183 13, 17, 0, 35, 23, 16, 39, 29, 17, 23,
184 16, 13, 17, 0, 12, 0, 31, 0, 12, 0,
185 32, 0, 32, 0, 4, 0, 8, 0, 3, 0,
186 9, 0, 4, 0, 7, 0, 33, 0, 10, 0,
187 8, 0, 0, 34, 0, 7, 0, 10, 0, 0,
188 20, 34, 0, 0, 20, 13, 0, 0, 13, 20,
189 0, 42, 0, 42, 24, 41, 0, 43, 24, 41,
190 0, 43, 0, 42, 0, 42, 24, 41, 0, 43,
191 24, 41, 0, 43, 19, 43, 0, 3, 0, 4,
198 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
199 static const short yyrline
[] =
201 0, 117, 119, 120, 125, 131, 136, 141, 146, 151,
202 156, 161, 166, 178, 184, 189, 194, 204, 214, 224,
203 229, 234, 239, 246, 257, 264, 270, 277, 283, 294,
204 304, 311, 317, 325, 332, 339, 345, 353, 360, 372,
205 383, 395, 404, 412, 420, 430, 437, 445, 452, 465,
206 467, 479, 481, 492, 494, 495, 500, 502, 507, 509,
207 515, 517, 518, 523, 528, 533, 535, 540, 545, 553,
208 559, 567, 573, 581, 583, 587, 598, 603, 604, 608,
209 614, 624, 629, 633, 637
214 #if (YYDEBUG) || defined YYERROR_VERBOSE
216 /* YYTNAME[TOKEN_NUM] -- String name of the token TOKEN_NUM. */
217 static const char *const yytname
[] =
219 "$", "error", "$undefined.", "DR", "AR", "FPR", "FPCR", "LPC", "ZAR",
220 "ZDR", "LZPC", "CREG", "INDEXREG", "EXPR", "'#'", "'&'", "'('", "')'",
221 "'+'", "'-'", "','", "'['", "']'", "'@'", "'/'", "operand",
222 "generic_operand", "motorola_operand", "mit_operand", "zireg", "zdireg",
223 "zadr", "zdr", "apc", "zapc", "optzapc", "zpc", "optczapc", "optcexpr",
224 "optexprc", "reglist", "ireglist", "reglistpair", "reglistreg", NULL
228 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
229 static const short yyr1
[] =
231 0, 25, 25, 25, 26, 26, 26, 26, 26, 26,
232 26, 26, 26, 27, 27, 27, 27, 27, 27, 27,
233 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
234 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
235 27, 28, 28, 28, 28, 28, 28, 28, 28, 29,
236 29, 30, 30, 31, 31, 31, 32, 32, 33, 33,
237 34, 34, 34, 35, 35, 36, 36, 37, 37, 38,
238 38, 39, 39, 40, 40, 40, 41, 41, 41, 41,
242 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
243 static const short yyr2
[] =
245 0, 1, 1, 1, 1, 1, 1, 1, 1, 1,
246 2, 2, 1, 3, 4, 4, 5, 5, 4, 3,
247 3, 3, 7, 7, 6, 5, 6, 5, 6, 5,
248 5, 4, 9, 7, 8, 6, 10, 8, 10, 8,
249 8, 2, 3, 3, 5, 6, 10, 9, 10, 1,
250 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
251 1, 1, 1, 0, 1, 1, 1, 0, 2, 0,
252 2, 0, 2, 1, 3, 3, 1, 1, 3, 3,
256 /* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE
257 doesn't specify something else to do. Zero means the default is an
259 static const short yydefact
[] =
261 63, 81, 82, 83, 84, 59, 62, 61, 8, 9,
262 0, 0, 0, 0, 1, 2, 3, 60, 64, 0,
263 12, 73, 0, 0, 10, 11, 56, 58, 59, 62,
264 57, 61, 51, 0, 71, 67, 52, 0, 0, 41,
265 0, 0, 0, 58, 67, 0, 13, 19, 20, 21,
266 0, 67, 0, 0, 0, 0, 0, 0, 71, 42,
267 43, 81, 82, 83, 84, 74, 77, 76, 80, 75,
268 0, 0, 18, 0, 14, 67, 0, 72, 0, 0,
269 69, 67, 0, 68, 31, 54, 65, 55, 66, 49,
270 0, 0, 50, 53, 0, 15, 0, 0, 0, 0,
271 30, 0, 0, 0, 16, 0, 68, 69, 0, 0,
272 0, 0, 0, 25, 17, 27, 29, 44, 72, 0,
273 78, 79, 26, 28, 24, 0, 0, 0, 0, 0,
274 69, 69, 70, 69, 35, 69, 0, 45, 22, 23,
275 0, 0, 69, 33, 0, 0, 0, 0, 0, 71,
276 0, 69, 69, 0, 37, 39, 34, 40, 0, 0,
277 0, 0, 0, 32, 47, 0, 0, 36, 38, 46,
281 static const short yydefgoto
[] =
283 171, 14, 15, 16, 91, 35, 92, 93, 17, 83,
284 19, 94, 55, 111, 53, 20, 65, 66, 67
287 static const short yypact
[] =
289 89, 10, 11, 19, 23,-32768,-32768,-32768,-32768, 13,
290 -4, 22, 57, 36,-32768,-32768,-32768,-32768,-32768, 18,
291 -32768, 33, -2, 114,-32768,-32768,-32768, 46, 62, 66,
292 -32768, 67,-32768, 68, 131, 69,-32768, 70, 105, 147,
293 156, 156, 156,-32768, 94, 25, 101,-32768,-32768,-32768,
294 114, 100, 53, 9, 138, 108, 103, 112, 117,-32768,
295 -32768,-32768,-32768,-32768,-32768,-32768, 119, 12,-32768,-32768,
296 64, 130,-32768, 124,-32768, 94, 81, 64, 135, 124,
297 132, 94, 150,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
298 151, 152,-32768,-32768, 153,-32768, 120, 146, 156, 156,
299 -32768, 154, 155, 157,-32768, 124, 144, 158, 159, 160,
300 73, 162, 161,-32768,-32768,-32768,-32768, 163,-32768, 167,
301 -32768,-32768,-32768,-32768,-32768, 168, 170, 124, 73, 171,
302 169, 169,-32768, 169,-32768, 169, 164, 172,-32768,-32768,
303 174, 175, 169,-32768, 177, 176, 181, 182, 183, 178,
304 185, 169, 169, 186,-32768,-32768,-32768,-32768, 136, 146,
305 179, 187, 188,-32768,-32768, 189, 190,-32768,-32768,-32768,
306 -32768, 173, 194,-32768
309 static const short yypgoto
[] =
311 -32768,-32768,-32768,-32768, -72, 1,-32768, -7,-32768, 3,
312 -32768, -65, -31, -103, -58,-32768, -40, 202, 6
319 static const short yytable
[] =
321 97, 101, 69, 18, 129, 36, 22, 108, 102, 24,
322 -4, -5, 26, 71, 109, 37, 36, 41, 30, -6,
323 78, 32, 42, -7, 44, 119, 45, 145, 146, 23,
324 147, 41, 148, 125, -58, 25, 99, 52, 133, 153,
325 126, 39, 72, 36, 103, 73, 36, 68, 161, 162,
326 112, 75, 38, 76, 81, 140, 142, 40, 120, 121,
327 26, 27, 141, 46, 28, 29, 30, 31, 43, 32,
328 33, 5, 6, 79, 7, 80, 26, 85, 34, 47,
329 106, 87, 30, 48, 49, 89, 132, 165, 50, 54,
330 56, 159, 1, 2, 3, 4, 5, 6, 104, 7,
331 8, 105, 9, 10, 11, 12, 26, 85, 13, 57,
332 86, 87, 30, 88, 70, 89, 90, 26, 43, 74,
333 77, 5, 6, 30, 7, 84, 32, 26, 85, 95,
334 96, 86, 87, 30, 88, 43, 89, 117, 5, 6,
335 118, 7, 43, 98, 51, 5, 6, 100, 7, 26,
336 85, 82, 110, 164, 87, 30, 118, 107, 89, 61,
337 62, 63, 64, 58, 127, 59, 60, 113, 114, 115,
338 116, 122, 123, 172, 124, 0, 0, 0, 128, 134,
339 149, 130, 131, 135, 137, 138, 136, 139, 143, 144,
340 132, 158, 166, 154, 173, 150, 151, 152, 155, 156,
341 157, 160, 21, 163, 167, 168, 169, 170
344 static const short yycheck
[] =
346 58, 73, 42, 0, 107, 12, 0, 79, 73, 13,
347 0, 0, 3, 44, 79, 12, 23, 19, 9, 0,
348 51, 12, 24, 0, 23, 97, 23, 130, 131, 16,
349 133, 19, 135, 105, 23, 13, 24, 34, 110, 142,
350 105, 23, 17, 50, 75, 20, 53, 41, 151, 152,
351 81, 50, 16, 50, 53, 127, 128, 24, 98, 99,
352 3, 4, 127, 17, 7, 8, 9, 10, 4, 12,
353 13, 7, 8, 20, 10, 22, 3, 4, 21, 17,
354 77, 8, 9, 17, 17, 12, 13, 159, 20, 20,
355 20, 149, 3, 4, 5, 6, 7, 8, 17, 10,
356 11, 20, 13, 14, 15, 16, 3, 4, 19, 4,
357 7, 8, 9, 10, 20, 12, 13, 3, 4, 18,
358 20, 7, 8, 9, 10, 17, 12, 3, 4, 17,
359 13, 7, 8, 9, 10, 4, 12, 17, 7, 8,
360 20, 10, 4, 24, 13, 7, 8, 17, 10, 3,
361 4, 13, 20, 17, 8, 9, 20, 22, 12, 3,
362 4, 5, 6, 16, 20, 18, 19, 17, 17, 17,
363 17, 17, 17, 0, 17, -1, -1, -1, 20, 17,
364 16, 22, 22, 22, 17, 17, 23, 17, 17, 20,
365 13, 13, 13, 17, 0, 23, 22, 22, 17, 17,
366 17, 16, 0, 17, 17, 17, 17, 17
368 /* -*-C-*- Note some compilers choke on comments on `#line' lines. */
369 #line 3 "/usr/share/bison/bison.simple"
371 /* Skeleton output parser for bison,
373 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software
376 This program is free software; you can redistribute it and/or modify
377 it under the terms of the GNU General Public License as published by
378 the Free Software Foundation; either version 2, or (at your option)
381 This program is distributed in the hope that it will be useful,
382 but WITHOUT ANY WARRANTY; without even the implied warranty of
383 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
384 GNU General Public License for more details.
386 You should have received a copy of the GNU General Public License
387 along with this program; if not, write to the Free Software
388 Foundation, Inc., 59 Temple Place - Suite 330,
389 Boston, MA 02111-1307, USA. */
391 /* As a special exception, when this file is copied by Bison into a
392 Bison output file, you may use that output file without restriction.
393 This special exception was added by the Free Software Foundation
394 in version 1.24 of Bison. */
396 /* This is the parser code that is written into each bison parser when
397 the %semantic_parser declaration is not specified in the grammar.
398 It was written by Richard Stallman by simplifying the hairy parser
399 used when %semantic_parser is specified. */
401 /* All symbols defined below should begin with yy or YY, to avoid
402 infringing on user name space. This should be done even for local
403 variables, as they might otherwise be expanded by user macros.
404 There are some unavoidable exceptions within include files to
405 define necessary library symbols; they are noted "INFRINGES ON
406 USER NAME SPACE" below. */
409 # define YYSTD(x) std::x
414 #if ! defined (yyoverflow) || defined (YYERROR_VERBOSE)
416 /* The parser invokes alloca or malloc; define the necessary symbols. */
418 # if YYSTACK_USE_ALLOCA
419 # define YYSTACK_ALLOC alloca
421 # ifndef YYSTACK_USE_ALLOCA
422 # if defined (alloca) || defined (_ALLOCA_H)
423 # define YYSTACK_ALLOC alloca
426 # define YYSTACK_ALLOC __builtin_alloca
432 # ifdef YYSTACK_ALLOC
433 /* Pacify GCC's `empty if-body' warning. */
434 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
437 # include <cstdlib> /* INFRINGES ON USER NAME SPACE */
438 # define YYSIZE_T std::size_t
441 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
442 # define YYSIZE_T size_t
445 # define YYSTACK_ALLOC YYSTD (malloc)
446 # define YYSTACK_FREE YYSTD (free)
449 /* A type that is properly aligned for any stack member. */
459 /* The size of the maximum gap between one aligned stack and the next. */
460 # define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1)
462 /* The size of an array large to enough to hold all stacks, each with
465 # define YYSTACK_BYTES(N) \
466 ((N) * (sizeof (short) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
467 + 2 * YYSTACK_GAP_MAX)
469 # define YYSTACK_BYTES(N) \
470 ((N) * (sizeof (short) + sizeof (YYSTYPE)) \
474 /* Relocate the TYPE STACK from its old location to the new one. The
475 local variables YYSIZE and YYSTACKSIZE give the old and new number of
476 elements in the stack, and YYPTR gives the new location of the
477 stack. Advance YYPTR to a properly aligned location for the next
479 # define YYSTACK_RELOCATE(Type, Stack) \
482 YYSIZE_T yynewbytes; \
483 yymemcpy ((char *) yyptr, (char *) (Stack), \
484 yysize * (YYSIZE_T) sizeof (Type)); \
485 Stack = &yyptr->Stack; \
486 yynewbytes = yystacksize * sizeof (Type) + YYSTACK_GAP_MAX; \
487 yyptr += yynewbytes / sizeof (*yyptr); \
491 #endif /* ! defined (yyoverflow) || defined (YYERROR_VERBOSE) */
494 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
495 # define YYSIZE_T __SIZE_TYPE__
497 #if ! defined (YYSIZE_T) && defined (size_t)
498 # define YYSIZE_T size_t
500 #if ! defined (YYSIZE_T)
502 # include <cstddef> /* INFRINGES ON USER NAME SPACE */
503 # define YYSIZE_T std::size_t
506 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
507 # define YYSIZE_T size_t
511 #if ! defined (YYSIZE_T)
512 # define YYSIZE_T unsigned int
515 #define yyerrok (yyerrstatus = 0)
516 #define yyclearin (yychar = YYEMPTY)
519 #define YYACCEPT goto yyacceptlab
520 #define YYABORT goto yyabortlab
521 #define YYERROR goto yyerrlab1
522 /* Like YYERROR except do call yyerror. This remains here temporarily
523 to ease the transition to the new meaning of YYERROR, for GCC.
524 Once GCC version 2 has supplanted version 1, this can go. */
525 #define YYFAIL goto yyerrlab
526 #define YYRECOVERING() (!!yyerrstatus)
527 #define YYBACKUP(Token, Value) \
529 if (yychar == YYEMPTY && yylen == 1) \
533 yychar1 = YYTRANSLATE (yychar); \
539 yyerror ("syntax error: cannot back up"); \
545 #define YYERRCODE 256
548 /* YYLLOC_DEFAULT -- Compute the default location (before the actions
551 When YYLLOC_DEFAULT is run, CURRENT is set the location of the
552 first token. By default, to implement support for ranges, extend
553 its range to the last symbol. */
555 #ifndef YYLLOC_DEFAULT
556 # define YYLLOC_DEFAULT(Current, Rhs, N) \
557 Current.last_line = Rhs[N].last_line; \
558 Current.last_column = Rhs[N].last_column;
562 /* YYLEX -- calling `yylex' with the right arguments. */
567 # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
569 # define YYLEX yylex (&yylval, &yylloc)
571 # else /* !YYLSP_NEEDED */
573 # define YYLEX yylex (&yylval, YYLEX_PARAM)
575 # define YYLEX yylex (&yylval)
577 # endif /* !YYLSP_NEEDED */
579 # define YYLEX yylex ()
583 /* Enable debugging if requested. */
588 # include <cstdio> /* INFRINGES ON USER NAME SPACE */
590 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
592 # define YYFPRINTF YYSTD (fprintf)
595 # define YYDPRINTF(Args) \
600 /* Nonzero means print parse trace. [The following comment makes no
601 sense to me. Could someone clarify it? --akim] Since this is
602 uninitialized, it does not stop multiple parsers from coexisting.
606 # define YYDPRINTF(Args)
607 #endif /* !YYDEBUG */
609 /* YYINITDEPTH -- initial size of the parser's stacks. */
611 # define YYINITDEPTH 200
614 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
615 if the built-in stack extension method is used).
617 Do not make this value too large; the results are undefined if
618 SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
619 evaluated with infinite-precision integer arithmetic. */
626 # define YYMAXDEPTH 10000
629 #if ! defined (yyoverflow) && ! defined (yymemcpy)
630 # if __GNUC__ > 1 /* GNU C and GNU C++ define this. */
631 # define yymemcpy __builtin_memcpy
632 # else /* not GNU C or C++ */
634 /* This is the most reliable way to avoid incompatibilities
635 in available built-in functions on various systems. */
637 # if defined (__STDC__) || defined (__cplusplus)
638 yymemcpy (char *yyto
, const char *yyfrom
, YYSIZE_T yycount
)
640 yymemcpy (yyto
, yyfrom
, yycount
)
646 register const char *yyf
= yyfrom
;
647 register char *yyt
= yyto
;
648 register YYSIZE_T yyi
= yycount
;
656 #ifdef YYERROR_VERBOSE
659 # if defined (__GLIBC__) && defined (_STRING_H)
660 # define yystrlen strlen
662 /* Return the length of YYSTR. */
664 # if defined (__STDC__) || defined (__cplusplus)
665 yystrlen (const char *yystr
)
671 register const char *yys
= yystr
;
673 while (*yys
++ != '\0')
676 return yys
- yystr
- 1;
682 # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
683 # define yystpcpy stpcpy
685 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
688 # if defined (__STDC__) || defined (__cplusplus)
689 yystpcpy (char *yydest
, const char *yysrc
)
691 yystpcpy (yydest
, yysrc
)
696 register char *yyd
= yydest
;
697 register const char *yys
= yysrc
;
699 while ((*yyd
++ = *yys
++) != '\0')
708 #line 341 "/usr/share/bison/bison.simple"
711 /* The user can define YYPARSE_PARAM as the name of an argument to be passed
712 into yyparse. The argument should have type void *.
713 It should actually point to an object.
714 Grammar actions can access the variable by casting it
715 to the proper pointer type. */
719 # define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
720 # define YYPARSE_PARAM_DECL
721 # else /* !__cplusplus */
722 # define YYPARSE_PARAM_ARG YYPARSE_PARAM
723 # define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
724 # endif /* !__cplusplus */
725 #else /* !YYPARSE_PARAM */
726 # define YYPARSE_PARAM_ARG
727 # define YYPARSE_PARAM_DECL
728 #endif /* !YYPARSE_PARAM */
730 /* Prevent warning if -Wstrict-prototypes. */
732 # ifdef YYPARSE_PARAM
733 int yyparse (void *);
739 /* YY_DECL_VARIABLES -- depending whether we use a pure parser,
740 variables are global, or local to YYPARSE. */
742 #define YY_DECL_NON_LSP_VARIABLES \
743 /* The lookahead symbol. */ \
746 /* The semantic value of the lookahead symbol. */ \
749 /* Number of parse errors so far. */ \
753 # define YY_DECL_VARIABLES \
754 YY_DECL_NON_LSP_VARIABLES \
756 /* Location data for the lookahead symbol. */ \
759 # define YY_DECL_VARIABLES \
760 YY_DECL_NON_LSP_VARIABLES
764 /* If nonreentrant, generate the variables here. */
771 yyparse (YYPARSE_PARAM_ARG
)
774 /* If reentrant, generate the variables here. */
779 register int yystate
;
782 /* Number of tokens to shift before error messages enabled. */
784 /* Lookahead token as an internal (translated) token number. */
787 /* Three stacks and their tools:
788 `yyss': related to states,
789 `yyvs': related to semantic values,
790 `yyls': related to locations.
792 Refer to the stacks thru separate pointers, to allow yyoverflow
793 to reallocate them elsewhere. */
795 /* The state stack. */
796 short yyssa
[YYINITDEPTH
];
798 register short *yyssp
;
800 /* The semantic value stack. */
801 YYSTYPE yyvsa
[YYINITDEPTH
];
802 YYSTYPE
*yyvs
= yyvsa
;
803 register YYSTYPE
*yyvsp
;
806 /* The location stack. */
807 YYLTYPE yylsa
[YYINITDEPTH
];
808 YYLTYPE
*yyls
= yylsa
;
813 # define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
815 # define YYPOPSTACK (yyvsp--, yyssp--)
818 YYSIZE_T yystacksize
= YYINITDEPTH
;
821 /* The variables used to return semantic value and location from the
828 /* When reducing, the number of symbols on the RHS of the reduced
832 YYDPRINTF ((stderr
, "Starting parse\n"));
837 yychar
= YYEMPTY
; /* Cause a token to be read. */
839 /* Initialize stack pointers.
840 Waste one element of value and location stack
841 so that they stay on the same level as the state stack.
842 The wasted elements are never initialized. */
851 /*------------------------------------------------------------.
852 | yynewstate -- Push a new state, which is found in yystate. |
853 `------------------------------------------------------------*/
855 /* In all cases, when you get here, the value and location stacks
856 have just been pushed. so pushing a state here evens the stacks.
863 if (yyssp
>= yyss
+ yystacksize
- 1)
865 /* Get the current used size of the three stacks, in elements. */
866 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
870 /* Give user a chance to reallocate the stack. Use copies of
871 these so that the &'s don't force the real ones into
873 YYSTYPE
*yyvs1
= yyvs
;
876 /* Each stack pointer address is followed by the size of the
877 data in use in that stack, in bytes. */
879 YYLTYPE
*yyls1
= yyls
;
880 /* This used to be a conditional around just the two extra args,
881 but that might be undefined if yyoverflow is a macro. */
882 yyoverflow ("parser stack overflow",
883 &yyss1
, yysize
* sizeof (*yyssp
),
884 &yyvs1
, yysize
* sizeof (*yyvsp
),
885 &yyls1
, yysize
* sizeof (*yylsp
),
889 yyoverflow ("parser stack overflow",
890 &yyss1
, yysize
* sizeof (*yyssp
),
891 &yyvs1
, yysize
* sizeof (*yyvsp
),
897 #else /* no yyoverflow */
898 /* Extend the stack our own way. */
899 if (yystacksize
>= YYMAXDEPTH
)
902 if (yystacksize
> YYMAXDEPTH
)
903 yystacksize
= YYMAXDEPTH
;
907 union yyalloc
*yyptr
=
908 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
911 YYSTACK_RELOCATE (short, yyss
);
912 YYSTACK_RELOCATE (YYSTYPE
, yyvs
);
914 YYSTACK_RELOCATE (YYLTYPE
, yyls
);
916 # undef YYSTACK_RELOCATE
918 YYSTACK_FREE (yyss1
);
920 #endif /* no yyoverflow */
922 yyssp
= yyss
+ yysize
- 1;
923 yyvsp
= yyvs
+ yysize
- 1;
925 yylsp
= yyls
+ yysize
- 1;
928 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
929 (unsigned long int) yystacksize
));
931 if (yyssp
>= yyss
+ yystacksize
- 1)
935 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
945 /* Do appropriate processing given the current state. */
946 /* Read a lookahead token if we need one and don't already have one. */
949 /* First try to decide what to do without reference to lookahead token. */
951 yyn
= yypact
[yystate
];
955 /* Not known => get a lookahead token if don't already have one. */
957 /* yychar is either YYEMPTY or YYEOF
958 or a valid token in external form. */
960 if (yychar
== YYEMPTY
)
962 YYDPRINTF ((stderr
, "Reading a token: "));
966 /* Convert token to internal form (in yychar1) for indexing tables with */
968 if (yychar
<= 0) /* This means end of input. */
971 yychar
= YYEOF
; /* Don't call YYLEX any more */
973 YYDPRINTF ((stderr
, "Now at end of input.\n"));
977 yychar1
= YYTRANSLATE (yychar
);
980 /* We have to keep this `#if YYDEBUG', since we use variables
981 which are defined only if `YYDEBUG' is set. */
984 YYFPRINTF (stderr
, "Next token is %d (%s",
985 yychar
, yytname
[yychar1
]);
986 /* Give the individual parser a way to print the precise
987 meaning of a token, for further debugging info. */
989 YYPRINT (stderr
, yychar
, yylval
);
991 YYFPRINTF (stderr
, ")\n");
997 if (yyn
< 0 || yyn
> YYLAST
|| yycheck
[yyn
] != yychar1
)
1002 /* yyn is what to do for this token type in this state.
1003 Negative => reduce, -yyn is rule number.
1004 Positive => shift, yyn is new state.
1005 New state is final state => don't bother to shift,
1006 just return success.
1007 0, or most negative number => error. */
1022 /* Shift the lookahead token. */
1023 YYDPRINTF ((stderr
, "Shifting token %d (%s), ",
1024 yychar
, yytname
[yychar1
]));
1026 /* Discard the token being shifted unless it is eof. */
1027 if (yychar
!= YYEOF
)
1035 /* Count tokens shifted since error; after three, turn off error
1044 /*-----------------------------------------------------------.
1045 | yydefault -- do the default action for the current state. |
1046 `-----------------------------------------------------------*/
1048 yyn
= yydefact
[yystate
];
1054 /*-----------------------------.
1055 | yyreduce -- Do a reduction. |
1056 `-----------------------------*/
1058 /* yyn is the number of a rule to reduce with. */
1061 /* If YYLEN is nonzero, implement the default value of the action:
1064 Otherwise, the following line sets YYVAL to the semantic value of
1065 the lookahead token. This behavior is undocumented and Bison
1066 users should not rely upon it. Assigning to YYVAL
1067 unconditionally makes the parser a bit smaller, and it avoids a
1068 GCC warning that YYVAL may be used uninitialized. */
1069 yyval
= yyvsp
[1-yylen
];
1072 /* Similarly for the default location. Let the user run additional
1073 commands if for instance locations are ranges. */
1074 yyloc
= yylsp
[1-yylen
];
1075 YYLLOC_DEFAULT (yyloc
, (yylsp
- yylen
), yylen
);
1079 /* We have to keep this `#if YYDEBUG', since we use variables which
1080 are defined only if `YYDEBUG' is set. */
1085 YYFPRINTF (stderr
, "Reducing via rule %d (line %d), ",
1088 /* Print the symbols being reduced, and their result. */
1089 for (yyi
= yyprhs
[yyn
]; yyrhs
[yyi
] > 0; yyi
++)
1090 YYFPRINTF (stderr
, "%s ", yytname
[yyrhs
[yyi
]]);
1091 YYFPRINTF (stderr
, " -> %s\n", yytname
[yyr1
[yyn
]]);
1098 #line 127 "m68k-parse.y"
1101 op
->reg
= yyvsp
[0].reg
;
1105 #line 132 "m68k-parse.y"
1108 op
->reg
= yyvsp
[0].reg
;
1112 #line 137 "m68k-parse.y"
1115 op
->reg
= yyvsp
[0].reg
;
1119 #line 142 "m68k-parse.y"
1122 op
->reg
= yyvsp
[0].reg
;
1126 #line 147 "m68k-parse.y"
1129 op
->reg
= yyvsp
[0].reg
;
1133 #line 152 "m68k-parse.y"
1136 op
->disp
= yyvsp
[0].exp
;
1140 #line 157 "m68k-parse.y"
1143 op
->disp
= yyvsp
[0].exp
;
1147 #line 162 "m68k-parse.y"
1150 op
->disp
= yyvsp
[0].exp
;
1154 #line 167 "m68k-parse.y"
1157 op
->mask
= yyvsp
[0].mask
;
1161 #line 180 "m68k-parse.y"
1164 op
->reg
= yyvsp
[-1].reg
;
1168 #line 185 "m68k-parse.y"
1171 op
->reg
= yyvsp
[-2].reg
;
1175 #line 190 "m68k-parse.y"
1178 op
->reg
= yyvsp
[-1].reg
;
1182 #line 195 "m68k-parse.y"
1184 op
->reg
= yyvsp
[-1].reg
;
1185 op
->disp
= yyvsp
[-3].exp
;
1186 if ((yyvsp
[-1].reg
>= ZADDR0
&& yyvsp
[-1].reg
<= ZADDR7
)
1187 || yyvsp
[-1].reg
== ZPC
)
1194 #line 205 "m68k-parse.y"
1196 op
->reg
= yyvsp
[-3].reg
;
1197 op
->disp
= yyvsp
[-1].exp
;
1198 if ((yyvsp
[-3].reg
>= ZADDR0
&& yyvsp
[-3].reg
<= ZADDR7
)
1199 || yyvsp
[-3].reg
== ZPC
)
1206 #line 215 "m68k-parse.y"
1208 op
->reg
= yyvsp
[-1].reg
;
1209 op
->disp
= yyvsp
[-3].exp
;
1210 if ((yyvsp
[-1].reg
>= ZADDR0
&& yyvsp
[-1].reg
<= ZADDR7
)
1211 || yyvsp
[-1].reg
== ZPC
)
1218 #line 225 "m68k-parse.y"
1221 op
->reg
= yyvsp
[-1].reg
;
1225 #line 230 "m68k-parse.y"
1228 op
->reg
= yyvsp
[-1].reg
;
1232 #line 235 "m68k-parse.y"
1235 op
->reg
= yyvsp
[-1].reg
;
1239 #line 240 "m68k-parse.y"
1242 op
->reg
= yyvsp
[-3].reg
;
1243 op
->disp
= yyvsp
[-5].exp
;
1244 op
->index
= yyvsp
[-1].indexreg
;
1248 #line 247 "m68k-parse.y"
1250 if (yyvsp
[-3].reg
== PC
|| yyvsp
[-3].reg
== ZPC
)
1251 yyerror (_("syntax error"));
1253 op
->reg
= yyvsp
[-1].reg
;
1254 op
->disp
= yyvsp
[-5].exp
;
1255 op
->index
.reg
= yyvsp
[-3].reg
;
1256 op
->index
.size
= SIZE_UNSPEC
;
1257 op
->index
.scale
= 1;
1261 #line 258 "m68k-parse.y"
1264 op
->reg
= yyvsp
[-1].reg
;
1265 op
->disp
= yyvsp
[-4].exp
;
1266 op
->index
= yyvsp
[-2].indexreg
;
1270 #line 265 "m68k-parse.y"
1273 op
->disp
= yyvsp
[-1].exp
;
1274 op
->index
= yyvsp
[-3].indexreg
;
1278 #line 271 "m68k-parse.y"
1281 op
->reg
= yyvsp
[-3].reg
;
1282 op
->disp
= yyvsp
[-5].exp
;
1283 op
->index
= yyvsp
[-1].indexreg
;
1287 #line 278 "m68k-parse.y"
1290 op
->reg
= yyvsp
[-3].reg
;
1291 op
->index
= yyvsp
[-1].indexreg
;
1295 #line 284 "m68k-parse.y"
1297 if (yyvsp
[-3].reg
== PC
|| yyvsp
[-3].reg
== ZPC
)
1298 yyerror (_("syntax error"));
1300 op
->reg
= yyvsp
[-1].reg
;
1301 op
->disp
= yyvsp
[-5].exp
;
1302 op
->index
.reg
= yyvsp
[-3].reg
;
1303 op
->index
.size
= SIZE_UNSPEC
;
1304 op
->index
.scale
= 1;
1308 #line 295 "m68k-parse.y"
1310 if (yyvsp
[-3].reg
== PC
|| yyvsp
[-3].reg
== ZPC
)
1311 yyerror (_("syntax error"));
1313 op
->reg
= yyvsp
[-1].reg
;
1314 op
->index
.reg
= yyvsp
[-3].reg
;
1315 op
->index
.size
= SIZE_UNSPEC
;
1316 op
->index
.scale
= 1;
1320 #line 305 "m68k-parse.y"
1323 op
->reg
= yyvsp
[-1].reg
;
1324 op
->disp
= yyvsp
[-4].exp
;
1325 op
->index
= yyvsp
[-2].indexreg
;
1329 #line 312 "m68k-parse.y"
1332 op
->reg
= yyvsp
[-1].reg
;
1333 op
->index
= yyvsp
[-2].indexreg
;
1337 #line 318 "m68k-parse.y"
1340 op
->reg
= yyvsp
[-5].reg
;
1341 op
->disp
= yyvsp
[-6].exp
;
1342 op
->index
= yyvsp
[-2].indexreg
;
1343 op
->odisp
= yyvsp
[-1].exp
;
1347 #line 326 "m68k-parse.y"
1350 op
->reg
= yyvsp
[-3].reg
;
1351 op
->disp
= yyvsp
[-4].exp
;
1352 op
->odisp
= yyvsp
[-1].exp
;
1356 #line 333 "m68k-parse.y"
1359 op
->reg
= yyvsp
[-5].reg
;
1360 op
->index
= yyvsp
[-2].indexreg
;
1361 op
->odisp
= yyvsp
[-1].exp
;
1365 #line 340 "m68k-parse.y"
1368 op
->reg
= yyvsp
[-3].reg
;
1369 op
->odisp
= yyvsp
[-1].exp
;
1373 #line 346 "m68k-parse.y"
1376 op
->reg
= yyvsp
[-5].reg
;
1377 op
->disp
= yyvsp
[-7].exp
;
1378 op
->index
= yyvsp
[-3].indexreg
;
1379 op
->odisp
= yyvsp
[-1].exp
;
1383 #line 354 "m68k-parse.y"
1386 op
->reg
= yyvsp
[-5].reg
;
1387 op
->index
= yyvsp
[-3].indexreg
;
1388 op
->odisp
= yyvsp
[-1].exp
;
1392 #line 361 "m68k-parse.y"
1394 if (yyvsp
[-5].reg
== PC
|| yyvsp
[-5].reg
== ZPC
)
1395 yyerror (_("syntax error"));
1397 op
->reg
= yyvsp
[-3].reg
;
1398 op
->disp
= yyvsp
[-7].exp
;
1399 op
->index
.reg
= yyvsp
[-5].reg
;
1400 op
->index
.size
= SIZE_UNSPEC
;
1401 op
->index
.scale
= 1;
1402 op
->odisp
= yyvsp
[-1].exp
;
1406 #line 373 "m68k-parse.y"
1408 if (yyvsp
[-5].reg
== PC
|| yyvsp
[-5].reg
== ZPC
)
1409 yyerror (_("syntax error"));
1411 op
->reg
= yyvsp
[-3].reg
;
1412 op
->index
.reg
= yyvsp
[-5].reg
;
1413 op
->index
.size
= SIZE_UNSPEC
;
1414 op
->index
.scale
= 1;
1415 op
->odisp
= yyvsp
[-1].exp
;
1419 #line 384 "m68k-parse.y"
1422 op
->reg
= yyvsp
[-3].reg
;
1423 op
->disp
= yyvsp
[-5].exp
;
1424 op
->index
= yyvsp
[-4].indexreg
;
1425 op
->odisp
= yyvsp
[-1].exp
;
1429 #line 397 "m68k-parse.y"
1431 /* We use optzapc to avoid a shift/reduce conflict. */
1432 if (yyvsp
[-1].reg
< ADDR0
|| yyvsp
[-1].reg
> ADDR7
)
1433 yyerror (_("syntax error"));
1435 op
->reg
= yyvsp
[-1].reg
;
1439 #line 405 "m68k-parse.y"
1441 /* We use optzapc to avoid a shift/reduce conflict. */
1442 if (yyvsp
[-2].reg
< ADDR0
|| yyvsp
[-2].reg
> ADDR7
)
1443 yyerror (_("syntax error"));
1445 op
->reg
= yyvsp
[-2].reg
;
1449 #line 413 "m68k-parse.y"
1451 /* We use optzapc to avoid a shift/reduce conflict. */
1452 if (yyvsp
[-2].reg
< ADDR0
|| yyvsp
[-2].reg
> ADDR7
)
1453 yyerror (_("syntax error"));
1455 op
->reg
= yyvsp
[-2].reg
;
1459 #line 421 "m68k-parse.y"
1461 op
->reg
= yyvsp
[-4].reg
;
1462 op
->disp
= yyvsp
[-1].exp
;
1463 if ((yyvsp
[-4].reg
>= ZADDR0
&& yyvsp
[-4].reg
<= ZADDR7
)
1464 || yyvsp
[-4].reg
== ZPC
)
1471 #line 431 "m68k-parse.y"
1474 op
->reg
= yyvsp
[-5].reg
;
1475 op
->disp
= yyvsp
[-2].exp
;
1476 op
->index
= yyvsp
[-1].indexreg
;
1480 #line 438 "m68k-parse.y"
1483 op
->reg
= yyvsp
[-9].reg
;
1484 op
->disp
= yyvsp
[-6].exp
;
1485 op
->index
= yyvsp
[-1].indexreg
;
1486 op
->odisp
= yyvsp
[-2].exp
;
1490 #line 446 "m68k-parse.y"
1493 op
->reg
= yyvsp
[-8].reg
;
1494 op
->disp
= yyvsp
[-5].exp
;
1495 op
->odisp
= yyvsp
[-1].exp
;
1499 #line 453 "m68k-parse.y"
1502 op
->reg
= yyvsp
[-9].reg
;
1503 op
->disp
= yyvsp
[-6].exp
;
1504 op
->index
= yyvsp
[-5].indexreg
;
1505 op
->odisp
= yyvsp
[-1].exp
;
1509 #line 468 "m68k-parse.y"
1511 yyval
.indexreg
.reg
= yyvsp
[0].reg
;
1512 yyval
.indexreg
.size
= SIZE_UNSPEC
;
1513 yyval
.indexreg
.scale
= 1;
1517 #line 482 "m68k-parse.y"
1519 yyval
.indexreg
.reg
= yyvsp
[0].reg
;
1520 yyval
.indexreg
.size
= SIZE_UNSPEC
;
1521 yyval
.indexreg
.scale
= 1;
1525 #line 525 "m68k-parse.y"
1531 #line 542 "m68k-parse.y"
1537 #line 546 "m68k-parse.y"
1539 yyval
.reg
= yyvsp
[0].reg
;
1543 #line 555 "m68k-parse.y"
1545 yyval
.exp
.exp
.X_op
= O_absent
;
1546 yyval
.exp
.size
= SIZE_UNSPEC
;
1550 #line 560 "m68k-parse.y"
1552 yyval
.exp
= yyvsp
[0].exp
;
1556 #line 569 "m68k-parse.y"
1558 yyval
.exp
.exp
.X_op
= O_absent
;
1559 yyval
.exp
.size
= SIZE_UNSPEC
;
1563 #line 574 "m68k-parse.y"
1565 yyval
.exp
= yyvsp
[-1].exp
;
1569 #line 584 "m68k-parse.y"
1571 yyval
.mask
= yyvsp
[-2].mask
| yyvsp
[0].mask
;
1575 #line 588 "m68k-parse.y"
1577 yyval
.mask
= (1 << yyvsp
[-2].onereg
) | yyvsp
[0].mask
;
1581 #line 600 "m68k-parse.y"
1583 yyval
.mask
= 1 << yyvsp
[0].onereg
;
1587 #line 605 "m68k-parse.y"
1589 yyval
.mask
= yyvsp
[-2].mask
| yyvsp
[0].mask
;
1593 #line 609 "m68k-parse.y"
1595 yyval
.mask
= (1 << yyvsp
[-2].onereg
) | yyvsp
[0].mask
;
1599 #line 616 "m68k-parse.y"
1601 if (yyvsp
[-2].onereg
<= yyvsp
[0].onereg
)
1602 yyval
.mask
= (1 << (yyvsp
[0].onereg
+ 1)) - 1 - ((1 << yyvsp
[-2].onereg
) - 1);
1604 yyval
.mask
= (1 << (yyvsp
[-2].onereg
+ 1)) - 1 - ((1 << yyvsp
[0].onereg
) - 1);
1608 #line 626 "m68k-parse.y"
1610 yyval
.onereg
= yyvsp
[0].reg
- DATA0
;
1614 #line 630 "m68k-parse.y"
1616 yyval
.onereg
= yyvsp
[0].reg
- ADDR0
+ 8;
1620 #line 634 "m68k-parse.y"
1622 yyval
.onereg
= yyvsp
[0].reg
- FP0
+ 16;
1626 #line 638 "m68k-parse.y"
1628 if (yyvsp
[0].reg
== FPI
)
1630 else if (yyvsp
[0].reg
== FPS
)
1638 #line 727 "/usr/share/bison/bison.simple"
1650 short *yyssp1
= yyss
- 1;
1651 YYFPRINTF (stderr
, "state stack now");
1652 while (yyssp1
!= yyssp
)
1653 YYFPRINTF (stderr
, " %d", *++yyssp1
);
1654 YYFPRINTF (stderr
, "\n");
1663 /* Now `shift' the result of the reduction. Determine what state
1664 that goes to, based on the state we popped back to and the rule
1665 number reduced by. */
1669 yystate
= yypgoto
[yyn
- YYNTBASE
] + *yyssp
;
1670 if (yystate
>= 0 && yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
1671 yystate
= yytable
[yystate
];
1673 yystate
= yydefgoto
[yyn
- YYNTBASE
];
1678 /*------------------------------------.
1679 | yyerrlab -- here on detecting error |
1680 `------------------------------------*/
1682 /* If not already recovering from an error, report this error. */
1687 #ifdef YYERROR_VERBOSE
1688 yyn
= yypact
[yystate
];
1690 if (yyn
> YYFLAG
&& yyn
< YYLAST
)
1692 YYSIZE_T yysize
= 0;
1697 /* Start YYX at -YYN if negative to avoid negative indexes in
1699 for (yyx
= yyn
< 0 ? -yyn
: 0;
1700 yyx
< (int) (sizeof (yytname
) / sizeof (char *)); yyx
++)
1701 if (yycheck
[yyx
+ yyn
] == yyx
)
1702 yysize
+= yystrlen (yytname
[yyx
]) + 15, yycount
++;
1703 yysize
+= yystrlen ("parse error, unexpected ") + 1;
1704 yysize
+= yystrlen (yytname
[YYTRANSLATE (yychar
)]);
1705 yymsg
= (char *) YYSTACK_ALLOC (yysize
);
1708 char *yyp
= yystpcpy (yymsg
, "parse error, unexpected ");
1709 yyp
= yystpcpy (yyp
, yytname
[YYTRANSLATE (yychar
)]);
1714 for (yyx
= yyn
< 0 ? -yyn
: 0;
1715 yyx
< (int) (sizeof (yytname
) / sizeof (char *));
1717 if (yycheck
[yyx
+ yyn
] == yyx
)
1719 const char *yyq
= ! yycount
? ", expecting " : " or ";
1720 yyp
= yystpcpy (yyp
, yyq
);
1721 yyp
= yystpcpy (yyp
, yytname
[yyx
]);
1726 YYSTACK_FREE (yymsg
);
1729 yyerror ("parse error; also virtual memory exhausted");
1732 #endif /* defined (YYERROR_VERBOSE) */
1733 yyerror ("parse error");
1738 /*--------------------------------------------------.
1739 | yyerrlab1 -- error raised explicitly by an action |
1740 `--------------------------------------------------*/
1742 if (yyerrstatus
== 3)
1744 /* If just tried and failed to reuse lookahead token after an
1745 error, discard it. */
1747 /* return failure if at end of input */
1748 if (yychar
== YYEOF
)
1750 YYDPRINTF ((stderr
, "Discarding token %d (%s).\n",
1751 yychar
, yytname
[yychar1
]));
1755 /* Else will try to reuse lookahead token after shifting the error
1758 yyerrstatus
= 3; /* Each real token shifted decrements this */
1763 /*-------------------------------------------------------------------.
1764 | yyerrdefault -- current state does not do anything special for the |
1766 `-------------------------------------------------------------------*/
1769 /* This is wrong; only states that explicitly want error tokens
1770 should shift them. */
1772 /* If its default is to accept any token, ok. Otherwise pop it. */
1773 yyn
= yydefact
[yystate
];
1779 /*---------------------------------------------------------------.
1780 | yyerrpop -- pop the current state because it cannot handle the |
1782 `---------------------------------------------------------------*/
1795 short *yyssp1
= yyss
- 1;
1796 YYFPRINTF (stderr
, "Error: state stack now");
1797 while (yyssp1
!= yyssp
)
1798 YYFPRINTF (stderr
, " %d", *++yyssp1
);
1799 YYFPRINTF (stderr
, "\n");
1807 yyn
= yypact
[yystate
];
1812 if (yyn
< 0 || yyn
> YYLAST
|| yycheck
[yyn
] != YYTERROR
)
1829 YYDPRINTF ((stderr
, "Shifting error token, "));
1840 /*-------------------------------------.
1841 | yyacceptlab -- YYACCEPT comes here. |
1842 `-------------------------------------*/
1847 /*-----------------------------------.
1848 | yyabortlab -- YYABORT comes here. |
1849 `-----------------------------------*/
1854 /*---------------------------------------------.
1855 | yyoverflowab -- parser overflow comes here. |
1856 `---------------------------------------------*/
1858 yyerror ("parser stack overflow");
1865 YYSTACK_FREE (yyss
);
1869 #line 648 "m68k-parse.y"
1872 /* The string to parse is stored here, and modified by yylex. */
1876 /* The original string pointer. */
1878 static char *strorig
;
1880 /* If *CCP could be a register, return the register number and advance
1881 *CCP. Otherwise don't change *CCP, and return 0. */
1883 static enum m68k_register
1884 m68k_reg_parse (ccp
)
1885 register char **ccp
;
1892 if (flag_reg_prefix_optional
)
1894 if (*start
== REGISTER_PREFIX
)
1900 if (*start
!= REGISTER_PREFIX
)
1905 if (! is_name_beginner (*p
))
1909 while (is_part_of_name (*p
) && *p
!= '.' && *p
!= ':' && *p
!= '*')
1914 symbolp
= symbol_find (start
);
1917 if (symbolp
!= NULL
&& S_GET_SEGMENT (symbolp
) == reg_section
)
1920 return S_GET_VALUE (symbolp
);
1923 /* In MRI mode, something like foo.bar can be equated to a register
1925 while (flag_mri
&& c
== '.')
1928 while (is_part_of_name (*p
) && *p
!= '.' && *p
!= ':' && *p
!= '*')
1932 symbolp
= symbol_find (start
);
1934 if (symbolp
!= NULL
&& S_GET_SEGMENT (symbolp
) == reg_section
)
1937 return S_GET_VALUE (symbolp
);
1949 enum m68k_register reg
;
1962 /* Various special characters are just returned directly. */
1966 /* In MRI mode, this can be the start of an octal number. */
1969 if (ISDIGIT (str
[1])
1970 || ((str
[1] == '+' || str
[1] == '-')
1971 && ISDIGIT (str
[2])))
1984 /* It so happens that a '+' can only appear at the end of an
1985 operand. If it appears anywhere else, it must be a unary
1986 plus on an expression. */
1991 /* A '-' can only appear in -(ar), rn-rn, or ar@-. If it
1992 appears anywhere else, it must be a unary minus on an
1999 if (m68k_reg_parse (&s
) != 0)
2003 /* A '(' can only appear in `(reg)', `(expr,...', `([', `@(', or
2004 `)('. If it appears anywhere else, it must be starting an
2009 || str
[-1] == ')')))
2012 if (m68k_reg_parse (&s
) != 0)
2014 /* Check for the case of '(expr,...' by scanning ahead. If we
2015 find a comma outside of balanced parentheses, we return '('.
2016 If we find an unbalanced right parenthesis, then presumably
2017 the '(' really starts an expression. */
2019 for (s
= str
+ 1; *s
!= '\0'; s
++)
2029 else if (*s
== ',' && parens
== 0)
2031 /* A comma can not normally appear in an expression, so
2032 this is a case of '(expr,...'. */
2038 /* See if it's a register. */
2040 reg
= m68k_reg_parse (&str
);
2047 if (reg
>= DATA0
&& reg
<= DATA7
)
2049 else if (reg
>= ADDR0
&& reg
<= ADDR7
)
2051 else if (reg
>= FP0
&& reg
<= FP7
)
2059 else if (reg
>= ZDATA0
&& reg
<= ZDATA7
)
2061 else if (reg
>= ZADDR0
&& reg
<= ZADDR7
)
2063 else if (reg
== ZPC
)
2068 /* If we get here, we have a data or address register. We
2069 must check for a size or scale; if we find one, we must
2074 if (*s
!= '.' && *s
!= ':' && *s
!= '*')
2077 yylval
.indexreg
.reg
= reg
;
2079 if (*s
!= '.' && *s
!= ':')
2080 yylval
.indexreg
.size
= SIZE_UNSPEC
;
2088 yylval
.indexreg
.size
= SIZE_WORD
;
2093 yylval
.indexreg
.size
= SIZE_LONG
;
2097 yyerror (_("illegal size specification"));
2098 yylval
.indexreg
.size
= SIZE_UNSPEC
;
2103 yylval
.indexreg
.scale
= 1;
2105 if (*s
== '*' || *s
== ':')
2111 hold
= input_line_pointer
;
2112 input_line_pointer
= s
;
2113 expression (&scale
);
2114 s
= input_line_pointer
;
2115 input_line_pointer
= hold
;
2117 if (scale
.X_op
!= O_constant
)
2118 yyerror (_("scale specification must resolve to a number"));
2121 switch (scale
.X_add_number
)
2127 yylval
.indexreg
.scale
= scale
.X_add_number
;
2130 yyerror (_("invalid scale value"));
2141 /* It must be an expression. Before we call expression, we need to
2142 look ahead to see if there is a size specification. We must do
2143 that first, because otherwise foo.l will be treated as the symbol
2144 foo.l, rather than as the symbol foo with a long size
2145 specification. The grammar requires that all expressions end at
2146 the end of the operand, or with ',', '(', ']', ')'. */
2149 for (s
= str
; *s
!= '\0'; s
++)
2155 && (s
[-1] == ')' || ISALNUM (s
[-1])))
2165 else if (parens
== 0
2166 && (*s
== ',' || *s
== ']'))
2170 yylval
.exp
.size
= SIZE_UNSPEC
;
2172 || (s
[-2] != '.' && s
[-2] != ':'))
2182 yylval
.exp
.size
= SIZE_BYTE
;
2186 yylval
.exp
.size
= SIZE_WORD
;
2190 yylval
.exp
.size
= SIZE_LONG
;
2195 if (yylval
.exp
.size
!= SIZE_UNSPEC
)
2201 /* Look for @PLTPC, etc. */
2204 yylval
.exp
.pic_reloc
= pic_none
;
2206 if (cp
- 6 > str
&& cp
[-6] == '@')
2208 if (strncmp (cp
- 6, "@PLTPC", 6) == 0)
2210 yylval
.exp
.pic_reloc
= pic_plt_pcrel
;
2213 else if (strncmp (cp
- 6, "@GOTPC", 6) == 0)
2215 yylval
.exp
.pic_reloc
= pic_got_pcrel
;
2219 else if (cp
- 4 > str
&& cp
[-4] == '@')
2221 if (strncmp (cp
- 4, "@PLT", 4) == 0)
2223 yylval
.exp
.pic_reloc
= pic_plt_off
;
2226 else if (strncmp (cp
- 4, "@GOT", 4) == 0)
2228 yylval
.exp
.pic_reloc
= pic_got_off
;
2241 hold
= input_line_pointer
;
2242 input_line_pointer
= str
;
2243 expression (&yylval
.exp
.exp
);
2244 str
= input_line_pointer
;
2245 input_line_pointer
= hold
;
2256 /* Parse an m68k operand. This is the only function which is called
2257 from outside this file. */
2260 m68k_ip_op (s
, oparg
)
2262 struct m68k_op
*oparg
;
2264 memset (oparg
, 0, sizeof *oparg
);
2265 oparg
->error
= NULL
;
2266 oparg
->index
.reg
= ZDATA0
;
2267 oparg
->index
.scale
= 1;
2268 oparg
->disp
.exp
.X_op
= O_absent
;
2269 oparg
->odisp
.exp
.X_op
= O_absent
;
2277 /* The error handler. */