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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gdb-7.1/] [gdb/] [objc-exp.c] - Blame information for rev 824

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 227 jeremybenn
/* 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
     INT = 258,
57
     FLOAT = 259,
58
     STRING = 260,
59
     NSSTRING = 261,
60
     SELECTOR = 262,
61
     NAME = 263,
62
     TYPENAME = 264,
63
     CLASSNAME = 265,
64
     NAME_OR_INT = 266,
65
     STRUCT = 267,
66
     CLASS = 268,
67
     UNION = 269,
68
     ENUM = 270,
69
     SIZEOF = 271,
70
     UNSIGNED = 272,
71
     COLONCOLON = 273,
72
     TEMPLATE = 274,
73
     ERROR = 275,
74
     SIGNED_KEYWORD = 276,
75
     LONG = 277,
76
     SHORT = 278,
77
     INT_KEYWORD = 279,
78
     CONST_KEYWORD = 280,
79
     VOLATILE_KEYWORD = 281,
80
     DOUBLE_KEYWORD = 282,
81
     VARIABLE = 283,
82
     ASSIGN_MODIFY = 284,
83
     ABOVE_COMMA = 285,
84
     OROR = 286,
85
     ANDAND = 287,
86
     NOTEQUAL = 288,
87
     EQUAL = 289,
88
     GEQ = 290,
89
     LEQ = 291,
90
     RSH = 292,
91
     LSH = 293,
92
     DECREMENT = 294,
93
     INCREMENT = 295,
94
     UNARY = 296,
95
     ARROW = 297,
96
     BLOCKNAME = 298
97
   };
98
#endif
99
#define INT 258
100
#define FLOAT 259
101
#define STRING 260
102
#define NSSTRING 261
103
#define SELECTOR 262
104
#define NAME 263
105
#define TYPENAME 264
106
#define CLASSNAME 265
107
#define NAME_OR_INT 266
108
#define STRUCT 267
109
#define CLASS 268
110
#define UNION 269
111
#define ENUM 270
112
#define SIZEOF 271
113
#define UNSIGNED 272
114
#define COLONCOLON 273
115
#define TEMPLATE 274
116
#define ERROR 275
117
#define SIGNED_KEYWORD 276
118
#define LONG 277
119
#define SHORT 278
120
#define INT_KEYWORD 279
121
#define CONST_KEYWORD 280
122
#define VOLATILE_KEYWORD 281
123
#define DOUBLE_KEYWORD 282
124
#define VARIABLE 283
125
#define ASSIGN_MODIFY 284
126
#define ABOVE_COMMA 285
127
#define OROR 286
128
#define ANDAND 287
129
#define NOTEQUAL 288
130
#define EQUAL 289
131
#define GEQ 290
132
#define LEQ 291
133
#define RSH 292
134
#define LSH 293
135
#define DECREMENT 294
136
#define INCREMENT 295
137
#define UNARY 296
138
#define ARROW 297
139
#define BLOCKNAME 298
140
 
141
 
142
 
143
 
144
/* Copy the first part of user declarations.  */
145
#line 35 "objc-exp.y"
146
 
147
 
148
#include "defs.h"
149
#include "gdb_string.h"
150
#include <ctype.h>
151
#include "expression.h"
152
 
153
#include "objc-lang.h"  /* For objc language constructs.  */
154
 
155
#include "value.h"
156
#include "parser-defs.h"
157
#include "language.h"
158
#include "c-lang.h"
159
#include "bfd.h" /* Required by objfiles.h.  */
160
#include "symfile.h" /* Required by objfiles.h.  */
161
#include "objfiles.h" /* For have_full_symbols and have_partial_symbols.  */
162
#include "top.h"
163
#include "completer.h" /* For skip_quoted().  */
164
#include "block.h"
165
 
166
#define parse_type builtin_type (parse_gdbarch)
167
 
168
/* Remap normal yacc parser interface names (yyparse, yylex, yyerror,
169
   etc), as well as gratuitiously global symbol names, so we can have
170
   multiple yacc generated parsers in gdb.  Note that these are only
171
   the variables produced by yacc.  If other parser generators (bison,
172
   byacc, etc) produce additional global names that conflict at link
173
   time, then those parser generators need to be fixed instead of
174
   adding those names to this list.  */
175
 
176
#define yymaxdepth      objc_maxdepth
177
#define yyparse         objc_parse
178
#define yylex           objc_lex
179
#define yyerror         objc_error
180
#define yylval          objc_lval
181
#define yychar          objc_char
182
#define yydebug         objc_debug
183
#define yypact          objc_pact       
184
#define yyr1            objc_r1                 
185
#define yyr2            objc_r2                 
186
#define yydef           objc_def                
187
#define yychk           objc_chk                
188
#define yypgo           objc_pgo                
189
#define yyact           objc_act                
190
#define yyexca          objc_exca
191
#define yyerrflag       objc_errflag
192
#define yynerrs         objc_nerrs
193
#define yyps            objc_ps
194
#define yypv            objc_pv
195
#define yys             objc_s
196
#define yy_yys          objc_yys
197
#define yystate         objc_state
198
#define yytmp           objc_tmp
199
#define yyv             objc_v
200
#define yy_yyv          objc_yyv
201
#define yyval           objc_val
202
#define yylloc          objc_lloc
203
#define yyreds          objc_reds               /* With YYDEBUG defined */
204
#define yytoks          objc_toks               /* With YYDEBUG defined */
205
#define yyname          objc_name               /* With YYDEBUG defined */
206
#define yyrule          objc_rule               /* With YYDEBUG defined */
207
#define yylhs           objc_yylhs
208
#define yylen           objc_yylen
209
#define yydefred        objc_yydefred
210
#define yydgoto         objc_yydgoto
211
#define yysindex        objc_yysindex
212
#define yyrindex        objc_yyrindex
213
#define yygindex        objc_yygindex
214
#define yytable         objc_yytable
215
#define yycheck         objc_yycheck
216
 
217
#ifndef YYDEBUG
218
#define YYDEBUG 0                /* Default to no yydebug support.  */
219
#endif
220
 
221
int
222
yyparse (void);
223
 
224
static int
225
yylex (void);
226
 
227
void
228
yyerror (char *);
229
 
230
 
231
 
232
/* Enabling traces.  */
233
#ifndef YYDEBUG
234
# define YYDEBUG 0
235
#endif
236
 
237
/* Enabling verbose error messages.  */
238
#ifdef YYERROR_VERBOSE
239
# undef YYERROR_VERBOSE
240
# define YYERROR_VERBOSE 1
241
#else
242
# define YYERROR_VERBOSE 0
243
#endif
244
 
245
#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
246
#line 126 "objc-exp.y"
247
typedef union YYSTYPE {
248
    LONGEST lval;
249
    struct {
250
      LONGEST val;
251
      struct type *type;
252
    } typed_val_int;
253
    struct {
254
      DOUBLEST dval;
255
      struct type *type;
256
    } typed_val_float;
257
    struct symbol *sym;
258
    struct type *tval;
259
    struct stoken sval;
260
    struct ttype tsym;
261
    struct symtoken ssym;
262
    int voidval;
263
    struct block *bval;
264
    enum exp_opcode opcode;
265
    struct internalvar *ivar;
266
    struct objc_class_str class;
267
 
268
    struct type **tvec;
269
    int *ivec;
270
  } YYSTYPE;
271
/* Line 191 of yacc.c.  */
272
#line 273 "objc-exp.c.tmp"
273
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
274
# define YYSTYPE_IS_DECLARED 1
275
# define YYSTYPE_IS_TRIVIAL 1
276
#endif
277
 
278
 
279
 
280
/* Copy the second part of user declarations.  */
281
#line 151 "objc-exp.y"
282
 
283
/* YYSTYPE gets defined by %union.  */
284
static int
285
parse_number (char *, int, int, YYSTYPE *);
286
 
287
 
288
/* Line 214 of yacc.c.  */
289
#line 290 "objc-exp.c.tmp"
290
 
291
#if ! defined (yyoverflow) || YYERROR_VERBOSE
292
 
293
# ifndef YYFREE
294
#  define YYFREE xfree
295
# endif
296
# ifndef YYMALLOC
297
#  define YYMALLOC xmalloc
298
# endif
299
 
300
/* The parser invokes alloca or xmalloc; define the necessary symbols.  */
301
 
302
# ifdef YYSTACK_USE_ALLOCA
303
#  if YYSTACK_USE_ALLOCA
304
#   define YYSTACK_ALLOC alloca
305
#  endif
306
# else
307
#  if defined (alloca) || defined (_ALLOCA_H)
308
#   define YYSTACK_ALLOC alloca
309
#  else
310
#   ifdef __GNUC__
311
#    define YYSTACK_ALLOC __builtin_alloca
312
#   endif
313
#  endif
314
# endif
315
 
316
# ifdef YYSTACK_ALLOC
317
   /* Pacify GCC's `empty if-body' warning. */
318
#  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
319
# else
320
#  if defined (__STDC__) || defined (__cplusplus)
321
#   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
322
#   define YYSIZE_T size_t
323
#  endif
324
#  define YYSTACK_ALLOC YYMALLOC
325
#  define YYSTACK_FREE YYFREE
326
# endif
327
#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
328
 
329
 
330
#if (! defined (yyoverflow) \
331
     && (! defined (__cplusplus) \
332
         || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL)))
333
 
334
/* A type that is properly aligned for any stack member.  */
335
union yyalloc
336
{
337
  short yyss;
338
  YYSTYPE yyvs;
339
  };
340
 
341
/* The size of the maximum gap between one aligned stack and the next.  */
342
# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
343
 
344
/* The size of an array large to enough to hold all stacks, each with
345
   N elements.  */
346
# define YYSTACK_BYTES(N) \
347
     ((N) * (sizeof (short) + sizeof (YYSTYPE))                         \
348
      + YYSTACK_GAP_MAXIMUM)
349
 
350
/* Copy COUNT objects from FROM to TO.  The source and destination do
351
   not overlap.  */
352
# ifndef YYCOPY
353
#  if defined (__GNUC__) && 1 < __GNUC__
354
#   define YYCOPY(To, From, Count) \
355
      __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
356
#  else
357
#   define YYCOPY(To, From, Count)              \
358
      do                                        \
359
        {                                       \
360
          register YYSIZE_T yyi;                \
361
          for (yyi = 0; yyi < (Count); yyi++)    \
362
            (To)[yyi] = (From)[yyi];            \
363
        }                                       \
364
      while (0)
365
#  endif
366
# endif
367
 
368
/* Relocate STACK from its old location to the new one.  The
369
   local variables YYSIZE and YYSTACKSIZE give the old and new number of
370
   elements in the stack, and YYPTR gives the new location of the
371
   stack.  Advance YYPTR to a properly aligned location for the next
372
   stack.  */
373
# define YYSTACK_RELOCATE(Stack)                                        \
374
    do                                                                  \
375
      {                                                                 \
376
        YYSIZE_T yynewbytes;                                            \
377
        YYCOPY (&yyptr->Stack, Stack, yysize);                          \
378
        Stack = &yyptr->Stack;                                          \
379
        yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
380
        yyptr += yynewbytes / sizeof (*yyptr);                          \
381
      }                                                                 \
382
    while (0)
383
 
384
#endif
385
 
386
#if defined (__STDC__) || defined (__cplusplus)
387
   typedef signed char yysigned_char;
388
#else
389
   typedef short yysigned_char;
390
#endif
391
 
392
/* YYFINAL -- State number of the termination state. */
393
#define YYFINAL  89
394
/* YYLAST -- Last index in YYTABLE.  */
395
#define YYLAST   793
396
 
397
/* YYNTOKENS -- Number of terminals. */
398
#define YYNTOKENS  68
399
/* YYNNTS -- Number of nonterminals. */
400
#define YYNNTS  29
401
/* YYNRULES -- Number of rules. */
402
#define YYNRULES  146
403
/* YYNRULES -- Number of states. */
404
#define YYNSTATES  236
405
 
406
/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
407
#define YYUNDEFTOK  2
408
#define YYMAXUTOK   298
409
 
410
#define YYTRANSLATE(YYX)                                                \
411
  ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
412
 
413
/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
414
static const unsigned char yytranslate[] =
415
{
416
       0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
417
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
418
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
419
       2,     2,     2,    61,     2,     2,     2,    52,    38,     2,
420
      58,    65,    50,    48,    30,    49,    56,    51,     2,     2,
421
       2,     2,     2,     2,     2,     2,     2,     2,    64,     2,
422
      41,    32,    42,    33,    47,     2,     2,     2,     2,     2,
423
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
424
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
425
       2,    57,     2,    63,    37,     2,     2,     2,     2,     2,
426
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
427
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
428
       2,     2,     2,    66,    36,    67,    62,     2,     2,     2,
429
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
430
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
431
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
432
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
433
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
434
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
435
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
436
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
437
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
438
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
439
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
440
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
441
       2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
442
       5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
443
      15,    16,    17,    18,    19,    20,    21,    22,    23,    24,
444
      25,    26,    27,    28,    29,    31,    34,    35,    39,    40,
445
      43,    44,    45,    46,    53,    54,    55,    59,    60
446
};
447
 
448
#if YYDEBUG
449
/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
450
   YYRHS.  */
451
static const unsigned short yyprhs[] =
452
{
453
       0,     0,     3,     5,     7,     9,    11,    15,    18,    21,
454
      24,    27,    30,    33,    36,    39,    42,    45,    49,    53,
455
      58,    62,    66,    71,    76,    77,    83,    84,    90,    91,
456
      97,    99,   101,   103,   106,   110,   113,   116,   117,   123,
457
     125,   126,   128,   132,   134,   138,   143,   148,   152,   156,
458
     160,   164,   168,   172,   176,   180,   184,   188,   192,   196,
459
     200,   204,   208,   212,   216,   220,   224,   228,   234,   238,
460
     242,   244,   246,   248,   250,   252,   254,   259,   261,   263,
461
     265,   269,   273,   277,   282,   284,   287,   289,   291,   294,
462
     297,   300,   304,   308,   310,   313,   315,   318,   320,   324,
463
     327,   329,   332,   334,   337,   341,   344,   348,   350,   352,
464
     354,   356,   358,   360,   363,   367,   370,   374,   378,   383,
465
     386,   390,   392,   395,   398,   401,   404,   407,   410,   412,
466
     415,   417,   423,   426,   429,   431,   433,   435,   437,   439,
467
     443,   445,   447,   449,   451,   453,   455
468
};
469
 
470
/* YYRHS -- A `-1'-separated list of the rules' RHS. */
471
static const yysigned_char yyrhs[] =
472
{
473
      69,     0,    -1,    71,    -1,    70,    -1,    91,    -1,    72,
474
      -1,    71,    30,    72,    -1,    50,    72,    -1,    38,    72,
475
      -1,    49,    72,    -1,    61,    72,    -1,    62,    72,    -1,
476
      54,    72,    -1,    53,    72,    -1,    72,    54,    -1,    72,
477
      53,    -1,    16,    72,    -1,    72,    59,    95,    -1,    72,
478
      59,    85,    -1,    72,    59,    50,    72,    -1,    72,    56,
479
      95,    -1,    72,    56,    85,    -1,    72,    56,    50,    72,
480
      -1,    72,    57,    71,    63,    -1,    -1,    57,     9,    73,
481
      76,    63,    -1,    -1,    57,    10,    74,    76,    63,    -1,
482
      -1,    57,    72,    75,    76,    63,    -1,    95,    -1,    77,
483
      -1,    78,    -1,    77,    78,    -1,    95,    64,    72,    -1,
484
      64,    72,    -1,    30,    72,    -1,    -1,    72,    58,    79,
485
      81,    65,    -1,    66,    -1,    -1,    72,    -1,    81,    30,
486
      72,    -1,    67,    -1,    80,    81,    82,    -1,    80,    91,
487
      82,    72,    -1,    58,    91,    65,    72,    -1,    58,    71,
488
      65,    -1,    72,    47,    72,    -1,    72,    50,    72,    -1,
489
      72,    51,    72,    -1,    72,    52,    72,    -1,    72,    48,
490
      72,    -1,    72,    49,    72,    -1,    72,    46,    72,    -1,
491
      72,    45,    72,    -1,    72,    40,    72,    -1,    72,    39,
492
      72,    -1,    72,    44,    72,    -1,    72,    43,    72,    -1,
493
      72,    41,    72,    -1,    72,    42,    72,    -1,    72,    38,
494
      72,    -1,    72,    37,    72,    -1,    72,    36,    72,    -1,
495
      72,    35,    72,    -1,    72,    34,    72,    -1,    72,    33,
496
      72,    64,    72,    -1,    72,    32,    72,    -1,    72,    29,
497
      72,    -1,     3,    -1,    11,    -1,     4,    -1,    84,    -1,
498
      28,    -1,     7,    -1,    16,    58,    91,    65,    -1,     5,
499
      -1,     6,    -1,    60,    -1,    83,    18,    95,    -1,    83,
500
      18,    95,    -1,    92,    18,    95,    -1,    92,    18,    62,
501
      95,    -1,    85,    -1,    18,    95,    -1,    96,    -1,    92,
502
      -1,    92,    25,    -1,    92,    26,    -1,    92,    87,    -1,
503
      92,    25,    87,    -1,    92,    26,    87,    -1,    50,    -1,
504
      50,    87,    -1,    38,    -1,    38,    87,    -1,    88,    -1,
505
      58,    87,    65,    -1,    88,    89,    -1,    89,    -1,    88,
506
      90,    -1,    90,    -1,    57,    63,    -1,    57,     3,    63,
507
      -1,    58,    65,    -1,    58,    94,    65,    -1,    86,    -1,
508
       9,    -1,    10,    -1,    24,    -1,    22,    -1,    23,    -1,
509
      22,    24,    -1,    17,    22,    24,    -1,    22,    22,    -1,
510
      22,    22,    24,    -1,    17,    22,    22,    -1,    17,    22,
511
      22,    24,    -1,    23,    24,    -1,    17,    23,    24,    -1,
512
      27,    -1,    22,    27,    -1,    12,    95,    -1,    13,    95,
513
      -1,    14,    95,    -1,    15,    95,    -1,    17,    93,    -1,
514
      17,    -1,    21,    93,    -1,    21,    -1,    19,    95,    41,
515
      91,    42,    -1,    25,    92,    -1,    26,    92,    -1,     9,
516
      -1,    24,    -1,    22,    -1,    23,    -1,    91,    -1,    94,
517
      30,    91,    -1,     8,    -1,    60,    -1,     9,    -1,    10,
518
      -1,    11,    -1,     8,    -1,    60,    -1
519
};
520
 
