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

Subversion Repositories openrisc

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

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

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

powered by: WebSVN 2.1.0

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