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 gratuitously 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
96 # define YYSTYPE_IS_TRIVIAL 1
105 #define YYFLAG -32768
108 /* YYTRANSLATE(YYLEX) -- Bison token number corresponding to YYLEX. */
109 #define YYTRANSLATE(x) ((unsigned)(x) <= 267 ? yytranslate[x] : 44)
111 /* YYTRANSLATE[YYLEX] -- Bison token number corresponding to YYLEX. */
112 static const char yytranslate
[] =
114 0, 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, 2, 2, 2, 2, 2,
117 2, 2, 2, 2, 2, 14, 2, 2, 15, 2,
118 16, 17, 2, 18, 20, 19, 2, 24, 2, 2,
119 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
120 2, 2, 2, 2, 23, 2, 2, 2, 2, 2,
121 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
122 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
123 2, 21, 2, 22, 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, 2, 2, 2, 2,
139 2, 2, 2, 2, 2, 2, 1, 3, 4, 5,
140 6, 7, 8, 9, 10, 11, 12, 13
144 static const short yyprhs
[] =
146 0, 0, 2, 4, 6, 8, 10, 12, 14, 16,
147 18, 21, 24, 26, 30, 35, 40, 46, 52, 57,
148 61, 65, 69, 77, 85, 92, 98, 105, 111, 118,
149 124, 130, 135, 145, 153, 162, 169, 180, 189, 200,
150 209, 218, 221, 225, 229, 235, 242, 253, 263, 274,
151 276, 278, 280, 282, 284, 286, 288, 290, 292, 294,
152 296, 298, 300, 302, 303, 305, 307, 309, 310, 313,
153 314, 317, 318, 321, 323, 327, 331, 333, 335, 339,
154 343, 347, 349, 351, 353
156 static const short yyrhs
[] =
158 26, 0, 27, 0, 28, 0, 3, 0, 4, 0,
159 5, 0, 6, 0, 11, 0, 13, 0, 14, 13,
160 0, 15, 13, 0, 40, 0, 16, 4, 17, 0,
161 16, 4, 17, 18, 0, 19, 16, 4, 17, 0,
162 16, 13, 20, 34, 17, 0, 16, 34, 20, 13,
163 17, 0, 13, 16, 34, 17, 0, 16, 7, 17,
164 0, 16, 8, 17, 0, 16, 10, 17, 0, 16,
165 13, 20, 34, 20, 29, 17, 0, 16, 13, 20,
166 34, 20, 36, 17, 0, 16, 13, 20, 30, 37,
167 17, 0, 16, 30, 20, 13, 17, 0, 13, 16,
168 34, 20, 29, 17, 0, 16, 34, 20, 29, 17,
169 0, 13, 16, 34, 20, 36, 17, 0, 16, 34,
170 20, 36, 17, 0, 13, 16, 30, 37, 17, 0,
171 16, 30, 37, 17, 0, 16, 21, 13, 37, 22,
172 20, 29, 38, 17, 0, 16, 21, 13, 37, 22,
173 38, 17, 0, 16, 21, 34, 22, 20, 29, 38,
174 17, 0, 16, 21, 34, 22, 38, 17, 0, 16,
175 21, 13, 20, 34, 20, 29, 22, 38, 17, 0,
176 16, 21, 34, 20, 29, 22, 38, 17, 0, 16,
177 21, 13, 20, 34, 20, 36, 22, 38, 17, 0,
178 16, 21, 34, 20, 36, 22, 38, 17, 0, 16,
179 21, 39, 30, 37, 22, 38, 17, 0, 35, 23,
180 0, 35, 23, 18, 0, 35, 23, 19, 0, 35,
181 23, 16, 13, 17, 0, 35, 23, 16, 39, 29,
182 17, 0, 35, 23, 16, 13, 17, 23, 16, 39,
183 29, 17, 0, 35, 23, 16, 13, 17, 23, 16,
184 13, 17, 0, 35, 23, 16, 39, 29, 17, 23,
185 16, 13, 17, 0, 12, 0, 31, 0, 12, 0,
186 32, 0, 32, 0, 4, 0, 8, 0, 3, 0,
187 9, 0, 4, 0, 7, 0, 33, 0, 10, 0,
188 8, 0, 0, 34, 0, 7, 0, 10, 0, 0,
189 20, 34, 0, 0, 20, 13, 0, 0, 13, 20,
190 0, 42, 0, 42, 24, 41, 0, 43, 24, 41,
191 0, 43, 0, 42, 0, 42, 24, 41, 0, 43,
192 24, 41, 0, 43, 19, 43, 0, 3, 0, 4,
199 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
200 static const short yyrline
[] =
202 0, 117, 119, 120, 125, 131, 136, 141, 146, 151,
203 156, 161, 166, 178, 184, 189, 194, 204, 214, 224,
204 229, 234, 239, 246, 257, 264, 270, 277, 283, 294,
205 304, 311, 317, 325, 332, 339, 345, 353, 360, 372,
206 383, 395, 404, 412, 420, 430, 437, 445, 452, 465,
207 467, 479, 481, 492, 494, 495, 500, 502, 507, 509,
208 515, 517, 518, 523, 528, 533, 535, 540, 545, 553,
209 559, 567, 573, 581, 583, 587, 598, 603, 604, 608,
210 614, 624, 629, 633, 637
215 #if (YYDEBUG) || defined YYERROR_VERBOSE
217 /* YYTNAME[TOKEN_NUM] -- String name of the token TOKEN_NUM. */
218 static const char *const yytname
[] =
220 "$", "error", "$undefined.", "DR", "AR", "FPR", "FPCR", "LPC", "ZAR",
221 "ZDR", "LZPC", "CREG", "INDEXREG", "EXPR", "'#'", "'&'", "'('", "')'",
222 "'+'", "'-'", "','", "'['", "']'", "'@'", "'/'", "operand",
223 "generic_operand", "motorola_operand", "mit_operand", "zireg", "zdireg",
224 "zadr", "zdr", "apc", "zapc", "optzapc", "zpc", "optczapc", "optcexpr",
225 "optexprc", "reglist", "ireglist", "reglistpair", "reglistreg", 0
229 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
230 static const short yyr1
[] =
232 0, 25, 25, 25, 26, 26, 26, 26, 26, 26,
233 26, 26, 26, 27, 27, 27, 27, 27, 27, 27,
234 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
235 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
236 27, 28, 28, 28, 28, 28, 28, 28, 28, 29,
237 29, 30, 30, 31, 31, 31, 32, 32, 33, 33,
238 34, 34, 34, 35, 35, 36, 36, 37, 37, 38,
239 38, 39, 39, 40, 40, 40, 41, 41, 41, 41,
243 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
244 static const short yyr2
[] =
246 0, 1, 1, 1, 1, 1, 1, 1, 1, 1,
247 2, 2, 1, 3, 4, 4, 5, 5, 4, 3,
248 3, 3, 7, 7, 6, 5, 6, 5, 6, 5,
249 5, 4, 9, 7, 8, 6, 10, 8, 10, 8,
250 8, 2, 3, 3, 5, 6, 10, 9, 10, 1,
251 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
252 1, 1, 1, 0, 1, 1, 1, 0, 2, 0,
253 2, 0, 2, 1, 3, 3, 1, 1, 3, 3,
257 /* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE
258 doesn't specify something else to do. Zero means the default is an
260 static const short yydefact
[] =
262 63, 81, 82, 83, 84, 59, 62, 61, 8, 9,
263 0, 0, 0, 0, 1, 2, 3, 60, 64, 0,
264 12, 73, 0, 0, 10, 11, 56, 58, 59, 62,
265 57, 61, 51, 0, 71, 67, 52, 0, 0, 41,
266 0, 0, 0, 58, 67, 0, 13, 19, 20, 21,
267 0, 67, 0, 0, 0, 0, 0, 0, 71, 42,
268 43, 81, 82, 83, 84, 74, 77, 76, 80, 75,
269 0, 0, 18, 0, 14, 67, 0, 72, 0, 0,
270 69, 67, 0, 68, 31, 54, 65, 55, 66, 49,
271 0, 0, 50, 53, 0, 15, 0, 0, 0, 0,
272 30, 0, 0, 0, 16, 0, 68, 69, 0, 0,
273 0, 0, 0, 25, 17, 27, 29, 44, 72, 0,
274 78, 79, 26, 28, 24, 0, 0, 0, 0, 0,
275 69, 69, 70, 69, 35, 69, 0, 45, 22, 23,
276 0, 0, 69, 33, 0, 0, 0, 0, 0, 71,
277 0, 69, 69, 0, 37, 39, 34, 40, 0, 0,
278 0, 0, 0, 32, 47, 0, 0, 36, 38, 46,
282 static const short yydefgoto
[] =
284 171, 14, 15, 16, 91, 35, 92, 93, 17, 83,
285 19, 94, 55, 111, 53, 20, 65, 66, 67
288 static const short yypact
[] =
290 89, 10, 11, 19, 23,-32768,-32768,-32768,-32768, 13,
291 -4, 22, 57, 36,-32768,-32768,-32768,-32768,-32768, 18,
292 -32768, 33, -2, 114,-32768,-32768,-32768, 46, 62, 66,
293 -32768, 67,-32768, 68, 131, 69,-32768, 70, 105, 147,
294 156, 156, 156,-32768, 94, 25, 101,-32768,-32768,-32768,
295 114, 100, 53, 9, 138, 108, 103, 112, 117,-32768,
296 -32768,-32768,-32768,-32768,-32768,-32768, 119, 12,-32768,-32768,
297 64, 130,-32768, 124,-32768, 94, 81, 64, 135, 124,
298 132, 94, 150,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
299 151, 152,-32768,-32768, 153,-32768, 120, 146, 156, 156,
300 -32768, 154, 155, 157,-32768, 124, 144, 158, 159, 160,
301 73, 162, 161,-32768,-32768,-32768,-32768, 163,-32768, 167,
302 -32768,-32768,-32768,-32768,-32768, 168, 170, 124, 73, 171,
303 169, 169,-32768, 169,-32768, 169, 164, 172,-32768,-32768,
304 174, 175, 169,-32768, 177, 176, 181, 182, 183, 178,
305 185, 169, 169, 186,-32768,-32768,-32768,-32768, 136, 146,
306 179, 187, 188,-32768,-32768, 189, 190,-32768,-32768,-32768,
307 -32768, 173, 194,-32768
310 static const short yypgoto
[] =
312 -32768,-32768,-32768,-32768, -72, 1,-32768, -7,-32768, 3,
313 -32768, -65, -31, -103, -58,-32768, -40, 202, 6
320 static const short yytable
[] =
322 97, 101, 69, 18, 129, 36, 22, 108, 102, 24,
323 -4, -5, 26, 71, 109, 37, 36, 41, 30, -6,
324 78, 32, 42, -7, 44, 119, 45, 145, 146, 23,
325 147, 41, 148, 125, -58, 25, 99, 52, 133, 153,
326 126, 39, 72, 36, 103, 73, 36, 68, 161, 162,
327 112, 75, 38, 76, 81, 140, 142, 40, 120, 121,
328 26, 27, 141, 46, 28, 29, 30, 31, 43, 32,
329 33, 5, 6, 79, 7, 80, 26, 85, 34, 47,
330 106, 87, 30, 48, 49, 89, 132, 165, 50, 54,
331 56, 159, 1, 2, 3, 4, 5, 6, 104, 7,
332 8, 105, 9, 10, 11, 12, 26, 85, 13, 57,
333 86, 87, 30, 88, 70, 89, 90, 26, 43, 74,
334 77, 5, 6, 30, 7, 84, 32, 26, 85, 95,
335 96, 86, 87, 30, 88, 43, 89, 117, 5, 6,
336 118, 7, 43, 98, 51, 5, 6, 100, 7, 26,
337 85, 82, 110, 164, 87, 30, 118, 107, 89, 61,
338 62, 63, 64, 58, 127, 59, 60, 113, 114, 115,
339 116, 122, 123, 172, 124, 0, 0, 0, 128, 134,
340 149, 130, 131, 135, 137, 138, 136, 139, 143, 144,
341 132, 158, 166, 154, 173, 150, 151, 152, 155, 156,
342 157, 160, 21, 163, 167, 168, 169, 170
345 static const short yycheck
[] =
347 58, 73, 42, 0, 107, 12, 0, 79, 73, 13,
348 0, 0, 3, 44, 79, 12, 23, 19, 9, 0,
349 51, 12, 24, 0, 23, 97, 23, 130, 131, 16,
350 133, 19, 135, 105, 23, 13, 24, 34, 110, 142,
351 105, 23, 17, 50, 75, 20, 53, 41, 151, 152,
352 81, 50, 16, 50, 53, 127, 128, 24, 98, 99,
353 3, 4, 127, 17, 7, 8, 9, 10, 4, 12,
354 13, 7, 8, 20, 10, 22, 3, 4, 21, 17,
355 77, 8, 9, 17, 17, 12, 13, 159, 20, 20,
356 20, 149, 3, 4, 5, 6, 7, 8, 17, 10,
357 11, 20, 13, 14, 15, 16, 3, 4, 19, 4,
358 7, 8, 9, 10, 20, 12, 13, 3, 4, 18,
359 20, 7, 8, 9, 10, 17, 12, 3, 4, 17,
360 13, 7, 8, 9, 10, 4, 12, 17, 7, 8,
361 20, 10, 4, 24, 13, 7, 8, 17, 10, 3,
362 4, 13, 20, 17, 8, 9, 20, 22, 12, 3,
363 4, 5, 6, 16, 20, 18, 19, 17, 17, 17,
364 17, 17, 17, 0, 17, -1, -1, -1, 20, 17,
365 16, 22, 22, 22, 17, 17, 23, 17, 17, 20,
366 13, 13, 13, 17, 0, 23, 22, 22, 17, 17,
367 17, 16, 0, 17, 17, 17, 17, 17
369 /* -*-C-*- Note some compilers choke on comments on `#line' lines. */
370 #line 3 "/usr/share/bison-1.35/bison.simple"
372 /* Skeleton output parser for bison,
374 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software
377 This program is free software; you can redistribute it and/or modify
378 it under the terms of the GNU General Public License as published by
379 the Free Software Foundation; either version 2, or (at your option)
382 This program is distributed in the hope that it will be useful,
383 but WITHOUT ANY WARRANTY; without even the implied warranty of
384 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
385 GNU General Public License for more details.
387 You should have received a copy of the GNU General Public License
388 along with this program; if not, write to the Free Software
389 Foundation, Inc., 59 Temple Place - Suite 330,
390 Boston, MA 02111-1307, USA. */
392 /* As a special exception, when this file is copied by Bison into a
393 Bison output file, you may use that output file without restriction.
394 This special exception was added by the Free Software Foundation
395 in version 1.24 of Bison. */
397 /* This is the parser code that is written into each bison parser when
398 the %semantic_parser declaration is not specified in the grammar.
399 It was written by Richard Stallman by simplifying the hairy parser
400 used when %semantic_parser is specified. */
402 /* All symbols defined below should begin with yy or YY, to avoid
403 infringing on user name space. This should be done even for local
404 variables, as they might otherwise be expanded by user macros.
405 There are some unavoidable exceptions within include files to
406 define necessary library symbols; they are noted "INFRINGES ON
407 USER NAME SPACE" below. */
409 #if ! defined (yyoverflow) || defined (YYERROR_VERBOSE)
411 /* The parser invokes alloca or malloc; define the necessary symbols. */
413 # if YYSTACK_USE_ALLOCA
414 # define YYSTACK_ALLOC alloca
416 # ifndef YYSTACK_USE_ALLOCA
417 # if defined (alloca) || defined (_ALLOCA_H)
418 # define YYSTACK_ALLOC alloca
421 # define YYSTACK_ALLOC __builtin_alloca
427 # ifdef YYSTACK_ALLOC
428 /* Pacify GCC's `empty if-body' warning. */
429 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
431 # if defined (__STDC__) || defined (__cplusplus)
432 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
433 # define YYSIZE_T size_t
435 # define YYSTACK_ALLOC malloc
436 # define YYSTACK_FREE free
438 #endif /* ! defined (yyoverflow) || defined (YYERROR_VERBOSE) */
441 #if (! defined (yyoverflow) \
442 && (! defined (__cplusplus) \
443 || (YYLTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
445 /* A type that is properly aligned for any stack member. */
455 /* The size of the maximum gap between one aligned stack and the next. */
456 # define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1)
458 /* The size of an array large to enough to hold all stacks, each with
461 # define YYSTACK_BYTES(N) \
462 ((N) * (sizeof (short) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
463 + 2 * YYSTACK_GAP_MAX)
465 # define YYSTACK_BYTES(N) \
466 ((N) * (sizeof (short) + sizeof (YYSTYPE)) \
470 /* Copy COUNT objects from FROM to TO. The source and destination do
474 # define YYCOPY(To, From, Count) \
475 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
477 # define YYCOPY(To, From, Count) \
480 register YYSIZE_T yyi; \
481 for (yyi = 0; yyi < (Count); yyi++) \
482 (To)[yyi] = (From)[yyi]; \
488 /* Relocate STACK from its old location to the new one. The
489 local variables YYSIZE and YYSTACKSIZE give the old and new number of
490 elements in the stack, and YYPTR gives the new location of the
491 stack. Advance YYPTR to a properly aligned location for the next
493 # define YYSTACK_RELOCATE(Stack) \
496 YYSIZE_T yynewbytes; \
497 YYCOPY (&yyptr->Stack, Stack, yysize); \
498 Stack = &yyptr->Stack; \
499 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAX; \
500 yyptr += yynewbytes / sizeof (*yyptr); \
507 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
508 # define YYSIZE_T __SIZE_TYPE__
510 #if ! defined (YYSIZE_T) && defined (size_t)
511 # define YYSIZE_T size_t
513 #if ! defined (YYSIZE_T)
514 # if defined (__STDC__) || defined (__cplusplus)
515 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
516 # define YYSIZE_T size_t
519 #if ! defined (YYSIZE_T)
520 # define YYSIZE_T unsigned int
523 #define yyerrok (yyerrstatus = 0)
524 #define yyclearin (yychar = YYEMPTY)
527 #define YYACCEPT goto yyacceptlab
528 #define YYABORT goto yyabortlab
529 #define YYERROR goto yyerrlab1
530 /* Like YYERROR except do call yyerror. This remains here temporarily
531 to ease the transition to the new meaning of YYERROR, for GCC.
532 Once GCC version 2 has supplanted version 1, this can go. */
533 #define YYFAIL goto yyerrlab
534 #define YYRECOVERING() (!!yyerrstatus)
535 #define YYBACKUP(Token, Value) \
537 if (yychar == YYEMPTY && yylen == 1) \
541 yychar1 = YYTRANSLATE (yychar); \
547 yyerror ("syntax error: cannot back up"); \
553 #define YYERRCODE 256
556 /* YYLLOC_DEFAULT -- Compute the default location (before the actions
559 When YYLLOC_DEFAULT is run, CURRENT is set the location of the
560 first token. By default, to implement support for ranges, extend
561 its range to the last symbol. */
563 #ifndef YYLLOC_DEFAULT
564 # define YYLLOC_DEFAULT(Current, Rhs, N) \
565 Current.last_line = Rhs[N].last_line; \
566 Current.last_column = Rhs[N].last_column;
570 /* YYLEX -- calling `yylex' with the right arguments. */
575 # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
577 # define YYLEX yylex (&yylval, &yylloc)
579 # else /* !YYLSP_NEEDED */
581 # define YYLEX yylex (&yylval, YYLEX_PARAM)
583 # define YYLEX yylex (&yylval)
585 # endif /* !YYLSP_NEEDED */
587 # define YYLEX yylex ()
591 /* Enable debugging if requested. */
595 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
596 # define YYFPRINTF fprintf
599 # define YYDPRINTF(Args) \
604 /* Nonzero means print parse trace. It is left uninitialized so that
605 multiple parsers can coexist. */
608 # define YYDPRINTF(Args)
609 #endif /* !YYDEBUG */
611 /* YYINITDEPTH -- initial size of the parser's stacks. */
613 # define YYINITDEPTH 200
616 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
617 if the built-in stack extension method is used).
619 Do not make this value too large; the results are undefined if
620 SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
621 evaluated with infinite-precision integer arithmetic. */
628 # define YYMAXDEPTH 10000
631 #ifdef YYERROR_VERBOSE
634 # if defined (__GLIBC__) && defined (_STRING_H)
635 # define yystrlen strlen
637 /* Return the length of YYSTR. */
639 # if defined (__STDC__) || defined (__cplusplus)
640 yystrlen (const char *yystr
)
646 register const char *yys
= yystr
;
648 while (*yys
++ != '\0')
651 return yys
- yystr
- 1;
657 # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
658 # define yystpcpy stpcpy
660 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
663 # if defined (__STDC__) || defined (__cplusplus)
664 yystpcpy (char *yydest
, const char *yysrc
)
666 yystpcpy (yydest
, yysrc
)
671 register char *yyd
= yydest
;
672 register const char *yys
= yysrc
;
674 while ((*yyd
++ = *yys
++) != '\0')
683 #line 315 "/usr/share/bison-1.35/bison.simple"
686 /* The user can define YYPARSE_PARAM as the name of an argument to be passed
687 into yyparse. The argument should have type void *.
688 It should actually point to an object.
689 Grammar actions can access the variable by casting it
690 to the proper pointer type. */
693 # if defined (__STDC__) || defined (__cplusplus)
694 # define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
695 # define YYPARSE_PARAM_DECL
697 # define YYPARSE_PARAM_ARG YYPARSE_PARAM
698 # define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
700 #else /* !YYPARSE_PARAM */
701 # define YYPARSE_PARAM_ARG
702 # define YYPARSE_PARAM_DECL
703 #endif /* !YYPARSE_PARAM */
705 /* Prevent warning if -Wstrict-prototypes. */
707 # ifdef YYPARSE_PARAM
708 int yyparse (void *);
714 /* YY_DECL_VARIABLES -- depending whether we use a pure parser,
715 variables are global, or local to YYPARSE. */
717 #define YY_DECL_NON_LSP_VARIABLES \
718 /* The lookahead symbol. */ \
721 /* The semantic value of the lookahead symbol. */ \
724 /* Number of parse errors so far. */ \
728 # define YY_DECL_VARIABLES \
729 YY_DECL_NON_LSP_VARIABLES \
731 /* Location data for the lookahead symbol. */ \
734 # define YY_DECL_VARIABLES \
735 YY_DECL_NON_LSP_VARIABLES
739 /* If nonreentrant, generate the variables here. */
746 yyparse (YYPARSE_PARAM_ARG
)
749 /* If reentrant, generate the variables here. */
754 register int yystate
;
757 /* Number of tokens to shift before error messages enabled. */
759 /* Lookahead token as an internal (translated) token number. */
762 /* Three stacks and their tools:
763 `yyss': related to states,
764 `yyvs': related to semantic values,
765 `yyls': related to locations.
767 Refer to the stacks thru separate pointers, to allow yyoverflow
768 to reallocate them elsewhere. */
770 /* The state stack. */
771 short yyssa
[YYINITDEPTH
];
773 register short *yyssp
;
775 /* The semantic value stack. */
776 YYSTYPE yyvsa
[YYINITDEPTH
];
777 YYSTYPE
*yyvs
= yyvsa
;
778 register YYSTYPE
*yyvsp
;
781 /* The location stack. */
782 YYLTYPE yylsa
[YYINITDEPTH
];
783 YYLTYPE
*yyls
= yylsa
;
788 # define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
790 # define YYPOPSTACK (yyvsp--, yyssp--)
793 YYSIZE_T yystacksize
= YYINITDEPTH
;
796 /* The variables used to return semantic value and location from the
803 /* When reducing, the number of symbols on the RHS of the reduced
807 YYDPRINTF ((stderr
, "Starting parse\n"));
812 yychar
= YYEMPTY
; /* Cause a token to be read. */
814 /* Initialize stack pointers.
815 Waste one element of value and location stack
816 so that they stay on the same level as the state stack.
817 The wasted elements are never initialized. */
826 /*------------------------------------------------------------.
827 | yynewstate -- Push a new state, which is found in yystate. |
828 `------------------------------------------------------------*/
830 /* In all cases, when you get here, the value and location stacks
831 have just been pushed. so pushing a state here evens the stacks.
838 if (yyssp
>= yyss
+ yystacksize
- 1)
840 /* Get the current used size of the three stacks, in elements. */
841 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
845 /* Give user a chance to reallocate the stack. Use copies of
846 these so that the &'s don't force the real ones into
848 YYSTYPE
*yyvs1
= yyvs
;
851 /* Each stack pointer address is followed by the size of the
852 data in use in that stack, in bytes. */
854 YYLTYPE
*yyls1
= yyls
;
855 /* This used to be a conditional around just the two extra args,
856 but that might be undefined if yyoverflow is a macro. */
857 yyoverflow ("parser stack overflow",
858 &yyss1
, yysize
* sizeof (*yyssp
),
859 &yyvs1
, yysize
* sizeof (*yyvsp
),
860 &yyls1
, yysize
* sizeof (*yylsp
),
864 yyoverflow ("parser stack overflow",
865 &yyss1
, yysize
* sizeof (*yyssp
),
866 &yyvs1
, yysize
* sizeof (*yyvsp
),
872 #else /* no yyoverflow */
873 # ifndef YYSTACK_RELOCATE
876 /* Extend the stack our own way. */
877 if (yystacksize
>= YYMAXDEPTH
)
880 if (yystacksize
> YYMAXDEPTH
)
881 yystacksize
= YYMAXDEPTH
;
885 union yyalloc
*yyptr
=
886 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
889 YYSTACK_RELOCATE (yyss
);
890 YYSTACK_RELOCATE (yyvs
);
892 YYSTACK_RELOCATE (yyls
);
894 # undef YYSTACK_RELOCATE
896 YYSTACK_FREE (yyss1
);
899 #endif /* no yyoverflow */
901 yyssp
= yyss
+ yysize
- 1;
902 yyvsp
= yyvs
+ yysize
- 1;
904 yylsp
= yyls
+ yysize
- 1;
907 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
908 (unsigned long int) yystacksize
));
910 if (yyssp
>= yyss
+ yystacksize
- 1)
914 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
924 /* Do appropriate processing given the current state. */
925 /* Read a lookahead token if we need one and don't already have one. */
928 /* First try to decide what to do without reference to lookahead token. */
930 yyn
= yypact
[yystate
];
934 /* Not known => get a lookahead token if don't already have one. */
936 /* yychar is either YYEMPTY or YYEOF
937 or a valid token in external form. */
939 if (yychar
== YYEMPTY
)
941 YYDPRINTF ((stderr
, "Reading a token: "));
945 /* Convert token to internal form (in yychar1) for indexing tables with */
947 if (yychar
<= 0) /* This means end of input. */
950 yychar
= YYEOF
; /* Don't call YYLEX any more */
952 YYDPRINTF ((stderr
, "Now at end of input.\n"));
956 yychar1
= YYTRANSLATE (yychar
);
959 /* We have to keep this `#if YYDEBUG', since we use variables
960 which are defined only if `YYDEBUG' is set. */
963 YYFPRINTF (stderr
, "Next token is %d (%s",
964 yychar
, yytname
[yychar1
]);
965 /* Give the individual parser a way to print the precise
966 meaning of a token, for further debugging info. */
968 YYPRINT (stderr
, yychar
, yylval
);
970 YYFPRINTF (stderr
, ")\n");
976 if (yyn
< 0 || yyn
> YYLAST
|| yycheck
[yyn
] != yychar1
)
981 /* yyn is what to do for this token type in this state.
982 Negative => reduce, -yyn is rule number.
983 Positive => shift, yyn is new state.
984 New state is final state => don't bother to shift,
986 0, or most negative number => error. */
1001 /* Shift the lookahead token. */
1002 YYDPRINTF ((stderr
, "Shifting token %d (%s), ",
1003 yychar
, yytname
[yychar1
]));
1005 /* Discard the token being shifted unless it is eof. */
1006 if (yychar
!= YYEOF
)
1014 /* Count tokens shifted since error; after three, turn off error
1023 /*-----------------------------------------------------------.
1024 | yydefault -- do the default action for the current state. |
1025 `-----------------------------------------------------------*/
1027 yyn
= yydefact
[yystate
];
1033 /*-----------------------------.
1034 | yyreduce -- Do a reduction. |
1035 `-----------------------------*/
1037 /* yyn is the number of a rule to reduce with. */
1040 /* If YYLEN is nonzero, implement the default value of the action:
1043 Otherwise, the following line sets YYVAL to the semantic value of
1044 the lookahead token. This behavior is undocumented and Bison
1045 users should not rely upon it. Assigning to YYVAL
1046 unconditionally makes the parser a bit smaller, and it avoids a
1047 GCC warning that YYVAL may be used uninitialized. */
1048 yyval
= yyvsp
[1-yylen
];
1051 /* Similarly for the default location. Let the user run additional
1052 commands if for instance locations are ranges. */
1053 yyloc
= yylsp
[1-yylen
];
1054 YYLLOC_DEFAULT (yyloc
, (yylsp
- yylen
), yylen
);
1058 /* We have to keep this `#if YYDEBUG', since we use variables which
1059 are defined only if `YYDEBUG' is set. */
1064 YYFPRINTF (stderr
, "Reducing via rule %d (line %d), ",
1067 /* Print the symbols being reduced, and their result. */
1068 for (yyi
= yyprhs
[yyn
]; yyrhs
[yyi
] > 0; yyi
++)
1069 YYFPRINTF (stderr
, "%s ", yytname
[yyrhs
[yyi
]]);
1070 YYFPRINTF (stderr
, " -> %s\n", yytname
[yyr1
[yyn
]]);
1077 #line 127 "m68k-parse.y"
1080 op
->reg
= yyvsp
[0].reg
;
1084 #line 132 "m68k-parse.y"
1087 op
->reg
= yyvsp
[0].reg
;
1091 #line 137 "m68k-parse.y"
1094 op
->reg
= yyvsp
[0].reg
;
1098 #line 142 "m68k-parse.y"
1101 op
->reg
= yyvsp
[0].reg
;
1105 #line 147 "m68k-parse.y"
1108 op
->reg
= yyvsp
[0].reg
;
1112 #line 152 "m68k-parse.y"
1115 op
->disp
= yyvsp
[0].exp
;
1119 #line 157 "m68k-parse.y"
1122 op
->disp
= yyvsp
[0].exp
;
1126 #line 162 "m68k-parse.y"
1129 op
->disp
= yyvsp
[0].exp
;
1133 #line 167 "m68k-parse.y"
1136 op
->mask
= yyvsp
[0].mask
;
1140 #line 180 "m68k-parse.y"
1143 op
->reg
= yyvsp
[-1].reg
;
1147 #line 185 "m68k-parse.y"
1150 op
->reg
= yyvsp
[-2].reg
;
1154 #line 190 "m68k-parse.y"
1157 op
->reg
= yyvsp
[-1].reg
;
1161 #line 195 "m68k-parse.y"
1163 op
->reg
= yyvsp
[-1].reg
;
1164 op
->disp
= yyvsp
[-3].exp
;
1165 if ((yyvsp
[-1].reg
>= ZADDR0
&& yyvsp
[-1].reg
<= ZADDR7
)
1166 || yyvsp
[-1].reg
== ZPC
)
1173 #line 205 "m68k-parse.y"
1175 op
->reg
= yyvsp
[-3].reg
;
1176 op
->disp
= yyvsp
[-1].exp
;
1177 if ((yyvsp
[-3].reg
>= ZADDR0
&& yyvsp
[-3].reg
<= ZADDR7
)
1178 || yyvsp
[-3].reg
== ZPC
)
1185 #line 215 "m68k-parse.y"
1187 op
->reg
= yyvsp
[-1].reg
;
1188 op
->disp
= yyvsp
[-3].exp
;
1189 if ((yyvsp
[-1].reg
>= ZADDR0
&& yyvsp
[-1].reg
<= ZADDR7
)
1190 || yyvsp
[-1].reg
== ZPC
)
1197 #line 225 "m68k-parse.y"
1200 op
->reg
= yyvsp
[-1].reg
;
1204 #line 230 "m68k-parse.y"
1207 op
->reg
= yyvsp
[-1].reg
;
1211 #line 235 "m68k-parse.y"
1214 op
->reg
= yyvsp
[-1].reg
;
1218 #line 240 "m68k-parse.y"
1221 op
->reg
= yyvsp
[-3].reg
;
1222 op
->disp
= yyvsp
[-5].exp
;
1223 op
->index
= yyvsp
[-1].indexreg
;
1227 #line 247 "m68k-parse.y"
1229 if (yyvsp
[-3].reg
== PC
|| yyvsp
[-3].reg
== ZPC
)
1230 yyerror (_("syntax error"));
1232 op
->reg
= yyvsp
[-1].reg
;
1233 op
->disp
= yyvsp
[-5].exp
;
1234 op
->index
.reg
= yyvsp
[-3].reg
;
1235 op
->index
.size
= SIZE_UNSPEC
;
1236 op
->index
.scale
= 1;
1240 #line 258 "m68k-parse.y"
1243 op
->reg
= yyvsp
[-1].reg
;
1244 op
->disp
= yyvsp
[-4].exp
;
1245 op
->index
= yyvsp
[-2].indexreg
;
1249 #line 265 "m68k-parse.y"
1252 op
->disp
= yyvsp
[-1].exp
;
1253 op
->index
= yyvsp
[-3].indexreg
;
1257 #line 271 "m68k-parse.y"
1260 op
->reg
= yyvsp
[-3].reg
;
1261 op
->disp
= yyvsp
[-5].exp
;
1262 op
->index
= yyvsp
[-1].indexreg
;
1266 #line 278 "m68k-parse.y"
1269 op
->reg
= yyvsp
[-3].reg
;
1270 op
->index
= yyvsp
[-1].indexreg
;
1274 #line 284 "m68k-parse.y"
1276 if (yyvsp
[-3].reg
== PC
|| yyvsp
[-3].reg
== ZPC
)
1277 yyerror (_("syntax error"));
1279 op
->reg
= yyvsp
[-1].reg
;
1280 op
->disp
= yyvsp
[-5].exp
;
1281 op
->index
.reg
= yyvsp
[-3].reg
;
1282 op
->index
.size
= SIZE_UNSPEC
;
1283 op
->index
.scale
= 1;
1287 #line 295 "m68k-parse.y"
1289 if (yyvsp
[-3].reg
== PC
|| yyvsp
[-3].reg
== ZPC
)
1290 yyerror (_("syntax error"));
1292 op
->reg
= yyvsp
[-1].reg
;
1293 op
->index
.reg
= yyvsp
[-3].reg
;
1294 op
->index
.size
= SIZE_UNSPEC
;
1295 op
->index
.scale
= 1;
1299 #line 305 "m68k-parse.y"
1302 op
->reg
= yyvsp
[-1].reg
;
1303 op
->disp
= yyvsp
[-4].exp
;
1304 op
->index
= yyvsp
[-2].indexreg
;
1308 #line 312 "m68k-parse.y"
1311 op
->reg
= yyvsp
[-1].reg
;
1312 op
->index
= yyvsp
[-2].indexreg
;
1316 #line 318 "m68k-parse.y"
1319 op
->reg
= yyvsp
[-5].reg
;
1320 op
->disp
= yyvsp
[-6].exp
;
1321 op
->index
= yyvsp
[-2].indexreg
;
1322 op
->odisp
= yyvsp
[-1].exp
;
1326 #line 326 "m68k-parse.y"
1329 op
->reg
= yyvsp
[-3].reg
;
1330 op
->disp
= yyvsp
[-4].exp
;
1331 op
->odisp
= yyvsp
[-1].exp
;
1335 #line 333 "m68k-parse.y"
1338 op
->reg
= yyvsp
[-5].reg
;
1339 op
->index
= yyvsp
[-2].indexreg
;
1340 op
->odisp
= yyvsp
[-1].exp
;
1344 #line 340 "m68k-parse.y"
1347 op
->reg
= yyvsp
[-3].reg
;
1348 op
->odisp
= yyvsp
[-1].exp
;
1352 #line 346 "m68k-parse.y"
1355 op
->reg
= yyvsp
[-5].reg
;
1356 op
->disp
= yyvsp
[-7].exp
;
1357 op
->index
= yyvsp
[-3].indexreg
;
1358 op
->odisp
= yyvsp
[-1].exp
;
1362 #line 354 "m68k-parse.y"
1365 op
->reg
= yyvsp
[-5].reg
;
1366 op
->index
= yyvsp
[-3].indexreg
;
1367 op
->odisp
= yyvsp
[-1].exp
;
1371 #line 361 "m68k-parse.y"
1373 if (yyvsp
[-5].reg
== PC
|| yyvsp
[-5].reg
== ZPC
)
1374 yyerror (_("syntax error"));
1376 op
->reg
= yyvsp
[-3].reg
;
1377 op
->disp
= yyvsp
[-7].exp
;
1378 op
->index
.reg
= yyvsp
[-5].reg
;
1379 op
->index
.size
= SIZE_UNSPEC
;
1380 op
->index
.scale
= 1;
1381 op
->odisp
= yyvsp
[-1].exp
;
1385 #line 373 "m68k-parse.y"
1387 if (yyvsp
[-5].reg
== PC
|| yyvsp
[-5].reg
== ZPC
)
1388 yyerror (_("syntax error"));
1390 op
->reg
= yyvsp
[-3].reg
;
1391 op
->index
.reg
= yyvsp
[-5].reg
;
1392 op
->index
.size
= SIZE_UNSPEC
;
1393 op
->index
.scale
= 1;
1394 op
->odisp
= yyvsp
[-1].exp
;
1398 #line 384 "m68k-parse.y"
1401 op
->reg
= yyvsp
[-3].reg
;
1402 op
->disp
= yyvsp
[-5].exp
;
1403 op
->index
= yyvsp
[-4].indexreg
;
1404 op
->odisp
= yyvsp
[-1].exp
;
1408 #line 397 "m68k-parse.y"
1410 /* We use optzapc to avoid a shift/reduce conflict. */
1411 if (yyvsp
[-1].reg
< ADDR0
|| yyvsp
[-1].reg
> ADDR7
)
1412 yyerror (_("syntax error"));
1414 op
->reg
= yyvsp
[-1].reg
;
1418 #line 405 "m68k-parse.y"
1420 /* We use optzapc to avoid a shift/reduce conflict. */
1421 if (yyvsp
[-2].reg
< ADDR0
|| yyvsp
[-2].reg
> ADDR7
)
1422 yyerror (_("syntax error"));
1424 op
->reg
= yyvsp
[-2].reg
;
1428 #line 413 "m68k-parse.y"
1430 /* We use optzapc to avoid a shift/reduce conflict. */
1431 if (yyvsp
[-2].reg
< ADDR0
|| yyvsp
[-2].reg
> ADDR7
)
1432 yyerror (_("syntax error"));
1434 op
->reg
= yyvsp
[-2].reg
;
1438 #line 421 "m68k-parse.y"
1440 op
->reg
= yyvsp
[-4].reg
;
1441 op
->disp
= yyvsp
[-1].exp
;
1442 if ((yyvsp
[-4].reg
>= ZADDR0
&& yyvsp
[-4].reg
<= ZADDR7
)
1443 || yyvsp
[-4].reg
== ZPC
)
1450 #line 431 "m68k-parse.y"
1453 op
->reg
= yyvsp
[-5].reg
;
1454 op
->disp
= yyvsp
[-2].exp
;
1455 op
->index
= yyvsp
[-1].indexreg
;
1459 #line 438 "m68k-parse.y"
1462 op
->reg
= yyvsp
[-9].reg
;
1463 op
->disp
= yyvsp
[-6].exp
;
1464 op
->index
= yyvsp
[-1].indexreg
;
1465 op
->odisp
= yyvsp
[-2].exp
;
1469 #line 446 "m68k-parse.y"
1472 op
->reg
= yyvsp
[-8].reg
;
1473 op
->disp
= yyvsp
[-5].exp
;
1474 op
->odisp
= yyvsp
[-1].exp
;
1478 #line 453 "m68k-parse.y"
1481 op
->reg
= yyvsp
[-9].reg
;
1482 op
->disp
= yyvsp
[-6].exp
;
1483 op
->index
= yyvsp
[-5].indexreg
;
1484 op
->odisp
= yyvsp
[-1].exp
;
1488 #line 468 "m68k-parse.y"
1490 yyval
.indexreg
.reg
= yyvsp
[0].reg
;
1491 yyval
.indexreg
.size
= SIZE_UNSPEC
;
1492 yyval
.indexreg
.scale
= 1;
1496 #line 482 "m68k-parse.y"
1498 yyval
.indexreg
.reg
= yyvsp
[0].reg
;
1499 yyval
.indexreg
.size
= SIZE_UNSPEC
;
1500 yyval
.indexreg
.scale
= 1;
1504 #line 525 "m68k-parse.y"
1510 #line 542 "m68k-parse.y"
1516 #line 546 "m68k-parse.y"
1518 yyval
.reg
= yyvsp
[0].reg
;
1522 #line 555 "m68k-parse.y"
1524 yyval
.exp
.exp
.X_op
= O_absent
;
1525 yyval
.exp
.size
= SIZE_UNSPEC
;
1529 #line 560 "m68k-parse.y"
1531 yyval
.exp
= yyvsp
[0].exp
;
1535 #line 569 "m68k-parse.y"
1537 yyval
.exp
.exp
.X_op
= O_absent
;
1538 yyval
.exp
.size
= SIZE_UNSPEC
;
1542 #line 574 "m68k-parse.y"
1544 yyval
.exp
= yyvsp
[-1].exp
;
1548 #line 584 "m68k-parse.y"
1550 yyval
.mask
= yyvsp
[-2].mask
| yyvsp
[0].mask
;
1554 #line 588 "m68k-parse.y"
1556 yyval
.mask
= (1 << yyvsp
[-2].onereg
) | yyvsp
[0].mask
;
1560 #line 600 "m68k-parse.y"
1562 yyval
.mask
= 1 << yyvsp
[0].onereg
;
1566 #line 605 "m68k-parse.y"
1568 yyval
.mask
= yyvsp
[-2].mask
| yyvsp
[0].mask
;
1572 #line 609 "m68k-parse.y"
1574 yyval
.mask
= (1 << yyvsp
[-2].onereg
) | yyvsp
[0].mask
;
1578 #line 616 "m68k-parse.y"
1580 if (yyvsp
[-2].onereg
<= yyvsp
[0].onereg
)
1581 yyval
.mask
= (1 << (yyvsp
[0].onereg
+ 1)) - 1 - ((1 << yyvsp
[-2].onereg
) - 1);
1583 yyval
.mask
= (1 << (yyvsp
[-2].onereg
+ 1)) - 1 - ((1 << yyvsp
[0].onereg
) - 1);
1587 #line 626 "m68k-parse.y"
1589 yyval
.onereg
= yyvsp
[0].reg
- DATA0
;
1593 #line 630 "m68k-parse.y"
1595 yyval
.onereg
= yyvsp
[0].reg
- ADDR0
+ 8;
1599 #line 634 "m68k-parse.y"
1601 yyval
.onereg
= yyvsp
[0].reg
- FP0
+ 16;
1605 #line 638 "m68k-parse.y"
1607 if (yyvsp
[0].reg
== FPI
)
1609 else if (yyvsp
[0].reg
== FPS
)
1617 #line 705 "/usr/share/bison-1.35/bison.simple"
1629 short *yyssp1
= yyss
- 1;
1630 YYFPRINTF (stderr
, "state stack now");
1631 while (yyssp1
!= yyssp
)
1632 YYFPRINTF (stderr
, " %d", *++yyssp1
);
1633 YYFPRINTF (stderr
, "\n");
1642 /* Now `shift' the result of the reduction. Determine what state
1643 that goes to, based on the state we popped back to and the rule
1644 number reduced by. */
1648 yystate
= yypgoto
[yyn
- YYNTBASE
] + *yyssp
;
1649 if (yystate
>= 0 && yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
1650 yystate
= yytable
[yystate
];
1652 yystate
= yydefgoto
[yyn
- YYNTBASE
];
1657 /*------------------------------------.
1658 | yyerrlab -- here on detecting error |
1659 `------------------------------------*/
1661 /* If not already recovering from an error, report this error. */
1666 #ifdef YYERROR_VERBOSE
1667 yyn
= yypact
[yystate
];
1669 if (yyn
> YYFLAG
&& yyn
< YYLAST
)
1671 YYSIZE_T yysize
= 0;
1676 /* Start YYX at -YYN if negative to avoid negative indexes in
1678 for (yyx
= yyn
< 0 ? -yyn
: 0;
1679 yyx
< (int) (sizeof (yytname
) / sizeof (char *)); yyx
++)
1680 if (yycheck
[yyx
+ yyn
] == yyx
)
1681 yysize
+= yystrlen (yytname
[yyx
]) + 15, yycount
++;
1682 yysize
+= yystrlen ("parse error, unexpected ") + 1;
1683 yysize
+= yystrlen (yytname
[YYTRANSLATE (yychar
)]);
1684 yymsg
= (char *) YYSTACK_ALLOC (yysize
);
1687 char *yyp
= yystpcpy (yymsg
, "parse error, unexpected ");
1688 yyp
= yystpcpy (yyp
, yytname
[YYTRANSLATE (yychar
)]);
1693 for (yyx
= yyn
< 0 ? -yyn
: 0;
1694 yyx
< (int) (sizeof (yytname
) / sizeof (char *));
1696 if (yycheck
[yyx
+ yyn
] == yyx
)
1698 const char *yyq
= ! yycount
? ", expecting " : " or ";
1699 yyp
= yystpcpy (yyp
, yyq
);
1700 yyp
= yystpcpy (yyp
, yytname
[yyx
]);
1705 YYSTACK_FREE (yymsg
);
1708 yyerror ("parse error; also virtual memory exhausted");
1711 #endif /* defined (YYERROR_VERBOSE) */
1712 yyerror ("parse error");
1717 /*--------------------------------------------------.
1718 | yyerrlab1 -- error raised explicitly by an action |
1719 `--------------------------------------------------*/
1721 if (yyerrstatus
== 3)
1723 /* If just tried and failed to reuse lookahead token after an
1724 error, discard it. */
1726 /* return failure if at end of input */
1727 if (yychar
== YYEOF
)
1729 YYDPRINTF ((stderr
, "Discarding token %d (%s).\n",
1730 yychar
, yytname
[yychar1
]));
1734 /* Else will try to reuse lookahead token after shifting the error
1737 yyerrstatus
= 3; /* Each real token shifted decrements this */
1742 /*-------------------------------------------------------------------.
1743 | yyerrdefault -- current state does not do anything special for the |
1745 `-------------------------------------------------------------------*/
1748 /* This is wrong; only states that explicitly want error tokens
1749 should shift them. */
1751 /* If its default is to accept any token, ok. Otherwise pop it. */
1752 yyn
= yydefact
[yystate
];
1758 /*---------------------------------------------------------------.
1759 | yyerrpop -- pop the current state because it cannot handle the |
1761 `---------------------------------------------------------------*/
1774 short *yyssp1
= yyss
- 1;
1775 YYFPRINTF (stderr
, "Error: state stack now");
1776 while (yyssp1
!= yyssp
)
1777 YYFPRINTF (stderr
, " %d", *++yyssp1
);
1778 YYFPRINTF (stderr
, "\n");
1786 yyn
= yypact
[yystate
];
1791 if (yyn
< 0 || yyn
> YYLAST
|| yycheck
[yyn
] != YYTERROR
)
1808 YYDPRINTF ((stderr
, "Shifting error token, "));
1819 /*-------------------------------------.
1820 | yyacceptlab -- YYACCEPT comes here. |
1821 `-------------------------------------*/
1826 /*-----------------------------------.
1827 | yyabortlab -- YYABORT comes here. |
1828 `-----------------------------------*/
1833 /*---------------------------------------------.
1834 | yyoverflowab -- parser overflow comes here. |
1835 `---------------------------------------------*/
1837 yyerror ("parser stack overflow");
1844 YYSTACK_FREE (yyss
);
1848 #line 648 "m68k-parse.y"
1851 /* The string to parse is stored here, and modified by yylex. */
1855 /* The original string pointer. */
1857 static char *strorig
;
1859 /* If *CCP could be a register, return the register number and advance
1860 *CCP. Otherwise don't change *CCP, and return 0. */
1862 static enum m68k_register
1863 m68k_reg_parse (ccp
)
1864 register char **ccp
;
1871 if (flag_reg_prefix_optional
)
1873 if (*start
== REGISTER_PREFIX
)
1879 if (*start
!= REGISTER_PREFIX
)
1884 if (! is_name_beginner (*p
))
1888 while (is_part_of_name (*p
) && *p
!= '.' && *p
!= ':' && *p
!= '*')
1893 symbolp
= symbol_find (start
);
1896 if (symbolp
!= NULL
&& S_GET_SEGMENT (symbolp
) == reg_section
)
1899 return S_GET_VALUE (symbolp
);
1902 /* In MRI mode, something like foo.bar can be equated to a register
1904 while (flag_mri
&& c
== '.')
1907 while (is_part_of_name (*p
) && *p
!= '.' && *p
!= ':' && *p
!= '*')
1911 symbolp
= symbol_find (start
);
1913 if (symbolp
!= NULL
&& S_GET_SEGMENT (symbolp
) == reg_section
)
1916 return S_GET_VALUE (symbolp
);
1928 enum m68k_register reg
;
1941 /* Various special characters are just returned directly. */
1945 /* In MRI mode, this can be the start of an octal number. */
1948 if (ISDIGIT (str
[1])
1949 || ((str
[1] == '+' || str
[1] == '-')
1950 && ISDIGIT (str
[2])))
1963 /* It so happens that a '+' can only appear at the end of an
1964 operand. If it appears anywhere else, it must be a unary
1965 plus on an expression. */
1970 /* A '-' can only appear in -(ar), rn-rn, or ar@-. If it
1971 appears anywhere else, it must be a unary minus on an
1978 if (m68k_reg_parse (&s
) != 0)
1982 /* A '(' can only appear in `(reg)', `(expr,...', `([', `@(', or
1983 `)('. If it appears anywhere else, it must be starting an
1988 || str
[-1] == ')')))
1991 if (m68k_reg_parse (&s
) != 0)
1993 /* Check for the case of '(expr,...' by scanning ahead. If we
1994 find a comma outside of balanced parentheses, we return '('.
1995 If we find an unbalanced right parenthesis, then presumably
1996 the '(' really starts an expression. */
1998 for (s
= str
+ 1; *s
!= '\0'; s
++)
2008 else if (*s
== ',' && parens
== 0)
2010 /* A comma can not normally appear in an expression, so
2011 this is a case of '(expr,...'. */
2017 /* See if it's a register. */
2019 reg
= m68k_reg_parse (&str
);
2026 if (reg
>= DATA0
&& reg
<= DATA7
)
2028 else if (reg
>= ADDR0
&& reg
<= ADDR7
)
2030 else if (reg
>= FP0
&& reg
<= FP7
)
2038 else if (reg
>= ZDATA0
&& reg
<= ZDATA7
)
2040 else if (reg
>= ZADDR0
&& reg
<= ZADDR7
)
2042 else if (reg
== ZPC
)
2047 /* If we get here, we have a data or address register. We
2048 must check for a size or scale; if we find one, we must
2053 if (*s
!= '.' && *s
!= ':' && *s
!= '*')
2056 yylval
.indexreg
.reg
= reg
;
2058 if (*s
!= '.' && *s
!= ':')
2059 yylval
.indexreg
.size
= SIZE_UNSPEC
;
2067 yylval
.indexreg
.size
= SIZE_WORD
;
2072 yylval
.indexreg
.size
= SIZE_LONG
;
2076 yyerror (_("illegal size specification"));
2077 yylval
.indexreg
.size
= SIZE_UNSPEC
;
2082 yylval
.indexreg
.scale
= 1;
2084 if (*s
== '*' || *s
== ':')
2090 hold
= input_line_pointer
;
2091 input_line_pointer
= s
;
2092 expression (&scale
);
2093 s
= input_line_pointer
;
2094 input_line_pointer
= hold
;
2096 if (scale
.X_op
!= O_constant
)
2097 yyerror (_("scale specification must resolve to a number"));
2100 switch (scale
.X_add_number
)
2106 yylval
.indexreg
.scale
= scale
.X_add_number
;
2109 yyerror (_("invalid scale value"));
2120 /* It must be an expression. Before we call expression, we need to
2121 look ahead to see if there is a size specification. We must do
2122 that first, because otherwise foo.l will be treated as the symbol
2123 foo.l, rather than as the symbol foo with a long size
2124 specification. The grammar requires that all expressions end at
2125 the end of the operand, or with ',', '(', ']', ')'. */
2128 for (s
= str
; *s
!= '\0'; s
++)
2134 && (s
[-1] == ')' || ISALNUM (s
[-1])))
2144 else if (parens
== 0
2145 && (*s
== ',' || *s
== ']'))
2149 yylval
.exp
.size
= SIZE_UNSPEC
;
2151 || (s
[-2] != '.' && s
[-2] != ':'))
2161 yylval
.exp
.size
= SIZE_BYTE
;
2165 yylval
.exp
.size
= SIZE_WORD
;
2169 yylval
.exp
.size
= SIZE_LONG
;
2174 if (yylval
.exp
.size
!= SIZE_UNSPEC
)
2180 /* Look for @PLTPC, etc. */
2183 yylval
.exp
.pic_reloc
= pic_none
;
2185 if (cp
- 6 > str
&& cp
[-6] == '@')
2187 if (strncmp (cp
- 6, "@PLTPC", 6) == 0)
2189 yylval
.exp
.pic_reloc
= pic_plt_pcrel
;
2192 else if (strncmp (cp
- 6, "@GOTPC", 6) == 0)
2194 yylval
.exp
.pic_reloc
= pic_got_pcrel
;
2198 else if (cp
- 4 > str
&& cp
[-4] == '@')
2200 if (strncmp (cp
- 4, "@PLT", 4) == 0)
2202 yylval
.exp
.pic_reloc
= pic_plt_off
;
2205 else if (strncmp (cp
- 4, "@GOT", 4) == 0)
2207 yylval
.exp
.pic_reloc
= pic_got_off
;
2220 hold
= input_line_pointer
;
2221 input_line_pointer
= str
;
2222 expression (&yylval
.exp
.exp
);
2223 str
= input_line_pointer
;
2224 input_line_pointer
= hold
;
2235 /* Parse an m68k operand. This is the only function which is called
2236 from outside this file. */
2239 m68k_ip_op (s
, oparg
)
2241 struct m68k_op
*oparg
;
2243 memset (oparg
, 0, sizeof *oparg
);
2244 oparg
->error
= NULL
;
2245 oparg
->index
.reg
= ZDATA0
;
2246 oparg
->index
.scale
= 1;
2247 oparg
->disp
.exp
.X_op
= O_absent
;
2248 oparg
->odisp
.exp
.X_op
= O_absent
;
2256 /* The error handler. */