521
/* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
522
static const unsigned short yyrline[] =
523
{
524
       0,   231,   231,   232,   235,   242,   243,   248,   252,   256,
525
     260,   264,   268,   272,   276,   280,   284,   288,   294,   301,
526
     305,   312,   320,   324,   333,   332,   355,   354,   370,   369,
527
     378,   380,   383,   384,   387,   389,   391,   398,   395,   405,
528
     409,   412,   416,   420,   423,   430,   436,   442,   448,   452,
529
     456,   460,   464,   468,   472,   476,   480,   484,   488,   492,
530
     496,   500,   504,   508,   512,   516,   520,   524,   528,   532,
531
     538,   545,   556,   563,   566,   570,   577,   585,   610,   618,
532
     635,   645,   660,   673,   698,   699,   727,   782,   788,   789,
533
     790,   792,   794,   798,   800,   802,   804,   806,   809,   811,
534
     816,   823,   825,   829,   831,   835,   837,   849,   853,   855,
535
     863,   865,   867,   869,   871,   873,   875,   877,   879,   881,
536
     883,   885,   887,   889,   892,   895,   898,   901,   905,   907,
537
     911,   913,   920,   921,   924,   925,   931,   937,   946,   951,
538
     958,   959,   960,   961,   962,   965,   966
539
};
540
#endif
541
 
542
#if YYDEBUG || YYERROR_VERBOSE
543
/* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
544
   First, the terminals, then, starting at YYNTOKENS, nonterminals. */
545
static const char *const yytname[] =
546
{
547
  "$end", "error", "$undefined", "INT", "FLOAT", "STRING", "NSSTRING",
548
  "SELECTOR", "NAME", "TYPENAME", "CLASSNAME", "NAME_OR_INT", "STRUCT",
549
  "CLASS", "UNION", "ENUM", "SIZEOF", "UNSIGNED", "COLONCOLON", "TEMPLATE",
550
  "ERROR", "SIGNED_KEYWORD", "LONG", "SHORT", "INT_KEYWORD",
551
  "CONST_KEYWORD", "VOLATILE_KEYWORD", "DOUBLE_KEYWORD", "VARIABLE",
552
  "ASSIGN_MODIFY", "','", "ABOVE_COMMA", "'='", "'?'", "OROR", "ANDAND",
553
  "'|'", "'^'", "'&'", "NOTEQUAL", "EQUAL", "'<'", "'>'", "GEQ", "LEQ",
554
  "RSH", "LSH", "'@'", "'+'", "'-'", "'*'", "'/'", "'%'", "DECREMENT",
555
  "INCREMENT", "UNARY", "'.'", "'['", "'('", "ARROW", "BLOCKNAME", "'!'",
556
  "'~'", "']'", "':'", "')'", "'{'", "'}'", "$accept", "start", "type_exp",
557
  "exp1", "exp", "@1", "@2", "@3", "msglist", "msgarglist", "msgarg", "@4",
558
  "lcurly", "arglist", "rcurly", "block", "variable", "qualified_name",
559
  "ptype", "abs_decl", "direct_abs_decl", "array_mod", "func_mod", "type",
560
  "typebase", "typename", "nonempty_typelist", "name", "name_not_typename", 0
561
};
562
#endif
563
 
564
# ifdef YYPRINT
565
/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
566
   token YYLEX-NUM.  */
567
static const unsigned short yytoknum[] =
568
{
569
       0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
570
     265,   266,   267,   268,   269,   270,   271,   272,   273,   274,
571
     275,   276,   277,   278,   279,   280,   281,   282,   283,   284,
572
      44,   285,    61,    63,   286,   287,   124,    94,    38,   288,
573
     289,    60,    62,   290,   291,   292,   293,    64,    43,    45,
574
      42,    47,    37,   294,   295,   296,    46,    91,    40,   297,
575
     298,    33,   126,    93,    58,    41,   123,   125
576
};
577
# endif
578
 
579
/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
580
static const unsigned char yyr1[] =
581
{
582
       0,    68,    69,    69,    70,    71,    71,    72,    72,    72,
583
      72,    72,    72,    72,    72,    72,    72,    72,    72,    72,
584
      72,    72,    72,    72,    73,    72,    74,    72,    75,    72,
585
      76,    76,    77,    77,    78,    78,    78,    79,    72,    80,
586
      81,    81,    81,    82,    72,    72,    72,    72,    72,    72,
587
      72,    72,    72,    72,    72,    72,    72,    72,    72,    72,
588
      72,    72,    72,    72,    72,    72,    72,    72,    72,    72,
589
      72,    72,    72,    72,    72,    72,    72,    72,    72,    83,
590
      83,    84,    85,    85,    84,    84,    84,    86,    86,    86,
591
      86,    86,    86,    87,    87,    87,    87,    87,    88,    88,
592
      88,    88,    88,    89,    89,    90,    90,    91,    92,    92,
593
      92,    92,    92,    92,    92,    92,    92,    92,    92,    92,
594
      92,    92,    92,    92,    92,    92,    92,    92,    92,    92,
595
      92,    92,    92,    92,    93,    93,    93,    93,    94,    94,
596
      95,    95,    95,    95,    95,    96,    96
597
};
598
 
599
/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
600
static const unsigned char yyr2[] =
601
{
602
       0,     2,     1,     1,     1,     1,     3,     2,     2,     2,
603
       2,     2,     2,     2,     2,     2,     2,     3,     3,     4,
604
       3,     3,     4,     4,     0,     5,     0,     5,     0,     5,
605
       1,     1,     1,     2,     3,     2,     2,     0,     5,     1,
606
       0,     1,     3,     1,     3,     4,     4,     3,     3,     3,
607
       3,     3,     3,     3,     3,     3,     3,     3,     3,     3,
608
       3,     3,     3,     3,     3,     3,     3,     5,     3,     3,
609
       1,     1,     1,     1,     1,     1,     4,     1,     1,     1,
610
       3,     3,     3,     4,     1,     2,     1,     1,     2,     2,
611
       2,     3,     3,     1,     2,     1,     2,     1,     3,     2,
612
       1,     2,     1,     2,     3,     2,     3,     1,     1,     1,
613
       1,     1,     1,     2,     3,     2,     3,     3,     4,     2,
614
       3,     1,     2,     2,     2,     2,     2,     2,     1,     2,
615
       1,     5,     2,     2,     1,     1,     1,     1,     1,     3,
616
       1,     1,     1,     1,     1,     1,     1
617
};
618
 
619
/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
620
   STATE-NUM when YYTABLE doesn't specify something else to do.  Zero
621
   means the default is an error.  */
622
static const unsigned char yydefact[] =
623
{
624
       0,    70,    72,    77,    78,    75,   145,   108,   109,    71,
625
       0,     0,     0,     0,     0,   128,     0,     0,   130,   111,
626
     112,   110,     0,     0,   121,    74,     0,     0,     0,     0,
627
       0,     0,     0,   146,     0,     0,    39,     0,     3,     2,
628
       5,    40,     0,    73,    84,   107,     4,    87,    86,   140,
629
     142,   143,   144,   141,   123,   124,   125,   126,     0,    16,
630
       0,   134,   136,   137,   135,   127,    85,     0,   136,   137,
631
     129,   115,   113,   122,   119,   132,   133,     8,     9,     7,
632
      13,    12,    24,    26,    28,     0,     0,    10,    11,     1,
633
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
634
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
635
       0,     0,     0,    15,    14,     0,     0,    37,     0,    41,
636
       0,     0,     0,     0,    88,    89,    95,    93,     0,     0,
637
      90,    97,   100,   102,     0,   117,   114,   120,     0,   116,
638
       0,     0,     0,    47,     0,     6,    69,    68,     0,    66,
639
      65,    64,    63,    62,    57,    56,    60,    61,    59,    58,
640
      55,    54,    48,    52,    53,    49,    50,    51,   142,   143,
641
       0,    21,    20,     0,    40,     0,    18,    17,     0,    43,
642
      44,     0,    81,     0,    82,    91,    92,    96,    94,     0,
643
     103,   105,     0,   138,    87,     0,     0,    99,   101,    76,
644
     118,     0,     0,     0,     0,    31,    32,    30,     0,     0,
645
      46,     0,    22,    23,     0,    19,    42,    45,    83,   104,
646
      98,     0,   106,   131,    36,    35,    25,    33,     0,     0,
647
      27,    29,    67,    38,   139,    34
648
};
649
 
650
/* YYDEFGOTO[NTERM-NUM]. */
651
static const short yydefgoto[] =
652
{
653
      -1,    37,    38,    85,    40,   140,   141,   142,   204,   205,
654
     206,   174,    41,   120,   180,    42,    43,    44,    45,   130,
655
     131,   132,   133,   193,    60,    65,   195,   207,    48
656
};
657
 
658
/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
659
   STATE-NUM.  */
660
#define YYPACT_NINF -86
661
static const short yypact[] =
662
{
663
     220,   -86,   -86,   -86,   -86,   -86,   -86,   -86,   -86,   -86,
664
      19,    19,    19,    19,   284,    28,    19,    19,   118,    16,
665
      -9,   -86,   240,   240,   -86,   -86,   220,   220,   220,   220,
666
     220,   348,   220,     8,   220,   220,   -86,    44,   -86,    23,
667
     573,   220,    91,   -86,   -86,   -86,   -86,   119,   -86,   -86,
668
     -86,   -86,   -86,   -86,   -86,   -86,   -86,   -86,   220,   129,
669
      93,   -86,    47,    88,   -86,   -86,   -86,    73,   -86,   -86,
670
     -86,   100,   -86,   -86,   -86,   -86,   -86,   129,   129,   129,
671
     129,   129,    97,   108,   573,   -20,    63,   129,   129,   -86,
672
     220,   220,   220,   220,   220,   220,   220,   220,   220,   220,
673
     220,   220,   220,   220,   220,   220,   220,   220,   220,   220,
674
     220,   220,   220,   -86,   -86,   491,   220,   -86,   511,   573,
675
     -21,    69,    19,   112,    -3,    -3,    -3,    -3,    -1,   433,
676
     -86,    50,   -86,   -86,    78,   122,   -86,   -86,   240,   -86,
677
      95,    95,    95,   -86,   220,   573,   573,   573,   540,   625,
678
     649,   672,   694,   715,   734,   734,   157,   157,   157,   157,
679
     267,   267,   331,   496,   496,   129,   129,   129,    97,   108,
680
     220,   -86,   -86,     4,   220,   220,   -86,   -86,   220,   -86,
681
     -86,   220,   132,    19,   -86,   -86,   -86,   -86,   -86,    84,
682
     -86,   -86,    86,   -86,   123,   -17,    51,   -86,   -86,   412,
683
     -86,   110,   220,   220,    90,    95,   -86,    92,    99,   103,
684
     129,   220,   129,   -86,   -16,   129,   573,   129,   -86,   -86,
685
     -86,   240,   -86,   -86,   573,   573,   -86,   -86,    92,   220,
686
     -86,   -86,   600,   -86,   -86,   573
687
};
688
 
689
/* YYPGOTO[NTERM-NUM].  */
690
static const short yypgoto[] =
691
{
692
     -86,   -86,   -86,     3,   -10,   -86,   -86,   -86,   -85,   -86,
693
     -51,   -86,   -86,   -11,    37,   -86,   -86,   -79,   -86,     6,
694
     -86,    36,    39,     1,     0,   161,   -86,    -5,   -86
695
};
696
 
697
/* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
698
   positive, shift that token.  If negative, reduce the rule which
699
   number is the opposite.  If zero, do what YYDEFACT says.
700
   If YYTABLE_NINF, syntax error.  */
701
#define YYTABLE_NINF -110
702
static const short yytable[] =
703
{
704
      47,    46,   189,    39,    59,    54,    55,    56,    57,   178,
705
      90,    66,    67,   221,   178,    74,    77,    78,    79,    80,
706
      81,    84,    75,    76,    87,    88,   -79,    49,    50,    51,
707
      52,   119,    47,    86,    90,   126,   171,    61,    71,   176,
708
      72,    47,   121,    73,    89,   143,   179,   127,   222,   233,
709
      62,    63,    64,    90,   128,   129,   208,   209,    47,   134,
710
       7,     8,   190,    10,    11,    12,    13,   213,    15,   135,
711
      17,   136,    18,    19,    20,    21,    22,    23,    24,    53,
712
     145,   146,   147,   148,   149,   150,   151,   152,   153,   154,
713
     155,   156,   157,   158,   159,   160,   161,   162,   163,   164,
714
     165,   166,   167,    49,    50,    51,    52,   128,   196,   122,
715
     172,   123,   137,   177,   138,  -108,   191,   182,   184,   173,
716
      49,    50,    51,    52,   139,   202,  -109,    61,   144,   194,
717
     185,   186,   187,   188,   210,   192,   179,   123,   194,   201,
718
      68,    69,    64,   199,   124,   125,   200,   219,   124,   125,
719
     -80,   220,   223,   226,   227,    53,   229,   126,   181,   203,
720
     212,   126,   230,   214,   119,   215,   231,   197,   216,   127,
721
     198,   217,    53,   127,   183,     0,   128,   129,   218,    70,
722
     128,   129,   113,   114,     0,   115,   116,   117,   118,   210,
723
       0,     0,   224,   225,     0,     0,   194,     0,     0,     0,
724
     228,   232,   105,   106,   107,   108,   109,   110,   111,   112,
725
     113,   114,     0,   115,   116,   117,   118,     0,     0,   235,
726
       0,   194,   234,     1,     2,     3,     4,     5,     6,     7,
727
       8,     9,    10,    11,    12,    13,    14,    15,    16,    17,
728
       0,    18,    19,    20,    21,    22,    23,    24,    25,     7,
729
       8,     0,    10,    11,    12,    13,     0,    15,    26,    17,
730
       0,    18,    19,    20,    21,    22,    23,    24,     0,    27,
731
      28,     0,     0,    29,    30,     0,     0,    31,    32,     0,
732
      33,    34,    35,     0,     0,     0,    36,     1,     2,     3,
733
       4,     5,     6,     7,     8,     9,    10,    11,    12,    13,
734
      14,    15,    16,    17,     0,    18,    19,    20,    21,    22,
735
      23,    24,    25,     0,   107,   108,   109,   110,   111,   112,
736
     113,   114,    26,   115,   116,   117,   118,     0,     0,     0,
737
       0,     0,     0,    27,    28,     0,     0,    29,    30,     0,
738
       0,    31,    58,     0,    33,    34,    35,     0,     0,     0,
739
      36,     1,     2,     3,     4,     5,     6,    82,    83,     9,
740
      10,    11,    12,    13,    14,    15,    16,    17,     0,    18,
741
      19,    20,    21,    22,    23,    24,    25,     0,     0,   108,
742
     109,   110,   111,   112,   113,   114,    26,   115,   116,   117,
743
     118,     0,     0,     0,     0,     0,     0,    27,    28,     0,
744
       0,    29,    30,     0,     0,    31,    32,     0,    33,    34,
745
      35,     0,     0,     0,    36,     1,     2,     3,     4,     5,
746
       6,     7,     8,     9,    10,    11,    12,    13,    14,    15,
747
      16,    17,     0,    18,    19,    20,    21,    22,    23,    24,
748
      25,     0,     7,     8,     0,    10,    11,    12,    13,     0,
749
      15,     0,    17,     0,    18,    19,    20,    21,    22,    23,
750
      24,     0,     0,     0,     0,    29,    30,     0,     0,    31,
751
      32,   126,    33,    34,    35,     0,     0,     0,    36,     0,
752
       0,     0,     0,   127,     0,     0,     0,     0,     0,     0,
753
     128,   129,     0,     0,     0,     0,     0,     0,   191,    49,
754
     168,   169,    52,    10,    11,    12,    13,     0,    15,     0,
755
      17,     0,    18,    19,    20,    21,    22,    23,    24,    49,
756
     168,   169,    52,    10,    11,    12,    13,     0,    15,     0,
757
      17,     0,    18,    19,    20,    21,    22,    23,    24,     0,
758
       0,   170,     0,     0,     0,     0,   110,   111,   112,   113,
759
     114,    53,   115,   116,   117,   118,     0,     0,     0,     0,
760
       0,   175,     0,     0,     0,     0,     0,     0,     0,    91,
761
       0,    53,    92,    93,    94,    95,    96,    97,    98,    99,
762
     100,   101,   102,   103,   104,   105,   106,   107,   108,   109,
763
     110,   111,   112,   113,   114,     0,   115,   116,   117,   118,
764
       0,     0,    91,     0,   211,    92,    93,    94,    95,    96,
765
      97,    98,    99,   100,   101,   102,   103,   104,   105,   106,
766
     107,   108,   109,   110,   111,   112,   113,   114,     0,   115,
767
     116,   117,   118,    93,    94,    95,    96,    97,    98,    99,
768
     100,   101,   102,   103,   104,   105,   106,   107,   108,   109,
769
     110,   111,   112,   113,   114,     0,   115,   116,   117,   118,
770
      95,    96,    97,    98,    99,   100,   101,   102,   103,   104,
771
     105,   106,   107,   108,   109,   110,   111,   112,   113,   114,
772
       0,   115,   116,   117,   118,    96,    97,    98,    99,   100,
773
     101,   102,   103,   104,   105,   106,   107,   108,   109,   110,
774
     111,   112,   113,   114,     0,   115,   116,   117,   118,    97,
775
      98,    99,   100,   101,   102,   103,   104,   105,   106,   107,
776
     108,   109,   110,   111,   112,   113,   114,     0,   115,   116,
777
     117,   118,    98,    99,   100,   101,   102,   103,   104,   105,
778
     106,   107,   108,   109,   110,   111,   112,   113,   114,     0,
779
     115,   116,   117,   118,    99,   100,   101,   102,   103,   104,
780
     105,   106,   107,   108,   109,   110,   111,   112,   113,   114,
781
       0,   115,   116,   117,   118,   101,   102,   103,   104,   105,
782
     106,   107,   108,   109,   110,   111,   112,   113,   114,     0,
783
     115,   116,   117,   118
784
};
785
 
