TSP: The Transport Sample Protocol



Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

tsp_ascii_writer_config.tab.c

00001 /* A Bison parser, made by GNU Bison 1.875.  */
00002 
00003 /* Skeleton parser for Yacc-like parsing with Bison,
00004    Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation, Inc.
00005 
00006    This program is free software; you can redistribute it and/or modify
00007    it under the terms of the GNU General Public License as published by
00008    the Free Software Foundation; either version 2, or (at your option)
00009    any later version.
00010 
00011    This program is distributed in the hope that it will be useful,
00012    but WITHOUT ANY WARRANTY; without even the implied warranty of
00013    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014    GNU General Public License for more details.
00015 
00016    You should have received a copy of the GNU General Public License
00017    along with this program; if not, write to the Free Software
00018    Foundation, Inc., 59 Temple Place - Suite 330,
00019    Boston, MA 02111-1307, USA.  */
00020 
00021 /* As a special exception, when this file is copied by Bison into a
00022    Bison output file, you may use that output file without restriction.
00023    This special exception was added by the Free Software Foundation
00024    in version 1.24 of Bison.  */
00025 
00026 /* Written by Richard Stallman by simplifying the original so called
00027    ``semantic'' parser.  */
00028 
00029 /* All symbols defined below should begin with yy or YY, to avoid
00030    infringing on user name space.  This should be done even for local
00031    variables, as they might otherwise be expanded by user macros.
00032    There are some unavoidable exceptions within include files to
00033    define necessary library symbols; they are noted "INFRINGES ON
00034    USER NAME SPACE" below.  */
00035 
00036 /* Identify Bison output.  */
00037 #define YYBISON 1
00038 
00039 /* Skeleton name.  */
00040 #define YYSKELETON_NAME "yacc.c"
00041 
00042 /* Pure parsers.  */
00043 #define YYPURE 0
00044 
00045 /* Using locations.  */
00046 #define YYLSP_NEEDED 0
00047 
00048 
00049 
00050 /* Tokens.  */
00051 #ifndef YYTOKENTYPE
00052 # define YYTOKENTYPE
00053    /* Put the tokens into the symbol table, so that GDB and other debuggers
00054       know about them.  */
00055    enum yytokentype {
00056      T_SAMPLE_SYMBOL = 258,
00057      T_PERIOD = 259,
00058      T_SPACE = 260,
00059      T_NEWLINE = 261,
00060      T_COMMENT = 262
00061    };
00062 #endif
00063 #define T_SAMPLE_SYMBOL 258
00064 #define T_PERIOD 259
00065 #define T_SPACE 260
00066 #define T_NEWLINE 261
00067 #define T_COMMENT 262
00068 
00069 
00070 
00071 
00072 /* Copy the first part of user declarations.  */
00073 #line 2 "tsp_ascii_writer_config.y"
00074 
00075 #define YYDEBUG 1
00076 #define YYERROR_VERBOSE
00077 #define YYSTYPE double
00078 #include <stdio.h>
00079   YYSTYPE yylval; 
00080   int yyerror(char *msg);
00081   int yylex();
00082 #include <tsp_ascii_writer.h>
00083 
00084 
00085 /* Enabling traces.  */
00086 #ifndef YYDEBUG
00087 # define YYDEBUG 1
00088 #endif
00089 
00090 /* Enabling verbose error messages.  */
00091 #ifdef YYERROR_VERBOSE
00092 # undef YYERROR_VERBOSE
00093 # define YYERROR_VERBOSE 1
00094 #else
00095 # define YYERROR_VERBOSE 0
00096 #endif
00097 
00098 #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
00099 typedef int YYSTYPE;
00100 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
00101 # define YYSTYPE_IS_DECLARED 1
00102 # define YYSTYPE_IS_TRIVIAL 1
00103 #endif
00104 
00105 
00106 
00107 /* Copy the second part of user declarations.  */
00108 
00109 
00110 /* Line 214 of yacc.c.  */
00111 #line 111 "tsp_ascii_writer_config.tab.c"
00112 
00113 #if ! defined (yyoverflow) || YYERROR_VERBOSE
00114 
00115 /* The parser invokes alloca or malloc; define the necessary symbols.  */
00116 
00117 # if YYSTACK_USE_ALLOCA
00118 #  define YYSTACK_ALLOC alloca
00119 # else
00120 #  ifndef YYSTACK_USE_ALLOCA
00121 #   if defined (alloca) || defined (_ALLOCA_H)
00122 #    define YYSTACK_ALLOC alloca
00123 #   else
00124 #    ifdef __GNUC__
00125 #     define YYSTACK_ALLOC __builtin_alloca
00126 #    endif
00127 #   endif
00128 #  endif
00129 # endif
00130 
00131 # ifdef YYSTACK_ALLOC
00132    /* Pacify GCC's `empty if-body' warning. */
00133 #  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
00134 # else
00135 #  if defined (__STDC__) || defined (__cplusplus)
00136 #   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
00137 #   define YYSIZE_T size_t
00138 #  endif
00139 #  define YYSTACK_ALLOC malloc
00140 #  define YYSTACK_FREE free
00141 # endif
00142 #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
00143 
00144 
00145 #if (! defined (yyoverflow) \
00146      && (! defined (__cplusplus) \
00147          || (YYSTYPE_IS_TRIVIAL)))
00148 
00149 /* A type that is properly aligned for any stack member.  */
00150 union yyalloc
00151 {
00152   short yyss;
00153   YYSTYPE yyvs;
00154   };
00155 
00156 /* The size of the maximum gap between one aligned stack and the next.  */
00157 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
00158 
00159 /* The size of an array large to enough to hold all stacks, each with
00160    N elements.  */
00161 # define YYSTACK_BYTES(N) \
00162      ((N) * (sizeof (short) + sizeof (YYSTYPE))                         \
00163       + YYSTACK_GAP_MAXIMUM)
00164 
00165 /* Copy COUNT objects from FROM to TO.  The source and destination do
00166    not overlap.  */
00167 # ifndef YYCOPY
00168 #  if 1 < __GNUC__
00169 #   define YYCOPY(To, From, Count) \
00170       __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
00171 #  else
00172 #   define YYCOPY(To, From, Count)              \
00173       do                                        \
00174         {                                       \
00175           register YYSIZE_T yyi;                \
00176           for (yyi = 0; yyi < (Count); yyi++)   \
00177             (To)[yyi] = (From)[yyi];            \
00178         }                                       \
00179       while (0)
00180 #  endif
00181 # endif
00182 
00183 /* Relocate STACK from its old location to the new one.  The
00184    local variables YYSIZE and YYSTACKSIZE give the old and new number of
00185    elements in the stack, and YYPTR gives the new location of the
00186    stack.  Advance YYPTR to a properly aligned location for the next
00187    stack.  */
00188 # define YYSTACK_RELOCATE(Stack)                                        \
00189     do                                                                  \
00190       {                                                                 \
00191         YYSIZE_T yynewbytes;                                            \
00192         YYCOPY (&yyptr->Stack, Stack, yysize);                          \
00193         Stack = &yyptr->Stack;                                          \
00194         yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
00195         yyptr += yynewbytes / sizeof (*yyptr);                          \
00196       }                                                                 \
00197     while (0)
00198 
00199 #endif
00200 
00201 #if defined (__STDC__) || defined (__cplusplus)
00202    typedef signed char yysigned_char;
00203 #else
00204    typedef short yysigned_char;
00205 #endif
00206 
00207 /* YYFINAL -- State number of the termination state. */
00208 #define YYFINAL  13
00209 /* YYLAST -- Last index in YYTABLE.  */
00210 #define YYLAST   20
00211 
00212 /* YYNTOKENS -- Number of terminals. */
00213 #define YYNTOKENS  8
00214 /* YYNNTS -- Number of nonterminals. */
00215 #define YYNNTS  6
00216 /* YYNRULES -- Number of rules. */
00217 #define YYNRULES  13
00218 /* YYNRULES -- Number of states. */
00219 #define YYNSTATES  21
00220 
00221 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
00222 #define YYUNDEFTOK  2
00223 #define YYMAXUTOK   262
00224 
00225 #define YYTRANSLATE(YYX)                                                \
00226   ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
00227 
00228 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
00229 static const unsigned char yytranslate[] =
00230 {
00231        0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00232        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00233        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00234        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00235        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00236        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00237        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00238        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00239        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00240        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00241        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00242        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00243        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00244        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00245        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00246        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00247        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00248        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00249        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00250        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00251        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00252        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00253        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00254        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00255        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00256        2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
00257        5,     6,     7
00258 };
00259 
00260 #if YYDEBUG
00261 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
00262    YYRHS.  */
00263 static const unsigned char yyprhs[] =
00264 {
00265        0,     0,     3,     5,     8,    11,    14,    17,    19,    21,
00266       24,    28,    34,    36
00267 };
00268 
00269 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
00270 static const yysigned_char yyrhs[] =
00271 {
00272        9,     0,    -1,    10,    -1,    10,     9,    -1,    11,     6,
00273       -1,    12,     6,    -1,    13,     6,    -1,    13,    -1,     6,
00274       -1,     1,     6,    -1,     3,     5,     4,    -1,     3,     5,
00275        4,     5,     7,    -1,     7,    -1,     5,    -1
00276 };
00277 
00278 /* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
00279 static const unsigned char yyrline[] =
00280 {
00281        0,    15,    15,    16,    18,    19,    20,    21,    22,    23,
00282       25,    26,    28,    30
00283 };
00284 #endif
00285 
00286 #if YYDEBUG || YYERROR_VERBOSE
00287 /* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
00288    First, the terminals, then, starting at YYNTOKENS, nonterminals. */
00289 static const char *const yytname[] =
00290 {
00291   "$end", "error", "$undefined", "T_SAMPLE_SYMBOL", "T_PERIOD", "T_SPACE", 
00292   "T_NEWLINE", "T_COMMENT", "$accept", "INPUT", "LINE", "SAMPLE_LINE", 
00293   "COMMENT_LINE", "VOID_LINE", 0
00294 };
00295 #endif
00296 
00297 # ifdef YYPRINT
00298 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
00299    token YYLEX-NUM.  */
00300 static const unsigned short yytoknum[] =
00301 {
00302        0,   256,   257,   258,   259,   260,   261,   262
00303 };
00304 # endif
00305 
00306 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
00307 static const unsigned char yyr1[] =
00308 {
00309        0,     8,     9,     9,    10,    10,    10,    10,    10,    10,
00310       11,    11,    12,    13
00311 };
00312 
00313 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
00314 static const unsigned char yyr2[] =
00315 {
00316        0,     2,     1,     2,     2,     2,     2,     1,     1,     2,
00317        3,     5,     1,     1
00318 };
00319 
00320 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
00321    STATE-NUM when YYTABLE doesn't specify something else to do.  Zero
00322    means the default is an error.  */
00323 static const unsigned char yydefact[] =
00324 {
00325        0,     0,     0,    13,     8,    12,     0,     0,     0,     0,
00326        7,     9,     0,     1,     3,     4,     5,     6,    10,     0,
00327       11
00328 };
00329 
00330 /* YYDEFGOTO[NTERM-NUM]. */
00331 static const yysigned_char yydefgoto[] =
00332 {
00333       -1,     6,     7,     8,     9,    10
00334 };
00335 
00336 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
00337    STATE-NUM.  */
00338 #define YYPACT_NINF -5
00339 static const yysigned_char yypact[] =
00340 {
00341        7,    -4,    -1,    -5,    -5,    -5,     9,     0,     5,    10,
00342       11,    -5,    14,    -5,    -5,    -5,    -5,    -5,    15,     8,
00343       -5
00344 };
00345 
00346 /* YYPGOTO[NTERM-NUM].  */
00347 static const yysigned_char yypgoto[] =
00348 {
00349       -5,    12,    -5,    -5,    -5,    -5
00350 };
00351 
00352 /* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
00353    positive, shift that token.  If negative, reduce the rule which
00354    number is the opposite.  If zero, do what YYDEFACT says.
00355    If YYTABLE_NINF, syntax error.  */
00356 #define YYTABLE_NINF -3
00357 static const yysigned_char yytable[] =
00358 {
00359       -2,     1,    11,     2,    12,     3,     4,     5,     1,    13,
00360        2,    15,     3,     4,     5,    20,    16,    17,    18,    14,
00361       19
00362 };
00363 
00364 static const unsigned char yycheck[] =
00365 {
00366        0,     1,     6,     3,     5,     5,     6,     7,     1,     0,
00367        3,     6,     5,     6,     7,     7,     6,     6,     4,     7,
00368        5
00369 };
00370 
00371 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
00372    symbol of state STATE-NUM.  */
00373 static const unsigned char yystos[] =
00374 {
00375        0,     1,     3,     5,     6,     7,     9,    10,    11,    12,
00376       13,     6,     5,     0,     9,     6,     6,     6,     4,     5,
00377        7
00378 };
00379 
00380 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
00381 # define YYSIZE_T __SIZE_TYPE__
00382 #endif
00383 #if ! defined (YYSIZE_T) && defined (size_t)
00384 # define YYSIZE_T size_t
00385 #endif
00386 #if ! defined (YYSIZE_T)
00387 # if defined (__STDC__) || defined (__cplusplus)
00388 #  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
00389 #  define YYSIZE_T size_t
00390 # endif
00391 #endif
00392 #if ! defined (YYSIZE_T)
00393 # define YYSIZE_T unsigned int
00394 #endif
00395 
00396 #define yyerrok         (yyerrstatus = 0)
00397 #define yyclearin       (yychar = YYEMPTY)
00398 #define YYEMPTY         (-2)
00399 #define YYEOF           0
00400 
00401 #define YYACCEPT        goto yyacceptlab
00402 #define YYABORT         goto yyabortlab
00403 #define YYERROR         goto yyerrlab1
00404 
00405 
00406 /* Like YYERROR except do call yyerror.  This remains here temporarily
00407    to ease the transition to the new meaning of YYERROR, for GCC.
00408    Once GCC version 2 has supplanted version 1, this can go.  */
00409 
00410 #define YYFAIL          goto yyerrlab
00411 
00412 #define YYRECOVERING()  (!!yyerrstatus)
00413 
00414 #define YYBACKUP(Token, Value)                                  \
00415 do                                                              \
00416   if (yychar == YYEMPTY && yylen == 1)                          \
00417     {                                                           \
00418       yychar = (Token);                                         \
00419       yylval = (Value);                                         \
00420       yytoken = YYTRANSLATE (yychar);                           \
00421       YYPOPSTACK;                                               \
00422       goto yybackup;                                            \
00423     }                                                           \
00424   else                                                          \
00425     {                                                           \
00426       yyerror ("syntax error: cannot back up");\
00427       YYERROR;                                                  \
00428     }                                                           \
00429 while (0)
00430 
00431 #define YYTERROR        1
00432 #define YYERRCODE       256
00433 
00434 /* YYLLOC_DEFAULT -- Compute the default location (before the actions
00435    are run).  */
00436 
00437 #ifndef YYLLOC_DEFAULT
00438 # define YYLLOC_DEFAULT(Current, Rhs, N)         \
00439   Current.first_line   = Rhs[1].first_line;      \
00440   Current.first_column = Rhs[1].first_column;    \
00441   Current.last_line    = Rhs[N].last_line;       \
00442   Current.last_column  = Rhs[N].last_column;
00443 #endif
00444 
00445 /* YYLEX -- calling `yylex' with the right arguments.  */
00446 
00447 #ifdef YYLEX_PARAM
00448 # define YYLEX yylex (YYLEX_PARAM)
00449 #else
00450 # define YYLEX yylex ()
00451 #endif
00452 
00453 /* Enable debugging if requested.  */
00454 #if YYDEBUG
00455 
00456 # ifndef YYFPRINTF
00457 #  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
00458 #  define YYFPRINTF fprintf
00459 # endif
00460 
00461 # define YYDPRINTF(Args)                        \
00462 do {                                            \
00463   if (yydebug)                                  \
00464     YYFPRINTF Args;                             \
00465 } while (0)
00466 
00467 # define YYDSYMPRINT(Args)                      \
00468 do {                                            \
00469   if (yydebug)                                  \
00470     yysymprint Args;                            \
00471 } while (0)
00472 
00473 # define YYDSYMPRINTF(Title, Token, Value, Location)            \
00474 do {                                                            \
00475   if (yydebug)                                                  \
00476     {                                                           \
00477       YYFPRINTF (stderr, "%s ", Title);                         \
00478       yysymprint (stderr,                                       \
00479                   Token, Value);        \
00480       YYFPRINTF (stderr, "\n");                                 \
00481     }                                                           \
00482 } while (0)
00483 
00484 /*------------------------------------------------------------------.
00485 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
00486 | TOP (cinluded).                                                   |
00487 `------------------------------------------------------------------*/
00488 
00489 #if defined (__STDC__) || defined (__cplusplus)
00490 static void
00491 yy_stack_print (short *bottom, short *top)
00492 #else
00493 static void
00494 yy_stack_print (bottom, top)
00495     short *bottom;
00496     short *top;
00497 #endif
00498 {
00499   YYFPRINTF (stderr, "Stack now");
00500   for (/* Nothing. */; bottom <= top; ++bottom)
00501     YYFPRINTF (stderr, " %d", *bottom);
00502   YYFPRINTF (stderr, "\n");
00503 }
00504 
00505 # define YY_STACK_PRINT(Bottom, Top)                            \
00506 do {                                                            \
00507   if (yydebug)                                                  \
00508     yy_stack_print ((Bottom), (Top));                           \
00509 } while (0)
00510 
00511 
00512 /*------------------------------------------------.
00513 | Report that the YYRULE is going to be reduced.  |
00514 `------------------------------------------------*/
00515 
00516 #if defined (__STDC__) || defined (__cplusplus)
00517 static void
00518 yy_reduce_print (int yyrule)
00519 #else
00520 static void
00521 yy_reduce_print (yyrule)
00522     int yyrule;
00523 #endif
00524 {
00525   int yyi;
00526   unsigned int yylineno = yyrline[yyrule];
00527   YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ",
00528              yyrule - 1, yylineno);
00529   /* Print the symbols being reduced, and their result.  */
00530   for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
00531     YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]);
00532   YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]);
00533 }
00534 
00535 # define YY_REDUCE_PRINT(Rule)          \
00536 do {                                    \
00537   if (yydebug)                          \
00538     yy_reduce_print (Rule);             \
00539 } while (0)
00540 
00541 /* Nonzero means print parse trace.  It is left uninitialized so that
00542    multiple parsers can coexist.  */
00543 int yydebug;
00544 #else /* !YYDEBUG */
00545 # define YYDPRINTF(Args)
00546 # define YYDSYMPRINT(Args)
00547 # define YYDSYMPRINTF(Title, Token, Value, Location)
00548 # define YY_STACK_PRINT(Bottom, Top)
00549 # define YY_REDUCE_PRINT(Rule)
00550 #endif /* !YYDEBUG */
00551 
00552 
00553 /* YYINITDEPTH -- initial size of the parser's stacks.  */
00554 #ifndef YYINITDEPTH
00555 # define YYINITDEPTH 200
00556 #endif
00557 
00558 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
00559    if the built-in stack extension method is used).
00560 
00561    Do not make this value too large; the results are undefined if
00562    SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
00563    evaluated with infinite-precision integer arithmetic.  */
00564 
00565 #if YYMAXDEPTH == 0
00566 # undef YYMAXDEPTH
00567 #endif
00568 
00569 #ifndef YYMAXDEPTH
00570 # define YYMAXDEPTH 10000
00571 #endif
00572 
00573 
00574 
00575 #if YYERROR_VERBOSE
00576 
00577 # ifndef yystrlen
00578 #  if defined (__GLIBC__) && defined (_STRING_H)
00579 #   define yystrlen strlen
00580 #  else
00581 /* Return the length of YYSTR.  */
00582 static YYSIZE_T
00583 #   if defined (__STDC__) || defined (__cplusplus)
00584 yystrlen (const char *yystr)
00585 #   else
00586 yystrlen (yystr)
00587      const char *yystr;
00588 #   endif
00589 {
00590   register const char *yys = yystr;
00591 
00592   while (*yys++ != '\0')
00593     continue;
00594 
00595   return yys - yystr - 1;
00596 }
00597 #  endif
00598 # endif
00599 
00600 # ifndef yystpcpy
00601 #  if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
00602 #   define yystpcpy stpcpy
00603 #  else
00604 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
00605    YYDEST.  */
00606 static char *
00607 #   if defined (__STDC__) || defined (__cplusplus)
00608 yystpcpy (char *yydest, const char *yysrc)
00609 #   else
00610 yystpcpy (yydest, yysrc)
00611      char *yydest;
00612      const char *yysrc;
00613 #   endif
00614 {
00615   register char *yyd = yydest;
00616   register const char *yys = yysrc;
00617 
00618   while ((*yyd++ = *yys++) != '\0')
00619     continue;
00620 
00621   return yyd - 1;
00622 }
00623 #  endif
00624 # endif
00625 
00626 #endif /* !YYERROR_VERBOSE */
00627 
00628 
00629 
00630 #if YYDEBUG
00631 /*--------------------------------.
00632 | Print this symbol on YYOUTPUT.  |
00633 `--------------------------------*/
00634 
00635 #if defined (__STDC__) || defined (__cplusplus)
00636 static void
00637 yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
00638 #else
00639 static void
00640 yysymprint (yyoutput, yytype, yyvaluep)
00641     FILE *yyoutput;
00642     int yytype;
00643     YYSTYPE *yyvaluep;
00644 #endif
00645 {
00646   /* Pacify ``unused variable'' warnings.  */
00647   (void) yyvaluep;
00648 
00649   if (yytype < YYNTOKENS)
00650     {
00651       YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
00652 # ifdef YYPRINT
00653       YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
00654 # endif
00655     }
00656   else
00657     YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
00658 
00659   switch (yytype)
00660     {
00661       default:
00662         break;
00663     }
00664   YYFPRINTF (yyoutput, ")");
00665 }
00666 
00667 #endif /* ! YYDEBUG */
00668 /*-----------------------------------------------.
00669 | Release the memory associated to this symbol.  |
00670 `-----------------------------------------------*/
00671 
00672 #if defined (__STDC__) || defined (__cplusplus)
00673 static void
00674 yydestruct (int yytype, YYSTYPE *yyvaluep)
00675 #else
00676 static void
00677 yydestruct (yytype, yyvaluep)
00678     int yytype;
00679     YYSTYPE *yyvaluep;
00680 #endif
00681 {
00682   /* Pacify ``unused variable'' warnings.  */
00683   (void) yyvaluep;
00684 
00685   switch (yytype)
00686     {
00687 
00688       default:
00689         break;
00690     }
00691 }
00692 
00693 
00694 /* Prevent warnings from -Wmissing-prototypes.  */
00695 
00696 #ifdef YYPARSE_PARAM
00697 # if defined (__STDC__) || defined (__cplusplus)
00698 int yyparse (void *YYPARSE_PARAM);
00699 # else
00700 int yyparse ();
00701 # endif
00702 #else /* ! YYPARSE_PARAM */
00703 #if defined (__STDC__) || defined (__cplusplus)
00704 int yyparse (void);
00705 #else
00706 int yyparse ();
00707 #endif
00708 #endif /* ! YYPARSE_PARAM */
00709 
00710 
00711 
00712 /* The lookahead symbol.  */
00713 int yychar;
00714 
00715 /* The semantic value of the lookahead symbol.  */
00716 YYSTYPE yylval;
00717 
00718 /* Number of syntax errors so far.  */
00719 int yynerrs;
00720 
00721 
00722 
00723 /*----------.
00724 | yyparse.  |
00725 `----------*/
00726 
00727 #ifdef YYPARSE_PARAM
00728 # if defined (__STDC__) || defined (__cplusplus)
00729 int yyparse (void *YYPARSE_PARAM)
00730 # else
00731 int yyparse (YYPARSE_PARAM)
00732   void *YYPARSE_PARAM;
00733 # endif
00734 #else /* ! YYPARSE_PARAM */
00735 #if defined (__STDC__) || defined (__cplusplus)
00736 int
00737 yyparse (void)
00738 #else
00739 int
00740 yyparse ()
00741 
00742 #endif
00743 #endif
00744 {
00745   
00746   register int yystate;
00747   register int yyn;
00748   int yyresult;
00749   /* Number of tokens to shift before error messages enabled.  */
00750   int yyerrstatus;
00751   /* Lookahead token as an internal (translated) token number.  */
00752   int yytoken = 0;
00753 
00754   /* Three stacks and their tools:
00755      `yyss': related to states,
00756      `yyvs': related to semantic values,
00757      `yyls': related to locations.
00758 
00759      Refer to the stacks thru separate pointers, to allow yyoverflow
00760      to reallocate them elsewhere.  */
00761 
00762   /* The state stack.  */
00763   short yyssa[YYINITDEPTH];
00764   short *yyss = yyssa;
00765   register short *yyssp;
00766 
00767   /* The semantic value stack.  */
00768   YYSTYPE yyvsa[YYINITDEPTH];
00769   YYSTYPE *yyvs = yyvsa;
00770   register YYSTYPE *yyvsp;
00771 
00772 
00773 
00774 #define YYPOPSTACK   (yyvsp--, yyssp--)
00775 
00776   YYSIZE_T yystacksize = YYINITDEPTH;
00777 
00778   /* The variables used to return semantic value and location from the
00779      action routines.  */
00780   YYSTYPE yyval;
00781 
00782 
00783   /* When reducing, the number of symbols on the RHS of the reduced
00784      rule.  */
00785   int yylen;
00786 
00787   YYDPRINTF ((stderr, "Starting parse\n"));
00788 
00789   yystate = 0;
00790   yyerrstatus = 0;
00791   yynerrs = 0;
00792   yychar = YYEMPTY;             /* Cause a token to be read.  */
00793 
00794   /* Initialize stack pointers.
00795      Waste one element of value and location stack
00796      so that they stay on the same level as the state stack.
00797      The wasted elements are never initialized.  */
00798 
00799   yyssp = yyss;
00800   yyvsp = yyvs;
00801 
00802   goto yysetstate;
00803 
00804 /*------------------------------------------------------------.
00805 | yynewstate -- Push a new state, which is found in yystate.  |
00806 `------------------------------------------------------------*/
00807  yynewstate:
00808   /* In all cases, when you get here, the value and location stacks
00809      have just been pushed. so pushing a state here evens the stacks.
00810      */
00811   yyssp++;
00812 
00813  yysetstate:
00814   *yyssp = yystate;
00815 
00816   if (yyss + yystacksize - 1 <= yyssp)
00817     {
00818       /* Get the current used size of the three stacks, in elements.  */
00819       YYSIZE_T yysize = yyssp - yyss + 1;
00820 
00821 #ifdef yyoverflow
00822       {
00823         /* Give user a chance to reallocate the stack. Use copies of
00824            these so that the &'s don't force the real ones into
00825            memory.  */
00826         YYSTYPE *yyvs1 = yyvs;
00827         short *yyss1 = yyss;
00828 
00829 
00830         /* Each stack pointer address is followed by the size of the
00831            data in use in that stack, in bytes.  This used to be a
00832            conditional around just the two extra args, but that might
00833            be undefined if yyoverflow is a macro.  */
00834         yyoverflow ("parser stack overflow",
00835                     &yyss1, yysize * sizeof (*yyssp),
00836                     &yyvs1, yysize * sizeof (*yyvsp),
00837 
00838                     &yystacksize);
00839 
00840         yyss = yyss1;
00841         yyvs = yyvs1;
00842       }
00843 #else /* no yyoverflow */
00844 # ifndef YYSTACK_RELOCATE
00845       goto yyoverflowlab;
00846 # else
00847       /* Extend the stack our own way.  */
00848       if (YYMAXDEPTH <= yystacksize)
00849         goto yyoverflowlab;
00850       yystacksize *= 2;
00851       if (YYMAXDEPTH < yystacksize)
00852         yystacksize = YYMAXDEPTH;
00853 
00854       {
00855         short *yyss1 = yyss;
00856         union yyalloc *yyptr =
00857           (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
00858         if (! yyptr)
00859           goto yyoverflowlab;
00860         YYSTACK_RELOCATE (yyss);
00861         YYSTACK_RELOCATE (yyvs);
00862 
00863 #  undef YYSTACK_RELOCATE
00864         if (yyss1 != yyssa)
00865           YYSTACK_FREE (yyss1);
00866       }
00867 # endif
00868 #endif /* no yyoverflow */
00869 
00870       yyssp = yyss + yysize - 1;
00871       yyvsp = yyvs + yysize - 1;
00872 
00873 
00874       YYDPRINTF ((stderr, "Stack size increased to %lu\n",
00875                   (unsigned long int) yystacksize));
00876 
00877       if (yyss + yystacksize - 1 <= yyssp)
00878         YYABORT;
00879     }
00880 
00881   YYDPRINTF ((stderr, "Entering state %d\n", yystate));
00882 
00883   goto yybackup;
00884 
00885 /*-----------.
00886 | yybackup.  |
00887 `-----------*/
00888 yybackup:
00889 
00890 /* Do appropriate processing given the current state.  */
00891 /* Read a lookahead token if we need one and don't already have one.  */
00892 /* yyresume: */
00893 
00894   /* First try to decide what to do without reference to lookahead token.  */
00895 
00896   yyn = yypact[yystate];
00897   if (yyn == YYPACT_NINF)
00898     goto yydefault;
00899 
00900   /* Not known => get a lookahead token if don't already have one.  */
00901 
00902   /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol.  */
00903   if (yychar == YYEMPTY)
00904     {
00905       YYDPRINTF ((stderr, "Reading a token: "));
00906       yychar = YYLEX;
00907     }
00908 
00909   if (yychar <= YYEOF)
00910     {
00911       yychar = yytoken = YYEOF;
00912       YYDPRINTF ((stderr, "Now at end of input.\n"));
00913     }
00914   else
00915     {
00916       yytoken = YYTRANSLATE (yychar);
00917       YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc);
00918     }
00919 
00920   /* If the proper action on seeing token YYTOKEN is to reduce or to
00921      detect an error, take that action.  */
00922   yyn += yytoken;
00923   if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
00924     goto yydefault;
00925   yyn = yytable[yyn];
00926   if (yyn <= 0)
00927     {
00928       if (yyn == 0 || yyn == YYTABLE_NINF)
00929         goto yyerrlab;
00930       yyn = -yyn;
00931       goto yyreduce;
00932     }
00933 
00934   if (yyn == YYFINAL)
00935     YYACCEPT;
00936 
00937   /* Shift the lookahead token.  */
00938   YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken]));
00939 
00940   /* Discard the token being shifted unless it is eof.  */
00941   if (yychar != YYEOF)
00942     yychar = YYEMPTY;
00943 
00944   *++yyvsp = yylval;
00945 
00946 
00947   /* Count tokens shifted since error; after three, turn off error
00948      status.  */
00949   if (yyerrstatus)
00950     yyerrstatus--;
00951 
00952   yystate = yyn;
00953   goto yynewstate;
00954 
00955 
00956 /*-----------------------------------------------------------.
00957 | yydefault -- do the default action for the current state.  |
00958 `-----------------------------------------------------------*/
00959 yydefault:
00960   yyn = yydefact[yystate];
00961   if (yyn == 0)
00962     goto yyerrlab;
00963   goto yyreduce;
00964 
00965 
00966 /*-----------------------------.
00967 | yyreduce -- Do a reduction.  |
00968 `-----------------------------*/
00969 yyreduce:
00970   /* yyn is the number of a rule to reduce with.  */
00971   yylen = yyr2[yyn];
00972 
00973   /* If YYLEN is nonzero, implement the default value of the action:
00974      `$$ = $1'.
00975 
00976      Otherwise, the following line sets YYVAL to garbage.
00977      This behavior is undocumented and Bison
00978      users should not rely upon it.  Assigning to YYVAL
00979      unconditionally makes the parser a bit smaller, and it avoids a
00980      GCC warning that YYVAL may be used uninitialized.  */
00981   yyval = yyvsp[1-yylen];
00982 
00983 
00984   YY_REDUCE_PRINT (yyn);
00985   switch (yyn)
00986     {
00987       
00988     }
00989 
00990 /* Line 999 of yacc.c.  */
00991 #line 991 "tsp_ascii_writer_config.tab.c"
00992 
00993   yyvsp -= yylen;
00994   yyssp -= yylen;
00995 
00996 
00997   YY_STACK_PRINT (yyss, yyssp);
00998 
00999   *++yyvsp = yyval;
01000 
01001 
01002   /* Now `shift' the result of the reduction.  Determine what state
01003      that goes to, based on the state we popped back to and the rule
01004      number reduced by.  */
01005 
01006   yyn = yyr1[yyn];
01007 
01008   yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
01009   if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
01010     yystate = yytable[yystate];
01011   else
01012     yystate = yydefgoto[yyn - YYNTOKENS];
01013 
01014   goto yynewstate;
01015 
01016 
01017 /*------------------------------------.
01018 | yyerrlab -- here on detecting error |
01019 `------------------------------------*/
01020 yyerrlab:
01021   /* If not already recovering from an error, report this error.  */
01022   if (!yyerrstatus)
01023     {
01024       ++yynerrs;
01025 #if YYERROR_VERBOSE
01026       yyn = yypact[yystate];
01027 
01028       if (YYPACT_NINF < yyn && yyn < YYLAST)
01029         {
01030           YYSIZE_T yysize = 0;
01031           int yytype = YYTRANSLATE (yychar);
01032           char *yymsg;
01033           int yyx, yycount;
01034 
01035           yycount = 0;
01036           /* Start YYX at -YYN if negative to avoid negative indexes in
01037              YYCHECK.  */
01038           for (yyx = yyn < 0 ? -yyn : 0;
01039                yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++)
01040             if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
01041               yysize += yystrlen (yytname[yyx]) + 15, yycount++;
01042           yysize += yystrlen ("syntax error, unexpected ") + 1;
01043           yysize += yystrlen (yytname[yytype]);
01044           yymsg = (char *) YYSTACK_ALLOC (yysize);
01045           if (yymsg != 0)
01046             {
01047               char *yyp = yystpcpy (yymsg, "syntax error, unexpected ");
01048               yyp = yystpcpy (yyp, yytname[yytype]);
01049 
01050               if (yycount < 5)
01051                 {
01052                   yycount = 0;
01053                   for (yyx = yyn < 0 ? -yyn : 0;
01054                        yyx < (int) (sizeof (yytname) / sizeof (char *));
01055                        yyx++)
01056                     if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
01057                       {
01058                         const char *yyq = ! yycount ? ", expecting " : " or ";
01059                         yyp = yystpcpy (yyp, yyq);
01060                         yyp = yystpcpy (yyp, yytname[yyx]);
01061                         yycount++;
01062                       }
01063                 }
01064               yyerror (yymsg);
01065               YYSTACK_FREE (yymsg);
01066             }
01067           else
01068             yyerror ("syntax error; also virtual memory exhausted");
01069         }
01070       else
01071 #endif /* YYERROR_VERBOSE */
01072         yyerror ("syntax error");
01073     }
01074 
01075 
01076 
01077   if (yyerrstatus == 3)
01078     {
01079       /* If just tried and failed to reuse lookahead token after an
01080          error, discard it.  */
01081 
01082       /* Return failure if at end of input.  */
01083       if (yychar == YYEOF)
01084         {
01085           /* Pop the error token.  */
01086           YYPOPSTACK;
01087           /* Pop the rest of the stack.  */
01088           while (yyss < yyssp)
01089             {
01090               YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
01091               yydestruct (yystos[*yyssp], yyvsp);
01092               YYPOPSTACK;
01093             }
01094           YYABORT;
01095         }
01096 
01097       YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc);
01098       yydestruct (yytoken, &yylval);
01099       yychar = YYEMPTY;
01100 
01101     }
01102 
01103   /* Else will try to reuse lookahead token after shifting the error
01104      token.  */
01105   goto yyerrlab1;
01106 
01107 
01108 /*----------------------------------------------------.
01109 | yyerrlab1 -- error raised explicitly by an action.  |
01110 `----------------------------------------------------*/
01111 yyerrlab1:
01112   yyerrstatus = 3;      /* Each real token shifted decrements this.  */
01113 
01114   for (;;)
01115     {
01116       yyn = yypact[yystate];
01117       if (yyn != YYPACT_NINF)
01118         {
01119           yyn += YYTERROR;
01120           if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
01121             {
01122               yyn = yytable[yyn];
01123               if (0 < yyn)
01124                 break;
01125             }
01126         }
01127 
01128       /* Pop the current state because it cannot handle the error token.  */
01129       if (yyssp == yyss)
01130         YYABORT;
01131 
01132       YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
01133       yydestruct (yystos[yystate], yyvsp);
01134       yyvsp--;
01135       yystate = *--yyssp;
01136 
01137       YY_STACK_PRINT (yyss, yyssp);
01138     }
01139 
01140   if (yyn == YYFINAL)
01141     YYACCEPT;
01142 
01143   YYDPRINTF ((stderr, "Shifting error token, "));
01144 
01145   *++yyvsp = yylval;
01146 
01147 
01148   yystate = yyn;
01149   goto yynewstate;
01150 
01151 
01152 /*-------------------------------------.
01153 | yyacceptlab -- YYACCEPT comes here.  |
01154 `-------------------------------------*/
01155 yyacceptlab:
01156   yyresult = 0;
01157   goto yyreturn;
01158 
01159 /*-----------------------------------.
01160 | yyabortlab -- YYABORT comes here.  |
01161 `-----------------------------------*/
01162 yyabortlab:
01163   yyresult = 1;
01164   goto yyreturn;
01165 
01166 #ifndef yyoverflow
01167 /*----------------------------------------------.
01168 | yyoverflowlab -- parser overflow comes here.  |
01169 `----------------------------------------------*/
01170 yyoverflowlab:
01171   yyerror ("parser stack overflow");
01172   yyresult = 2;
01173   /* Fall through.  */
01174 #endif
01175 
01176 yyreturn:
01177 #ifndef yyoverflow
01178   if (yyss != yyssa)
01179     YYSTACK_FREE (yyss);
01180 #endif
01181   return yyresult;
01182 }
01183 
01184 
01185 #line 15 "tsp_ascii_writer_config.y"
01186  
01187 #ifdef YACCMAIN
01188 int main( void ) {
01189   /*  yydebug = 1; */
01190   yyparse();
01191   return 0;
01192 }
01193 #endif
01194 
01195 
Framework Home Page.

Beware !! TSP wave is coming...