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