786
static const short yycheck[] =
787
{
788
       0,     0,     3,     0,    14,    10,    11,    12,    13,    30,
789
      30,    16,    17,    30,    30,    24,    26,    27,    28,    29,
790
      30,    31,    22,    23,    34,    35,    18,     8,     9,    10,
791
      11,    41,    32,    32,    30,    38,   115,     9,    22,   118,
792
      24,    41,    41,    27,     0,    65,    67,    50,    65,    65,
793
      22,    23,    24,    30,    57,    58,   141,   142,    58,    58,
794
       9,    10,    63,    12,    13,    14,    15,    63,    17,    22,
795
      19,    24,    21,    22,    23,    24,    25,    26,    27,    60,
796
      90,    91,    92,    93,    94,    95,    96,    97,    98,    99,
797
     100,   101,   102,   103,   104,   105,   106,   107,   108,   109,
798
     110,   111,   112,     8,     9,    10,    11,    57,    58,    18,
799
     115,    18,    24,   118,    41,    18,    65,   122,   123,   116,
800
       8,     9,    10,    11,    24,    30,    18,     9,    65,   129,
801
     124,   125,   126,   127,   144,   129,    67,    18,   138,   138,
802
      22,    23,    24,    65,    25,    26,    24,    63,    25,    26,
803
      18,    65,    42,    63,   205,    60,    64,    38,   121,    64,
804
     170,    38,    63,   174,   174,   175,    63,   131,   178,    50,
805
     131,   181,    60,    50,    62,    -1,    57,    58,   183,    18,
806
      57,    58,    53,    54,    -1,    56,    57,    58,    59,   199,
807
      -1,    -1,   202,   203,    -1,    -1,   196,    -1,    -1,    -1,
808
     205,   211,    45,    46,    47,    48,    49,    50,    51,    52,
809
      53,    54,    -1,    56,    57,    58,    59,    -1,    -1,   229,
810
      -1,   221,   221,     3,     4,     5,     6,     7,     8,     9,
811
      10,    11,    12,    13,    14,    15,    16,    17,    18,    19,
812
      -1,    21,    22,    23,    24,    25,    26,    27,    28,     9,
813
      10,    -1,    12,    13,    14,    15,    -1,    17,    38,    19,
814
      -1,    21,    22,    23,    24,    25,    26,    27,    -1,    49,
815
      50,    -1,    -1,    53,    54,    -1,    -1,    57,    58,    -1,
816
      60,    61,    62,    -1,    -1,    -1,    66,     3,     4,     5,
817
       6,     7,     8,     9,    10,    11,    12,    13,    14,    15,
818
      16,    17,    18,    19,    -1,    21,    22,    23,    24,    25,
819
      26,    27,    28,    -1,    47,    48,    49,    50,    51,    52,
820
      53,    54,    38,    56,    57,    58,    59,    -1,    -1,    -1,
821
      -1,    -1,    -1,    49,    50,    -1,    -1,    53,    54,    -1,
822
      -1,    57,    58,    -1,    60,    61,    62,    -1,    -1,    -1,
823
      66,     3,     4,     5,     6,     7,     8,     9,    10,    11,
824
      12,    13,    14,    15,    16,    17,    18,    19,    -1,    21,
825
      22,    23,    24,    25,    26,    27,    28,    -1,    -1,    48,
826
      49,    50,    51,    52,    53,    54,    38,    56,    57,    58,
827
      59,    -1,    -1,    -1,    -1,    -1,    -1,    49,    50,    -1,
828
      -1,    53,    54,    -1,    -1,    57,    58,    -1,    60,    61,
829
      62,    -1,    -1,    -1,    66,     3,     4,     5,     6,     7,
830
       8,     9,    10,    11,    12,    13,    14,    15,    16,    17,
831
      18,    19,    -1,    21,    22,    23,    24,    25,    26,    27,
832
      28,    -1,     9,    10,    -1,    12,    13,    14,    15,    -1,
833
      17,    -1,    19,    -1,    21,    22,    23,    24,    25,    26,
834
      27,    -1,    -1,    -1,    -1,    53,    54,    -1,    -1,    57,
835
      58,    38,    60,    61,    62,    -1,    -1,    -1,    66,    -1,
836
      -1,    -1,    -1,    50,    -1,    -1,    -1,    -1,    -1,    -1,
837
      57,    58,    -1,    -1,    -1,    -1,    -1,    -1,    65,     8,
838
       9,    10,    11,    12,    13,    14,    15,    -1,    17,    -1,
839
      19,    -1,    21,    22,    23,    24,    25,    26,    27,     8,
840
       9,    10,    11,    12,    13,    14,    15,    -1,    17,    -1,
841
      19,    -1,    21,    22,    23,    24,    25,    26,    27,    -1,
842
      -1,    50,    -1,    -1,    -1,    -1,    50,    51,    52,    53,
843
      54,    60,    56,    57,    58,    59,    -1,    -1,    -1,    -1,
844
      -1,    50,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    29,
845
      -1,    60,    32,    33,    34,    35,    36,    37,    38,    39,
846
      40,    41,    42,    43,    44,    45,    46,    47,    48,    49,
847
      50,    51,    52,    53,    54,    -1,    56,    57,    58,    59,
848
      -1,    -1,    29,    -1,    64,    32,    33,    34,    35,    36,
849
      37,    38,    39,    40,    41,    42,    43,    44,    45,    46,
850
      47,    48,    49,    50,    51,    52,    53,    54,    -1,    56,
851
      57,    58,    59,    33,    34,    35,    36,    37,    38,    39,
852
      40,    41,    42,    43,    44,    45,    46,    47,    48,    49,
853
      50,    51,    52,    53,    54,    -1,    56,    57,    58,    59,
854
      35,    36,    37,    38,    39,    40,    41,    42,    43,    44,
855
      45,    46,    47,    48,    49,    50,    51,    52,    53,    54,
856
      -1,    56,    57,    58,    59,    36,    37,    38,    39,    40,
857
      41,    42,    43,    44,    45,    46,    47,    48,    49,    50,
858
      51,    52,    53,    54,    -1,    56,    57,    58,    59,    37,
859
      38,    39,    40,    41,    42,    43,    44,    45,    46,    47,
860
      48,    49,    50,    51,    52,    53,    54,    -1,    56,    57,
861
      58,    59,    38,    39,    40,    41,    42,    43,    44,    45,
862
      46,    47,    48,    49,    50,    51,    52,    53,    54,    -1,
863
      56,    57,    58,    59,    39,    40,    41,    42,    43,    44,
864
      45,    46,    47,    48,    49,    50,    51,    52,    53,    54,
865
      -1,    56,    57,    58,    59,    41,    42,    43,    44,    45,
866
      46,    47,    48,    49,    50,    51,    52,    53,    54,    -1,
867
      56,    57,    58,    59
868
};
869
 
870
/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
871
   symbol of state STATE-NUM.  */
872
static const unsigned char yystos[] =
873
{
874
       0,     3,     4,     5,     6,     7,     8,     9,    10,    11,
875
      12,    13,    14,    15,    16,    17,    18,    19,    21,    22,
876
      23,    24,    25,    26,    27,    28,    38,    49,    50,    53,
877
      54,    57,    58,    60,    61,    62,    66,    69,    70,    71,
878
      72,    80,    83,    84,    85,    86,    91,    92,    96,     8,
879
       9,    10,    11,    60,    95,    95,    95,    95,    58,    72,
880
      92,     9,    22,    23,    24,    93,    95,    95,    22,    23,
881
      93,    22,    24,    27,    24,    92,    92,    72,    72,    72,
882
      72,    72,     9,    10,    72,    71,    91,    72,    72,     0,
883
      30,    29,    32,    33,    34,    35,    36,    37,    38,    39,
884
      40,    41,    42,    43,    44,    45,    46,    47,    48,    49,
885
      50,    51,    52,    53,    54,    56,    57,    58,    59,    72,
886
      81,    91,    18,    18,    25,    26,    38,    50,    57,    58,
887
      87,    88,    89,    90,    91,    22,    24,    24,    41,    24,
888
      73,    74,    75,    65,    65,    72,    72,    72,    72,    72,
889
      72,    72,    72,    72,    72,    72,    72,    72,    72,    72,
890
      72,    72,    72,    72,    72,    72,    72,    72,     9,    10,
891
      50,    85,    95,    71,    79,    50,    85,    95,    30,    67,
892
      82,    82,    95,    62,    95,    87,    87,    87,    87,     3,
893
      63,    65,    87,    91,    92,    94,    58,    89,    90,    65,
894
      24,    91,    30,    64,    76,    77,    78,    95,    76,    76,
895
      72,    64,    72,    63,    81,    72,    72,    72,    95,    63,
896
      65,    30,    65,    42,    72,    72,    63,    78,    95,    64,
897
      63,    63,    72,    65,    91,    72
898
};
899
 
900
#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
901
# define YYSIZE_T __SIZE_TYPE__
902
#endif
903
#if ! defined (YYSIZE_T) && defined (size_t)
904
# define YYSIZE_T size_t
905
#endif
906
#if ! defined (YYSIZE_T)
907
# if defined (__STDC__) || defined (__cplusplus)
908
#  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
909
#  define YYSIZE_T size_t
910
# endif
911
#endif
912
#if ! defined (YYSIZE_T)
913
# define YYSIZE_T unsigned int
914
#endif
915
 
916
#define yyerrok         (yyerrstatus = 0)
917
#define yyclearin       (yychar = YYEMPTY)
918
#define YYEMPTY         (-2)
919
#define YYEOF           0
920
 
921
#define YYACCEPT        goto yyacceptlab
922
#define YYABORT         goto yyabortlab
923
#define YYERROR         goto yyerrorlab
924
 
925
 
926
/* Like YYERROR except do call yyerror.  This remains here temporarily
927
   to ease the transition to the new meaning of YYERROR, for GCC.
928
   Once GCC version 2 has supplanted version 1, this can go.  */
929
 
930
#define YYFAIL          goto yyerrlab
931
 
932
#define YYRECOVERING()  (!!yyerrstatus)
933
 
934
#define YYBACKUP(Token, Value)                                  \
935
do                                                              \
936
  if (yychar == YYEMPTY && yylen == 1)                          \
937
    {                                                           \
938
      yychar = (Token);                                         \
939
      yylval = (Value);                                         \
940
      yytoken = YYTRANSLATE (yychar);                           \
941
      YYPOPSTACK;                                               \
942
      goto yybackup;                                            \
943
    }                                                           \
944
  else                                                          \
945
    {                                                           \
946
      yyerror ("syntax error: cannot back up");\
947
      YYERROR;                                                  \
948
    }                                                           \
949
while (0)
950
 
951
#define YYTERROR        1
952
#define YYERRCODE       256
953
 
954
/* YYLLOC_DEFAULT -- Compute the default location (before the actions
955
   are run).  */
956
 
957
#ifndef YYLLOC_DEFAULT
958
# define YYLLOC_DEFAULT(Current, Rhs, N)                \
959
   ((Current).first_line   = (Rhs)[1].first_line,       \
960
    (Current).first_column = (Rhs)[1].first_column,     \
961
    (Current).last_line    = (Rhs)[N].last_line,        \
962
    (Current).last_column  = (Rhs)[N].last_column)
963
#endif
964
 
965
/* YYLEX -- calling `yylex' with the right arguments.  */
966
 
967
#ifdef YYLEX_PARAM
968
# define YYLEX yylex (YYLEX_PARAM)
969
#else
970
# define YYLEX yylex ()
971
#endif
972
 
973
/* Enable debugging if requested.  */
974
#if YYDEBUG
975
 
976
# ifndef YYFPRINTF
977
#  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
978
#  define YYFPRINTF fprintf
979
# endif
980
 
981
# define YYDPRINTF(Args)                        \
982
do {                                            \
983
  if (yydebug)                                  \
984
    YYFPRINTF Args;                             \
985
} while (0)
986
 
987
# define YYDSYMPRINT(Args)                      \
988
do {                                            \
989
  if (yydebug)                                  \
990
    yysymprint Args;                            \
991
} while (0)
992
 
993
# define YYDSYMPRINTF(Title, Token, Value, Location)            \
994
do {                                                            \
995
  if (yydebug)                                                  \
996
    {                                                           \
997
      YYFPRINTF (stderr, "%s ", Title);                         \
998
      yysymprint (stderr,                                       \
999
                  Token, Value);        \
1000
      YYFPRINTF (stderr, "\n");                                 \
1001
    }                                                           \
1002
} while (0)
1003
 
1004
/*------------------------------------------------------------------.
1005
| yy_stack_print -- Print the state stack from its BOTTOM up to its |
1006
| TOP (included).                                                   |
1007
`------------------------------------------------------------------*/
1008
 
1009
#if defined (__STDC__) || defined (__cplusplus)
1010
static void
1011
yy_stack_print (short *bottom, short *top)
1012
#else
1013
static void
1014
yy_stack_print (bottom, top)
1015
    short *bottom;
1016
    short *top;
1017
#endif
1018
{
1019
  YYFPRINTF (stderr, "Stack now");
1020
  for (/* Nothing. */; bottom <= top; ++bottom)
1021
    YYFPRINTF (stderr, " %d", *bottom);
1022
  YYFPRINTF (stderr, "\n");
1023
}
1024
 
1025
# define YY_STACK_PRINT(Bottom, Top)                            \
1026
do {                                                            \
1027
  if (yydebug)                                                  \
1028
    yy_stack_print ((Bottom), (Top));                           \
1029
} while (0)
1030
 
1031
 
1032
/*------------------------------------------------.
1033
| Report that the YYRULE is going to be reduced.  |
1034
`------------------------------------------------*/
1035
 
1036
#if defined (__STDC__) || defined (__cplusplus)
1037
static void
1038
yy_reduce_print (int yyrule)
1039
#else
1040
static void
1041
yy_reduce_print (yyrule)
1042
    int yyrule;
1043
#endif
1044
{
1045
  int yyi;
1046
  unsigned int yylno = yyrline[yyrule];
1047
  YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ",
1048
             yyrule - 1, yylno);
1049
  /* Print the symbols being reduced, and their result.  */
1050
  for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
1051
    YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]);
1052
  YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]);
1053
}
1054
 
1055
# define YY_REDUCE_PRINT(Rule)          \
1056
do {                                    \
1057
  if (yydebug)                          \
1058
    yy_reduce_print (Rule);             \
1059
} while (0)
1060
 
1061
/* Nonzero means print parse trace.  It is left uninitialized so that
1062
   multiple parsers can coexist.  */
1063
int yydebug;
1064
#else /* !YYDEBUG */
1065
# define YYDPRINTF(Args)
1066
# define YYDSYMPRINT(Args)
1067
# define YYDSYMPRINTF(Title, Token, Value, Location)
1068
# define YY_STACK_PRINT(Bottom, Top)
1069
# define YY_REDUCE_PRINT(Rule)
1070
#endif /* !YYDEBUG */
1071
 
1072
 
1073
/* YYINITDEPTH -- initial size of the parser's stacks.  */
1074
#ifndef YYINITDEPTH
1075
# define YYINITDEPTH 200
1076
#endif
1077
 
1078
/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1079
   if the built-in stack extension method is used).
1080
 
1081
   Do not make this value too large; the results are undefined if
1082
   SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
1083
   evaluated with infinite-precision integer arithmetic.  */
1084
 
1085
#if defined (YYMAXDEPTH) && YYMAXDEPTH == 0
1086
# undef YYMAXDEPTH
1087
#endif
1088
 
