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