m68k-parse.c revision 1.1.1.2 1 1.1 christos /* A Bison parser, made by GNU Bison 3.8.2. */
2 1.1 christos
3 1.1 christos /* Bison implementation for Yacc-like parsers in C
4 1.1 christos
5 1.1 christos Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation,
6 1.1 christos Inc.
7 1.1 christos
8 1.1 christos This program is free software: you can redistribute it and/or modify
9 1.1 christos it under the terms of the GNU General Public License as published by
10 1.1 christos the Free Software Foundation, either version 3 of the License, or
11 1.1 christos (at your option) any later version.
12 1.1 christos
13 1.1 christos This program is distributed in the hope that it will be useful,
14 1.1 christos but WITHOUT ANY WARRANTY; without even the implied warranty of
15 1.1 christos MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 1.1 christos GNU General Public License for more details.
17 1.1 christos
18 1.1 christos You should have received a copy of the GNU General Public License
19 1.1 christos along with this program. If not, see <https://www.gnu.org/licenses/>. */
20 1.1 christos
21 1.1 christos /* As a special exception, you may create a larger work that contains
22 1.1 christos part or all of the Bison parser skeleton and distribute that work
23 1.1 christos under terms of your choice, so long as that work isn't itself a
24 1.1 christos parser generator using the skeleton or a modified version thereof
25 1.1 christos as a parser skeleton. Alternatively, if you modify or redistribute
26 1.1 christos the parser skeleton itself, you may (at your option) remove this
27 1.1 christos special exception, which will cause the skeleton and the resulting
28 1.1 christos Bison output files to be licensed under the GNU General Public
29 1.1 christos License without this special exception.
30 1.1 christos
31 1.1 christos This special exception was added by the Free Software Foundation in
32 1.1 christos version 2.2 of Bison. */
33 1.1 christos
34 1.1 christos /* C LALR(1) parser skeleton written by Richard Stallman, by
35 1.1 christos simplifying the original so-called "semantic" parser. */
36 1.1 christos
37 1.1 christos /* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual,
38 1.1 christos especially those whose name start with YY_ or yy_. They are
39 1.1 christos private implementation details that can be changed or removed. */
40 1.1 christos
41 1.1 christos /* All symbols defined below should begin with yy or YY, to avoid
42 1.1 christos infringing on user name space. This should be done even for local
43 1.1 christos variables, as they might otherwise be expanded by user macros.
44 1.1 christos There are some unavoidable exceptions within include files to
45 1.1 christos define necessary library symbols; they are noted "INFRINGES ON
46 1.1 christos USER NAME SPACE" below. */
47 1.1 christos
48 1.1 christos /* Identify Bison output, and Bison version. */
49 1.1 christos #define YYBISON 30802
50 1.1 christos
51 1.1 christos /* Bison version string. */
52 1.1 christos #define YYBISON_VERSION "3.8.2"
53 1.1 christos
54 1.1 christos /* Skeleton name. */
55 1.1 christos #define YYSKELETON_NAME "yacc.c"
56 1.1 christos
57 1.1 christos /* Pure parsers. */
58 1.1 christos #define YYPURE 0
59 1.1 christos
60 1.1 christos /* Push parsers. */
61 1.1 christos #define YYPUSH 0
62 1.1 christos
63 1.1 christos /* Pull parsers. */
64 1.1 christos #define YYPULL 1
65 1.1 christos
66 1.1 christos
67 1.1 christos
68 1.1 christos
69 1.1 christos /* First part of user prologue. */
70 1.1 christos #line 27 "./config/m68k-parse.y"
71 1.1 christos
72 1.1 christos
73 1.1 christos #include "as.h"
74 1.1 christos #include "tc-m68k.h"
75 1.1 christos #include "m68k-parse.h"
76 1.1 christos #include "safe-ctype.h"
77 1.1 christos
78 1.1 christos /* Remap normal yacc parser interface names (yyparse, yylex, yyerror,
79 1.1 christos etc), as well as gratuitously global symbol names If other parser
80 1.1 christos generators (bison, byacc, etc) produce additional global names that
81 1.1 christos conflict at link time, then those parser generators need to be
82 1.1 christos fixed instead of adding those names to this list. */
83 1.1 christos
84 1.1 christos #define yymaxdepth m68k_maxdepth
85 1.1 christos #define yyparse m68k_parse
86 1.1 christos #define yylex m68k_lex
87 1.1 christos #define yyerror m68k_error
88 1.1 christos #define yylval m68k_lval
89 1.1 christos #define yychar m68k_char
90 1.1 christos #define yydebug m68k_debug
91 1.1 christos #define yypact m68k_pact
92 1.1 christos #define yyr1 m68k_r1
93 1.1 christos #define yyr2 m68k_r2
94 1.1 christos #define yydef m68k_def
95 1.1 christos #define yychk m68k_chk
96 1.1 christos #define yypgo m68k_pgo
97 1.1 christos #define yyact m68k_act
98 1.1 christos #define yyexca m68k_exca
99 1.1 christos #define yyerrflag m68k_errflag
100 1.1 christos #define yynerrs m68k_nerrs
101 1.1 christos #define yyps m68k_ps
102 1.1 christos #define yypv m68k_pv
103 1.1 christos #define yys m68k_s
104 1.1 christos #define yy_yys m68k_yys
105 1.1 christos #define yystate m68k_state
106 1.1 christos #define yytmp m68k_tmp
107 1.1 christos #define yyv m68k_v
108 1.1 christos #define yy_yyv m68k_yyv
109 1.1 christos #define yyval m68k_val
110 1.1 christos #define yylloc m68k_lloc
111 1.1 christos #define yyreds m68k_reds /* With YYDEBUG defined */
112 1.1 christos #define yytoks m68k_toks /* With YYDEBUG defined */
113 1.1 christos #define yylhs m68k_yylhs
114 1.1 christos #define yylen m68k_yylen
115 1.1 christos #define yydefred m68k_yydefred
116 1.1 christos #define yydgoto m68k_yydgoto
117 1.1 christos #define yysindex m68k_yysindex
118 1.1 christos #define yyrindex m68k_yyrindex
119 1.1 christos #define yygindex m68k_yygindex
120 1.1 christos #define yytable m68k_yytable
121 1.1 christos #define yycheck m68k_yycheck
122 1.1 christos
123 1.1 christos #ifndef YYDEBUG
124 1.1 christos #define YYDEBUG 1
125 1.1 christos #endif
126 1.1 christos
127 1.1 christos /* Internal functions. */
128 1.1 christos
129 1.1 christos static enum m68k_register m68k_reg_parse (char **);
130 1.1 christos static int yylex (void);
131 1.1 christos static void yyerror (const char *);
132 1.1 christos
133 1.1 christos /* The parser sets fields pointed to by this global variable. */
134 1.1 christos static struct m68k_op *op;
135 1.1 christos
136 1.1 christos
137 1.1 christos #line 138 "config/m68k-parse.c"
138 1.1 christos
139 1.1 christos # ifndef YY_CAST
140 1.1 christos # ifdef __cplusplus
141 1.1 christos # define YY_CAST(Type, Val) static_cast<Type> (Val)
142 1.1 christos # define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type> (Val)
143 1.1 christos # else
144 1.1 christos # define YY_CAST(Type, Val) ((Type) (Val))
145 1.1 christos # define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val))
146 1.1 christos # endif
147 1.1 christos # endif
148 1.1 christos # ifndef YY_NULLPTR
149 1.1 christos # if defined __cplusplus
150 1.1 christos # if 201103L <= __cplusplus
151 1.1 christos # define YY_NULLPTR nullptr
152 1.1 christos # else
153 1.1 christos # define YY_NULLPTR 0
154 1.1 christos # endif
155 1.1 christos # else
156 1.1 christos # define YY_NULLPTR ((void*)0)
157 1.1 christos # endif
158 1.1 christos # endif
159 1.1 christos
160 1.1 christos
161 1.1 christos /* Debug traces. */
162 1.1 christos #ifndef YYDEBUG
163 1.1 christos # define YYDEBUG 0
164 1.1 christos #endif
165 1.1 christos #if YYDEBUG
166 1.1 christos extern int yydebug;
167 1.1 christos #endif
168 1.1 christos
169 1.1 christos /* Token kinds. */
170 1.1 christos #ifndef YYTOKENTYPE
171 1.1 christos # define YYTOKENTYPE
172 1.1 christos enum yytokentype
173 1.1 christos {
174 1.1 christos YYEMPTY = -2,
175 1.1 christos YYEOF = 0, /* "end of file" */
176 1.1 christos YYerror = 256, /* error */
177 1.1 christos YYUNDEF = 257, /* "invalid token" */
178 1.1 christos DR = 258, /* DR */
179 1.1 christos AR = 259, /* AR */
180 1.1 christos FPR = 260, /* FPR */
181 1.1 christos FPCR = 261, /* FPCR */
182 1.1 christos LPC = 262, /* LPC */
183 1.1 christos ZAR = 263, /* ZAR */
184 1.1 christos ZDR = 264, /* ZDR */
185 1.1 christos LZPC = 265, /* LZPC */
186 1.1 christos CREG = 266, /* CREG */
187 1.1 christos INDEXREG = 267, /* INDEXREG */
188 1.1 christos EXPR = 268 /* EXPR */
189 1.1 christos };
190 1.1 christos typedef enum yytokentype yytoken_kind_t;
191 1.1 christos #endif
192 1.1 christos /* Token kinds. */
193 1.1 christos #define YYEMPTY -2
194 1.1 christos #define YYEOF 0
195 1.1 christos #define YYerror 256
196 1.1 christos #define YYUNDEF 257
197 1.1 christos #define DR 258
198 1.1 christos #define AR 259
199 1.1 christos #define FPR 260
200 1.1 christos #define FPCR 261
201 1.1 christos #define LPC 262
202 1.1 christos #define ZAR 263
203 1.1 christos #define ZDR 264
204 1.1 christos #define LZPC 265
205 1.1 christos #define CREG 266
206 1.1 christos #define INDEXREG 267
207 1.1 christos #define EXPR 268
208 1.1 christos
209 1.1 christos /* Value type. */
210 1.1 christos #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
211 1.1 christos union YYSTYPE
212 1.1 christos {
213 1.1 christos #line 95 "./config/m68k-parse.y"
214 1.1 christos
215 1.1 christos struct m68k_indexreg indexreg;
216 1.1 christos enum m68k_register reg;
217 1.1 christos struct m68k_exp exp;
218 1.1 christos unsigned long mask;
219 1.1 christos int onereg;
220 1.1 christos int trailing_ampersand;
221 1.1 christos
222 1.1 christos #line 223 "config/m68k-parse.c"
223 1.1 christos
224 1.1 christos };
225 1.1 christos typedef union YYSTYPE YYSTYPE;
226 1.1 christos # define YYSTYPE_IS_TRIVIAL 1
227 1.1 christos # define YYSTYPE_IS_DECLARED 1
228 1.1 christos #endif
229 1.1 christos
230 1.1 christos
231 1.1 christos extern YYSTYPE yylval;
232 1.1 christos
233 1.1 christos
234 1.1 christos int yyparse (void);
235 1.1 christos
236 1.1 christos
237 1.1 christos
238 1.1 christos /* Symbol kind. */
239 1.1 christos enum yysymbol_kind_t
240 1.1 christos {
241 1.1 christos YYSYMBOL_YYEMPTY = -2,
242 1.1 christos YYSYMBOL_YYEOF = 0, /* "end of file" */
243 1.1 christos YYSYMBOL_YYerror = 1, /* error */
244 1.1 christos YYSYMBOL_YYUNDEF = 2, /* "invalid token" */
245 1.1 christos YYSYMBOL_DR = 3, /* DR */
246 1.1 christos YYSYMBOL_AR = 4, /* AR */
247 1.1 christos YYSYMBOL_FPR = 5, /* FPR */
248 1.1 christos YYSYMBOL_FPCR = 6, /* FPCR */
249 1.1 christos YYSYMBOL_LPC = 7, /* LPC */
250 1.1 christos YYSYMBOL_ZAR = 8, /* ZAR */
251 1.1 christos YYSYMBOL_ZDR = 9, /* ZDR */
252 1.1 christos YYSYMBOL_LZPC = 10, /* LZPC */
253 1.1 christos YYSYMBOL_CREG = 11, /* CREG */
254 1.1 christos YYSYMBOL_INDEXREG = 12, /* INDEXREG */
255 1.1 christos YYSYMBOL_EXPR = 13, /* EXPR */
256 1.1 christos YYSYMBOL_14_ = 14, /* '&' */
257 1.1 christos YYSYMBOL_15_ = 15, /* '<' */
258 1.1 christos YYSYMBOL_16_ = 16, /* '>' */
259 1.1 christos YYSYMBOL_17_ = 17, /* '#' */
260 1.1 christos YYSYMBOL_18_ = 18, /* '(' */
261 1.1 christos YYSYMBOL_19_ = 19, /* ')' */
262 1.1 christos YYSYMBOL_20_ = 20, /* '+' */
263 1.1 christos YYSYMBOL_21_ = 21, /* '-' */
264 1.1 christos YYSYMBOL_22_ = 22, /* ',' */
265 1.1 christos YYSYMBOL_23_ = 23, /* '[' */
266 1.1 christos YYSYMBOL_24_ = 24, /* ']' */
267 1.1 christos YYSYMBOL_25_ = 25, /* '@' */
268 1.1 christos YYSYMBOL_26_ = 26, /* '/' */
269 1.1 christos YYSYMBOL_YYACCEPT = 27, /* $accept */
270 1.1 christos YYSYMBOL_operand = 28, /* operand */
271 1.1 christos YYSYMBOL_optional_ampersand = 29, /* optional_ampersand */
272 1.1 christos YYSYMBOL_generic_operand = 30, /* generic_operand */
273 1.1 christos YYSYMBOL_motorola_operand = 31, /* motorola_operand */
274 1.1 christos YYSYMBOL_mit_operand = 32, /* mit_operand */
275 1.1 christos YYSYMBOL_zireg = 33, /* zireg */
276 1.1 christos YYSYMBOL_zdireg = 34, /* zdireg */
277 1.1 christos YYSYMBOL_zadr = 35, /* zadr */
278 1.1 christos YYSYMBOL_zdr = 36, /* zdr */
279 1.1 christos YYSYMBOL_apc = 37, /* apc */
280 1.1 christos YYSYMBOL_zapc = 38, /* zapc */
281 1.1 christos YYSYMBOL_optzapc = 39, /* optzapc */
282 1.1 christos YYSYMBOL_zpc = 40, /* zpc */
283 1.1 christos YYSYMBOL_optczapc = 41, /* optczapc */
284 1.1 christos YYSYMBOL_optcexpr = 42, /* optcexpr */
285 1.1 christos YYSYMBOL_optexprc = 43, /* optexprc */
286 1.1 christos YYSYMBOL_reglist = 44, /* reglist */
287 1.1 christos YYSYMBOL_ireglist = 45, /* ireglist */
288 1.1 christos YYSYMBOL_reglistpair = 46, /* reglistpair */
289 1.1 christos YYSYMBOL_reglistreg = 47 /* reglistreg */
290 1.1 christos };
291 1.1 christos typedef enum yysymbol_kind_t yysymbol_kind_t;
292 1.1 christos
293 1.1 christos
294 1.1 christos
295 1.1 christos
296 1.1 christos #ifdef short
297 1.1 christos # undef short
298 1.1 christos #endif
299 1.1 christos
300 1.1 christos /* On compilers that do not define __PTRDIFF_MAX__ etc., make sure
301 1.1 christos <limits.h> and (if available) <stdint.h> are included
302 1.1 christos so that the code can choose integer types of a good width. */
303 1.1 christos
304 1.1 christos #ifndef __PTRDIFF_MAX__
305 1.1 christos # include <limits.h> /* INFRINGES ON USER NAME SPACE */
306 1.1 christos # if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
307 1.1 christos # include <stdint.h> /* INFRINGES ON USER NAME SPACE */
308 1.1 christos # define YY_STDINT_H
309 1.1 christos # endif
310 1.1 christos #endif
311 1.1 christos
312 1.1 christos /* Narrow types that promote to a signed type and that can represent a
313 1.1 christos signed or unsigned integer of at least N bits. In tables they can
314 1.1 christos save space and decrease cache pressure. Promoting to a signed type
315 1.1 christos helps avoid bugs in integer arithmetic. */
316 1.1 christos
317 1.1 christos #ifdef __INT_LEAST8_MAX__
318 1.1 christos typedef __INT_LEAST8_TYPE__ yytype_int8;
319 1.1 christos #elif defined YY_STDINT_H
320 1.1 christos typedef int_least8_t yytype_int8;
321 1.1 christos #else
322 1.1 christos typedef signed char yytype_int8;
323 1.1 christos #endif
324 1.1 christos
325 1.1 christos #ifdef __INT_LEAST16_MAX__
326 1.1 christos typedef __INT_LEAST16_TYPE__ yytype_int16;
327 1.1 christos #elif defined YY_STDINT_H
328 1.1 christos typedef int_least16_t yytype_int16;
329 1.1 christos #else
330 1.1 christos typedef short yytype_int16;
331 1.1 christos #endif
332 1.1 christos
333 1.1 christos /* Work around bug in HP-UX 11.23, which defines these macros
334 1.1 christos incorrectly for preprocessor constants. This workaround can likely
335 1.1 christos be removed in 2023, as HPE has promised support for HP-UX 11.23
336 1.1 christos (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of
337 1.1 christos <https://h20195.www2.hpe.com/V2/getpdf.aspx/4AA4-7673ENW.pdf>. */
338 1.1 christos #ifdef __hpux
339 1.1 christos # undef UINT_LEAST8_MAX
340 1.1 christos # undef UINT_LEAST16_MAX
341 1.1 christos # define UINT_LEAST8_MAX 255
342 1.1 christos # define UINT_LEAST16_MAX 65535
343 1.1 christos #endif
344 1.1 christos
345 1.1 christos #if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__
346 1.1 christos typedef __UINT_LEAST8_TYPE__ yytype_uint8;
347 1.1 christos #elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \
348 1.1 christos && UINT_LEAST8_MAX <= INT_MAX)
349 1.1 christos typedef uint_least8_t yytype_uint8;
350 1.1 christos #elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX
351 1.1 christos typedef unsigned char yytype_uint8;
352 1.1 christos #else
353 1.1 christos typedef short yytype_uint8;
354 1.1 christos #endif
355 1.1 christos
356 1.1 christos #if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__
357 1.1 christos typedef __UINT_LEAST16_TYPE__ yytype_uint16;
358 1.1 christos #elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \
359 1.1 christos && UINT_LEAST16_MAX <= INT_MAX)
360 1.1 christos typedef uint_least16_t yytype_uint16;
361 1.1 christos #elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX
362 1.1 christos typedef unsigned short yytype_uint16;
363 1.1 christos #else
364 1.1 christos typedef int yytype_uint16;
365 1.1 christos #endif
366 1.1 christos
367 1.1 christos #ifndef YYPTRDIFF_T
368 1.1 christos # if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__
369 1.1 christos # define YYPTRDIFF_T __PTRDIFF_TYPE__
370 1.1 christos # define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__
371 1.1 christos # elif defined PTRDIFF_MAX
372 1.1 christos # ifndef ptrdiff_t
373 1.1 christos # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
374 1.1 christos # endif
375 1.1 christos # define YYPTRDIFF_T ptrdiff_t
376 1.1 christos # define YYPTRDIFF_MAXIMUM PTRDIFF_MAX
377 1.1 christos # else
378 1.1 christos # define YYPTRDIFF_T long
379 1.1 christos # define YYPTRDIFF_MAXIMUM LONG_MAX
380 1.1 christos # endif
381 1.1 christos #endif
382 1.1 christos
383 1.1 christos #ifndef YYSIZE_T
384 1.1 christos # ifdef __SIZE_TYPE__
385 1.1 christos # define YYSIZE_T __SIZE_TYPE__
386 1.1 christos # elif defined size_t
387 1.1 christos # define YYSIZE_T size_t
388 1.1 christos # elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
389 1.1 christos # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
390 1.1 christos # define YYSIZE_T size_t
391 1.1 christos # else
392 1.1 christos # define YYSIZE_T unsigned
393 1.1 christos # endif
394 1.1 christos #endif
395 1.1 christos
396 1.1 christos #define YYSIZE_MAXIMUM \
397 1.1 christos YY_CAST (YYPTRDIFF_T, \
398 1.1 christos (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1) \
399 1.1 christos ? YYPTRDIFF_MAXIMUM \
400 1.1 christos : YY_CAST (YYSIZE_T, -1)))
401 1.1 christos
402 1.1 christos #define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X))
403 1.1 christos
404 1.1 christos
405 1.1 christos /* Stored state numbers (used for stacks). */
406 1.1 christos typedef yytype_uint8 yy_state_t;
407 1.1 christos
408 1.1 christos /* State numbers in computations. */
409 1.1 christos typedef int yy_state_fast_t;
410 1.1 christos
411 1.1 christos #ifndef YY_
412 1.1 christos # if defined YYENABLE_NLS && YYENABLE_NLS
413 1.1 christos # if ENABLE_NLS
414 1.1 christos # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
415 1.1 christos # define YY_(Msgid) dgettext ("bison-runtime", Msgid)
416 1.1 christos # endif
417 1.1 christos # endif
418 1.1 christos # ifndef YY_
419 1.1 christos # define YY_(Msgid) Msgid
420 1.1 christos # endif
421 1.1 christos #endif
422 1.1 christos
423 1.1 christos
424 1.1 christos #ifndef YY_ATTRIBUTE_PURE
425 1.1 christos # if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__)
426 1.1 christos # define YY_ATTRIBUTE_PURE __attribute__ ((__pure__))
427 1.1 christos # else
428 1.1 christos # define YY_ATTRIBUTE_PURE
429 1.1 christos # endif
430 1.1 christos #endif
431 1.1 christos
432 1.1 christos #ifndef YY_ATTRIBUTE_UNUSED
433 1.1 christos # if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
434 1.1 christos # define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
435 1.1 christos # else
436 1.1 christos # define YY_ATTRIBUTE_UNUSED
437 1.1 christos # endif
438 1.1 christos #endif
439 1.1 christos
440 1.1 christos /* Suppress unused-variable warnings by "using" E. */
441 1.1 christos #if ! defined lint || defined __GNUC__
442 1.1 christos # define YY_USE(E) ((void) (E))
443 1.1 christos #else
444 1.1 christos # define YY_USE(E) /* empty */
445 1.1 christos #endif
446 1.1 christos
447 1.1 christos /* Suppress an incorrect diagnostic about yylval being uninitialized. */
448 1.1 christos #if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__
449 1.1 christos # if __GNUC__ * 100 + __GNUC_MINOR__ < 407
450 1.1 christos # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
451 1.1 christos _Pragma ("GCC diagnostic push") \
452 1.1 christos _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")
453 1.1 christos # else
454 1.1 christos # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
455 1.1 christos _Pragma ("GCC diagnostic push") \
456 1.1 christos _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \
457 1.1 christos _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
458 1.1 christos # endif
459 1.1 christos # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
460 1.1 christos _Pragma ("GCC diagnostic pop")
461 1.1 christos #else
462 1.1 christos # define YY_INITIAL_VALUE(Value) Value
463 1.1 christos #endif
464 1.1 christos #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
465 1.1 christos # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
466 1.1 christos # define YY_IGNORE_MAYBE_UNINITIALIZED_END
467 1.1 christos #endif
468 1.1 christos #ifndef YY_INITIAL_VALUE
469 1.1 christos # define YY_INITIAL_VALUE(Value) /* Nothing. */
470 1.1 christos #endif
471 1.1 christos
472 1.1 christos #if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__
473 1.1 christos # define YY_IGNORE_USELESS_CAST_BEGIN \
474 1.1 christos _Pragma ("GCC diagnostic push") \
475 1.1 christos _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"")
476 1.1 christos # define YY_IGNORE_USELESS_CAST_END \
477 1.1 christos _Pragma ("GCC diagnostic pop")
478 1.1 christos #endif
479 1.1 christos #ifndef YY_IGNORE_USELESS_CAST_BEGIN
480 1.1 christos # define YY_IGNORE_USELESS_CAST_BEGIN
481 1.1 christos # define YY_IGNORE_USELESS_CAST_END
482 1.1 christos #endif
483 1.1 christos
484 1.1 christos
485 1.1 christos #define YY_ASSERT(E) ((void) (0 && (E)))
486 1.1 christos
487 1.1 christos #if !defined yyoverflow
488 1.1 christos
489 1.1 christos /* The parser invokes alloca or malloc; define the necessary symbols. */
490 1.1 christos
491 1.1 christos # ifdef YYSTACK_USE_ALLOCA
492 1.1 christos # if YYSTACK_USE_ALLOCA
493 1.1 christos # ifdef __GNUC__
494 1.1 christos # define YYSTACK_ALLOC __builtin_alloca
495 1.1 christos # elif defined __BUILTIN_VA_ARG_INCR
496 1.1 christos # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
497 1.1 christos # elif defined _AIX
498 1.1 christos # define YYSTACK_ALLOC __alloca
499 1.1 christos # elif defined _MSC_VER
500 1.1 christos # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
501 1.1 christos # define alloca _alloca
502 1.1 christos # else
503 1.1 christos # define YYSTACK_ALLOC alloca
504 1.1 christos # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
505 1.1 christos # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
506 1.1 christos /* Use EXIT_SUCCESS as a witness for stdlib.h. */
507 1.1 christos # ifndef EXIT_SUCCESS
508 1.1 christos # define EXIT_SUCCESS 0
509 1.1 christos # endif
510 1.1 christos # endif
511 1.1 christos # endif
512 1.1 christos # endif
513 1.1 christos # endif
514 1.1 christos
515 1.1 christos # ifdef YYSTACK_ALLOC
516 1.1 christos /* Pacify GCC's 'empty if-body' warning. */
517 1.1 christos # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
518 1.1 christos # ifndef YYSTACK_ALLOC_MAXIMUM
519 1.1 christos /* The OS might guarantee only one guard page at the bottom of the stack,
520 1.1 christos and a page size can be as small as 4096 bytes. So we cannot safely
521 1.1 christos invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
522 1.1 christos to allow for a few compiler-allocated temporary stack slots. */
523 1.1 christos # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
524 1.1 christos # endif
525 1.1 christos # else
526 1.1 christos # define YYSTACK_ALLOC YYMALLOC
527 1.1 christos # define YYSTACK_FREE YYFREE
528 1.1 christos # ifndef YYSTACK_ALLOC_MAXIMUM
529 1.1 christos # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
530 1.1 christos # endif
531 1.1 christos # if (defined __cplusplus && ! defined EXIT_SUCCESS \
532 1.1 christos && ! ((defined YYMALLOC || defined malloc) \
533 1.1 christos && (defined YYFREE || defined free)))
534 1.1 christos # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
535 1.1 christos # ifndef EXIT_SUCCESS
536 1.1 christos # define EXIT_SUCCESS 0
537 1.1 christos # endif
538 1.1 christos # endif
539 1.1 christos # ifndef YYMALLOC
540 1.1 christos # define YYMALLOC malloc
541 1.1 christos # if ! defined malloc && ! defined EXIT_SUCCESS
542 1.1 christos void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
543 1.1 christos # endif
544 1.1 christos # endif
545 1.1 christos # ifndef YYFREE
546 1.1 christos # define YYFREE free
547 1.1 christos # if ! defined free && ! defined EXIT_SUCCESS
548 1.1 christos void free (void *); /* INFRINGES ON USER NAME SPACE */
549 1.1 christos # endif
550 1.1 christos # endif
551 1.1 christos # endif
552 1.1 christos #endif /* !defined yyoverflow */
553 1.1 christos
554 1.1 christos #if (! defined yyoverflow \
555 1.1 christos && (! defined __cplusplus \
556 1.1 christos || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
557 1.1 christos
558 1.1 christos /* A type that is properly aligned for any stack member. */
559 1.1 christos union yyalloc
560 1.1 christos {
561 1.1 christos yy_state_t yyss_alloc;
562 1.1 christos YYSTYPE yyvs_alloc;
563 1.1 christos };
564 1.1 christos
565 1.1 christos /* The size of the maximum gap between one aligned stack and the next. */
566 1.1 christos # define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1)
567 1.1 christos
568 1.1 christos /* The size of an array large to enough to hold all stacks, each with
569 1.1 christos N elements. */
570 1.1 christos # define YYSTACK_BYTES(N) \
571 1.1 christos ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE)) \
572 1.1 christos + YYSTACK_GAP_MAXIMUM)
573 1.1 christos
574 1.1 christos # define YYCOPY_NEEDED 1
575 1.1 christos
576 1.1 christos /* Relocate STACK from its old location to the new one. The
577 1.1 christos local variables YYSIZE and YYSTACKSIZE give the old and new number of
578 1.1 christos elements in the stack, and YYPTR gives the new location of the
579 1.1 christos stack. Advance YYPTR to a properly aligned location for the next
580 1.1 christos stack. */
581 1.1 christos # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
582 1.1 christos do \
583 1.1 christos { \
584 1.1 christos YYPTRDIFF_T yynewbytes; \
585 1.1 christos YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
586 1.1 christos Stack = &yyptr->Stack_alloc; \
587 1.1 christos yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \
588 1.1 christos yyptr += yynewbytes / YYSIZEOF (*yyptr); \
589 1.1 christos } \
590 1.1 christos while (0)
591 1.1 christos
592 1.1 christos #endif
593 1.1 christos
594 1.1 christos #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
595 1.1 christos /* Copy COUNT objects from SRC to DST. The source and destination do
596 1.1 christos not overlap. */
597 1.1 christos # ifndef YYCOPY
598 1.1 christos # if defined __GNUC__ && 1 < __GNUC__
599 1.1 christos # define YYCOPY(Dst, Src, Count) \
600 1.1 christos __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src)))
601 1.1 christos # else
602 1.1 christos # define YYCOPY(Dst, Src, Count) \
603 1.1 christos do \
604 1.1 christos { \
605 1.1 christos YYPTRDIFF_T yyi; \
606 1.1 christos for (yyi = 0; yyi < (Count); yyi++) \
607 1.1 christos (Dst)[yyi] = (Src)[yyi]; \
608 1.1 christos } \
609 1.1 christos while (0)
610 1.1 christos # endif
611 1.1 christos # endif
612 1.1 christos #endif /* !YYCOPY_NEEDED */
613 1.1 christos
614 1.1 christos /* YYFINAL -- State number of the termination state. */
615 1.1 christos #define YYFINAL 44
616 1.1 christos /* YYLAST -- Last index in YYTABLE. */
617 1.1 christos #define YYLAST 215
618 1.1 christos
619 1.1 christos /* YYNTOKENS -- Number of terminals. */
620 1.1 christos #define YYNTOKENS 27
621 1.1 christos /* YYNNTS -- Number of nonterminals. */
622 1.1 christos #define YYNNTS 21
623 1.1 christos /* YYNRULES -- Number of rules. */
624 1.1 christos #define YYNRULES 89
625 1.1 christos /* YYNSTATES -- Number of states. */
626 1.1 christos #define YYNSTATES 180
627 1.1 christos
628 1.1 christos /* YYMAXUTOK -- Last valid token kind. */
629 1.1 christos #define YYMAXUTOK 268
630 1.1 christos
631 1.1 christos
632 1.1 christos /* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
633 1.1 christos as returned by yylex, with out-of-bounds checking. */
634 1.1 christos #define YYTRANSLATE(YYX) \
635 1.1 christos (0 <= (YYX) && (YYX) <= YYMAXUTOK \
636 1.1 christos ? YY_CAST (yysymbol_kind_t, yytranslate[YYX]) \
637 1.1 christos : YYSYMBOL_YYUNDEF)
638 1.1 christos
639 1.1 christos /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
640 1.1 christos as returned by yylex. */
641 1.1 christos static const yytype_int8 yytranslate[] =
642 1.1 christos {
643 1.1 christos 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
644 1.1 christos 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
645 1.1 christos 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
646 1.1 christos 2, 2, 2, 2, 2, 17, 2, 2, 14, 2,
647 1.1 christos 18, 19, 2, 20, 22, 21, 2, 26, 2, 2,
648 1.1 christos 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
649 1.1 christos 15, 2, 16, 2, 25, 2, 2, 2, 2, 2,
650 1.1 christos 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
651 1.1 christos 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
652 1.1 christos 2, 23, 2, 24, 2, 2, 2, 2, 2, 2,
653 1.1 christos 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
654 1.1 christos 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
655 1.1 christos 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
656 1.1 christos 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
657 1.1 christos 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
658 1.1 christos 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
659 1.1 christos 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
660 1.1 christos 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
661 1.1 christos 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
662 1.1 christos 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
663 1.1 christos 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
664 1.1 christos 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
665 1.1 christos 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
666 1.1 christos 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
667 1.1 christos 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
668 1.1 christos 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
669 1.1 christos 5, 6, 7, 8, 9, 10, 11, 12, 13
670 1.1 christos };
671 1.1 christos
672 1.1 christos #if YYDEBUG
673 1.1 christos /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
674 1.1 christos static const yytype_int16 yyrline[] =
675 1.1 christos {
676 1.1 christos 0, 120, 120, 121, 125, 134, 135, 142, 147, 152,
677 1.1 christos 157, 162, 167, 172, 177, 182, 187, 192, 205, 210,
678 1.1 christos 215, 220, 230, 240, 250, 255, 260, 265, 272, 283,
679 1.1 christos 290, 296, 303, 309, 320, 330, 337, 343, 351, 358,
680 1.1 christos 365, 371, 379, 386, 398, 409, 422, 430, 438, 446,
681 1.1 christos 456, 463, 471, 478, 492, 493, 506, 507, 519, 520,
682 1.1 christos 521, 527, 528, 534, 535, 542, 543, 544, 551, 554,
683 1.1 christos 560, 561, 568, 571, 581, 585, 595, 599, 608, 609,
684 1.1 christos 613, 625, 629, 630, 634, 641, 651, 655, 659, 663
685 1.1 christos };
686 1.1 christos #endif
687 1.1 christos
688 1.1 christos /** Accessing symbol of state STATE. */
689 1.1 christos #define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State])
690 1.1 christos
691 1.1 christos #if YYDEBUG || 0
692 1.1 christos /* The user-facing name of the symbol whose (internal) number is
693 1.1 christos YYSYMBOL. No bounds checking. */
694 1.1 christos static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED;
695 1.1 christos
696 1.1 christos /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
697 1.1 christos First, the terminals, then, starting at YYNTOKENS, nonterminals. */
698 1.1 christos static const char *const yytname[] =
699 1.1 christos {
700 1.1 christos "\"end of file\"", "error", "\"invalid token\"", "DR", "AR", "FPR",
701 1.1 christos "FPCR", "LPC", "ZAR", "ZDR", "LZPC", "CREG", "INDEXREG", "EXPR", "'&'",
702 1.1 christos "'<'", "'>'", "'#'", "'('", "')'", "'+'", "'-'", "','", "'['", "']'",
703 1.1 christos "'@'", "'/'", "$accept", "operand", "optional_ampersand",
704 1.1 christos "generic_operand", "motorola_operand", "mit_operand", "zireg", "zdireg",
705 1.1 christos "zadr", "zdr", "apc", "zapc", "optzapc", "zpc", "optczapc", "optcexpr",
706 1.1 christos "optexprc", "reglist", "ireglist", "reglistpair", "reglistreg", YY_NULLPTR
707 1.1 christos };
708 1.1 christos
709 1.1 christos static const char *
710 1.1 christos yysymbol_name (yysymbol_kind_t yysymbol)
711 1.1 christos {
712 1.1 christos return yytname[yysymbol];
713 1.1 christos }
714 1.1 christos #endif
715 1.1 christos
716 1.1 christos #define YYPACT_NINF (-98)
717 1.1 christos
718 1.1 christos #define yypact_value_is_default(Yyn) \
719 1.1 christos ((Yyn) == YYPACT_NINF)
720 1.1 christos
721 1.1 christos #define YYTABLE_NINF (-64)
722 1.1 christos
723 1.1 christos #define yytable_value_is_error(Yyn) \
724 1.1 christos 0
725 1.1 christos
726 1.1 christos /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
727 1.1 christos STATE-NUM. */
728 1.1 christos static const yytype_int16 yypact[] =
729 1.1 christos {
730 1.1 christos 89, 14, 9, 31, 35, -98, -98, -98, -98, 0,
731 1.1 christos 36, 42, 28, 56, 63, 67, 90, -98, 75, 75,
732 1.1 christos -98, -98, 86, -98, 96, -15, 123, -98, -98, -98,
733 1.1 christos -98, -98, 97, 115, 119, -98, 120, -98, 122, 16,
734 1.1 christos 126, -98, 127, 157, -98, -98, -98, -98, 19, 154,
735 1.1 christos 154, 154, -98, 140, 29, 144, -98, -98, -98, 123,
736 1.1 christos 141, 99, 18, 70, 147, 105, 148, 152, -98, -98,
737 1.1 christos -98, -98, -98, -98, -98, 142, -13, -98, -98, 146,
738 1.1 christos 150, -98, 133, -98, 140, 60, 146, 149, 133, 153,
739 1.1 christos 140, 151, -98, -98, -98, -98, -98, -98, -98, 155,
740 1.1 christos 158, -98, -98, 159, -98, 62, 143, 154, 154, -98,
741 1.1 christos 160, 161, 162, -98, 133, 163, 164, 165, 166, 116,
742 1.1 christos 168, 167, -98, -98, -98, -98, 169, -98, 173, -98,
743 1.1 christos -98, -98, -98, -98, 174, 176, 133, 116, 177, 175,
744 1.1 christos 175, -98, 175, -98, 175, 170, 178, -98, -98, 180,
745 1.1 christos 181, 175, -98, 171, 179, 182, 183, 187, 186, 189,
746 1.1 christos 175, 175, 190, -98, -98, -98, -98, 79, 143, 195,
747 1.1 christos 191, 192, -98, -98, 193, 194, -98, -98, -98, -98
748 1.1 christos };
749 1.1 christos
750 1.1 christos /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
751 1.1 christos Performed when YYTABLE does not specify something else to do. Zero
752 1.1 christos means the default is an error. */
753 1.1 christos static const yytype_int8 yydefact[] =
754 1.1 christos {
755 1.1 christos 68, 86, 87, 88, 89, 64, 67, 66, 13, 14,
756 1.1 christos 0, 0, 0, 0, 0, 0, 0, 2, 5, 5,
757 1.1 christos 65, 69, 0, 17, 78, 0, 0, 16, 7, 8,
758 1.1 christos 15, 61, 63, 64, 67, 62, 66, 56, 0, 76,
759 1.1 christos 72, 57, 0, 0, 1, 6, 3, 4, 46, 0,
760 1.1 christos 0, 0, 63, 72, 0, 18, 24, 25, 26, 0,
761 1.1 christos 72, 0, 0, 0, 0, 0, 0, 76, 47, 48,
762 1.1 christos 86, 87, 88, 89, 79, 82, 81, 85, 80, 0,
763 1.1 christos 0, 23, 0, 19, 72, 0, 77, 0, 0, 74,
764 1.1 christos 72, 0, 73, 36, 59, 70, 60, 71, 54, 0,
765 1.1 christos 0, 55, 58, 0, 20, 0, 0, 0, 0, 35,
766 1.1 christos 0, 0, 0, 21, 0, 73, 74, 0, 0, 0,
767 1.1 christos 0, 0, 30, 22, 32, 34, 49, 77, 0, 83,
768 1.1 christos 84, 31, 33, 29, 0, 0, 0, 0, 0, 74,
769 1.1 christos 74, 75, 74, 40, 74, 0, 50, 27, 28, 0,
770 1.1 christos 0, 74, 38, 0, 0, 0, 0, 0, 76, 0,
771 1.1 christos 74, 74, 0, 42, 44, 39, 45, 0, 0, 0,
772 1.1 christos 0, 0, 37, 52, 0, 0, 41, 43, 51, 53
773 1.1 christos };
774 1.1 christos
775 1.1 christos /* YYPGOTO[NTERM-NUM]. */
776 1.1 christos static const yytype_int16 yypgoto[] =
777 1.1 christos {
778 1.1 christos -98, -98, 196, -98, -98, -98, -81, 6, -98, -9,
779 1.1 christos -98, 2, -98, -78, -38, -97, -67, -98, -48, 172,
780 1.1 christos 12
781 1.1 christos };
782 1.1 christos
783 1.1 christos /* YYDEFGOTO[NTERM-NUM]. */
784 1.1 christos static const yytype_int8 yydefgoto[] =
785 1.1 christos {
786 1.1 christos 0, 16, 46, 17, 18, 19, 100, 40, 101, 102,
787 1.1 christos 20, 92, 22, 103, 64, 120, 62, 23, 74, 75,
788 1.1 christos 76
789 1.1 christos };
790 1.1 christos
791 1.1 christos /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
792 1.1 christos positive, shift that token. If negative, reduce the rule whose
793 1.1 christos number is the opposite. If YYTABLE_NINF, syntax error. */
794 1.1 christos static const yytype_int16 yytable[] =
795 1.1 christos {
796 1.1 christos 106, 110, 21, 78, 111, 41, 50, 117, 50, -10,
797 1.1 christos 118, 51, 25, 108, -9, 80, 42, 41, 26, 138,
798 1.1 christos 52, 31, 87, 5, 6, 128, 7, 35, 54, 60,
799 1.1 christos 37, -11, 53, 134, -63, -12, 135, 67, 142, 68,
800 1.1 christos 69, 61, 154, 155, 29, 156, 112, 157, 81, 27,
801 1.1 christos 41, 82, 121, 41, 162, 149, 151, 28, 150, 129,
802 1.1 christos 130, 85, 77, 170, 171, 84, 31, 32, 90, 30,
803 1.1 christos 33, 34, 35, 36, 52, 37, 38, 5, 6, 113,
804 1.1 christos 7, 126, 114, 91, 127, 43, 39, 174, 115, 45,
805 1.1 christos 44, 168, 1, 2, 3, 4, 5, 6, 173, 7,
806 1.1 christos 8, 127, 9, 10, 11, 12, 13, 14, 31, 94,
807 1.1 christos 15, 48, 95, 96, 35, 97, 55, 98, 99, 31,
808 1.1 christos 94, 88, 49, 89, 96, 35, 31, 52, 98, 141,
809 1.1 christos 5, 6, 35, 7, 56, 37, 31, 94, 57, 58,
810 1.1 christos 95, 96, 35, 97, 59, 98, 31, 94, 63, 65,
811 1.1 christos 52, 96, 35, 5, 6, 98, 7, 70, 71, 72,
812 1.1 christos 73, 66, 79, 86, 83, 105, 93, 104, 107, 109,
813 1.1 christos 122, 0, 24, 116, 123, 119, 0, 124, 125, 131,
814 1.1 christos 132, 133, 0, 0, 141, 136, 137, 143, 158, 139,
815 1.1 christos 140, 144, 146, 147, 145, 148, 152, 153, 163, 167,
816 1.1 christos 0, 164, 165, 159, 160, 161, 166, 169, 175, 172,
817 1.1 christos 176, 177, 178, 179, 0, 47
818 1.1 christos };
819 1.1 christos
820 1.1 christos static const yytype_int16 yycheck[] =
821 1.1 christos {
822 1.1 christos 67, 82, 0, 51, 82, 14, 21, 88, 21, 0,
823 1.1 christos 88, 26, 0, 26, 0, 53, 14, 26, 18, 116,
824 1.1 christos 4, 3, 60, 7, 8, 106, 10, 9, 26, 13,
825 1.1 christos 12, 0, 26, 114, 25, 0, 114, 18, 119, 20,
826 1.1 christos 21, 39, 139, 140, 16, 142, 84, 144, 19, 13,
827 1.1 christos 59, 22, 90, 62, 151, 136, 137, 15, 136, 107,
828 1.1 christos 108, 59, 50, 160, 161, 59, 3, 4, 62, 13,
829 1.1 christos 7, 8, 9, 10, 4, 12, 13, 7, 8, 19,
830 1.1 christos 10, 19, 22, 13, 22, 18, 23, 168, 86, 14,
831 1.1 christos 0, 158, 3, 4, 5, 6, 7, 8, 19, 10,
832 1.1 christos 11, 22, 13, 14, 15, 16, 17, 18, 3, 4,
833 1.1 christos 21, 25, 7, 8, 9, 10, 19, 12, 13, 3,
834 1.1 christos 4, 22, 26, 24, 8, 9, 3, 4, 12, 13,
835 1.1 christos 7, 8, 9, 10, 19, 12, 3, 4, 19, 19,
836 1.1 christos 7, 8, 9, 10, 22, 12, 3, 4, 22, 22,
837 1.1 christos 4, 8, 9, 7, 8, 12, 10, 3, 4, 5,
838 1.1 christos 6, 4, 22, 22, 20, 13, 19, 19, 26, 19,
839 1.1 christos 19, -1, 0, 24, 19, 22, -1, 19, 19, 19,
840 1.1 christos 19, 19, -1, -1, 13, 22, 22, 19, 18, 24,
841 1.1 christos 24, 24, 19, 19, 25, 19, 19, 22, 19, 13,
842 1.1 christos -1, 19, 19, 25, 24, 24, 19, 18, 13, 19,
843 1.1 christos 19, 19, 19, 19, -1, 19
844 1.1 christos };
845 1.1 christos
846 1.1 christos /* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of
847 1.1 christos state STATE-NUM. */
848 1.1 christos static const yytype_int8 yystos[] =
849 1.1 christos {
850 1.1 christos 0, 3, 4, 5, 6, 7, 8, 10, 11, 13,
851 1.1 christos 14, 15, 16, 17, 18, 21, 28, 30, 31, 32,
852 1.1 christos 37, 38, 39, 44, 46, 47, 18, 13, 15, 16,
853 1.1 christos 13, 3, 4, 7, 8, 9, 10, 12, 13, 23,
854 1.1 christos 34, 36, 38, 18, 0, 14, 29, 29, 25, 26,
855 1.1 christos 21, 26, 4, 34, 38, 19, 19, 19, 19, 22,
856 1.1 christos 13, 38, 43, 22, 41, 22, 4, 18, 20, 21,
857 1.1 christos 3, 4, 5, 6, 45, 46, 47, 47, 45, 22,
858 1.1 christos 41, 19, 22, 20, 34, 38, 22, 41, 22, 24,
859 1.1 christos 34, 13, 38, 19, 4, 7, 8, 10, 12, 13,
860 1.1 christos 33, 35, 36, 40, 19, 13, 43, 26, 26, 19,
861 1.1 christos 33, 40, 41, 19, 22, 38, 24, 33, 40, 22,
862 1.1 christos 42, 41, 19, 19, 19, 19, 19, 22, 33, 45,
863 1.1 christos 45, 19, 19, 19, 33, 40, 22, 22, 42, 24,
864 1.1 christos 24, 13, 33, 19, 24, 25, 19, 19, 19, 33,
865 1.1 christos 40, 33, 19, 22, 42, 42, 42, 42, 18, 25,
866 1.1 christos 24, 24, 42, 19, 19, 19, 19, 13, 43, 18,
867 1.1 christos 42, 42, 19, 19, 33, 13, 19, 19, 19, 19
868 1.1 christos };
869 1.1 christos
870 1.1 christos /* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */
871 1.1 christos static const yytype_int8 yyr1[] =
872 1.1 christos {
873 1.1 christos 0, 27, 28, 28, 28, 29, 29, 30, 30, 30,
874 1.1 christos 30, 30, 30, 30, 30, 30, 30, 30, 31, 31,
875 1.1 christos 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
876 1.1 christos 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
877 1.1 christos 31, 31, 31, 31, 31, 31, 32, 32, 32, 32,
878 1.1 christos 32, 32, 32, 32, 33, 33, 34, 34, 35, 35,
879 1.1 christos 35, 36, 36, 37, 37, 38, 38, 38, 39, 39,
880 1.1 christos 40, 40, 41, 41, 42, 42, 43, 43, 44, 44,
881 1.1 christos 44, 45, 45, 45, 45, 46, 47, 47, 47, 47
882 1.1 christos };
883 1.1 christos
884 1.1 christos /* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */
885 1.1 christos static const yytype_int8 yyr2[] =
886 1.1 christos {
887 1.1 christos 0, 2, 1, 2, 2, 0, 1, 2, 2, 1,
888 1.1 christos 1, 1, 1, 1, 1, 2, 2, 1, 3, 4,
889 1.1 christos 4, 5, 5, 4, 3, 3, 3, 7, 7, 6,
890 1.1 christos 5, 6, 5, 6, 5, 5, 4, 9, 7, 8,
891 1.1 christos 6, 10, 8, 10, 8, 8, 2, 3, 3, 5,
892 1.1 christos 6, 10, 9, 10, 1, 1, 1, 1, 1, 1,
893 1.1 christos 1, 1, 1, 1, 1, 1, 1, 1, 0, 1,
894 1.1 christos 1, 1, 0, 2, 0, 2, 0, 2, 1, 3,
895 1.1 christos 3, 1, 1, 3, 3, 3, 1, 1, 1, 1
896 1.1 christos };
897 1.1 christos
898 1.1 christos
899 1.1 christos enum { YYENOMEM = -2 };
900 1.1 christos
901 1.1 christos #define yyerrok (yyerrstatus = 0)
902 1.1 christos #define yyclearin (yychar = YYEMPTY)
903 1.1 christos
904 1.1 christos #define YYACCEPT goto yyacceptlab
905 1.1 christos #define YYABORT goto yyabortlab
906 1.1 christos #define YYERROR goto yyerrorlab
907 1.1 christos #define YYNOMEM goto yyexhaustedlab
908 1.1 christos
909 1.1 christos
910 1.1 christos #define YYRECOVERING() (!!yyerrstatus)
911 1.1 christos
912 1.1 christos #define YYBACKUP(Token, Value) \
913 1.1 christos do \
914 1.1 christos if (yychar == YYEMPTY) \
915 1.1 christos { \
916 1.1 christos yychar = (Token); \
917 1.1 christos yylval = (Value); \
918 1.1 christos YYPOPSTACK (yylen); \
919 1.1 christos yystate = *yyssp; \
920 1.1 christos goto yybackup; \
921 1.1 christos } \
922 1.1 christos else \
923 1.1 christos { \
924 1.1 christos yyerror (YY_("syntax error: cannot back up")); \
925 1.1 christos YYERROR; \
926 1.1 christos } \
927 1.1 christos while (0)
928 1.1 christos
929 1.1 christos /* Backward compatibility with an undocumented macro.
930 1.1 christos Use YYerror or YYUNDEF. */
931 1.1 christos #define YYERRCODE YYUNDEF
932 1.1 christos
933 1.1 christos
934 1.1 christos /* Enable debugging if requested. */
935 1.1 christos #if YYDEBUG
936 1.1 christos
937 1.1 christos # ifndef YYFPRINTF
938 1.1 christos # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
939 1.1 christos # define YYFPRINTF fprintf
940 1.1 christos # endif
941 1.1 christos
942 1.1 christos # define YYDPRINTF(Args) \
943 1.1 christos do { \
944 1.1 christos if (yydebug) \
945 1.1 christos YYFPRINTF Args; \
946 1.1 christos } while (0)
947 1.1 christos
948 1.1 christos
949 1.1 christos
950 1.1 christos
951 1.1 christos # define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \
952 1.1 christos do { \
953 1.1 christos if (yydebug) \
954 1.1 christos { \
955 1.1 christos YYFPRINTF (stderr, "%s ", Title); \
956 1.1 christos yy_symbol_print (stderr, \
957 1.1 christos Kind, Value); \
958 1.1 christos YYFPRINTF (stderr, "\n"); \
959 1.1 christos } \
960 1.1 christos } while (0)
961 1.1 christos
962 1.1 christos
963 1.1 christos /*-----------------------------------.
964 1.1 christos | Print this symbol's value on YYO. |
965 1.1 christos `-----------------------------------*/
966 1.1 christos
967 1.1 christos static void
968 1.1 christos yy_symbol_value_print (FILE *yyo,
969 1.1 christos yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep)
970 1.1 christos {
971 1.1 christos FILE *yyoutput = yyo;
972 1.1 christos YY_USE (yyoutput);
973 1.1 christos if (!yyvaluep)
974 1.1 christos return;
975 1.1 christos YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
976 1.1 christos YY_USE (yykind);
977 1.1 christos YY_IGNORE_MAYBE_UNINITIALIZED_END
978 1.1 christos }
979 1.1 christos
980 1.1 christos
981 1.1 christos /*---------------------------.
982 1.1 christos | Print this symbol on YYO. |
983 1.1 christos `---------------------------*/
984 1.1 christos
985 1.1 christos static void
986 1.1 christos yy_symbol_print (FILE *yyo,
987 1.1 christos yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep)
988 1.1 christos {
989 1.1 christos YYFPRINTF (yyo, "%s %s (",
990 1.1 christos yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind));
991 1.1 christos
992 1.1 christos yy_symbol_value_print (yyo, yykind, yyvaluep);
993 1.1 christos YYFPRINTF (yyo, ")");
994 1.1 christos }
995 1.1 christos
996 1.1 christos /*------------------------------------------------------------------.
997 1.1 christos | yy_stack_print -- Print the state stack from its BOTTOM up to its |
998 1.1 christos | TOP (included). |
999 1.1 christos `------------------------------------------------------------------*/
1000 1.1 christos
1001 1.1 christos static void
1002 1.1 christos yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop)
1003 1.1 christos {
1004 1.1 christos YYFPRINTF (stderr, "Stack now");
1005 1.1 christos for (; yybottom <= yytop; yybottom++)
1006 1.1 christos {
1007 1.1 christos int yybot = *yybottom;
1008 1.1 christos YYFPRINTF (stderr, " %d", yybot);
1009 1.1 christos }
1010 1.1 christos YYFPRINTF (stderr, "\n");
1011 1.1 christos }
1012 1.1 christos
1013 1.1 christos # define YY_STACK_PRINT(Bottom, Top) \
1014 1.1 christos do { \
1015 1.1 christos if (yydebug) \
1016 1.1 christos yy_stack_print ((Bottom), (Top)); \
1017 1.1 christos } while (0)
1018 1.1 christos
1019 1.1 christos
1020 1.1 christos /*------------------------------------------------.
1021 1.1 christos | Report that the YYRULE is going to be reduced. |
1022 1.1 christos `------------------------------------------------*/
1023 1.1 christos
1024 1.1 christos static void
1025 1.1 christos yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp,
1026 1.1 christos int yyrule)
1027 1.1 christos {
1028 1.1 christos int yylno = yyrline[yyrule];
1029 1.1 christos int yynrhs = yyr2[yyrule];
1030 1.1 christos int yyi;
1031 1.1 christos YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n",
1032 1.1 christos yyrule - 1, yylno);
1033 1.1 christos /* The symbols being reduced. */
1034 1.1 christos for (yyi = 0; yyi < yynrhs; yyi++)
1035 1.1 christos {
1036 1.1 christos YYFPRINTF (stderr, " $%d = ", yyi + 1);
1037 1.1 christos yy_symbol_print (stderr,
1038 1.1 christos YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]),
1039 1.1 christos &yyvsp[(yyi + 1) - (yynrhs)]);
1040 1.1 christos YYFPRINTF (stderr, "\n");
1041 1.1 christos }
1042 1.1 christos }
1043 1.1 christos
1044 1.1 christos # define YY_REDUCE_PRINT(Rule) \
1045 1.1 christos do { \
1046 1.1 christos if (yydebug) \
1047 1.1 christos yy_reduce_print (yyssp, yyvsp, Rule); \
1048 1.1 christos } while (0)
1049 1.1 christos
1050 1.1 christos /* Nonzero means print parse trace. It is left uninitialized so that
1051 1.1 christos multiple parsers can coexist. */
1052 1.1 christos int yydebug;
1053 1.1 christos #else /* !YYDEBUG */
1054 1.1 christos # define YYDPRINTF(Args) ((void) 0)
1055 1.1 christos # define YY_SYMBOL_PRINT(Title, Kind, Value, Location)
1056 1.1 christos # define YY_STACK_PRINT(Bottom, Top)
1057 1.1 christos # define YY_REDUCE_PRINT(Rule)
1058 1.1 christos #endif /* !YYDEBUG */
1059 1.1 christos
1060 1.1 christos
1061 1.1 christos /* YYINITDEPTH -- initial size of the parser's stacks. */
1062 1.1 christos #ifndef YYINITDEPTH
1063 1.1 christos # define YYINITDEPTH 200
1064 1.1 christos #endif
1065 1.1 christos
1066 1.1 christos /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1067 1.1 christos if the built-in stack extension method is used).
1068 1.1 christos
1069 1.1 christos Do not make this value too large; the results are undefined if
1070 1.1 christos YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1071 1.1 christos evaluated with infinite-precision integer arithmetic. */
1072 1.1 christos
1073 1.1 christos #ifndef YYMAXDEPTH
1074 1.1 christos # define YYMAXDEPTH 10000
1075 1.1 christos #endif
1076 1.1 christos
1077 1.1 christos
1078 1.1 christos
1079 1.1 christos
1080 1.1 christos
1081 1.1 christos
1082 1.1 christos /*-----------------------------------------------.
1083 1.1 christos | Release the memory associated to this symbol. |
1084 1.1 christos `-----------------------------------------------*/
1085 1.1 christos
1086 1.1 christos static void
1087 1.1 christos yydestruct (const char *yymsg,
1088 1.1 christos yysymbol_kind_t yykind, YYSTYPE *yyvaluep)
1089 1.1 christos {
1090 1.1 christos YY_USE (yyvaluep);
1091 1.1 christos if (!yymsg)
1092 1.1 christos yymsg = "Deleting";
1093 1.1 christos YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp);
1094 1.1 christos
1095 1.1 christos YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1096 1.1 christos YY_USE (yykind);
1097 1.1 christos YY_IGNORE_MAYBE_UNINITIALIZED_END
1098 1.1 christos }
1099 1.1 christos
1100 1.1 christos
1101 1.1 christos /* Lookahead token kind. */
1102 1.1 christos int yychar;
1103 1.1 christos
1104 1.1 christos /* The semantic value of the lookahead symbol. */
1105 1.1 christos YYSTYPE yylval;
1106 1.1 christos /* Number of syntax errors so far. */
1107 1.1 christos int yynerrs;
1108 1.1 christos
1109 1.1 christos
1110 1.1 christos
1111 1.1 christos
1112 1.1 christos /*----------.
1113 1.1 christos | yyparse. |
1114 1.1 christos `----------*/
1115 1.1 christos
1116 1.1 christos int
1117 1.1 christos yyparse (void)
1118 1.1 christos {
1119 1.1 christos yy_state_fast_t yystate = 0;
1120 1.1 christos /* Number of tokens to shift before error messages enabled. */
1121 1.1 christos int yyerrstatus = 0;
1122 1.1 christos
1123 1.1 christos /* Refer to the stacks through separate pointers, to allow yyoverflow
1124 1.1 christos to reallocate them elsewhere. */
1125 1.1 christos
1126 1.1 christos /* Their size. */
1127 1.1 christos YYPTRDIFF_T yystacksize = YYINITDEPTH;
1128 1.1 christos
1129 1.1 christos /* The state stack: array, bottom, top. */
1130 1.1 christos yy_state_t yyssa[YYINITDEPTH];
1131 1.1 christos yy_state_t *yyss = yyssa;
1132 1.1 christos yy_state_t *yyssp = yyss;
1133 1.1 christos
1134 1.1 christos /* The semantic value stack: array, bottom, top. */
1135 1.1 christos YYSTYPE yyvsa[YYINITDEPTH];
1136 1.1 christos YYSTYPE *yyvs = yyvsa;
1137 1.1 christos YYSTYPE *yyvsp = yyvs;
1138 1.1 christos
1139 1.1 christos int yyn;
1140 1.1 christos /* The return value of yyparse. */
1141 1.1 christos int yyresult;
1142 1.1 christos /* Lookahead symbol kind. */
1143 1.1 christos yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY;
1144 1.1 christos /* The variables used to return semantic value and location from the
1145 1.1 christos action routines. */
1146 1.1 christos YYSTYPE yyval;
1147 1.1 christos
1148 1.1 christos
1149 1.1 christos
1150 1.1 christos #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1151 1.1 christos
1152 1.1 christos /* The number of symbols on the RHS of the reduced rule.
1153 1.1 christos Keep to zero when no symbol should be popped. */
1154 1.1 christos int yylen = 0;
1155 1.1 christos
1156 1.1 christos YYDPRINTF ((stderr, "Starting parse\n"));
1157 1.1 christos
1158 1.1 christos yychar = YYEMPTY; /* Cause a token to be read. */
1159 1.1 christos
1160 1.1 christos goto yysetstate;
1161 1.1 christos
1162 1.1 christos
1163 1.1 christos /*------------------------------------------------------------.
1164 1.1 christos | yynewstate -- push a new state, which is found in yystate. |
1165 1.1 christos `------------------------------------------------------------*/
1166 1.1 christos yynewstate:
1167 1.1 christos /* In all cases, when you get here, the value and location stacks
1168 1.1 christos have just been pushed. So pushing a state here evens the stacks. */
1169 1.1 christos yyssp++;
1170 1.1 christos
1171 1.1 christos
1172 1.1 christos /*--------------------------------------------------------------------.
1173 1.1 christos | yysetstate -- set current state (the top of the stack) to yystate. |
1174 1.1 christos `--------------------------------------------------------------------*/
1175 1.1 christos yysetstate:
1176 1.1 christos YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1177 1.1 christos YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
1178 1.1 christos YY_IGNORE_USELESS_CAST_BEGIN
1179 1.1 christos *yyssp = YY_CAST (yy_state_t, yystate);
1180 1.1 christos YY_IGNORE_USELESS_CAST_END
1181 1.1 christos YY_STACK_PRINT (yyss, yyssp);
1182 1.1 christos
1183 1.1 christos if (yyss + yystacksize - 1 <= yyssp)
1184 1.1 christos #if !defined yyoverflow && !defined YYSTACK_RELOCATE
1185 1.1 christos YYNOMEM;
1186 1.1 christos #else
1187 1.1 christos {
1188 1.1 christos /* Get the current used size of the three stacks, in elements. */
1189 1.1 christos YYPTRDIFF_T yysize = yyssp - yyss + 1;
1190 1.1 christos
1191 1.1 christos # if defined yyoverflow
1192 1.1 christos {
1193 1.1 christos /* Give user a chance to reallocate the stack. Use copies of
1194 1.1 christos these so that the &'s don't force the real ones into
1195 1.1 christos memory. */
1196 1.1 christos yy_state_t *yyss1 = yyss;
1197 1.1 christos YYSTYPE *yyvs1 = yyvs;
1198 1.1 christos
1199 1.1 christos /* Each stack pointer address is followed by the size of the
1200 1.1 christos data in use in that stack, in bytes. This used to be a
1201 1.1 christos conditional around just the two extra args, but that might
1202 1.1 christos be undefined if yyoverflow is a macro. */
1203 1.1 christos yyoverflow (YY_("memory exhausted"),
1204 1.1 christos &yyss1, yysize * YYSIZEOF (*yyssp),
1205 1.1 christos &yyvs1, yysize * YYSIZEOF (*yyvsp),
1206 1.1 christos &yystacksize);
1207 1.1 christos yyss = yyss1;
1208 1.1 christos yyvs = yyvs1;
1209 1.1 christos }
1210 1.1 christos # else /* defined YYSTACK_RELOCATE */
1211 1.1 christos /* Extend the stack our own way. */
1212 1.1 christos if (YYMAXDEPTH <= yystacksize)
1213 1.1 christos YYNOMEM;
1214 1.1 christos yystacksize *= 2;
1215 1.1 christos if (YYMAXDEPTH < yystacksize)
1216 1.1 christos yystacksize = YYMAXDEPTH;
1217 1.1 christos
1218 1.1 christos {
1219 1.1 christos yy_state_t *yyss1 = yyss;
1220 1.1 christos union yyalloc *yyptr =
1221 1.1 christos YY_CAST (union yyalloc *,
1222 1.1 christos YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize))));
1223 1.1 christos if (! yyptr)
1224 1.1 christos YYNOMEM;
1225 1.1 christos YYSTACK_RELOCATE (yyss_alloc, yyss);
1226 1.1 christos YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1227 1.1 christos # undef YYSTACK_RELOCATE
1228 1.1 christos if (yyss1 != yyssa)
1229 1.1 christos YYSTACK_FREE (yyss1);
1230 1.1 christos }
1231 1.1 christos # endif
1232 1.1 christos
1233 1.1 christos yyssp = yyss + yysize - 1;
1234 1.1 christos yyvsp = yyvs + yysize - 1;
1235 1.1 christos
1236 1.1 christos YY_IGNORE_USELESS_CAST_BEGIN
1237 1.1 christos YYDPRINTF ((stderr, "Stack size increased to %ld\n",
1238 1.1 christos YY_CAST (long, yystacksize)));
1239 1.1 christos YY_IGNORE_USELESS_CAST_END
1240 1.1 christos
1241 1.1 christos if (yyss + yystacksize - 1 <= yyssp)
1242 1.1 christos YYABORT;
1243 1.1 christos }
1244 1.1 christos #endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
1245 1.1 christos
1246 1.1 christos
1247 1.1 christos if (yystate == YYFINAL)
1248 1.1 christos YYACCEPT;
1249 1.1 christos
1250 1.1 christos goto yybackup;
1251 1.1 christos
1252 1.1 christos
1253 1.1 christos /*-----------.
1254 1.1 christos | yybackup. |
1255 1.1 christos `-----------*/
1256 1.1 christos yybackup:
1257 1.1 christos /* Do appropriate processing given the current state. Read a
1258 1.1 christos lookahead token if we need one and don't already have one. */
1259 1.1 christos
1260 1.1 christos /* First try to decide what to do without reference to lookahead token. */
1261 1.1 christos yyn = yypact[yystate];
1262 1.1 christos if (yypact_value_is_default (yyn))
1263 1.1 christos goto yydefault;
1264 1.1 christos
1265 1.1 christos /* Not known => get a lookahead token if don't already have one. */
1266 1.1 christos
1267 1.1 christos /* YYCHAR is either empty, or end-of-input, or a valid lookahead. */
1268 1.1 christos if (yychar == YYEMPTY)
1269 1.1 christos {
1270 1.1 christos YYDPRINTF ((stderr, "Reading a token\n"));
1271 1.1 christos yychar = yylex ();
1272 1.1 christos }
1273 1.1 christos
1274 1.1 christos if (yychar <= YYEOF)
1275 1.1 christos {
1276 1.1 christos yychar = YYEOF;
1277 1.1 christos yytoken = YYSYMBOL_YYEOF;
1278 1.1 christos YYDPRINTF ((stderr, "Now at end of input.\n"));
1279 1.1 christos }
1280 1.1 christos else if (yychar == YYerror)
1281 1.1 christos {
1282 1.1 christos /* The scanner already issued an error message, process directly
1283 1.1 christos to error recovery. But do not keep the error token as
1284 1.1 christos lookahead, it is too special and may lead us to an endless
1285 1.1 christos loop in error recovery. */
1286 1.1 christos yychar = YYUNDEF;
1287 1.1 christos yytoken = YYSYMBOL_YYerror;
1288 1.1 christos goto yyerrlab1;
1289 1.1 christos }
1290 1.1 christos else
1291 1.1 christos {
1292 1.1 christos yytoken = YYTRANSLATE (yychar);
1293 1.1 christos YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1294 1.1 christos }
1295 1.1 christos
1296 1.1 christos /* If the proper action on seeing token YYTOKEN is to reduce or to
1297 1.1 christos detect an error, take that action. */
1298 1.1 christos yyn += yytoken;
1299 1.1 christos if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1300 1.1 christos goto yydefault;
1301 1.1 christos yyn = yytable[yyn];
1302 1.1 christos if (yyn <= 0)
1303 1.1 christos {
1304 1.1 christos if (yytable_value_is_error (yyn))
1305 1.1 christos goto yyerrlab;
1306 1.1 christos yyn = -yyn;
1307 1.1 christos goto yyreduce;
1308 1.1 christos }
1309 1.1 christos
1310 1.1 christos /* Count tokens shifted since error; after three, turn off error
1311 1.1 christos status. */
1312 1.1 christos if (yyerrstatus)
1313 1.1 christos yyerrstatus--;
1314 1.1 christos
1315 1.1 christos /* Shift the lookahead token. */
1316 1.1 christos YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1317 1.1 christos yystate = yyn;
1318 1.1 christos YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1319 1.1 christos *++yyvsp = yylval;
1320 1.1 christos YY_IGNORE_MAYBE_UNINITIALIZED_END
1321 1.1 christos
1322 1.1 christos /* Discard the shifted token. */
1323 1.1 christos yychar = YYEMPTY;
1324 1.1 christos goto yynewstate;
1325 1.1 christos
1326 1.1 christos
1327 1.1 christos /*-----------------------------------------------------------.
1328 1.1 christos | yydefault -- do the default action for the current state. |
1329 1.1 christos `-----------------------------------------------------------*/
1330 1.1 christos yydefault:
1331 1.1 christos yyn = yydefact[yystate];
1332 1.1 christos if (yyn == 0)
1333 1.1 christos goto yyerrlab;
1334 1.1 christos goto yyreduce;
1335 1.1 christos
1336 1.1 christos
1337 1.1 christos /*-----------------------------.
1338 1.1 christos | yyreduce -- do a reduction. |
1339 1.1 christos `-----------------------------*/
1340 1.1 christos yyreduce:
1341 1.1 christos /* yyn is the number of a rule to reduce with. */
1342 1.1 christos yylen = yyr2[yyn];
1343 1.1 christos
1344 1.1 christos /* If YYLEN is nonzero, implement the default value of the action:
1345 1.1 christos '$$ = $1'.
1346 1.1 christos
1347 1.1 christos Otherwise, the following line sets YYVAL to garbage.
1348 1.1 christos This behavior is undocumented and Bison
1349 1.1 christos users should not rely upon it. Assigning to YYVAL
1350 1.1 christos unconditionally makes the parser a bit smaller, and it avoids a
1351 1.1 christos GCC warning that YYVAL may be used uninitialized. */
1352 1.1 christos yyval = yyvsp[1-yylen];
1353 1.1 christos
1354 1.1 christos
1355 1.1 christos YY_REDUCE_PRINT (yyn);
1356 1.1 christos switch (yyn)
1357 1.1 christos {
1358 1.1 christos case 3: /* operand: motorola_operand optional_ampersand */
1359 1.1 christos #line 122 "./config/m68k-parse.y"
1360 1.1 christos {
1361 1.1 christos op->trailing_ampersand = (yyvsp[0].trailing_ampersand);
1362 1.1 christos }
1363 1.1 christos #line 1364 "config/m68k-parse.c"
1364 1.1 christos break;
1365 1.1 christos
1366 1.1 christos case 4: /* operand: mit_operand optional_ampersand */
1367 1.1 christos #line 126 "./config/m68k-parse.y"
1368 1.1 christos {
1369 1.1 christos op->trailing_ampersand = (yyvsp[0].trailing_ampersand);
1370 1.1 christos }
1371 1.1 christos #line 1372 "config/m68k-parse.c"
1372 1.1 christos break;
1373 1.1 christos
1374 1.1 christos case 5: /* optional_ampersand: %empty */
1375 1.1 christos #line 134 "./config/m68k-parse.y"
1376 1.1 christos { (yyval.trailing_ampersand) = 0; }
1377 1.1 christos #line 1378 "config/m68k-parse.c"
1378 1.1 christos break;
1379 1.1 christos
1380 1.1 christos case 6: /* optional_ampersand: '&' */
1381 1.1 christos #line 136 "./config/m68k-parse.y"
1382 1.1 christos { (yyval.trailing_ampersand) = 1; }
1383 1.1 christos #line 1384 "config/m68k-parse.c"
1384 1.1 christos break;
1385 1.1 christos
1386 1.1 christos case 7: /* generic_operand: '<' '<' */
1387 1.1 christos #line 143 "./config/m68k-parse.y"
1388 1.1 christos {
1389 1.1 christos op->mode = LSH;
1390 1.1 christos }
1391 1.1 christos #line 1392 "config/m68k-parse.c"
1392 1.1 christos break;
1393 1.1 christos
1394 1.1 christos case 8: /* generic_operand: '>' '>' */
1395 1.1 christos #line 148 "./config/m68k-parse.y"
1396 1.1 christos {
1397 1.1 christos op->mode = RSH;
1398 1.1 christos }
1399 1.1 christos #line 1400 "config/m68k-parse.c"
1400 1.1 christos break;
1401 1.1 christos
1402 1.1 christos case 9: /* generic_operand: DR */
1403 1.1 christos #line 153 "./config/m68k-parse.y"
1404 1.1 christos {
1405 1.1 christos op->mode = DREG;
1406 1.1 christos op->reg = (yyvsp[0].reg);
1407 1.1 christos }
1408 1.1 christos #line 1409 "config/m68k-parse.c"
1409 1.1 christos break;
1410 1.1 christos
1411 1.1 christos case 10: /* generic_operand: AR */
1412 1.1 christos #line 158 "./config/m68k-parse.y"
1413 1.1 christos {
1414 1.1 christos op->mode = AREG;
1415 1.1 christos op->reg = (yyvsp[0].reg);
1416 1.1 christos }
1417 1.1 christos #line 1418 "config/m68k-parse.c"
1418 1.1 christos break;
1419 1.1 christos
1420 1.1 christos case 11: /* generic_operand: FPR */
1421 1.1 christos #line 163 "./config/m68k-parse.y"
1422 1.1 christos {
1423 1.1 christos op->mode = FPREG;
1424 1.1 christos op->reg = (yyvsp[0].reg);
1425 1.1 christos }
1426 1.1 christos #line 1427 "config/m68k-parse.c"
1427 1.1 christos break;
1428 1.1 christos
1429 1.1 christos case 12: /* generic_operand: FPCR */
1430 1.1 christos #line 168 "./config/m68k-parse.y"
1431 1.1 christos {
1432 1.1 christos op->mode = CONTROL;
1433 1.1 christos op->reg = (yyvsp[0].reg);
1434 1.1 christos }
1435 1.1 christos #line 1436 "config/m68k-parse.c"
1436 1.1 christos break;
1437 1.1 christos
1438 1.1 christos case 13: /* generic_operand: CREG */
1439 1.1 christos #line 173 "./config/m68k-parse.y"
1440 1.1 christos {
1441 1.1 christos op->mode = CONTROL;
1442 1.1 christos op->reg = (yyvsp[0].reg);
1443 1.1 christos }
1444 1.1 christos #line 1445 "config/m68k-parse.c"
1445 1.1 christos break;
1446 1.1 christos
1447 1.1 christos case 14: /* generic_operand: EXPR */
1448 1.1 christos #line 178 "./config/m68k-parse.y"
1449 1.1 christos {
1450 1.1 christos op->mode = ABSL;
1451 1.1 christos op->disp = (yyvsp[0].exp);
1452 1.1 christos }
1453 1.1 christos #line 1454 "config/m68k-parse.c"
1454 1.1 christos break;
1455 1.1 christos
1456 1.1 christos case 15: /* generic_operand: '#' EXPR */
1457 1.1 christos #line 183 "./config/m68k-parse.y"
1458 1.1 christos {
1459 1.1 christos op->mode = IMMED;
1460 1.1 christos op->disp = (yyvsp[0].exp);
1461 1.1 christos }
1462 1.1 christos #line 1463 "config/m68k-parse.c"
1463 1.1 christos break;
1464 1.1 christos
1465 1.1 christos case 16: /* generic_operand: '&' EXPR */
1466 1.1 christos #line 188 "./config/m68k-parse.y"
1467 1.1 christos {
1468 1.1 christos op->mode = IMMED;
1469 1.1 christos op->disp = (yyvsp[0].exp);
1470 1.1 christos }
1471 1.1 christos #line 1472 "config/m68k-parse.c"
1472 1.1 christos break;
1473 1.1 christos
1474 1.1 christos case 17: /* generic_operand: reglist */
1475 1.1 christos #line 193 "./config/m68k-parse.y"
1476 1.1 christos {
1477 1.1 christos op->mode = REGLST;
1478 1.1 christos op->mask = (yyvsp[0].mask);
1479 1.1 christos }
1480 1.1 christos #line 1481 "config/m68k-parse.c"
1481 1.1 christos break;
1482 1.1 christos
1483 1.1 christos case 18: /* motorola_operand: '(' AR ')' */
1484 1.1 christos #line 206 "./config/m68k-parse.y"
1485 1.1 christos {
1486 1.1 christos op->mode = AINDR;
1487 1.1 christos op->reg = (yyvsp[-1].reg);
1488 1.1 christos }
1489 1.1 christos #line 1490 "config/m68k-parse.c"
1490 1.1 christos break;
1491 1.1 christos
1492 1.1 christos case 19: /* motorola_operand: '(' AR ')' '+' */
1493 1.1 christos #line 211 "./config/m68k-parse.y"
1494 1.1 christos {
1495 1.1 christos op->mode = AINC;
1496 1.1 christos op->reg = (yyvsp[-2].reg);
1497 1.1 christos }
1498 1.1 christos #line 1499 "config/m68k-parse.c"
1499 1.1 christos break;
1500 1.1 christos
1501 1.1 christos case 20: /* motorola_operand: '-' '(' AR ')' */
1502 1.1 christos #line 216 "./config/m68k-parse.y"
1503 1.1 christos {
1504 1.1 christos op->mode = ADEC;
1505 1.1 christos op->reg = (yyvsp[-1].reg);
1506 1.1 christos }
1507 1.1 christos #line 1508 "config/m68k-parse.c"
1508 1.1 christos break;
1509 1.1 christos
1510 1.1 christos case 21: /* motorola_operand: '(' EXPR ',' zapc ')' */
1511 1.1 christos #line 221 "./config/m68k-parse.y"
1512 1.1 christos {
1513 1.1 christos op->reg = (yyvsp[-1].reg);
1514 1.1 christos op->disp = (yyvsp[-3].exp);
1515 1.1 christos if (((yyvsp[-1].reg) >= ZADDR0 && (yyvsp[-1].reg) <= ZADDR7)
1516 1.1 christos || (yyvsp[-1].reg) == ZPC)
1517 1.1 christos op->mode = BASE;
1518 1.1 christos else
1519 1.1 christos op->mode = DISP;
1520 1.1 christos }
1521 1.1 christos #line 1522 "config/m68k-parse.c"
1522 1.1 christos break;
1523 1.1 christos
1524 1.1 christos case 22: /* motorola_operand: '(' zapc ',' EXPR ')' */
1525 1.1 christos #line 231 "./config/m68k-parse.y"
1526 1.1 christos {
1527 1.1 christos op->reg = (yyvsp[-3].reg);
1528 1.1 christos op->disp = (yyvsp[-1].exp);
1529 1.1 christos if (((yyvsp[-3].reg) >= ZADDR0 && (yyvsp[-3].reg) <= ZADDR7)
1530 1.1 christos || (yyvsp[-3].reg) == ZPC)
1531 1.1 christos op->mode = BASE;
1532 1.1 christos else
1533 1.1 christos op->mode = DISP;
1534 1.1 christos }
1535 1.1 christos #line 1536 "config/m68k-parse.c"
1536 1.1 christos break;
1537 1.1 christos
1538 1.1 christos case 23: /* motorola_operand: EXPR '(' zapc ')' */
1539 1.1 christos #line 241 "./config/m68k-parse.y"
1540 1.1 christos {
1541 1.1 christos op->reg = (yyvsp[-1].reg);
1542 1.1 christos op->disp = (yyvsp[-3].exp);
1543 1.1 christos if (((yyvsp[-1].reg) >= ZADDR0 && (yyvsp[-1].reg) <= ZADDR7)
1544 1.1 christos || (yyvsp[-1].reg) == ZPC)
1545 1.1 christos op->mode = BASE;
1546 1.1 christos else
1547 1.1 christos op->mode = DISP;
1548 1.1 christos }
1549 1.1 christos #line 1550 "config/m68k-parse.c"
1550 1.1 christos break;
1551 1.1 christos
1552 1.1 christos case 24: /* motorola_operand: '(' LPC ')' */
1553 1.1 christos #line 251 "./config/m68k-parse.y"
1554 1.1 christos {
1555 1.1 christos op->mode = DISP;
1556 1.1 christos op->reg = (yyvsp[-1].reg);
1557 1.1 christos }
1558 1.1 christos #line 1559 "config/m68k-parse.c"
1559 1.1 christos break;
1560 1.1 christos
1561 1.1 christos case 25: /* motorola_operand: '(' ZAR ')' */
1562 1.1 christos #line 256 "./config/m68k-parse.y"
1563 1.1 christos {
1564 1.1 christos op->mode = BASE;
1565 1.1 christos op->reg = (yyvsp[-1].reg);
1566 1.1 christos }
1567 1.1 christos #line 1568 "config/m68k-parse.c"
1568 1.1 christos break;
1569 1.1 christos
1570 1.1 christos case 26: /* motorola_operand: '(' LZPC ')' */
1571 1.1 christos #line 261 "./config/m68k-parse.y"
1572 1.1 christos {
1573 1.1 christos op->mode = BASE;
1574 1.1 christos op->reg = (yyvsp[-1].reg);
1575 1.1 christos }
1576 1.1 christos #line 1577 "config/m68k-parse.c"
1577 1.1 christos break;
1578 1.1 christos
1579 1.1 christos case 27: /* motorola_operand: '(' EXPR ',' zapc ',' zireg ')' */
1580 1.1 christos #line 266 "./config/m68k-parse.y"
1581 1.1 christos {
1582 1.1 christos op->mode = BASE;
1583 1.1 christos op->reg = (yyvsp[-3].reg);
1584 1.1 christos op->disp = (yyvsp[-5].exp);
1585 1.1 christos op->index = (yyvsp[-1].indexreg);
1586 1.1 christos }
1587 1.1 christos #line 1588 "config/m68k-parse.c"
1588 1.1 christos break;
1589 1.1 christos
1590 1.1 christos case 28: /* motorola_operand: '(' EXPR ',' zapc ',' zpc ')' */
1591 1.1 christos #line 273 "./config/m68k-parse.y"
1592 1.1 christos {
1593 1.1 christos if ((yyvsp[-3].reg) == PC || (yyvsp[-3].reg) == ZPC)
1594 1.1 christos yyerror (_("syntax error"));
1595 1.1 christos op->mode = BASE;
1596 1.1 christos op->reg = (yyvsp[-1].reg);
1597 1.1 christos op->disp = (yyvsp[-5].exp);
1598 1.1 christos op->index.reg = (yyvsp[-3].reg);
1599 1.1 christos op->index.size = SIZE_UNSPEC;
1600 1.1 christos op->index.scale = 1;
1601 1.1 christos }
1602 1.1 christos #line 1603 "config/m68k-parse.c"
1603 1.1 christos break;
1604 1.1 christos
1605 1.1 christos case 29: /* motorola_operand: '(' EXPR ',' zdireg optczapc ')' */
1606 1.1 christos #line 284 "./config/m68k-parse.y"
1607 1.1 christos {
1608 1.1 christos op->mode = BASE;
1609 1.1 christos op->reg = (yyvsp[-1].reg);
1610 1.1 christos op->disp = (yyvsp[-4].exp);
1611 1.1 christos op->index = (yyvsp[-2].indexreg);
1612 1.1 christos }
1613 1.1 christos #line 1614 "config/m68k-parse.c"
1614 1.1 christos break;
1615 1.1 christos
1616 1.1 christos case 30: /* motorola_operand: '(' zdireg ',' EXPR ')' */
1617 1.1 christos #line 291 "./config/m68k-parse.y"
1618 1.1 christos {
1619 1.1 christos op->mode = BASE;
1620 1.1 christos op->disp = (yyvsp[-1].exp);
1621 1.1 christos op->index = (yyvsp[-3].indexreg);
1622 1.1 christos }
1623 1.1 christos #line 1624 "config/m68k-parse.c"
1624 1.1 christos break;
1625 1.1 christos
1626 1.1 christos case 31: /* motorola_operand: EXPR '(' zapc ',' zireg ')' */
1627 1.1 christos #line 297 "./config/m68k-parse.y"
1628 1.1 christos {
1629 1.1 christos op->mode = BASE;
1630 1.1 christos op->reg = (yyvsp[-3].reg);
1631 1.1 christos op->disp = (yyvsp[-5].exp);
1632 1.1 christos op->index = (yyvsp[-1].indexreg);
1633 1.1 christos }
1634 1.1 christos #line 1635 "config/m68k-parse.c"
1635 1.1 christos break;
1636 1.1 christos
1637 1.1 christos case 32: /* motorola_operand: '(' zapc ',' zireg ')' */
1638 1.1 christos #line 304 "./config/m68k-parse.y"
1639 1.1 christos {
1640 1.1 christos op->mode = BASE;
1641 1.1 christos op->reg = (yyvsp[-3].reg);
1642 1.1 christos op->index = (yyvsp[-1].indexreg);
1643 1.1 christos }
1644 1.1 christos #line 1645 "config/m68k-parse.c"
1645 1.1 christos break;
1646 1.1 christos
1647 1.1 christos case 33: /* motorola_operand: EXPR '(' zapc ',' zpc ')' */
1648 1.1 christos #line 310 "./config/m68k-parse.y"
1649 1.1 christos {
1650 1.1 christos if ((yyvsp[-3].reg) == PC || (yyvsp[-3].reg) == ZPC)
1651 1.1 christos yyerror (_("syntax error"));
1652 1.1 christos op->mode = BASE;
1653 1.1 christos op->reg = (yyvsp[-1].reg);
1654 1.1 christos op->disp = (yyvsp[-5].exp);
1655 1.1 christos op->index.reg = (yyvsp[-3].reg);
1656 1.1 christos op->index.size = SIZE_UNSPEC;
1657 1.1 christos op->index.scale = 1;
1658 1.1 christos }
1659 1.1 christos #line 1660 "config/m68k-parse.c"
1660 1.1 christos break;
1661 1.1 christos
1662 1.1 christos case 34: /* motorola_operand: '(' zapc ',' zpc ')' */
1663 1.1 christos #line 321 "./config/m68k-parse.y"
1664 1.1 christos {
1665 1.1 christos if ((yyvsp[-3].reg) == PC || (yyvsp[-3].reg) == ZPC)
1666 1.1 christos yyerror (_("syntax error"));
1667 1.1 christos op->mode = BASE;
1668 1.1 christos op->reg = (yyvsp[-1].reg);
1669 1.1 christos op->index.reg = (yyvsp[-3].reg);
1670 1.1 christos op->index.size = SIZE_UNSPEC;
1671 1.1 christos op->index.scale = 1;
1672 1.1 christos }
1673 1.1 christos #line 1674 "config/m68k-parse.c"
1674 1.1 christos break;
1675 1.1 christos
1676 1.1 christos case 35: /* motorola_operand: EXPR '(' zdireg optczapc ')' */
1677 1.1 christos #line 331 "./config/m68k-parse.y"
1678 1.1 christos {
1679 1.1 christos op->mode = BASE;
1680 1.1 christos op->reg = (yyvsp[-1].reg);
1681 1.1 christos op->disp = (yyvsp[-4].exp);
1682 1.1 christos op->index = (yyvsp[-2].indexreg);
1683 1.1 christos }
1684 1.1 christos #line 1685 "config/m68k-parse.c"
1685 1.1 christos break;
1686 1.1 christos
1687 1.1 christos case 36: /* motorola_operand: '(' zdireg optczapc ')' */
1688 1.1 christos #line 338 "./config/m68k-parse.y"
1689 1.1 christos {
1690 1.1 christos op->mode = BASE;
1691 1.1 christos op->reg = (yyvsp[-1].reg);
1692 1.1 christos op->index = (yyvsp[-2].indexreg);
1693 1.1 christos }
1694 1.1 christos #line 1695 "config/m68k-parse.c"
1695 1.1 christos break;
1696 1.1 christos
1697 1.1 christos case 37: /* motorola_operand: '(' '[' EXPR optczapc ']' ',' zireg optcexpr ')' */
1698 1.1 christos #line 344 "./config/m68k-parse.y"
1699 1.1 christos {
1700 1.1 christos op->mode = POST;
1701 1.1 christos op->reg = (yyvsp[-5].reg);
1702 1.1 christos op->disp = (yyvsp[-6].exp);
1703 1.1 christos op->index = (yyvsp[-2].indexreg);
1704 1.1 christos op->odisp = (yyvsp[-1].exp);
1705 1.1 christos }
1706 1.1 christos #line 1707 "config/m68k-parse.c"
1707 1.1 christos break;
1708 1.1 christos
1709 1.1 christos case 38: /* motorola_operand: '(' '[' EXPR optczapc ']' optcexpr ')' */
1710 1.1 christos #line 352 "./config/m68k-parse.y"
1711 1.1 christos {
1712 1.1 christos op->mode = POST;
1713 1.1 christos op->reg = (yyvsp[-3].reg);
1714 1.1 christos op->disp = (yyvsp[-4].exp);
1715 1.1 christos op->odisp = (yyvsp[-1].exp);
1716 1.1 christos }
1717 1.1 christos #line 1718 "config/m68k-parse.c"
1718 1.1 christos break;
1719 1.1 christos
1720 1.1 christos case 39: /* motorola_operand: '(' '[' zapc ']' ',' zireg optcexpr ')' */
1721 1.1 christos #line 359 "./config/m68k-parse.y"
1722 1.1 christos {
1723 1.1 christos op->mode = POST;
1724 1.1 christos op->reg = (yyvsp[-5].reg);
1725 1.1 christos op->index = (yyvsp[-2].indexreg);
1726 1.1 christos op->odisp = (yyvsp[-1].exp);
1727 1.1 christos }
1728 1.1 christos #line 1729 "config/m68k-parse.c"
1729 1.1 christos break;
1730 1.1 christos
1731 1.1 christos case 40: /* motorola_operand: '(' '[' zapc ']' optcexpr ')' */
1732 1.1 christos #line 366 "./config/m68k-parse.y"
1733 1.1 christos {
1734 1.1 christos op->mode = POST;
1735 1.1 christos op->reg = (yyvsp[-3].reg);
1736 1.1 christos op->odisp = (yyvsp[-1].exp);
1737 1.1 christos }
1738 1.1 christos #line 1739 "config/m68k-parse.c"
1739 1.1 christos break;
1740 1.1 christos
1741 1.1 christos case 41: /* motorola_operand: '(' '[' EXPR ',' zapc ',' zireg ']' optcexpr ')' */
1742 1.1 christos #line 372 "./config/m68k-parse.y"
1743 1.1 christos {
1744 1.1 christos op->mode = PRE;
1745 1.1 christos op->reg = (yyvsp[-5].reg);
1746 1.1 christos op->disp = (yyvsp[-7].exp);
1747 1.1 christos op->index = (yyvsp[-3].indexreg);
1748 1.1 christos op->odisp = (yyvsp[-1].exp);
1749 1.1 christos }
1750 1.1 christos #line 1751 "config/m68k-parse.c"
1751 1.1 christos break;
1752 1.1 christos
1753 1.1 christos case 42: /* motorola_operand: '(' '[' zapc ',' zireg ']' optcexpr ')' */
1754 1.1 christos #line 380 "./config/m68k-parse.y"
1755 1.1 christos {
1756 1.1 christos op->mode = PRE;
1757 1.1 christos op->reg = (yyvsp[-5].reg);
1758 1.1 christos op->index = (yyvsp[-3].indexreg);
1759 1.1 christos op->odisp = (yyvsp[-1].exp);
1760 1.1 christos }
1761 1.1 christos #line 1762 "config/m68k-parse.c"
1762 1.1 christos break;
1763 1.1 christos
1764 1.1 christos case 43: /* motorola_operand: '(' '[' EXPR ',' zapc ',' zpc ']' optcexpr ')' */
1765 1.1 christos #line 387 "./config/m68k-parse.y"
1766 1.1 christos {
1767 1.1 christos if ((yyvsp[-5].reg) == PC || (yyvsp[-5].reg) == ZPC)
1768 1.1 christos yyerror (_("syntax error"));
1769 1.1 christos op->mode = PRE;
1770 1.1 christos op->reg = (yyvsp[-3].reg);
1771 1.1 christos op->disp = (yyvsp[-7].exp);
1772 1.1 christos op->index.reg = (yyvsp[-5].reg);
1773 1.1 christos op->index.size = SIZE_UNSPEC;
1774 1.1 christos op->index.scale = 1;
1775 1.1 christos op->odisp = (yyvsp[-1].exp);
1776 1.1 christos }
1777 1.1 christos #line 1778 "config/m68k-parse.c"
1778 1.1 christos break;
1779 1.1 christos
1780 1.1 christos case 44: /* motorola_operand: '(' '[' zapc ',' zpc ']' optcexpr ')' */
1781 1.1 christos #line 399 "./config/m68k-parse.y"
1782 1.1 christos {
1783 1.1 christos if ((yyvsp[-5].reg) == PC || (yyvsp[-5].reg) == ZPC)
1784 1.1 christos yyerror (_("syntax error"));
1785 1.1 christos op->mode = PRE;
1786 1.1 christos op->reg = (yyvsp[-3].reg);
1787 1.1 christos op->index.reg = (yyvsp[-5].reg);
1788 1.1 christos op->index.size = SIZE_UNSPEC;
1789 1.1 christos op->index.scale = 1;
1790 1.1 christos op->odisp = (yyvsp[-1].exp);
1791 1.1 christos }
1792 1.1 christos #line 1793 "config/m68k-parse.c"
1793 1.1 christos break;
1794 1.1 christos
1795 1.1 christos case 45: /* motorola_operand: '(' '[' optexprc zdireg optczapc ']' optcexpr ')' */
1796 1.1 christos #line 410 "./config/m68k-parse.y"
1797 1.1 christos {
1798 1.1 christos op->mode = PRE;
1799 1.1 christos op->reg = (yyvsp[-3].reg);
1800 1.1 christos op->disp = (yyvsp[-5].exp);
1801 1.1 christos op->index = (yyvsp[-4].indexreg);
1802 1.1 christos op->odisp = (yyvsp[-1].exp);
1803 1.1 christos }
1804 1.1 christos #line 1805 "config/m68k-parse.c"
1805 1.1 christos break;
1806 1.1 christos
1807 1.1 christos case 46: /* mit_operand: optzapc '@' */
1808 1.1 christos #line 423 "./config/m68k-parse.y"
1809 1.1 christos {
1810 1.1 christos /* We use optzapc to avoid a shift/reduce conflict. */
1811 1.1 christos if ((yyvsp[-1].reg) < ADDR0 || (yyvsp[-1].reg) > ADDR7)
1812 1.1 christos yyerror (_("syntax error"));
1813 1.1 christos op->mode = AINDR;
1814 1.1 christos op->reg = (yyvsp[-1].reg);
1815 1.1 christos }
1816 1.1 christos #line 1817 "config/m68k-parse.c"
1817 1.1 christos break;
1818 1.1 christos
1819 1.1 christos case 47: /* mit_operand: optzapc '@' '+' */
1820 1.1 christos #line 431 "./config/m68k-parse.y"
1821 1.1 christos {
1822 1.1 christos /* We use optzapc to avoid a shift/reduce conflict. */
1823 1.1 christos if ((yyvsp[-2].reg) < ADDR0 || (yyvsp[-2].reg) > ADDR7)
1824 1.1 christos yyerror (_("syntax error"));
1825 1.1 christos op->mode = AINC;
1826 1.1 christos op->reg = (yyvsp[-2].reg);
1827 1.1 christos }
1828 1.1 christos #line 1829 "config/m68k-parse.c"
1829 1.1 christos break;
1830 1.1 christos
1831 1.1 christos case 48: /* mit_operand: optzapc '@' '-' */
1832 1.1 christos #line 439 "./config/m68k-parse.y"
1833 1.1 christos {
1834 1.1 christos /* We use optzapc to avoid a shift/reduce conflict. */
1835 1.1 christos if ((yyvsp[-2].reg) < ADDR0 || (yyvsp[-2].reg) > ADDR7)
1836 1.1 christos yyerror (_("syntax error"));
1837 1.1 christos op->mode = ADEC;
1838 1.1 christos op->reg = (yyvsp[-2].reg);
1839 1.1 christos }
1840 1.1 christos #line 1841 "config/m68k-parse.c"
1841 1.1 christos break;
1842 1.1 christos
1843 1.1 christos case 49: /* mit_operand: optzapc '@' '(' EXPR ')' */
1844 1.1 christos #line 447 "./config/m68k-parse.y"
1845 1.1 christos {
1846 1.1 christos op->reg = (yyvsp[-4].reg);
1847 1.1 christos op->disp = (yyvsp[-1].exp);
1848 1.1 christos if (((yyvsp[-4].reg) >= ZADDR0 && (yyvsp[-4].reg) <= ZADDR7)
1849 1.1 christos || (yyvsp[-4].reg) == ZPC)
1850 1.1 christos op->mode = BASE;
1851 1.1 christos else
1852 1.1 christos op->mode = DISP;
1853 1.1 christos }
1854 1.1 christos #line 1855 "config/m68k-parse.c"
1855 1.1 christos break;
1856 1.1 christos
1857 1.1 christos case 50: /* mit_operand: optzapc '@' '(' optexprc zireg ')' */
1858 1.1 christos #line 457 "./config/m68k-parse.y"
1859 1.1 christos {
1860 1.1 christos op->mode = BASE;
1861 1.1 christos op->reg = (yyvsp[-5].reg);
1862 1.1 christos op->disp = (yyvsp[-2].exp);
1863 1.1 christos op->index = (yyvsp[-1].indexreg);
1864 1.1 christos }
1865 1.1 christos #line 1866 "config/m68k-parse.c"
1866 1.1 christos break;
1867 1.1 christos
1868 1.1 christos case 51: /* mit_operand: optzapc '@' '(' EXPR ')' '@' '(' optexprc zireg ')' */
1869 1.1 christos #line 464 "./config/m68k-parse.y"
1870 1.1 christos {
1871 1.1 christos op->mode = POST;
1872 1.1 christos op->reg = (yyvsp[-9].reg);
1873 1.1 christos op->disp = (yyvsp[-6].exp);
1874 1.1 christos op->index = (yyvsp[-1].indexreg);
1875 1.1 christos op->odisp = (yyvsp[-2].exp);
1876 1.1 christos }
1877 1.1 christos #line 1878 "config/m68k-parse.c"
1878 1.1 christos break;
1879 1.1 christos
1880 1.1 christos case 52: /* mit_operand: optzapc '@' '(' EXPR ')' '@' '(' EXPR ')' */
1881 1.1 christos #line 472 "./config/m68k-parse.y"
1882 1.1 christos {
1883 1.1 christos op->mode = POST;
1884 1.1 christos op->reg = (yyvsp[-8].reg);
1885 1.1 christos op->disp = (yyvsp[-5].exp);
1886 1.1 christos op->odisp = (yyvsp[-1].exp);
1887 1.1 christos }
1888 1.1 christos #line 1889 "config/m68k-parse.c"
1889 1.1 christos break;
1890 1.1 christos
1891 1.1 christos case 53: /* mit_operand: optzapc '@' '(' optexprc zireg ')' '@' '(' EXPR ')' */
1892 1.1 christos #line 479 "./config/m68k-parse.y"
1893 1.1 christos {
1894 1.1 christos op->mode = PRE;
1895 1.1 christos op->reg = (yyvsp[-9].reg);
1896 1.1 christos op->disp = (yyvsp[-6].exp);
1897 1.1 christos op->index = (yyvsp[-5].indexreg);
1898 1.1 christos op->odisp = (yyvsp[-1].exp);
1899 1.1 christos }
1900 1.1 christos #line 1901 "config/m68k-parse.c"
1901 1.1 christos break;
1902 1.1 christos
1903 1.1 christos case 55: /* zireg: zadr */
1904 1.1 christos #line 494 "./config/m68k-parse.y"
1905 1.1 christos {
1906 1.1 christos (yyval.indexreg).reg = (yyvsp[0].reg);
1907 1.1 christos (yyval.indexreg).size = SIZE_UNSPEC;
1908 1.1 christos (yyval.indexreg).scale = 1;
1909 1.1 christos }
1910 1.1 christos #line 1911 "config/m68k-parse.c"
1911 1.1 christos break;
1912 1.1 christos
1913 1.1 christos case 57: /* zdireg: zdr */
1914 1.1 christos #line 508 "./config/m68k-parse.y"
1915 1.1 christos {
1916 1.1 christos (yyval.indexreg).reg = (yyvsp[0].reg);
1917 1.1 christos (yyval.indexreg).size = SIZE_UNSPEC;
1918 1.1 christos (yyval.indexreg).scale = 1;
1919 1.1 christos }
1920 1.1 christos #line 1921 "config/m68k-parse.c"
1921 1.1 christos break;
1922 1.1 christos
1923 1.1 christos case 68: /* optzapc: %empty */
1924 1.1 christos #line 551 "./config/m68k-parse.y"
1925 1.1 christos {
1926 1.1 christos (yyval.reg) = ZADDR0;
1927 1.1 christos }
1928 1.1 christos #line 1929 "config/m68k-parse.c"
1929 1.1 christos break;
1930 1.1 christos
1931 1.1 christos case 72: /* optczapc: %empty */
1932 1.1 christos #line 568 "./config/m68k-parse.y"
1933 1.1 christos {
1934 1.1 christos (yyval.reg) = ZADDR0;
1935 1.1 christos }
1936 1.1 christos #line 1937 "config/m68k-parse.c"
1937 1.1 christos break;
1938 1.1 christos
1939 1.1 christos case 73: /* optczapc: ',' zapc */
1940 1.1 christos #line 572 "./config/m68k-parse.y"
1941 1.1 christos {
1942 1.1 christos (yyval.reg) = (yyvsp[0].reg);
1943 1.1 christos }
1944 1.1 christos #line 1945 "config/m68k-parse.c"
1945 1.1 christos break;
1946 1.1 christos
1947 1.1 christos case 74: /* optcexpr: %empty */
1948 1.1 christos #line 581 "./config/m68k-parse.y"
1949 1.1 christos {
1950 1.1 christos (yyval.exp).exp.X_op = O_absent;
1951 1.1 christos (yyval.exp).size = SIZE_UNSPEC;
1952 1.1 christos }
1953 1.1 christos #line 1954 "config/m68k-parse.c"
1954 1.1 christos break;
1955 1.1 christos
1956 1.1 christos case 75: /* optcexpr: ',' EXPR */
1957 1.1 christos #line 586 "./config/m68k-parse.y"
1958 1.1 christos {
1959 1.1 christos (yyval.exp) = (yyvsp[0].exp);
1960 1.1 christos }
1961 1.1 christos #line 1962 "config/m68k-parse.c"
1962 1.1 christos break;
1963 1.1 christos
1964 1.1 christos case 76: /* optexprc: %empty */
1965 1.1 christos #line 595 "./config/m68k-parse.y"
1966 1.1 christos {
1967 1.1 christos (yyval.exp).exp.X_op = O_absent;
1968 1.1 christos (yyval.exp).size = SIZE_UNSPEC;
1969 1.1 christos }
1970 1.1 christos #line 1971 "config/m68k-parse.c"
1971 1.1 christos break;
1972 1.1 christos
1973 1.1 christos case 77: /* optexprc: EXPR ',' */
1974 1.1 christos #line 600 "./config/m68k-parse.y"
1975 1.1 christos {
1976 1.1 christos (yyval.exp) = (yyvsp[-1].exp);
1977 1.1 christos }
1978 1.1 christos #line 1979 "config/m68k-parse.c"
1979 1.1 christos break;
1980 1.1 christos
1981 1.1 christos case 79: /* reglist: reglistpair '/' ireglist */
1982 1.1 christos #line 610 "./config/m68k-parse.y"
1983 1.1 christos {
1984 1.1 christos (yyval.mask) = (yyvsp[-2].mask) | (yyvsp[0].mask);
1985 1.1 christos }
1986 1.1 christos #line 1987 "config/m68k-parse.c"
1987 1.1 christos break;
1988 1.1 christos
1989 1.1 christos case 80: /* reglist: reglistreg '/' ireglist */
1990 1.1 christos #line 614 "./config/m68k-parse.y"
1991 1.1 christos {
1992 1.1 christos (yyval.mask) = (1 << (yyvsp[-2].onereg)) | (yyvsp[0].mask);
1993 1.1 christos }
1994 1.1 christos #line 1995 "config/m68k-parse.c"
1995 1.1 christos break;
1996 1.1 christos
1997 1.1 christos case 81: /* ireglist: reglistreg */
1998 1.1 christos #line 626 "./config/m68k-parse.y"
1999 1.1 christos {
2000 1.1 christos (yyval.mask) = 1 << (yyvsp[0].onereg);
2001 1.1 christos }
2002 1.1 christos #line 2003 "config/m68k-parse.c"
2003 1.1 christos break;
2004 1.1 christos
2005 1.1 christos case 83: /* ireglist: reglistpair '/' ireglist */
2006 1.1 christos #line 631 "./config/m68k-parse.y"
2007 1.1 christos {
2008 1.1 christos (yyval.mask) = (yyvsp[-2].mask) | (yyvsp[0].mask);
2009 1.1 christos }
2010 1.1 christos #line 2011 "config/m68k-parse.c"
2011 1.1 christos break;
2012 1.1 christos
2013 1.1 christos case 84: /* ireglist: reglistreg '/' ireglist */
2014 1.1 christos #line 635 "./config/m68k-parse.y"
2015 1.1 christos {
2016 1.1 christos (yyval.mask) = (1 << (yyvsp[-2].onereg)) | (yyvsp[0].mask);
2017 1.1 christos }
2018 1.1 christos #line 2019 "config/m68k-parse.c"
2019 1.1 christos break;
2020 1.1 christos
2021 1.1 christos case 85: /* reglistpair: reglistreg '-' reglistreg */
2022 1.1 christos #line 642 "./config/m68k-parse.y"
2023 1.1 christos {
2024 1.1 christos if ((yyvsp[-2].onereg) <= (yyvsp[0].onereg))
2025 1.1 christos (yyval.mask) = (1 << ((yyvsp[0].onereg) + 1)) - 1 - ((1 << (yyvsp[-2].onereg)) - 1);
2026 1.1 christos else
2027 1.1 christos (yyval.mask) = (1 << ((yyvsp[-2].onereg) + 1)) - 1 - ((1 << (yyvsp[0].onereg)) - 1);
2028 1.1 christos }
2029 1.1 christos #line 2030 "config/m68k-parse.c"
2030 1.1 christos break;
2031 1.1 christos
2032 1.1 christos case 86: /* reglistreg: DR */
2033 1.1 christos #line 652 "./config/m68k-parse.y"
2034 1.1 christos {
2035 1.1 christos (yyval.onereg) = (yyvsp[0].reg) - DATA0;
2036 1.1 christos }
2037 1.1 christos #line 2038 "config/m68k-parse.c"
2038 1.1 christos break;
2039 1.1 christos
2040 1.1 christos case 87: /* reglistreg: AR */
2041 1.1 christos #line 656 "./config/m68k-parse.y"
2042 1.1 christos {
2043 1.1 christos (yyval.onereg) = (yyvsp[0].reg) - ADDR0 + 8;
2044 1.1 christos }
2045 1.1 christos #line 2046 "config/m68k-parse.c"
2046 1.1 christos break;
2047 1.1 christos
2048 1.1 christos case 88: /* reglistreg: FPR */
2049 1.1 christos #line 660 "./config/m68k-parse.y"
2050 1.1 christos {
2051 1.1 christos (yyval.onereg) = (yyvsp[0].reg) - FP0 + 16;
2052 1.1 christos }
2053 1.1 christos #line 2054 "config/m68k-parse.c"
2054 1.1 christos break;
2055 1.1 christos
2056 1.1 christos case 89: /* reglistreg: FPCR */
2057 1.1 christos #line 664 "./config/m68k-parse.y"
2058 1.1 christos {
2059 1.1 christos if ((yyvsp[0].reg) == FPI)
2060 1.1 christos (yyval.onereg) = 24;
2061 1.1 christos else if ((yyvsp[0].reg) == FPS)
2062 1.1 christos (yyval.onereg) = 25;
2063 1.1 christos else
2064 1.1 christos (yyval.onereg) = 26;
2065 1.1 christos }
2066 1.1 christos #line 2067 "config/m68k-parse.c"
2067 1.1 christos break;
2068 1.1 christos
2069 1.1 christos
2070 1.1 christos #line 2071 "config/m68k-parse.c"
2071 1.1 christos
2072 1.1 christos default: break;
2073 1.1 christos }
2074 1.1 christos /* User semantic actions sometimes alter yychar, and that requires
2075 1.1 christos that yytoken be updated with the new translation. We take the
2076 1.1 christos approach of translating immediately before every use of yytoken.
2077 1.1 christos One alternative is translating here after every semantic action,
2078 1.1 christos but that translation would be missed if the semantic action invokes
2079 1.1 christos YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
2080 1.1 christos if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
2081 1.1 christos incorrect destructor might then be invoked immediately. In the
2082 1.1 christos case of YYERROR or YYBACKUP, subsequent parser actions might lead
2083 1.1 christos to an incorrect destructor call or verbose syntax error message
2084 1.1 christos before the lookahead is translated. */
2085 1.1 christos YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc);
2086 1.1 christos
2087 1.1 christos YYPOPSTACK (yylen);
2088 1.1 christos yylen = 0;
2089 1.1 christos
2090 1.1 christos *++yyvsp = yyval;
2091 1.1 christos
2092 1.1 christos /* Now 'shift' the result of the reduction. Determine what state
2093 1.1 christos that goes to, based on the state we popped back to and the rule
2094 1.1 christos number reduced by. */
2095 1.1 christos {
2096 1.1 christos const int yylhs = yyr1[yyn] - YYNTOKENS;
2097 1.1 christos const int yyi = yypgoto[yylhs] + *yyssp;
2098 1.1 christos yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
2099 1.1 christos ? yytable[yyi]
2100 1.1 christos : yydefgoto[yylhs]);
2101 1.1 christos }
2102 1.1 christos
2103 1.1 christos goto yynewstate;
2104 1.1 christos
2105 1.1 christos
2106 1.1 christos /*--------------------------------------.
2107 1.1 christos | yyerrlab -- here on detecting error. |
2108 1.1 christos `--------------------------------------*/
2109 1.1 christos yyerrlab:
2110 1.1 christos /* Make sure we have latest lookahead translation. See comments at
2111 1.1 christos user semantic actions for why this is necessary. */
2112 1.1 christos yytoken = yychar == YYEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar);
2113 1.1 christos /* If not already recovering from an error, report this error. */
2114 1.1 christos if (!yyerrstatus)
2115 1.1 christos {
2116 1.1 christos ++yynerrs;
2117 1.1 christos yyerror (YY_("syntax error"));
2118 1.1 christos }
2119 1.1 christos
2120 1.1 christos if (yyerrstatus == 3)
2121 1.1 christos {
2122 1.1 christos /* If just tried and failed to reuse lookahead token after an
2123 1.1 christos error, discard it. */
2124 1.1 christos
2125 1.1 christos if (yychar <= YYEOF)
2126 1.1 christos {
2127 1.1 christos /* Return failure if at end of input. */
2128 1.1 christos if (yychar == YYEOF)
2129 1.1 christos YYABORT;
2130 1.1 christos }
2131 1.1 christos else
2132 1.1 christos {
2133 1.1 christos yydestruct ("Error: discarding",
2134 1.1 christos yytoken, &yylval);
2135 1.1 christos yychar = YYEMPTY;
2136 1.1 christos }
2137 1.1 christos }
2138 1.1 christos
2139 1.1 christos /* Else will try to reuse lookahead token after shifting the error
2140 1.1 christos token. */
2141 1.1 christos goto yyerrlab1;
2142 1.1 christos
2143 1.1 christos
2144 1.1 christos /*---------------------------------------------------.
2145 1.1 christos | yyerrorlab -- error raised explicitly by YYERROR. |
2146 1.1 christos `---------------------------------------------------*/
2147 1.1 christos yyerrorlab:
2148 1.1 christos /* Pacify compilers when the user code never invokes YYERROR and the
2149 1.1 christos label yyerrorlab therefore never appears in user code. */
2150 1.1 christos if (0)
2151 1.1 christos YYERROR;
2152 1.1 christos ++yynerrs;
2153 1.1 christos
2154 1.1 christos /* Do not reclaim the symbols of the rule whose action triggered
2155 1.1 christos this YYERROR. */
2156 1.1 christos YYPOPSTACK (yylen);
2157 1.1 christos yylen = 0;
2158 1.1 christos YY_STACK_PRINT (yyss, yyssp);
2159 1.1 christos yystate = *yyssp;
2160 1.1 christos goto yyerrlab1;
2161 1.1 christos
2162 1.1 christos
2163 1.1 christos /*-------------------------------------------------------------.
2164 1.1 christos | yyerrlab1 -- common code for both syntax error and YYERROR. |
2165 1.1 christos `-------------------------------------------------------------*/
2166 1.1 christos yyerrlab1:
2167 1.1 christos yyerrstatus = 3; /* Each real token shifted decrements this. */
2168 1.1 christos
2169 1.1 christos /* Pop stack until we find a state that shifts the error token. */
2170 1.1 christos for (;;)
2171 1.1 christos {
2172 1.1 christos yyn = yypact[yystate];
2173 1.1 christos if (!yypact_value_is_default (yyn))
2174 1.1 christos {
2175 1.1 christos yyn += YYSYMBOL_YYerror;
2176 1.1 christos if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror)
2177 1.1 christos {
2178 1.1 christos yyn = yytable[yyn];
2179 1.1 christos if (0 < yyn)
2180 1.1 christos break;
2181 1.1 christos }
2182 1.1 christos }
2183 1.1 christos
2184 1.1 christos /* Pop the current state because it cannot handle the error token. */
2185 1.1 christos if (yyssp == yyss)
2186 1.1 christos YYABORT;
2187 1.1 christos
2188 1.1 christos
2189 1.1 christos yydestruct ("Error: popping",
2190 1.1 christos YY_ACCESSING_SYMBOL (yystate), yyvsp);
2191 1.1 christos YYPOPSTACK (1);
2192 1.1 christos yystate = *yyssp;
2193 1.1 christos YY_STACK_PRINT (yyss, yyssp);
2194 1.1 christos }
2195 1.1 christos
2196 1.1 christos YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
2197 1.1 christos *++yyvsp = yylval;
2198 1.1 christos YY_IGNORE_MAYBE_UNINITIALIZED_END
2199 1.1 christos
2200 1.1 christos
2201 1.1 christos /* Shift the error token. */
2202 1.1 christos YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp);
2203 1.1 christos
2204 1.1 christos yystate = yyn;
2205 1.1 christos goto yynewstate;
2206 1.1 christos
2207 1.1 christos
2208 1.1 christos /*-------------------------------------.
2209 1.1 christos | yyacceptlab -- YYACCEPT comes here. |
2210 1.1 christos `-------------------------------------*/
2211 1.1 christos yyacceptlab:
2212 1.1 christos yyresult = 0;
2213 1.1 christos goto yyreturnlab;
2214 1.1 christos
2215 1.1 christos
2216 1.1 christos /*-----------------------------------.
2217 1.1 christos | yyabortlab -- YYABORT comes here. |
2218 1.1 christos `-----------------------------------*/
2219 1.1 christos yyabortlab:
2220 1.1 christos yyresult = 1;
2221 1.1 christos goto yyreturnlab;
2222 1.1 christos
2223 1.1 christos
2224 1.1 christos /*-----------------------------------------------------------.
2225 1.1 christos | yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here. |
2226 1.1 christos `-----------------------------------------------------------*/
2227 1.1 christos yyexhaustedlab:
2228 1.1 christos yyerror (YY_("memory exhausted"));
2229 1.1 christos yyresult = 2;
2230 1.1 christos goto yyreturnlab;
2231 1.1 christos
2232 1.1 christos
2233 1.1 christos /*----------------------------------------------------------.
2234 1.1 christos | yyreturnlab -- parsing is finished, clean up and return. |
2235 1.1 christos `----------------------------------------------------------*/
2236 1.1 christos yyreturnlab:
2237 1.1 christos if (yychar != YYEMPTY)
2238 1.1 christos {
2239 1.1 christos /* Make sure we have latest lookahead translation. See comments at
2240 1.1 christos user semantic actions for why this is necessary. */
2241 1.1 christos yytoken = YYTRANSLATE (yychar);
2242 1.1 christos yydestruct ("Cleanup: discarding lookahead",
2243 1.1 christos yytoken, &yylval);
2244 1.1 christos }
2245 1.1 christos /* Do not reclaim the symbols of the rule whose action triggered
2246 1.1 christos this YYABORT or YYACCEPT. */
2247 1.1 christos YYPOPSTACK (yylen);
2248 1.1 christos YY_STACK_PRINT (yyss, yyssp);
2249 1.1 christos while (yyssp != yyss)
2250 1.1 christos {
2251 1.1 christos yydestruct ("Cleanup: popping",
2252 1.1 christos YY_ACCESSING_SYMBOL (+*yyssp), yyvsp);
2253 1.1 christos YYPOPSTACK (1);
2254 1.1 christos }
2255 1.1 christos #ifndef yyoverflow
2256 1.1 christos if (yyss != yyssa)
2257 1.1 christos YYSTACK_FREE (yyss);
2258 1.1 christos #endif
2259 1.1 christos
2260 1.1 christos return yyresult;
2261 1.1 christos }
2262 1.1 christos
2263 1.1 christos #line 674 "./config/m68k-parse.y"
2264 1.1 christos
2265 1.1 christos
2266 1.1 christos /* The string to parse is stored here, and modified by yylex. */
2267 1.1 christos
2268 1.1 christos static char *str;
2269 1.1 christos
2270 1.1 christos /* The original string pointer. */
2271 1.1 christos
2272 1.1 christos static char *strorig;
2273 1.1 christos
2274 1.1 christos /* If *CCP could be a register, return the register number and advance
2275 1.1 christos *CCP. Otherwise don't change *CCP, and return 0. */
2276 1.1 christos
2277 1.1 christos static enum m68k_register
2278 1.1 christos m68k_reg_parse (char **ccp)
2279 1.1 christos {
2280 1.1 christos char *start = *ccp;
2281 1.1 christos char c;
2282 1.1 christos char *p;
2283 1.1 christos symbolS *symbolp;
2284 1.1 christos
2285 1.1 christos if (flag_reg_prefix_optional)
2286 1.1 christos {
2287 1.1 christos if (*start == REGISTER_PREFIX)
2288 1.1 christos start++;
2289 1.1 christos p = start;
2290 1.1 christos }
2291 1.1 christos else
2292 1.1 christos {
2293 1.1 christos if (*start != REGISTER_PREFIX)
2294 1.1 christos return 0;
2295 1.1 christos p = start + 1;
2296 1.1 christos }
2297 1.1 christos
2298 1.1 christos if (! is_name_beginner (*p))
2299 1.1 christos return 0;
2300 1.1 christos
2301 1.1 christos p++;
2302 1.1 christos while (is_part_of_name (*p) && *p != '.' && *p != ':' && *p != '*')
2303 1.1 christos p++;
2304 1.1 christos
2305 1.1 christos c = *p;
2306 1.1 christos *p = 0;
2307 1.1 christos symbolp = symbol_find (start);
2308 1.1 christos *p = c;
2309 1.1 christos
2310 1.1 christos if (symbolp != NULL && S_GET_SEGMENT (symbolp) == reg_section)
2311 1.1 christos {
2312 1.1 christos *ccp = p;
2313 1.1 christos return S_GET_VALUE (symbolp);
2314 1.1 christos }
2315 1.1 christos
2316 1.1 christos /* In MRI mode, something like foo.bar can be equated to a register
2317 1.1 christos name. */
2318 1.1 christos while (flag_mri && c == '.')
2319 1.1 christos {
2320 1.1 christos ++p;
2321 1.1 christos while (is_part_of_name (*p) && *p != '.' && *p != ':' && *p != '*')
2322 1.1 christos p++;
2323 1.1 christos c = *p;
2324 1.1 christos *p = '\0';
2325 1.1 christos symbolp = symbol_find (start);
2326 1.1 christos *p = c;
2327 1.1 christos if (symbolp != NULL && S_GET_SEGMENT (symbolp) == reg_section)
2328 1.1 christos {
2329 1.1 christos *ccp = p;
2330 1.1 christos return S_GET_VALUE (symbolp);
2331 1.1 christos }
2332 1.1 christos }
2333 1.1 christos
2334 1.1 christos return 0;
2335 1.1 christos }
2336 1.1 christos
2337 1.1 christos /* The lexer. */
2338 1.1 christos
2339 1.1 christos static int
2340 1.1 christos yylex (void)
2341 1.1 christos {
2342 1.1 christos enum m68k_register reg;
2343 1.1 christos char *s;
2344 1.1 christos int parens;
2345 1.1 christos int c = 0;
2346 1.1 christos int tail = 0;
2347 1.1 christos
2348 1.1.1.2 christos if (is_whitespace (*str))
2349 1.1 christos ++str;
2350 1.1 christos
2351 1.1 christos if (*str == '\0')
2352 1.1 christos return 0;
2353 1.1 christos
2354 1.1 christos /* Various special characters are just returned directly. */
2355 1.1 christos switch (*str)
2356 1.1 christos {
2357 1.1 christos case '@':
2358 1.1 christos /* In MRI mode, this can be the start of an octal number. */
2359 1.1 christos if (flag_mri)
2360 1.1 christos {
2361 1.1 christos if (ISDIGIT (str[1])
2362 1.1 christos || ((str[1] == '+' || str[1] == '-')
2363 1.1 christos && ISDIGIT (str[2])))
2364 1.1 christos break;
2365 1.1 christos }
2366 1.1 christos /* Fall through. */
2367 1.1 christos case '#':
2368 1.1 christos case '&':
2369 1.1 christos case ',':
2370 1.1 christos case ')':
2371 1.1 christos case '/':
2372 1.1 christos case '[':
2373 1.1 christos case ']':
2374 1.1 christos case '<':
2375 1.1 christos case '>':
2376 1.1 christos return *str++;
2377 1.1 christos case '+':
2378 1.1 christos /* It so happens that a '+' can only appear at the end of an
2379 1.1 christos operand, or if it is trailed by an '&'(see mac load insn).
2380 1.1 christos If it appears anywhere else, it must be a unary. */
2381 1.1 christos if (str[1] == '\0' || (str[1] == '&' && str[2] == '\0'))
2382 1.1 christos return *str++;
2383 1.1 christos break;
2384 1.1 christos case '-':
2385 1.1 christos /* A '-' can only appear in -(ar), rn-rn, or ar@-. If it
2386 1.1 christos appears anywhere else, it must be a unary minus on an
2387 1.1 christos expression, unless it it trailed by a '&'(see mac load insn). */
2388 1.1 christos if (str[1] == '\0' || (str[1] == '&' && str[2] == '\0'))
2389 1.1 christos return *str++;
2390 1.1 christos s = str + 1;
2391 1.1 christos if (*s == '(')
2392 1.1 christos ++s;
2393 1.1 christos if (m68k_reg_parse (&s) != 0)
2394 1.1 christos return *str++;
2395 1.1 christos break;
2396 1.1 christos case '(':
2397 1.1 christos /* A '(' can only appear in `(reg)', `(expr,...', `([', `@(', or
2398 1.1 christos `)('. If it appears anywhere else, it must be starting an
2399 1.1 christos expression. */
2400 1.1 christos if (str[1] == '['
2401 1.1 christos || (str > strorig
2402 1.1 christos && (str[-1] == '@'
2403 1.1 christos || str[-1] == ')')))
2404 1.1 christos return *str++;
2405 1.1 christos s = str + 1;
2406 1.1 christos if (m68k_reg_parse (&s) != 0)
2407 1.1 christos return *str++;
2408 1.1 christos /* Check for the case of '(expr,...' by scanning ahead. If we
2409 1.1 christos find a comma outside of balanced parentheses, we return '('.
2410 1.1 christos If we find an unbalanced right parenthesis, then presumably
2411 1.1 christos the '(' really starts an expression. */
2412 1.1 christos parens = 0;
2413 1.1 christos for (s = str + 1; *s != '\0'; s++)
2414 1.1 christos {
2415 1.1 christos if (*s == '(')
2416 1.1 christos ++parens;
2417 1.1 christos else if (*s == ')')
2418 1.1 christos {
2419 1.1 christos if (parens == 0)
2420 1.1 christos break;
2421 1.1 christos --parens;
2422 1.1 christos }
2423 1.1 christos else if (*s == ',' && parens == 0)
2424 1.1 christos {
2425 1.1 christos /* A comma can not normally appear in an expression, so
2426 1.1 christos this is a case of '(expr,...'. */
2427 1.1 christos return *str++;
2428 1.1 christos }
2429 1.1 christos }
2430 1.1 christos }
2431 1.1 christos
2432 1.1 christos /* See if it's a register. */
2433 1.1 christos
2434 1.1 christos reg = m68k_reg_parse (&str);
2435 1.1 christos if (reg != 0)
2436 1.1 christos {
2437 1.1 christos int ret;
2438 1.1 christos
2439 1.1 christos yylval.reg = reg;
2440 1.1 christos
2441 1.1 christos if (reg >= DATA0 && reg <= DATA7)
2442 1.1 christos ret = DR;
2443 1.1 christos else if (reg >= ADDR0 && reg <= ADDR7)
2444 1.1 christos ret = AR;
2445 1.1 christos else if (reg >= FP0 && reg <= FP7)
2446 1.1 christos return FPR;
2447 1.1 christos else if (reg == FPI
2448 1.1 christos || reg == FPS
2449 1.1 christos || reg == FPC)
2450 1.1 christos return FPCR;
2451 1.1 christos else if (reg == PC)
2452 1.1 christos return LPC;
2453 1.1 christos else if (reg >= ZDATA0 && reg <= ZDATA7)
2454 1.1 christos ret = ZDR;
2455 1.1 christos else if (reg >= ZADDR0 && reg <= ZADDR7)
2456 1.1 christos ret = ZAR;
2457 1.1 christos else if (reg == ZPC)
2458 1.1 christos return LZPC;
2459 1.1 christos else
2460 1.1 christos return CREG;
2461 1.1 christos
2462 1.1 christos /* If we get here, we have a data or address register. We
2463 1.1 christos must check for a size or scale; if we find one, we must
2464 1.1 christos return INDEXREG. */
2465 1.1 christos
2466 1.1 christos s = str;
2467 1.1 christos
2468 1.1 christos if (*s != '.' && *s != ':' && *s != '*')
2469 1.1 christos return ret;
2470 1.1 christos
2471 1.1 christos yylval.indexreg.reg = reg;
2472 1.1 christos
2473 1.1 christos if (*s != '.' && *s != ':')
2474 1.1 christos yylval.indexreg.size = SIZE_UNSPEC;
2475 1.1 christos else
2476 1.1 christos {
2477 1.1 christos ++s;
2478 1.1 christos switch (*s)
2479 1.1 christos {
2480 1.1 christos case 'w':
2481 1.1 christos case 'W':
2482 1.1 christos yylval.indexreg.size = SIZE_WORD;
2483 1.1 christos ++s;
2484 1.1 christos break;
2485 1.1 christos case 'l':
2486 1.1 christos case 'L':
2487 1.1 christos yylval.indexreg.size = SIZE_LONG;
2488 1.1 christos ++s;
2489 1.1 christos break;
2490 1.1 christos default:
2491 1.1 christos yyerror (_("illegal size specification"));
2492 1.1 christos yylval.indexreg.size = SIZE_UNSPEC;
2493 1.1 christos break;
2494 1.1 christos }
2495 1.1 christos }
2496 1.1 christos
2497 1.1 christos yylval.indexreg.scale = 1;
2498 1.1 christos
2499 1.1 christos if (*s == '*' || *s == ':')
2500 1.1 christos {
2501 1.1 christos expressionS scale;
2502 1.1 christos
2503 1.1 christos ++s;
2504 1.1 christos
2505 1.1 christos temp_ilp (s);
2506 1.1 christos expression (&scale);
2507 1.1 christos s = input_line_pointer;
2508 1.1 christos restore_ilp ();
2509 1.1 christos
2510 1.1 christos if (scale.X_op != O_constant)
2511 1.1 christos yyerror (_("scale specification must resolve to a number"));
2512 1.1 christos else
2513 1.1 christos {
2514 1.1 christos switch (scale.X_add_number)
2515 1.1 christos {
2516 1.1 christos case 1:
2517 1.1 christos case 2:
2518 1.1 christos case 4:
2519 1.1 christos case 8:
2520 1.1 christos yylval.indexreg.scale = scale.X_add_number;
2521 1.1 christos break;
2522 1.1 christos default:
2523 1.1 christos yyerror (_("invalid scale value"));
2524 1.1 christos break;
2525 1.1 christos }
2526 1.1 christos }
2527 1.1 christos }
2528 1.1 christos
2529 1.1 christos str = s;
2530 1.1 christos
2531 1.1 christos return INDEXREG;
2532 1.1 christos }
2533 1.1 christos
2534 1.1 christos /* It must be an expression. Before we call expression, we need to
2535 1.1 christos look ahead to see if there is a size specification. We must do
2536 1.1 christos that first, because otherwise foo.l will be treated as the symbol
2537 1.1 christos foo.l, rather than as the symbol foo with a long size
2538 1.1 christos specification. The grammar requires that all expressions end at
2539 1.1 christos the end of the operand, or with ',', '(', ']', ')'. */
2540 1.1 christos
2541 1.1 christos parens = 0;
2542 1.1 christos for (s = str; *s != '\0'; s++)
2543 1.1 christos {
2544 1.1 christos if (*s == '(')
2545 1.1 christos {
2546 1.1 christos if (parens == 0
2547 1.1 christos && s > str
2548 1.1 christos && (s[-1] == ')' || ISALNUM (s[-1])))
2549 1.1 christos break;
2550 1.1 christos ++parens;
2551 1.1 christos }
2552 1.1 christos else if (*s == ')')
2553 1.1 christos {
2554 1.1 christos if (parens == 0)
2555 1.1 christos break;
2556 1.1 christos --parens;
2557 1.1 christos }
2558 1.1 christos else if (parens == 0
2559 1.1 christos && (*s == ',' || *s == ']'))
2560 1.1 christos break;
2561 1.1 christos }
2562 1.1 christos
2563 1.1 christos yylval.exp.size = SIZE_UNSPEC;
2564 1.1 christos if (s <= str + 2
2565 1.1 christos || (s[-2] != '.' && s[-2] != ':'))
2566 1.1 christos tail = 0;
2567 1.1 christos else
2568 1.1 christos {
2569 1.1 christos switch (s[-1])
2570 1.1 christos {
2571 1.1 christos case 's':
2572 1.1 christos case 'S':
2573 1.1 christos case 'b':
2574 1.1 christos case 'B':
2575 1.1 christos yylval.exp.size = SIZE_BYTE;
2576 1.1 christos break;
2577 1.1 christos case 'w':
2578 1.1 christos case 'W':
2579 1.1 christos yylval.exp.size = SIZE_WORD;
2580 1.1 christos break;
2581 1.1 christos case 'l':
2582 1.1 christos case 'L':
2583 1.1 christos yylval.exp.size = SIZE_LONG;
2584 1.1 christos break;
2585 1.1 christos default:
2586 1.1 christos break;
2587 1.1 christos }
2588 1.1 christos if (yylval.exp.size != SIZE_UNSPEC)
2589 1.1 christos tail = 2;
2590 1.1 christos }
2591 1.1 christos
2592 1.1 christos #ifdef OBJ_ELF
2593 1.1 christos {
2594 1.1 christos /* Look for @PLTPC, etc. */
2595 1.1 christos char *cp;
2596 1.1 christos
2597 1.1 christos yylval.exp.pic_reloc = pic_none;
2598 1.1 christos cp = s - tail;
2599 1.1 christos if (cp - 7 > str && cp[-7] == '@')
2600 1.1 christos {
2601 1.1 christos if (startswith (cp - 7, "@TLSLDM"))
2602 1.1 christos {
2603 1.1 christos yylval.exp.pic_reloc = pic_tls_ldm;
2604 1.1 christos tail += 7;
2605 1.1 christos }
2606 1.1 christos else if (startswith (cp - 7, "@TLSLDO"))
2607 1.1 christos {
2608 1.1 christos yylval.exp.pic_reloc = pic_tls_ldo;
2609 1.1 christos tail += 7;
2610 1.1 christos }
2611 1.1 christos }
2612 1.1 christos else if (cp - 6 > str && cp[-6] == '@')
2613 1.1 christos {
2614 1.1 christos if (startswith (cp - 6, "@PLTPC"))
2615 1.1 christos {
2616 1.1 christos yylval.exp.pic_reloc = pic_plt_pcrel;
2617 1.1 christos tail += 6;
2618 1.1 christos }
2619 1.1 christos else if (startswith (cp - 6, "@GOTPC"))
2620 1.1 christos {
2621 1.1 christos yylval.exp.pic_reloc = pic_got_pcrel;
2622 1.1 christos tail += 6;
2623 1.1 christos }
2624 1.1 christos else if (startswith (cp - 6, "@TLSGD"))
2625 1.1 christos {
2626 1.1 christos yylval.exp.pic_reloc = pic_tls_gd;
2627 1.1 christos tail += 6;
2628 1.1 christos }
2629 1.1 christos else if (startswith (cp - 6, "@TLSIE"))
2630 1.1 christos {
2631 1.1 christos yylval.exp.pic_reloc = pic_tls_ie;
2632 1.1 christos tail += 6;
2633 1.1 christos }
2634 1.1 christos else if (startswith (cp - 6, "@TLSLE"))
2635 1.1 christos {
2636 1.1 christos yylval.exp.pic_reloc = pic_tls_le;
2637 1.1 christos tail += 6;
2638 1.1 christos }
2639 1.1 christos }
2640 1.1 christos else if (cp - 4 > str && cp[-4] == '@')
2641 1.1 christos {
2642 1.1 christos if (startswith (cp - 4, "@PLT"))
2643 1.1 christos {
2644 1.1 christos yylval.exp.pic_reloc = pic_plt_off;
2645 1.1 christos tail += 4;
2646 1.1 christos }
2647 1.1 christos else if (startswith (cp - 4, "@GOT"))
2648 1.1 christos {
2649 1.1 christos yylval.exp.pic_reloc = pic_got_off;
2650 1.1 christos tail += 4;
2651 1.1 christos }
2652 1.1 christos }
2653 1.1 christos }
2654 1.1 christos #endif
2655 1.1 christos
2656 1.1 christos if (tail != 0)
2657 1.1 christos {
2658 1.1 christos c = s[-tail];
2659 1.1 christos s[-tail] = 0;
2660 1.1 christos }
2661 1.1 christos
2662 1.1 christos temp_ilp (str);
2663 1.1 christos expression (&yylval.exp.exp);
2664 1.1 christos str = input_line_pointer;
2665 1.1 christos restore_ilp ();
2666 1.1 christos
2667 1.1 christos if (tail != 0)
2668 1.1 christos {
2669 1.1 christos s[-tail] = c;
2670 1.1 christos str = s;
2671 1.1 christos }
2672 1.1 christos
2673 1.1 christos return EXPR;
2674 1.1 christos }
2675 1.1 christos
2676 1.1 christos /* Parse an m68k operand. This is the only function which is called
2677 1.1 christos from outside this file. */
2678 1.1 christos
2679 1.1 christos int
2680 1.1 christos m68k_ip_op (char *s, struct m68k_op *oparg)
2681 1.1 christos {
2682 1.1 christos memset (oparg, 0, sizeof *oparg);
2683 1.1 christos oparg->error = NULL;
2684 1.1 christos oparg->index.reg = ZDATA0;
2685 1.1 christos oparg->index.scale = 1;
2686 1.1 christos oparg->disp.exp.X_op = O_absent;
2687 1.1 christos oparg->odisp.exp.X_op = O_absent;
2688 1.1 christos
2689 1.1 christos str = strorig = s;
2690 1.1 christos op = oparg;
2691 1.1 christos
2692 1.1 christos return yyparse ();
2693 1.1 christos }
2694 1.1 christos
2695 1.1 christos /* The error handler. */
2696 1.1 christos
2697 1.1 christos static void
2698 1.1 christos yyerror (const char *s)
2699 1.1 christos {
2700 1.1 christos op->error = s;
2701 1.1 christos }
2702