1089
#ifndef YYMAXDEPTH
1090
# define YYMAXDEPTH 10000
1091
#endif
1092
 
1093
 
1094
 
1095
#if YYERROR_VERBOSE
1096
 
1097
# ifndef yystrlen
1098
#  if defined (__GLIBC__) && defined (_STRING_H)
1099
#   define yystrlen strlen
1100
#  else
1101
/* Return the length of YYSTR.  */
1102
static YYSIZE_T
1103
#   if defined (__STDC__) || defined (__cplusplus)
1104
yystrlen (const char *yystr)
1105
#   else
1106
yystrlen (yystr)
1107
     const char *yystr;
1108
#   endif
1109
{
1110
  register const char *yys = yystr;
1111
 
1112
  while (*yys++ != '\0')
1113
    continue;
1114
 
1115
  return yys - yystr - 1;
1116
}
1117
#  endif
1118
# endif
1119
 
1120
# ifndef yystpcpy
1121
#  if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
1122
#   define yystpcpy stpcpy
1123
#  else
1124
/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1125
   YYDEST.  */
1126
static char *
1127
#   if defined (__STDC__) || defined (__cplusplus)
1128
yystpcpy (char *yydest, const char *yysrc)
1129
#   else
1130
yystpcpy (yydest, yysrc)
1131
     char *yydest;
1132
     const char *yysrc;
1133
#   endif
1134
{
1135
  register char *yyd = yydest;
1136
  register const char *yys = yysrc;
1137
 
1138
  while ((*yyd++ = *yys++) != '\0')
1139
    continue;
1140
 
1141
  return yyd - 1;
1142
}
1143
#  endif
1144
# endif
1145
 
1146
#endif /* !YYERROR_VERBOSE */
1147
 
1148
 
1149
 
1150
#if YYDEBUG
1151
/*--------------------------------.
1152
| Print this symbol on YYOUTPUT.  |
1153
`--------------------------------*/
1154
 
1155
#if defined (__STDC__) || defined (__cplusplus)
1156
static void
1157
yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
1158
#else
1159
static void
1160
yysymprint (yyoutput, yytype, yyvaluep)
1161
    FILE *yyoutput;
1162
    int yytype;
1163
    YYSTYPE *yyvaluep;
1164
#endif
1165
{
1166
  /* Pacify ``unused variable'' warnings.  */
1167
  (void) yyvaluep;
1168
 
1169
  if (yytype < YYNTOKENS)
1170
    {
1171
      YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
1172
# ifdef YYPRINT
1173
      YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
1174
# endif
1175
    }
1176
  else
1177
    YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
1178
 
1179
  switch (yytype)
1180
    {
1181
      default:
1182
        break;
1183
    }
1184
  YYFPRINTF (yyoutput, ")");
1185
}
1186
 
1187
#endif /* ! YYDEBUG */
1188
/*-----------------------------------------------.
1189
| Release the memory associated to this symbol.  |
1190
`-----------------------------------------------*/
1191
 
1192
#if defined (__STDC__) || defined (__cplusplus)
1193
static void
1194
yydestruct (int yytype, YYSTYPE *yyvaluep)
1195
#else
1196
static void
1197
yydestruct (yytype, yyvaluep)
1198
    int yytype;
1199
    YYSTYPE *yyvaluep;
1200
#endif
1201
{
1202
  /* Pacify ``unused variable'' warnings.  */
1203
  (void) yyvaluep;
1204
 
1205
  switch (yytype)
1206
    {
1207
 
1208
      default:
1209
        break;
1210
    }
1211
}
1212
 
1213
 
1214
/* Prevent warnings from -Wmissing-prototypes.  */
1215
 
1216
#ifdef YYPARSE_PARAM
1217
# if defined (__STDC__) || defined (__cplusplus)
1218
int yyparse (void *YYPARSE_PARAM);
1219
# else
1220
int yyparse ();
1221
# endif
1222
#else /* ! YYPARSE_PARAM */
1223
#if defined (__STDC__) || defined (__cplusplus)
1224
int yyparse (void);
1225
#else
1226
int yyparse ();
1227
#endif
1228
#endif /* ! YYPARSE_PARAM */
1229
 
1230
 
1231
 
1232
/* The lookahead symbol.  */
1233
int yychar;
1234
 
1235
/* The semantic value of the lookahead symbol.  */
1236
YYSTYPE yylval;
1237
 
1238
/* Number of syntax errors so far.  */
1239
int yynerrs;
1240
 
1241
 
1242
 
1243
/*----------.
1244
| yyparse.  |
1245
`----------*/
1246
 
1247
#ifdef YYPARSE_PARAM
1248
# if defined (__STDC__) || defined (__cplusplus)
1249
int yyparse (void *YYPARSE_PARAM)
1250
# else
1251
int yyparse (YYPARSE_PARAM)
1252
  void *YYPARSE_PARAM;
1253
# endif
1254
#else /* ! YYPARSE_PARAM */
1255
#if defined (__STDC__) || defined (__cplusplus)
1256
int
1257
yyparse (void)
1258
#else
1259
int
1260
yyparse ()
1261
 
1262
#endif
1263
#endif
1264
{
1265
 
1266
  register int yystate;
1267
  register int yyn;
1268
  int yyresult;
1269
  /* Number of tokens to shift before error messages enabled.  */
1270
  int yyerrstatus;
1271
  /* Lookahead token as an internal (translated) token number.  */
1272
  int yytoken = 0;
1273
 
1274
  /* Three stacks and their tools:
1275
     `yyss': related to states,
1276
     `yyvs': related to semantic values,
1277
     `yyls': related to locations.
1278
 
1279
     Refer to the stacks thru separate pointers, to allow yyoverflow
1280
     to xreallocate them elsewhere.  */
1281
 
1282
  /* The state stack.  */
1283
  short yyssa[YYINITDEPTH];
1284
  short *yyss = yyssa;
1285
  register short *yyssp;
1286
 
1287
  /* The semantic value stack.  */
1288
  YYSTYPE yyvsa[YYINITDEPTH];
1289
  YYSTYPE *yyvs = yyvsa;
1290
  register YYSTYPE *yyvsp;
1291
 
1292
 
1293
 
1294
#define YYPOPSTACK   (yyvsp--, yyssp--)
1295
 
1296
  YYSIZE_T yystacksize = YYINITDEPTH;
1297
 
1298
  /* The variables used to return semantic value and location from the
1299
     action routines.  */
1300
  YYSTYPE yyval;
1301
 
1302
 
1303
  /* When reducing, the number of symbols on the RHS of the reduced
1304
     rule.  */
1305
  int yylen;
1306
 
1307
  YYDPRINTF ((stderr, "Starting parse\n"));
1308
 
1309
  yystate = 0;
1310
  yyerrstatus = 0;
1311
  yynerrs = 0;
1312
  yychar = YYEMPTY;             /* Cause a token to be read.  */
1313
 
1314
  /* Initialize stack pointers.
1315
     Waste one element of value and location stack
1316
     so that they stay on the same level as the state stack.
1317
     The wasted elements are never initialized.  */
1318
 
1319
  yyssp = yyss;
1320
  yyvsp = yyvs;
1321
 
1322
  goto yysetstate;
1323
 
1324
/*------------------------------------------------------------.
1325
| yynewstate -- Push a new state, which is found in yystate.  |
1326
`------------------------------------------------------------*/
1327
 yynewstate:
1328
  /* In all cases, when you get here, the value and location stacks
1329
     have just been pushed. so pushing a state here evens the stacks.
1330
     */
1331
  yyssp++;
1332
 
1333
 yysetstate:
1334
  *yyssp = yystate;
1335
 
1336
  if (yyss + yystacksize - 1 <= yyssp)
1337
    {
1338
      /* Get the current used size of the three stacks, in elements.  */
1339
      YYSIZE_T yysize = yyssp - yyss + 1;
1340
 
1341
#ifdef yyoverflow
1342
      {
1343
        /* Give user a chance to xreallocate the stack. Use copies of
1344
           these so that the &'s don't force the real ones into
1345
           memory.  */
1346
        YYSTYPE *yyvs1 = yyvs;
1347
        short *yyss1 = yyss;
1348
 
1349
 
1350
        /* Each stack pointer address is followed by the size of the
1351
           data in use in that stack, in bytes.  This used to be a
1352
           conditional around just the two extra args, but that might
1353
           be undefined if yyoverflow is a macro.  */
1354
        yyoverflow ("parser stack overflow",
1355
                    &yyss1, yysize * sizeof (*yyssp),
1356
                    &yyvs1, yysize * sizeof (*yyvsp),
1357
 
1358
                    &yystacksize);
1359
 
1360
        yyss = yyss1;
1361
        yyvs = yyvs1;
1362
      }
1363
#else /* no yyoverflow */
1364
# ifndef YYSTACK_RELOCATE
1365
      goto yyoverflowlab;
1366
# else
1367
      /* Extend the stack our own way.  */
1368
      if (YYMAXDEPTH <= yystacksize)
1369
        goto yyoverflowlab;
1370
      yystacksize *= 2;
1371
      if (YYMAXDEPTH < yystacksize)
1372
        yystacksize = YYMAXDEPTH;
1373
 
1374
      {
1375
        short *yyss1 = yyss;
1376
        union yyalloc *yyptr =
1377
          (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1378
        if (! yyptr)
1379
          goto yyoverflowlab;
1380
        YYSTACK_RELOCATE (yyss);
1381
        YYSTACK_RELOCATE (yyvs);
1382
 
1383
#  undef YYSTACK_RELOCATE
1384
        if (yyss1 != yyssa)
1385
          YYSTACK_FREE (yyss1);
1386
      }
1387
# endif
1388
#endif /* no yyoverflow */
1389
 
1390
      yyssp = yyss + yysize - 1;
1391
      yyvsp = yyvs + yysize - 1;
1392
 
1393
 
1394
      YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1395
                  (unsigned long int) yystacksize));
1396
 
1397
      if (yyss + yystacksize - 1 <= yyssp)
1398
        YYABORT;
1399
    }
1400
 
1401
  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1402
 
1403
  goto yybackup;
1404
 
1405
/*-----------.
1406
| yybackup.  |
1407
`-----------*/
1408
yybackup:
1409
 
1410
/* Do appropriate processing given the current state.  */
1411
/* Read a lookahead token if we need one and don't already have one.  */
1412
/* yyresume: */
1413
 
1414
  /* First try to decide what to do without reference to lookahead token.  */
1415
 
1416
  yyn = yypact[yystate];
1417
  if (yyn == YYPACT_NINF)
1418
    goto yydefault;
1419
 
1420
  /* Not known => get a lookahead token if don't already have one.  */
1421
 
1422
  /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol.  */
1423
  if (yychar == YYEMPTY)
1424
    {
1425
      YYDPRINTF ((stderr, "Reading a token: "));
1426
      yychar = YYLEX;
1427
    }
1428
 
1429
  if (yychar <= YYEOF)
1430
    {
1431
      yychar = yytoken = YYEOF;
1432
      YYDPRINTF ((stderr, "Now at end of input.\n"));
1433
    }
1434
  else
1435
    {
1436
      yytoken = YYTRANSLATE (yychar);
1437
      YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc);
1438
    }
1439
 
1440
  /* If the proper action on seeing token YYTOKEN is to reduce or to
1441
     detect an error, take that action.  */
1442
  yyn += yytoken;
1443
  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1444
    goto yydefault;
1445
  yyn = yytable[yyn];
1446
  if (yyn <= 0)
1447
    {
1448
      if (yyn == 0 || yyn == YYTABLE_NINF)
1449
        goto yyerrlab;
1450
      yyn = -yyn;
1451
      goto yyreduce;
1452
    }
1453
 
1454
  if (yyn == YYFINAL)
1455
    YYACCEPT;
1456
 
1457
  /* Shift the lookahead token.  */
1458
  YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken]));
1459
 
1460
  /* Discard the token being shifted unless it is eof.  */
1461
  if (yychar != YYEOF)
1462
    yychar = YYEMPTY;
1463
 
1464
  *++yyvsp = yylval;
1465
 
1466
 
1467
  /* Count tokens shifted since error; after three, turn off error
1468
     status.  */
1469
  if (yyerrstatus)
1470
    yyerrstatus--;
1471
 
1472
  yystate = yyn;
1473
  goto yynewstate;
1474
 
1475
 
1476
/*-----------------------------------------------------------.
1477
| yydefault -- do the default action for the current state.  |
1478
`-----------------------------------------------------------*/
1479
yydefault:
1480
  yyn = yydefact[yystate];
1481
  if (yyn == 0)
1482
    goto yyerrlab;
1483
  goto yyreduce;
1484
 
1485
 
1486
/*-----------------------------.
1487
| yyreduce -- Do a reduction.  |
1488
`-----------------------------*/
1489
yyreduce:
1490
  /* yyn is the number of a rule to reduce with.  */
1491
  yylen = yyr2[yyn];
1492
 
1493
  /* If YYLEN is nonzero, implement the default value of the action:
1494
     `$$ = $1'.
1495
 
1496
     Otherwise, the following line sets YYVAL to garbage.
1497
     This behavior is undocumented and Bison
1498
     users should not rely upon it.  Assigning to YYVAL
1499
     unconditionally makes the parser a bit smaller, and it avoids a
1500
     GCC warning that YYVAL may be used uninitialized.  */
1501
  yyval = yyvsp[1-yylen];
1502
 
1503
 
1504
  YY_REDUCE_PRINT (yyn);
1505
  switch (yyn)
