OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [binutils-2.18.50/] [gas/] [m68k-parse.c] - Blame information for rev 816

Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.