OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gdb-7.2/] [gdb/] [objc-exp.c] - Blame information for rev 501

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

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

powered by: WebSVN 2.1.0

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