1506
    {
1507
        case 4:
1508
#line 236 "objc-exp.y"
1509
    { write_exp_elt_opcode(OP_TYPE);
1510
                          write_exp_elt_type(yyvsp[0].tval);
1511
                          write_exp_elt_opcode(OP_TYPE);}
1512
    break;
1513
 
1514
  case 6:
1515
#line 244 "objc-exp.y"
1516
    { write_exp_elt_opcode (BINOP_COMMA); }
1517
    break;
1518
 
1519
  case 7:
1520
#line 249 "objc-exp.y"
1521
    { write_exp_elt_opcode (UNOP_IND); }
1522
    break;
1523
 
1524
  case 8:
1525
#line 253 "objc-exp.y"
1526
    { write_exp_elt_opcode (UNOP_ADDR); }
1527
    break;
1528
 
1529
  case 9:
1530
#line 257 "objc-exp.y"
1531
    { write_exp_elt_opcode (UNOP_NEG); }
1532
    break;
1533
 
1534
  case 10:
1535
#line 261 "objc-exp.y"
1536
    { write_exp_elt_opcode (UNOP_LOGICAL_NOT); }
1537
    break;
1538
 
1539
  case 11:
1540
#line 265 "objc-exp.y"
1541
    { write_exp_elt_opcode (UNOP_COMPLEMENT); }
1542
    break;
1543
 
1544
  case 12:
1545
#line 269 "objc-exp.y"
1546
    { write_exp_elt_opcode (UNOP_PREINCREMENT); }
1547
    break;
1548
 
1549
  case 13:
1550
#line 273 "objc-exp.y"
1551
    { write_exp_elt_opcode (UNOP_PREDECREMENT); }
1552
    break;
1553
 
1554
  case 14:
1555
#line 277 "objc-exp.y"
1556
    { write_exp_elt_opcode (UNOP_POSTINCREMENT); }
1557
    break;
1558
 
1559
  case 15:
1560
#line 281 "objc-exp.y"
1561
    { write_exp_elt_opcode (UNOP_POSTDECREMENT); }
1562
    break;
1563
 
1564
  case 16:
1565
#line 285 "objc-exp.y"
1566
    { write_exp_elt_opcode (UNOP_SIZEOF); }
1567
    break;
1568
 
1569
  case 17:
1570
#line 289 "objc-exp.y"
1571
    { write_exp_elt_opcode (STRUCTOP_PTR);
1572
                          write_exp_string (yyvsp[0].sval);
1573
                          write_exp_elt_opcode (STRUCTOP_PTR); }
1574
    break;
1575
 
1576
  case 18:
1577
#line 295 "objc-exp.y"
1578
    { /* exp->type::name becomes exp->*(&type::name) */
1579
                          /* Note: this doesn't work if name is a
1580
                             static member!  FIXME */
1581
                          write_exp_elt_opcode (UNOP_ADDR);
1582
                          write_exp_elt_opcode (STRUCTOP_MPTR); }
1583
    break;
1584
 
1585
  case 19:
1586
#line 302 "objc-exp.y"
1587
    { write_exp_elt_opcode (STRUCTOP_MPTR); }
1588
    break;
1589
 
1590
  case 20:
1591
#line 306 "objc-exp.y"
1592
    { write_exp_elt_opcode (STRUCTOP_STRUCT);
1593
                          write_exp_string (yyvsp[0].sval);
1594
                          write_exp_elt_opcode (STRUCTOP_STRUCT); }
1595
    break;
1596
 
1597
  case 21:
1598
#line 313 "objc-exp.y"
1599
    { /* exp.type::name becomes exp.*(&type::name) */
1600
                          /* Note: this doesn't work if name is a
1601
                             static member!  FIXME */
1602
                          write_exp_elt_opcode (UNOP_ADDR);
1603
                          write_exp_elt_opcode (STRUCTOP_MEMBER); }
1604
    break;
1605
 
1606
  case 22:
1607
#line 321 "objc-exp.y"
1608
    { write_exp_elt_opcode (STRUCTOP_MEMBER); }
1609
    break;
1610
 
1611
  case 23:
1612
#line 325 "objc-exp.y"
1613
    { write_exp_elt_opcode (BINOP_SUBSCRIPT); }
1614
    break;
1615
 
1616
  case 24:
1617
#line 333 "objc-exp.y"
1618
    {
1619
                          CORE_ADDR class;
1620
 
1621
                          class = lookup_objc_class (parse_gdbarch,
1622
                                                     copy_name (yyvsp[0].tsym.stoken));
1623
                          if (class == 0)
1624
                            error ("%s is not an ObjC Class",
1625
                                   copy_name (yyvsp[0].tsym.stoken));
1626
                          write_exp_elt_opcode (OP_LONG);
1627
                          write_exp_elt_type (parse_type->builtin_int);
1628
                          write_exp_elt_longcst ((LONGEST) class);
1629
                          write_exp_elt_opcode (OP_LONG);
1630
                          start_msglist();
1631
                        }
1632
    break;
1633
 
1634
  case 25:
1635
#line 348 "objc-exp.y"
1636
    { write_exp_elt_opcode (OP_OBJC_MSGCALL);
1637
                          end_msglist();
1638
                          write_exp_elt_opcode (OP_OBJC_MSGCALL);
1639
                        }
1640
    break;
1641
 
1642
  case 26:
1643
#line 355 "objc-exp.y"
1644
    {
1645
                          write_exp_elt_opcode (OP_LONG);
1646
                          write_exp_elt_type (parse_type->builtin_int);
1647
                          write_exp_elt_longcst ((LONGEST) yyvsp[0].class.class);
1648
                          write_exp_elt_opcode (OP_LONG);
1649
                          start_msglist();
1650
                        }
1651
    break;
1652
 
1653
  case 27:
1654
#line 363 "objc-exp.y"
1655
    { write_exp_elt_opcode (OP_OBJC_MSGCALL);
1656
                          end_msglist();
1657
                          write_exp_elt_opcode (OP_OBJC_MSGCALL);
1658
                        }
1659
    break;
1660
 
1661
  case 28:
1662
#line 370 "objc-exp.y"
1663
    { start_msglist(); }
1664
    break;
1665
 
1666
  case 29:
1667
#line 372 "objc-exp.y"
1668
    { write_exp_elt_opcode (OP_OBJC_MSGCALL);
1669
                          end_msglist();
1670
                          write_exp_elt_opcode (OP_OBJC_MSGCALL);
1671
                        }
1672
    break;
1673
 
1674
  case 30:
1675
#line 379 "objc-exp.y"
1676
    { add_msglist(&yyvsp[0].sval, 0); }
1677
    break;
1678
 
1679
  case 34:
1680
#line 388 "objc-exp.y"
1681
    { add_msglist(&yyvsp[-2].sval, 1); }
1682
    break;
1683
 
1684
  case 35:
1685
#line 390 "objc-exp.y"
1686
    { add_msglist(0, 1);   }
1687
    break;
1688
 
1689
  case 36:
1690
#line 392 "objc-exp.y"
1691
    { add_msglist(0, 0);   }
1692
    break;
1693
 
1694
  case 37:
1695
#line 398 "objc-exp.y"
1696
    { start_arglist (); }
1697
    break;
1698
 
1699
  case 38:
1700
#line 400 "objc-exp.y"
1701
    { write_exp_elt_opcode (OP_FUNCALL);
1702
                          write_exp_elt_longcst ((LONGEST) end_arglist ());
1703
                          write_exp_elt_opcode (OP_FUNCALL); }
1704
    break;
1705
 
1706
  case 39:
1707
#line 406 "objc-exp.y"
1708
    { start_arglist (); }
1709
    break;
1710
 
1711
  case 41:
1712
#line 413 "objc-exp.y"
1713
    { arglist_len = 1; }
1714
    break;
1715
 
1716
  case 42:
1717
#line 417 "objc-exp.y"
1718
    { arglist_len++; }
1719
    break;
1720
 
1721
  case 43:
1722
#line 421 "objc-exp.y"
1723
    { yyval.lval = end_arglist () - 1; }
1724
    break;
1725
 
1726
  case 44:
1727
#line 424 "objc-exp.y"
1728
    { write_exp_elt_opcode (OP_ARRAY);
1729
                          write_exp_elt_longcst ((LONGEST) 0);
1730
                          write_exp_elt_longcst ((LONGEST) yyvsp[0].lval);
1731
                          write_exp_elt_opcode (OP_ARRAY); }
1732
    break;
1733
 
1734
  case 45:
1735
#line 431 "objc-exp.y"
1736
    { write_exp_elt_opcode (UNOP_MEMVAL);
1737
                          write_exp_elt_type (yyvsp[-2].tval);
1738
                          write_exp_elt_opcode (UNOP_MEMVAL); }
1739
    break;
1740
 
1741
  case 46:
1742
#line 437 "objc-exp.y"
1743
    { write_exp_elt_opcode (UNOP_CAST);
1744
                          write_exp_elt_type (yyvsp[-2].tval);
1745
                          write_exp_elt_opcode (UNOP_CAST); }
1746
    break;
1747
 
1748
  case 47:
1749
#line 443 "objc-exp.y"
1750
    { }
1751
    break;
1752
 
1753
  case 48:
1754
#line 449 "objc-exp.y"
1755
    { write_exp_elt_opcode (BINOP_REPEAT); }
1756
    break;
1757
 
1758
  case 49:
1759
#line 453 "objc-exp.y"
1760
    { write_exp_elt_opcode (BINOP_MUL); }
1761
    break;
1762
 
1763
  case 50:
1764
#line 457 "objc-exp.y"
1765
    { write_exp_elt_opcode (BINOP_DIV); }
1766
    break;
1767
 
1768
  case 51:
1769
#line 461 "objc-exp.y"
1770
    { write_exp_elt_opcode (BINOP_REM); }
1771
    break;
1772
 
1773
  case 52:
1774
#line 465 "objc-exp.y"
1775
    { write_exp_elt_opcode (BINOP_ADD); }
1776
    break;
1777
 
1778
  case 53:
1779
#line 469 "objc-exp.y"
1780
    { write_exp_elt_opcode (BINOP_SUB); }
1781
    break;
1782
 
1783
  case 54:
1784
#line 473 "objc-exp.y"
1785
    { write_exp_elt_opcode (BINOP_LSH); }
1786
    break;
1787
 
1788
  case 55:
1789
#line 477 "objc-exp.y"
1790
    { write_exp_elt_opcode (BINOP_RSH); }
1791
    break;
1792
 
1793
  case 56:
1794
#line 481 "objc-exp.y"
1795
    { write_exp_elt_opcode (BINOP_EQUAL); }
1796
    break;
1797
 
1798
  case 57:
1799
#line 485 "objc-exp.y"
1800
    { write_exp_elt_opcode (BINOP_NOTEQUAL); }
1801
    break;
1802
 
1803
  case 58:
1804
#line 489 "objc-exp.y"
1805
    { write_exp_elt_opcode (BINOP_LEQ); }
1806
    break;
1807
 
1808
  case 59:
1809
#line 493 "objc-exp.y"
1810
    { write_exp_elt_opcode (BINOP_GEQ); }
1811
    break;
1812
 
1813
  case 60:
1814
#line 497 "objc-exp.y"
1815
    { write_exp_elt_opcode (BINOP_LESS); }
1816
    break;
1817
 
1818
  case 61:
1819
#line 501 "objc-exp.y"
1820
    { write_exp_elt_opcode (BINOP_GTR); }
1821
    break;
1822
 
1823
  case 62:
1824
#line 505 "objc-exp.y"
1825
    { write_exp_elt_opcode (BINOP_BITWISE_AND); }
1826
    break;
1827
 
1828
  case 63:
1829
#line 509 "objc-exp.y"
1830
    { write_exp_elt_opcode (BINOP_BITWISE_XOR); }
1831
    break;
1832
 
1833
  case 64:
1834
#line 513 "objc-exp.y"
1835
    { write_exp_elt_opcode (BINOP_BITWISE_IOR); }
1836
    break;
1837
 
1838
  case 65:
1839
#line 517 "objc-exp.y"
1840
    { write_exp_elt_opcode (BINOP_LOGICAL_AND); }
1841
    break;
1842
 
1843
  case 66:
1844
#line 521 "objc-exp.y"
1845
    { write_exp_elt_opcode (BINOP_LOGICAL_OR); }
1846
    break;
1847
 
1848
  case 67:
1849
#line 525 "objc-exp.y"
1850
    { write_exp_elt_opcode (TERNOP_COND); }
1851
    break;
1852
 
1853
  case 68:
1854
#line 529 "objc-exp.y"
1855
    { write_exp_elt_opcode (BINOP_ASSIGN); }
1856
    break;
1857
 
1858
  case 69:
1859
#line 533 "objc-exp.y"
1860
    { write_exp_elt_opcode (BINOP_ASSIGN_MODIFY);
1861
                          write_exp_elt_opcode (yyvsp[-1].opcode);
1862
                          write_exp_elt_opcode (BINOP_ASSIGN_MODIFY); }
1863
    break;
1864
 
1865
  case 70:
1866
#line 539 "objc-exp.y"
1867
    { write_exp_elt_opcode (OP_LONG);
1868
                          write_exp_elt_type (yyvsp[0].typed_val_int.type);
1869
                          write_exp_elt_longcst ((LONGEST)(yyvsp[0].typed_val_int.val));
1870
                          write_exp_elt_opcode (OP_LONG); }
1871
    break;
1872
 
1873
  case 71:
1874
#line 546 "objc-exp.y"
1875
    { YYSTYPE val;
1876
                          parse_number (yyvsp[0].ssym.stoken.ptr, yyvsp[0].ssym.stoken.length, 0, &val);
1877
                          write_exp_elt_opcode (OP_LONG);
1878
                          write_exp_elt_type (val.typed_val_int.type);
1879
                          write_exp_elt_longcst ((LONGEST)val.typed_val_int.val);
1880
                          write_exp_elt_opcode (OP_LONG);
1881
                        }
1882
    break;
1883
 
1884
  case 72:
1885
#line 557 "objc-exp.y"
1886
    { write_exp_elt_opcode (OP_DOUBLE);
1887
                          write_exp_elt_type (yyvsp[0].typed_val_float.type);
1888
                          write_exp_elt_dblcst (yyvsp[0].typed_val_float.dval);
1889
                          write_exp_elt_opcode (OP_DOUBLE); }
1890
    break;
1891
 
1892
  case 75:
1893
#line 571 "objc-exp.y"
1894
    {
1895
                          write_exp_elt_opcode (OP_OBJC_SELECTOR);
1896
                          write_exp_string (yyvsp[0].sval);
1897
                          write_exp_elt_opcode (OP_OBJC_SELECTOR); }
1898
    break;
1899
 
1900
  case 76:
1901
#line 578 "objc-exp.y"
1902
    { write_exp_elt_opcode (OP_LONG);
1903
                          write_exp_elt_type (parse_type->builtin_int);
1904
                          CHECK_TYPEDEF (yyvsp[-1].tval);
1905
                          write_exp_elt_longcst ((LONGEST) TYPE_LENGTH (yyvsp[-1].tval));
1906
                          write_exp_elt_opcode (OP_LONG); }
1907
    break;
1908
 
1909
  case 77:
1910
#line 586 "objc-exp.y"
1911
    { /* C strings are converted into array
1912
                             constants with an explicit null byte
1913
                             added at the end.  Thus the array upper
1914
                             bound is the string length.  There is no
1915
                             such thing in C as a completely empty
1916
                             string.  */
1917
                          char *sp = yyvsp[0].sval.ptr; int count = yyvsp[0].sval.length;
1918
                          while (count-- > 0)
1919
                            {
1920
                              write_exp_elt_opcode (OP_LONG);
1921
                              write_exp_elt_type (parse_type->builtin_char);
1922
                              write_exp_elt_longcst ((LONGEST)(*sp++));
1923
                              write_exp_elt_opcode (OP_LONG);
1924
                            }
1925
                          write_exp_elt_opcode (OP_LONG);
1926
                          write_exp_elt_type (parse_type->builtin_char);
1927
                          write_exp_elt_longcst ((LONGEST)'\0');
1928
                          write_exp_elt_opcode (OP_LONG);
1929
                          write_exp_elt_opcode (OP_ARRAY);
1930
                          write_exp_elt_longcst ((LONGEST) 0);
1931
                          write_exp_elt_longcst ((LONGEST) (yyvsp[0].sval.length));
1932
                          write_exp_elt_opcode (OP_ARRAY); }
1933
    break;
1934
 
1935
  case 78:
1936
#line 613 "objc-exp.y"
1937
    { write_exp_elt_opcode (OP_OBJC_NSSTRING);
1938
                          write_exp_string (yyvsp[0].sval);
1939
                          write_exp_elt_opcode (OP_OBJC_NSSTRING); }
1940
    break;
1941
 
1942
  case 79:
1943
#line 619 "objc-exp.y"
1944
    {
1945
                          if (yyvsp[0].ssym.sym != 0)
1946
                              yyval.bval = SYMBOL_BLOCK_VALUE (yyvsp[0].ssym.sym);
1947
                          else
1948
                            {
1949
                              struct symtab *tem =
1950
                                  lookup_symtab (copy_name (yyvsp[0].ssym.stoken));
1951
                              if (tem)
1952
                                yyval.bval = BLOCKVECTOR_BLOCK (BLOCKVECTOR (tem), STATIC_BLOCK);
1953
                              else
1954
                                error ("No file or function \"%s\".",
1955
                                       copy_name (yyvsp[0].ssym.stoken));
1956
                            }
1957
                        }
1958
    break;
1959
 
1960
  case 80:
1961
#line 636 "objc-exp.y"
1962
    { struct symbol *tem
1963
                            = lookup_symbol (copy_name (yyvsp[0].sval), yyvsp[-2].bval,
1964
                                             VAR_DOMAIN, (int *) NULL);
1965
                          if (!tem || SYMBOL_CLASS (tem) != LOC_BLOCK)
1966
                            error ("No function \"%s\" in specified context.",
1967
                                   copy_name (yyvsp[0].sval));
1968
                          yyval.bval = SYMBOL_BLOCK_VALUE (tem); }
1969
    break;
1970
 
1971
  case 81:
1972
#line 646 "objc-exp.y"
1973
    { struct symbol *sym;
1974
                          sym = lookup_symbol (copy_name (yyvsp[0].sval), yyvsp[-2].bval,
1975
                                               VAR_DOMAIN, (int *) NULL);
1976
                          if (sym == 0)
1977
                            error ("No symbol \"%s\" in specified context.",
1978
                                   copy_name (yyvsp[0].sval));
1979
 
1980
                          write_exp_elt_opcode (OP_VAR_VALUE);
1981
                          /* block_found is set by lookup_symbol.  */
1982
                          write_exp_elt_block (block_found);
1983
                          write_exp_elt_sym (sym);
1984
                          write_exp_elt_opcode (OP_VAR_VALUE); }
1985
    break;
1986
 
1987
  case 82:
1988
#line 661 "objc-exp.y"
1989
    {
1990
                          struct type *type = yyvsp[-2].tval;
1991
                          if (TYPE_CODE (type) != TYPE_CODE_STRUCT
1992
                              && TYPE_CODE (type) != TYPE_CODE_UNION)
1993
                            error ("`%s' is not defined as an aggregate type.",
1994
                                   TYPE_NAME (type));
1995
 
1996
                          write_exp_elt_opcode (OP_SCOPE);
1997
                          write_exp_elt_type (type);
1998
                          write_exp_string (yyvsp[0].sval);
1999
                          write_exp_elt_opcode (OP_SCOPE);
2000
                        }
2001
    break;
2002
 
2003
  case 83:
2004
#line 674 "objc-exp.y"
2005
    {
2006
                          struct type *type = yyvsp[-3].tval;
2007
                          struct stoken tmp_token;
2008
                          if (TYPE_CODE (type) != TYPE_CODE_STRUCT
2009
                              && TYPE_CODE (type) != TYPE_CODE_UNION)
2010
                            error ("`%s' is not defined as an aggregate type.",
2011
                                   TYPE_NAME (type));
2012
 
2013
                          if (strcmp (type_name_no_tag (type), yyvsp[0].sval.ptr) != 0)
2014
                            error ("invalid destructor `%s::~%s'",
2015
                                   type_name_no_tag (type), yyvsp[0].sval.ptr);
2016
 
2017
                          tmp_token.ptr = (char*) alloca (yyvsp[0].sval.length + 2);
2018
                          tmp_token.length = yyvsp[0].sval.length + 1;
2019
                          tmp_token.ptr[0] = '~';
2020
                          memcpy (tmp_token.ptr+1, yyvsp[0].sval.ptr, yyvsp[0].sval.length);
2021
                          tmp_token.ptr[tmp_token.length] = 0;
2022
                          write_exp_elt_opcode (OP_SCOPE);
2023
                          write_exp_elt_type (type);
2024
                          write_exp_string (tmp_token);
2025
                          write_exp_elt_opcode (OP_SCOPE);
2026
                        }
2027
    break;
2028
 
2029
  case 85:
2030
#line 700 "objc-exp.y"
2031
    {
2032
                          char *name = copy_name (yyvsp[0].sval);
2033
                          struct symbol *sym;
2034
                          struct minimal_symbol *msymbol;
2035
 
2036
                          sym =
2037
                            lookup_symbol (name, (const struct block *) NULL,
2038
                                           VAR_DOMAIN, (int *) NULL);
2039
                          if (sym)
2040
                            {
2041
                              write_exp_elt_opcode (OP_VAR_VALUE);
2042
                              write_exp_elt_block (NULL);
2043
                              write_exp_elt_sym (sym);
2044
                              write_exp_elt_opcode (OP_VAR_VALUE);
2045
                              break;
2046
                            }
2047
 
2048
                          msymbol = lookup_minimal_symbol (name, NULL, NULL);
2049
                          if (msymbol != NULL)
2050
                            write_exp_msymbol (msymbol);
2051
                          else if (!have_full_symbols () && !have_partial_symbols ())
2052
                            error ("No symbol table is loaded.  Use the \"file\" command.");
2053
                          else
2054
                            error ("No symbol \"%s\" in current context.", name);
2055
                        }
2056
    break;
2057
 
2058
  case 86:
2059
#line 728 "objc-exp.y"
2060
    { struct symbol *sym = yyvsp[0].ssym.sym;
2061
 
2062
                          if (sym)
2063
                            {
2064
                              if (symbol_read_needs_frame (sym))
2065
                                {
2066
                                  if (innermost_block == 0 ||
2067
                                      contained_in (block_found,
2068
                                                    innermost_block))
2069
                                    innermost_block = block_found;
2070
                                }
2071
 
2072
                              write_exp_elt_opcode (OP_VAR_VALUE);
2073
                              /* We want to use the selected frame, not
2074
                                 another more inner frame which happens to
2075
                                 be in the same block.  */
2076
                              write_exp_elt_block (NULL);
2077
                              write_exp_elt_sym (sym);
2078
                              write_exp_elt_opcode (OP_VAR_VALUE);
2079
                            }
2080
                          else if (yyvsp[0].ssym.is_a_field_of_this)
2081
                            {
2082
                              /* C++/ObjC: it hangs off of `this'/'self'.
2083
                                 Must not inadvertently convert from a
2084
                                 method call to data ref.  */
2085
                              if (innermost_block == 0 ||
2086
                                  contained_in (block_found, innermost_block))
2087
                                innermost_block = block_found;
2088
                              write_exp_elt_opcode (OP_OBJC_SELF);
2089
                              write_exp_elt_opcode (OP_OBJC_SELF);
2090
                              write_exp_elt_opcode (STRUCTOP_PTR);
2091
                              write_exp_string (yyvsp[0].ssym.stoken);
2092
                              write_exp_elt_opcode (STRUCTOP_PTR);
2093
                            }
2094
                          else
2095
                            {
2096
                              struct minimal_symbol *msymbol;
2097
                              char *arg = copy_name (yyvsp[0].ssym.stoken);
2098
 
2099
                              msymbol =
2100
                                lookup_minimal_symbol (arg, NULL, NULL);
2101
                              if (msymbol != NULL)
2102
                                write_exp_msymbol (msymbol);
2103
                              else if (!have_full_symbols () &&
2104
                                       !have_partial_symbols ())
2105
                                error ("No symbol table is loaded.  Use the \"file\" command.");
2106
                              else
2107
                                error ("No symbol \"%s\" in current context.",
2108
                                       copy_name (yyvsp[0].ssym.stoken));
2109
                            }
2110
                        }
2111
    break;
2112
 
2113
  case 90:
2114
#line 791 "objc-exp.y"
2115
    { yyval.tval = follow_types (yyvsp[-1].tval); }
2116
    break;
2117
 
2118
  case 91:
2119
#line 793 "objc-exp.y"
2120
    { yyval.tval = follow_types (yyvsp[-2].tval); }
2121
    break;
2122
 
2123
  case 92:
2124
#line 795 "objc-exp.y"
2125
    { yyval.tval = follow_types (yyvsp[-2].tval); }
2126
    break;
2127
 
2128
  case 93:
2129
#line 799 "objc-exp.y"
2130
    { push_type (tp_pointer); yyval.voidval = 0; }
2131
    break;
2132
 
2133
  case 94:
2134
#line 801 "objc-exp.y"
2135
    { push_type (tp_pointer); yyval.voidval = yyvsp[0].voidval; }
2136
    break;
2137
 
2138
  case 95:
2139
#line 803 "objc-exp.y"
2140
    { push_type (tp_reference); yyval.voidval = 0; }
2141
    break;
2142
 
2143
  case 96:
2144
#line 805 "objc-exp.y"
2145
    { push_type (tp_reference); yyval.voidval = yyvsp[0].voidval; }
2146
    break;
2147
 
2148
  case 98:
2149
#line 810 "objc-exp.y"
2150
    { yyval.voidval = yyvsp[-1].voidval; }
2151
    break;
2152
 
2153
  case 99:
2154
#line 812 "objc-exp.y"
2155
    {
2156
                          push_type_int (yyvsp[0].lval);
2157
                          push_type (tp_array);
2158
                        }
2159
    break;
2160
 
2161
  case 100:
2162
#line 817 "objc-exp.y"
2163
    {
2164
                          push_type_int (yyvsp[0].lval);
2165
                          push_type (tp_array);
2166
                          yyval.voidval = 0;
2167
                        }
2168
    break;
2169
 
2170
  case 101:
2171
#line 824 "objc-exp.y"
2172
    { push_type (tp_function); }
2173
    break;
2174
 
2175
  case 102:
2176
#line 826 "objc-exp.y"
2177
    { push_type (tp_function); }
2178
    break;
2179
 
2180
  case 103:
2181
#line 830 "objc-exp.y"
2182
    { yyval.lval = -1; }
2183
    break;
2184
 
2185
  case 104:
2186
#line 832 "objc-exp.y"
2187
    { yyval.lval = yyvsp[-1].typed_val_int.val; }
2188
    break;
2189
 
2190
  case 105:
2191
#line 836 "objc-exp.y"
2192
    { yyval.voidval = 0; }
2193
    break;
2194
 
2195
  case 106:
2196
#line 838 "objc-exp.y"
2197
    { xfree (yyvsp[-1].tvec); yyval.voidval = 0; }
2198
    break;
2199
 
2200
  case 108:
2201
#line 854 "objc-exp.y"
2202
    { yyval.tval = yyvsp[0].tsym.type; }
2203
    break;
2204
 
2205
  case 109:
2206
#line 856 "objc-exp.y"
2207
    {
2208
                          if (yyvsp[0].class.type == NULL)
2209
                            error ("No symbol \"%s\" in current context.",
2210
                                   copy_name(yyvsp[0].class.stoken));
2211
                          else
2212
                            yyval.tval = yyvsp[0].class.type;
2213
                        }
2214
    break;
2215
 
2216
  case 110:
2217
#line 864 "objc-exp.y"
2218
    { yyval.tval = parse_type->builtin_int; }
2219
    break;
2220
 
2221
  case 111:
2222
#line 866 "objc-exp.y"
2223
    { yyval.tval = parse_type->builtin_long; }
2224
    break;
2225
 
2226
  case 112:
2227
#line 868 "objc-exp.y"
2228
    { yyval.tval = parse_type->builtin_short; }
2229
    break;
2230
 
2231
  case 113:
2232
#line 870 "objc-exp.y"
2233
    { yyval.tval = parse_type->builtin_long; }
2234
    break;
2235
 
2236
  case 114:
2237
#line 872 "objc-exp.y"
2238
    { yyval.tval = parse_type->builtin_unsigned_long; }
2239
    break;
2240
 
2241
  case 115:
2242
#line 874 "objc-exp.y"
2243
    { yyval.tval = parse_type->builtin_long_long; }
2244
    break;
2245
 
2246
  case 116:
2247
#line 876 "objc-exp.y"
2248
    { yyval.tval = parse_type->builtin_long_long; }
2249
    break;
2250
 
2251
  case 117:
2252
#line 878 "objc-exp.y"
2253
    { yyval.tval = parse_type->builtin_unsigned_long_long; }
2254
    break;
2255
 
2256
  case 118:
2257
#line 880 "objc-exp.y"
2258
    { yyval.tval = parse_type->builtin_unsigned_long_long; }
2259
    break;
2260
 
2261
  case 119:
2262
#line 882 "objc-exp.y"
2263
    { yyval.tval = parse_type->builtin_short; }
2264
    break;
2265
 
2266
  case 120:
2267
#line 884 "objc-exp.y"
2268
    { yyval.tval = parse_type->builtin_unsigned_short; }
2269
    break;
2270
 
2271
  case 121:
2272
#line 886 "objc-exp.y"
2273
    { yyval.tval = parse_type->builtin_double; }
2274
    break;
2275
 
2276
  case 122:
2277
#line 888 "objc-exp.y"
2278
    { yyval.tval = parse_type->builtin_long_double; }
2279
    break;
2280
 
2281
  case 123:
2282
#line 890 "objc-exp.y"
2283
    { yyval.tval = lookup_struct (copy_name (yyvsp[0].sval),
2284
                                              expression_context_block); }
2285
    break;
2286
 
2287
  case 124:
2288
#line 893 "objc-exp.y"
2289
    { yyval.tval = lookup_struct (copy_name (yyvsp[0].sval),
2290
                                              expression_context_block); }
2291
    break;
2292
 
2293
  case 125:
2294
#line 896 "objc-exp.y"
2295
    { yyval.tval = lookup_union (copy_name (yyvsp[0].sval),
2296
                                             expression_context_block); }
2297
    break;
2298
 
2299
  case 126:
2300
#line 899 "objc-exp.y"
2301
    { yyval.tval = lookup_enum (copy_name (yyvsp[0].sval),
2302
                                            expression_context_block); }
2303
    break;
2304
 
2305
  case 127:
2306
#line 902 "objc-exp.y"
2307
    { yyval.tval = lookup_unsigned_typename (parse_language,
2308
                                                         parse_gdbarch,
2309
                                                         TYPE_NAME(yyvsp[0].tsym.type)); }
2310
    break;
2311
 
2312
  case 128:
2313
#line 906 "objc-exp.y"
2314
    { yyval.tval = parse_type->builtin_unsigned_int; }
2315
    break;
2316
 
2317
  case 129:
2318
#line 908 "objc-exp.y"
2319
    { yyval.tval = lookup_signed_typename (parse_language,
2320
                                                       parse_gdbarch,
2321
                                                       TYPE_NAME(yyvsp[0].tsym.type)); }
2322
    break;
2323
 
2324
  case 130:
2325
#line 912 "objc-exp.y"
2326
    { yyval.tval = parse_type->builtin_int; }
2327
    break;
2328
 
2329
  case 131:
2330
#line 914 "objc-exp.y"
2331
    { yyval.tval = lookup_template_type(copy_name(yyvsp[-3].sval), yyvsp[-1].tval,
2332
                                                    expression_context_block);
2333
                        }
2334
    break;
2335
 
2336
  case 132:
2337
#line 920 "objc-exp.y"
2338
    { yyval.tval = yyvsp[0].tval; }
2339
    break;
2340
 
2341
  case 133:
2342
#line 921 "objc-exp.y"
2343
    { yyval.tval = yyvsp[0].tval; }
2344
    break;
2345
 
2346
  case 135:
2347
#line 926 "objc-exp.y"
2348
    {
2349
                  yyval.tsym.stoken.ptr = "int";
2350
                  yyval.tsym.stoken.length = 3;
2351
                  yyval.tsym.type = parse_type->builtin_int;
2352
                }
2353
    break;
2354
 
2355
  case 136:
2356
#line 932 "objc-exp.y"
2357
    {
2358
                  yyval.tsym.stoken.ptr = "long";
2359
                  yyval.tsym.stoken.length = 4;
2360
                  yyval.tsym.type = parse_type->builtin_long;
2361
                }
2362
    break;
2363
 
2364
  case 137:
2365
#line 938 "objc-exp.y"
2366
    {
2367
                  yyval.tsym.stoken.ptr = "short";
2368
                  yyval.tsym.stoken.length = 5;
2369
                  yyval.tsym.type = parse_type->builtin_short;
2370
                }
2371
    break;
2372
 
2373
  case 138:
2374
#line 947 "objc-exp.y"
2375
    { yyval.tvec = (struct type **) xmalloc (sizeof (struct type *) * 2);
2376
                  yyval.ivec[0] = 1;     /* Number of types in vector.  */
2377
                  yyval.tvec[1] = yyvsp[0].tval;
2378
                }
2379
    break;
2380
 
2381
  case 139:
2382
#line 952 "objc-exp.y"
2383
    { int len = sizeof (struct type *) * (++(yyvsp[-2].ivec[0]) + 1);
2384
                  yyval.tvec = (struct type **) xrealloc ((char *) yyvsp[-2].tvec, len);
2385
                  yyval.tvec[yyval.ivec[0]] = yyvsp[0].tval;
2386
                }
2387
    break;
2388
 
2389
  case 140:
2390
#line 958 "objc-exp.y"
2391
    { yyval.sval = yyvsp[0].ssym.stoken; }
2392
    break;
2393
 
2394
  case 141:
2395
#line 959 "objc-exp.y"
2396
    { yyval.sval = yyvsp[0].ssym.stoken; }
2397
    break;
2398
 
2399
  case 142:
2400
#line 960 "objc-exp.y"
2401
    { yyval.sval = yyvsp[0].tsym.stoken; }
2402
    break;
2403
 
2404
  case 143:
2405
#line 961 "objc-exp.y"
2406
    { yyval.sval = yyvsp[0].class.stoken; }
2407
    break;
2408
 
2409
  case 144:
2410
#line 962 "objc-exp.y"
2411
    { yyval.sval = yyvsp[0].ssym.stoken; }
2412
    break;
2413
 
2414
 
2415
    }
