CalcGrammar.cpp

Go to the documentation of this file.
00001 /* A Bison parser, made by GNU Bison 2.3.  */
00002 
00003 /* Skeleton implementation for Bison's Yacc-like parsers in C
00004 
00005    Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
00006    Free Software Foundation, Inc.
00007 
00008    This program is free software; you can redistribute it and/or modify
00009    it under the terms of the GNU General Public License as published by
00010    the Free Software Foundation; either version 2, or (at your option)
00011    any later version.
00012 
00013    This program is distributed in the hope that it will be useful,
00014    but WITHOUT ANY WARRANTY; without even the implied warranty of
00015    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016    GNU General Public License for more details.
00017 
00018    You should have received a copy of the GNU General Public License
00019    along with this program; if not, write to the Free Software
00020    Foundation, Inc., 51 Franklin Street, Fifth Floor,
00021    Boston, MA 02110-1301, USA.  */
00022 
00023 /* As a special exception, you may create a larger work that contains
00024    part or all of the Bison parser skeleton and distribute that work
00025    under terms of your choice, so long as that work isn't itself a
00026    parser generator using the skeleton or a modified version thereof
00027    as a parser skeleton.  Alternatively, if you modify or redistribute
00028    the parser skeleton itself, you may (at your option) remove this
00029    special exception, which will cause the skeleton and the resulting
00030    Bison output files to be licensed under the GNU General Public
00031    License without this special exception.
00032 
00033    This special exception was added by the Free Software Foundation in
00034    version 2.2 of Bison.  */
00035 
00036 /* C LALR(1) parser skeleton written by Richard Stallman, by
00037    simplifying the original so-called "semantic" parser.  */
00038 
00039 /* All symbols defined below should begin with yy or YY, to avoid
00040    infringing on user name space.  This should be done even for local
00041    variables, as they might otherwise be expanded by user macros.
00042    There are some unavoidable exceptions within include files to
00043    define necessary library symbols; they are noted "INFRINGES ON
00044    USER NAME SPACE" below.  */
00045 
00046 /* Identify Bison output.  */
00047 #define YYBISON 1
00048 
00049 /* Bison version.  */
00050 #define YYBISON_VERSION "2.3"
00051 
00052 /* Skeleton name.  */
00053 #define YYSKELETON_NAME "yacc.c"
00054 
00055 /* Pure parsers.  */
00056 #define YYPURE 1
00057 
00058 /* Using locations.  */
00059 #define YYLSP_NEEDED 1
00060 
00061 /* Substitute the variable and function names.  */
00062 #define yyparse CalcYYparse
00063 #define yylex   CalcYYlex
00064 #define yyerror CalcYYerror
00065 #define yylval  CalcYYlval
00066 #define yychar  CalcYYchar
00067 #define yydebug CalcYYdebug
00068 #define yynerrs CalcYYnerrs
00069 #define yylloc CalcYYlloc
00070 
00071 /* Tokens.  */
00072 #ifndef YYTOKENTYPE
00073 # define YYTOKENTYPE
00074    /* Put the tokens into the symbol table, so that GDB and other debuggers
00075       know about them.  */
00076    enum yytokentype {
00077      UNSIGNED_INTEGER = 258,
00078      NEGATIVE_INTEGER = 259,
00079      REAL = 260,
00080      STRING = 261,
00081      UNKNOWN_TOKEN = 262,
00082      COMMA = 263,
00083      TERM = 264,
00084      CODE_START = 265,
00085      LPAREN = 266,
00086      RPAREN = 267,
00087      WS = 268,
00088      AT = 269,
00089      REG_LOCAL = 270,
00090      REG_STATUS = 271,
00091      REG_LITERAL = 272,
00092      REG_INPUT = 273,
00093      REG_OUTPUT = 274,
00094      VALUES = 275,
00095      TYPE_FIXED = 276,
00096      TYPE_VARIABLE = 277,
00097      OPCODE = 278,
00098      NAME = 279
00099    };
00100 #endif
00101 /* Tokens.  */
00102 #define UNSIGNED_INTEGER 258
00103 #define NEGATIVE_INTEGER 259
00104 #define REAL 260
00105 #define STRING 261
00106 #define UNKNOWN_TOKEN 262
00107 #define COMMA 263
00108 #define TERM 264
00109 #define CODE_START 265
00110 #define LPAREN 266
00111 #define RPAREN 267
00112 #define WS 268
00113 #define AT 269
00114 #define REG_LOCAL 270
00115 #define REG_STATUS 271
00116 #define REG_LITERAL 272
00117 #define REG_INPUT 273
00118 #define REG_OUTPUT 274
00119 #define VALUES 275
00120 #define TYPE_FIXED 276
00121 #define TYPE_VARIABLE 277
00122 #define OPCODE 278
00123 #define NAME 279
00124 
00125 
00126 
00127 
00128 /* Copy the first part of user declarations.  */
00129 #line 29 "CalcGrammar.ypp"
00130 
00131 #include "fennel/common/CommonPreamble.h"
00132 #include "fennel/disruptivetech/calc/InstructionCommon.h"
00133 #include "fennel/disruptivetech/calc/CalcAssembler.h"
00134 
00135 FENNEL_BEGIN_CPPFILE("$Id: //open/dev/fennel/disruptivetech/calc/CalcGrammar.ypp#4 $");
00136 
00137 /* Define parameters for yyparse and yylex so we can pass them as
00138    arguments and create a re-entrant parser/lexer */
00139 #define YYPARSE_PARAM parm
00140 #define YYLEX_PARAM   parm
00141 #define YYSTYPE       CalcTokenValue
00142 #define YYERROR_VERBOSE
00143 #define YYLTYPE       CalcYYLocType
00144 
00145 /* Define our own macro for updating the location so that
00146    the character position is also updated */
00147 # define YYLLOC_DEFAULT(Current, Rhs, N)        \
00148 {                                               \
00149    (Current).last_line   = (Rhs)[(N)].last_line;        \
00150    (Current).last_column = (Rhs)[(N)].last_column;    \
00151    (Current).last_pos    = (Rhs)[(N)].last_pos;       \
00152 }
00153 
00154 int  CalcYYlex(YYSTYPE*, YYLTYPE*, void*);
00155 void CalcYYerror(const char*);
00156 
00157 
00158 
00159 /* Enabling traces.  */
00160 #ifndef YYDEBUG
00161 # define YYDEBUG 0
00162 #endif
00163 
00164 /* Enabling verbose error messages.  */
00165 #ifdef YYERROR_VERBOSE
00166 # undef YYERROR_VERBOSE
00167 # define YYERROR_VERBOSE 1
00168 #else
00169 # define YYERROR_VERBOSE 0
00170 #endif
00171 
00172 /* Enabling the token table.  */
00173 #ifndef YYTOKEN_TABLE
00174 # define YYTOKEN_TABLE 0
00175 #endif
00176 
00177 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
00178 typedef int YYSTYPE;
00179 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
00180 # define YYSTYPE_IS_DECLARED 1
00181 # define YYSTYPE_IS_TRIVIAL 1
00182 #endif
00183 
00184 #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
00185 typedef struct YYLTYPE
00186 {
00187   int first_line;
00188   int first_column;
00189   int last_line;
00190   int last_column;
00191 } YYLTYPE;
00192 # define yyltype YYLTYPE /* obsolescent; will be withdrawn */
00193 # define YYLTYPE_IS_DECLARED 1
00194 # define YYLTYPE_IS_TRIVIAL 1
00195 #endif
00196 
00197 
00198 /* Copy the second part of user declarations.  */
00199 
00200 
00201 /* Line 216 of yacc.c.  */
00202 #line 203 "CalcGrammar.cpp"
00203 
00204 #ifdef short
00205 # undef short
00206 #endif
00207 
00208 #ifdef YYTYPE_UINT8
00209 typedef YYTYPE_UINT8 yytype_uint8;
00210 #else
00211 typedef unsigned char yytype_uint8;
00212 #endif
00213 
00214 #ifdef YYTYPE_INT8
00215 typedef YYTYPE_INT8 yytype_int8;
00216 #elif (defined __STDC__ || defined __C99__FUNC__ \
00217      || defined __cplusplus || defined _MSC_VER)
00218 typedef signed char yytype_int8;
00219 #else
00220 typedef short int yytype_int8;
00221 #endif
00222 
00223 #ifdef YYTYPE_UINT16
00224 typedef YYTYPE_UINT16 yytype_uint16;
00225 #else
00226 typedef unsigned short int yytype_uint16;
00227 #endif
00228 
00229 #ifdef YYTYPE_INT16
00230 typedef YYTYPE_INT16 yytype_int16;
00231 #else
00232 typedef short int yytype_int16;
00233 #endif
00234 
00235 #ifndef YYSIZE_T
00236 # ifdef __SIZE_TYPE__
00237 #  define YYSIZE_T __SIZE_TYPE__
00238 # elif defined size_t
00239 #  define YYSIZE_T size_t
00240 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
00241      || defined __cplusplus || defined _MSC_VER)
00242 #  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
00243 #  define YYSIZE_T size_t
00244 # else
00245 #  define YYSIZE_T unsigned int
00246 # endif
00247 #endif
00248 
00249 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
00250 
00251 #ifndef YY_
00252 # if YYENABLE_NLS
00253 #  if ENABLE_NLS
00254 #   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
00255 #   define YY_(msgid) dgettext ("bison-runtime", msgid)
00256 #  endif
00257 # endif
00258 # ifndef YY_
00259 #  define YY_(msgid) msgid
00260 # endif
00261 #endif
00262 
00263 /* Suppress unused-variable warnings by "using" E.  */
00264 #if ! defined lint || defined __GNUC__
00265 # define YYUSE(e) ((void) (e))
00266 #else
00267 # define YYUSE(e) /* empty */
00268 #endif
00269 
00270 /* Identity function, used to suppress warnings about constant conditions.  */
00271 #ifndef lint
00272 # define YYID(n) (n)
00273 #else
00274 #if (defined __STDC__ || defined __C99__FUNC__ \
00275      || defined __cplusplus || defined _MSC_VER)
00276 static int
00277 YYID (int i)
00278 #else
00279 static int
00280 YYID (i)
00281     int i;
00282 #endif
00283 {
00284   return i;
00285 }
00286 #endif
00287 
00288 #if ! defined yyoverflow || YYERROR_VERBOSE
00289 
00290 /* The parser invokes alloca or malloc; define the necessary symbols.  */
00291 
00292 # ifdef YYSTACK_USE_ALLOCA
00293 #  if YYSTACK_USE_ALLOCA
00294 #   ifdef __GNUC__
00295 #    define YYSTACK_ALLOC __builtin_alloca
00296 #   elif defined __BUILTIN_VA_ARG_INCR
00297 #    include <alloca.h> /* INFRINGES ON USER NAME SPACE */
00298 #   elif defined _AIX
00299 #    define YYSTACK_ALLOC __alloca
00300 #   elif defined _MSC_VER
00301 #    include <malloc.h> /* INFRINGES ON USER NAME SPACE */
00302 #    define alloca _alloca
00303 #   else
00304 #    define YYSTACK_ALLOC alloca
00305 #    if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
00306      || defined __cplusplus || defined _MSC_VER)
00307 #     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
00308 #     ifndef _STDLIB_H
00309 #      define _STDLIB_H 1
00310 #     endif
00311 #    endif
00312 #   endif
00313 #  endif
00314 # endif
00315 
00316 # ifdef YYSTACK_ALLOC
00317    /* Pacify GCC's `empty if-body' warning.  */
00318 #  define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
00319 #  ifndef YYSTACK_ALLOC_MAXIMUM
00320     /* The OS might guarantee only one guard page at the bottom of the stack,
00321        and a page size can be as small as 4096 bytes.  So we cannot safely
00322        invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number
00323        to allow for a few compiler-allocated temporary stack slots.  */
00324 #   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
00325 #  endif
00326 # else
00327 #  define YYSTACK_ALLOC YYMALLOC
00328 #  define YYSTACK_FREE YYFREE
00329 #  ifndef YYSTACK_ALLOC_MAXIMUM
00330 #   define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
00331 #  endif
00332 #  if (defined __cplusplus && ! defined _STDLIB_H \
00333        && ! ((defined YYMALLOC || defined malloc) \
00334          && (defined YYFREE || defined free)))
00335 #   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
00336 #   ifndef _STDLIB_H
00337 #    define _STDLIB_H 1
00338 #   endif
00339 #  endif
00340 #  ifndef YYMALLOC
00341 #   define YYMALLOC malloc
00342 #   if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
00343      || defined __cplusplus || defined _MSC_VER)
00344 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
00345 #   endif
00346 #  endif
00347 #  ifndef YYFREE
00348 #   define YYFREE free
00349 #   if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
00350      || defined __cplusplus || defined _MSC_VER)
00351 void free (void *); /* INFRINGES ON USER NAME SPACE */
00352 #   endif
00353 #  endif
00354 # endif
00355 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
00356 
00357 
00358 #if (! defined yyoverflow \
00359      && (! defined __cplusplus \
00360      || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
00361          && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
00362 
00363 /* A type that is properly aligned for any stack member.  */
00364 union yyalloc
00365 {
00366   yytype_int16 yyss;
00367   YYSTYPE yyvs;
00368     YYLTYPE yyls;
00369 };
00370 
00371 /* The size of the maximum gap between one aligned stack and the next.  */
00372 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
00373 
00374 /* The size of an array large to enough to hold all stacks, each with
00375    N elements.  */
00376 # define YYSTACK_BYTES(N) \
00377      ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
00378       + 2 * YYSTACK_GAP_MAXIMUM)
00379 
00380 /* Copy COUNT objects from FROM to TO.  The source and destination do
00381    not overlap.  */
00382 # ifndef YYCOPY
00383 #  if defined __GNUC__ && 1 < __GNUC__
00384 #   define YYCOPY(To, From, Count) \
00385       __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
00386 #  else
00387 #   define YYCOPY(To, From, Count)      \
00388       do                    \
00389     {                   \
00390       YYSIZE_T yyi;             \
00391       for (yyi = 0; yyi < (Count); yyi++)   \
00392         (To)[yyi] = (From)[yyi];        \
00393     }                   \
00394       while (YYID (0))
00395 #  endif
00396 # endif
00397 
00398 /* Relocate STACK from its old location to the new one.  The
00399    local variables YYSIZE and YYSTACKSIZE give the old and new number of
00400    elements in the stack, and YYPTR gives the new location of the
00401    stack.  Advance YYPTR to a properly aligned location for the next
00402    stack.  */
00403 # define YYSTACK_RELOCATE(Stack)                    \
00404     do                                  \
00405       {                                 \
00406     YYSIZE_T yynewbytes;                        \
00407     YYCOPY (&yyptr->Stack, Stack, yysize);              \
00408     Stack = &yyptr->Stack;                      \
00409     yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
00410     yyptr += yynewbytes / sizeof (*yyptr);              \
00411       }                                 \
00412     while (YYID (0))
00413 
00414 #endif
00415 
00416 /* YYFINAL -- State number of the termination state.  */
00417 #define YYFINAL  3
00418 /* YYLAST -- Last index in YYTABLE.  */
00419 #define YYLAST   81
00420 
00421 /* YYNTOKENS -- Number of terminals.  */
00422 #define YYNTOKENS  25
00423 /* YYNNTS -- Number of nonterminals.  */
00424 #define YYNNTS  32
00425 /* YYNRULES -- Number of rules.  */
00426 #define YYNRULES  58
00427 /* YYNRULES -- Number of states.  */
00428 #define YYNSTATES  94
00429 
00430 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
00431 #define YYUNDEFTOK  2
00432 #define YYMAXUTOK   279
00433 
00434 #define YYTRANSLATE(YYX)                        \
00435   ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
00436 
00437 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
00438 static const yytype_uint8 yytranslate[] =
00439 {
00440        0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00441        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00442        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00443        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00444        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00445        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00446        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00447        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00448        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00449        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00450        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00451        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00452        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00453        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00454        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00455        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00456        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00457        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00458        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00459        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00460        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00461        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00462        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00463        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00464        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00465        2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
00466        5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
00467       15,    16,    17,    18,    19,    20,    21,    22,    23,    24
00468 };
00469 
00470 #if YYDEBUG
00471 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
00472    YYRHS.  */
00473 static const yytype_uint8 yyprhs[] =
00474 {
00475        0,     0,     3,     4,     5,    12,    15,    17,    20,    21,
00476       26,    27,    28,    32,    33,    38,    39,    44,    46,    50,
00477       52,    54,    56,    58,    59,    61,    63,    65,    67,    69,
00478       73,    75,    79,    81,    83,    86,    94,   100,   104,   108,
00479      114,   121,   124,   126,   129,   131,   133,   135,   137,   139,
00480      141,   143,   145,   147,   151,   154,   157,   160,   163
00481 };
00482 
00483 /* YYRHS -- A `-1'-separated list of the rules' RHS.  */
00484 static const yytype_int8 yyrhs[] =
00485 {
00486       26,     0,    -1,    -1,    -1,    27,    29,    28,    10,     9,
00487       44,    -1,    30,    33,    -1,    31,    -1,    30,    31,    -1,
00488       -1,    41,    32,    43,     9,    -1,    -1,    -1,    35,    34,
00489       37,    -1,    -1,    17,    36,    43,     9,    -1,    -1,    20,
00490       39,    38,     9,    -1,    40,    -1,    39,     8,    40,    -1,
00491        3,    -1,     4,    -1,     5,    -1,     6,    -1,    -1,    15,
00492       -1,    16,    -1,    18,    -1,    19,    -1,    21,    -1,    22,
00493        8,     3,    -1,    42,    -1,    43,     8,    42,    -1,    45,
00494       -1,    46,    -1,    45,    46,    -1,    23,    49,     8,    50,
00495        8,    50,     9,    -1,    23,    49,     8,    50,     9,    -1,
00496       23,    50,     9,    -1,    23,    48,     9,    -1,    23,    48,
00497        8,    50,     9,    -1,    23,    24,    11,    51,    12,     9,
00498       -1,    23,     9,    -1,     3,    -1,    14,    47,    -1,    52,
00499       -1,    56,    -1,    54,    -1,    52,    -1,    56,    -1,    53,
00500       -1,    54,    -1,    55,    -1,    50,    -1,    51,     8,    50,
00501       -1,    19,    47,    -1,    18,    47,    -1,    16,    47,    -1,
00502       17,    47,    -1,    15,    47,    -1
00503 };
00504 
00505 /* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
00506 static const yytype_uint8 yyrline[] =
00507 {
00508        0,   106,   106,   108,   106,   113,   116,   116,   119,   119,
00509      123,   124,   124,   127,   127,   131,   131,   134,   134,   137,
00510      138,   139,   140,   141,   144,   144,   144,   144,   147,   148,
00511      152,   153,   156,   159,   160,   164,   169,   174,   179,   184,
00512      189,   194,   200,   203,   206,   206,   206,   209,   209,   209,
00513      209,   209,   212,   213,   216,   217,   218,   219,   220
00514 };
00515 #endif
00516 
00517 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
00518 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
00519    First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
00520 static const char *const yytname[] =
00521 {
00522   "$end", "error", "$undefined", "UNSIGNED_INTEGER", "NEGATIVE_INTEGER",
00523   "REAL", "STRING", "UNKNOWN_TOKEN", "COMMA", "TERM", "CODE_START",
00524   "LPAREN", "RPAREN", "WS", "AT", "REG_LOCAL", "REG_STATUS", "REG_LITERAL",
00525   "REG_INPUT", "REG_OUTPUT", "VALUES", "TYPE_FIXED", "TYPE_VARIABLE",
00526   "OPCODE", "NAME", "$accept", "program", "@1", "@2", "preamble",
00527   "register_sets", "register_set", "@3", "literal_set_values", "@4",
00528   "literal_set", "@5", "literal_values", "@6", "literal_defs",
00529   "literal_def", "set_name", "type_size", "type_size_list", "program_text",
00530   "instructions", "instruction", "index", "location", "result", "operand",
00531   "operand_list", "output_reg", "input_reg", "status_reg", "literal_reg",
00532   "local_reg", 0
00533 };
00534 #endif
00535 
00536 # ifdef YYPRINT
00537 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
00538    token YYLEX-NUM.  */
00539 static const yytype_uint16 yytoknum[] =
00540 {
00541        0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
00542      265,   266,   267,   268,   269,   270,   271,   272,   273,   274,
00543      275,   276,   277,   278,   279
00544 };
00545 # endif
00546 
00547 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
00548 static const yytype_uint8 yyr1[] =
00549 {
00550        0,    25,    27,    28,    26,    29,    30,    30,    32,    31,
00551       33,    34,    33,    36,    35,    38,    37,    39,    39,    40,
00552       40,    40,    40,    40,    41,    41,    41,    41,    42,    42,
00553       43,    43,    44,    45,    45,    46,    46,    46,    46,    46,
00554       46,    46,    47,    48,    49,    49,    49,    50,    50,    50,
00555       50,    50,    51,    51,    52,    53,    54,    55,    56
00556 };
00557 
00558 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
00559 static const yytype_uint8 yyr2[] =
00560 {
00561        0,     2,     0,     0,     6,     2,     1,     2,     0,     4,
00562        0,     0,     3,     0,     4,     0,     4,     1,     3,     1,
00563        1,     1,     1,     0,     1,     1,     1,     1,     1,     3,
00564        1,     3,     1,     1,     2,     7,     5,     3,     3,     5,
00565        6,     2,     1,     2,     1,     1,     1,     1,     1,     1,
00566        1,     1,     1,     3,     2,     2,     2,     2,     2
00567 };
00568 
00569 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
00570    STATE-NUM when YYTABLE doesn't specify something else to do.  Zero
00571    means the default is an error.  */
00572 static const yytype_uint8 yydefact[] =
00573 {
00574        2,     0,     0,     1,    24,    25,    26,    27,     3,    10,
00575        6,     8,     0,    13,     7,     5,    11,     0,     0,     0,
00576        0,    28,     0,    30,     0,     0,     0,    23,    12,     0,
00577        0,     9,     0,     4,    32,    33,    14,    19,    20,    21,
00578       22,    15,    17,    29,    31,    41,     0,     0,     0,     0,
00579        0,     0,     0,     0,     0,     0,    44,    49,    46,    51,
00580       45,    34,    23,     0,    42,    43,    58,    56,    57,    55,
00581       54,     0,     0,    38,     0,    37,    18,    16,    52,     0,
00582       47,    50,    48,     0,     0,     0,     0,    39,     0,    36,
00583       53,    40,     0,    35
00584 };
00585 
00586 /* YYDEFGOTO[NTERM-NUM].  */
00587 static const yytype_int8 yydefgoto[] =
00588 {
00589       -1,     1,     2,    12,     8,     9,    10,    17,    15,    20,
00590       16,    19,    28,    63,    41,    42,    11,    23,    24,    33,
00591       34,    35,    65,    53,    54,    55,    79,    80,    57,    81,
00592       59,    82
00593 };
00594 
00595 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
00596    STATE-NUM.  */
00597 #define YYPACT_NINF -72
00598 static const yytype_int8 yypact[] =
00599 {
00600      -72,     2,    24,   -72,   -72,   -72,   -72,   -72,   -72,   -11,
00601      -72,   -72,     6,   -72,   -72,   -72,   -72,   -12,    32,   -12,
00602       -8,   -72,    44,   -72,    36,    30,    38,    21,   -72,    51,
00603      -12,   -72,     4,   -72,    30,   -72,   -72,   -72,   -72,   -72,
00604      -72,    47,   -72,   -72,   -72,   -72,    53,    53,    53,    53,
00605       53,    53,    46,    40,    50,    52,    54,   -72,    55,   -72,
00606       56,   -72,    21,    57,   -72,   -72,   -72,   -72,   -72,   -72,
00607      -72,    14,    14,   -72,    14,   -72,   -72,   -72,   -72,     3,
00608      -72,   -72,   -72,    58,    42,    14,    59,   -72,    14,   -72,
00609      -72,   -72,    60,   -72
00610 };
00611 
00612 /* YYPGOTO[NTERM-NUM].  */
00613 static const yytype_int8 yypgoto[] =
00614 {
00615      -72,   -72,   -72,   -72,   -72,   -72,    61,   -72,   -72,   -72,
00616      -72,   -72,   -72,   -72,   -72,    -3,   -72,    41,    43,   -72,
00617      -72,    26,   -13,   -72,   -72,   -71,   -72,    45,   -72,    48,
00618      -72,    49
00619 };
00620 
00621 /* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
00622    positive, shift that token.  If negative, reduce the rule which
00623    number is the opposite.  If zero, do what YYDEFACT says.
00624    If YYTABLE_NINF, syntax error.  */
00625 #define YYTABLE_NINF -51
00626 static const yytype_int8 yytable[] =
00627 {
00628       78,    83,     3,    84,     4,     5,    13,     6,     7,    21,
00629       22,    85,    27,    45,    90,    86,    18,    92,    46,    47,
00630       48,    49,    50,    51,    37,    38,    39,    40,    52,    47,
00631       48,    49,    50,    51,    66,    67,    68,    69,    70,     4,
00632        5,    25,     6,     7,    30,    31,    30,    36,    72,    73,
00633       88,    89,    29,    32,    43,    62,    64,    71,    74,    76,
00634       61,    75,    26,   -47,   -50,   -48,    77,    87,    91,    93,
00635       14,    44,     0,     0,     0,     0,     0,    56,     0,     0,
00636       58,    60
00637 };
00638 
00639 static const yytype_int8 yycheck[] =
00640 {
00641       71,    72,     0,    74,    15,    16,    17,    18,    19,    21,
00642       22,     8,    20,     9,    85,    12,    10,    88,    14,    15,
00643       16,    17,    18,    19,     3,     4,     5,     6,    24,    15,
00644       16,    17,    18,    19,    47,    48,    49,    50,    51,    15,
00645       16,     9,    18,    19,     8,     9,     8,     9,     8,     9,
00646        8,     9,     8,    23,     3,     8,     3,    11,     8,    62,
00647       34,     9,    19,     9,     9,     9,     9,     9,     9,     9,
00648        9,    30,    -1,    -1,    -1,    -1,    -1,    32,    -1,    -1,
00649       32,    32
00650 };
00651 
00652 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
00653    symbol of state STATE-NUM.  */
00654 static const yytype_uint8 yystos[] =
00655 {
00656        0,    26,    27,     0,    15,    16,    18,    19,    29,    30,
00657       31,    41,    28,    17,    31,    33,    35,    32,    10,    36,
00658       34,    21,    22,    42,    43,     9,    43,    20,    37,     8,
00659        8,     9,    23,    44,    45,    46,     9,     3,     4,     5,
00660        6,    39,    40,     3,    42,     9,    14,    15,    16,    17,
00661       18,    19,    24,    48,    49,    50,    52,    53,    54,    55,
00662       56,    46,     8,    38,     3,    47,    47,    47,    47,    47,
00663       47,    11,     8,     9,     8,     9,    40,     9,    50,    51,
00664       52,    54,    56,    50,    50,     8,    12,     9,     8,     9,
00665       50,     9,    50,     9
00666 };
00667 
00668 #define yyerrok     (yyerrstatus = 0)
00669 #define yyclearin   (yychar = YYEMPTY)
00670 #define YYEMPTY     (-2)
00671 #define YYEOF       0
00672 
00673 #define YYACCEPT    goto yyacceptlab
00674 #define YYABORT     goto yyabortlab
00675 #define YYERROR     goto yyerrorlab
00676 
00677 
00678 /* Like YYERROR except do call yyerror.  This remains here temporarily
00679    to ease the transition to the new meaning of YYERROR, for GCC.
00680    Once GCC version 2 has supplanted version 1, this can go.  */
00681 
00682 #define YYFAIL      goto yyerrlab
00683 
00684 #define YYRECOVERING()  (!!yyerrstatus)
00685 
00686 #define YYBACKUP(Token, Value)                  \
00687 do                              \
00688   if (yychar == YYEMPTY && yylen == 1)              \
00689     {                               \
00690       yychar = (Token);                     \
00691       yylval = (Value);                     \
00692       yytoken = YYTRANSLATE (yychar);               \
00693       YYPOPSTACK (1);                       \
00694       goto yybackup;                        \
00695     }                               \
00696   else                              \
00697     {                               \
00698       yyerror (YY_("syntax error: cannot back up")); \
00699       YYERROR;                          \
00700     }                               \
00701 while (YYID (0))
00702 
00703 
00704 #define YYTERROR    1
00705 #define YYERRCODE   256
00706 
00707 
00708 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
00709    If N is 0, then set CURRENT to the empty location which ends
00710    the previous symbol: RHS[0] (always defined).  */
00711 
00712 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
00713 #ifndef YYLLOC_DEFAULT
00714 # define YYLLOC_DEFAULT(Current, Rhs, N)                \
00715     do                                  \
00716       if (YYID (N))                                                    \
00717     {                               \
00718       (Current).first_line   = YYRHSLOC (Rhs, 1).first_line;    \
00719       (Current).first_column = YYRHSLOC (Rhs, 1).first_column;  \
00720       (Current).last_line    = YYRHSLOC (Rhs, N).last_line;     \
00721       (Current).last_column  = YYRHSLOC (Rhs, N).last_column;   \
00722     }                               \
00723       else                              \
00724     {                               \
00725       (Current).first_line   = (Current).last_line   =      \
00726         YYRHSLOC (Rhs, 0).last_line;                \
00727       (Current).first_column = (Current).last_column =      \
00728         YYRHSLOC (Rhs, 0).last_column;              \
00729     }                               \
00730     while (YYID (0))
00731 #endif
00732 
00733 
00734 /* YY_LOCATION_PRINT -- Print the location on the stream.
00735    This macro was not mandated originally: define only if we know
00736    we won't break user code: when these are the locations we know.  */
00737 
00738 #ifndef YY_LOCATION_PRINT
00739 # if YYLTYPE_IS_TRIVIAL
00740 #  define YY_LOCATION_PRINT(File, Loc)          \
00741      fprintf (File, "%d.%d-%d.%d",          \
00742           (Loc).first_line, (Loc).first_column, \
00743           (Loc).last_line,  (Loc).last_column)
00744 # else
00745 #  define YY_LOCATION_PRINT(File, Loc) ((void) 0)
00746 # endif
00747 #endif
00748 
00749 
00750 /* YYLEX -- calling `yylex' with the right arguments.  */
00751 
00752 #ifdef YYLEX_PARAM
00753 # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
00754 #else
00755 # define YYLEX yylex (&yylval, &yylloc)
00756 #endif
00757 
00758 /* Enable debugging if requested.  */
00759 #if YYDEBUG
00760 
00761 # ifndef YYFPRINTF
00762 #  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
00763 #  define YYFPRINTF fprintf
00764 # endif
00765 
00766 # define YYDPRINTF(Args)            \
00767 do {                        \
00768   if (yydebug)                  \
00769     YYFPRINTF Args;             \
00770 } while (YYID (0))
00771 
00772 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)            \
00773 do {                                      \
00774   if (yydebug)                                \
00775     {                                     \
00776       YYFPRINTF (stderr, "%s ", Title);                   \
00777       yy_symbol_print (stderr,                        \
00778           Type, Value, Location); \
00779       YYFPRINTF (stderr, "\n");                       \
00780     }                                     \
00781 } while (YYID (0))
00782 
00783 
00784 /*--------------------------------.
00785 | Print this symbol on YYOUTPUT.  |
00786 `--------------------------------*/
00787 
00788 /*ARGSUSED*/
00789 #if (defined __STDC__ || defined __C99__FUNC__ \
00790      || defined __cplusplus || defined _MSC_VER)
00791 static void
00792 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp)
00793 #else
00794 static void
00795 yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp)
00796     FILE *yyoutput;
00797     int yytype;
00798     YYSTYPE const * const yyvaluep;
00799     YYLTYPE const * const yylocationp;
00800 #endif
00801 {
00802   if (!yyvaluep)
00803     return;
00804   YYUSE (yylocationp);
00805 # ifdef YYPRINT
00806   if (yytype < YYNTOKENS)
00807     YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
00808 # else
00809   YYUSE (yyoutput);
00810 # endif
00811   switch (yytype)
00812     {
00813       default:
00814     break;
00815     }
00816 }
00817 
00818 
00819 /*--------------------------------.
00820 | Print this symbol on YYOUTPUT.  |
00821 `--------------------------------*/
00822 
00823 #if (defined __STDC__ || defined __C99__FUNC__ \
00824      || defined __cplusplus || defined _MSC_VER)
00825 static void
00826 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp)
00827 #else
00828 static void
00829 yy_symbol_print (yyoutput, yytype, yyvaluep, yylocationp)
00830     FILE *yyoutput;
00831     int yytype;
00832     YYSTYPE const * const yyvaluep;
00833     YYLTYPE const * const yylocationp;
00834 #endif
00835 {
00836   if (yytype < YYNTOKENS)
00837     YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
00838   else
00839     YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
00840 
00841   YY_LOCATION_PRINT (yyoutput, *yylocationp);
00842   YYFPRINTF (yyoutput, ": ");
00843   yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp);
00844   YYFPRINTF (yyoutput, ")");
00845 }
00846 
00847 /*------------------------------------------------------------------.
00848 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
00849 | TOP (included).                                                   |
00850 `------------------------------------------------------------------*/
00851 
00852 #if (defined __STDC__ || defined __C99__FUNC__ \
00853      || defined __cplusplus || defined _MSC_VER)
00854 static void
00855 yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
00856 #else
00857 static void
00858 yy_stack_print (bottom, top)
00859     yytype_int16 *bottom;
00860     yytype_int16 *top;
00861 #endif
00862 {
00863   YYFPRINTF (stderr, "Stack now");
00864   for (; bottom <= top; ++bottom)
00865     YYFPRINTF (stderr, " %d", *bottom);
00866   YYFPRINTF (stderr, "\n");
00867 }
00868 
00869 # define YY_STACK_PRINT(Bottom, Top)                \
00870 do {                                \
00871   if (yydebug)                          \
00872     yy_stack_print ((Bottom), (Top));               \
00873 } while (YYID (0))
00874 
00875 
00876 /*------------------------------------------------.
00877 | Report that the YYRULE is going to be reduced.  |
00878 `------------------------------------------------*/
00879 
00880 #if (defined __STDC__ || defined __C99__FUNC__ \
00881      || defined __cplusplus || defined _MSC_VER)
00882 static void
00883 yy_reduce_print (YYSTYPE *yyvsp, YYLTYPE *yylsp, int yyrule)
00884 #else
00885 static void
00886 yy_reduce_print (yyvsp, yylsp, yyrule)
00887     YYSTYPE *yyvsp;
00888     YYLTYPE *yylsp;
00889     int yyrule;
00890 #endif
00891 {
00892   int yynrhs = yyr2[yyrule];
00893   int yyi;
00894   unsigned long int yylno = yyrline[yyrule];
00895   YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
00896          yyrule - 1, yylno);
00897   /* The symbols being reduced.  */
00898   for (yyi = 0; yyi < yynrhs; yyi++)
00899     {
00900       fprintf (stderr, "   $%d = ", yyi + 1);
00901       yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
00902                &(yyvsp[(yyi + 1) - (yynrhs)])
00903                , &(yylsp[(yyi + 1) - (yynrhs)])            );
00904       fprintf (stderr, "\n");
00905     }
00906 }
00907 
00908 # define YY_REDUCE_PRINT(Rule)      \
00909 do {                    \
00910   if (yydebug)              \
00911     yy_reduce_print (yyvsp, yylsp, Rule); \
00912 } while (YYID (0))
00913 
00914 /* Nonzero means print parse trace.  It is left uninitialized so that
00915    multiple parsers can coexist.  */
00916 int yydebug;
00917 #else /* !YYDEBUG */
00918 # define YYDPRINTF(Args)
00919 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
00920 # define YY_STACK_PRINT(Bottom, Top)
00921 # define YY_REDUCE_PRINT(Rule)
00922 #endif /* !YYDEBUG */
00923 
00924 
00925 /* YYINITDEPTH -- initial size of the parser's stacks.  */
00926 #ifndef YYINITDEPTH
00927 # define YYINITDEPTH 200
00928 #endif
00929 
00930 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
00931    if the built-in stack extension method is used).
00932 
00933    Do not make this value too large; the results are undefined if
00934    YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
00935    evaluated with infinite-precision integer arithmetic.  */
00936 
00937 #ifndef YYMAXDEPTH
00938 # define YYMAXDEPTH 10000
00939 #endif
00940 
00941 
00942 
00943 #if YYERROR_VERBOSE
00944 
00945 # ifndef yystrlen
00946 #  if defined __GLIBC__ && defined _STRING_H
00947 #   define yystrlen strlen
00948 #  else
00949 /* Return the length of YYSTR.  */
00950 #if (defined __STDC__ || defined __C99__FUNC__ \
00951      || defined __cplusplus || defined _MSC_VER)
00952 static YYSIZE_T
00953 yystrlen (const char *yystr)
00954 #else
00955 static YYSIZE_T
00956 yystrlen (yystr)
00957     const char *yystr;
00958 #endif
00959 {
00960   YYSIZE_T yylen;
00961   for (yylen = 0; yystr[yylen]; yylen++)
00962     continue;
00963   return yylen;
00964 }
00965 #  endif
00966 # endif
00967 
00968 # ifndef yystpcpy
00969 #  if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
00970 #   define yystpcpy stpcpy
00971 #  else
00972 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
00973    YYDEST.  */
00974 #if (defined __STDC__ || defined __C99__FUNC__ \
00975      || defined __cplusplus || defined _MSC_VER)
00976 static char *
00977 yystpcpy (char *yydest, const char *yysrc)
00978 #else
00979 static char *
00980 yystpcpy (yydest, yysrc)
00981     char *yydest;
00982     const char *yysrc;
00983 #endif
00984 {
00985   char *yyd = yydest;
00986   const char *yys = yysrc;
00987 
00988   while ((*yyd++ = *yys++) != '\0')
00989     continue;
00990 
00991   return yyd - 1;
00992 }
00993 #  endif
00994 # endif
00995 
00996 # ifndef yytnamerr
00997 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
00998    quotes and backslashes, so that it's suitable for yyerror.  The
00999    heuristic is that double-quoting is unnecessary unless the string
01000    contains an apostrophe, a comma, or backslash (other than
01001    backslash-backslash).  YYSTR is taken from yytname.  If YYRES is
01002    null, do not copy; instead, return the length of what the result
01003    would have been.  */
01004 static YYSIZE_T
01005 yytnamerr (char *yyres, const char *yystr)
01006 {
01007   if (*yystr == '"')
01008     {
01009       YYSIZE_T yyn = 0;
01010       char const *yyp = yystr;
01011 
01012       for (;;)
01013     switch (*++yyp)
01014       {
01015       case '\'':
01016       case ',':
01017         goto do_not_strip_quotes;
01018 
01019       case '\\':
01020         if (*++yyp != '\\')
01021           goto do_not_strip_quotes;
01022         /* Fall through.  */
01023       default:
01024         if (yyres)
01025           yyres[yyn] = *yyp;
01026         yyn++;
01027         break;
01028 
01029       case '"':
01030         if (yyres)
01031           yyres[yyn] = '\0';
01032         return yyn;
01033       }
01034     do_not_strip_quotes: ;
01035     }
01036 
01037   if (! yyres)
01038     return yystrlen (yystr);
01039 
01040   return yystpcpy (yyres, yystr) - yyres;
01041 }
01042 # endif
01043 
01044 /* Copy into YYRESULT an error message about the unexpected token
01045    YYCHAR while in state YYSTATE.  Return the number of bytes copied,
01046    including the terminating null byte.  If YYRESULT is null, do not
01047    copy anything; just return the number of bytes that would be
01048    copied.  As a special case, return 0 if an ordinary "syntax error"
01049    message will do.  Return YYSIZE_MAXIMUM if overflow occurs during
01050    size calculation.  */
01051 static YYSIZE_T
01052 yysyntax_error (char *yyresult, int yystate, int yychar)
01053 {
01054   int yyn = yypact[yystate];
01055 
01056   if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
01057     return 0;
01058   else
01059     {
01060       int yytype = YYTRANSLATE (yychar);
01061       YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
01062       YYSIZE_T yysize = yysize0;
01063       YYSIZE_T yysize1;
01064       int yysize_overflow = 0;
01065       enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
01066       char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
01067       int yyx;
01068 
01069 # if 0
01070       /* This is so xgettext sees the translatable formats that are
01071      constructed on the fly.  */
01072       YY_("syntax error, unexpected %s");
01073       YY_("syntax error, unexpected %s, expecting %s");
01074       YY_("syntax error, unexpected %s, expecting %s or %s");
01075       YY_("syntax error, unexpected %s, expecting %s or %s or %s");
01076       YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
01077 # endif
01078       char *yyfmt;
01079       char const *yyf;
01080       static char const yyunexpected[] = "syntax error, unexpected %s";
01081       static char const yyexpecting[] = ", expecting %s";
01082       static char const yyor[] = " or %s";
01083       char yyformat[sizeof yyunexpected
01084             + sizeof yyexpecting - 1
01085             + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
01086                * (sizeof yyor - 1))];
01087       char const *yyprefix = yyexpecting;
01088 
01089       /* Start YYX at -YYN if negative to avoid negative indexes in
01090      YYCHECK.  */
01091       int yyxbegin = yyn < 0 ? -yyn : 0;
01092 
01093       /* Stay within bounds of both yycheck and yytname.  */
01094       int yychecklim = YYLAST - yyn + 1;
01095       int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
01096       int yycount = 1;
01097 
01098       yyarg[0] = yytname[yytype];
01099       yyfmt = yystpcpy (yyformat, yyunexpected);
01100 
01101       for (yyx = yyxbegin; yyx < yyxend; ++yyx)
01102     if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
01103       {
01104         if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
01105           {
01106         yycount = 1;
01107         yysize = yysize0;
01108         yyformat[sizeof yyunexpected - 1] = '\0';
01109         break;
01110           }
01111         yyarg[yycount++] = yytname[yyx];
01112         yysize1 = yysize + yytnamerr (0, yytname[yyx]);
01113         yysize_overflow |= (yysize1 < yysize);
01114         yysize = yysize1;
01115         yyfmt = yystpcpy (yyfmt, yyprefix);
01116         yyprefix = yyor;
01117       }
01118 
01119       yyf = YY_(yyformat);
01120       yysize1 = yysize + yystrlen (yyf);
01121       yysize_overflow |= (yysize1 < yysize);
01122       yysize = yysize1;
01123 
01124       if (yysize_overflow)
01125     return YYSIZE_MAXIMUM;
01126 
01127       if (yyresult)
01128     {
01129       /* Avoid sprintf, as that infringes on the user's name space.
01130          Don't have undefined behavior even if the translation
01131          produced a string with the wrong number of "%s"s.  */
01132       char *yyp = yyresult;
01133       int yyi = 0;
01134       while ((*yyp = *yyf) != '\0')
01135         {
01136           if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
01137         {
01138           yyp += yytnamerr (yyp, yyarg[yyi++]);
01139           yyf += 2;
01140         }
01141           else
01142         {
01143           yyp++;
01144           yyf++;
01145         }
01146         }
01147     }
01148       return yysize;
01149     }
01150 }
01151 #endif /* YYERROR_VERBOSE */
01152 
01153 
01154 /*-----------------------------------------------.
01155 | Release the memory associated to this symbol.  |
01156 `-----------------------------------------------*/
01157 
01158 /*ARGSUSED*/
01159 #if (defined __STDC__ || defined __C99__FUNC__ \
01160      || defined __cplusplus || defined _MSC_VER)
01161 static void
01162 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp)
01163 #else
01164 static void
01165 yydestruct (yymsg, yytype, yyvaluep, yylocationp)
01166     const char *yymsg;
01167     int yytype;
01168     YYSTYPE *yyvaluep;
01169     YYLTYPE *yylocationp;
01170 #endif
01171 {
01172   YYUSE (yyvaluep);
01173   YYUSE (yylocationp);
01174 
01175   if (!yymsg)
01176     yymsg = "Deleting";
01177   YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
01178 
01179   switch (yytype)
01180     {
01181 
01182       default:
01183     break;
01184     }
01185 }
01186 
01187 
01188 /* Prevent warnings from -Wmissing-prototypes.  */
01189 
01190 #ifdef YYPARSE_PARAM
01191 #if defined __STDC__ || defined __cplusplus
01192 int yyparse (void *YYPARSE_PARAM);
01193 #else
01194 int yyparse ();
01195 #endif
01196 #else /* ! YYPARSE_PARAM */
01197 #if defined __STDC__ || defined __cplusplus
01198 int yyparse (void);
01199 #else
01200 int yyparse ();
01201 #endif
01202 #endif /* ! YYPARSE_PARAM */
01203 
01204 
01205 
01206 
01207 
01208 
01209 /*----------.
01210 | yyparse.  |
01211 `----------*/
01212 
01213 #ifdef YYPARSE_PARAM
01214 #if (defined __STDC__ || defined __C99__FUNC__ \
01215      || defined __cplusplus || defined _MSC_VER)
01216 int
01217 yyparse (void *YYPARSE_PARAM)
01218 #else
01219 int
01220 yyparse (YYPARSE_PARAM)
01221     void *YYPARSE_PARAM;
01222 #endif
01223 #else /* ! YYPARSE_PARAM */
01224 #if (defined __STDC__ || defined __C99__FUNC__ \
01225      || defined __cplusplus || defined _MSC_VER)
01226 int
01227 yyparse (void)
01228 #else
01229 int
01230 yyparse ()
01231 
01232 #endif
01233 #endif
01234 {
01235   /* The look-ahead symbol.  */
01236 int yychar;
01237 
01238 /* The semantic value of the look-ahead symbol.  */
01239 YYSTYPE yylval;
01240 
01241 /* Number of syntax errors so far.  */
01242 int yynerrs;
01243 /* Location data for the look-ahead symbol.  */
01244 YYLTYPE yylloc;
01245 
01246   int yystate;
01247   int yyn;
01248   int yyresult;
01249   /* Number of tokens to shift before error messages enabled.  */
01250   int yyerrstatus;
01251   /* Look-ahead token as an internal (translated) token number.  */
01252   int yytoken = 0;
01253 #if YYERROR_VERBOSE
01254   /* Buffer for error messages, and its allocated size.  */
01255   char yymsgbuf[128];
01256   char *yymsg = yymsgbuf;
01257   YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
01258 #endif
01259 
01260   /* Three stacks and their tools:
01261      `yyss': related to states,
01262      `yyvs': related to semantic values,
01263      `yyls': related to locations.
01264 
01265      Refer to the stacks thru separate pointers, to allow yyoverflow
01266      to reallocate them elsewhere.  */
01267 
01268   /* The state stack.  */
01269   yytype_int16 yyssa[YYINITDEPTH];
01270   yytype_int16 *yyss = yyssa;
01271   yytype_int16 *yyssp;
01272 
01273   /* The semantic value stack.  */
01274   YYSTYPE yyvsa[YYINITDEPTH];
01275   YYSTYPE *yyvs = yyvsa;
01276   YYSTYPE *yyvsp;
01277 
01278   /* The location stack.  */
01279   YYLTYPE yylsa[YYINITDEPTH];
01280   YYLTYPE *yyls = yylsa;
01281   YYLTYPE *yylsp;
01282   /* The locations where the error started and ended.  */
01283   YYLTYPE yyerror_range[2];
01284 
01285 #define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
01286 
01287   YYSIZE_T yystacksize = YYINITDEPTH;
01288 
01289   /* The variables used to return semantic value and location from the
01290      action routines.  */
01291   YYSTYPE yyval;
01292   YYLTYPE yyloc;
01293 
01294   /* The number of symbols on the RHS of the reduced rule.
01295      Keep to zero when no symbol should be popped.  */
01296   int yylen = 0;
01297 
01298   YYDPRINTF ((stderr, "Starting parse\n"));
01299 
01300   yystate = 0;
01301   yyerrstatus = 0;
01302   yynerrs = 0;
01303   yychar = YYEMPTY;     /* Cause a token to be read.  */
01304 
01305   /* Initialize stack pointers.
01306      Waste one element of value and location stack
01307      so that they stay on the same level as the state stack.
01308      The wasted elements are never initialized.  */
01309 
01310   yyssp = yyss;
01311   yyvsp = yyvs;
01312   yylsp = yyls;
01313 #if YYLTYPE_IS_TRIVIAL
01314   /* Initialize the default location before parsing starts.  */
01315   yylloc.first_line   = yylloc.last_line   = 1;
01316   yylloc.first_column = yylloc.last_column = 0;
01317 #endif
01318 
01319   goto yysetstate;
01320 
01321 /*------------------------------------------------------------.
01322 | yynewstate -- Push a new state, which is found in yystate.  |
01323 `------------------------------------------------------------*/
01324  yynewstate:
01325   /* In all cases, when you get here, the value and location stacks
01326      have just been pushed.  So pushing a state here evens the stacks.  */
01327   yyssp++;
01328 
01329  yysetstate:
01330   *yyssp = yystate;
01331 
01332   if (yyss + yystacksize - 1 <= yyssp)
01333     {
01334       /* Get the current used size of the three stacks, in elements.  */
01335       YYSIZE_T yysize = yyssp - yyss + 1;
01336 
01337 #ifdef yyoverflow
01338       {
01339     /* Give user a chance to reallocate the stack.  Use copies of
01340        these so that the &'s don't force the real ones into
01341        memory.  */
01342     YYSTYPE *yyvs1 = yyvs;
01343     yytype_int16 *yyss1 = yyss;
01344     YYLTYPE *yyls1 = yyls;
01345 
01346     /* Each stack pointer address is followed by the size of the
01347        data in use in that stack, in bytes.  This used to be a
01348        conditional around just the two extra args, but that might
01349        be undefined if yyoverflow is a macro.  */
01350     yyoverflow (YY_("memory exhausted"),
01351             &yyss1, yysize * sizeof (*yyssp),
01352             &yyvs1, yysize * sizeof (*yyvsp),
01353             &yyls1, yysize * sizeof (*yylsp),
01354             &yystacksize);
01355     yyls = yyls1;
01356     yyss = yyss1;
01357     yyvs = yyvs1;
01358       }
01359 #else /* no yyoverflow */
01360 # ifndef YYSTACK_RELOCATE
01361       goto yyexhaustedlab;
01362 # else
01363       /* Extend the stack our own way.  */
01364       if (YYMAXDEPTH <= yystacksize)
01365     goto yyexhaustedlab;
01366       yystacksize *= 2;
01367       if (YYMAXDEPTH < yystacksize)
01368     yystacksize = YYMAXDEPTH;
01369 
01370       {
01371     yytype_int16 *yyss1 = yyss;
01372     union yyalloc *yyptr =
01373       (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
01374     if (! yyptr)
01375       goto yyexhaustedlab;
01376     YYSTACK_RELOCATE (yyss);
01377     YYSTACK_RELOCATE (yyvs);
01378     YYSTACK_RELOCATE (yyls);
01379 #  undef YYSTACK_RELOCATE
01380     if (yyss1 != yyssa)
01381       YYSTACK_FREE (yyss1);
01382       }
01383 # endif
01384 #endif /* no yyoverflow */
01385 
01386       yyssp = yyss + yysize - 1;
01387       yyvsp = yyvs + yysize - 1;
01388       yylsp = yyls + yysize - 1;
01389 
01390       YYDPRINTF ((stderr, "Stack size increased to %lu\n",
01391           (unsigned long int) yystacksize));
01392 
01393       if (yyss + yystacksize - 1 <= yyssp)
01394     YYABORT;
01395     }
01396 
01397   YYDPRINTF ((stderr, "Entering state %d\n", yystate));
01398 
01399   goto yybackup;
01400 
01401 /*-----------.
01402 | yybackup.  |
01403 `-----------*/
01404 yybackup:
01405 
01406   /* Do appropriate processing given the current state.  Read a
01407      look-ahead token if we need one and don't already have one.  */
01408 
01409   /* First try to decide what to do without reference to look-ahead token.  */
01410   yyn = yypact[yystate];
01411   if (yyn == YYPACT_NINF)
01412     goto yydefault;
01413 
01414   /* Not known => get a look-ahead token if don't already have one.  */
01415 
01416   /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol.  */
01417   if (yychar == YYEMPTY)
01418     {
01419       YYDPRINTF ((stderr, "Reading a token: "));
01420       yychar = YYLEX;
01421     }
01422 
01423   if (yychar <= YYEOF)
01424     {
01425       yychar = yytoken = YYEOF;
01426       YYDPRINTF ((stderr, "Now at end of input.\n"));
01427     }
01428   else
01429     {
01430       yytoken = YYTRANSLATE (yychar);
01431       YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
01432     }
01433 
01434   /* If the proper action on seeing token YYTOKEN is to reduce or to
01435      detect an error, take that action.  */
01436   yyn += yytoken;
01437   if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
01438     goto yydefault;
01439   yyn = yytable[yyn];
01440   if (yyn <= 0)
01441     {
01442       if (yyn == 0 || yyn == YYTABLE_NINF)
01443     goto yyerrlab;
01444       yyn = -yyn;
01445       goto yyreduce;
01446     }
01447 
01448   if (yyn == YYFINAL)
01449     YYACCEPT;
01450 
01451   /* Count tokens shifted since error; after three, turn off error
01452      status.  */
01453   if (yyerrstatus)
01454     yyerrstatus--;
01455 
01456   /* Shift the look-ahead token.  */
01457   YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
01458 
01459   /* Discard the shifted token unless it is eof.  */
01460   if (yychar != YYEOF)
01461     yychar = YYEMPTY;
01462 
01463   yystate = yyn;
01464   *++yyvsp = yylval;
01465   *++yylsp = yylloc;
01466   goto yynewstate;
01467 
01468 
01469 /*-----------------------------------------------------------.
01470 | yydefault -- do the default action for the current state.  |
01471 `-----------------------------------------------------------*/
01472 yydefault:
01473   yyn = yydefact[yystate];
01474   if (yyn == 0)
01475     goto yyerrlab;
01476   goto yyreduce;
01477 
01478 
01479 /*-----------------------------.
01480 | yyreduce -- Do a reduction.  |
01481 `-----------------------------*/
01482 yyreduce:
01483   /* yyn is the number of a rule to reduce with.  */
01484   yylen = yyr2[yyn];
01485 
01486   /* If YYLEN is nonzero, implement the default value of the action:
01487      `$$ = $1'.
01488 
01489      Otherwise, the following line sets YYVAL to garbage.
01490      This behavior is undocumented and Bison
01491      users should not rely upon it.  Assigning to YYVAL
01492      unconditionally makes the parser a bit smaller, and it avoids a
01493      GCC warning that YYVAL may be used uninitialized.  */
01494   yyval = yyvsp[1-yylen];
01495 
01496   /* Default location.  */
01497   YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
01498   YY_REDUCE_PRINT (yyn);
01499   switch (yyn)
01500     {
01501         case 2:
01502 #line 106 "CalcGrammar.ypp"
01503     { ((CalcAssembler*) parm)->init(); }
01504     break;
01505 
01506   case 3:
01507 #line 108 "CalcGrammar.ypp"
01508     { ((CalcAssembler*) parm)->bindRegisters(); }
01509     break;
01510 
01511   case 8:
01512 #line 119 "CalcGrammar.ypp"
01513     { ((CalcAssembler*) parm)->selectRegisterSet((yyvsp[(1) - (1)].u.v_regset)); }
01514     break;
01515 
01516   case 10:
01517 #line 123 "CalcGrammar.ypp"
01518     { ((CalcAssembler*) parm)->allocateTuples(); }
01519     break;
01520 
01521   case 11:
01522 #line 124 "CalcGrammar.ypp"
01523     { ((CalcAssembler*) parm)->allocateTuples(); }
01524     break;
01525 
01526   case 13:
01527 #line 127 "CalcGrammar.ypp"
01528     { ((CalcAssembler*) parm)->selectRegisterSet((yyvsp[(1) - (1)].u.v_regset)); }
01529     break;
01530 
01531   case 15:
01532 #line 131 "CalcGrammar.ypp"
01533     { ((CalcAssembler*) parm)->bindLiteralDone(); }
01534     break;
01535 
01536   case 19:
01537 #line 137 "CalcGrammar.ypp"
01538     { ((CalcAssembler*) parm)->bindNextLiteral<uint64_t>((yyvsp[(1) - (1)].u.v_uint64)); }
01539     break;
01540 
01541   case 20:
01542 #line 138 "CalcGrammar.ypp"
01543     { ((CalcAssembler*) parm)->bindNextLiteral<int64_t>((yyvsp[(1) - (1)].u.v_int64));  }
01544     break;
01545 
01546   case 21:
01547 #line 139 "CalcGrammar.ypp"
01548     { ((CalcAssembler*) parm)->bindNextLiteral<double>((yyvsp[(1) - (1)].u.v_double));   }
01549     break;
01550 
01551   case 22:
01552 #line 140 "CalcGrammar.ypp"
01553     { ((CalcAssembler*) parm)->bindNextLiteral<string>((yyvsp[(1) - (1)].v_string));   }
01554     break;
01555 
01556   case 23:
01557 #line 141 "CalcGrammar.ypp"
01558     { ((CalcAssembler*) parm)->bindNextLiteral<PConstBuffer>(NULL); }
01559     break;
01560 
01561   case 28:
01562 #line 147 "CalcGrammar.ypp"
01563     { ((CalcAssembler*) parm)->addRegister((yyvsp[(1) - (1)].u.v_type)); }
01564     break;
01565 
01566   case 29:
01567 #line 149 "CalcGrammar.ypp"
01568     { ((CalcAssembler*) parm)->addRegister((yyvsp[(1) - (3)].u.v_type), (yyvsp[(3) - (3)].u.v_uint64)); }
01569     break;
01570 
01571   case 33:
01572 #line 159 "CalcGrammar.ypp"
01573     { ((CalcAssembler*) parm)->addInstruction((yyvsp[(1) - (1)].u.p_inst)); }
01574     break;
01575 
01576   case 34:
01577 #line 161 "CalcGrammar.ypp"
01578     { ((CalcAssembler*) parm)->addInstruction((yyvsp[(2) - (2)].u.p_inst)); }
01579     break;
01580 
01581   case 35:
01582 #line 165 "CalcGrammar.ypp"
01583     {
01584               (yyval.u.p_inst) = ((CalcAssembler*) parm)->createInstruction((yyvsp[(1) - (7)].v_opcode), (yyvsp[(2) - (7)].u.p_regref), (yyvsp[(4) - (7)].u.p_regref), (yyvsp[(6) - (7)].u.p_regref), (yyloc));
01585             }
01586     break;
01587 
01588   case 36:
01589 #line 170 "CalcGrammar.ypp"
01590     { 
01591               (yyval.u.p_inst) = ((CalcAssembler*) parm)->createInstruction((yyvsp[(1) - (5)].v_opcode), (yyvsp[(2) - (5)].u.p_regref), (yyvsp[(4) - (5)].u.p_regref), (yyloc));
01592             }
01593     break;
01594 
01595   case 37:
01596 #line 175 "CalcGrammar.ypp"
01597     {
01598               (yyval.u.p_inst) = ((CalcAssembler*) parm)->createInstruction((yyvsp[(1) - (3)].v_opcode), (yyvsp[(2) - (3)].u.p_regref), (yyloc));
01599             }
01600     break;
01601 
01602   case 38:
01603 #line 180 "CalcGrammar.ypp"
01604     { 
01605               (yyval.u.p_inst) = ((CalcAssembler*) parm)->createInstruction((yyvsp[(1) - (3)].v_opcode), (yyvsp[(2) - (3)].u.v_pc), (yyloc));
01606             }
01607     break;
01608 
01609   case 39:
01610 #line 185 "CalcGrammar.ypp"
01611     { 
01612               (yyval.u.p_inst) = ((CalcAssembler*) parm)->createInstruction((yyvsp[(1) - (5)].v_opcode), (yyvsp[(2) - (5)].u.v_pc), (yyvsp[(4) - (5)].u.p_regref), (yyloc));
01613             }
01614     break;
01615 
01616   case 40:
01617 #line 190 "CalcGrammar.ypp"
01618     {
01619               (yyval.u.p_inst) = ((CalcAssembler*) parm)->createInstruction((yyvsp[(1) - (6)].v_opcode), (yyvsp[(2) - (6)].v_string), (yyvsp[(4) - (6)].v_register_list), (yyloc));
01620             }
01621     break;
01622 
01623   case 41:
01624 #line 195 "CalcGrammar.ypp"
01625     { 
01626               (yyval.u.p_inst) = ((CalcAssembler*) parm)->createInstruction((yyvsp[(1) - (2)].v_opcode), (yyloc));
01627             }
01628     break;
01629 
01630   case 43:
01631 #line 203 "CalcGrammar.ypp"
01632     { (yyval.u.v_pc) = (yyvsp[(2) - (2)].u.v_uint64); ((CalcAssembler*) parm)->saveMaxPC((yyval.u.v_pc)); }
01633     break;
01634 
01635   case 52:
01636 #line 212 "CalcGrammar.ypp"
01637     { (yyval.v_register_list).push_back((yyvsp[(1) - (1)].u.p_regref)); }
01638     break;
01639 
01640   case 53:
01641 #line 213 "CalcGrammar.ypp"
01642     { (yyval.v_register_list) = (yyvsp[(1) - (3)].v_register_list); (yyval.v_register_list).push_back((yyvsp[(3) - (3)].u.p_regref)); }
01643     break;
01644 
01645   case 54:
01646 #line 216 "CalcGrammar.ypp"
01647     { (yyval.u.p_regref) = ((CalcAssembler*) parm)->getRegister((yyvsp[(1) - (2)].u.v_regset), (yyvsp[(2) - (2)].u.v_uint64)); }
01648     break;
01649 
01650   case 55:
01651 #line 217 "CalcGrammar.ypp"
01652     { (yyval.u.p_regref) = ((CalcAssembler*) parm)->getRegister((yyvsp[(1) - (2)].u.v_regset), (yyvsp[(2) - (2)].u.v_uint64)); }
01653     break;
01654 
01655   case 56:
01656 #line 218 "CalcGrammar.ypp"
01657     { (yyval.u.p_regref) = ((CalcAssembler*) parm)->getRegister((yyvsp[(1) - (2)].u.v_regset), (yyvsp[(2) - (2)].u.v_uint64)); }
01658     break;
01659 
01660   case 57:
01661 #line 219 "CalcGrammar.ypp"
01662     { (yyval.u.p_regref) = ((CalcAssembler*) parm)->getRegister((yyvsp[(1) - (2)].u.v_regset), (yyvsp[(2) - (2)].u.v_uint64)); }
01663     break;
01664 
01665   case 58:
01666 #line 220 "CalcGrammar.ypp"
01667     { (yyval.u.p_regref) = ((CalcAssembler*) parm)->getRegister((yyvsp[(1) - (2)].u.v_regset), (yyvsp[(2) - (2)].u.v_uint64)); }
01668     break;
01669 
01670 
01671 /* Line 1267 of yacc.c.  */
01672 #line 1673 "CalcGrammar.cpp"
01673       default: break;
01674     }
01675   YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
01676 
01677   YYPOPSTACK (yylen);
01678   yylen = 0;
01679   YY_STACK_PRINT (yyss, yyssp);
01680 
01681   *++yyvsp = yyval;
01682   *++yylsp = yyloc;
01683 
01684   /* Now `shift' the result of the reduction.  Determine what state
01685      that goes to, based on the state we popped back to and the rule
01686      number reduced by.  */
01687 
01688   yyn = yyr1[yyn];
01689 
01690   yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
01691   if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
01692     yystate = yytable[yystate];
01693   else
01694     yystate = yydefgoto[yyn - YYNTOKENS];
01695 
01696   goto yynewstate;
01697 
01698 
01699 /*------------------------------------.
01700 | yyerrlab -- here on detecting error |
01701 `------------------------------------*/
01702 yyerrlab:
01703   /* If not already recovering from an error, report this error.  */
01704   if (!yyerrstatus)
01705     {
01706       ++yynerrs;
01707 #if ! YYERROR_VERBOSE
01708       yyerror (YY_("syntax error"));
01709 #else
01710       {
01711     YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
01712     if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
01713       {
01714         YYSIZE_T yyalloc = 2 * yysize;
01715         if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
01716           yyalloc = YYSTACK_ALLOC_MAXIMUM;
01717         if (yymsg != yymsgbuf)
01718           YYSTACK_FREE (yymsg);
01719         yymsg = (char *) YYSTACK_ALLOC (yyalloc);
01720         if (yymsg)
01721           yymsg_alloc = yyalloc;
01722         else
01723           {
01724         yymsg = yymsgbuf;
01725         yymsg_alloc = sizeof yymsgbuf;
01726           }
01727       }
01728 
01729     if (0 < yysize && yysize <= yymsg_alloc)
01730       {
01731         (void) yysyntax_error (yymsg, yystate, yychar);
01732         yyerror (yymsg);
01733       }
01734     else
01735       {
01736         yyerror (YY_("syntax error"));
01737         if (yysize != 0)
01738           goto yyexhaustedlab;
01739       }
01740       }
01741 #endif
01742     }
01743 
01744   yyerror_range[0] = yylloc;
01745 
01746   if (yyerrstatus == 3)
01747     {
01748       /* If just tried and failed to reuse look-ahead token after an
01749      error, discard it.  */
01750 
01751       if (yychar <= YYEOF)
01752     {
01753       /* Return failure if at end of input.  */
01754       if (yychar == YYEOF)
01755         YYABORT;
01756     }
01757       else
01758     {
01759       yydestruct ("Error: discarding",
01760               yytoken, &yylval, &yylloc);
01761       yychar = YYEMPTY;
01762     }
01763     }
01764 
01765   /* Else will try to reuse look-ahead token after shifting the error
01766      token.  */
01767   goto yyerrlab1;
01768 
01769 
01770 /*---------------------------------------------------.
01771 | yyerrorlab -- error raised explicitly by YYERROR.  |
01772 `---------------------------------------------------*/
01773 yyerrorlab:
01774 
01775   /* Pacify compilers like GCC when the user code never invokes
01776      YYERROR and the label yyerrorlab therefore never appears in user
01777      code.  */
01778   if (/*CONSTCOND*/ 0)
01779      goto yyerrorlab;
01780 
01781   yyerror_range[0] = yylsp[1-yylen];
01782   /* Do not reclaim the symbols of the rule which action triggered
01783      this YYERROR.  */
01784   YYPOPSTACK (yylen);
01785   yylen = 0;
01786   YY_STACK_PRINT (yyss, yyssp);
01787   yystate = *yyssp;
01788   goto yyerrlab1;
01789 
01790 
01791 /*-------------------------------------------------------------.
01792 | yyerrlab1 -- common code for both syntax error and YYERROR.  |
01793 `-------------------------------------------------------------*/
01794 yyerrlab1:
01795   yyerrstatus = 3;  /* Each real token shifted decrements this.  */
01796 
01797   for (;;)
01798     {
01799       yyn = yypact[yystate];
01800       if (yyn != YYPACT_NINF)
01801     {
01802       yyn += YYTERROR;
01803       if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
01804         {
01805           yyn = yytable[yyn];
01806           if (0 < yyn)
01807         break;
01808         }
01809     }
01810 
01811       /* Pop the current state because it cannot handle the error token.  */
01812       if (yyssp == yyss)
01813     YYABORT;
01814 
01815       yyerror_range[0] = *yylsp;
01816       yydestruct ("Error: popping",
01817           yystos[yystate], yyvsp, yylsp);
01818       YYPOPSTACK (1);
01819       yystate = *yyssp;
01820       YY_STACK_PRINT (yyss, yyssp);
01821     }
01822 
01823   if (yyn == YYFINAL)
01824     YYACCEPT;
01825 
01826   *++yyvsp = yylval;
01827 
01828   yyerror_range[1] = yylloc;
01829   /* Using YYLLOC is tempting, but would change the location of
01830      the look-ahead.  YYLOC is available though.  */
01831   YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2);
01832   *++yylsp = yyloc;
01833 
01834   /* Shift the error token.  */
01835   YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
01836 
01837   yystate = yyn;
01838   goto yynewstate;
01839 
01840 
01841 /*-------------------------------------.
01842 | yyacceptlab -- YYACCEPT comes here.  |
01843 `-------------------------------------*/
01844 yyacceptlab:
01845   yyresult = 0;
01846   goto yyreturn;
01847 
01848 /*-----------------------------------.
01849 | yyabortlab -- YYABORT comes here.  |
01850 `-----------------------------------*/
01851 yyabortlab:
01852   yyresult = 1;
01853   goto yyreturn;
01854 
01855 #ifndef yyoverflow
01856 /*-------------------------------------------------.
01857 | yyexhaustedlab -- memory exhaustion comes here.  |
01858 `-------------------------------------------------*/
01859 yyexhaustedlab:
01860   yyerror (YY_("memory exhausted"));
01861   yyresult = 2;
01862   /* Fall through.  */
01863 #endif
01864 
01865 yyreturn:
01866   if (yychar != YYEOF && yychar != YYEMPTY)
01867      yydestruct ("Cleanup: discarding lookahead",
01868          yytoken, &yylval, &yylloc);
01869   /* Do not reclaim the symbols of the rule which action triggered
01870      this YYABORT or YYACCEPT.  */
01871   YYPOPSTACK (yylen);
01872   YY_STACK_PRINT (yyss, yyssp);
01873   while (yyssp != yyss)
01874     {
01875       yydestruct ("Cleanup: popping",
01876           yystos[*yyssp], yyvsp, yylsp);
01877       YYPOPSTACK (1);
01878     }
01879 #ifndef yyoverflow
01880   if (yyss != yyssa)
01881     YYSTACK_FREE (yyss);
01882 #endif
01883 #if YYERROR_VERBOSE
01884   if (yymsg != yymsgbuf)
01885     YYSTACK_FREE (yymsg);
01886 #endif
01887   /* Make sure YYID is used.  */
01888   return YYID (yyresult);
01889 }
01890 
01891 
01892 #line 222 "CalcGrammar.ypp"
01893 
01894 
01895 int CalcYYlex (YYSTYPE *lvalp, YYLTYPE *llocp, void* parm)
01896 {
01897     /* Check that we are being passed valid input */
01898     assert(lvalp);
01899     assert(llocp);
01900     assert(parm);
01901 
01902     CalcAssembler* pAssembler = (CalcAssembler*) parm;
01903     CalcLexer& lexer = pAssembler->getLexer();
01904 
01905     int token = lexer.yylex();
01906     *lvalp = lexer.getValue();
01907     *llocp = lexer.getLocation();
01908        
01909     return token;  
01910 }
01911 
01912 void CalcYYerror(const char *s)
01913 {
01914     throw CalcAssemblerException(s);
01915 }
01916 
01917 FENNEL_END_CPPFILE("$Id: //open/dev/fennel/disruptivetech/calc/CalcGrammar.ypp#4 $");
01918 
01919 // End CalcGrammar.ypp
01920 

Generated on Mon Jun 22 04:00:17 2009 for Fennel by  doxygen 1.5.1