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