2416
 
2417
/* Line 1000 of yacc.c.  */
2418
#line 2419 "objc-exp.c.tmp"
2419
 
2420
  yyvsp -= yylen;
2421
  yyssp -= yylen;
2422
 
2423
 
2424
  YY_STACK_PRINT (yyss, yyssp);
2425
 
2426
  *++yyvsp = yyval;
2427
 
2428
 
2429
  /* Now `shift' the result of the reduction.  Determine what state
2430
     that goes to, based on the state we popped back to and the rule
2431
     number reduced by.  */
2432
 
2433
  yyn = yyr1[yyn];
2434
 
2435
  yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
2436
  if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
2437
    yystate = yytable[yystate];
2438
  else
2439
    yystate = yydefgoto[yyn - YYNTOKENS];
2440
 
2441
  goto yynewstate;
2442
 
2443
 
2444
/*------------------------------------.
2445
| yyerrlab -- here on detecting error |
2446
`------------------------------------*/
2447
yyerrlab:
2448
  /* If not already recovering from an error, report this error.  */
2449
  if (!yyerrstatus)
2450
    {
2451
      ++yynerrs;
2452
#if YYERROR_VERBOSE
2453
      yyn = yypact[yystate];
2454
 
2455
      if (YYPACT_NINF < yyn && yyn < YYLAST)
2456
        {
2457
          YYSIZE_T yysize = 0;
2458
          int yytype = YYTRANSLATE (yychar);
2459
          const char* yyprefix;
2460
          char *yymsg;
2461
          int yyx;
2462
 
2463
          /* Start YYX at -YYN if negative to avoid negative indexes in
2464
             YYCHECK.  */
2465
          int yyxbegin = yyn < 0 ? -yyn : 0;
2466
 
2467
          /* Stay within bounds of both yycheck and yytname.  */
2468
          int yychecklim = YYLAST - yyn;
2469
          int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
2470
          int yycount = 0;
2471
 
2472
          yyprefix = ", expecting ";
2473
          for (yyx = yyxbegin; yyx < yyxend; ++yyx)
2474
            if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
2475
              {
2476
                yysize += yystrlen (yyprefix) + yystrlen (yytname [yyx]);
2477
                yycount += 1;
2478
                if (yycount == 5)
2479
                  {
2480
                    yysize = 0;
2481
                    break;
2482
                  }
2483
              }
2484
          yysize += (sizeof ("syntax error, unexpected ")
2485
                     + yystrlen (yytname[yytype]));
2486
          yymsg = (char *) YYSTACK_ALLOC (yysize);
2487
          if (yymsg != 0)
2488
            {
2489
              char *yyp = yystpcpy (yymsg, "syntax error, unexpected ");
2490
              yyp = yystpcpy (yyp, yytname[yytype]);
2491
 
2492
              if (yycount < 5)
2493
                {
2494
                  yyprefix = ", expecting ";
2495
                  for (yyx = yyxbegin; yyx < yyxend; ++yyx)
2496
                    if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
2497
                      {
2498
                        yyp = yystpcpy (yyp, yyprefix);
2499
                        yyp = yystpcpy (yyp, yytname[yyx]);
2500
                        yyprefix = " or ";
2501
                      }
2502
                }
2503
              yyerror (yymsg);
2504
              YYSTACK_FREE (yymsg);
2505
            }
2506
          else
2507
            yyerror ("syntax error; also virtual memory exhausted");
2508
        }
2509
      else
2510
#endif /* YYERROR_VERBOSE */
2511
        yyerror ("syntax error");
2512
    }
2513
 
2514
 
2515
 
2516
  if (yyerrstatus == 3)
