1 /* A Bison parser, made by GNU Bison 2.3.  */
2 
3 /* Skeleton implementation for Bison's Yacc-like parsers in C
4 
5    Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
6    Free Software Foundation, Inc.
7 
8    This program is free software; you can redistribute it and/or modify
9    it under the terms of the GNU General Public License as published by
10    the Free Software Foundation; either version 2, or (at your option)
11    any later version.
12 
13    This program is distributed in the hope that it will be useful,
14    but WITHOUT ANY WARRANTY; without even the implied warranty of
15    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16    GNU General Public License for more details.
17 
18    You should have received a copy of the GNU General Public License
19    along with this program; if not, write to the Free Software
20    Foundation, Inc., 51 Franklin Street, Fifth Floor,
21    Boston, MA 02110-1301, USA.  */
22 
23 /* As a special exception, you may create a larger work that contains
24    part or all of the Bison parser skeleton and distribute that work
25    under terms of your choice, so long as that work isn't itself a
26    parser generator using the skeleton or a modified version thereof
27    as a parser skeleton.  Alternatively, if you modify or redistribute
28    the parser skeleton itself, you may (at your option) remove this
29    special exception, which will cause the skeleton and the resulting
30    Bison output files to be licensed under the GNU General Public
31    License without this special exception.
32 
33    This special exception was added by the Free Software Foundation in
34    version 2.2 of Bison.  */
35 
36 /* C LALR(1) parser skeleton written by Richard Stallman, by
37    simplifying the original so-called "semantic" parser.  */
38 
39 /* All symbols defined below should begin with yy or YY, to avoid
40    infringing on user name space.  This should be done even for local
41    variables, as they might otherwise be expanded by user macros.
42    There are some unavoidable exceptions within include files to
43    define necessary library symbols; they are noted "INFRINGES ON
44    USER NAME SPACE" below.  */
45 
46 /* Identify Bison output.  */
47 #define YYBISON 1
48 
49 /* Bison version.  */
50 #define YYBISON_VERSION "2.3"
51 
52 /* Skeleton name.  */
53 #define YYSKELETON_NAME "yacc.c"
54 
55 /* Pure parsers.  */
56 #define YYPURE 0
57 
58 /* Using locations.  */
59 #define YYLSP_NEEDED 0
60 
61 
62 
63 /* Tokens.  */
64 #ifndef YYTOKENTYPE
65 # define YYTOKENTYPE
66    /* Put the tokens into the symbol table, so that GDB and other debuggers
67       know about them.  */
68    enum yytokentype {
69      TOKEN_IDENTIFIER = 258,
70      TOKEN_DOT = 259,
71      TOKEN_STAR = 260,
72      TOKEN_ARROW = 261,
73      TOKEN_ADDR = 262,
74      TOKEN_SIZEOF = 263,
75      TOKEN_NUMBER = 264
76    };
77 #endif
78 /* Tokens.  */
79 #define TOKEN_IDENTIFIER 258
80 #define TOKEN_DOT 259
81 #define TOKEN_STAR 260
82 #define TOKEN_ARROW 261
83 #define TOKEN_ADDR 262
84 #define TOKEN_SIZEOF 263
85 #define TOKEN_NUMBER 264
86 
87 
88 
89 
90 /* Copy the first part of user declarations.  */
91 #line 1 "expr.ypp"
92 
93 #include <stdio.h>
94 #include <memory.h>
95 #include <stdlib.h>
96 #include <string.h>
97 
98 #include "../System.h"
99 #include "../gba/elf.h"
100 #include "exprNode.h"
101 
102 extern int yyerror(const char *);
103 extern int yylex();
104 extern char *yytext;
105 
106 
107 //#define YYERROR_VERBOSE 1
108 //#define YYDEBUG 1
109 
110  Node *result = NULL;
111 
112 
113 /* Enabling traces.  */
114 #ifndef YYDEBUG
115 # define YYDEBUG 0
116 #endif
117 
118 /* Enabling verbose error messages.  */
119 #ifdef YYERROR_VERBOSE
120 # undef YYERROR_VERBOSE
121 # define YYERROR_VERBOSE 1
122 #else
123 # define YYERROR_VERBOSE 0
124 #endif
125 
126 /* Enabling the token table.  */
127 #ifndef YYTOKEN_TABLE
128 # define YYTOKEN_TABLE 0
129 #endif
130 
131 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
132 typedef int YYSTYPE;
133 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
134 # define YYSTYPE_IS_DECLARED 1
135 # define YYSTYPE_IS_TRIVIAL 1
136 #endif
137 
138 
139 
140 /* Copy the second part of user declarations.  */
141 
142 
143 /* Line 216 of yacc.c.  */
144 #line 149 "expr.tab.cpp"
145 
146 #ifdef short
147 # undef short
148 #endif
149 
150 #ifdef YYTYPE_UINT8
151 typedef YYTYPE_UINT8 yytype_uint8;
152 #else
153 typedef unsigned char yytype_uint8;
154 #endif
155 
156 #ifdef YYTYPE_INT8
157 typedef YYTYPE_INT8 yytype_int8;
158 #elif (defined __STDC__ || defined __C99__FUNC__ \
159      || defined __cplusplus || defined _MSC_VER)
160 typedef signed char yytype_int8;
161 #else
162 typedef short int yytype_int8;
163 #endif
164 
165 #ifdef YYTYPE_UINT16
166 typedef YYTYPE_UINT16 yytype_uint16;
167 #else
168 typedef unsigned short int yytype_uint16;
169 #endif
170 
171 #ifdef YYTYPE_INT16
172 typedef YYTYPE_INT16 yytype_int16;
173 #else
174 typedef short int yytype_int16;
175 #endif
176 
177 #ifndef YYSIZE_T
178 # ifdef __SIZE_TYPE__
179 #  define YYSIZE_T __SIZE_TYPE__
180 # elif defined size_t
181 #  define YYSIZE_T size_t
182 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
183      || defined __cplusplus || defined _MSC_VER)
184 #  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
185 #  define YYSIZE_T size_t
186 # else
187 #  define YYSIZE_T unsigned int
188 # endif
189 #endif
190 
191 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
192 
193 #ifndef YY_
194 # if YYENABLE_NLS
195 #  if ENABLE_NLS
196 #   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
197 #   define YY_(msgid) dgettext ("bison-runtime", msgid)
198 #  endif
199 # endif
200 # ifndef YY_
201 #  define YY_(msgid) msgid
202 # endif
203 #endif
204 
205 /* Suppress unused-variable warnings by "using" E.  */
206 #if ! defined lint || defined __GNUC__
207 # define YYUSE(e) ((void) (e))
208 #else
209 # define YYUSE(e) /* empty */
210 #endif
211 
212 /* Identity function, used to suppress warnings about constant conditions.  */
213 #ifndef lint
214 # define YYID(n) (n)
215 #else
216 #if (defined __STDC__ || defined __C99__FUNC__ \
217      || defined __cplusplus || defined _MSC_VER)
218 static int
YYID(int i)219 YYID (int i)
220 #else
221 static int
222 YYID (i)
223     int i;
224 #endif
225 {
226   return i;
227 }
228 #endif
229 
230 #if ! defined yyoverflow || YYERROR_VERBOSE
231 
232 /* The parser invokes alloca or malloc; define the necessary symbols.  */
233 
234 # ifdef YYSTACK_USE_ALLOCA
235 #  if YYSTACK_USE_ALLOCA
236 #   ifdef __GNUC__
237 #    define YYSTACK_ALLOC __builtin_alloca
238 #   elif defined __BUILTIN_VA_ARG_INCR
239 #    include <alloca.h> /* INFRINGES ON USER NAME SPACE */
240 #   elif defined _AIX
241 #    define YYSTACK_ALLOC __alloca
242 #   elif defined _MSC_VER
243 #    include <malloc.h> /* INFRINGES ON USER NAME SPACE */
244 #    define alloca _alloca
245 #   else
246 #    define YYSTACK_ALLOC alloca
247 #    if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
248      || defined __cplusplus || defined _MSC_VER)
249 #     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
250 #     ifndef _STDLIB_H
251 #      define _STDLIB_H 1
252 #     endif
253 #    endif
254 #   endif
255 #  endif
256 # endif
257 
258 # ifdef YYSTACK_ALLOC
259    /* Pacify GCC's `empty if-body' warning.  */
260 #  define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
261 #  ifndef YYSTACK_ALLOC_MAXIMUM
262     /* The OS might guarantee only one guard page at the bottom of the stack,
263        and a page size can be as small as 4096 bytes.  So we cannot safely
264        invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number
265        to allow for a few compiler-allocated temporary stack slots.  */
266 #   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
267 #  endif
268 # else
269 #  define YYSTACK_ALLOC YYMALLOC
270 #  define YYSTACK_FREE YYFREE
271 #  ifndef YYSTACK_ALLOC_MAXIMUM
272 #   define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
273 #  endif
274 #  if (defined __cplusplus && ! defined _STDLIB_H \
275        && ! ((defined YYMALLOC || defined malloc) \
276 	     && (defined YYFREE || defined free)))
277 #   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
278 #   ifndef _STDLIB_H
279 #    define _STDLIB_H 1
280 #   endif
281 #  endif
282 #  ifndef YYMALLOC
283 #   define YYMALLOC malloc
284 #   if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
285      || defined __cplusplus || defined _MSC_VER)
286 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
287 #   endif
288 #  endif
289 #  ifndef YYFREE
290 #   define YYFREE free
291 #   if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
292      || defined __cplusplus || defined _MSC_VER)
293 void free (void *); /* INFRINGES ON USER NAME SPACE */
294 #   endif
295 #  endif
296 # endif
297 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
298 
299 
300 #if (! defined yyoverflow \
301      && (! defined __cplusplus \
302 	 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
303 
304 /* A type that is properly aligned for any stack member.  */
305 union yyalloc
306 {
307   yytype_int16 yyss;
308   YYSTYPE yyvs;
309   };
310 
311 /* The size of the maximum gap between one aligned stack and the next.  */
312 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
313 
314 /* The size of an array large to enough to hold all stacks, each with
315    N elements.  */
316 # define YYSTACK_BYTES(N) \
317      ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
318       + YYSTACK_GAP_MAXIMUM)
319 
320 /* Copy COUNT objects from FROM to TO.  The source and destination do
321    not overlap.  */
322 # ifndef YYCOPY
323 #  if defined __GNUC__ && 1 < __GNUC__
324 #   define YYCOPY(To, From, Count) \
325       __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
326 #  else
327 #   define YYCOPY(To, From, Count)		\
328       do					\
329 	{					\
330 	  YYSIZE_T yyi;				\
331 	  for (yyi = 0; yyi < (Count); yyi++)	\
332 	    (To)[yyi] = (From)[yyi];		\
333 	}					\
334       while (YYID (0))
335 #  endif
336 # endif
337 
338 /* Relocate STACK from its old location to the new one.  The
339    local variables YYSIZE and YYSTACKSIZE give the old and new number of
340    elements in the stack, and YYPTR gives the new location of the
341    stack.  Advance YYPTR to a properly aligned location for the next
342    stack.  */
343 # define YYSTACK_RELOCATE(Stack)					\
344     do									\
345       {									\
346 	YYSIZE_T yynewbytes;						\
347 	YYCOPY (&yyptr->Stack, Stack, yysize);				\
348 	Stack = &yyptr->Stack;						\
349 	yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
350 	yyptr += yynewbytes / sizeof (*yyptr);				\
351       }									\
352     while (YYID (0))
353 
354 #endif
355 
356 /* YYFINAL -- State number of the termination state.  */
357 #define YYFINAL  14
358 /* YYLAST -- Last index in YYTABLE.  */
359 #define YYLAST   27
360 
361 /* YYNTOKENS -- Number of terminals.  */
362 #define YYNTOKENS  14
363 /* YYNNTS -- Number of nonterminals.  */
364 #define YYNNTS  6
365 /* YYNRULES -- Number of rules.  */
366 #define YYNRULES  13
367 /* YYNRULES -- Number of states.  */
368 #define YYNSTATES  26
369 
370 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
371 #define YYUNDEFTOK  2
372 #define YYMAXUTOK   264
373 
374 #define YYTRANSLATE(YYX)						\
375   ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
376 
377 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
378 static const yytype_uint8 yytranslate[] =
379 {
380        0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
381        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
382        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
383        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
384       11,    12,     2,     2,     2,     2,     2,     2,     2,     2,
385        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
386        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
387        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
388        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
389        2,    10,     2,    13,     2,     2,     2,     2,     2,     2,
390        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
391        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
392        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
393        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
394        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
395        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
396        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
397        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
398        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
399        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
400        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
401        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
402        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
403        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
404        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
405        2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
406        5,     6,     7,     8,     9
407 };
408 
409 #if YYDEBUG
410 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
411    YYRHS.  */
412 static const yytype_uint8 yyprhs[] =
413 {
414        0,     0,     3,     5,     7,    11,    15,    19,    24,    26,
415       29,    32,    37,    39
416 };
417 
418 /* YYRHS -- A `-1'-separated list of the rules' RHS.  */
419 static const yytype_int8 yyrhs[] =
420 {
421       15,     0,    -1,    16,    -1,    17,    -1,    11,    16,    12,
422       -1,    16,     4,    19,    -1,    16,     6,    19,    -1,    16,
423       10,    18,    13,    -1,    19,    -1,     5,    16,    -1,     7,
424       16,    -1,     8,    11,    16,    12,    -1,     9,    -1,     3,
425       -1
426 };
427 
428 /* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
429 static const yytype_uint8 yyrline[] =
430 {
431        0,    32,    32,    36,    37,    38,    39,    40,    43,    44,
432       45,    46,    50,    54
433 };
434 #endif
435 
436 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
437 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
438    First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
439 static const char *const yytname[] =
440 {
441   "$end", "error", "$undefined", "TOKEN_IDENTIFIER", "TOKEN_DOT",
442   "TOKEN_STAR", "TOKEN_ARROW", "TOKEN_ADDR", "TOKEN_SIZEOF",
443   "TOKEN_NUMBER", "'['", "'('", "')'", "']'", "$accept", "final",
444   "expression", "simple_expression", "number", "ident", 0
445 };
446 #endif
447 
448 # ifdef YYPRINT
449 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
450    token YYLEX-NUM.  */
451 static const yytype_uint16 yytoknum[] =
452 {
453        0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
454       91,    40,    41,    93
455 };
456 # endif
457 
458 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
459 static const yytype_uint8 yyr1[] =
460 {
461        0,    14,    15,    16,    16,    16,    16,    16,    17,    17,
462       17,    17,    18,    19
463 };
464 
465 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
466 static const yytype_uint8 yyr2[] =
467 {
468        0,     2,     1,     1,     3,     3,     3,     4,     1,     2,
469        2,     4,     1,     1
470 };
471 
472 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
473    STATE-NUM when YYTABLE doesn't specify something else to do.  Zero
474    means the default is an error.  */
475 static const yytype_uint8 yydefact[] =
476 {
477        0,    13,     0,     0,     0,     0,     0,     2,     3,     8,
478        9,    10,     0,     0,     1,     0,     0,     0,     0,     4,
479        5,     6,    12,     0,    11,     7
480 };
481 
482 /* YYDEFGOTO[NTERM-NUM].  */
483 static const yytype_int8 yydefgoto[] =
484 {
485       -1,     6,     7,     8,    23,     9
486 };
487 
488 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
489    STATE-NUM.  */
490 #define YYPACT_NINF -10
491 static const yytype_int8 yypact[] =
492 {
493        1,   -10,     1,     1,    -9,     1,     5,    17,   -10,   -10,
494       17,    17,     1,     7,   -10,     4,     4,     6,    10,   -10,
495      -10,   -10,   -10,    13,   -10,   -10
496 };
497 
498 /* YYPGOTO[NTERM-NUM].  */
499 static const yytype_int8 yypgoto[] =
500 {
501      -10,   -10,    -2,   -10,   -10,     9
502 };
503 
504 /* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
505    positive, shift that token.  If negative, reduce the rule which
506    number is the opposite.  If zero, do what YYDEFACT says.
507    If YYTABLE_NINF, syntax error.  */
508 #define YYTABLE_NINF -1
509 static const yytype_uint8 yytable[] =
510 {
511       10,    11,    12,    13,     1,    14,     2,     1,     3,     4,
512       18,    15,     5,    16,    15,    22,    16,    17,     0,    19,
513       17,    15,    24,    16,    20,    21,    25,    17
514 };
515 
516 static const yytype_int8 yycheck[] =
517 {
518        2,     3,    11,     5,     3,     0,     5,     3,     7,     8,
519       12,     4,    11,     6,     4,     9,     6,    10,    -1,    12,
520       10,     4,    12,     6,    15,    16,    13,    10
521 };
522 
523 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
524    symbol of state STATE-NUM.  */
525 static const yytype_uint8 yystos[] =
526 {
527        0,     3,     5,     7,     8,    11,    15,    16,    17,    19,
528       16,    16,    11,    16,     0,     4,     6,    10,    16,    12,
529       19,    19,     9,    18,    12,    13
530 };
531 
532 #define yyerrok		(yyerrstatus = 0)
533 #define yyclearin	(yychar = YYEMPTY)
534 #define YYEMPTY		(-2)
535 #define YYEOF		0
536 
537 #define YYACCEPT	goto yyacceptlab
538 #define YYABORT		goto yyabortlab
539 #define YYERROR		goto yyerrorlab
540 
541 
542 /* Like YYERROR except do call yyerror.  This remains here temporarily
543    to ease the transition to the new meaning of YYERROR, for GCC.
544    Once GCC version 2 has supplanted version 1, this can go.  */
545 
546 #define YYFAIL		goto yyerrlab
547 
548 #define YYRECOVERING()  (!!yyerrstatus)
549 
550 #define YYBACKUP(Token, Value)					\
551 do								\
552   if (yychar == YYEMPTY && yylen == 1)				\
553     {								\
554       yychar = (Token);						\
555       yylval = (Value);						\
556       yytoken = YYTRANSLATE (yychar);				\
557       YYPOPSTACK (1);						\
558       goto yybackup;						\
559     }								\
560   else								\
561     {								\
562       yyerror (YY_("syntax error: cannot back up")); \
563       YYERROR;							\
564     }								\
565 while (YYID (0))
566 
567 
568 #define YYTERROR	1
569 #define YYERRCODE	256
570 
571 
572 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
573    If N is 0, then set CURRENT to the empty location which ends
574    the previous symbol: RHS[0] (always defined).  */
575 
576 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
577 #ifndef YYLLOC_DEFAULT
578 # define YYLLOC_DEFAULT(Current, Rhs, N)				\
579     do									\
580       if (YYID (N))                                                    \
581 	{								\
582 	  (Current).first_line   = YYRHSLOC (Rhs, 1).first_line;	\
583 	  (Current).first_column = YYRHSLOC (Rhs, 1).first_column;	\
584 	  (Current).last_line    = YYRHSLOC (Rhs, N).last_line;		\
585 	  (Current).last_column  = YYRHSLOC (Rhs, N).last_column;	\
586 	}								\
587       else								\
588 	{								\
589 	  (Current).first_line   = (Current).last_line   =		\
590 	    YYRHSLOC (Rhs, 0).last_line;				\
591 	  (Current).first_column = (Current).last_column =		\
592 	    YYRHSLOC (Rhs, 0).last_column;				\
593 	}								\
594     while (YYID (0))
595 #endif
596 
597 
598 /* YY_LOCATION_PRINT -- Print the location on the stream.
599    This macro was not mandated originally: define only if we know
600    we won't break user code: when these are the locations we know.  */
601 
602 #ifndef YY_LOCATION_PRINT
603 # if YYLTYPE_IS_TRIVIAL
604 #  define YY_LOCATION_PRINT(File, Loc)			\
605      fprintf (File, "%d.%d-%d.%d",			\
606 	      (Loc).first_line, (Loc).first_column,	\
607 	      (Loc).last_line,  (Loc).last_column)
608 # else
609 #  define YY_LOCATION_PRINT(File, Loc) ((void) 0)
610 # endif
611 #endif
612 
613 
614 /* YYLEX -- calling `yylex' with the right arguments.  */
615 
616 #ifdef YYLEX_PARAM
617 # define YYLEX yylex (YYLEX_PARAM)
618 #else
619 # define YYLEX yylex ()
620 #endif
621 
622 /* Enable debugging if requested.  */
623 #if YYDEBUG
624 
625 # ifndef YYFPRINTF
626 #  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
627 #  define YYFPRINTF fprintf
628 # endif
629 
630 # define YYDPRINTF(Args)			\
631 do {						\
632   if (yydebug)					\
633     YYFPRINTF Args;				\
634 } while (YYID (0))
635 
636 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)			  \
637 do {									  \
638   if (yydebug)								  \
639     {									  \
640       YYFPRINTF (stderr, "%s ", Title);					  \
641       yy_symbol_print (stderr,						  \
642 		  Type, Value); \
643       YYFPRINTF (stderr, "\n");						  \
644     }									  \
645 } while (YYID (0))
646 
647 
648 /*--------------------------------.
649 | Print this symbol on YYOUTPUT.  |
650 `--------------------------------*/
651 
652 /*ARGSUSED*/
653 #if (defined __STDC__ || defined __C99__FUNC__ \
654      || defined __cplusplus || defined _MSC_VER)
655 static void
yy_symbol_value_print(FILE * yyoutput,int yytype,YYSTYPE const * const yyvaluep)656 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
657 #else
658 static void
659 yy_symbol_value_print (yyoutput, yytype, yyvaluep)
660     FILE *yyoutput;
661     int yytype;
662     YYSTYPE const * const yyvaluep;
663 #endif
664 {
665   if (!yyvaluep)
666     return;
667 # ifdef YYPRINT
668   if (yytype < YYNTOKENS)
669     YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
670 # else
671   YYUSE (yyoutput);
672 # endif
673   switch (yytype)
674     {
675       default:
676 	break;
677     }
678 }
679 
680 
681 /*--------------------------------.
682 | Print this symbol on YYOUTPUT.  |
683 `--------------------------------*/
684 
685 #if (defined __STDC__ || defined __C99__FUNC__ \
686      || defined __cplusplus || defined _MSC_VER)
687 static void
yy_symbol_print(FILE * yyoutput,int yytype,YYSTYPE const * const yyvaluep)688 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
689 #else
690 static void
691 yy_symbol_print (yyoutput, yytype, yyvaluep)
692     FILE *yyoutput;
693     int yytype;
694     YYSTYPE const * const yyvaluep;
695 #endif
696 {
697   if (yytype < YYNTOKENS)
698     YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
699   else
700     YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
701 
702   yy_symbol_value_print (yyoutput, yytype, yyvaluep);
703   YYFPRINTF (yyoutput, ")");
704 }
705 
706 /*------------------------------------------------------------------.
707 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
708 | TOP (included).                                                   |
709 `------------------------------------------------------------------*/
710 
711 #if (defined __STDC__ || defined __C99__FUNC__ \
712      || defined __cplusplus || defined _MSC_VER)
713 static void
yy_stack_print(yytype_int16 * bottom,yytype_int16 * top)714 yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
715 #else
716 static void
717 yy_stack_print (bottom, top)
718     yytype_int16 *bottom;
719     yytype_int16 *top;
720 #endif
721 {
722   YYFPRINTF (stderr, "Stack now");
723   for (; bottom <= top; ++bottom)
724     YYFPRINTF (stderr, " %d", *bottom);
725   YYFPRINTF (stderr, "\n");
726 }
727 
728 # define YY_STACK_PRINT(Bottom, Top)				\
729 do {								\
730   if (yydebug)							\
731     yy_stack_print ((Bottom), (Top));				\
732 } while (YYID (0))
733 
734 
735 /*------------------------------------------------.
736 | Report that the YYRULE is going to be reduced.  |
737 `------------------------------------------------*/
738 
739 #if (defined __STDC__ || defined __C99__FUNC__ \
740      || defined __cplusplus || defined _MSC_VER)
741 static void
yy_reduce_print(YYSTYPE * yyvsp,int yyrule)742 yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
743 #else
744 static void
745 yy_reduce_print (yyvsp, yyrule)
746     YYSTYPE *yyvsp;
747     int yyrule;
748 #endif
749 {
750   int yynrhs = yyr2[yyrule];
751   int yyi;
752   unsigned long int yylno = yyrline[yyrule];
753   YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
754 	     yyrule - 1, yylno);
755   /* The symbols being reduced.  */
756   for (yyi = 0; yyi < yynrhs; yyi++)
757     {
758       fprintf (stderr, "   $%d = ", yyi + 1);
759       yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
760 		       &(yyvsp[(yyi + 1) - (yynrhs)])
761 		       		       );
762       fprintf (stderr, "\n");
763     }
764 }
765 
766 # define YY_REDUCE_PRINT(Rule)		\
767 do {					\
768   if (yydebug)				\
769     yy_reduce_print (yyvsp, Rule); \
770 } while (YYID (0))
771 
772 /* Nonzero means print parse trace.  It is left uninitialized so that
773    multiple parsers can coexist.  */
774 int yydebug;
775 #else /* !YYDEBUG */
776 # define YYDPRINTF(Args)
777 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
778 # define YY_STACK_PRINT(Bottom, Top)
779 # define YY_REDUCE_PRINT(Rule)
780 #endif /* !YYDEBUG */
781 
782 
783 /* YYINITDEPTH -- initial size of the parser's stacks.  */
784 #ifndef	YYINITDEPTH
785 # define YYINITDEPTH 200
786 #endif
787 
788 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
789    if the built-in stack extension method is used).
790 
791    Do not make this value too large; the results are undefined if
792    YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
793    evaluated with infinite-precision integer arithmetic.  */
794 
795 #ifndef YYMAXDEPTH
796 # define YYMAXDEPTH 10000
797 #endif
798 
799 
800 
801 #if YYERROR_VERBOSE
802 
803 # ifndef yystrlen
804 #  if defined __GLIBC__ && defined _STRING_H
805 #   define yystrlen strlen
806 #  else
807 /* Return the length of YYSTR.  */
808 #if (defined __STDC__ || defined __C99__FUNC__ \
809      || defined __cplusplus || defined _MSC_VER)
810 static YYSIZE_T
yystrlen(const char * yystr)811 yystrlen (const char *yystr)
812 #else
813 static YYSIZE_T
814 yystrlen (yystr)
815     const char *yystr;
816 #endif
817 {
818   YYSIZE_T yylen;
819   for (yylen = 0; yystr[yylen]; yylen++)
820     continue;
821   return yylen;
822 }
823 #  endif
824 # endif
825 
826 # ifndef yystpcpy
827 #  if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
828 #   define yystpcpy stpcpy
829 #  else
830 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
831    YYDEST.  */
832 #if (defined __STDC__ || defined __C99__FUNC__ \
833      || defined __cplusplus || defined _MSC_VER)
834 static char *
yystpcpy(char * yydest,const char * yysrc)835 yystpcpy (char *yydest, const char *yysrc)
836 #else
837 static char *
838 yystpcpy (yydest, yysrc)
839     char *yydest;
840     const char *yysrc;
841 #endif
842 {
843   char *yyd = yydest;
844   const char *yys = yysrc;
845 
846   while ((*yyd++ = *yys++) != '\0')
847     continue;
848 
849   return yyd - 1;
850 }
851 #  endif
852 # endif
853 
854 # ifndef yytnamerr
855 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
856    quotes and backslashes, so that it's suitable for yyerror.  The
857    heuristic is that double-quoting is unnecessary unless the string
858    contains an apostrophe, a comma, or backslash (other than
859    backslash-backslash).  YYSTR is taken from yytname.  If YYRES is
860    null, do not copy; instead, return the length of what the result
861    would have been.  */
862 static YYSIZE_T
yytnamerr(char * yyres,const char * yystr)863 yytnamerr (char *yyres, const char *yystr)
864 {
865   if (*yystr == '"')
866     {
867       YYSIZE_T yyn = 0;
868       char const *yyp = yystr;
869 
870       for (;;)
871 	switch (*++yyp)
872 	  {
873 	  case '\'':
874 	  case ',':
875 	    goto do_not_strip_quotes;
876 
877 	  case '\\':
878 	    if (*++yyp != '\\')
879 	      goto do_not_strip_quotes;
880 	    /* Fall through.  */
881 	  default:
882 	    if (yyres)
883 	      yyres[yyn] = *yyp;
884 	    yyn++;
885 	    break;
886 
887 	  case '"':
888 	    if (yyres)
889 	      yyres[yyn] = '\0';
890 	    return yyn;
891 	  }
892     do_not_strip_quotes: ;
893     }
894 
895   if (! yyres)
896     return yystrlen (yystr);
897 
898   return yystpcpy (yyres, yystr) - yyres;
899 }
900 # endif
901 
902 /* Copy into YYRESULT an error message about the unexpected token
903    YYCHAR while in state YYSTATE.  Return the number of bytes copied,
904    including the terminating null byte.  If YYRESULT is null, do not
905    copy anything; just return the number of bytes that would be
906    copied.  As a special case, return 0 if an ordinary "syntax error"
907    message will do.  Return YYSIZE_MAXIMUM if overflow occurs during
908    size calculation.  */
909 static YYSIZE_T
yysyntax_error(char * yyresult,int yystate,int yychar)910 yysyntax_error (char *yyresult, int yystate, int yychar)
911 {
912   int yyn = yypact[yystate];
913 
914   if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
915     return 0;
916   else
917     {
918       int yytype = YYTRANSLATE (yychar);
919       YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
920       YYSIZE_T yysize = yysize0;
921       YYSIZE_T yysize1;
922       int yysize_overflow = 0;
923       enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
924       char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
925       int yyx;
926 
927 # if 0
928       /* This is so xgettext sees the translatable formats that are
929 	 constructed on the fly.  */
930       YY_("syntax error, unexpected %s");
931       YY_("syntax error, unexpected %s, expecting %s");
932       YY_("syntax error, unexpected %s, expecting %s or %s");
933       YY_("syntax error, unexpected %s, expecting %s or %s or %s");
934       YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
935 # endif
936       char *yyfmt;
937       char const *yyf;
938       static char const yyunexpected[] = "syntax error, unexpected %s";
939       static char const yyexpecting[] = ", expecting %s";
940       static char const yyor[] = " or %s";
941       char yyformat[sizeof yyunexpected
942 		    + sizeof yyexpecting - 1
943 		    + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
944 		       * (sizeof yyor - 1))];
945       char const *yyprefix = yyexpecting;
946 
947       /* Start YYX at -YYN if negative to avoid negative indexes in
948 	 YYCHECK.  */
949       int yyxbegin = yyn < 0 ? -yyn : 0;
950 
951       /* Stay within bounds of both yycheck and yytname.  */
952       int yychecklim = YYLAST - yyn + 1;
953       int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
954       int yycount = 1;
955 
956       yyarg[0] = yytname[yytype];
957       yyfmt = yystpcpy (yyformat, yyunexpected);
958 
959       for (yyx = yyxbegin; yyx < yyxend; ++yyx)
960 	if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
961 	  {
962 	    if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
963 	      {
964 		yycount = 1;
965 		yysize = yysize0;
966 		yyformat[sizeof yyunexpected - 1] = '\0';
967 		break;
968 	      }
969 	    yyarg[yycount++] = yytname[yyx];
970 	    yysize1 = yysize + yytnamerr (0, yytname[yyx]);
971 	    yysize_overflow |= (yysize1 < yysize);
972 	    yysize = yysize1;
973 	    yyfmt = yystpcpy (yyfmt, yyprefix);
974 	    yyprefix = yyor;
975 	  }
976 
977       yyf = YY_(yyformat);
978       yysize1 = yysize + yystrlen (yyf);
979       yysize_overflow |= (yysize1 < yysize);
980       yysize = yysize1;
981 
982       if (yysize_overflow)
983 	return YYSIZE_MAXIMUM;
984 
985       if (yyresult)
986 	{
987 	  /* Avoid sprintf, as that infringes on the user's name space.
988 	     Don't have undefined behavior even if the translation
989 	     produced a string with the wrong number of "%s"s.  */
990 	  char *yyp = yyresult;
991 	  int yyi = 0;
992 	  while ((*yyp = *yyf) != '\0')
993 	    {
994 	      if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
995 		{
996 		  yyp += yytnamerr (yyp, yyarg[yyi++]);
997 		  yyf += 2;
998 		}
999 	      else
1000 		{
1001 		  yyp++;
1002 		  yyf++;
1003 		}
1004 	    }
1005 	}
1006       return yysize;
1007     }
1008 }
1009 #endif /* YYERROR_VERBOSE */
1010 
1011 
1012 /*-----------------------------------------------.
1013 | Release the memory associated to this symbol.  |
1014 `-----------------------------------------------*/
1015 
1016 /*ARGSUSED*/
1017 #if (defined __STDC__ || defined __C99__FUNC__ \
1018      || defined __cplusplus || defined _MSC_VER)
1019 static void
yydestruct(const char * yymsg,int yytype,YYSTYPE * yyvaluep)1020 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
1021 #else
1022 static void
1023 yydestruct (yymsg, yytype, yyvaluep)
1024     const char *yymsg;
1025     int yytype;
1026     YYSTYPE *yyvaluep;
1027 #endif
1028 {
1029   YYUSE (yyvaluep);
1030 
1031   if (!yymsg)
1032     yymsg = "Deleting";
1033   YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1034 
1035   switch (yytype)
1036     {
1037 
1038       default:
1039 	break;
1040     }
1041 }
1042 
1043 
1044 /* Prevent warnings from -Wmissing-prototypes.  */
1045 
1046 #ifdef YYPARSE_PARAM
1047 #if defined __STDC__ || defined __cplusplus
1048 int yyparse (void *YYPARSE_PARAM);
1049 #else
1050 int yyparse ();
1051 #endif
1052 #else /* ! YYPARSE_PARAM */
1053 #if defined __STDC__ || defined __cplusplus
1054 int yyparse (void);
1055 #else
1056 int yyparse ();
1057 #endif
1058 #endif /* ! YYPARSE_PARAM */
1059 
1060 
1061 
1062 /* The look-ahead symbol.  */
1063 int yychar;
1064 
1065 /* The semantic value of the look-ahead symbol.  */
1066 YYSTYPE yylval;
1067 
1068 /* Number of syntax errors so far.  */
1069 int yynerrs;
1070 
1071 
1072 
1073 /*----------.
1074 | yyparse.  |
1075 `----------*/
1076 
1077 #ifdef YYPARSE_PARAM
1078 #if (defined __STDC__ || defined __C99__FUNC__ \
1079      || defined __cplusplus || defined _MSC_VER)
1080 int
yyparse(void * YYPARSE_PARAM)1081 yyparse (void *YYPARSE_PARAM)
1082 #else
1083 int
1084 yyparse (YYPARSE_PARAM)
1085     void *YYPARSE_PARAM;
1086 #endif
1087 #else /* ! YYPARSE_PARAM */
1088 #if (defined __STDC__ || defined __C99__FUNC__ \
1089      || defined __cplusplus || defined _MSC_VER)
1090 int
1091 yyparse (void)
1092 #else
1093 int
1094 yyparse ()
1095 
1096 #endif
1097 #endif
1098 {
1099 
1100   int yystate;
1101   int yyn;
1102   int yyresult;
1103   /* Number of tokens to shift before error messages enabled.  */
1104   int yyerrstatus;
1105   /* Look-ahead token as an internal (translated) token number.  */
1106   int yytoken = 0;
1107 #if YYERROR_VERBOSE
1108   /* Buffer for error messages, and its allocated size.  */
1109   char yymsgbuf[128];
1110   char *yymsg = yymsgbuf;
1111   YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1112 #endif
1113 
1114   /* Three stacks and their tools:
1115      `yyss': related to states,
1116      `yyvs': related to semantic values,
1117      `yyls': related to locations.
1118 
1119      Refer to the stacks thru separate pointers, to allow yyoverflow
1120      to reallocate them elsewhere.  */
1121 
1122   /* The state stack.  */
1123   yytype_int16 yyssa[YYINITDEPTH];
1124   yytype_int16 *yyss = yyssa;
1125   yytype_int16 *yyssp;
1126 
1127   /* The semantic value stack.  */
1128   YYSTYPE yyvsa[YYINITDEPTH];
1129   YYSTYPE *yyvs = yyvsa;
1130   YYSTYPE *yyvsp;
1131 
1132 
1133 
1134 #define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))
1135 
1136   YYSIZE_T yystacksize = YYINITDEPTH;
1137 
1138   /* The variables used to return semantic value and location from the
1139      action routines.  */
1140   YYSTYPE yyval;
1141 
1142 
1143   /* The number of symbols on the RHS of the reduced rule.
1144      Keep to zero when no symbol should be popped.  */
1145   int yylen = 0;
1146 
1147   YYDPRINTF ((stderr, "Starting parse\n"));
1148 
1149   yystate = 0;
1150   yyerrstatus = 0;
1151   yynerrs = 0;
1152   yychar = YYEMPTY;		/* Cause a token to be read.  */
1153 
1154   /* Initialize stack pointers.
1155      Waste one element of value and location stack
1156      so that they stay on the same level as the state stack.
1157      The wasted elements are never initialized.  */
1158 
1159   yyssp = yyss;
1160   yyvsp = yyvs;
1161 
1162   goto yysetstate;
1163 
1164 /*------------------------------------------------------------.
1165 | yynewstate -- Push a new state, which is found in yystate.  |
1166 `------------------------------------------------------------*/
1167  yynewstate:
1168   /* In all cases, when you get here, the value and location stacks
1169      have just been pushed.  So pushing a state here evens the stacks.  */
1170   yyssp++;
1171 
1172  yysetstate:
1173   *yyssp = yystate;
1174 
1175   if (yyss + yystacksize - 1 <= yyssp)
1176     {
1177       /* Get the current used size of the three stacks, in elements.  */
1178       YYSIZE_T yysize = yyssp - yyss + 1;
1179 
1180 #ifdef yyoverflow
1181       {
1182 	/* Give user a chance to reallocate the stack.  Use copies of
1183 	   these so that the &'s don't force the real ones into
1184 	   memory.  */
1185 	YYSTYPE *yyvs1 = yyvs;
1186 	yytype_int16 *yyss1 = yyss;
1187 
1188 
1189 	/* Each stack pointer address is followed by the size of the
1190 	   data in use in that stack, in bytes.  This used to be a
1191 	   conditional around just the two extra args, but that might
1192 	   be undefined if yyoverflow is a macro.  */
1193 	yyoverflow (YY_("memory exhausted"),
1194 		    &yyss1, yysize * sizeof (*yyssp),
1195 		    &yyvs1, yysize * sizeof (*yyvsp),
1196 
1197 		    &yystacksize);
1198 
1199 	yyss = yyss1;
1200 	yyvs = yyvs1;
1201       }
1202 #else /* no yyoverflow */
1203 # ifndef YYSTACK_RELOCATE
1204       goto yyexhaustedlab;
1205 # else
1206       /* Extend the stack our own way.  */
1207       if (YYMAXDEPTH <= yystacksize)
1208 	goto yyexhaustedlab;
1209       yystacksize *= 2;
1210       if (YYMAXDEPTH < yystacksize)
1211 	yystacksize = YYMAXDEPTH;
1212 
1213       {
1214 	yytype_int16 *yyss1 = yyss;
1215 	union yyalloc *yyptr =
1216 	  (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1217 	if (! yyptr)
1218 	  goto yyexhaustedlab;
1219 	YYSTACK_RELOCATE (yyss);
1220 	YYSTACK_RELOCATE (yyvs);
1221 
1222 #  undef YYSTACK_RELOCATE
1223 	if (yyss1 != yyssa)
1224 	  YYSTACK_FREE (yyss1);
1225       }
1226 # endif
1227 #endif /* no yyoverflow */
1228 
1229       yyssp = yyss + yysize - 1;
1230       yyvsp = yyvs + yysize - 1;
1231 
1232 
1233       YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1234 		  (unsigned long int) yystacksize));
1235 
1236       if (yyss + yystacksize - 1 <= yyssp)
1237 	YYABORT;
1238     }
1239 
1240   YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1241 
1242   goto yybackup;
1243 
1244 /*-----------.
1245 | yybackup.  |
1246 `-----------*/
1247 yybackup:
1248 
1249   /* Do appropriate processing given the current state.  Read a
1250      look-ahead token if we need one and don't already have one.  */
1251 
1252   /* First try to decide what to do without reference to look-ahead token.  */
1253   yyn = yypact[yystate];
1254   if (yyn == YYPACT_NINF)
1255     goto yydefault;
1256 
1257   /* Not known => get a look-ahead token if don't already have one.  */
1258 
1259   /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol.  */
1260   if (yychar == YYEMPTY)
1261     {
1262       YYDPRINTF ((stderr, "Reading a token: "));
1263       yychar = YYLEX;
1264     }
1265 
1266   if (yychar <= YYEOF)
1267     {
1268       yychar = yytoken = YYEOF;
1269       YYDPRINTF ((stderr, "Now at end of input.\n"));
1270     }
1271   else
1272     {
1273       yytoken = YYTRANSLATE (yychar);
1274       YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1275     }
1276 
1277   /* If the proper action on seeing token YYTOKEN is to reduce or to
1278      detect an error, take that action.  */
1279   yyn += yytoken;
1280   if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1281     goto yydefault;
1282   yyn = yytable[yyn];
1283   if (yyn <= 0)
1284     {
1285       if (yyn == 0 || yyn == YYTABLE_NINF)
1286 	goto yyerrlab;
1287       yyn = -yyn;
1288       goto yyreduce;
1289     }
1290 
1291   if (yyn == YYFINAL)
1292     YYACCEPT;
1293 
1294   /* Count tokens shifted since error; after three, turn off error
1295      status.  */
1296   if (yyerrstatus)
1297     yyerrstatus--;
1298 
1299   /* Shift the look-ahead token.  */
1300   YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1301 
1302   /* Discard the shifted token unless it is eof.  */
1303   if (yychar != YYEOF)
1304     yychar = YYEMPTY;
1305 
1306   yystate = yyn;
1307   *++yyvsp = yylval;
1308 
1309   goto yynewstate;
1310 
1311 
1312 /*-----------------------------------------------------------.
1313 | yydefault -- do the default action for the current state.  |
1314 `-----------------------------------------------------------*/
1315 yydefault:
1316   yyn = yydefact[yystate];
1317   if (yyn == 0)
1318     goto yyerrlab;
1319   goto yyreduce;
1320 
1321 
1322 /*-----------------------------.
1323 | yyreduce -- Do a reduction.  |
1324 `-----------------------------*/
1325 yyreduce:
1326   /* yyn is the number of a rule to reduce with.  */
1327   yylen = yyr2[yyn];
1328 
1329   /* If YYLEN is nonzero, implement the default value of the action:
1330      `$$ = $1'.
1331 
1332      Otherwise, the following line sets YYVAL to garbage.
1333      This behavior is undocumented and Bison
1334      users should not rely upon it.  Assigning to YYVAL
1335      unconditionally makes the parser a bit smaller, and it avoids a
1336      GCC warning that YYVAL may be used uninitialized.  */
1337   yyval = yyvsp[1-yylen];
1338 
1339 
1340   YY_REDUCE_PRINT (yyn);
1341   switch (yyn)
1342     {
1343         case 2:
1344 #line 32 "expr.ypp"
1345     { result = (yyvsp[(1) - (1)]); ;}
1346     break;
1347 
1348   case 3:
1349 #line 36 "expr.ypp"
1350     { (yyval) = (yyvsp[(1) - (1)]); ;}
1351     break;
1352 
1353   case 4:
1354 #line 37 "expr.ypp"
1355     { (yyval) = (yyvsp[(2) - (3)]); ;}
1356     break;
1357 
1358   case 5:
1359 #line 38 "expr.ypp"
1360     { (yyval) = exprNodeDot((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)])); ;}
1361     break;
1362 
1363   case 6:
1364 #line 39 "expr.ypp"
1365     { (yyval) = exprNodeArrow((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)])); ;}
1366     break;
1367 
1368   case 7:
1369 #line 40 "expr.ypp"
1370     { (yyval) = exprNodeArray((yyvsp[(1) - (4)]), (yyvsp[(3) - (4)])); ;}
1371     break;
1372 
1373   case 8:
1374 #line 43 "expr.ypp"
1375     { (yyval) = (yyvsp[(1) - (1)]); ;}
1376     break;
1377 
1378   case 9:
1379 #line 44 "expr.ypp"
1380     { (yyval) = exprNodeStar((yyvsp[(2) - (2)])); ;}
1381     break;
1382 
1383   case 10:
1384 #line 45 "expr.ypp"
1385     { (yyval) = exprNodeAddr((yyvsp[(2) - (2)])); ;}
1386     break;
1387 
1388   case 11:
1389 #line 46 "expr.ypp"
1390     { (yyval) = exprNodeSizeof((yyvsp[(3) - (4)])); ;}
1391     break;
1392 
1393   case 12:
1394 #line 50 "expr.ypp"
1395     { (yyval) = exprNodeNumber(); ;}
1396     break;
1397 
1398   case 13:
1399 #line 54 "expr.ypp"
1400     {(yyval) = exprNodeIdentifier(); ;}
1401     break;
1402 
1403 
1404 /* Line 1267 of yacc.c.  */
1405 #line 1410 "expr.tab.cpp"
1406       default: break;
1407     }
1408   YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
1409 
1410   YYPOPSTACK (yylen);
1411   yylen = 0;
1412   YY_STACK_PRINT (yyss, yyssp);
1413 
1414   *++yyvsp = yyval;
1415 
1416 
1417   /* Now `shift' the result of the reduction.  Determine what state
1418      that goes to, based on the state we popped back to and the rule
1419      number reduced by.  */
1420 
1421   yyn = yyr1[yyn];
1422 
1423   yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1424   if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1425     yystate = yytable[yystate];
1426   else
1427     yystate = yydefgoto[yyn - YYNTOKENS];
1428 
1429   goto yynewstate;
1430 
1431 
1432 /*------------------------------------.
1433 | yyerrlab -- here on detecting error |
1434 `------------------------------------*/
1435 yyerrlab:
1436   /* If not already recovering from an error, report this error.  */
1437   if (!yyerrstatus)
1438     {
1439       ++yynerrs;
1440 #if ! YYERROR_VERBOSE
1441       yyerror (YY_("syntax error"));
1442 #else
1443       {
1444 	YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
1445 	if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
1446 	  {
1447 	    YYSIZE_T yyalloc = 2 * yysize;
1448 	    if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
1449 	      yyalloc = YYSTACK_ALLOC_MAXIMUM;
1450 	    if (yymsg != yymsgbuf)
1451 	      YYSTACK_FREE (yymsg);
1452 	    yymsg = (char *) YYSTACK_ALLOC (yyalloc);
1453 	    if (yymsg)
1454 	      yymsg_alloc = yyalloc;
1455 	    else
1456 	      {
1457 		yymsg = yymsgbuf;
1458 		yymsg_alloc = sizeof yymsgbuf;
1459 	      }
1460 	  }
1461 
1462 	if (0 < yysize && yysize <= yymsg_alloc)
1463 	  {
1464 	    (void) yysyntax_error (yymsg, yystate, yychar);
1465 	    yyerror (yymsg);
1466 	  }
1467 	else
1468 	  {
1469 	    yyerror (YY_("syntax error"));
1470 	    if (yysize != 0)
1471 	      goto yyexhaustedlab;
1472 	  }
1473       }
1474 #endif
1475     }
1476 
1477 
1478 
1479   if (yyerrstatus == 3)
1480     {
1481       /* If just tried and failed to reuse look-ahead token after an
1482 	 error, discard it.  */
1483 
1484       if (yychar <= YYEOF)
1485 	{
1486 	  /* Return failure if at end of input.  */
1487 	  if (yychar == YYEOF)
1488 	    YYABORT;
1489 	}
1490       else
1491 	{
1492 	  yydestruct ("Error: discarding",
1493 		      yytoken, &yylval);
1494 	  yychar = YYEMPTY;
1495 	}
1496     }
1497 
1498   /* Else will try to reuse look-ahead token after shifting the error
1499      token.  */
1500   goto yyerrlab1;
1501 
1502 
1503 /*---------------------------------------------------.
1504 | yyerrorlab -- error raised explicitly by YYERROR.  |
1505 `---------------------------------------------------*/
1506 yyerrorlab:
1507 
1508   /* Pacify compilers like GCC when the user code never invokes
1509      YYERROR and the label yyerrorlab therefore never appears in user
1510      code.  */
1511   if (/*CONSTCOND*/ 0)
1512      goto yyerrorlab;
1513 
1514   /* Do not reclaim the symbols of the rule which action triggered
1515      this YYERROR.  */
1516   YYPOPSTACK (yylen);
1517   yylen = 0;
1518   YY_STACK_PRINT (yyss, yyssp);
1519   yystate = *yyssp;
1520   goto yyerrlab1;
1521 
1522 
1523 /*-------------------------------------------------------------.
1524 | yyerrlab1 -- common code for both syntax error and YYERROR.  |
1525 `-------------------------------------------------------------*/
1526 yyerrlab1:
1527   yyerrstatus = 3;	/* Each real token shifted decrements this.  */
1528 
1529   for (;;)
1530     {
1531       yyn = yypact[yystate];
1532       if (yyn != YYPACT_NINF)
1533 	{
1534 	  yyn += YYTERROR;
1535 	  if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1536 	    {
1537 	      yyn = yytable[yyn];
1538 	      if (0 < yyn)
1539 		break;
1540 	    }
1541 	}
1542 
1543       /* Pop the current state because it cannot handle the error token.  */
1544       if (yyssp == yyss)
1545 	YYABORT;
1546 
1547 
1548       yydestruct ("Error: popping",
1549 		  yystos[yystate], yyvsp);
1550       YYPOPSTACK (1);
1551       yystate = *yyssp;
1552       YY_STACK_PRINT (yyss, yyssp);
1553     }
1554 
1555   if (yyn == YYFINAL)
1556     YYACCEPT;
1557 
1558   *++yyvsp = yylval;
1559 
1560 
1561   /* Shift the error token.  */
1562   YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
1563 
1564   yystate = yyn;
1565   goto yynewstate;
1566 
1567 
1568 /*-------------------------------------.
1569 | yyacceptlab -- YYACCEPT comes here.  |
1570 `-------------------------------------*/
1571 yyacceptlab:
1572   yyresult = 0;
1573   goto yyreturn;
1574 
1575 /*-----------------------------------.
1576 | yyabortlab -- YYABORT comes here.  |
1577 `-----------------------------------*/
1578 yyabortlab:
1579   yyresult = 1;
1580   goto yyreturn;
1581 
1582 #ifndef yyoverflow
1583 /*-------------------------------------------------.
1584 | yyexhaustedlab -- memory exhaustion comes here.  |
1585 `-------------------------------------------------*/
1586 yyexhaustedlab:
1587   yyerror (YY_("memory exhausted"));
1588   yyresult = 2;
1589   /* Fall through.  */
1590 #endif
1591 
1592 yyreturn:
1593   if (yychar != YYEOF && yychar != YYEMPTY)
1594      yydestruct ("Cleanup: discarding lookahead",
1595 		 yytoken, &yylval);
1596   /* Do not reclaim the symbols of the rule which action triggered
1597      this YYABORT or YYACCEPT.  */
1598   YYPOPSTACK (yylen);
1599   YY_STACK_PRINT (yyss, yyssp);
1600   while (yyssp != yyss)
1601     {
1602       yydestruct ("Cleanup: popping",
1603 		  yystos[*yyssp], yyvsp);
1604       YYPOPSTACK (1);
1605     }
1606 #ifndef yyoverflow
1607   if (yyss != yyssa)
1608     YYSTACK_FREE (yyss);
1609 #endif
1610 #if YYERROR_VERBOSE
1611   if (yymsg != yymsgbuf)
1612     YYSTACK_FREE (yymsg);
1613 #endif
1614   /* Make sure YYID is used.  */
1615   return YYID (yyresult);
1616 }
1617 
1618 
1619 #line 57 "expr.ypp"
1620 
1621 
yyerror(const char * s)1622 int yyerror(const char *s)
1623 {
1624   return 0;
1625 }
1626 
1627 #ifndef SDL
1628 extern FILE *yyin;
main(int argc,char ** argv)1629 int main(int argc, char **argv)
1630 {
1631   //  yydebug = 1;
1632   ++argv, --argc;
1633   if(argc > 0)
1634     yyin = fopen(argv[0], "r");
1635   else
1636     yyin = stdin;
1637   if(!yyparse())
1638     result->print();
1639 }
1640 #endif
1641 
1642