Main Page | Data Structures | Directories | File List | Data Fields | Globals

rddf_parser.c

Go to the documentation of this file.
00001 /* A Bison parser, made by GNU Bison 2.2.  */
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.2"
00051 
00052 /* Skeleton name.  */
00053 #define YYSKELETON_NAME "yacc.c"
00054 
00055 /* Pure parsers.  */
00056 #define YYPURE 0
00057 
00058 /* Using locations.  */
00059 #define YYLSP_NEEDED 0
00060 
00061 /* Substitute the variable and function names.  */
00062 #define yyparse rddfparse
00063 #define yylex   rddflex
00064 #define yyerror rddferror
00065 #define yylval  rddflval
00066 #define yychar  rddfchar
00067 #define yydebug rddfdebug
00068 #define yynerrs rddfnerrs
00069 
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      STRING = 258,
00078      COMMA = 259,
00079      NEWLINE = 260
00080    };
00081 #endif
00082 /* Tokens.  */
00083 #define STRING 258
00084 #define COMMA 259
00085 #define NEWLINE 260
00086 
00087 
00088 
00089 
00090 /* Copy the first part of user declarations.  */
00091 #line 1 "src/rddf_parser.y"
00092 
00093 #include <config.h>
00094 
00095 #include <stdio.h>
00096 #include <stdlib.h>
00097 #include <string.h>
00098 
00099 #include <rddf/rddf.h>
00100 
00101 #define DEBUG_LEVEL 1
00102 #include "debug.h"
00103 
00104 #include "rddf_lexer.h"
00105 #include "rddf_parser.h"
00106 
00107 #define YYPARSE_PARAM data
00108 #define rdata ((gpsroute_t *) data)
00109 
00110 int rddfdebug = 1;
00111 #define YYERROR_VERBOSE
00112 
00113 int rddfwrap(void) { return 1; }
00114 void rddferror(char *str) {
00115     DEBUG1("error decoding: %s", str);
00116 }
00117 
00118 
00119 /* Enabling traces.  */
00120 #ifndef YYDEBUG
00121 # define YYDEBUG 0
00122 #endif
00123 
00124 /* Enabling verbose error messages.  */
00125 #ifdef YYERROR_VERBOSE
00126 # undef YYERROR_VERBOSE
00127 # define YYERROR_VERBOSE 1
00128 #else
00129 # define YYERROR_VERBOSE 0
00130 #endif
00131 
00132 /* Enabling the token table.  */
00133 #ifndef YYTOKEN_TABLE
00134 # define YYTOKEN_TABLE 0
00135 #endif
00136 
00137 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
00138 typedef union YYSTYPE
00139 #line 28 "src/rddf_parser.y"
00140 {
00141     char *string;
00142 }
00143 /* Line 187 of yacc.c.  */
00144 #line 145 "src/rddf_parser.tab.c"
00145     YYSTYPE;
00146 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
00147 # define YYSTYPE_IS_DECLARED 1
00148 # define YYSTYPE_IS_TRIVIAL 1
00149 #endif
00150 
00151 
00152 
00153 /* Copy the second part of user declarations.  */
00154 
00155 
00156 /* Line 216 of yacc.c.  */
00157 #line 158 "src/rddf_parser.tab.c"
00158 
00159 #ifdef short
00160 # undef short
00161 #endif
00162 
00163 #ifdef YYTYPE_UINT8
00164 typedef YYTYPE_UINT8 yytype_uint8;
00165 #else
00166 typedef unsigned char yytype_uint8;
00167 #endif
00168 
00169 #ifdef YYTYPE_INT8
00170 typedef YYTYPE_INT8 yytype_int8;
00171 #elif (defined __STDC__ || defined __C99__FUNC__ \
00172      || defined __cplusplus || defined _MSC_VER)
00173 typedef signed char yytype_int8;
00174 #else
00175 typedef short int yytype_int8;
00176 #endif
00177 
00178 #ifdef YYTYPE_UINT16
00179 typedef YYTYPE_UINT16 yytype_uint16;
00180 #else
00181 typedef unsigned short int yytype_uint16;
00182 #endif
00183 
00184 #ifdef YYTYPE_INT16
00185 typedef YYTYPE_INT16 yytype_int16;
00186 #else
00187 typedef short int yytype_int16;
00188 #endif
00189 
00190 #ifndef YYSIZE_T
00191 # ifdef __SIZE_TYPE__
00192 #  define YYSIZE_T __SIZE_TYPE__
00193 # elif defined size_t
00194 #  define YYSIZE_T size_t
00195 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
00196      || defined __cplusplus || defined _MSC_VER)
00197 #  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
00198 #  define YYSIZE_T size_t
00199 # else
00200 #  define YYSIZE_T unsigned int
00201 # endif
00202 #endif
00203 
00204 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
00205 
00206 #ifndef YY_
00207 # if YYENABLE_NLS
00208 #  if ENABLE_NLS
00209 #   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
00210 #   define YY_(msgid) dgettext ("bison-runtime", msgid)
00211 #  endif
00212 # endif
00213 # ifndef YY_
00214 #  define YY_(msgid) msgid
00215 # endif
00216 #endif
00217 
00218 /* Suppress unused-variable warnings by "using" E.  */
00219 #if ! defined lint || defined __GNUC__
00220 # define YYUSE(e) ((void) (e))
00221 #else
00222 # define YYUSE(e) /* empty */
00223 #endif
00224 
00225 /* Identity function, used to suppress warnings about constant conditions.  */
00226 #ifndef lint
00227 # define YYID(n) (n)
00228 #else
00229 #if (defined __STDC__ || defined __C99__FUNC__ \
00230      || defined __cplusplus || defined _MSC_VER)
00231 static int
00232 YYID (int i)
00233 #else
00234 static int
00235 YYID (i)
00236     int i;
00237 #endif
00238 {
00239   return i;
00240 }
00241 #endif
00242 
00243 #if ! defined yyoverflow || YYERROR_VERBOSE
00244 
00245 /* The parser invokes alloca or malloc; define the necessary symbols.  */
00246 
00247 # ifdef YYSTACK_USE_ALLOCA
00248 #  if YYSTACK_USE_ALLOCA
00249 #   ifdef __GNUC__
00250 #    define YYSTACK_ALLOC __builtin_alloca
00251 #   elif defined __BUILTIN_VA_ARG_INCR
00252 #    include <alloca.h> /* INFRINGES ON USER NAME SPACE */
00253 #   elif defined _AIX
00254 #    define YYSTACK_ALLOC __alloca
00255 #   elif defined _MSC_VER
00256 #    include <malloc.h> /* INFRINGES ON USER NAME SPACE */
00257 #    define alloca _alloca
00258 #   else
00259 #    define YYSTACK_ALLOC alloca
00260 #    if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
00261      || defined __cplusplus || defined _MSC_VER)
00262 #     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
00263 #     ifndef _STDLIB_H
00264 #      define _STDLIB_H 1
00265 #     endif
00266 #    endif
00267 #   endif
00268 #  endif
00269 # endif
00270 
00271 # ifdef YYSTACK_ALLOC
00272    /* Pacify GCC's `empty if-body' warning.  */
00273 #  define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
00274 #  ifndef YYSTACK_ALLOC_MAXIMUM
00275     /* The OS might guarantee only one guard page at the bottom of the stack,
00276        and a page size can be as small as 4096 bytes.  So we cannot safely
00277        invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number
00278        to allow for a few compiler-allocated temporary stack slots.  */
00279 #   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
00280 #  endif
00281 # else
00282 #  define YYSTACK_ALLOC YYMALLOC
00283 #  define YYSTACK_FREE YYFREE
00284 #  ifndef YYSTACK_ALLOC_MAXIMUM
00285 #   define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
00286 #  endif
00287 #  if (defined __cplusplus && ! defined _STDLIB_H \
00288        && ! ((defined YYMALLOC || defined malloc) \
00289          && (defined YYFREE || defined free)))
00290 #   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
00291 #   ifndef _STDLIB_H
00292 #    define _STDLIB_H 1
00293 #   endif
00294 #  endif
00295 #  ifndef YYMALLOC
00296 #   define YYMALLOC malloc
00297 #   if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
00298      || defined __cplusplus || defined _MSC_VER)
00299 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
00300 #   endif
00301 #  endif
00302 #  ifndef YYFREE
00303 #   define YYFREE free
00304 #   if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
00305      || defined __cplusplus || defined _MSC_VER)
00306 void free (void *); /* INFRINGES ON USER NAME SPACE */
00307 #   endif
00308 #  endif
00309 # endif
00310 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
00311 
00312 
00313 #if (! defined yyoverflow \
00314      && (! defined __cplusplus \
00315      || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
00316 
00317 /* A type that is properly aligned for any stack member.  */
00318 union yyalloc
00319 {
00320   yytype_int16 yyss;
00321   YYSTYPE yyvs;
00322   };
00323 
00324 /* The size of the maximum gap between one aligned stack and the next.  */
00325 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
00326 
00327 /* The size of an array large to enough to hold all stacks, each with
00328    N elements.  */
00329 # define YYSTACK_BYTES(N) \
00330      ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
00331       + YYSTACK_GAP_MAXIMUM)
00332 
00333 /* Copy COUNT objects from FROM to TO.  The source and destination do
00334    not overlap.  */
00335 # ifndef YYCOPY
00336 #  if defined __GNUC__ && 1 < __GNUC__
00337 #   define YYCOPY(To, From, Count) \
00338       __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
00339 #  else
00340 #   define YYCOPY(To, From, Count)      \
00341       do                    \
00342     {                   \
00343       YYSIZE_T yyi;             \
00344       for (yyi = 0; yyi < (Count); yyi++)   \
00345         (To)[yyi] = (From)[yyi];        \
00346     }                   \
00347       while (YYID (0))
00348 #  endif
00349 # endif
00350 
00351 /* Relocate STACK from its old location to the new one.  The
00352    local variables YYSIZE and YYSTACKSIZE give the old and new number of
00353    elements in the stack, and YYPTR gives the new location of the
00354    stack.  Advance YYPTR to a properly aligned location for the next
00355    stack.  */
00356 # define YYSTACK_RELOCATE(Stack)                    \
00357     do                                  \
00358       {                                 \
00359     YYSIZE_T yynewbytes;                        \
00360     YYCOPY (&yyptr->Stack, Stack, yysize);              \
00361     Stack = &yyptr->Stack;                      \
00362     yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
00363     yyptr += yynewbytes / sizeof (*yyptr);              \
00364       }                                 \
00365     while (YYID (0))
00366 
00367 #endif
00368 
00369 /* YYFINAL -- State number of the termination state.  */
00370 #define YYFINAL  4
00371 /* YYLAST -- Last index in YYTABLE.  */
00372 #define YYLAST   14
00373 
00374 /* YYNTOKENS -- Number of terminals.  */
00375 #define YYNTOKENS  6
00376 /* YYNNTS -- Number of nonterminals.  */
00377 #define YYNNTS  5
00378 /* YYNRULES -- Number of rules.  */
00379 #define YYNRULES  8
00380 /* YYNRULES -- Number of states.  */
00381 #define YYNSTATES  16
00382 
00383 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
00384 #define YYUNDEFTOK  2
00385 #define YYMAXUTOK   260
00386 
00387 #define YYTRANSLATE(YYX)                        \
00388   ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
00389 
00390 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
00391 static const yytype_uint8 yytranslate[] =
00392 {
00393        0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00394        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00395        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00396        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00397        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00398        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00399        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00400        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00401        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00402        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00403        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00404        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00405        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00406        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00407        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00408        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00409        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00410        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00411        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00412        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00413        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00414        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00415        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00416        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00417        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00418        2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
00419        5
00420 };
00421 
00422 #if YYDEBUG
00423 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
00424    YYRHS.  */
00425 static const yytype_uint8 yyprhs[] =
00426 {
00427        0,     0,     3,     5,     6,     8,    11,    12,    16
00428 };
00429 
00430 /* YYRHS -- A `-1'-separated list of the rules' RHS.  */
00431 static const yytype_int8 yyrhs[] =
00432 {
00433        7,     0,    -1,     8,    -1,    -1,     9,    -1,     9,    10,
00434       -1,    -1,     9,    10,     5,    -1,     3,     4,     3,     4,
00435        3,     4,     3,     4,     3,    -1
00436 };
00437 
00438 /* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
00439 static const yytype_uint8 yyrline[] =
00440 {
00441        0,    40,    40,    42,    43,    44,    49,    51,    57
00442 };
00443 #endif
00444 
00445 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
00446 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
00447    First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
00448 static const char *const yytname[] =
00449 {
00450   "$end", "error", "$undefined", "STRING", "COMMA", "NEWLINE", "$accept",
00451   "rddffile", "rddfentrylist_optioanl_newline", "rddfentrylist",
00452   "rddfentry", 0
00453 };
00454 #endif
00455 
00456 # ifdef YYPRINT
00457 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
00458    token YYLEX-NUM.  */
00459 static const yytype_uint16 yytoknum[] =
00460 {
00461        0,   256,   257,   258,   259,   260
00462 };
00463 # endif
00464 
00465 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
00466 static const yytype_uint8 yyr1[] =
00467 {
00468        0,     6,     7,     8,     8,     8,     9,     9,    10
00469 };
00470 
00471 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
00472 static const yytype_uint8 yyr2[] =
00473 {
00474        0,     2,     1,     0,     1,     2,     0,     3,     9
00475 };
00476 
00477 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
00478    STATE-NUM when YYTABLE doesn't specify something else to do.  Zero
00479    means the default is an error.  */
00480 static const yytype_uint8 yydefact[] =
00481 {
00482        3,     0,     2,     4,     1,     0,     5,     0,     7,     0,
00483        0,     0,     0,     0,     0,     8
00484 };
00485 
00486 /* YYDEFGOTO[NTERM-NUM].  */
00487 static const yytype_int8 yydefgoto[] =
00488 {
00489       -1,     1,     2,     3,     6
00490 };
00491 
00492 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
00493    STATE-NUM.  */
00494 #define YYPACT_NINF -4
00495 static const yytype_int8 yypact[] =
00496 {
00497       -3,     1,    -4,    -1,    -4,     0,    -2,     2,    -4,     3,
00498        5,     6,     8,     9,    11,    -4
00499 };
00500 
00501 /* YYPGOTO[NTERM-NUM].  */
00502 static const yytype_int8 yypgoto[] =
00503 {
00504       -4,    -4,    -4,    -4,    -4
00505 };
00506 
00507 /* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
00508    positive, shift that token.  If negative, reduce the rule which
00509    number is the opposite.  If zero, do what YYDEFACT says.
00510    If YYTABLE_NINF, syntax error.  */
00511 #define YYTABLE_NINF -7
00512 static const yytype_int8 yytable[] =
00513 {
00514       -6,     4,     5,     8,     7,     9,     0,    10,    11,     0,
00515       12,    13,     0,    14,    15
00516 };
00517 
00518 static const yytype_int8 yycheck[] =
00519 {
00520        3,     0,     3,     5,     4,     3,    -1,     4,     3,    -1,
00521        4,     3,    -1,     4,     3
00522 };
00523 
00524 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
00525    symbol of state STATE-NUM.  */
00526 static const yytype_uint8 yystos[] =
00527 {
00528        0,     7,     8,     9,     0,     3,    10,     4,     5,     3,
00529        4,     3,     4,     3,     4,     3
00530 };
00531 
00532 #define yyerrok     (yyerrstatus = 0)
00533 #define yyclearin   (yychar = YYEMPTY)
00534 #define YYEMPTY     (-2)
00535 #define YYEOF       0
00536 
00537 #define YYACCEPT    goto yyacceptlab
00538 #define YYABORT     goto yyabortlab
00539 #define YYERROR     goto yyerrorlab
00540 
00541 
00542 /* Like YYERROR except do call yyerror.  This remains here temporarily
00543    to ease the transition to the new meaning of YYERROR, for GCC.
00544    Once GCC version 2 has supplanted version 1, this can go.  */
00545 
00546 #define YYFAIL      goto yyerrlab
00547 
00548 #define YYRECOVERING()  (!!yyerrstatus)
00549 
00550 #define YYBACKUP(Token, Value)                  \
00551 do                              \
00552   if (yychar == YYEMPTY && yylen == 1)              \
00553     {                               \
00554       yychar = (Token);                     \
00555       yylval = (Value);                     \
00556       yytoken = YYTRANSLATE (yychar);               \
00557       YYPOPSTACK (1);                       \
00558       goto yybackup;                        \
00559     }                               \
00560   else                              \
00561     {                               \
00562       yyerror (YY_("syntax error: cannot back up")); \
00563       YYERROR;                          \
00564     }                               \
00565 while (YYID (0))
00566 
00567 
00568 #define YYTERROR    1
00569 #define YYERRCODE   256
00570 
00571 
00572 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
00573    If N is 0, then set CURRENT to the empty location which ends
00574    the previous symbol: RHS[0] (always defined).  */
00575 
00576 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
00577 #ifndef YYLLOC_DEFAULT
00578 # define YYLLOC_DEFAULT(Current, Rhs, N)                \
00579     do                                  \
00580       if (YYID (N))                                                    \
00581     {                               \
00582       (Current).first_line   = YYRHSLOC (Rhs, 1).first_line;    \
00583       (Current).first_column = YYRHSLOC (Rhs, 1).first_column;  \
00584       (Current).last_line    = YYRHSLOC (Rhs, N).last_line;     \
00585       (Current).last_column  = YYRHSLOC (Rhs, N).last_column;   \
00586     }                               \
00587       else                              \
00588     {                               \
00589       (Current).first_line   = (Current).last_line   =      \
00590         YYRHSLOC (Rhs, 0).last_line;                \
00591       (Current).first_column = (Current).last_column =      \
00592         YYRHSLOC (Rhs, 0).last_column;              \
00593     }                               \
00594     while (YYID (0))
00595 #endif
00596 
00597 
00598 /* YY_LOCATION_PRINT -- Print the location on the stream.
00599    This macro was not mandated originally: define only if we know
00600    we won't break user code: when these are the locations we know.  */
00601 
00602 #ifndef YY_LOCATION_PRINT
00603 # if YYLTYPE_IS_TRIVIAL
00604 #  define YY_LOCATION_PRINT(File, Loc)          \
00605      fprintf (File, "%d.%d-%d.%d",          \
00606           (Loc).first_line, (Loc).first_column, \
00607           (Loc).last_line,  (Loc).last_column)
00608 # else
00609 #  define YY_LOCATION_PRINT(File, Loc) ((void) 0)
00610 # endif
00611 #endif
00612 
00613 
00614 /* YYLEX -- calling `yylex' with the right arguments.  */
00615 
00616 #ifdef YYLEX_PARAM
00617 # define YYLEX yylex (YYLEX_PARAM)
00618 #else
00619 # define YYLEX yylex ()
00620 #endif
00621 
00622 /* Enable debugging if requested.  */
00623 #if YYDEBUG
00624 
00625 # ifndef YYFPRINTF
00626 #  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
00627 #  define YYFPRINTF fprintf
00628 # endif
00629 
00630 # define YYDPRINTF(Args)            \
00631 do {                        \
00632   if (yydebug)                  \
00633     YYFPRINTF Args;             \
00634 } while (YYID (0))
00635 
00636 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)            \
00637 do {                                      \
00638   if (yydebug)                                \
00639     {                                     \
00640       YYFPRINTF (stderr, "%s ", Title);                   \
00641       yy_symbol_print (stderr,                        \
00642           Type, Value); \
00643       YYFPRINTF (stderr, "\n");                       \
00644     }                                     \
00645 } while (YYID (0))
00646 
00647 
00648 /*--------------------------------.
00649 | Print this symbol on YYOUTPUT.  |
00650 `--------------------------------*/
00651 
00652 /*ARGSUSED*/
00653 #if (defined __STDC__ || defined __C99__FUNC__ \
00654      || defined __cplusplus || defined _MSC_VER)
00655 static void
00656 yy_symbol_value_print (FILE *yyoutput, int yytype, const YYSTYPE * const yyvaluep)
00657 #else
00658 static void
00659 yy_symbol_value_print (yyoutput, yytype, yyvaluep)
00660     FILE *yyoutput;
00661     int yytype;
00662     const YYSTYPE * const yyvaluep;
00663 #endif
00664 {
00665   if (!yyvaluep)
00666     return;
00667 # ifdef YYPRINT
00668   if (yytype < YYNTOKENS)
00669     YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
00670 # else
00671   YYUSE (yyoutput);
00672 # endif
00673   switch (yytype)
00674     {
00675       default:
00676     break;
00677     }
00678 }
00679 
00680 
00681 /*--------------------------------.
00682 | Print this symbol on YYOUTPUT.  |
00683 `--------------------------------*/
00684 
00685 #if (defined __STDC__ || defined __C99__FUNC__ \
00686      || defined __cplusplus || defined _MSC_VER)
00687 static void
00688 yy_symbol_print (FILE *yyoutput, int yytype, const YYSTYPE * const yyvaluep)
00689 #else
00690 static void
00691 yy_symbol_print (yyoutput, yytype, yyvaluep)
00692     FILE *yyoutput;
00693     int yytype;
00694     const YYSTYPE * const yyvaluep;
00695 #endif
00696 {
00697   if (yytype < YYNTOKENS)
00698     YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
00699   else
00700     YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
00701 
00702   yy_symbol_value_print (yyoutput, yytype, yyvaluep);
00703   YYFPRINTF (yyoutput, ")");
00704 }
00705 
00706 /*------------------------------------------------------------------.
00707 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
00708 | TOP (included).                                                   |
00709 `------------------------------------------------------------------*/
00710 
00711 #if (defined __STDC__ || defined __C99__FUNC__ \
00712      || defined __cplusplus || defined _MSC_VER)
00713 static void
00714 yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
00715 #else
00716 static void
00717 yy_stack_print (bottom, top)
00718     yytype_int16 *bottom;
00719     yytype_int16 *top;
00720 #endif
00721 {
00722   YYFPRINTF (stderr, "Stack now");
00723   for (; bottom <= top; ++bottom)
00724     YYFPRINTF (stderr, " %d", *bottom);
00725   YYFPRINTF (stderr, "\n");
00726 }
00727 
00728 # define YY_STACK_PRINT(Bottom, Top)                \
00729 do {                                \
00730   if (yydebug)                          \
00731     yy_stack_print ((Bottom), (Top));               \
00732 } while (YYID (0))
00733 
00734 
00735 /*------------------------------------------------.
00736 | Report that the YYRULE is going to be reduced.  |
00737 `------------------------------------------------*/
00738 
00739 #if (defined __STDC__ || defined __C99__FUNC__ \
00740      || defined __cplusplus || defined _MSC_VER)
00741 static void
00742 yy_reduce_print (YYSTYPE *yyvsp, 
00743            int yyrule)
00744 #else
00745 static void
00746 yy_reduce_print (yyvsp, yyrule
00747            )
00748     YYSTYPE *yyvsp;
00749     
00750            int yyrule;
00751 #endif
00752 {
00753   int yynrhs = yyr2[yyrule];
00754   int yyi;
00755   unsigned long int yylno = yyrline[yyrule];
00756   YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
00757          yyrule - 1, yylno);
00758   /* The symbols being reduced.  */
00759   for (yyi = 0; yyi < yynrhs; yyi++)
00760     {
00761       fprintf (stderr, "   $%d = ", yyi + 1);
00762       yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
00763                &(yyvsp[(yyi + 1) - (yynrhs)])
00764                            );
00765       fprintf (stderr, "\n");
00766     }
00767 }
00768 
00769 # define YY_REDUCE_PRINT(Rule)      \
00770 do {                    \
00771   if (yydebug)              \
00772     yy_reduce_print (yyvsp, Rule); \
00773 } while (YYID (0))
00774 
00775 /* Nonzero means print parse trace.  It is left uninitialized so that
00776    multiple parsers can coexist.  */
00777 int yydebug;
00778 #else /* !YYDEBUG */
00779 # define YYDPRINTF(Args)
00780 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
00781 # define YY_STACK_PRINT(Bottom, Top)
00782 # define YY_REDUCE_PRINT(Rule)
00783 #endif /* !YYDEBUG */
00784 
00785 
00786 /* YYINITDEPTH -- initial size of the parser's stacks.  */
00787 #ifndef YYINITDEPTH
00788 # define YYINITDEPTH 200
00789 #endif
00790 
00791 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
00792    if the built-in stack extension method is used).
00793 
00794    Do not make this value too large; the results are undefined if
00795    YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
00796    evaluated with infinite-precision integer arithmetic.  */
00797 
00798 #ifndef YYMAXDEPTH
00799 # define YYMAXDEPTH 10000
00800 #endif
00801 
00802 
00803 
00804 #if YYERROR_VERBOSE
00805 
00806 # ifndef yystrlen
00807 #  if defined __GLIBC__ && defined _STRING_H
00808 #   define yystrlen strlen
00809 #  else
00810 /* Return the length of YYSTR.  */
00811 #if (defined __STDC__ || defined __C99__FUNC__ \
00812      || defined __cplusplus || defined _MSC_VER)
00813 static YYSIZE_T
00814 yystrlen (const char *yystr)
00815 #else
00816 static YYSIZE_T
00817 yystrlen (yystr)
00818     const char *yystr;
00819 #endif
00820 {
00821   YYSIZE_T yylen;
00822   for (yylen = 0; yystr[yylen]; yylen++)
00823     continue;
00824   return yylen;
00825 }
00826 #  endif
00827 # endif
00828 
00829 # ifndef yystpcpy
00830 #  if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
00831 #   define yystpcpy stpcpy
00832 #  else
00833 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
00834    YYDEST.  */
00835 #if (defined __STDC__ || defined __C99__FUNC__ \
00836      || defined __cplusplus || defined _MSC_VER)
00837 static char *
00838 yystpcpy (char *yydest, const char *yysrc)
00839 #else
00840 static char *
00841 yystpcpy (yydest, yysrc)
00842     char *yydest;
00843     const char *yysrc;
00844 #endif
00845 {
00846   char *yyd = yydest;
00847   const char *yys = yysrc;
00848 
00849   while ((*yyd++ = *yys++) != '\0')
00850     continue;
00851 
00852   return yyd - 1;
00853 }
00854 #  endif
00855 # endif
00856 
00857 # ifndef yytnamerr
00858 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
00859    quotes and backslashes, so that it's suitable for yyerror.  The
00860    heuristic is that double-quoting is unnecessary unless the string
00861    contains an apostrophe, a comma, or backslash (other than
00862    backslash-backslash).  YYSTR is taken from yytname.  If YYRES is
00863    null, do not copy; instead, return the length of what the result
00864    would have been.  */
00865 static YYSIZE_T
00866 yytnamerr (char *yyres, const char *yystr)
00867 {
00868   if (*yystr == '"')
00869     {
00870       YYSIZE_T yyn = 0;
00871       char const *yyp = yystr;
00872 
00873       for (;;)
00874     switch (*++yyp)
00875       {
00876       case '\'':
00877       case ',':
00878         goto do_not_strip_quotes;
00879 
00880       case '\\':
00881         if (*++yyp != '\\')
00882           goto do_not_strip_quotes;
00883         /* Fall through.  */
00884       default:
00885         if (yyres)
00886           yyres[yyn] = *yyp;
00887         yyn++;
00888         break;
00889 
00890       case '"':
00891         if (yyres)
00892           yyres[yyn] = '\0';
00893         return yyn;
00894       }
00895     do_not_strip_quotes: ;
00896     }
00897 
00898   if (! yyres)
00899     return yystrlen (yystr);
00900 
00901   return yystpcpy (yyres, yystr) - yyres;
00902 }
00903 # endif
00904 
00905 /* Copy into YYRESULT an error message about the unexpected token
00906    YYCHAR while in state YYSTATE.  Return the number of bytes copied,
00907    including the terminating null byte.  If YYRESULT is null, do not
00908    copy anything; just return the number of bytes that would be
00909    copied.  As a special case, return 0 if an ordinary "syntax error"
00910    message will do.  Return YYSIZE_MAXIMUM if overflow occurs during
00911    size calculation.  */
00912 static YYSIZE_T
00913 yysyntax_error (char *yyresult, int yystate, int yychar)
00914 {
00915   int yyn = yypact[yystate];
00916 
00917   if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
00918     return 0;
00919   else
00920     {
00921       int yytype = YYTRANSLATE (yychar);
00922       YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
00923       YYSIZE_T yysize = yysize0;
00924       YYSIZE_T yysize1;
00925       int yysize_overflow = 0;
00926       enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
00927       char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
00928       int yyx;
00929 
00930 # if 0
00931       /* This is so xgettext sees the translatable formats that are
00932      constructed on the fly.  */
00933       YY_("syntax error, unexpected %s");
00934       YY_("syntax error, unexpected %s, expecting %s");
00935       YY_("syntax error, unexpected %s, expecting %s or %s");
00936       YY_("syntax error, unexpected %s, expecting %s or %s or %s");
00937       YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
00938 # endif
00939       char *yyfmt;
00940       char const *yyf;
00941       static char const yyunexpected[] = "syntax error, unexpected %s";
00942       static char const yyexpecting[] = ", expecting %s";
00943       static char const yyor[] = " or %s";
00944       char yyformat[sizeof yyunexpected
00945             + sizeof yyexpecting - 1
00946             + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
00947                * (sizeof yyor - 1))];
00948       char const *yyprefix = yyexpecting;
00949 
00950       /* Start YYX at -YYN if negative to avoid negative indexes in
00951      YYCHECK.  */
00952       int yyxbegin = yyn < 0 ? -yyn : 0;
00953 
00954       /* Stay within bounds of both yycheck and yytname.  */
00955       int yychecklim = YYLAST - yyn + 1;
00956       int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
00957       int yycount = 1;
00958 
00959       yyarg[0] = yytname[yytype];
00960       yyfmt = yystpcpy (yyformat, yyunexpected);
00961 
00962       for (yyx = yyxbegin; yyx < yyxend; ++yyx)
00963     if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
00964       {
00965         if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
00966           {
00967         yycount = 1;
00968         yysize = yysize0;
00969         yyformat[sizeof yyunexpected - 1] = '\0';
00970         break;
00971           }
00972         yyarg[yycount++] = yytname[yyx];
00973         yysize1 = yysize + yytnamerr (0, yytname[yyx]);
00974         yysize_overflow |= (yysize1 < yysize);
00975         yysize = yysize1;
00976         yyfmt = yystpcpy (yyfmt, yyprefix);
00977         yyprefix = yyor;
00978       }
00979 
00980       yyf = YY_(yyformat);
00981       yysize1 = yysize + yystrlen (yyf);
00982       yysize_overflow |= (yysize1 < yysize);
00983       yysize = yysize1;
00984 
00985       if (yysize_overflow)
00986     return YYSIZE_MAXIMUM;
00987 
00988       if (yyresult)
00989     {
00990       /* Avoid sprintf, as that infringes on the user's name space.
00991          Don't have undefined behavior even if the translation
00992          produced a string with the wrong number of "%s"s.  */
00993       char *yyp = yyresult;
00994       int yyi = 0;
00995       while ((*yyp = *yyf) != '\0')
00996         {
00997           if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
00998         {
00999           yyp += yytnamerr (yyp, yyarg[yyi++]);
01000           yyf += 2;
01001         }
01002           else
01003         {
01004           yyp++;
01005           yyf++;
01006         }
01007         }
01008     }
01009       return yysize;
01010     }
01011 }
01012 #endif /* YYERROR_VERBOSE */
01013 
01014 
01015 /*-----------------------------------------------.
01016 | Release the memory associated to this symbol.  |
01017 `-----------------------------------------------*/
01018 
01019 /*ARGSUSED*/
01020 #if (defined __STDC__ || defined __C99__FUNC__ \
01021      || defined __cplusplus || defined _MSC_VER)
01022 static void
01023 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
01024 #else
01025 static void
01026 yydestruct (yymsg, yytype, yyvaluep)
01027     const char *yymsg;
01028     int yytype;
01029     YYSTYPE *yyvaluep;
01030 #endif
01031 {
01032   YYUSE (yyvaluep);
01033 
01034   if (!yymsg)
01035     yymsg = "Deleting";
01036   YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
01037 
01038   switch (yytype)
01039     {
01040 
01041       default:
01042     break;
01043     }
01044 }
01045 
01046 
01047 /* Prevent warnings from -Wmissing-prototypes.  */
01048 
01049 #ifdef YYPARSE_PARAM
01050 #if defined __STDC__ || defined __cplusplus
01051 int yyparse (void *YYPARSE_PARAM);
01052 #else
01053 int yyparse ();
01054 #endif
01055 #else /* ! YYPARSE_PARAM */
01056 #if defined __STDC__ || defined __cplusplus
01057 int yyparse (void);
01058 #else
01059 int yyparse ();
01060 #endif
01061 #endif /* ! YYPARSE_PARAM */
01062 
01063 
01064 
01065 /* The look-ahead symbol.  */
01066 int yychar;
01067 
01068 /* The semantic value of the look-ahead symbol.  */
01069 YYSTYPE yylval;
01070 
01071 /* Number of syntax errors so far.  */
01072 int yynerrs;
01073 
01074 
01075 
01076 /*----------.
01077 | yyparse.  |
01078 `----------*/
01079 
01080 #ifdef YYPARSE_PARAM
01081 #if (defined __STDC__ || defined __C99__FUNC__ \
01082      || defined __cplusplus || defined _MSC_VER)
01083 int
01084 yyparse (void *YYPARSE_PARAM)
01085 #else
01086 int
01087 yyparse (YYPARSE_PARAM)
01088     void *YYPARSE_PARAM;
01089 #endif
01090 #else /* ! YYPARSE_PARAM */
01091 #if (defined __STDC__ || defined __C99__FUNC__ \
01092      || defined __cplusplus || defined _MSC_VER)
01093 int
01094 yyparse (void)
01095 #else
01096 int
01097 yyparse ()
01098 
01099 #endif
01100 #endif
01101 {
01102   
01103   int yystate;
01104   int yyn;
01105   int yyresult;
01106   /* Number of tokens to shift before error messages enabled.  */
01107   int yyerrstatus;
01108   /* Look-ahead token as an internal (translated) token number.  */
01109   int yytoken = 0;
01110 #if YYERROR_VERBOSE
01111   /* Buffer for error messages, and its allocated size.  */
01112   char yymsgbuf[128];
01113   char *yymsg = yymsgbuf;
01114   YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
01115 #endif
01116 
01117   /* Three stacks and their tools:
01118      `yyss': related to states,
01119      `yyvs': related to semantic values,
01120      `yyls': related to locations.
01121 
01122      Refer to the stacks thru separate pointers, to allow yyoverflow
01123      to reallocate them elsewhere.  */
01124 
01125   /* The state stack.  */
01126   yytype_int16 yyssa[YYINITDEPTH];
01127   yytype_int16 *yyss = yyssa;
01128   yytype_int16 *yyssp;
01129 
01130   /* The semantic value stack.  */
01131   YYSTYPE yyvsa[YYINITDEPTH];
01132   YYSTYPE *yyvs = yyvsa;
01133   YYSTYPE *yyvsp;
01134 
01135 
01136 
01137 #define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))
01138 
01139   YYSIZE_T yystacksize = YYINITDEPTH;
01140 
01141   /* The variables used to return semantic value and location from the
01142      action routines.  */
01143   YYSTYPE yyval;
01144 
01145 
01146   /* The number of symbols on the RHS of the reduced rule.
01147      Keep to zero when no symbol should be popped.  */
01148   int yylen = 0;
01149 
01150   YYDPRINTF ((stderr, "Starting parse\n"));
01151 
01152   yystate = 0;
01153   yyerrstatus = 0;
01154   yynerrs = 0;
01155   yychar = YYEMPTY;     /* Cause a token to be read.  */
01156 
01157   /* Initialize stack pointers.
01158      Waste one element of value and location stack
01159      so that they stay on the same level as the state stack.
01160      The wasted elements are never initialized.  */
01161 
01162   yyssp = yyss;
01163   yyvsp = yyvs;
01164 
01165   goto yysetstate;
01166 
01167 /*------------------------------------------------------------.
01168 | yynewstate -- Push a new state, which is found in yystate.  |
01169 `------------------------------------------------------------*/
01170  yynewstate:
01171   /* In all cases, when you get here, the value and location stacks
01172      have just been pushed.  So pushing a state here evens the stacks.  */
01173   yyssp++;
01174 
01175  yysetstate:
01176   *yyssp = yystate;
01177 
01178   if (yyss + yystacksize - 1 <= yyssp)
01179     {
01180       /* Get the current used size of the three stacks, in elements.  */
01181       YYSIZE_T yysize = yyssp - yyss + 1;
01182 
01183 #ifdef yyoverflow
01184       {
01185     /* Give user a chance to reallocate the stack.  Use copies of
01186        these so that the &'s don't force the real ones into
01187        memory.  */
01188     YYSTYPE *yyvs1 = yyvs;
01189     yytype_int16 *yyss1 = yyss;
01190 
01191 
01192     /* Each stack pointer address is followed by the size of the
01193        data in use in that stack, in bytes.  This used to be a
01194        conditional around just the two extra args, but that might
01195        be undefined if yyoverflow is a macro.  */
01196     yyoverflow (YY_("memory exhausted"),
01197             &yyss1, yysize * sizeof (*yyssp),
01198             &yyvs1, yysize * sizeof (*yyvsp),
01199 
01200             &yystacksize);
01201 
01202     yyss = yyss1;
01203     yyvs = yyvs1;
01204       }
01205 #else /* no yyoverflow */
01206 # ifndef YYSTACK_RELOCATE
01207       goto yyexhaustedlab;
01208 # else
01209       /* Extend the stack our own way.  */
01210       if (YYMAXDEPTH <= yystacksize)
01211     goto yyexhaustedlab;
01212       yystacksize *= 2;
01213       if (YYMAXDEPTH < yystacksize)
01214     yystacksize = YYMAXDEPTH;
01215 
01216       {
01217     yytype_int16 *yyss1 = yyss;
01218     union yyalloc *yyptr =
01219       (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
01220     if (! yyptr)
01221       goto yyexhaustedlab;
01222     YYSTACK_RELOCATE (yyss);
01223     YYSTACK_RELOCATE (yyvs);
01224 
01225 #  undef YYSTACK_RELOCATE
01226     if (yyss1 != yyssa)
01227       YYSTACK_FREE (yyss1);
01228       }
01229 # endif
01230 #endif /* no yyoverflow */
01231 
01232       yyssp = yyss + yysize - 1;
01233       yyvsp = yyvs + yysize - 1;
01234 
01235 
01236       YYDPRINTF ((stderr, "Stack size increased to %lu\n",
01237           (unsigned long int) yystacksize));
01238 
01239       if (yyss + yystacksize - 1 <= yyssp)
01240     YYABORT;
01241     }
01242 
01243   YYDPRINTF ((stderr, "Entering state %d\n", yystate));
01244 
01245   goto yybackup;
01246 
01247 /*-----------.
01248 | yybackup.  |
01249 `-----------*/
01250 yybackup:
01251 
01252   /* Do appropriate processing given the current state.  Read a
01253      look-ahead token if we need one and don't already have one.  */
01254 
01255   /* First try to decide what to do without reference to look-ahead token.  */
01256   yyn = yypact[yystate];
01257   if (yyn == YYPACT_NINF)
01258     goto yydefault;
01259 
01260   /* Not known => get a look-ahead token if don't already have one.  */
01261 
01262   /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol.  */
01263   if (yychar == YYEMPTY)
01264     {
01265       YYDPRINTF ((stderr, "Reading a token: "));
01266       yychar = YYLEX;
01267     }
01268 
01269   if (yychar <= YYEOF)
01270     {
01271       yychar = yytoken = YYEOF;
01272       YYDPRINTF ((stderr, "Now at end of input.\n"));
01273     }
01274   else
01275     {
01276       yytoken = YYTRANSLATE (yychar);
01277       YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
01278     }
01279 
01280   /* If the proper action on seeing token YYTOKEN is to reduce or to
01281      detect an error, take that action.  */
01282   yyn += yytoken;
01283   if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
01284     goto yydefault;
01285   yyn = yytable[yyn];
01286   if (yyn <= 0)
01287     {
01288       if (yyn == 0 || yyn == YYTABLE_NINF)
01289     goto yyerrlab;
01290       yyn = -yyn;
01291       goto yyreduce;
01292     }
01293 
01294   if (yyn == YYFINAL)
01295     YYACCEPT;
01296 
01297   /* Count tokens shifted since error; after three, turn off error
01298      status.  */
01299   if (yyerrstatus)
01300     yyerrstatus--;
01301 
01302   /* Shift the look-ahead token.  */
01303   YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
01304 
01305   /* Discard the shifted token unless it is eof.  */
01306   if (yychar != YYEOF)
01307     yychar = YYEMPTY;
01308 
01309   yystate = yyn;
01310   *++yyvsp = yylval;
01311 
01312   goto yynewstate;
01313 
01314 
01315 /*-----------------------------------------------------------.
01316 | yydefault -- do the default action for the current state.  |
01317 `-----------------------------------------------------------*/
01318 yydefault:
01319   yyn = yydefact[yystate];
01320   if (yyn == 0)
01321     goto yyerrlab;
01322   goto yyreduce;
01323 
01324 
01325 /*-----------------------------.
01326 | yyreduce -- Do a reduction.  |
01327 `-----------------------------*/
01328 yyreduce:
01329   /* yyn is the number of a rule to reduce with.  */
01330   yylen = yyr2[yyn];
01331 
01332   /* If YYLEN is nonzero, implement the default value of the action:
01333      `$$ = $1'.
01334 
01335      Otherwise, the following line sets YYVAL to garbage.
01336      This behavior is undocumented and Bison
01337      users should not rely upon it.  Assigning to YYVAL
01338      unconditionally makes the parser a bit smaller, and it avoids a
01339      GCC warning that YYVAL may be used uninitialized.  */
01340   yyval = yyvsp[1-yylen];
01341 
01342 
01343   YY_REDUCE_PRINT (yyn);
01344   switch (yyn)
01345     {
01346         case 5:
01347 #line 45 "src/rddf_parser.y"
01348     {
01349             rdata->size++;
01350         }
01351     break;
01352 
01353   case 7:
01354 #line 52 "src/rddf_parser.y"
01355     {
01356             rdata->size++;
01357         }
01358     break;
01359 
01360   case 8:
01361 #line 58 "src/rddf_parser.y"
01362     {
01363             rdata->points[rdata->size].lat = strtod((yyvsp[(3) - (9)].string), NULL);
01364             rdata->points[rdata->size].lon = strtod((yyvsp[(5) - (9)].string), NULL);
01365             rdata->points[rdata->size].radius = strtod((yyvsp[(7) - (9)].string), NULL);
01366             rdata->points[rdata->size].speed = strtod((yyvsp[(9) - (9)].string), NULL);
01367             rdata->points[rdata->size].max_speed = strtod((yyvsp[(9) - (9)].string), NULL);
01368             rdata->points[rdata->size].type = ROUTE_NORMAL;
01369             free((yyvsp[(1) - (9)].string)); free((yyvsp[(3) - (9)].string)); free((yyvsp[(5) - (9)].string)); free((yyvsp[(7) - (9)].string)); free((yyvsp[(9) - (9)].string));
01370         }
01371     break;
01372 
01373 
01374 /* Line 1267 of yacc.c.  */
01375 #line 1376 "src/rddf_parser.tab.c"
01376       default: break;
01377     }
01378   YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
01379 
01380   YYPOPSTACK (yylen);
01381   yylen = 0;
01382   YY_STACK_PRINT (yyss, yyssp);
01383 
01384   *++yyvsp = yyval;
01385 
01386 
01387   /* Now `shift' the result of the reduction.  Determine what state
01388      that goes to, based on the state we popped back to and the rule
01389      number reduced by.  */
01390 
01391   yyn = yyr1[yyn];
01392 
01393   yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
01394   if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
01395     yystate = yytable[yystate];
01396   else
01397     yystate = yydefgoto[yyn - YYNTOKENS];
01398 
01399   goto yynewstate;
01400 
01401 
01402 /*------------------------------------.
01403 | yyerrlab -- here on detecting error |
01404 `------------------------------------*/
01405 yyerrlab:
01406   /* If not already recovering from an error, report this error.  */
01407   if (!yyerrstatus)
01408     {
01409       ++yynerrs;
01410 #if ! YYERROR_VERBOSE
01411       yyerror (YY_("syntax error"));
01412 #else
01413       {
01414     YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
01415     if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
01416       {
01417         YYSIZE_T yyalloc = 2 * yysize;
01418         if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
01419           yyalloc = YYSTACK_ALLOC_MAXIMUM;
01420         if (yymsg != yymsgbuf)
01421           YYSTACK_FREE (yymsg);
01422         yymsg = (char *) YYSTACK_ALLOC (yyalloc);
01423         if (yymsg)
01424           yymsg_alloc = yyalloc;
01425         else
01426           {
01427         yymsg = yymsgbuf;
01428         yymsg_alloc = sizeof yymsgbuf;
01429           }
01430       }
01431 
01432     if (0 < yysize && yysize <= yymsg_alloc)
01433       {
01434         (void) yysyntax_error (yymsg, yystate, yychar);
01435         yyerror (yymsg);
01436       }
01437     else
01438       {
01439         yyerror (YY_("syntax error"));
01440         if (yysize != 0)
01441           goto yyexhaustedlab;
01442       }
01443       }
01444 #endif
01445     }
01446 
01447 
01448 
01449   if (yyerrstatus == 3)
01450     {
01451       /* If just tried and failed to reuse look-ahead token after an
01452      error, discard it.  */
01453 
01454       if (yychar <= YYEOF)
01455     {
01456       /* Return failure if at end of input.  */
01457       if (yychar == YYEOF)
01458         YYABORT;
01459     }
01460       else
01461     {
01462       yydestruct ("Error: discarding",
01463               yytoken, &yylval);
01464       yychar = YYEMPTY;
01465     }
01466     }
01467 
01468   /* Else will try to reuse look-ahead token after shifting the error
01469      token.  */
01470   goto yyerrlab1;
01471 
01472 
01473 /*---------------------------------------------------.
01474 | yyerrorlab -- error raised explicitly by YYERROR.  |
01475 `---------------------------------------------------*/
01476 yyerrorlab:
01477 
01478   /* Pacify compilers like GCC when the user code never invokes
01479      YYERROR and the label yyerrorlab therefore never appears in user
01480      code.  */
01481   if (/*CONSTCOND*/ 0)
01482      goto yyerrorlab;
01483 
01484   /* Do not reclaim the symbols of the rule which action triggered
01485      this YYERROR.  */
01486   YYPOPSTACK (yylen);
01487   yylen = 0;
01488   YY_STACK_PRINT (yyss, yyssp);
01489   yystate = *yyssp;
01490   goto yyerrlab1;
01491 
01492 
01493 /*-------------------------------------------------------------.
01494 | yyerrlab1 -- common code for both syntax error and YYERROR.  |
01495 `-------------------------------------------------------------*/
01496 yyerrlab1:
01497   yyerrstatus = 3;  /* Each real token shifted decrements this.  */
01498 
01499   for (;;)
01500     {
01501       yyn = yypact[yystate];
01502       if (yyn != YYPACT_NINF)
01503     {
01504       yyn += YYTERROR;
01505       if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
01506         {
01507           yyn = yytable[yyn];
01508           if (0 < yyn)
01509         break;
01510         }
01511     }
01512 
01513       /* Pop the current state because it cannot handle the error token.  */
01514       if (yyssp == yyss)
01515     YYABORT;
01516 
01517 
01518       yydestruct ("Error: popping",
01519           yystos[yystate], yyvsp);
01520       YYPOPSTACK (1);
01521       yystate = *yyssp;
01522       YY_STACK_PRINT (yyss, yyssp);
01523     }
01524 
01525   if (yyn == YYFINAL)
01526     YYACCEPT;
01527 
01528   *++yyvsp = yylval;
01529 
01530 
01531   /* Shift the error token.  */
01532   YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
01533 
01534   yystate = yyn;
01535   goto yynewstate;
01536 
01537 
01538 /*-------------------------------------.
01539 | yyacceptlab -- YYACCEPT comes here.  |
01540 `-------------------------------------*/
01541 yyacceptlab:
01542   yyresult = 0;
01543   goto yyreturn;
01544 
01545 /*-----------------------------------.
01546 | yyabortlab -- YYABORT comes here.  |
01547 `-----------------------------------*/
01548 yyabortlab:
01549   yyresult = 1;
01550   goto yyreturn;
01551 
01552 #ifndef yyoverflow
01553 /*-------------------------------------------------.
01554 | yyexhaustedlab -- memory exhaustion comes here.  |
01555 `-------------------------------------------------*/
01556 yyexhaustedlab:
01557   yyerror (YY_("memory exhausted"));
01558   yyresult = 2;
01559   /* Fall through.  */
01560 #endif
01561 
01562 yyreturn:
01563   if (yychar != YYEOF && yychar != YYEMPTY)
01564      yydestruct ("Cleanup: discarding lookahead",
01565          yytoken, &yylval);
01566   /* Do not reclaim the symbols of the rule which action triggered
01567      this YYABORT or YYACCEPT.  */
01568   YYPOPSTACK (yylen);
01569   YY_STACK_PRINT (yyss, yyssp);
01570   while (yyssp != yyss)
01571     {
01572       yydestruct ("Cleanup: popping",
01573           yystos[*yyssp], yyvsp);
01574       YYPOPSTACK (1);
01575     }
01576 #ifndef yyoverflow
01577   if (yyss != yyssa)
01578     YYSTACK_FREE (yyss);
01579 #endif
01580 #if YYERROR_VERBOSE
01581   if (yymsg != yymsgbuf)
01582     YYSTACK_FREE (yymsg);
01583 #endif
01584   return yyresult;
01585 }
01586 
01587 
01588 #line 67 "src/rddf_parser.y"
01589 
01590 int rddf_parse(FILE *file, gpsroute_t *route) {
01591     int result;
01592 
01593     rddfrestart(file);
01594     route->size = 0;
01595     result = rddfparse(route);
01596 
01597     return result;
01598 }
01599 

Generated on Thu Sep 6 13:13:11 2007 for driver by  doxygen 1.3.9.1