2517
    {
2518
      /* If just tried and failed to reuse lookahead token after an
2519
         error, discard it.  */
2520
 
2521
      if (yychar <= YYEOF)
2522
        {
2523
          /* If at end of input, pop the error token,
2524
             then the rest of the stack, then return failure.  */
2525
          if (yychar == YYEOF)
2526
             for (;;)
2527
               {
2528
                 YYPOPSTACK;
2529
                 if (yyssp == yyss)
2530
                   YYABORT;
2531
                 YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
2532
                 yydestruct (yystos[*yyssp], yyvsp);
2533
               }
2534
        }
2535
      else
2536
        {
2537
          YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc);
2538
          yydestruct (yytoken, &yylval);
2539
          yychar = YYEMPTY;
2540
 
2541
        }
2542
    }
2543
 
2544
  /* Else will try to reuse lookahead token after shifting the error
2545
     token.  */
2546
  goto yyerrlab1;
2547
 
2548
 
2549
/*---------------------------------------------------.
2550
| yyerrorlab -- error raised explicitly by YYERROR.  |
2551
`---------------------------------------------------*/
2552
yyerrorlab:
2553
 
2554
#ifdef __GNUC__
2555
  /* Pacify GCC when the user code never invokes YYERROR and the label
2556
     yyerrorlab therefore never appears in user code.  */
2557
  if (0)
2558
     goto yyerrorlab;
2559
#endif
2560
 
2561
  yyvsp -= yylen;
2562
  yyssp -= yylen;
2563
  yystate = *yyssp;
2564
  goto yyerrlab1;
2565
 
2566
 
2567
/*-------------------------------------------------------------.
2568
| yyerrlab1 -- common code for both syntax error and YYERROR.  |
2569
`-------------------------------------------------------------*/
2570
yyerrlab1:
2571
  yyerrstatus = 3;      /* Each real token shifted decrements this.  */
2572
 
2573
  for (;;)
2574
    {
2575
      yyn = yypact[yystate];
2576
      if (yyn != YYPACT_NINF)
2577
        {
2578
          yyn += YYTERROR;
2579
          if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
2580
            {
2581
              yyn = yytable[yyn];
2582
              if (0 < yyn)
2583
                break;
2584
            }
2585
        }
2586
 
2587
      /* Pop the current state because it cannot handle the error token.  */
2588
      if (yyssp == yyss)
2589
        YYABORT;
2590
 
2591
      YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
2592
      yydestruct (yystos[yystate], yyvsp);
2593
      YYPOPSTACK;
2594
      yystate = *yyssp;
2595
      YY_STACK_PRINT (yyss, yyssp);
2596
    }
2597
 
2598
  if (yyn == YYFINAL)
2599
    YYACCEPT;
2600
 
2601
  YYDPRINTF ((stderr, "Shifting error token, "));
2602
 
2603
  *++yyvsp = yylval;
2604
 
2605
 
2606
  yystate = yyn;
2607
  goto yynewstate;
2608
 
2609
 
2610
/*-------------------------------------.
2611
| yyacceptlab -- YYACCEPT comes here.  |
2612
`-------------------------------------*/
2613
yyacceptlab:
2614
  yyresult = 0;
2615
  goto yyreturn;
2616
 
2617
/*-----------------------------------.
2618
| yyabortlab -- YYABORT comes here.  |
2619
`-----------------------------------*/
2620
yyabortlab:
2621
  yyresult = 1;
2622
  goto yyreturn;
2623
 
2624
#ifndef yyoverflow
2625
/*----------------------------------------------.
2626
| yyoverflowlab -- parser overflow comes here.  |
2627
`----------------------------------------------*/
2628
yyoverflowlab:
2629
  yyerror ("parser stack overflow");
2630
  yyresult = 2;
2631
  /* Fall through.  */
2632
#endif
2633
 
2634
yyreturn:
2635
#ifndef yyoverflow
2636
  if (yyss != yyssa)
2637
    YYSTACK_FREE (yyss);
2638
#endif
2639
  return yyresult;
2640
}
2641
 
2642
 
2643
#line 976 "objc-exp.y"
2644
 
2645
 
2646
/* Take care of parsing a number (anything that starts with a digit).
2647
   Set yylval and return the token type; update lexptr.  LEN is the
2648
   number of characters in it.  */
2649
 
2650
/*** Needs some error checking for the float case.  ***/
2651
 
2652
static int
2653
parse_number (p, len, parsed_float, putithere)
2654
     char *p;
2655
     int len;
2656
     int parsed_float;
2657
     YYSTYPE *putithere;
2658
{
2659
  /* FIXME: Shouldn't these be unsigned?  We don't deal with negative
2660
     values here, and we do kind of silly things like cast to
2661
     unsigned.  */
2662
  LONGEST n = 0;
2663
  LONGEST prevn = 0;
2664
  unsigned LONGEST un;
2665
 
2666
  int i = 0;
2667
  int c;
2668
  int base = input_radix;
2669
  int unsigned_p = 0;
2670
 
2671
  /* Number of "L" suffixes encountered.  */
2672
  int long_p = 0;
2673
 
2674
  /* We have found a "L" or "U" suffix.  */
2675
  int found_suffix = 0;
2676
 
2677
  unsigned LONGEST high_bit;
2678
  struct type *signed_type;
2679
  struct type *unsigned_type;
2680
 
2681
  if (parsed_float)
2682
    {
2683
      char c;
2684
 
2685
      /* It's a float since it contains a point or an exponent.  */
2686
 
2687
      sscanf (p, "%" DOUBLEST_SCAN_FORMAT "%c",
2688
              &putithere->typed_val_float.dval, &c);
2689
 
2690
      /* See if it has `f' or `l' suffix (float or long double).  */
2691
 
2692
      c = tolower (p[len - 1]);
2693
 
2694
      if (c == 'f')
2695
        putithere->typed_val_float.type = parse_type->builtin_float;
2696
      else if (c == 'l')
2697
        putithere->typed_val_float.type = parse_type->builtin_long_double;
2698
      else if (isdigit (c) || c == '.')
2699
        putithere->typed_val_float.type = parse_type->builtin_double;
2700
      else
2701
        return ERROR;
2702
 
2703
      return FLOAT;
2704
    }
2705
 
2706
  /* Handle base-switching prefixes 0x, 0t, 0d, and 0.  */
2707
  if (p[0] == '0')
2708
    switch (p[1])
2709
      {
2710
      case 'x':
2711
      case 'X':
2712
        if (len >= 3)
2713
          {
2714
            p += 2;
2715
            base = 16;
2716
            len -= 2;
2717
          }
2718
        break;
2719
 
2720
      case 't':
2721
      case 'T':
2722
      case 'd':
2723
      case 'D':
2724
        if (len >= 3)
2725
          {
2726
            p += 2;
2727
            base = 10;
2728
            len -= 2;
2729
          }
2730
        break;
2731
 
2732
      default:
2733
        base = 8;
2734
        break;
2735
      }
2736
 
2737
  while (len-- > 0)
2738
    {
2739
      c = *p++;
2740
      if (c >= 'A' && c <= 'Z')
2741
        c += 'a' - 'A';
2742
      if (c != 'l' && c != 'u')
2743
        n *= base;
2744
      if (c >= '0' && c <= '9')
2745
        {
2746
          if (found_suffix)
2747
            return ERROR;
2748
          n += i = c - '0';
2749
        }
2750
      else
2751
        {
2752
          if (base > 10 && c >= 'a' && c <= 'f')
2753
            {
2754
              if (found_suffix)
2755
                return ERROR;
2756
              n += i = c - 'a' + 10;
2757
            }
2758
          else if (c == 'l')
2759
            {
2760
              ++long_p;
2761
              found_suffix = 1;
2762
            }
2763
          else if (c == 'u')
2764
            {
2765
              unsigned_p = 1;
2766
              found_suffix = 1;
2767
            }
2768
          else
2769
            return ERROR;       /* Char not a digit.  */
2770
        }
2771
      if (i >= base)
2772
        return ERROR;           /* Invalid digit in this base.  */
2773
 
2774
      /* Portably test for overflow (only works for nonzero values, so
2775
         make a second check for zero).  FIXME: Can't we just make n
2776
         and prevn unsigned and avoid this?  */
2777
      if (c != 'l' && c != 'u' && (prevn >= n) && n != 0)
2778
        unsigned_p = 1;         /* Try something unsigned.  */
2779
 
2780
      /* Portably test for unsigned overflow.
2781
         FIXME: This check is wrong; for example it doesn't find
2782
         overflow on 0x123456789 when LONGEST is 32 bits.  */
2783
      if (c != 'l' && c != 'u' && n != 0)
2784
        {
2785
          if ((unsigned_p && (unsigned LONGEST) prevn >= (unsigned LONGEST) n))
2786
            error ("Numeric constant too large.");
2787
        }
2788
      prevn = n;
2789
    }
2790
 
2791
  /* An integer constant is an int, a long, or a long long.  An L
2792
     suffix forces it to be long; an LL suffix forces it to be long
2793
     long.  If not forced to a larger size, it gets the first type of
2794
     the above that it fits in.  To figure out whether it fits, we
2795
     shift it right and see whether anything remains.  Note that we
2796
     can't shift sizeof (LONGEST) * HOST_CHAR_BIT bits or more in one
2797
     operation, because many compilers will warn about such a shift
2798
     (which always produces a zero result).  Sometimes gdbarch_int_bit
2799
     or gdbarch_long_int will be that big, sometimes not.  To deal with
2800
     the case where it is we just always shift the value more than
2801
     once, with fewer bits each time.  */
2802
 
2803
  un = (unsigned LONGEST)n >> 2;
2804
  if (long_p == 0
2805
      && (un >> (gdbarch_int_bit (parse_gdbarch) - 2)) == 0)
2806
    {
2807
      high_bit = ((unsigned LONGEST)1) << (gdbarch_int_bit (parse_gdbarch) - 1);
2808
 
2809
      /* A large decimal (not hex or octal) constant (between INT_MAX
2810
         and UINT_MAX) is a long or unsigned long, according to ANSI,
2811
         never an unsigned int, but this code treats it as unsigned
2812
         int.  This probably should be fixed.  GCC gives a warning on
2813
         such constants.  */
2814
 
2815
      unsigned_type = parse_type->builtin_unsigned_int;
2816
      signed_type = parse_type->builtin_int;
2817
    }
2818
  else if (long_p <= 1
2819
           && (un >> (gdbarch_long_bit (parse_gdbarch) - 2)) == 0)
2820
    {
2821
      high_bit = ((unsigned LONGEST)1) << (gdbarch_long_bit (parse_gdbarch) - 1);
2822
      unsigned_type = parse_type->builtin_unsigned_long;
2823
      signed_type = parse_type->builtin_long;
2824
    }
2825
  else
2826
    {
2827
      high_bit = (((unsigned LONGEST)1)
2828
                  << (gdbarch_long_long_bit (parse_gdbarch) - 32 - 1)
2829
                  << 16
2830
                  << 16);
2831
      if (high_bit == 0)
2832
        /* A long long does not fit in a LONGEST.  */
2833
        high_bit =
2834
          (unsigned LONGEST)1 << (sizeof (LONGEST) * HOST_CHAR_BIT - 1);
2835
      unsigned_type = parse_type->builtin_unsigned_long_long;
2836
      signed_type = parse_type->builtin_long_long;
2837
    }
2838
 
2839
   putithere->typed_val_int.val = n;
2840
 
2841
   /* If the high bit of the worked out type is set then this number
2842
      has to be unsigned.  */
2843
 
2844
   if (unsigned_p || (n & high_bit))
2845
     {
2846
       putithere->typed_val_int.type = unsigned_type;
2847
     }
2848
   else
2849
     {
2850
       putithere->typed_val_int.type = signed_type;
2851
     }
2852
 
2853
   return INT;
2854
}
2855
 
2856
struct token
2857
{
2858
  char *operator;
2859
  int token;
2860
  enum exp_opcode opcode;
2861
};
2862
 
2863
static const struct token tokentab3[] =
2864
  {
2865
    {">>=", ASSIGN_MODIFY, BINOP_RSH},
2866
    {"<<=", ASSIGN_MODIFY, BINOP_LSH}
2867
  };
2868
 
2869
static const struct token tokentab2[] =
2870
  {
2871
    {"+=", ASSIGN_MODIFY, BINOP_ADD},
2872
    {"-=", ASSIGN_MODIFY, BINOP_SUB},
2873
    {"*=", ASSIGN_MODIFY, BINOP_MUL},
2874
    {"/=", ASSIGN_MODIFY, BINOP_DIV},
2875
    {"%=", ASSIGN_MODIFY, BINOP_REM},
2876
    {"|=", ASSIGN_MODIFY, BINOP_BITWISE_IOR},
2877
    {"&=", ASSIGN_MODIFY, BINOP_BITWISE_AND},
2878
    {"^=", ASSIGN_MODIFY, BINOP_BITWISE_XOR},
2879
    {"++", INCREMENT, BINOP_END},
2880
    {"--", DECREMENT, BINOP_END},
2881
    {"->", ARROW, BINOP_END},
2882
    {"&&", ANDAND, BINOP_END},
2883
    {"||", OROR, BINOP_END},
2884
    {"::", COLONCOLON, BINOP_END},
2885
    {"<<", LSH, BINOP_END},
2886
    {">>", RSH, BINOP_END},
2887
    {"==", EQUAL, BINOP_END},
2888
    {"!=", NOTEQUAL, BINOP_END},
2889
    {"<=", LEQ, BINOP_END},
2890
    {">=", GEQ, BINOP_END}
2891
  };
2892
 
2893
/* Read one token, getting characters through lexptr.  */
2894
 
