16a4c786fSespie /* A Bison parser, made from m68k-parse.y
2c074d1c9Sdrahn by GNU bison 1.35. */
36a4c786fSespie
46a4c786fSespie #define YYBISON 1 /* Identify Bison output. */
56a4c786fSespie
66a4c786fSespie # define DR 257
76a4c786fSespie # define AR 258
86a4c786fSespie # define FPR 259
96a4c786fSespie # define FPCR 260
106a4c786fSespie # define LPC 261
116a4c786fSespie # define ZAR 262
126a4c786fSespie # define ZDR 263
136a4c786fSespie # define LZPC 264
146a4c786fSespie # define CREG 265
156a4c786fSespie # define INDEXREG 266
166a4c786fSespie # define EXPR 267
176a4c786fSespie
186a4c786fSespie #line 27 "m68k-parse.y"
196a4c786fSespie
206a4c786fSespie
216a4c786fSespie #include "as.h"
226a4c786fSespie #include "tc-m68k.h"
236a4c786fSespie #include "m68k-parse.h"
24c074d1c9Sdrahn #include "safe-ctype.h"
256a4c786fSespie
266a4c786fSespie /* Remap normal yacc parser interface names (yyparse, yylex, yyerror,
27*007c2a45Smiod etc), as well as gratuitously global symbol names If other parser
286a4c786fSespie generators (bison, byacc, etc) produce additional global names that
296a4c786fSespie conflict at link time, then those parser generators need to be
306a4c786fSespie fixed instead of adding those names to this list. */
316a4c786fSespie
326a4c786fSespie #define yymaxdepth m68k_maxdepth
336a4c786fSespie #define yyparse m68k_parse
346a4c786fSespie #define yylex m68k_lex
356a4c786fSespie #define yyerror m68k_error
366a4c786fSespie #define yylval m68k_lval
376a4c786fSespie #define yychar m68k_char
386a4c786fSespie #define yydebug m68k_debug
396a4c786fSespie #define yypact m68k_pact
406a4c786fSespie #define yyr1 m68k_r1
416a4c786fSespie #define yyr2 m68k_r2
426a4c786fSespie #define yydef m68k_def
436a4c786fSespie #define yychk m68k_chk
446a4c786fSespie #define yypgo m68k_pgo
456a4c786fSespie #define yyact m68k_act
466a4c786fSespie #define yyexca m68k_exca
476a4c786fSespie #define yyerrflag m68k_errflag
486a4c786fSespie #define yynerrs m68k_nerrs
496a4c786fSespie #define yyps m68k_ps
506a4c786fSespie #define yypv m68k_pv
516a4c786fSespie #define yys m68k_s
526a4c786fSespie #define yy_yys m68k_yys
536a4c786fSespie #define yystate m68k_state
546a4c786fSespie #define yytmp m68k_tmp
556a4c786fSespie #define yyv m68k_v
566a4c786fSespie #define yy_yyv m68k_yyv
576a4c786fSespie #define yyval m68k_val
586a4c786fSespie #define yylloc m68k_lloc
596a4c786fSespie #define yyreds m68k_reds /* With YYDEBUG defined */
606a4c786fSespie #define yytoks m68k_toks /* With YYDEBUG defined */
616a4c786fSespie #define yylhs m68k_yylhs
626a4c786fSespie #define yylen m68k_yylen
636a4c786fSespie #define yydefred m68k_yydefred
646a4c786fSespie #define yydgoto m68k_yydgoto
656a4c786fSespie #define yysindex m68k_yysindex
666a4c786fSespie #define yyrindex m68k_yyrindex
676a4c786fSespie #define yygindex m68k_yygindex
686a4c786fSespie #define yytable m68k_yytable
696a4c786fSespie #define yycheck m68k_yycheck
706a4c786fSespie
716a4c786fSespie #ifndef YYDEBUG
726a4c786fSespie #define YYDEBUG 1
736a4c786fSespie #endif
746a4c786fSespie
756a4c786fSespie /* Internal functions. */
766a4c786fSespie
776a4c786fSespie static enum m68k_register m68k_reg_parse PARAMS ((char **));
786a4c786fSespie static int yylex PARAMS ((void));
796a4c786fSespie static void yyerror PARAMS ((const char *));
806a4c786fSespie
816a4c786fSespie /* The parser sets fields pointed to by this global variable. */
826a4c786fSespie static struct m68k_op *op;
836a4c786fSespie
846a4c786fSespie
85c074d1c9Sdrahn #line 94 "m68k-parse.y"
86c074d1c9Sdrahn #ifndef YYSTYPE
876a4c786fSespie typedef union
886a4c786fSespie {
896a4c786fSespie struct m68k_indexreg indexreg;
906a4c786fSespie enum m68k_register reg;
916a4c786fSespie struct m68k_exp exp;
926a4c786fSespie unsigned long mask;
936a4c786fSespie int onereg;
94c074d1c9Sdrahn } yystype;
95c074d1c9Sdrahn # define YYSTYPE yystype
96c074d1c9Sdrahn # define YYSTYPE_IS_TRIVIAL 1
976a4c786fSespie #endif
98c074d1c9Sdrahn #ifndef YYDEBUG
99c074d1c9Sdrahn # define YYDEBUG 0
1006a4c786fSespie #endif
1016a4c786fSespie
1026a4c786fSespie
1036a4c786fSespie
1046a4c786fSespie #define YYFINAL 173
1056a4c786fSespie #define YYFLAG -32768
1066a4c786fSespie #define YYNTBASE 25
1076a4c786fSespie
108c074d1c9Sdrahn /* YYTRANSLATE(YYLEX) -- Bison token number corresponding to YYLEX. */
1096a4c786fSespie #define YYTRANSLATE(x) ((unsigned)(x) <= 267 ? yytranslate[x] : 44)
1106a4c786fSespie
111c074d1c9Sdrahn /* YYTRANSLATE[YYLEX] -- Bison token number corresponding to YYLEX. */
112c074d1c9Sdrahn static const char yytranslate[] =
113c074d1c9Sdrahn {
114c074d1c9Sdrahn 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1156a4c786fSespie 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1166a4c786fSespie 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
117c074d1c9Sdrahn 2, 2, 2, 2, 2, 14, 2, 2, 15, 2,
118c074d1c9Sdrahn 16, 17, 2, 18, 20, 19, 2, 24, 2, 2,
1196a4c786fSespie 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
120c074d1c9Sdrahn 2, 2, 2, 2, 23, 2, 2, 2, 2, 2,
1216a4c786fSespie 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1226a4c786fSespie 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
123c074d1c9Sdrahn 2, 21, 2, 22, 2, 2, 2, 2, 2, 2,
1246a4c786fSespie 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1256a4c786fSespie 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1266a4c786fSespie 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1276a4c786fSespie 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1286a4c786fSespie 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1296a4c786fSespie 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1306a4c786fSespie 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1316a4c786fSespie 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1326a4c786fSespie 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1336a4c786fSespie 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1346a4c786fSespie 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1356a4c786fSespie 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1366a4c786fSespie 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1376a4c786fSespie 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1386a4c786fSespie 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
139c074d1c9Sdrahn 2, 2, 2, 2, 2, 2, 1, 3, 4, 5,
140c074d1c9Sdrahn 6, 7, 8, 9, 10, 11, 12, 13
1416a4c786fSespie };
1426a4c786fSespie
143c074d1c9Sdrahn #if YYDEBUG
144c074d1c9Sdrahn static const short yyprhs[] =
145c074d1c9Sdrahn {
146c074d1c9Sdrahn 0, 0, 2, 4, 6, 8, 10, 12, 14, 16,
147c074d1c9Sdrahn 18, 21, 24, 26, 30, 35, 40, 46, 52, 57,
148c074d1c9Sdrahn 61, 65, 69, 77, 85, 92, 98, 105, 111, 118,
149c074d1c9Sdrahn 124, 130, 135, 145, 153, 162, 169, 180, 189, 200,
150c074d1c9Sdrahn 209, 218, 221, 225, 229, 235, 242, 253, 263, 274,
151c074d1c9Sdrahn 276, 278, 280, 282, 284, 286, 288, 290, 292, 294,
152c074d1c9Sdrahn 296, 298, 300, 302, 303, 305, 307, 309, 310, 313,
153c074d1c9Sdrahn 314, 317, 318, 321, 323, 327, 331, 333, 335, 339,
154c074d1c9Sdrahn 343, 347, 349, 351, 353
1556a4c786fSespie };
156c074d1c9Sdrahn static const short yyrhs[] =
157c074d1c9Sdrahn {
158c074d1c9Sdrahn 26, 0, 27, 0, 28, 0, 3, 0, 4, 0,
159c074d1c9Sdrahn 5, 0, 6, 0, 11, 0, 13, 0, 14, 13,
160c074d1c9Sdrahn 0, 15, 13, 0, 40, 0, 16, 4, 17, 0,
161c074d1c9Sdrahn 16, 4, 17, 18, 0, 19, 16, 4, 17, 0,
162c074d1c9Sdrahn 16, 13, 20, 34, 17, 0, 16, 34, 20, 13,
163c074d1c9Sdrahn 17, 0, 13, 16, 34, 17, 0, 16, 7, 17,
164c074d1c9Sdrahn 0, 16, 8, 17, 0, 16, 10, 17, 0, 16,
165c074d1c9Sdrahn 13, 20, 34, 20, 29, 17, 0, 16, 13, 20,
166c074d1c9Sdrahn 34, 20, 36, 17, 0, 16, 13, 20, 30, 37,
167c074d1c9Sdrahn 17, 0, 16, 30, 20, 13, 17, 0, 13, 16,
168c074d1c9Sdrahn 34, 20, 29, 17, 0, 16, 34, 20, 29, 17,
169c074d1c9Sdrahn 0, 13, 16, 34, 20, 36, 17, 0, 16, 34,
170c074d1c9Sdrahn 20, 36, 17, 0, 13, 16, 30, 37, 17, 0,
171c074d1c9Sdrahn 16, 30, 37, 17, 0, 16, 21, 13, 37, 22,
172c074d1c9Sdrahn 20, 29, 38, 17, 0, 16, 21, 13, 37, 22,
173c074d1c9Sdrahn 38, 17, 0, 16, 21, 34, 22, 20, 29, 38,
174c074d1c9Sdrahn 17, 0, 16, 21, 34, 22, 38, 17, 0, 16,
175c074d1c9Sdrahn 21, 13, 20, 34, 20, 29, 22, 38, 17, 0,
176c074d1c9Sdrahn 16, 21, 34, 20, 29, 22, 38, 17, 0, 16,
177c074d1c9Sdrahn 21, 13, 20, 34, 20, 36, 22, 38, 17, 0,
178c074d1c9Sdrahn 16, 21, 34, 20, 36, 22, 38, 17, 0, 16,
179c074d1c9Sdrahn 21, 39, 30, 37, 22, 38, 17, 0, 35, 23,
180c074d1c9Sdrahn 0, 35, 23, 18, 0, 35, 23, 19, 0, 35,
181c074d1c9Sdrahn 23, 16, 13, 17, 0, 35, 23, 16, 39, 29,
182c074d1c9Sdrahn 17, 0, 35, 23, 16, 13, 17, 23, 16, 39,
183c074d1c9Sdrahn 29, 17, 0, 35, 23, 16, 13, 17, 23, 16,
184c074d1c9Sdrahn 13, 17, 0, 35, 23, 16, 39, 29, 17, 23,
185c074d1c9Sdrahn 16, 13, 17, 0, 12, 0, 31, 0, 12, 0,
186c074d1c9Sdrahn 32, 0, 32, 0, 4, 0, 8, 0, 3, 0,
187c074d1c9Sdrahn 9, 0, 4, 0, 7, 0, 33, 0, 10, 0,
188c074d1c9Sdrahn 8, 0, 0, 34, 0, 7, 0, 10, 0, 0,
189c074d1c9Sdrahn 20, 34, 0, 0, 20, 13, 0, 0, 13, 20,
190c074d1c9Sdrahn 0, 42, 0, 42, 24, 41, 0, 43, 24, 41,
191c074d1c9Sdrahn 0, 43, 0, 42, 0, 42, 24, 41, 0, 43,
192c074d1c9Sdrahn 24, 41, 0, 43, 19, 43, 0, 3, 0, 4,
193c074d1c9Sdrahn 0, 5, 0, 6, 0
1946a4c786fSespie };
1956a4c786fSespie
1966a4c786fSespie #endif
1976a4c786fSespie
198c074d1c9Sdrahn #if YYDEBUG
199c074d1c9Sdrahn /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
200c074d1c9Sdrahn static const short yyrline[] =
201c074d1c9Sdrahn {
202c074d1c9Sdrahn 0, 117, 119, 120, 125, 131, 136, 141, 146, 151,
203c074d1c9Sdrahn 156, 161, 166, 178, 184, 189, 194, 204, 214, 224,
204c074d1c9Sdrahn 229, 234, 239, 246, 257, 264, 270, 277, 283, 294,
205c074d1c9Sdrahn 304, 311, 317, 325, 332, 339, 345, 353, 360, 372,
206c074d1c9Sdrahn 383, 395, 404, 412, 420, 430, 437, 445, 452, 465,
207c074d1c9Sdrahn 467, 479, 481, 492, 494, 495, 500, 502, 507, 509,
208c074d1c9Sdrahn 515, 517, 518, 523, 528, 533, 535, 540, 545, 553,
209c074d1c9Sdrahn 559, 567, 573, 581, 583, 587, 598, 603, 604, 608,
210c074d1c9Sdrahn 614, 624, 629, 633, 637
2116a4c786fSespie };
2126a4c786fSespie #endif
2136a4c786fSespie
2146a4c786fSespie
215c074d1c9Sdrahn #if (YYDEBUG) || defined YYERROR_VERBOSE
2166a4c786fSespie
217c074d1c9Sdrahn /* YYTNAME[TOKEN_NUM] -- String name of the token TOKEN_NUM. */
218c074d1c9Sdrahn static const char *const yytname[] =
219c074d1c9Sdrahn {
220c074d1c9Sdrahn "$", "error", "$undefined.", "DR", "AR", "FPR", "FPCR", "LPC", "ZAR",
221c074d1c9Sdrahn "ZDR", "LZPC", "CREG", "INDEXREG", "EXPR", "'#'", "'&'", "'('", "')'",
222c074d1c9Sdrahn "'+'", "'-'", "','", "'['", "']'", "'@'", "'/'", "operand",
223c074d1c9Sdrahn "generic_operand", "motorola_operand", "mit_operand", "zireg", "zdireg",
224c074d1c9Sdrahn "zadr", "zdr", "apc", "zapc", "optzapc", "zpc", "optczapc", "optcexpr",
225c074d1c9Sdrahn "optexprc", "reglist", "ireglist", "reglistpair", "reglistreg", 0
2266a4c786fSespie };
2276a4c786fSespie #endif
2286a4c786fSespie
229c074d1c9Sdrahn /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
230c074d1c9Sdrahn static const short yyr1[] =
231c074d1c9Sdrahn {
232c074d1c9Sdrahn 0, 25, 25, 25, 26, 26, 26, 26, 26, 26,
233c074d1c9Sdrahn 26, 26, 26, 27, 27, 27, 27, 27, 27, 27,
2346a4c786fSespie 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
2356a4c786fSespie 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
236c074d1c9Sdrahn 27, 28, 28, 28, 28, 28, 28, 28, 28, 29,
237c074d1c9Sdrahn 29, 30, 30, 31, 31, 31, 32, 32, 33, 33,
238c074d1c9Sdrahn 34, 34, 34, 35, 35, 36, 36, 37, 37, 38,
239c074d1c9Sdrahn 38, 39, 39, 40, 40, 40, 41, 41, 41, 41,
240c074d1c9Sdrahn 42, 43, 43, 43, 43
2416a4c786fSespie };
2426a4c786fSespie
243c074d1c9Sdrahn /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
244c074d1c9Sdrahn static const short yyr2[] =
245c074d1c9Sdrahn {
246c074d1c9Sdrahn 0, 1, 1, 1, 1, 1, 1, 1, 1, 1,
247c074d1c9Sdrahn 2, 2, 1, 3, 4, 4, 5, 5, 4, 3,
248c074d1c9Sdrahn 3, 3, 7, 7, 6, 5, 6, 5, 6, 5,
249c074d1c9Sdrahn 5, 4, 9, 7, 8, 6, 10, 8, 10, 8,
250c074d1c9Sdrahn 8, 2, 3, 3, 5, 6, 10, 9, 10, 1,
2516a4c786fSespie 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
252c074d1c9Sdrahn 1, 1, 1, 0, 1, 1, 1, 0, 2, 0,
253c074d1c9Sdrahn 2, 0, 2, 1, 3, 3, 1, 1, 3, 3,
254c074d1c9Sdrahn 3, 1, 1, 1, 1
2556a4c786fSespie };
2566a4c786fSespie
257c074d1c9Sdrahn /* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE
258c074d1c9Sdrahn doesn't specify something else to do. Zero means the default is an
259c074d1c9Sdrahn error. */
260c074d1c9Sdrahn static const short yydefact[] =
261c074d1c9Sdrahn {
262c074d1c9Sdrahn 63, 81, 82, 83, 84, 59, 62, 61, 8, 9,
263c074d1c9Sdrahn 0, 0, 0, 0, 1, 2, 3, 60, 64, 0,
264c074d1c9Sdrahn 12, 73, 0, 0, 10, 11, 56, 58, 59, 62,
265c074d1c9Sdrahn 57, 61, 51, 0, 71, 67, 52, 0, 0, 41,
266c074d1c9Sdrahn 0, 0, 0, 58, 67, 0, 13, 19, 20, 21,
267c074d1c9Sdrahn 0, 67, 0, 0, 0, 0, 0, 0, 71, 42,
268c074d1c9Sdrahn 43, 81, 82, 83, 84, 74, 77, 76, 80, 75,
269c074d1c9Sdrahn 0, 0, 18, 0, 14, 67, 0, 72, 0, 0,
270c074d1c9Sdrahn 69, 67, 0, 68, 31, 54, 65, 55, 66, 49,
271c074d1c9Sdrahn 0, 0, 50, 53, 0, 15, 0, 0, 0, 0,
272c074d1c9Sdrahn 30, 0, 0, 0, 16, 0, 68, 69, 0, 0,
273c074d1c9Sdrahn 0, 0, 0, 25, 17, 27, 29, 44, 72, 0,
274c074d1c9Sdrahn 78, 79, 26, 28, 24, 0, 0, 0, 0, 0,
275c074d1c9Sdrahn 69, 69, 70, 69, 35, 69, 0, 45, 22, 23,
276c074d1c9Sdrahn 0, 0, 69, 33, 0, 0, 0, 0, 0, 71,
277c074d1c9Sdrahn 0, 69, 69, 0, 37, 39, 34, 40, 0, 0,
278c074d1c9Sdrahn 0, 0, 0, 32, 47, 0, 0, 36, 38, 46,
279c074d1c9Sdrahn 48, 0, 0, 0
2806a4c786fSespie };
2816a4c786fSespie
282c074d1c9Sdrahn static const short yydefgoto[] =
283c074d1c9Sdrahn {
284c074d1c9Sdrahn 171, 14, 15, 16, 91, 35, 92, 93, 17, 83,
285c074d1c9Sdrahn 19, 94, 55, 111, 53, 20, 65, 66, 67
2866a4c786fSespie };
2876a4c786fSespie
288c074d1c9Sdrahn static const short yypact[] =
289c074d1c9Sdrahn {
290c074d1c9Sdrahn 89, 10, 11, 19, 23,-32768,-32768,-32768,-32768, 13,
291c074d1c9Sdrahn -4, 22, 57, 36,-32768,-32768,-32768,-32768,-32768, 18,
292c074d1c9Sdrahn -32768, 33, -2, 114,-32768,-32768,-32768, 46, 62, 66,
293c074d1c9Sdrahn -32768, 67,-32768, 68, 131, 69,-32768, 70, 105, 147,
294c074d1c9Sdrahn 156, 156, 156,-32768, 94, 25, 101,-32768,-32768,-32768,
295c074d1c9Sdrahn 114, 100, 53, 9, 138, 108, 103, 112, 117,-32768,
296c074d1c9Sdrahn -32768,-32768,-32768,-32768,-32768,-32768, 119, 12,-32768,-32768,
297c074d1c9Sdrahn 64, 130,-32768, 124,-32768, 94, 81, 64, 135, 124,
298c074d1c9Sdrahn 132, 94, 150,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
299c074d1c9Sdrahn 151, 152,-32768,-32768, 153,-32768, 120, 146, 156, 156,
300c074d1c9Sdrahn -32768, 154, 155, 157,-32768, 124, 144, 158, 159, 160,
301c074d1c9Sdrahn 73, 162, 161,-32768,-32768,-32768,-32768, 163,-32768, 167,
302c074d1c9Sdrahn -32768,-32768,-32768,-32768,-32768, 168, 170, 124, 73, 171,
303c074d1c9Sdrahn 169, 169,-32768, 169,-32768, 169, 164, 172,-32768,-32768,
304c074d1c9Sdrahn 174, 175, 169,-32768, 177, 176, 181, 182, 183, 178,
305c074d1c9Sdrahn 185, 169, 169, 186,-32768,-32768,-32768,-32768, 136, 146,
306c074d1c9Sdrahn 179, 187, 188,-32768,-32768, 189, 190,-32768,-32768,-32768,
307c074d1c9Sdrahn -32768, 173, 194,-32768
3086a4c786fSespie };
3096a4c786fSespie
310c074d1c9Sdrahn static const short yypgoto[] =
311c074d1c9Sdrahn {
312c074d1c9Sdrahn -32768,-32768,-32768,-32768, -72, 1,-32768, -7,-32768, 3,
313c074d1c9Sdrahn -32768, -65, -31, -103, -58,-32768, -40, 202, 6
3146a4c786fSespie };
3156a4c786fSespie
3166a4c786fSespie
3176a4c786fSespie #define YYLAST 207
3186a4c786fSespie
3196a4c786fSespie
320c074d1c9Sdrahn static const short yytable[] =
321c074d1c9Sdrahn {
322c074d1c9Sdrahn 97, 101, 69, 18, 129, 36, 22, 108, 102, 24,
323c074d1c9Sdrahn -4, -5, 26, 71, 109, 37, 36, 41, 30, -6,
324c074d1c9Sdrahn 78, 32, 42, -7, 44, 119, 45, 145, 146, 23,
325c074d1c9Sdrahn 147, 41, 148, 125, -58, 25, 99, 52, 133, 153,
326c074d1c9Sdrahn 126, 39, 72, 36, 103, 73, 36, 68, 161, 162,
327c074d1c9Sdrahn 112, 75, 38, 76, 81, 140, 142, 40, 120, 121,
328c074d1c9Sdrahn 26, 27, 141, 46, 28, 29, 30, 31, 43, 32,
329c074d1c9Sdrahn 33, 5, 6, 79, 7, 80, 26, 85, 34, 47,
330c074d1c9Sdrahn 106, 87, 30, 48, 49, 89, 132, 165, 50, 54,
331c074d1c9Sdrahn 56, 159, 1, 2, 3, 4, 5, 6, 104, 7,
332c074d1c9Sdrahn 8, 105, 9, 10, 11, 12, 26, 85, 13, 57,
333c074d1c9Sdrahn 86, 87, 30, 88, 70, 89, 90, 26, 43, 74,
334c074d1c9Sdrahn 77, 5, 6, 30, 7, 84, 32, 26, 85, 95,
335c074d1c9Sdrahn 96, 86, 87, 30, 88, 43, 89, 117, 5, 6,
336c074d1c9Sdrahn 118, 7, 43, 98, 51, 5, 6, 100, 7, 26,
337c074d1c9Sdrahn 85, 82, 110, 164, 87, 30, 118, 107, 89, 61,
338c074d1c9Sdrahn 62, 63, 64, 58, 127, 59, 60, 113, 114, 115,
339c074d1c9Sdrahn 116, 122, 123, 172, 124, 0, 0, 0, 128, 134,
340c074d1c9Sdrahn 149, 130, 131, 135, 137, 138, 136, 139, 143, 144,
341c074d1c9Sdrahn 132, 158, 166, 154, 173, 150, 151, 152, 155, 156,
342c074d1c9Sdrahn 157, 160, 21, 163, 167, 168, 169, 170
3436a4c786fSespie };
3446a4c786fSespie
345c074d1c9Sdrahn static const short yycheck[] =
346c074d1c9Sdrahn {
347c074d1c9Sdrahn 58, 73, 42, 0, 107, 12, 0, 79, 73, 13,
348c074d1c9Sdrahn 0, 0, 3, 44, 79, 12, 23, 19, 9, 0,
349c074d1c9Sdrahn 51, 12, 24, 0, 23, 97, 23, 130, 131, 16,
350c074d1c9Sdrahn 133, 19, 135, 105, 23, 13, 24, 34, 110, 142,
351c074d1c9Sdrahn 105, 23, 17, 50, 75, 20, 53, 41, 151, 152,
352c074d1c9Sdrahn 81, 50, 16, 50, 53, 127, 128, 24, 98, 99,
353c074d1c9Sdrahn 3, 4, 127, 17, 7, 8, 9, 10, 4, 12,
354c074d1c9Sdrahn 13, 7, 8, 20, 10, 22, 3, 4, 21, 17,
355c074d1c9Sdrahn 77, 8, 9, 17, 17, 12, 13, 159, 20, 20,
356c074d1c9Sdrahn 20, 149, 3, 4, 5, 6, 7, 8, 17, 10,
357c074d1c9Sdrahn 11, 20, 13, 14, 15, 16, 3, 4, 19, 4,
358c074d1c9Sdrahn 7, 8, 9, 10, 20, 12, 13, 3, 4, 18,
359c074d1c9Sdrahn 20, 7, 8, 9, 10, 17, 12, 3, 4, 17,
360c074d1c9Sdrahn 13, 7, 8, 9, 10, 4, 12, 17, 7, 8,
361c074d1c9Sdrahn 20, 10, 4, 24, 13, 7, 8, 17, 10, 3,
362c074d1c9Sdrahn 4, 13, 20, 17, 8, 9, 20, 22, 12, 3,
363c074d1c9Sdrahn 4, 5, 6, 16, 20, 18, 19, 17, 17, 17,
364c074d1c9Sdrahn 17, 17, 17, 0, 17, -1, -1, -1, 20, 17,
365c074d1c9Sdrahn 16, 22, 22, 22, 17, 17, 23, 17, 17, 20,
366c074d1c9Sdrahn 13, 13, 13, 17, 0, 23, 22, 22, 17, 17,
367c074d1c9Sdrahn 17, 16, 0, 17, 17, 17, 17, 17
3686a4c786fSespie };
3696a4c786fSespie /* -*-C-*- Note some compilers choke on comments on `#line' lines. */
370c074d1c9Sdrahn #line 3 "/usr/share/bison-1.35/bison.simple"
3716a4c786fSespie
3726a4c786fSespie /* Skeleton output parser for bison,
373c074d1c9Sdrahn
374c074d1c9Sdrahn Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software
375c074d1c9Sdrahn Foundation, Inc.
3766a4c786fSespie
3776a4c786fSespie This program is free software; you can redistribute it and/or modify
3786a4c786fSespie it under the terms of the GNU General Public License as published by
3796a4c786fSespie the Free Software Foundation; either version 2, or (at your option)
3806a4c786fSespie any later version.
3816a4c786fSespie
3826a4c786fSespie This program is distributed in the hope that it will be useful,
3836a4c786fSespie but WITHOUT ANY WARRANTY; without even the implied warranty of
3846a4c786fSespie MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3856a4c786fSespie GNU General Public License for more details.
3866a4c786fSespie
3876a4c786fSespie You should have received a copy of the GNU General Public License
3886a4c786fSespie along with this program; if not, write to the Free Software
3896a4c786fSespie Foundation, Inc., 59 Temple Place - Suite 330,
3906a4c786fSespie Boston, MA 02111-1307, USA. */
3916a4c786fSespie
3926a4c786fSespie /* As a special exception, when this file is copied by Bison into a
3936a4c786fSespie Bison output file, you may use that output file without restriction.
3946a4c786fSespie This special exception was added by the Free Software Foundation
3956a4c786fSespie in version 1.24 of Bison. */
3966a4c786fSespie
397c074d1c9Sdrahn /* This is the parser code that is written into each bison parser when
398c074d1c9Sdrahn the %semantic_parser declaration is not specified in the grammar.
3996a4c786fSespie It was written by Richard Stallman by simplifying the hairy parser
4006a4c786fSespie used when %semantic_parser is specified. */
4016a4c786fSespie
402c074d1c9Sdrahn /* All symbols defined below should begin with yy or YY, to avoid
403c074d1c9Sdrahn infringing on user name space. This should be done even for local
404c074d1c9Sdrahn variables, as they might otherwise be expanded by user macros.
405c074d1c9Sdrahn There are some unavoidable exceptions within include files to
406c074d1c9Sdrahn define necessary library symbols; they are noted "INFRINGES ON
407c074d1c9Sdrahn USER NAME SPACE" below. */
4086a4c786fSespie
409c074d1c9Sdrahn #if ! defined (yyoverflow) || defined (YYERROR_VERBOSE)
410c074d1c9Sdrahn
411c074d1c9Sdrahn /* The parser invokes alloca or malloc; define the necessary symbols. */
412c074d1c9Sdrahn
413c074d1c9Sdrahn # if YYSTACK_USE_ALLOCA
4146a4c786fSespie # define YYSTACK_ALLOC alloca
4156a4c786fSespie # else
416c074d1c9Sdrahn # ifndef YYSTACK_USE_ALLOCA
417c074d1c9Sdrahn # if defined (alloca) || defined (_ALLOCA_H)
418c074d1c9Sdrahn # define YYSTACK_ALLOC alloca
419c074d1c9Sdrahn # else
420c074d1c9Sdrahn # ifdef __GNUC__
421c074d1c9Sdrahn # define YYSTACK_ALLOC __builtin_alloca
422c074d1c9Sdrahn # endif
423c074d1c9Sdrahn # endif
424c074d1c9Sdrahn # endif
4256a4c786fSespie # endif
4266a4c786fSespie
427c074d1c9Sdrahn # ifdef YYSTACK_ALLOC
428c074d1c9Sdrahn /* Pacify GCC's `empty if-body' warning. */
429c074d1c9Sdrahn # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
430c074d1c9Sdrahn # else
431c074d1c9Sdrahn # if defined (__STDC__) || defined (__cplusplus)
432c074d1c9Sdrahn # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
433c074d1c9Sdrahn # define YYSIZE_T size_t
434c074d1c9Sdrahn # endif
435c074d1c9Sdrahn # define YYSTACK_ALLOC malloc
436c074d1c9Sdrahn # define YYSTACK_FREE free
437c074d1c9Sdrahn # endif
438c074d1c9Sdrahn #endif /* ! defined (yyoverflow) || defined (YYERROR_VERBOSE) */
439c074d1c9Sdrahn
440c074d1c9Sdrahn
441c074d1c9Sdrahn #if (! defined (yyoverflow) \
442c074d1c9Sdrahn && (! defined (__cplusplus) \
443c074d1c9Sdrahn || (YYLTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
444c074d1c9Sdrahn
445c074d1c9Sdrahn /* A type that is properly aligned for any stack member. */
446c074d1c9Sdrahn union yyalloc
447c074d1c9Sdrahn {
448c074d1c9Sdrahn short yyss;
449c074d1c9Sdrahn YYSTYPE yyvs;
450c074d1c9Sdrahn # if YYLSP_NEEDED
451c074d1c9Sdrahn YYLTYPE yyls;
452c074d1c9Sdrahn # endif
453c074d1c9Sdrahn };
454c074d1c9Sdrahn
455c074d1c9Sdrahn /* The size of the maximum gap between one aligned stack and the next. */
456c074d1c9Sdrahn # define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1)
457c074d1c9Sdrahn
458c074d1c9Sdrahn /* The size of an array large to enough to hold all stacks, each with
459c074d1c9Sdrahn N elements. */
460c074d1c9Sdrahn # if YYLSP_NEEDED
461c074d1c9Sdrahn # define YYSTACK_BYTES(N) \
462c074d1c9Sdrahn ((N) * (sizeof (short) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
463c074d1c9Sdrahn + 2 * YYSTACK_GAP_MAX)
464c074d1c9Sdrahn # else
465c074d1c9Sdrahn # define YYSTACK_BYTES(N) \
466c074d1c9Sdrahn ((N) * (sizeof (short) + sizeof (YYSTYPE)) \
467c074d1c9Sdrahn + YYSTACK_GAP_MAX)
468c074d1c9Sdrahn # endif
469c074d1c9Sdrahn
470c074d1c9Sdrahn /* Copy COUNT objects from FROM to TO. The source and destination do
471c074d1c9Sdrahn not overlap. */
472c074d1c9Sdrahn # ifndef YYCOPY
473c074d1c9Sdrahn # if 1 < __GNUC__
474c074d1c9Sdrahn # define YYCOPY(To, From, Count) \
475c074d1c9Sdrahn __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
476c074d1c9Sdrahn # else
477c074d1c9Sdrahn # define YYCOPY(To, From, Count) \
478c074d1c9Sdrahn do \
479c074d1c9Sdrahn { \
480c074d1c9Sdrahn register YYSIZE_T yyi; \
481c074d1c9Sdrahn for (yyi = 0; yyi < (Count); yyi++) \
482c074d1c9Sdrahn (To)[yyi] = (From)[yyi]; \
483c074d1c9Sdrahn } \
484c074d1c9Sdrahn while (0)
485c074d1c9Sdrahn # endif
486c074d1c9Sdrahn # endif
487c074d1c9Sdrahn
488c074d1c9Sdrahn /* Relocate STACK from its old location to the new one. The
489c074d1c9Sdrahn local variables YYSIZE and YYSTACKSIZE give the old and new number of
490c074d1c9Sdrahn elements in the stack, and YYPTR gives the new location of the
491c074d1c9Sdrahn stack. Advance YYPTR to a properly aligned location for the next
492c074d1c9Sdrahn stack. */
493c074d1c9Sdrahn # define YYSTACK_RELOCATE(Stack) \
494c074d1c9Sdrahn do \
495c074d1c9Sdrahn { \
496c074d1c9Sdrahn YYSIZE_T yynewbytes; \
497c074d1c9Sdrahn YYCOPY (&yyptr->Stack, Stack, yysize); \
498c074d1c9Sdrahn Stack = &yyptr->Stack; \
499c074d1c9Sdrahn yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAX; \
500c074d1c9Sdrahn yyptr += yynewbytes / sizeof (*yyptr); \
501c074d1c9Sdrahn } \
502c074d1c9Sdrahn while (0)
503c074d1c9Sdrahn
504c074d1c9Sdrahn #endif
505c074d1c9Sdrahn
506c074d1c9Sdrahn
507c074d1c9Sdrahn #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
508c074d1c9Sdrahn # define YYSIZE_T __SIZE_TYPE__
509c074d1c9Sdrahn #endif
510c074d1c9Sdrahn #if ! defined (YYSIZE_T) && defined (size_t)
511c074d1c9Sdrahn # define YYSIZE_T size_t
512c074d1c9Sdrahn #endif
513c074d1c9Sdrahn #if ! defined (YYSIZE_T)
514c074d1c9Sdrahn # if defined (__STDC__) || defined (__cplusplus)
515c074d1c9Sdrahn # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
516c074d1c9Sdrahn # define YYSIZE_T size_t
517c074d1c9Sdrahn # endif
518c074d1c9Sdrahn #endif
519c074d1c9Sdrahn #if ! defined (YYSIZE_T)
520c074d1c9Sdrahn # define YYSIZE_T unsigned int
521c074d1c9Sdrahn #endif
5226a4c786fSespie
5236a4c786fSespie #define yyerrok (yyerrstatus = 0)
5246a4c786fSespie #define yyclearin (yychar = YYEMPTY)
5256a4c786fSespie #define YYEMPTY -2
5266a4c786fSespie #define YYEOF 0
5276a4c786fSespie #define YYACCEPT goto yyacceptlab
5286a4c786fSespie #define YYABORT goto yyabortlab
5296a4c786fSespie #define YYERROR goto yyerrlab1
530c074d1c9Sdrahn /* Like YYERROR except do call yyerror. This remains here temporarily
531c074d1c9Sdrahn to ease the transition to the new meaning of YYERROR, for GCC.
5326a4c786fSespie Once GCC version 2 has supplanted version 1, this can go. */
5336a4c786fSespie #define YYFAIL goto yyerrlab
5346a4c786fSespie #define YYRECOVERING() (!!yyerrstatus)
535c074d1c9Sdrahn #define YYBACKUP(Token, Value) \
5366a4c786fSespie do \
5376a4c786fSespie if (yychar == YYEMPTY && yylen == 1) \
538c074d1c9Sdrahn { \
539c074d1c9Sdrahn yychar = (Token); \
540c074d1c9Sdrahn yylval = (Value); \
5416a4c786fSespie yychar1 = YYTRANSLATE (yychar); \
5426a4c786fSespie YYPOPSTACK; \
5436a4c786fSespie goto yybackup; \
5446a4c786fSespie } \
5456a4c786fSespie else \
546c074d1c9Sdrahn { \
547c074d1c9Sdrahn yyerror ("syntax error: cannot back up"); \
548c074d1c9Sdrahn YYERROR; \
549c074d1c9Sdrahn } \
5506a4c786fSespie while (0)
5516a4c786fSespie
5526a4c786fSespie #define YYTERROR 1
5536a4c786fSespie #define YYERRCODE 256
5546a4c786fSespie
555c074d1c9Sdrahn
556c074d1c9Sdrahn /* YYLLOC_DEFAULT -- Compute the default location (before the actions
557c074d1c9Sdrahn are run).
558c074d1c9Sdrahn
559c074d1c9Sdrahn When YYLLOC_DEFAULT is run, CURRENT is set the location of the
560c074d1c9Sdrahn first token. By default, to implement support for ranges, extend
561c074d1c9Sdrahn its range to the last symbol. */
562c074d1c9Sdrahn
563c074d1c9Sdrahn #ifndef YYLLOC_DEFAULT
564c074d1c9Sdrahn # define YYLLOC_DEFAULT(Current, Rhs, N) \
565c074d1c9Sdrahn Current.last_line = Rhs[N].last_line; \
566c074d1c9Sdrahn Current.last_column = Rhs[N].last_column;
5676a4c786fSespie #endif
5686a4c786fSespie
569c074d1c9Sdrahn
570c074d1c9Sdrahn /* YYLEX -- calling `yylex' with the right arguments. */
571c074d1c9Sdrahn
572c074d1c9Sdrahn #if YYPURE
573c074d1c9Sdrahn # if YYLSP_NEEDED
5746a4c786fSespie # ifdef YYLEX_PARAM
5756a4c786fSespie # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
5766a4c786fSespie # else
5776a4c786fSespie # define YYLEX yylex (&yylval, &yylloc)
5786a4c786fSespie # endif
579c074d1c9Sdrahn # else /* !YYLSP_NEEDED */
5806a4c786fSespie # ifdef YYLEX_PARAM
5816a4c786fSespie # define YYLEX yylex (&yylval, YYLEX_PARAM)
5826a4c786fSespie # else
5836a4c786fSespie # define YYLEX yylex (&yylval)
5846a4c786fSespie # endif
585c074d1c9Sdrahn # endif /* !YYLSP_NEEDED */
586c074d1c9Sdrahn #else /* !YYPURE */
587c074d1c9Sdrahn # define YYLEX yylex ()
588c074d1c9Sdrahn #endif /* !YYPURE */
589c074d1c9Sdrahn
590c074d1c9Sdrahn
591c074d1c9Sdrahn /* Enable debugging if requested. */
592c074d1c9Sdrahn #if YYDEBUG
593c074d1c9Sdrahn
594c074d1c9Sdrahn # ifndef YYFPRINTF
595c074d1c9Sdrahn # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
596c074d1c9Sdrahn # define YYFPRINTF fprintf
5976a4c786fSespie # endif
5986a4c786fSespie
599c074d1c9Sdrahn # define YYDPRINTF(Args) \
600c074d1c9Sdrahn do { \
601c074d1c9Sdrahn if (yydebug) \
602c074d1c9Sdrahn YYFPRINTF Args; \
603c074d1c9Sdrahn } while (0)
604c074d1c9Sdrahn /* Nonzero means print parse trace. It is left uninitialized so that
605c074d1c9Sdrahn multiple parsers can coexist. */
606c074d1c9Sdrahn int yydebug;
607c074d1c9Sdrahn #else /* !YYDEBUG */
608c074d1c9Sdrahn # define YYDPRINTF(Args)
609c074d1c9Sdrahn #endif /* !YYDEBUG */
6106a4c786fSespie
611c074d1c9Sdrahn /* YYINITDEPTH -- initial size of the parser's stacks. */
6126a4c786fSespie #ifndef YYINITDEPTH
6136a4c786fSespie # define YYINITDEPTH 200
6146a4c786fSespie #endif
6156a4c786fSespie
616c074d1c9Sdrahn /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
617c074d1c9Sdrahn if the built-in stack extension method is used).
618c074d1c9Sdrahn
619c074d1c9Sdrahn Do not make this value too large; the results are undefined if
620c074d1c9Sdrahn SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
621c074d1c9Sdrahn evaluated with infinite-precision integer arithmetic. */
6226a4c786fSespie
6236a4c786fSespie #if YYMAXDEPTH == 0
6246a4c786fSespie # undef YYMAXDEPTH
6256a4c786fSespie #endif
6266a4c786fSespie
6276a4c786fSespie #ifndef YYMAXDEPTH
6286a4c786fSespie # define YYMAXDEPTH 10000
6296a4c786fSespie #endif
6306a4c786fSespie
631c074d1c9Sdrahn #ifdef YYERROR_VERBOSE
6326a4c786fSespie
633c074d1c9Sdrahn # ifndef yystrlen
634c074d1c9Sdrahn # if defined (__GLIBC__) && defined (_STRING_H)
635c074d1c9Sdrahn # define yystrlen strlen
636c074d1c9Sdrahn # else
637c074d1c9Sdrahn /* Return the length of YYSTR. */
638c074d1c9Sdrahn static YYSIZE_T
639c074d1c9Sdrahn # if defined (__STDC__) || defined (__cplusplus)
yystrlen(const char * yystr)640c074d1c9Sdrahn yystrlen (const char *yystr)
641c074d1c9Sdrahn # else
642c074d1c9Sdrahn yystrlen (yystr)
643c074d1c9Sdrahn const char *yystr;
644c074d1c9Sdrahn # endif
6456a4c786fSespie {
646c074d1c9Sdrahn register const char *yys = yystr;
6476a4c786fSespie
648c074d1c9Sdrahn while (*yys++ != '\0')
649c074d1c9Sdrahn continue;
650c074d1c9Sdrahn
651c074d1c9Sdrahn return yys - yystr - 1;
6526a4c786fSespie }
653c074d1c9Sdrahn # endif
654c074d1c9Sdrahn # endif
6556a4c786fSespie
656c074d1c9Sdrahn # ifndef yystpcpy
657c074d1c9Sdrahn # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
658c074d1c9Sdrahn # define yystpcpy stpcpy
659c074d1c9Sdrahn # else
660c074d1c9Sdrahn /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
661c074d1c9Sdrahn YYDEST. */
662c074d1c9Sdrahn static char *
663c074d1c9Sdrahn # if defined (__STDC__) || defined (__cplusplus)
yystpcpy(char * yydest,const char * yysrc)664c074d1c9Sdrahn yystpcpy (char *yydest, const char *yysrc)
665c074d1c9Sdrahn # else
666c074d1c9Sdrahn yystpcpy (yydest, yysrc)
667c074d1c9Sdrahn char *yydest;
668c074d1c9Sdrahn const char *yysrc;
669c074d1c9Sdrahn # endif
6706a4c786fSespie {
671c074d1c9Sdrahn register char *yyd = yydest;
672c074d1c9Sdrahn register const char *yys = yysrc;
6736a4c786fSespie
674c074d1c9Sdrahn while ((*yyd++ = *yys++) != '\0')
675c074d1c9Sdrahn continue;
676c074d1c9Sdrahn
677c074d1c9Sdrahn return yyd - 1;
6786a4c786fSespie }
679c074d1c9Sdrahn # endif
6806a4c786fSespie # endif
6816a4c786fSespie #endif
6826a4c786fSespie
683c074d1c9Sdrahn #line 315 "/usr/share/bison-1.35/bison.simple"
684c074d1c9Sdrahn
6856a4c786fSespie
6866a4c786fSespie /* The user can define YYPARSE_PARAM as the name of an argument to be passed
6876a4c786fSespie into yyparse. The argument should have type void *.
6886a4c786fSespie It should actually point to an object.
6896a4c786fSespie Grammar actions can access the variable by casting it
6906a4c786fSespie to the proper pointer type. */
6916a4c786fSespie
6926a4c786fSespie #ifdef YYPARSE_PARAM
693c074d1c9Sdrahn # if defined (__STDC__) || defined (__cplusplus)
6946a4c786fSespie # define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
6956a4c786fSespie # define YYPARSE_PARAM_DECL
696c074d1c9Sdrahn # else
6976a4c786fSespie # define YYPARSE_PARAM_ARG YYPARSE_PARAM
6986a4c786fSespie # define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
699c074d1c9Sdrahn # endif
700c074d1c9Sdrahn #else /* !YYPARSE_PARAM */
7016a4c786fSespie # define YYPARSE_PARAM_ARG
7026a4c786fSespie # define YYPARSE_PARAM_DECL
703c074d1c9Sdrahn #endif /* !YYPARSE_PARAM */
7046a4c786fSespie
7056a4c786fSespie /* Prevent warning if -Wstrict-prototypes. */
7066a4c786fSespie #ifdef __GNUC__
7076a4c786fSespie # ifdef YYPARSE_PARAM
7086a4c786fSespie int yyparse (void *);
7096a4c786fSespie # else
7106a4c786fSespie int yyparse (void);
7116a4c786fSespie # endif
7126a4c786fSespie #endif
7136a4c786fSespie
714c074d1c9Sdrahn /* YY_DECL_VARIABLES -- depending whether we use a pure parser,
715c074d1c9Sdrahn variables are global, or local to YYPARSE. */
716c074d1c9Sdrahn
717c074d1c9Sdrahn #define YY_DECL_NON_LSP_VARIABLES \
718c074d1c9Sdrahn /* The lookahead symbol. */ \
719c074d1c9Sdrahn int yychar; \
720c074d1c9Sdrahn \
721c074d1c9Sdrahn /* The semantic value of the lookahead symbol. */ \
722c074d1c9Sdrahn YYSTYPE yylval; \
723c074d1c9Sdrahn \
724c074d1c9Sdrahn /* Number of parse errors so far. */ \
725c074d1c9Sdrahn int yynerrs;
726c074d1c9Sdrahn
727c074d1c9Sdrahn #if YYLSP_NEEDED
728c074d1c9Sdrahn # define YY_DECL_VARIABLES \
729c074d1c9Sdrahn YY_DECL_NON_LSP_VARIABLES \
730c074d1c9Sdrahn \
731c074d1c9Sdrahn /* Location data for the lookahead symbol. */ \
732c074d1c9Sdrahn YYLTYPE yylloc;
733c074d1c9Sdrahn #else
734c074d1c9Sdrahn # define YY_DECL_VARIABLES \
735c074d1c9Sdrahn YY_DECL_NON_LSP_VARIABLES
736c074d1c9Sdrahn #endif
737c074d1c9Sdrahn
738c074d1c9Sdrahn
739c074d1c9Sdrahn /* If nonreentrant, generate the variables here. */
740c074d1c9Sdrahn
741c074d1c9Sdrahn #if !YYPURE
742c074d1c9Sdrahn YY_DECL_VARIABLES
743c074d1c9Sdrahn #endif /* !YYPURE */
744c074d1c9Sdrahn
7456a4c786fSespie int
yyparse(YYPARSE_PARAM_ARG)7466a4c786fSespie yyparse (YYPARSE_PARAM_ARG)
7476a4c786fSespie YYPARSE_PARAM_DECL
7486a4c786fSespie {
749c074d1c9Sdrahn /* If reentrant, generate the variables here. */
750c074d1c9Sdrahn #if YYPURE
751c074d1c9Sdrahn YY_DECL_VARIABLES
752c074d1c9Sdrahn #endif /* !YYPURE */
753c074d1c9Sdrahn
7546a4c786fSespie register int yystate;
7556a4c786fSespie register int yyn;
756c074d1c9Sdrahn int yyresult;
757c074d1c9Sdrahn /* Number of tokens to shift before error messages enabled. */
758c074d1c9Sdrahn int yyerrstatus;
759c074d1c9Sdrahn /* Lookahead token as an internal (translated) token number. */
760c074d1c9Sdrahn int yychar1 = 0;
761c074d1c9Sdrahn
762c074d1c9Sdrahn /* Three stacks and their tools:
763c074d1c9Sdrahn `yyss': related to states,
764c074d1c9Sdrahn `yyvs': related to semantic values,
765c074d1c9Sdrahn `yyls': related to locations.
766c074d1c9Sdrahn
767c074d1c9Sdrahn Refer to the stacks thru separate pointers, to allow yyoverflow
768c074d1c9Sdrahn to reallocate them elsewhere. */
769c074d1c9Sdrahn
770c074d1c9Sdrahn /* The state stack. */
771c074d1c9Sdrahn short yyssa[YYINITDEPTH];
772c074d1c9Sdrahn short *yyss = yyssa;
7736a4c786fSespie register short *yyssp;
774c074d1c9Sdrahn
775c074d1c9Sdrahn /* The semantic value stack. */
776c074d1c9Sdrahn YYSTYPE yyvsa[YYINITDEPTH];
777c074d1c9Sdrahn YYSTYPE *yyvs = yyvsa;
7786a4c786fSespie register YYSTYPE *yyvsp;
7796a4c786fSespie
780c074d1c9Sdrahn #if YYLSP_NEEDED
781c074d1c9Sdrahn /* The location stack. */
782c074d1c9Sdrahn YYLTYPE yylsa[YYINITDEPTH];
7836a4c786fSespie YYLTYPE *yyls = yylsa;
7846a4c786fSespie YYLTYPE *yylsp;
785c074d1c9Sdrahn #endif
7866a4c786fSespie
787c074d1c9Sdrahn #if YYLSP_NEEDED
7886a4c786fSespie # define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
7896a4c786fSespie #else
7906a4c786fSespie # define YYPOPSTACK (yyvsp--, yyssp--)
7916a4c786fSespie #endif
7926a4c786fSespie
793c074d1c9Sdrahn YYSIZE_T yystacksize = YYINITDEPTH;
7946a4c786fSespie
795c074d1c9Sdrahn
796c074d1c9Sdrahn /* The variables used to return semantic value and location from the
797c074d1c9Sdrahn action routines. */
798c074d1c9Sdrahn YYSTYPE yyval;
799c074d1c9Sdrahn #if YYLSP_NEEDED
800c074d1c9Sdrahn YYLTYPE yyloc;
8016a4c786fSespie #endif
8026a4c786fSespie
803c074d1c9Sdrahn /* When reducing, the number of symbols on the RHS of the reduced
804c074d1c9Sdrahn rule. */
8056a4c786fSespie int yylen;
8066a4c786fSespie
807c074d1c9Sdrahn YYDPRINTF ((stderr, "Starting parse\n"));
8086a4c786fSespie
8096a4c786fSespie yystate = 0;
8106a4c786fSespie yyerrstatus = 0;
8116a4c786fSespie yynerrs = 0;
8126a4c786fSespie yychar = YYEMPTY; /* Cause a token to be read. */
8136a4c786fSespie
8146a4c786fSespie /* Initialize stack pointers.
8156a4c786fSespie Waste one element of value and location stack
8166a4c786fSespie so that they stay on the same level as the state stack.
8176a4c786fSespie The wasted elements are never initialized. */
8186a4c786fSespie
819c074d1c9Sdrahn yyssp = yyss;
8206a4c786fSespie yyvsp = yyvs;
821c074d1c9Sdrahn #if YYLSP_NEEDED
8226a4c786fSespie yylsp = yyls;
8236a4c786fSespie #endif
824c074d1c9Sdrahn goto yysetstate;
8256a4c786fSespie
826c074d1c9Sdrahn /*------------------------------------------------------------.
827c074d1c9Sdrahn | yynewstate -- Push a new state, which is found in yystate. |
828c074d1c9Sdrahn `------------------------------------------------------------*/
8296a4c786fSespie yynewstate:
830c074d1c9Sdrahn /* In all cases, when you get here, the value and location stacks
831c074d1c9Sdrahn have just been pushed. so pushing a state here evens the stacks.
832c074d1c9Sdrahn */
833c074d1c9Sdrahn yyssp++;
8346a4c786fSespie
835c074d1c9Sdrahn yysetstate:
836c074d1c9Sdrahn *yyssp = yystate;
8376a4c786fSespie
8386a4c786fSespie if (yyssp >= yyss + yystacksize - 1)
8396a4c786fSespie {
8406a4c786fSespie /* Get the current used size of the three stacks, in elements. */
841c074d1c9Sdrahn YYSIZE_T yysize = yyssp - yyss + 1;
8426a4c786fSespie
8436a4c786fSespie #ifdef yyoverflow
844c074d1c9Sdrahn {
845c074d1c9Sdrahn /* Give user a chance to reallocate the stack. Use copies of
846c074d1c9Sdrahn these so that the &'s don't force the real ones into
847c074d1c9Sdrahn memory. */
848c074d1c9Sdrahn YYSTYPE *yyvs1 = yyvs;
849c074d1c9Sdrahn short *yyss1 = yyss;
850c074d1c9Sdrahn
851c074d1c9Sdrahn /* Each stack pointer address is followed by the size of the
852c074d1c9Sdrahn data in use in that stack, in bytes. */
853c074d1c9Sdrahn # if YYLSP_NEEDED
854c074d1c9Sdrahn YYLTYPE *yyls1 = yyls;
8556a4c786fSespie /* This used to be a conditional around just the two extra args,
8566a4c786fSespie but that might be undefined if yyoverflow is a macro. */
8576a4c786fSespie yyoverflow ("parser stack overflow",
858c074d1c9Sdrahn &yyss1, yysize * sizeof (*yyssp),
859c074d1c9Sdrahn &yyvs1, yysize * sizeof (*yyvsp),
860c074d1c9Sdrahn &yyls1, yysize * sizeof (*yylsp),
8616a4c786fSespie &yystacksize);
862c074d1c9Sdrahn yyls = yyls1;
8636a4c786fSespie # else
8646a4c786fSespie yyoverflow ("parser stack overflow",
865c074d1c9Sdrahn &yyss1, yysize * sizeof (*yyssp),
866c074d1c9Sdrahn &yyvs1, yysize * sizeof (*yyvsp),
8676a4c786fSespie &yystacksize);
8686a4c786fSespie # endif
869c074d1c9Sdrahn yyss = yyss1;
870c074d1c9Sdrahn yyvs = yyvs1;
871c074d1c9Sdrahn }
8726a4c786fSespie #else /* no yyoverflow */
873c074d1c9Sdrahn # ifndef YYSTACK_RELOCATE
874c074d1c9Sdrahn goto yyoverflowlab;
875c074d1c9Sdrahn # else
8766a4c786fSespie /* Extend the stack our own way. */
8776a4c786fSespie if (yystacksize >= YYMAXDEPTH)
878c074d1c9Sdrahn goto yyoverflowlab;
8796a4c786fSespie yystacksize *= 2;
8806a4c786fSespie if (yystacksize > YYMAXDEPTH)
8816a4c786fSespie yystacksize = YYMAXDEPTH;
882c074d1c9Sdrahn
883c074d1c9Sdrahn {
884c074d1c9Sdrahn short *yyss1 = yyss;
885c074d1c9Sdrahn union yyalloc *yyptr =
886c074d1c9Sdrahn (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
887c074d1c9Sdrahn if (! yyptr)
888c074d1c9Sdrahn goto yyoverflowlab;
889c074d1c9Sdrahn YYSTACK_RELOCATE (yyss);
890c074d1c9Sdrahn YYSTACK_RELOCATE (yyvs);
891c074d1c9Sdrahn # if YYLSP_NEEDED
892c074d1c9Sdrahn YYSTACK_RELOCATE (yyls);
8936a4c786fSespie # endif
894c074d1c9Sdrahn # undef YYSTACK_RELOCATE
895c074d1c9Sdrahn if (yyss1 != yyssa)
896c074d1c9Sdrahn YYSTACK_FREE (yyss1);
897c074d1c9Sdrahn }
8986a4c786fSespie # endif
8996a4c786fSespie #endif /* no yyoverflow */
9006a4c786fSespie
901c074d1c9Sdrahn yyssp = yyss + yysize - 1;
902c074d1c9Sdrahn yyvsp = yyvs + yysize - 1;
903c074d1c9Sdrahn #if YYLSP_NEEDED
904c074d1c9Sdrahn yylsp = yyls + yysize - 1;
9056a4c786fSespie #endif
9066a4c786fSespie
907c074d1c9Sdrahn YYDPRINTF ((stderr, "Stack size increased to %lu\n",
908c074d1c9Sdrahn (unsigned long int) yystacksize));
9096a4c786fSespie
9106a4c786fSespie if (yyssp >= yyss + yystacksize - 1)
9116a4c786fSespie YYABORT;
9126a4c786fSespie }
9136a4c786fSespie
914c074d1c9Sdrahn YYDPRINTF ((stderr, "Entering state %d\n", yystate));
9156a4c786fSespie
9166a4c786fSespie goto yybackup;
917c074d1c9Sdrahn
918c074d1c9Sdrahn
919c074d1c9Sdrahn /*-----------.
920c074d1c9Sdrahn | yybackup. |
921c074d1c9Sdrahn `-----------*/
9226a4c786fSespie yybackup:
9236a4c786fSespie
9246a4c786fSespie /* Do appropriate processing given the current state. */
9256a4c786fSespie /* Read a lookahead token if we need one and don't already have one. */
9266a4c786fSespie /* yyresume: */
9276a4c786fSespie
9286a4c786fSespie /* First try to decide what to do without reference to lookahead token. */
9296a4c786fSespie
9306a4c786fSespie yyn = yypact[yystate];
9316a4c786fSespie if (yyn == YYFLAG)
9326a4c786fSespie goto yydefault;
9336a4c786fSespie
9346a4c786fSespie /* Not known => get a lookahead token if don't already have one. */
9356a4c786fSespie
9366a4c786fSespie /* yychar is either YYEMPTY or YYEOF
9376a4c786fSespie or a valid token in external form. */
9386a4c786fSespie
9396a4c786fSespie if (yychar == YYEMPTY)
9406a4c786fSespie {
941c074d1c9Sdrahn YYDPRINTF ((stderr, "Reading a token: "));
9426a4c786fSespie yychar = YYLEX;
9436a4c786fSespie }
9446a4c786fSespie
9456a4c786fSespie /* Convert token to internal form (in yychar1) for indexing tables with */
9466a4c786fSespie
9476a4c786fSespie if (yychar <= 0) /* This means end of input. */
9486a4c786fSespie {
9496a4c786fSespie yychar1 = 0;
9506a4c786fSespie yychar = YYEOF; /* Don't call YYLEX any more */
9516a4c786fSespie
952c074d1c9Sdrahn YYDPRINTF ((stderr, "Now at end of input.\n"));
9536a4c786fSespie }
9546a4c786fSespie else
9556a4c786fSespie {
9566a4c786fSespie yychar1 = YYTRANSLATE (yychar);
9576a4c786fSespie
958c074d1c9Sdrahn #if YYDEBUG
959c074d1c9Sdrahn /* We have to keep this `#if YYDEBUG', since we use variables
960c074d1c9Sdrahn which are defined only if `YYDEBUG' is set. */
9616a4c786fSespie if (yydebug)
9626a4c786fSespie {
963c074d1c9Sdrahn YYFPRINTF (stderr, "Next token is %d (%s",
964c074d1c9Sdrahn yychar, yytname[yychar1]);
965c074d1c9Sdrahn /* Give the individual parser a way to print the precise
966c074d1c9Sdrahn meaning of a token, for further debugging info. */
9676a4c786fSespie # ifdef YYPRINT
9686a4c786fSespie YYPRINT (stderr, yychar, yylval);
9696a4c786fSespie # endif
970c074d1c9Sdrahn YYFPRINTF (stderr, ")\n");
9716a4c786fSespie }
9726a4c786fSespie #endif
9736a4c786fSespie }
9746a4c786fSespie
9756a4c786fSespie yyn += yychar1;
9766a4c786fSespie if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
9776a4c786fSespie goto yydefault;
9786a4c786fSespie
9796a4c786fSespie yyn = yytable[yyn];
9806a4c786fSespie
9816a4c786fSespie /* yyn is what to do for this token type in this state.
9826a4c786fSespie Negative => reduce, -yyn is rule number.
9836a4c786fSespie Positive => shift, yyn is new state.
9846a4c786fSespie New state is final state => don't bother to shift,
9856a4c786fSespie just return success.
9866a4c786fSespie 0, or most negative number => error. */
9876a4c786fSespie
9886a4c786fSespie if (yyn < 0)
9896a4c786fSespie {
9906a4c786fSespie if (yyn == YYFLAG)
9916a4c786fSespie goto yyerrlab;
9926a4c786fSespie yyn = -yyn;
9936a4c786fSespie goto yyreduce;
9946a4c786fSespie }
9956a4c786fSespie else if (yyn == 0)
9966a4c786fSespie goto yyerrlab;
9976a4c786fSespie
9986a4c786fSespie if (yyn == YYFINAL)
9996a4c786fSespie YYACCEPT;
10006a4c786fSespie
10016a4c786fSespie /* Shift the lookahead token. */
1002c074d1c9Sdrahn YYDPRINTF ((stderr, "Shifting token %d (%s), ",
1003c074d1c9Sdrahn yychar, yytname[yychar1]));
10046a4c786fSespie
10056a4c786fSespie /* Discard the token being shifted unless it is eof. */
10066a4c786fSespie if (yychar != YYEOF)
10076a4c786fSespie yychar = YYEMPTY;
10086a4c786fSespie
10096a4c786fSespie *++yyvsp = yylval;
1010c074d1c9Sdrahn #if YYLSP_NEEDED
10116a4c786fSespie *++yylsp = yylloc;
10126a4c786fSespie #endif
10136a4c786fSespie
1014c074d1c9Sdrahn /* Count tokens shifted since error; after three, turn off error
1015c074d1c9Sdrahn status. */
1016c074d1c9Sdrahn if (yyerrstatus)
1017c074d1c9Sdrahn yyerrstatus--;
10186a4c786fSespie
10196a4c786fSespie yystate = yyn;
10206a4c786fSespie goto yynewstate;
10216a4c786fSespie
10226a4c786fSespie
1023c074d1c9Sdrahn /*-----------------------------------------------------------.
1024c074d1c9Sdrahn | yydefault -- do the default action for the current state. |
1025c074d1c9Sdrahn `-----------------------------------------------------------*/
1026c074d1c9Sdrahn yydefault:
10276a4c786fSespie yyn = yydefact[yystate];
10286a4c786fSespie if (yyn == 0)
10296a4c786fSespie goto yyerrlab;
1030c074d1c9Sdrahn goto yyreduce;
10316a4c786fSespie
1032c074d1c9Sdrahn
1033c074d1c9Sdrahn /*-----------------------------.
1034c074d1c9Sdrahn | yyreduce -- Do a reduction. |
1035c074d1c9Sdrahn `-----------------------------*/
10366a4c786fSespie yyreduce:
1037c074d1c9Sdrahn /* yyn is the number of a rule to reduce with. */
10386a4c786fSespie yylen = yyr2[yyn];
10396a4c786fSespie
1040c074d1c9Sdrahn /* If YYLEN is nonzero, implement the default value of the action:
1041c074d1c9Sdrahn `$$ = $1'.
1042c074d1c9Sdrahn
1043c074d1c9Sdrahn Otherwise, the following line sets YYVAL to the semantic value of
1044c074d1c9Sdrahn the lookahead token. This behavior is undocumented and Bison
1045c074d1c9Sdrahn users should not rely upon it. Assigning to YYVAL
1046c074d1c9Sdrahn unconditionally makes the parser a bit smaller, and it avoids a
1047c074d1c9Sdrahn GCC warning that YYVAL may be used uninitialized. */
1048c074d1c9Sdrahn yyval = yyvsp[1-yylen];
1049c074d1c9Sdrahn
1050c074d1c9Sdrahn #if YYLSP_NEEDED
1051c074d1c9Sdrahn /* Similarly for the default location. Let the user run additional
1052c074d1c9Sdrahn commands if for instance locations are ranges. */
1053c074d1c9Sdrahn yyloc = yylsp[1-yylen];
1054c074d1c9Sdrahn YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
1055c074d1c9Sdrahn #endif
1056c074d1c9Sdrahn
1057c074d1c9Sdrahn #if YYDEBUG
1058c074d1c9Sdrahn /* We have to keep this `#if YYDEBUG', since we use variables which
1059c074d1c9Sdrahn are defined only if `YYDEBUG' is set. */
10606a4c786fSespie if (yydebug)
10616a4c786fSespie {
1062c074d1c9Sdrahn int yyi;
10636a4c786fSespie
1064c074d1c9Sdrahn YYFPRINTF (stderr, "Reducing via rule %d (line %d), ",
10656a4c786fSespie yyn, yyrline[yyn]);
10666a4c786fSespie
10676a4c786fSespie /* Print the symbols being reduced, and their result. */
1068c074d1c9Sdrahn for (yyi = yyprhs[yyn]; yyrhs[yyi] > 0; yyi++)
1069c074d1c9Sdrahn YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]);
1070c074d1c9Sdrahn YYFPRINTF (stderr, " -> %s\n", yytname[yyr1[yyn]]);
10716a4c786fSespie }
10726a4c786fSespie #endif
10736a4c786fSespie
10746a4c786fSespie switch (yyn) {
10756a4c786fSespie
10766a4c786fSespie case 4:
1077c074d1c9Sdrahn #line 127 "m68k-parse.y"
10786a4c786fSespie {
10796a4c786fSespie op->mode = DREG;
10806a4c786fSespie op->reg = yyvsp[0].reg;
1081c074d1c9Sdrahn }
1082c074d1c9Sdrahn break;
10836a4c786fSespie case 5:
1084c074d1c9Sdrahn #line 132 "m68k-parse.y"
10856a4c786fSespie {
10866a4c786fSespie op->mode = AREG;
10876a4c786fSespie op->reg = yyvsp[0].reg;
1088c074d1c9Sdrahn }
1089c074d1c9Sdrahn break;
10906a4c786fSespie case 6:
1091c074d1c9Sdrahn #line 137 "m68k-parse.y"
10926a4c786fSespie {
10936a4c786fSespie op->mode = FPREG;
10946a4c786fSespie op->reg = yyvsp[0].reg;
1095c074d1c9Sdrahn }
1096c074d1c9Sdrahn break;
10976a4c786fSespie case 7:
1098c074d1c9Sdrahn #line 142 "m68k-parse.y"
10996a4c786fSespie {
11006a4c786fSespie op->mode = CONTROL;
11016a4c786fSespie op->reg = yyvsp[0].reg;
1102c074d1c9Sdrahn }
1103c074d1c9Sdrahn break;
11046a4c786fSespie case 8:
1105c074d1c9Sdrahn #line 147 "m68k-parse.y"
11066a4c786fSespie {
11076a4c786fSespie op->mode = CONTROL;
11086a4c786fSespie op->reg = yyvsp[0].reg;
1109c074d1c9Sdrahn }
1110c074d1c9Sdrahn break;
11116a4c786fSespie case 9:
1112c074d1c9Sdrahn #line 152 "m68k-parse.y"
11136a4c786fSespie {
11146a4c786fSespie op->mode = ABSL;
11156a4c786fSespie op->disp = yyvsp[0].exp;
1116c074d1c9Sdrahn }
1117c074d1c9Sdrahn break;
11186a4c786fSespie case 10:
1119c074d1c9Sdrahn #line 157 "m68k-parse.y"
11206a4c786fSespie {
11216a4c786fSespie op->mode = IMMED;
11226a4c786fSespie op->disp = yyvsp[0].exp;
1123c074d1c9Sdrahn }
1124c074d1c9Sdrahn break;
11256a4c786fSespie case 11:
1126c074d1c9Sdrahn #line 162 "m68k-parse.y"
11276a4c786fSespie {
11286a4c786fSespie op->mode = IMMED;
11296a4c786fSespie op->disp = yyvsp[0].exp;
1130c074d1c9Sdrahn }
1131c074d1c9Sdrahn break;
11326a4c786fSespie case 12:
1133c074d1c9Sdrahn #line 167 "m68k-parse.y"
11346a4c786fSespie {
11356a4c786fSespie op->mode = REGLST;
11366a4c786fSespie op->mask = yyvsp[0].mask;
1137c074d1c9Sdrahn }
1138c074d1c9Sdrahn break;
11396a4c786fSespie case 13:
1140c074d1c9Sdrahn #line 180 "m68k-parse.y"
11416a4c786fSespie {
11426a4c786fSespie op->mode = AINDR;
11436a4c786fSespie op->reg = yyvsp[-1].reg;
1144c074d1c9Sdrahn }
1145c074d1c9Sdrahn break;
11466a4c786fSespie case 14:
1147c074d1c9Sdrahn #line 185 "m68k-parse.y"
11486a4c786fSespie {
11496a4c786fSespie op->mode = AINC;
11506a4c786fSespie op->reg = yyvsp[-2].reg;
1151c074d1c9Sdrahn }
1152c074d1c9Sdrahn break;
11536a4c786fSespie case 15:
1154c074d1c9Sdrahn #line 190 "m68k-parse.y"
11556a4c786fSespie {
11566a4c786fSespie op->mode = ADEC;
11576a4c786fSespie op->reg = yyvsp[-1].reg;
1158c074d1c9Sdrahn }
1159c074d1c9Sdrahn break;
11606a4c786fSespie case 16:
1161c074d1c9Sdrahn #line 195 "m68k-parse.y"
11626a4c786fSespie {
11636a4c786fSespie op->reg = yyvsp[-1].reg;
11646a4c786fSespie op->disp = yyvsp[-3].exp;
11656a4c786fSespie if ((yyvsp[-1].reg >= ZADDR0 && yyvsp[-1].reg <= ZADDR7)
11666a4c786fSespie || yyvsp[-1].reg == ZPC)
11676a4c786fSespie op->mode = BASE;
11686a4c786fSespie else
11696a4c786fSespie op->mode = DISP;
1170c074d1c9Sdrahn }
1171c074d1c9Sdrahn break;
11726a4c786fSespie case 17:
1173c074d1c9Sdrahn #line 205 "m68k-parse.y"
11746a4c786fSespie {
11756a4c786fSespie op->reg = yyvsp[-3].reg;
11766a4c786fSespie op->disp = yyvsp[-1].exp;
11776a4c786fSespie if ((yyvsp[-3].reg >= ZADDR0 && yyvsp[-3].reg <= ZADDR7)
11786a4c786fSespie || yyvsp[-3].reg == ZPC)
11796a4c786fSespie op->mode = BASE;
11806a4c786fSespie else
11816a4c786fSespie op->mode = DISP;
1182c074d1c9Sdrahn }
1183c074d1c9Sdrahn break;
11846a4c786fSespie case 18:
1185c074d1c9Sdrahn #line 215 "m68k-parse.y"
11866a4c786fSespie {
11876a4c786fSespie op->reg = yyvsp[-1].reg;
11886a4c786fSespie op->disp = yyvsp[-3].exp;
11896a4c786fSespie if ((yyvsp[-1].reg >= ZADDR0 && yyvsp[-1].reg <= ZADDR7)
11906a4c786fSespie || yyvsp[-1].reg == ZPC)
11916a4c786fSespie op->mode = BASE;
11926a4c786fSespie else
11936a4c786fSespie op->mode = DISP;
1194c074d1c9Sdrahn }
1195c074d1c9Sdrahn break;
11966a4c786fSespie case 19:
1197c074d1c9Sdrahn #line 225 "m68k-parse.y"
11986a4c786fSespie {
11996a4c786fSespie op->mode = DISP;
12006a4c786fSespie op->reg = yyvsp[-1].reg;
1201c074d1c9Sdrahn }
1202c074d1c9Sdrahn break;
12036a4c786fSespie case 20:
1204c074d1c9Sdrahn #line 230 "m68k-parse.y"
12056a4c786fSespie {
12066a4c786fSespie op->mode = BASE;
12076a4c786fSespie op->reg = yyvsp[-1].reg;
1208c074d1c9Sdrahn }
1209c074d1c9Sdrahn break;
12106a4c786fSespie case 21:
1211c074d1c9Sdrahn #line 235 "m68k-parse.y"
12126a4c786fSespie {
12136a4c786fSespie op->mode = BASE;
12146a4c786fSespie op->reg = yyvsp[-1].reg;
1215c074d1c9Sdrahn }
1216c074d1c9Sdrahn break;
12176a4c786fSespie case 22:
1218c074d1c9Sdrahn #line 240 "m68k-parse.y"
12196a4c786fSespie {
12206a4c786fSespie op->mode = BASE;
12216a4c786fSespie op->reg = yyvsp[-3].reg;
12226a4c786fSespie op->disp = yyvsp[-5].exp;
12236a4c786fSespie op->index = yyvsp[-1].indexreg;
1224c074d1c9Sdrahn }
1225c074d1c9Sdrahn break;
12266a4c786fSespie case 23:
1227c074d1c9Sdrahn #line 247 "m68k-parse.y"
12286a4c786fSespie {
12296a4c786fSespie if (yyvsp[-3].reg == PC || yyvsp[-3].reg == ZPC)
12306a4c786fSespie yyerror (_("syntax error"));
12316a4c786fSespie op->mode = BASE;
12326a4c786fSespie op->reg = yyvsp[-1].reg;
12336a4c786fSespie op->disp = yyvsp[-5].exp;
12346a4c786fSespie op->index.reg = yyvsp[-3].reg;
12356a4c786fSespie op->index.size = SIZE_UNSPEC;
12366a4c786fSespie op->index.scale = 1;
1237c074d1c9Sdrahn }
1238c074d1c9Sdrahn break;
12396a4c786fSespie case 24:
1240c074d1c9Sdrahn #line 258 "m68k-parse.y"
12416a4c786fSespie {
12426a4c786fSespie op->mode = BASE;
12436a4c786fSespie op->reg = yyvsp[-1].reg;
12446a4c786fSespie op->disp = yyvsp[-4].exp;
12456a4c786fSespie op->index = yyvsp[-2].indexreg;
1246c074d1c9Sdrahn }
1247c074d1c9Sdrahn break;
12486a4c786fSespie case 25:
1249c074d1c9Sdrahn #line 265 "m68k-parse.y"
12506a4c786fSespie {
12516a4c786fSespie op->mode = BASE;
12526a4c786fSespie op->disp = yyvsp[-1].exp;
12536a4c786fSespie op->index = yyvsp[-3].indexreg;
1254c074d1c9Sdrahn }
1255c074d1c9Sdrahn break;
12566a4c786fSespie case 26:
1257c074d1c9Sdrahn #line 271 "m68k-parse.y"
12586a4c786fSespie {
12596a4c786fSespie op->mode = BASE;
12606a4c786fSespie op->reg = yyvsp[-3].reg;
12616a4c786fSespie op->disp = yyvsp[-5].exp;
12626a4c786fSespie op->index = yyvsp[-1].indexreg;
1263c074d1c9Sdrahn }
1264c074d1c9Sdrahn break;
12656a4c786fSespie case 27:
1266c074d1c9Sdrahn #line 278 "m68k-parse.y"
12676a4c786fSespie {
12686a4c786fSespie op->mode = BASE;
12696a4c786fSespie op->reg = yyvsp[-3].reg;
12706a4c786fSespie op->index = yyvsp[-1].indexreg;
1271c074d1c9Sdrahn }
1272c074d1c9Sdrahn break;
12736a4c786fSespie case 28:
1274c074d1c9Sdrahn #line 284 "m68k-parse.y"
12756a4c786fSespie {
12766a4c786fSespie if (yyvsp[-3].reg == PC || yyvsp[-3].reg == ZPC)
12776a4c786fSespie yyerror (_("syntax error"));
12786a4c786fSespie op->mode = BASE;
12796a4c786fSespie op->reg = yyvsp[-1].reg;
12806a4c786fSespie op->disp = yyvsp[-5].exp;
12816a4c786fSespie op->index.reg = yyvsp[-3].reg;
12826a4c786fSespie op->index.size = SIZE_UNSPEC;
12836a4c786fSespie op->index.scale = 1;
1284c074d1c9Sdrahn }
1285c074d1c9Sdrahn break;
12866a4c786fSespie case 29:
1287c074d1c9Sdrahn #line 295 "m68k-parse.y"
12886a4c786fSespie {
12896a4c786fSespie if (yyvsp[-3].reg == PC || yyvsp[-3].reg == ZPC)
12906a4c786fSespie yyerror (_("syntax error"));
12916a4c786fSespie op->mode = BASE;
12926a4c786fSespie op->reg = yyvsp[-1].reg;
12936a4c786fSespie op->index.reg = yyvsp[-3].reg;
12946a4c786fSespie op->index.size = SIZE_UNSPEC;
12956a4c786fSespie op->index.scale = 1;
1296c074d1c9Sdrahn }
1297c074d1c9Sdrahn break;
12986a4c786fSespie case 30:
1299c074d1c9Sdrahn #line 305 "m68k-parse.y"
13006a4c786fSespie {
13016a4c786fSespie op->mode = BASE;
13026a4c786fSespie op->reg = yyvsp[-1].reg;
13036a4c786fSespie op->disp = yyvsp[-4].exp;
13046a4c786fSespie op->index = yyvsp[-2].indexreg;
1305c074d1c9Sdrahn }
1306c074d1c9Sdrahn break;
13076a4c786fSespie case 31:
1308c074d1c9Sdrahn #line 312 "m68k-parse.y"
13096a4c786fSespie {
13106a4c786fSespie op->mode = BASE;
13116a4c786fSespie op->reg = yyvsp[-1].reg;
13126a4c786fSespie op->index = yyvsp[-2].indexreg;
1313c074d1c9Sdrahn }
1314c074d1c9Sdrahn break;
13156a4c786fSespie case 32:
1316c074d1c9Sdrahn #line 318 "m68k-parse.y"
13176a4c786fSespie {
13186a4c786fSespie op->mode = POST;
13196a4c786fSespie op->reg = yyvsp[-5].reg;
13206a4c786fSespie op->disp = yyvsp[-6].exp;
13216a4c786fSespie op->index = yyvsp[-2].indexreg;
13226a4c786fSespie op->odisp = yyvsp[-1].exp;
1323c074d1c9Sdrahn }
1324c074d1c9Sdrahn break;
13256a4c786fSespie case 33:
1326c074d1c9Sdrahn #line 326 "m68k-parse.y"
13276a4c786fSespie {
13286a4c786fSespie op->mode = POST;
13296a4c786fSespie op->reg = yyvsp[-3].reg;
13306a4c786fSespie op->disp = yyvsp[-4].exp;
13316a4c786fSespie op->odisp = yyvsp[-1].exp;
1332c074d1c9Sdrahn }
1333c074d1c9Sdrahn break;
13346a4c786fSespie case 34:
1335c074d1c9Sdrahn #line 333 "m68k-parse.y"
13366a4c786fSespie {
13376a4c786fSespie op->mode = POST;
13386a4c786fSespie op->reg = yyvsp[-5].reg;
13396a4c786fSespie op->index = yyvsp[-2].indexreg;
13406a4c786fSespie op->odisp = yyvsp[-1].exp;
1341c074d1c9Sdrahn }
1342c074d1c9Sdrahn break;
13436a4c786fSespie case 35:
1344c074d1c9Sdrahn #line 340 "m68k-parse.y"
13456a4c786fSespie {
13466a4c786fSespie op->mode = POST;
13476a4c786fSespie op->reg = yyvsp[-3].reg;
13486a4c786fSespie op->odisp = yyvsp[-1].exp;
1349c074d1c9Sdrahn }
1350c074d1c9Sdrahn break;
13516a4c786fSespie case 36:
1352c074d1c9Sdrahn #line 346 "m68k-parse.y"
13536a4c786fSespie {
13546a4c786fSespie op->mode = PRE;
13556a4c786fSespie op->reg = yyvsp[-5].reg;
13566a4c786fSespie op->disp = yyvsp[-7].exp;
13576a4c786fSespie op->index = yyvsp[-3].indexreg;
13586a4c786fSespie op->odisp = yyvsp[-1].exp;
1359c074d1c9Sdrahn }
1360c074d1c9Sdrahn break;
13616a4c786fSespie case 37:
1362c074d1c9Sdrahn #line 354 "m68k-parse.y"
13636a4c786fSespie {
13646a4c786fSespie op->mode = PRE;
13656a4c786fSespie op->reg = yyvsp[-5].reg;
13666a4c786fSespie op->index = yyvsp[-3].indexreg;
13676a4c786fSespie op->odisp = yyvsp[-1].exp;
1368c074d1c9Sdrahn }
1369c074d1c9Sdrahn break;
13706a4c786fSespie case 38:
1371c074d1c9Sdrahn #line 361 "m68k-parse.y"
13726a4c786fSespie {
13736a4c786fSespie if (yyvsp[-5].reg == PC || yyvsp[-5].reg == ZPC)
13746a4c786fSespie yyerror (_("syntax error"));
13756a4c786fSespie op->mode = PRE;
13766a4c786fSespie op->reg = yyvsp[-3].reg;
13776a4c786fSespie op->disp = yyvsp[-7].exp;
13786a4c786fSespie op->index.reg = yyvsp[-5].reg;
13796a4c786fSespie op->index.size = SIZE_UNSPEC;
13806a4c786fSespie op->index.scale = 1;
13816a4c786fSespie op->odisp = yyvsp[-1].exp;
1382c074d1c9Sdrahn }
1383c074d1c9Sdrahn break;
13846a4c786fSespie case 39:
1385c074d1c9Sdrahn #line 373 "m68k-parse.y"
13866a4c786fSespie {
13876a4c786fSespie if (yyvsp[-5].reg == PC || yyvsp[-5].reg == ZPC)
13886a4c786fSespie yyerror (_("syntax error"));
13896a4c786fSespie op->mode = PRE;
13906a4c786fSespie op->reg = yyvsp[-3].reg;
13916a4c786fSespie op->index.reg = yyvsp[-5].reg;
13926a4c786fSespie op->index.size = SIZE_UNSPEC;
13936a4c786fSespie op->index.scale = 1;
13946a4c786fSespie op->odisp = yyvsp[-1].exp;
1395c074d1c9Sdrahn }
1396c074d1c9Sdrahn break;
13976a4c786fSespie case 40:
1398c074d1c9Sdrahn #line 384 "m68k-parse.y"
13996a4c786fSespie {
14006a4c786fSespie op->mode = PRE;
14016a4c786fSespie op->reg = yyvsp[-3].reg;
14026a4c786fSespie op->disp = yyvsp[-5].exp;
14036a4c786fSespie op->index = yyvsp[-4].indexreg;
14046a4c786fSespie op->odisp = yyvsp[-1].exp;
1405c074d1c9Sdrahn }
1406c074d1c9Sdrahn break;
14076a4c786fSespie case 41:
1408c074d1c9Sdrahn #line 397 "m68k-parse.y"
14096a4c786fSespie {
14106a4c786fSespie /* We use optzapc to avoid a shift/reduce conflict. */
14116a4c786fSespie if (yyvsp[-1].reg < ADDR0 || yyvsp[-1].reg > ADDR7)
14126a4c786fSespie yyerror (_("syntax error"));
14136a4c786fSespie op->mode = AINDR;
14146a4c786fSespie op->reg = yyvsp[-1].reg;
1415c074d1c9Sdrahn }
1416c074d1c9Sdrahn break;
14176a4c786fSespie case 42:
1418c074d1c9Sdrahn #line 405 "m68k-parse.y"
14196a4c786fSespie {
14206a4c786fSespie /* We use optzapc to avoid a shift/reduce conflict. */
14216a4c786fSespie if (yyvsp[-2].reg < ADDR0 || yyvsp[-2].reg > ADDR7)
14226a4c786fSespie yyerror (_("syntax error"));
14236a4c786fSespie op->mode = AINC;
14246a4c786fSespie op->reg = yyvsp[-2].reg;
1425c074d1c9Sdrahn }
1426c074d1c9Sdrahn break;
14276a4c786fSespie case 43:
1428c074d1c9Sdrahn #line 413 "m68k-parse.y"
14296a4c786fSespie {
14306a4c786fSespie /* We use optzapc to avoid a shift/reduce conflict. */
14316a4c786fSespie if (yyvsp[-2].reg < ADDR0 || yyvsp[-2].reg > ADDR7)
14326a4c786fSespie yyerror (_("syntax error"));
14336a4c786fSespie op->mode = ADEC;
14346a4c786fSespie op->reg = yyvsp[-2].reg;
1435c074d1c9Sdrahn }
1436c074d1c9Sdrahn break;
14376a4c786fSespie case 44:
1438c074d1c9Sdrahn #line 421 "m68k-parse.y"
14396a4c786fSespie {
14406a4c786fSespie op->reg = yyvsp[-4].reg;
14416a4c786fSespie op->disp = yyvsp[-1].exp;
14426a4c786fSespie if ((yyvsp[-4].reg >= ZADDR0 && yyvsp[-4].reg <= ZADDR7)
14436a4c786fSespie || yyvsp[-4].reg == ZPC)
14446a4c786fSespie op->mode = BASE;
14456a4c786fSespie else
14466a4c786fSespie op->mode = DISP;
1447c074d1c9Sdrahn }
1448c074d1c9Sdrahn break;
14496a4c786fSespie case 45:
1450c074d1c9Sdrahn #line 431 "m68k-parse.y"
14516a4c786fSespie {
14526a4c786fSespie op->mode = BASE;
14536a4c786fSespie op->reg = yyvsp[-5].reg;
14546a4c786fSespie op->disp = yyvsp[-2].exp;
14556a4c786fSespie op->index = yyvsp[-1].indexreg;
1456c074d1c9Sdrahn }
1457c074d1c9Sdrahn break;
14586a4c786fSespie case 46:
1459c074d1c9Sdrahn #line 438 "m68k-parse.y"
14606a4c786fSespie {
14616a4c786fSespie op->mode = POST;
14626a4c786fSespie op->reg = yyvsp[-9].reg;
14636a4c786fSespie op->disp = yyvsp[-6].exp;
14646a4c786fSespie op->index = yyvsp[-1].indexreg;
14656a4c786fSespie op->odisp = yyvsp[-2].exp;
1466c074d1c9Sdrahn }
1467c074d1c9Sdrahn break;
14686a4c786fSespie case 47:
1469c074d1c9Sdrahn #line 446 "m68k-parse.y"
14706a4c786fSespie {
14716a4c786fSespie op->mode = POST;
14726a4c786fSespie op->reg = yyvsp[-8].reg;
14736a4c786fSespie op->disp = yyvsp[-5].exp;
14746a4c786fSespie op->odisp = yyvsp[-1].exp;
1475c074d1c9Sdrahn }
1476c074d1c9Sdrahn break;
14776a4c786fSespie case 48:
1478c074d1c9Sdrahn #line 453 "m68k-parse.y"
14796a4c786fSespie {
14806a4c786fSespie op->mode = PRE;
14816a4c786fSespie op->reg = yyvsp[-9].reg;
14826a4c786fSespie op->disp = yyvsp[-6].exp;
14836a4c786fSespie op->index = yyvsp[-5].indexreg;
14846a4c786fSespie op->odisp = yyvsp[-1].exp;
1485c074d1c9Sdrahn }
1486c074d1c9Sdrahn break;
14876a4c786fSespie case 50:
1488c074d1c9Sdrahn #line 468 "m68k-parse.y"
14896a4c786fSespie {
14906a4c786fSespie yyval.indexreg.reg = yyvsp[0].reg;
14916a4c786fSespie yyval.indexreg.size = SIZE_UNSPEC;
14926a4c786fSespie yyval.indexreg.scale = 1;
1493c074d1c9Sdrahn }
1494c074d1c9Sdrahn break;
14956a4c786fSespie case 52:
1496c074d1c9Sdrahn #line 482 "m68k-parse.y"
14976a4c786fSespie {
14986a4c786fSespie yyval.indexreg.reg = yyvsp[0].reg;
14996a4c786fSespie yyval.indexreg.size = SIZE_UNSPEC;
15006a4c786fSespie yyval.indexreg.scale = 1;
1501c074d1c9Sdrahn }
1502c074d1c9Sdrahn break;
15036a4c786fSespie case 63:
1504c074d1c9Sdrahn #line 525 "m68k-parse.y"
15056a4c786fSespie {
15066a4c786fSespie yyval.reg = ZADDR0;
1507c074d1c9Sdrahn }
1508c074d1c9Sdrahn break;
15096a4c786fSespie case 67:
1510c074d1c9Sdrahn #line 542 "m68k-parse.y"
15116a4c786fSespie {
15126a4c786fSespie yyval.reg = ZADDR0;
1513c074d1c9Sdrahn }
1514c074d1c9Sdrahn break;
15156a4c786fSespie case 68:
1516c074d1c9Sdrahn #line 546 "m68k-parse.y"
15176a4c786fSespie {
15186a4c786fSespie yyval.reg = yyvsp[0].reg;
1519c074d1c9Sdrahn }
1520c074d1c9Sdrahn break;
15216a4c786fSespie case 69:
1522c074d1c9Sdrahn #line 555 "m68k-parse.y"
15236a4c786fSespie {
15246a4c786fSespie yyval.exp.exp.X_op = O_absent;
15256a4c786fSespie yyval.exp.size = SIZE_UNSPEC;
1526c074d1c9Sdrahn }
1527c074d1c9Sdrahn break;
15286a4c786fSespie case 70:
1529c074d1c9Sdrahn #line 560 "m68k-parse.y"
15306a4c786fSespie {
15316a4c786fSespie yyval.exp = yyvsp[0].exp;
1532c074d1c9Sdrahn }
1533c074d1c9Sdrahn break;
15346a4c786fSespie case 71:
1535c074d1c9Sdrahn #line 569 "m68k-parse.y"
15366a4c786fSespie {
15376a4c786fSespie yyval.exp.exp.X_op = O_absent;
15386a4c786fSespie yyval.exp.size = SIZE_UNSPEC;
1539c074d1c9Sdrahn }
1540c074d1c9Sdrahn break;
15416a4c786fSespie case 72:
1542c074d1c9Sdrahn #line 574 "m68k-parse.y"
15436a4c786fSespie {
15446a4c786fSespie yyval.exp = yyvsp[-1].exp;
1545c074d1c9Sdrahn }
1546c074d1c9Sdrahn break;
15476a4c786fSespie case 74:
1548c074d1c9Sdrahn #line 584 "m68k-parse.y"
15496a4c786fSespie {
15506a4c786fSespie yyval.mask = yyvsp[-2].mask | yyvsp[0].mask;
1551c074d1c9Sdrahn }
1552c074d1c9Sdrahn break;
15536a4c786fSespie case 75:
1554c074d1c9Sdrahn #line 588 "m68k-parse.y"
15556a4c786fSespie {
15566a4c786fSespie yyval.mask = (1 << yyvsp[-2].onereg) | yyvsp[0].mask;
1557c074d1c9Sdrahn }
1558c074d1c9Sdrahn break;
15596a4c786fSespie case 76:
1560c074d1c9Sdrahn #line 600 "m68k-parse.y"
15616a4c786fSespie {
15626a4c786fSespie yyval.mask = 1 << yyvsp[0].onereg;
1563c074d1c9Sdrahn }
1564c074d1c9Sdrahn break;
15656a4c786fSespie case 78:
1566c074d1c9Sdrahn #line 605 "m68k-parse.y"
15676a4c786fSespie {
15686a4c786fSespie yyval.mask = yyvsp[-2].mask | yyvsp[0].mask;
1569c074d1c9Sdrahn }
1570c074d1c9Sdrahn break;
15716a4c786fSespie case 79:
1572c074d1c9Sdrahn #line 609 "m68k-parse.y"
15736a4c786fSespie {
15746a4c786fSespie yyval.mask = (1 << yyvsp[-2].onereg) | yyvsp[0].mask;
1575c074d1c9Sdrahn }
1576c074d1c9Sdrahn break;
15776a4c786fSespie case 80:
1578c074d1c9Sdrahn #line 616 "m68k-parse.y"
15796a4c786fSespie {
15806a4c786fSespie if (yyvsp[-2].onereg <= yyvsp[0].onereg)
15816a4c786fSespie yyval.mask = (1 << (yyvsp[0].onereg + 1)) - 1 - ((1 << yyvsp[-2].onereg) - 1);
15826a4c786fSespie else
15836a4c786fSespie yyval.mask = (1 << (yyvsp[-2].onereg + 1)) - 1 - ((1 << yyvsp[0].onereg) - 1);
1584c074d1c9Sdrahn }
1585c074d1c9Sdrahn break;
15866a4c786fSespie case 81:
1587c074d1c9Sdrahn #line 626 "m68k-parse.y"
15886a4c786fSespie {
15896a4c786fSespie yyval.onereg = yyvsp[0].reg - DATA0;
1590c074d1c9Sdrahn }
1591c074d1c9Sdrahn break;
15926a4c786fSespie case 82:
1593c074d1c9Sdrahn #line 630 "m68k-parse.y"
15946a4c786fSespie {
15956a4c786fSespie yyval.onereg = yyvsp[0].reg - ADDR0 + 8;
1596c074d1c9Sdrahn }
1597c074d1c9Sdrahn break;
15986a4c786fSespie case 83:
1599c074d1c9Sdrahn #line 634 "m68k-parse.y"
16006a4c786fSespie {
16016a4c786fSespie yyval.onereg = yyvsp[0].reg - FP0 + 16;
1602c074d1c9Sdrahn }
1603c074d1c9Sdrahn break;
16046a4c786fSespie case 84:
1605c074d1c9Sdrahn #line 638 "m68k-parse.y"
16066a4c786fSespie {
16076a4c786fSespie if (yyvsp[0].reg == FPI)
16086a4c786fSespie yyval.onereg = 24;
16096a4c786fSespie else if (yyvsp[0].reg == FPS)
16106a4c786fSespie yyval.onereg = 25;
16116a4c786fSespie else
16126a4c786fSespie yyval.onereg = 26;
16136a4c786fSespie }
1614c074d1c9Sdrahn break;
1615c074d1c9Sdrahn }
1616c074d1c9Sdrahn
1617c074d1c9Sdrahn #line 705 "/usr/share/bison-1.35/bison.simple"
1618c074d1c9Sdrahn
16196a4c786fSespie
16206a4c786fSespie yyvsp -= yylen;
16216a4c786fSespie yyssp -= yylen;
1622c074d1c9Sdrahn #if YYLSP_NEEDED
16236a4c786fSespie yylsp -= yylen;
16246a4c786fSespie #endif
16256a4c786fSespie
1626c074d1c9Sdrahn #if YYDEBUG
16276a4c786fSespie if (yydebug)
16286a4c786fSespie {
1629c074d1c9Sdrahn short *yyssp1 = yyss - 1;
1630c074d1c9Sdrahn YYFPRINTF (stderr, "state stack now");
1631c074d1c9Sdrahn while (yyssp1 != yyssp)
1632c074d1c9Sdrahn YYFPRINTF (stderr, " %d", *++yyssp1);
1633c074d1c9Sdrahn YYFPRINTF (stderr, "\n");
16346a4c786fSespie }
16356a4c786fSespie #endif
16366a4c786fSespie
16376a4c786fSespie *++yyvsp = yyval;
1638c074d1c9Sdrahn #if YYLSP_NEEDED
1639c074d1c9Sdrahn *++yylsp = yyloc;
16406a4c786fSespie #endif
16416a4c786fSespie
1642c074d1c9Sdrahn /* Now `shift' the result of the reduction. Determine what state
1643c074d1c9Sdrahn that goes to, based on the state we popped back to and the rule
1644c074d1c9Sdrahn number reduced by. */
16456a4c786fSespie
16466a4c786fSespie yyn = yyr1[yyn];
16476a4c786fSespie
16486a4c786fSespie yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
16496a4c786fSespie if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
16506a4c786fSespie yystate = yytable[yystate];
16516a4c786fSespie else
16526a4c786fSespie yystate = yydefgoto[yyn - YYNTBASE];
16536a4c786fSespie
16546a4c786fSespie goto yynewstate;
16556a4c786fSespie
16566a4c786fSespie
1657c074d1c9Sdrahn /*------------------------------------.
1658c074d1c9Sdrahn | yyerrlab -- here on detecting error |
1659c074d1c9Sdrahn `------------------------------------*/
1660c074d1c9Sdrahn yyerrlab:
16616a4c786fSespie /* If not already recovering from an error, report this error. */
1662c074d1c9Sdrahn if (!yyerrstatus)
16636a4c786fSespie {
16646a4c786fSespie ++yynerrs;
16656a4c786fSespie
16666a4c786fSespie #ifdef YYERROR_VERBOSE
16676a4c786fSespie yyn = yypact[yystate];
16686a4c786fSespie
16696a4c786fSespie if (yyn > YYFLAG && yyn < YYLAST)
16706a4c786fSespie {
1671c074d1c9Sdrahn YYSIZE_T yysize = 0;
1672c074d1c9Sdrahn char *yymsg;
1673c074d1c9Sdrahn int yyx, yycount;
16746a4c786fSespie
1675c074d1c9Sdrahn yycount = 0;
1676c074d1c9Sdrahn /* Start YYX at -YYN if negative to avoid negative indexes in
1677c074d1c9Sdrahn YYCHECK. */
1678c074d1c9Sdrahn for (yyx = yyn < 0 ? -yyn : 0;
1679c074d1c9Sdrahn yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++)
1680c074d1c9Sdrahn if (yycheck[yyx + yyn] == yyx)
1681c074d1c9Sdrahn yysize += yystrlen (yytname[yyx]) + 15, yycount++;
1682c074d1c9Sdrahn yysize += yystrlen ("parse error, unexpected ") + 1;
1683c074d1c9Sdrahn yysize += yystrlen (yytname[YYTRANSLATE (yychar)]);
1684c074d1c9Sdrahn yymsg = (char *) YYSTACK_ALLOC (yysize);
1685c074d1c9Sdrahn if (yymsg != 0)
16866a4c786fSespie {
1687c074d1c9Sdrahn char *yyp = yystpcpy (yymsg, "parse error, unexpected ");
1688c074d1c9Sdrahn yyp = yystpcpy (yyp, yytname[YYTRANSLATE (yychar)]);
16896a4c786fSespie
1690c074d1c9Sdrahn if (yycount < 5)
16916a4c786fSespie {
1692c074d1c9Sdrahn yycount = 0;
1693c074d1c9Sdrahn for (yyx = yyn < 0 ? -yyn : 0;
1694c074d1c9Sdrahn yyx < (int) (sizeof (yytname) / sizeof (char *));
1695c074d1c9Sdrahn yyx++)
1696c074d1c9Sdrahn if (yycheck[yyx + yyn] == yyx)
16976a4c786fSespie {
1698c074d1c9Sdrahn const char *yyq = ! yycount ? ", expecting " : " or ";
1699c074d1c9Sdrahn yyp = yystpcpy (yyp, yyq);
1700c074d1c9Sdrahn yyp = yystpcpy (yyp, yytname[yyx]);
1701c074d1c9Sdrahn yycount++;
17026a4c786fSespie }
17036a4c786fSespie }
1704c074d1c9Sdrahn yyerror (yymsg);
1705c074d1c9Sdrahn YYSTACK_FREE (yymsg);
17066a4c786fSespie }
17076a4c786fSespie else
1708c074d1c9Sdrahn yyerror ("parse error; also virtual memory exhausted");
17096a4c786fSespie }
17106a4c786fSespie else
1711c074d1c9Sdrahn #endif /* defined (YYERROR_VERBOSE) */
17126a4c786fSespie yyerror ("parse error");
17136a4c786fSespie }
17146a4c786fSespie goto yyerrlab1;
17156a4c786fSespie
1716c074d1c9Sdrahn
1717c074d1c9Sdrahn /*--------------------------------------------------.
1718c074d1c9Sdrahn | yyerrlab1 -- error raised explicitly by an action |
1719c074d1c9Sdrahn `--------------------------------------------------*/
1720c074d1c9Sdrahn yyerrlab1:
17216a4c786fSespie if (yyerrstatus == 3)
17226a4c786fSespie {
1723c074d1c9Sdrahn /* If just tried and failed to reuse lookahead token after an
1724c074d1c9Sdrahn error, discard it. */
17256a4c786fSespie
17266a4c786fSespie /* return failure if at end of input */
17276a4c786fSespie if (yychar == YYEOF)
17286a4c786fSespie YYABORT;
1729c074d1c9Sdrahn YYDPRINTF ((stderr, "Discarding token %d (%s).\n",
1730c074d1c9Sdrahn yychar, yytname[yychar1]));
17316a4c786fSespie yychar = YYEMPTY;
17326a4c786fSespie }
17336a4c786fSespie
1734c074d1c9Sdrahn /* Else will try to reuse lookahead token after shifting the error
1735c074d1c9Sdrahn token. */
17366a4c786fSespie
17376a4c786fSespie yyerrstatus = 3; /* Each real token shifted decrements this */
17386a4c786fSespie
17396a4c786fSespie goto yyerrhandle;
17406a4c786fSespie
17416a4c786fSespie
1742c074d1c9Sdrahn /*-------------------------------------------------------------------.
1743c074d1c9Sdrahn | yyerrdefault -- current state does not do anything special for the |
1744c074d1c9Sdrahn | error token. |
1745c074d1c9Sdrahn `-------------------------------------------------------------------*/
1746c074d1c9Sdrahn yyerrdefault:
17476a4c786fSespie #if 0
17486a4c786fSespie /* This is wrong; only states that explicitly want error tokens
17496a4c786fSespie should shift them. */
1750c074d1c9Sdrahn
1751c074d1c9Sdrahn /* If its default is to accept any token, ok. Otherwise pop it. */
1752c074d1c9Sdrahn yyn = yydefact[yystate];
1753c074d1c9Sdrahn if (yyn)
1754c074d1c9Sdrahn goto yydefault;
17556a4c786fSespie #endif
17566a4c786fSespie
17576a4c786fSespie
1758c074d1c9Sdrahn /*---------------------------------------------------------------.
1759c074d1c9Sdrahn | yyerrpop -- pop the current state because it cannot handle the |
1760c074d1c9Sdrahn | error token |
1761c074d1c9Sdrahn `---------------------------------------------------------------*/
1762c074d1c9Sdrahn yyerrpop:
1763c074d1c9Sdrahn if (yyssp == yyss)
1764c074d1c9Sdrahn YYABORT;
17656a4c786fSespie yyvsp--;
17666a4c786fSespie yystate = *--yyssp;
1767c074d1c9Sdrahn #if YYLSP_NEEDED
17686a4c786fSespie yylsp--;
17696a4c786fSespie #endif
17706a4c786fSespie
1771c074d1c9Sdrahn #if YYDEBUG
17726a4c786fSespie if (yydebug)
17736a4c786fSespie {
1774c074d1c9Sdrahn short *yyssp1 = yyss - 1;
1775c074d1c9Sdrahn YYFPRINTF (stderr, "Error: state stack now");
1776c074d1c9Sdrahn while (yyssp1 != yyssp)
1777c074d1c9Sdrahn YYFPRINTF (stderr, " %d", *++yyssp1);
1778c074d1c9Sdrahn YYFPRINTF (stderr, "\n");
17796a4c786fSespie }
17806a4c786fSespie #endif
17816a4c786fSespie
1782c074d1c9Sdrahn /*--------------.
1783c074d1c9Sdrahn | yyerrhandle. |
1784c074d1c9Sdrahn `--------------*/
17856a4c786fSespie yyerrhandle:
17866a4c786fSespie yyn = yypact[yystate];
17876a4c786fSespie if (yyn == YYFLAG)
17886a4c786fSespie goto yyerrdefault;
17896a4c786fSespie
17906a4c786fSespie yyn += YYTERROR;
17916a4c786fSespie if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
17926a4c786fSespie goto yyerrdefault;
17936a4c786fSespie
17946a4c786fSespie yyn = yytable[yyn];
17956a4c786fSespie if (yyn < 0)
17966a4c786fSespie {
17976a4c786fSespie if (yyn == YYFLAG)
17986a4c786fSespie goto yyerrpop;
17996a4c786fSespie yyn = -yyn;
18006a4c786fSespie goto yyreduce;
18016a4c786fSespie }
18026a4c786fSespie else if (yyn == 0)
18036a4c786fSespie goto yyerrpop;
18046a4c786fSespie
18056a4c786fSespie if (yyn == YYFINAL)
18066a4c786fSespie YYACCEPT;
18076a4c786fSespie
1808c074d1c9Sdrahn YYDPRINTF ((stderr, "Shifting error token, "));
18096a4c786fSespie
18106a4c786fSespie *++yyvsp = yylval;
1811c074d1c9Sdrahn #if YYLSP_NEEDED
18126a4c786fSespie *++yylsp = yylloc;
18136a4c786fSespie #endif
18146a4c786fSespie
18156a4c786fSespie yystate = yyn;
18166a4c786fSespie goto yynewstate;
18176a4c786fSespie
18186a4c786fSespie
1819c074d1c9Sdrahn /*-------------------------------------.
1820c074d1c9Sdrahn | yyacceptlab -- YYACCEPT comes here. |
1821c074d1c9Sdrahn `-------------------------------------*/
1822c074d1c9Sdrahn yyacceptlab:
1823c074d1c9Sdrahn yyresult = 0;
1824c074d1c9Sdrahn goto yyreturn;
1825c074d1c9Sdrahn
1826c074d1c9Sdrahn /*-----------------------------------.
1827c074d1c9Sdrahn | yyabortlab -- YYABORT comes here. |
1828c074d1c9Sdrahn `-----------------------------------*/
18296a4c786fSespie yyabortlab:
1830c074d1c9Sdrahn yyresult = 1;
1831c074d1c9Sdrahn goto yyreturn;
1832c074d1c9Sdrahn
1833c074d1c9Sdrahn /*---------------------------------------------.
1834c074d1c9Sdrahn | yyoverflowab -- parser overflow comes here. |
1835c074d1c9Sdrahn `---------------------------------------------*/
1836c074d1c9Sdrahn yyoverflowlab:
1837c074d1c9Sdrahn yyerror ("parser stack overflow");
1838c074d1c9Sdrahn yyresult = 2;
1839c074d1c9Sdrahn /* Fall through. */
1840c074d1c9Sdrahn
1841c074d1c9Sdrahn yyreturn:
1842c074d1c9Sdrahn #ifndef yyoverflow
1843c074d1c9Sdrahn if (yyss != yyssa)
1844c074d1c9Sdrahn YYSTACK_FREE (yyss);
18456a4c786fSespie #endif
1846c074d1c9Sdrahn return yyresult;
18476a4c786fSespie }
1848c074d1c9Sdrahn #line 648 "m68k-parse.y"
18496a4c786fSespie
18506a4c786fSespie
18516a4c786fSespie /* The string to parse is stored here, and modified by yylex. */
18526a4c786fSespie
18536a4c786fSespie static char *str;
18546a4c786fSespie
18556a4c786fSespie /* The original string pointer. */
18566a4c786fSespie
18576a4c786fSespie static char *strorig;
18586a4c786fSespie
18596a4c786fSespie /* If *CCP could be a register, return the register number and advance
18606a4c786fSespie *CCP. Otherwise don't change *CCP, and return 0. */
18616a4c786fSespie
18626a4c786fSespie static enum m68k_register
m68k_reg_parse(ccp)18636a4c786fSespie m68k_reg_parse (ccp)
18646a4c786fSespie register char **ccp;
18656a4c786fSespie {
18666a4c786fSespie char *start = *ccp;
18676a4c786fSespie char c;
18686a4c786fSespie char *p;
18696a4c786fSespie symbolS *symbolp;
18706a4c786fSespie
18716a4c786fSespie if (flag_reg_prefix_optional)
18726a4c786fSespie {
18736a4c786fSespie if (*start == REGISTER_PREFIX)
18746a4c786fSespie start++;
18756a4c786fSespie p = start;
18766a4c786fSespie }
18776a4c786fSespie else
18786a4c786fSespie {
18796a4c786fSespie if (*start != REGISTER_PREFIX)
18806a4c786fSespie return 0;
18816a4c786fSespie p = start + 1;
18826a4c786fSespie }
18836a4c786fSespie
18846a4c786fSespie if (! is_name_beginner (*p))
18856a4c786fSespie return 0;
18866a4c786fSespie
18876a4c786fSespie p++;
18886a4c786fSespie while (is_part_of_name (*p) && *p != '.' && *p != ':' && *p != '*')
18896a4c786fSespie p++;
18906a4c786fSespie
18916a4c786fSespie c = *p;
18926a4c786fSespie *p = 0;
18936a4c786fSespie symbolp = symbol_find (start);
18946a4c786fSespie *p = c;
18956a4c786fSespie
18966a4c786fSespie if (symbolp != NULL && S_GET_SEGMENT (symbolp) == reg_section)
18976a4c786fSespie {
18986a4c786fSespie *ccp = p;
18996a4c786fSespie return S_GET_VALUE (symbolp);
19006a4c786fSespie }
19016a4c786fSespie
19026a4c786fSespie /* In MRI mode, something like foo.bar can be equated to a register
19036a4c786fSespie name. */
19046a4c786fSespie while (flag_mri && c == '.')
19056a4c786fSespie {
19066a4c786fSespie ++p;
19076a4c786fSespie while (is_part_of_name (*p) && *p != '.' && *p != ':' && *p != '*')
19086a4c786fSespie p++;
19096a4c786fSespie c = *p;
19106a4c786fSespie *p = '\0';
19116a4c786fSespie symbolp = symbol_find (start);
19126a4c786fSespie *p = c;
19136a4c786fSespie if (symbolp != NULL && S_GET_SEGMENT (symbolp) == reg_section)
19146a4c786fSespie {
19156a4c786fSespie *ccp = p;
19166a4c786fSespie return S_GET_VALUE (symbolp);
19176a4c786fSespie }
19186a4c786fSespie }
19196a4c786fSespie
19206a4c786fSespie return 0;
19216a4c786fSespie }
19226a4c786fSespie
19236a4c786fSespie /* The lexer. */
19246a4c786fSespie
19256a4c786fSespie static int
yylex()19266a4c786fSespie yylex ()
19276a4c786fSespie {
19286a4c786fSespie enum m68k_register reg;
19296a4c786fSespie char *s;
19306a4c786fSespie int parens;
19316a4c786fSespie int c = 0;
19326a4c786fSespie int tail = 0;
19336a4c786fSespie char *hold;
19346a4c786fSespie
19356a4c786fSespie if (*str == ' ')
19366a4c786fSespie ++str;
19376a4c786fSespie
19386a4c786fSespie if (*str == '\0')
19396a4c786fSespie return 0;
19406a4c786fSespie
19416a4c786fSespie /* Various special characters are just returned directly. */
19426a4c786fSespie switch (*str)
19436a4c786fSespie {
19446a4c786fSespie case '@':
19456a4c786fSespie /* In MRI mode, this can be the start of an octal number. */
19466a4c786fSespie if (flag_mri)
19476a4c786fSespie {
1948c074d1c9Sdrahn if (ISDIGIT (str[1])
19496a4c786fSespie || ((str[1] == '+' || str[1] == '-')
1950c074d1c9Sdrahn && ISDIGIT (str[2])))
19516a4c786fSespie break;
19526a4c786fSespie }
19536a4c786fSespie /* Fall through. */
19546a4c786fSespie case '#':
19556a4c786fSespie case '&':
19566a4c786fSespie case ',':
19576a4c786fSespie case ')':
19586a4c786fSespie case '/':
19596a4c786fSespie case '[':
19606a4c786fSespie case ']':
19616a4c786fSespie return *str++;
19626a4c786fSespie case '+':
19636a4c786fSespie /* It so happens that a '+' can only appear at the end of an
19646a4c786fSespie operand. If it appears anywhere else, it must be a unary
19656a4c786fSespie plus on an expression. */
19666a4c786fSespie if (str[1] == '\0')
19676a4c786fSespie return *str++;
19686a4c786fSespie break;
19696a4c786fSespie case '-':
19706a4c786fSespie /* A '-' can only appear in -(ar), rn-rn, or ar@-. If it
19716a4c786fSespie appears anywhere else, it must be a unary minus on an
19726a4c786fSespie expression. */
19736a4c786fSespie if (str[1] == '\0')
19746a4c786fSespie return *str++;
19756a4c786fSespie s = str + 1;
19766a4c786fSespie if (*s == '(')
19776a4c786fSespie ++s;
19786a4c786fSespie if (m68k_reg_parse (&s) != 0)
19796a4c786fSespie return *str++;
19806a4c786fSespie break;
19816a4c786fSespie case '(':
19826a4c786fSespie /* A '(' can only appear in `(reg)', `(expr,...', `([', `@(', or
19836a4c786fSespie `)('. If it appears anywhere else, it must be starting an
19846a4c786fSespie expression. */
19856a4c786fSespie if (str[1] == '['
19866a4c786fSespie || (str > strorig
19876a4c786fSespie && (str[-1] == '@'
19886a4c786fSespie || str[-1] == ')')))
19896a4c786fSespie return *str++;
19906a4c786fSespie s = str + 1;
19916a4c786fSespie if (m68k_reg_parse (&s) != 0)
19926a4c786fSespie return *str++;
19936a4c786fSespie /* Check for the case of '(expr,...' by scanning ahead. If we
19946a4c786fSespie find a comma outside of balanced parentheses, we return '('.
19956a4c786fSespie If we find an unbalanced right parenthesis, then presumably
19966a4c786fSespie the '(' really starts an expression. */
19976a4c786fSespie parens = 0;
19986a4c786fSespie for (s = str + 1; *s != '\0'; s++)
19996a4c786fSespie {
20006a4c786fSespie if (*s == '(')
20016a4c786fSespie ++parens;
20026a4c786fSespie else if (*s == ')')
20036a4c786fSespie {
20046a4c786fSespie if (parens == 0)
20056a4c786fSespie break;
20066a4c786fSespie --parens;
20076a4c786fSespie }
20086a4c786fSespie else if (*s == ',' && parens == 0)
20096a4c786fSespie {
20106a4c786fSespie /* A comma can not normally appear in an expression, so
20116a4c786fSespie this is a case of '(expr,...'. */
20126a4c786fSespie return *str++;
20136a4c786fSespie }
20146a4c786fSespie }
20156a4c786fSespie }
20166a4c786fSespie
20176a4c786fSespie /* See if it's a register. */
20186a4c786fSespie
20196a4c786fSespie reg = m68k_reg_parse (&str);
20206a4c786fSespie if (reg != 0)
20216a4c786fSespie {
20226a4c786fSespie int ret;
20236a4c786fSespie
20246a4c786fSespie yylval.reg = reg;
20256a4c786fSespie
20266a4c786fSespie if (reg >= DATA0 && reg <= DATA7)
20276a4c786fSespie ret = DR;
20286a4c786fSespie else if (reg >= ADDR0 && reg <= ADDR7)
20296a4c786fSespie ret = AR;
20306a4c786fSespie else if (reg >= FP0 && reg <= FP7)
20316a4c786fSespie return FPR;
20326a4c786fSespie else if (reg == FPI
20336a4c786fSespie || reg == FPS
20346a4c786fSespie || reg == FPC)
20356a4c786fSespie return FPCR;
20366a4c786fSespie else if (reg == PC)
20376a4c786fSespie return LPC;
20386a4c786fSespie else if (reg >= ZDATA0 && reg <= ZDATA7)
20396a4c786fSespie ret = ZDR;
20406a4c786fSespie else if (reg >= ZADDR0 && reg <= ZADDR7)
20416a4c786fSespie ret = ZAR;
20426a4c786fSespie else if (reg == ZPC)
20436a4c786fSespie return LZPC;
20446a4c786fSespie else
20456a4c786fSespie return CREG;
20466a4c786fSespie
20476a4c786fSespie /* If we get here, we have a data or address register. We
20486a4c786fSespie must check for a size or scale; if we find one, we must
20496a4c786fSespie return INDEXREG. */
20506a4c786fSespie
20516a4c786fSespie s = str;
20526a4c786fSespie
20536a4c786fSespie if (*s != '.' && *s != ':' && *s != '*')
20546a4c786fSespie return ret;
20556a4c786fSespie
20566a4c786fSespie yylval.indexreg.reg = reg;
20576a4c786fSespie
20586a4c786fSespie if (*s != '.' && *s != ':')
20596a4c786fSespie yylval.indexreg.size = SIZE_UNSPEC;
20606a4c786fSespie else
20616a4c786fSespie {
20626a4c786fSespie ++s;
20636a4c786fSespie switch (*s)
20646a4c786fSespie {
20656a4c786fSespie case 'w':
20666a4c786fSespie case 'W':
20676a4c786fSespie yylval.indexreg.size = SIZE_WORD;
20686a4c786fSespie ++s;
20696a4c786fSespie break;
20706a4c786fSespie case 'l':
20716a4c786fSespie case 'L':
20726a4c786fSespie yylval.indexreg.size = SIZE_LONG;
20736a4c786fSespie ++s;
20746a4c786fSespie break;
20756a4c786fSespie default:
20766a4c786fSespie yyerror (_("illegal size specification"));
20776a4c786fSespie yylval.indexreg.size = SIZE_UNSPEC;
20786a4c786fSespie break;
20796a4c786fSespie }
20806a4c786fSespie }
20816a4c786fSespie
20826a4c786fSespie yylval.indexreg.scale = 1;
20836a4c786fSespie
20846a4c786fSespie if (*s == '*' || *s == ':')
20856a4c786fSespie {
20866a4c786fSespie expressionS scale;
20876a4c786fSespie
20886a4c786fSespie ++s;
20896a4c786fSespie
20906a4c786fSespie hold = input_line_pointer;
20916a4c786fSespie input_line_pointer = s;
20926a4c786fSespie expression (&scale);
20936a4c786fSespie s = input_line_pointer;
20946a4c786fSespie input_line_pointer = hold;
20956a4c786fSespie
20966a4c786fSespie if (scale.X_op != O_constant)
20976a4c786fSespie yyerror (_("scale specification must resolve to a number"));
20986a4c786fSespie else
20996a4c786fSespie {
21006a4c786fSespie switch (scale.X_add_number)
21016a4c786fSespie {
21026a4c786fSespie case 1:
21036a4c786fSespie case 2:
21046a4c786fSespie case 4:
21056a4c786fSespie case 8:
21066a4c786fSespie yylval.indexreg.scale = scale.X_add_number;
21076a4c786fSespie break;
21086a4c786fSespie default:
21096a4c786fSespie yyerror (_("invalid scale value"));
21106a4c786fSespie break;
21116a4c786fSespie }
21126a4c786fSespie }
21136a4c786fSespie }
21146a4c786fSespie
21156a4c786fSespie str = s;
21166a4c786fSespie
21176a4c786fSespie return INDEXREG;
21186a4c786fSespie }
21196a4c786fSespie
21206a4c786fSespie /* It must be an expression. Before we call expression, we need to
21216a4c786fSespie look ahead to see if there is a size specification. We must do
21226a4c786fSespie that first, because otherwise foo.l will be treated as the symbol
21236a4c786fSespie foo.l, rather than as the symbol foo with a long size
21246a4c786fSespie specification. The grammar requires that all expressions end at
21256a4c786fSespie the end of the operand, or with ',', '(', ']', ')'. */
21266a4c786fSespie
21276a4c786fSespie parens = 0;
21286a4c786fSespie for (s = str; *s != '\0'; s++)
21296a4c786fSespie {
21306a4c786fSespie if (*s == '(')
21316a4c786fSespie {
21326a4c786fSespie if (parens == 0
21336a4c786fSespie && s > str
2134c074d1c9Sdrahn && (s[-1] == ')' || ISALNUM (s[-1])))
21356a4c786fSespie break;
21366a4c786fSespie ++parens;
21376a4c786fSespie }
21386a4c786fSespie else if (*s == ')')
21396a4c786fSespie {
21406a4c786fSespie if (parens == 0)
21416a4c786fSespie break;
21426a4c786fSespie --parens;
21436a4c786fSespie }
21446a4c786fSespie else if (parens == 0
21456a4c786fSespie && (*s == ',' || *s == ']'))
21466a4c786fSespie break;
21476a4c786fSespie }
21486a4c786fSespie
21496a4c786fSespie yylval.exp.size = SIZE_UNSPEC;
21506a4c786fSespie if (s <= str + 2
21516a4c786fSespie || (s[-2] != '.' && s[-2] != ':'))
21526a4c786fSespie tail = 0;
21536a4c786fSespie else
21546a4c786fSespie {
21556a4c786fSespie switch (s[-1])
21566a4c786fSespie {
21576a4c786fSespie case 's':
21586a4c786fSespie case 'S':
21596a4c786fSespie case 'b':
21606a4c786fSespie case 'B':
21616a4c786fSespie yylval.exp.size = SIZE_BYTE;
21626a4c786fSespie break;
21636a4c786fSespie case 'w':
21646a4c786fSespie case 'W':
21656a4c786fSespie yylval.exp.size = SIZE_WORD;
21666a4c786fSespie break;
21676a4c786fSespie case 'l':
21686a4c786fSespie case 'L':
21696a4c786fSespie yylval.exp.size = SIZE_LONG;
21706a4c786fSespie break;
21716a4c786fSespie default:
21726a4c786fSespie break;
21736a4c786fSespie }
21746a4c786fSespie if (yylval.exp.size != SIZE_UNSPEC)
21756a4c786fSespie tail = 2;
21766a4c786fSespie }
21776a4c786fSespie
21786a4c786fSespie #ifdef OBJ_ELF
21796a4c786fSespie {
21806a4c786fSespie /* Look for @PLTPC, etc. */
21816a4c786fSespie char *cp;
21826a4c786fSespie
21836a4c786fSespie yylval.exp.pic_reloc = pic_none;
21846a4c786fSespie cp = s - tail;
21856a4c786fSespie if (cp - 6 > str && cp[-6] == '@')
21866a4c786fSespie {
21876a4c786fSespie if (strncmp (cp - 6, "@PLTPC", 6) == 0)
21886a4c786fSespie {
21896a4c786fSespie yylval.exp.pic_reloc = pic_plt_pcrel;
21906a4c786fSespie tail += 6;
21916a4c786fSespie }
21926a4c786fSespie else if (strncmp (cp - 6, "@GOTPC", 6) == 0)
21936a4c786fSespie {
21946a4c786fSespie yylval.exp.pic_reloc = pic_got_pcrel;
21956a4c786fSespie tail += 6;
21966a4c786fSespie }
21976a4c786fSespie }
21986a4c786fSespie else if (cp - 4 > str && cp[-4] == '@')
21996a4c786fSespie {
22006a4c786fSespie if (strncmp (cp - 4, "@PLT", 4) == 0)
22016a4c786fSespie {
22026a4c786fSespie yylval.exp.pic_reloc = pic_plt_off;
22036a4c786fSespie tail += 4;
22046a4c786fSespie }
22056a4c786fSespie else if (strncmp (cp - 4, "@GOT", 4) == 0)
22066a4c786fSespie {
22076a4c786fSespie yylval.exp.pic_reloc = pic_got_off;
22086a4c786fSespie tail += 4;
22096a4c786fSespie }
22106a4c786fSespie }
22116a4c786fSespie }
22126a4c786fSespie #endif
22136a4c786fSespie
22146a4c786fSespie if (tail != 0)
22156a4c786fSespie {
22166a4c786fSespie c = s[-tail];
22176a4c786fSespie s[-tail] = 0;
22186a4c786fSespie }
22196a4c786fSespie
22206a4c786fSespie hold = input_line_pointer;
22216a4c786fSespie input_line_pointer = str;
22226a4c786fSespie expression (&yylval.exp.exp);
22236a4c786fSespie str = input_line_pointer;
22246a4c786fSespie input_line_pointer = hold;
22256a4c786fSespie
22266a4c786fSespie if (tail != 0)
22276a4c786fSespie {
22286a4c786fSespie s[-tail] = c;
22296a4c786fSespie str = s;
22306a4c786fSespie }
22316a4c786fSespie
22326a4c786fSespie return EXPR;
22336a4c786fSespie }
22346a4c786fSespie
22356a4c786fSespie /* Parse an m68k operand. This is the only function which is called
22366a4c786fSespie from outside this file. */
22376a4c786fSespie
22386a4c786fSespie int
m68k_ip_op(s,oparg)22396a4c786fSespie m68k_ip_op (s, oparg)
22406a4c786fSespie char *s;
22416a4c786fSespie struct m68k_op *oparg;
22426a4c786fSespie {
22436a4c786fSespie memset (oparg, 0, sizeof *oparg);
22446a4c786fSespie oparg->error = NULL;
22456a4c786fSespie oparg->index.reg = ZDATA0;
22466a4c786fSespie oparg->index.scale = 1;
22476a4c786fSespie oparg->disp.exp.X_op = O_absent;
22486a4c786fSespie oparg->odisp.exp.X_op = O_absent;
22496a4c786fSespie
22506a4c786fSespie str = strorig = s;
22516a4c786fSespie op = oparg;
22526a4c786fSespie
22536a4c786fSespie return yyparse ();
22546a4c786fSespie }
22556a4c786fSespie
22566a4c786fSespie /* The error handler. */
22576a4c786fSespie
22586a4c786fSespie static void
yyerror(s)22596a4c786fSespie yyerror (s)
22606a4c786fSespie const char *s;
22616a4c786fSespie {
22626a4c786fSespie op->error = s;
22636a4c786fSespie }
2264