2895
static int
2896
yylex ()
2897
{
2898
  int c, tokchr;
2899
  int namelen;
2900
  unsigned int i;
2901
  char *tokstart;
2902
  char *tokptr;
2903
  int tempbufindex;
2904
  static char *tempbuf;
2905
  static int tempbufsize;
2906
 
2907
 retry:
2908
 
2909
  tokstart = lexptr;
2910
  /* See if it is a special token of length 3.  */
2911
  for (i = 0; i < sizeof tokentab3 / sizeof tokentab3[0]; i++)
2912
    if (strncmp (tokstart, tokentab3[i].operator, 3) == 0)
2913
      {
2914
        lexptr += 3;
2915
        yylval.opcode = tokentab3[i].opcode;
2916
        return tokentab3[i].token;
2917
      }
2918
 
2919
  /* See if it is a special token of length 2.  */
2920
  for (i = 0; i < sizeof tokentab2 / sizeof tokentab2[0]; i++)
2921
    if (strncmp (tokstart, tokentab2[i].operator, 2) == 0)
2922
      {
2923
        lexptr += 2;
2924
        yylval.opcode = tokentab2[i].opcode;
2925
        return tokentab2[i].token;
2926
      }
2927
 
2928
  c = 0;
2929
  switch (tokchr = *tokstart)
2930
    {
2931
    case 0:
2932
      return 0;
2933
 
2934
    case ' ':
2935
    case '\t':
2936
    case '\n':
2937
      lexptr++;
2938
      goto retry;
2939
 
2940
    case '\'':
2941
      /* We either have a character constant ('0' or '\177' for
2942
         example) or we have a quoted symbol reference ('foo(int,int)'
2943
         in C++ for example).  */
2944
      lexptr++;
2945
      c = *lexptr++;
2946
      if (c == '\\')
2947
        c = parse_escape (&lexptr);
2948
      else if (c == '\'')
2949
        error ("Empty character constant.");
2950
 
2951
      yylval.typed_val_int.val = c;
2952
      yylval.typed_val_int.type = parse_type->builtin_char;
2953
 
2954
      c = *lexptr++;
2955
      if (c != '\'')
2956
        {
2957
          namelen = skip_quoted (tokstart) - tokstart;
2958
          if (namelen > 2)
2959
            {
2960
              lexptr = tokstart + namelen;
2961
              if (lexptr[-1] != '\'')
2962
                error ("Unmatched single quote.");
2963
              namelen -= 2;
2964
              tokstart++;
2965
              goto tryname;
2966
            }
2967
          error ("Invalid character constant.");
2968
        }
2969
      return INT;
2970
 
2971
    case '(':
2972
      paren_depth++;
2973
      lexptr++;
2974
      return '(';
2975
 
2976
    case ')':
2977
      if (paren_depth == 0)
2978
        return 0;
2979
      paren_depth--;
2980
      lexptr++;
2981
      return ')';
2982
 
2983
    case ',':
2984
      if (comma_terminates && paren_depth == 0)
2985
        return 0;
2986
      lexptr++;
2987
      return ',';
2988
 
2989
    case '.':
2990
      /* Might be a floating point number.  */
2991
      if (lexptr[1] < '0' || lexptr[1] > '9')
2992
        goto symbol;            /* Nope, must be a symbol.  */
2993
      /* FALL THRU into number case.  */
2994
 
2995
    case '0':
2996
    case '1':
2997
    case '2':
2998
    case '3':
2999
    case '4':
3000
    case '5':
3001
    case '6':
3002
    case '7':
3003
    case '8':
3004
    case '9':
3005
      {
3006
        /* It's a number.  */
3007
        int got_dot = 0, got_e = 0, toktype = FLOAT;
3008
        /* Initialize toktype to anything other than ERROR.  */
3009
        char *p = tokstart;
3010
        int hex = input_radix > 10;
3011
        int local_radix = input_radix;
3012
        if (tokchr == '0' && (p[1] == 'x' || p[1] == 'X'))
3013
          {
3014
            p += 2;
3015
            hex = 1;
3016
            local_radix = 16;
3017
          }
3018
        else if (tokchr == '0' && (p[1]=='t' || p[1]=='T' || p[1]=='d' || p[1]=='D'))
3019
          {
3020
            p += 2;
3021
            hex = 0;
3022
            local_radix = 10;
3023
          }
3024
 
3025
        for (;; ++p)
3026
          {
3027
            /* This test includes !hex because 'e' is a valid hex digit
3028
               and thus does not indicate a floating point number when
3029
               the radix is hex.  */
3030
 
3031
            if (!hex && (*p == 'e' || *p == 'E'))
3032
              if (got_e)
3033
                toktype = ERROR;        /* Only one 'e' in a float.  */
3034
              else
3035
                got_e = 1;
3036
            /* This test does not include !hex, because a '.' always
3037
               indicates a decimal floating point number regardless of
3038
               the radix.  */
3039
            else if (*p == '.')
3040
              if (got_dot)
3041
                toktype = ERROR;        /* Only one '.' in a float.  */
3042
              else
3043
                got_dot = 1;
3044
            else if (got_e && (p[-1] == 'e' || p[-1] == 'E') &&
3045
                    (*p == '-' || *p == '+'))
3046
              /* This is the sign of the exponent, not the end of the
3047
                 number.  */
3048
              continue;
3049
            /* Always take decimal digits; parse_number handles radix
3050
               error.  */
3051
            else if (*p >= '0' && *p <= '9')
3052
              continue;
3053
            /* We will take letters only if hex is true, and only up
3054
               to what the input radix would permit.  FSF was content
3055
               to rely on parse_number to validate; but it leaks.  */
3056
            else if (*p >= 'a' && *p <= 'z')
3057
              {
3058
                if (!hex || *p >= ('a' + local_radix - 10))
3059
                  toktype = ERROR;
3060
              }
3061
            else if (*p >= 'A' && *p <= 'Z')
3062
              {
3063
                if (!hex || *p >= ('A' + local_radix - 10))
3064
                  toktype = ERROR;
3065
              }
3066
            else break;
3067
          }
3068
        if (toktype != ERROR)
3069
          toktype = parse_number (tokstart, p - tokstart,
3070
                                  got_dot | got_e, &yylval);
3071
        if (toktype == ERROR)
3072
          {
3073
            char *err_copy = (char *) alloca (p - tokstart + 1);
3074
 
3075
            memcpy (err_copy, tokstart, p - tokstart);
3076
            err_copy[p - tokstart] = 0;
3077
            error ("Invalid number \"%s\".", err_copy);
3078
          }
3079
        lexptr = p;
3080
        return toktype;
3081
      }
3082
 
3083
    case '+':
3084
    case '-':
3085
    case '*':
3086
    case '/':
3087
    case '%':
3088
    case '|':
3089
    case '&':
3090
    case '^':
3091
    case '~':
3092
    case '!':
3093
#if 0
3094
    case '@':           /* Moved out below.  */
3095
#endif
3096
    case '<':
3097
    case '>':
3098
    case '[':
3099
    case ']':
3100
    case '?':
3101
    case ':':
3102
    case '=':
3103
    case '{':
3104
    case '}':
3105
    symbol:
3106
      lexptr++;
3107
      return tokchr;
3108
 
3109
    case '@':
3110
      if (strncmp(tokstart, "@selector", 9) == 0)
3111
        {
3112
          tokptr = strchr(tokstart, '(');
3113
          if (tokptr == NULL)
3114
            {
3115
              error ("Missing '(' in @selector(...)");
3116
            }
3117
          tempbufindex = 0;
3118
          tokptr++;     /* Skip the '('.  */
3119
          do {
3120
            /* Grow the static temp buffer if necessary, including
3121
               allocating the first one on demand.  */
3122
            if (tempbufindex + 1 >= tempbufsize)
3123
              {
3124
                tempbuf = (char *) xrealloc (tempbuf, tempbufsize += 64);
3125
              }
3126
            tempbuf[tempbufindex++] = *tokptr++;
3127
          } while ((*tokptr != ')') && (*tokptr != '\0'));
3128
          if (*tokptr++ != ')')
3129
            {
3130
              error ("Missing ')' in @selector(...)");
3131
            }
3132
          tempbuf[tempbufindex] = '\0';
3133
          yylval.sval.ptr = tempbuf;
3134
          yylval.sval.length = tempbufindex;
3135
          lexptr = tokptr;
3136
          return SELECTOR;
3137
        }
3138
      if (tokstart[1] != '"')
3139
        {
3140
          lexptr++;
3141
          return tokchr;
3142
        }
3143
      /* ObjC NextStep NSString constant: fall thru and parse like
3144
         STRING.  */
3145
      tokstart++;
3146
 
3147
    case '"':
3148
 
3149
      /* Build the gdb internal form of the input string in tempbuf,
3150
         translating any standard C escape forms seen.  Note that the
3151
         buffer is null byte terminated *only* for the convenience of
3152
         debugging gdb itself and printing the buffer contents when
3153
         the buffer contains no embedded nulls.  Gdb does not depend
3154
         upon the buffer being null byte terminated, it uses the
3155
         length string instead.  This allows gdb to handle C strings
3156
         (as well as strings in other languages) with embedded null
3157
         bytes.  */
3158
 
3159
      tokptr = ++tokstart;
3160
      tempbufindex = 0;
3161
 
3162
      do {
3163
        /* Grow the static temp buffer if necessary, including
3164
           allocating the first one on demand.  */
3165
        if (tempbufindex + 1 >= tempbufsize)
3166
          {
3167
            tempbuf = (char *) xrealloc (tempbuf, tempbufsize += 64);
3168
          }
3169
        switch (*tokptr)
3170
          {
3171
          case '\0':
3172
          case '"':
3173
            /* Do nothing, loop will terminate.  */
3174
            break;
3175
          case '\\':
3176
            tokptr++;
3177
            c = parse_escape (&tokptr);
3178
            if (c == -1)
3179
              {
3180
                continue;
3181
              }
3182
            tempbuf[tempbufindex++] = c;
3183
            break;
3184
          default:
3185
            tempbuf[tempbufindex++] = *tokptr++;
3186
            break;
3187
          }
3188
      } while ((*tokptr != '"') && (*tokptr != '\0'));
3189
      if (*tokptr++ != '"')
3190
        {
3191
          error ("Unterminated string in expression.");
3192
        }
3193
      tempbuf[tempbufindex] = '\0';     /* See note above.  */
3194
      yylval.sval.ptr = tempbuf;
3195
      yylval.sval.length = tempbufindex;
3196
      lexptr = tokptr;
3197
      return (tokchr == '@' ? NSSTRING : STRING);
3198
    }
3199
 
3200
  if (!(tokchr == '_' || tokchr == '$' ||
3201
       (tokchr >= 'a' && tokchr <= 'z') || (tokchr >= 'A' && tokchr <= 'Z')))
3202
    /* We must have come across a bad character (e.g. ';').  */
3203
    error ("Invalid character '%c' in expression.", c);
3204
 
3205
  /* It's a name.  See how long it is.  */
3206
  namelen = 0;
3207
  for (c = tokstart[namelen];
3208
       (c == '_' || c == '$' || (c >= '0' && c <= '9')
3209
        || (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || c == '<');)
3210
    {
3211
       if (c == '<')
3212
         {
3213
           int i = namelen;
3214
           while (tokstart[++i] && tokstart[i] != '>');
3215
           if (tokstart[i] == '>')
3216
             namelen = i;
3217
          }
3218
       c = tokstart[++namelen];
3219
     }
3220
 
3221
  /* The token "if" terminates the expression and is NOT
3222
     removed from the input stream.  */
3223
  if (namelen == 2 && tokstart[0] == 'i' && tokstart[1] == 'f')
3224
    {
3225
      return 0;
3226
    }
3227
 
3228
  lexptr += namelen;
3229
 
3230
  tryname:
3231
 
3232
  /* Catch specific keywords.  Should be done with a data structure.  */
3233
  switch (namelen)
3234
    {
3235
    case 8:
3236
      if (strncmp (tokstart, "unsigned", 8) == 0)
3237
        return UNSIGNED;
3238
      if (parse_language->la_language == language_cplus
3239
          && strncmp (tokstart, "template", 8) == 0)
3240
        return TEMPLATE;
3241
      if (strncmp (tokstart, "volatile", 8) == 0)
3242
        return VOLATILE_KEYWORD;
3243
      break;
3244
    case 6:
3245
      if (strncmp (tokstart, "struct", 6) == 0)
3246
        return STRUCT;
3247
      if (strncmp (tokstart, "signed", 6) == 0)
3248
        return SIGNED_KEYWORD;
3249
      if (strncmp (tokstart, "sizeof", 6) == 0)
3250
        return SIZEOF;
3251
      if (strncmp (tokstart, "double", 6) == 0)
3252
        return DOUBLE_KEYWORD;
3253
      break;
3254
    case 5:
3255
      if ((parse_language->la_language == language_cplus)
3256
          && strncmp (tokstart, "class", 5) == 0)
3257
        return CLASS;
3258
      if (strncmp (tokstart, "union", 5) == 0)
3259
        return UNION;
3260
      if (strncmp (tokstart, "short", 5) == 0)
3261
        return SHORT;
3262
      if (strncmp (tokstart, "const", 5) == 0)
3263
        return CONST_KEYWORD;
3264
      break;
3265
    case 4:
3266
      if (strncmp (tokstart, "enum", 4) == 0)
3267
        return ENUM;
3268
      if (strncmp (tokstart, "long", 4) == 0)
3269
        return LONG;
3270
      break;
3271
    case 3:
3272
      if (strncmp (tokstart, "int", 3) == 0)
3273
        return INT_KEYWORD;
3274
      break;
3275
    default:
3276
      break;
3277
    }
3278
 
3279
  yylval.sval.ptr = tokstart;
3280
  yylval.sval.length = namelen;
3281
 
3282
  if (*tokstart == '$')
3283
    {
3284
      write_dollar_variable (yylval.sval);
3285
      return VARIABLE;
3286
    }
3287
 
3288
  /* Use token-type BLOCKNAME for symbols that happen to be defined as
3289
     functions or symtabs.  If this is not so, then ...
3290
     Use token-type TYPENAME for symbols that happen to be defined
3291
     currently as names of types; NAME for other symbols.
3292
     The caller is not constrained to care about the distinction.  */
3293
  {
3294
    char *tmp = copy_name (yylval.sval);
3295
    struct symbol *sym;
3296
    int is_a_field_of_this = 0, *need_this;
3297
    int hextype;
3298
 
3299
    if (parse_language->la_language == language_cplus ||
3300
        parse_language->la_language == language_objc)
3301
      need_this = &is_a_field_of_this;
3302
    else
3303
      need_this = (int *) NULL;
3304
 
3305
    sym = lookup_symbol (tmp, expression_context_block,
3306
                         VAR_DOMAIN,
3307
                         need_this);
3308
    /* Call lookup_symtab, not lookup_partial_symtab, in case there
3309
       are no psymtabs (coff, xcoff, or some future change to blow
3310
       away the psymtabs once symbols are read).  */
3311
    if ((sym && SYMBOL_CLASS (sym) == LOC_BLOCK) ||
3312
        lookup_symtab (tmp))
3313
      {
3314
        yylval.ssym.sym = sym;
3315
        yylval.ssym.is_a_field_of_this = is_a_field_of_this;
3316
        return BLOCKNAME;
3317
      }
3318
    if (sym && SYMBOL_CLASS (sym) == LOC_TYPEDEF)
3319
        {
3320
#if 1
3321
          /* Despite the following flaw, we need to keep this code
3322
             enabled.  Because we can get called from
3323
             check_stub_method, if we don't handle nested types then
3324
             it screws many operations in any program which uses
3325
             nested types.  */
3326
          /* In "A::x", if x is a member function of A and there
3327
             happens to be a type (nested or not, since the stabs
3328
             don't make that distinction) named x, then this code
3329
             incorrectly thinks we are dealing with nested types
3330
             rather than a member function.  */
3331
 
3332
          char *p;
3333
          char *namestart;
3334
          struct symbol *best_sym;
3335
 
3336
          /* Look ahead to detect nested types.  This probably should
3337
             be done in the grammar, but trying seemed to introduce a
3338
             lot of shift/reduce and reduce/reduce conflicts.  It's
3339
             possible that it could be done, though.  Or perhaps a
3340
             non-grammar, but less ad hoc, approach would work well.  */
3341
 
3342
          /* Since we do not currently have any way of distinguishing
3343
             a nested type from a non-nested one (the stabs don't tell
3344
             us whether a type is nested), we just ignore the
3345
             containing type.  */
3346
 
3347
          p = lexptr;
3348
          best_sym = sym;
3349
          while (1)
3350
            {
3351
              /* Skip whitespace.  */
3352
              while (*p == ' ' || *p == '\t' || *p == '\n')
3353
                ++p;
3354
              if (*p == ':' && p[1] == ':')
3355
                {
3356
                  /* Skip the `::'.  */
3357
                  p += 2;
3358
                  /* Skip whitespace.  */
3359
                  while (*p == ' ' || *p == '\t' || *p == '\n')
3360
                    ++p;
3361
                  namestart = p;
3362
                  while (*p == '_' || *p == '$' || (*p >= '0' && *p <= '9')
3363
                         || (*p >= 'a' && *p <= 'z')
3364
                         || (*p >= 'A' && *p <= 'Z'))
3365
                    ++p;
3366
                  if (p != namestart)
3367
                    {
3368
                      struct symbol *cur_sym;
3369
                      /* As big as the whole rest of the expression,
3370
                         which is at least big enough.  */
3371
                      char *ncopy = alloca (strlen (tmp) +
3372
                                            strlen (namestart) + 3);
3373
                      char *tmp1;
3374
 
3375
                      tmp1 = ncopy;
3376
                      memcpy (tmp1, tmp, strlen (tmp));
3377
                      tmp1 += strlen (tmp);
3378
                      memcpy (tmp1, "::", 2);
3379
                      tmp1 += 2;
3380
                      memcpy (tmp1, namestart, p - namestart);
3381
                      tmp1[p - namestart] = '\0';
3382
                      cur_sym = lookup_symbol (ncopy,
3383
                                               expression_context_block,
3384
                                               VAR_DOMAIN, (int *) NULL);
3385
                      if (cur_sym)
3386
                        {
3387
                          if (SYMBOL_CLASS (cur_sym) == LOC_TYPEDEF)
3388
                            {
3389
                              best_sym = cur_sym;
3390
                              lexptr = p;
3391
                            }
3392
                          else
3393
                            break;
3394
                        }
3395
                      else
3396
                        break;
3397
                    }
3398
                  else
3399
                    break;
3400
                }
3401
              else
3402
                break;
3403
            }
3404
 
3405
          yylval.tsym.type = SYMBOL_TYPE (best_sym);
3406
#else /* not 0 */
3407
          yylval.tsym.type = SYMBOL_TYPE (sym);
3408
#endif /* not 0 */
3409
          return TYPENAME;
3410
        }
3411
    yylval.tsym.type
3412
      = language_lookup_primitive_type_by_name (parse_language,
3413
                                                parse_gdbarch, tmp);
3414
    if (yylval.tsym.type != NULL)
3415
      return TYPENAME;
3416
 
3417
    /* See if it's an ObjC classname.  */
3418
    if (!sym)
3419
      {
3420
        CORE_ADDR Class = lookup_objc_class (parse_gdbarch, tmp);
3421
        if (Class)
3422
          {
3423
            yylval.class.class = Class;
3424
            if ((sym = lookup_struct_typedef (tmp,
3425
                                              expression_context_block,
3426
                                              1)))
3427
              yylval.class.type = SYMBOL_TYPE (sym);
3428
            return CLASSNAME;
3429
          }
3430
      }
3431
 
3432
    /* Input names that aren't symbols but ARE valid hex numbers,
3433
       when the input radix permits them, can be names or numbers
3434
       depending on the parse.  Note we support radixes > 16 here.  */
3435
    if (!sym &&
3436
        ((tokstart[0] >= 'a' && tokstart[0] < 'a' + input_radix - 10) ||
3437
         (tokstart[0] >= 'A' && tokstart[0] < 'A' + input_radix - 10)))
3438
      {
3439
        YYSTYPE newlval;        /* Its value is ignored.  */
3440
        hextype = parse_number (tokstart, namelen, 0, &newlval);
3441
        if (hextype == INT)
3442
          {
3443
            yylval.ssym.sym = sym;
3444
            yylval.ssym.is_a_field_of_this = is_a_field_of_this;
3445
            return NAME_OR_INT;
3446
          }
3447
      }
3448
 
3449
    /* Any other kind of symbol.  */
3450
    yylval.ssym.sym = sym;
3451
    yylval.ssym.is_a_field_of_this = is_a_field_of_this;
3452
    return NAME;
3453
  }
3454
}
3455
 
3456
void
3457
yyerror (msg)
3458
     char *msg;
3459
{
3460
  if (*lexptr == '\0')
3461
    error("A %s near end of expression.",  (msg ? msg : "error"));
3462
  else
3463
    error ("A %s in expression, near `%s'.", (msg ? msg : "error"),
3464
           lexptr);
3465
}
3466
 
3467
 

powered by: WebSVN 2.1.0

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