00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047 #define YYBISON 1
00048
00049
00050 #define YYBISON_VERSION "2.2"
00051
00052
00053 #define YYSKELETON_NAME "yacc.c"
00054
00055
00056 #define YYPURE 0
00057
00058
00059 #define YYLSP_NEEDED 0
00060
00061
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
00072 #ifndef YYTOKENTYPE
00073 # define YYTOKENTYPE
00074
00075
00076 enum yytokentype {
00077 STRING = 258,
00078 COMMA = 259,
00079 NEWLINE = 260
00080 };
00081 #endif
00082
00083 #define STRING 258
00084 #define COMMA 259
00085 #define NEWLINE 260
00086
00087
00088
00089
00090
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
00120 #ifndef YYDEBUG
00121 # define YYDEBUG 0
00122 #endif
00123
00124
00125 #ifdef YYERROR_VERBOSE
00126 # undef YYERROR_VERBOSE
00127 # define YYERROR_VERBOSE 1
00128 #else
00129 # define YYERROR_VERBOSE 0
00130 #endif
00131
00132
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
00144 #line 145 "src/rddf_parser.tab.c"
00145 YYSTYPE;
00146 # define yystype YYSTYPE
00147 # define YYSTYPE_IS_DECLARED 1
00148 # define YYSTYPE_IS_TRIVIAL 1
00149 #endif
00150
00151
00152
00153
00154
00155
00156
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>
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>
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
00219 #if ! defined lint || defined __GNUC__
00220 # define YYUSE(e) ((void) (e))
00221 #else
00222 # define YYUSE(e)
00223 #endif
00224
00225
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
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>
00253 # elif defined _AIX
00254 # define YYSTACK_ALLOC __alloca
00255 # elif defined _MSC_VER
00256 # include <malloc.h>
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>
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
00273 # define YYSTACK_FREE(Ptr) do { ; } while (YYID (0))
00274 # ifndef YYSTACK_ALLOC_MAXIMUM
00275
00276
00277
00278
00279 # define YYSTACK_ALLOC_MAXIMUM 4032
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>
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);
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 *);
00307 # endif
00308 # endif
00309 # endif
00310 #endif
00311
00312
00313 #if (! defined yyoverflow \
00314 && (! defined __cplusplus \
00315 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
00316
00317
00318 union yyalloc
00319 {
00320 yytype_int16 yyss;
00321 YYSTYPE yyvs;
00322 };
00323
00324
00325 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
00326
00327
00328
00329 # define YYSTACK_BYTES(N) \
00330 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
00331 + YYSTACK_GAP_MAXIMUM)
00332
00333
00334
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
00352
00353
00354
00355
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
00370 #define YYFINAL 4
00371
00372 #define YYLAST 14
00373
00374
00375 #define YYNTOKENS 6
00376
00377 #define YYNNTS 5
00378
00379 #define YYNRULES 8
00380
00381 #define YYNSTATES 16
00382
00383
00384 #define YYUNDEFTOK 2
00385 #define YYMAXUTOK 260
00386
00387 #define YYTRANSLATE(YYX) \
00388 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
00389
00390
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
00424
00425 static const yytype_uint8 yyprhs[] =
00426 {
00427 0, 0, 3, 5, 6, 8, 11, 12, 16
00428 };
00429
00430
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
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
00447
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
00458
00459 static const yytype_uint16 yytoknum[] =
00460 {
00461 0, 256, 257, 258, 259, 260
00462 };
00463 # endif
00464
00465
00466 static const yytype_uint8 yyr1[] =
00467 {
00468 0, 6, 7, 8, 8, 8, 9, 9, 10
00469 };
00470
00471
00472 static const yytype_uint8 yyr2[] =
00473 {
00474 0, 2, 1, 0, 1, 2, 0, 3, 9
00475 };
00476
00477
00478
00479
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
00487 static const yytype_int8 yydefgoto[] =
00488 {
00489 -1, 1, 2, 3, 6
00490 };
00491
00492
00493
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
00502 static const yytype_int8 yypgoto[] =
00503 {
00504 -4, -4, -4, -4, -4
00505 };
00506
00507
00508
00509
00510
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
00525
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
00543
00544
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
00573
00574
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
00599
00600
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
00615
00616 #ifdef YYLEX_PARAM
00617 # define YYLEX yylex (YYLEX_PARAM)
00618 #else
00619 # define YYLEX yylex ()
00620 #endif
00621
00622
00623 #if YYDEBUG
00624
00625 # ifndef YYFPRINTF
00626 # include <stdio.h>
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
00650
00651
00652
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
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
00708
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
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
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
00776
00777 int yydebug;
00778 #else
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
00784
00785
00786
00787 #ifndef YYINITDEPTH
00788 # define YYINITDEPTH 200
00789 #endif
00790
00791
00792
00793
00794
00795
00796
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
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
00834
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
00859
00860
00861
00862
00863
00864
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
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
00906
00907
00908
00909
00910
00911
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
00932
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
00951
00952 int yyxbegin = yyn < 0 ? -yyn : 0;
00953
00954
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
00991
00992
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
01013
01014
01015
01016
01017
01018
01019
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
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
01056 #if defined __STDC__ || defined __cplusplus
01057 int yyparse (void);
01058 #else
01059 int yyparse ();
01060 #endif
01061 #endif
01062
01063
01064
01065
01066 int yychar;
01067
01068
01069 YYSTYPE yylval;
01070
01071
01072 int yynerrs;
01073
01074
01075
01076
01077
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
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
01107 int yyerrstatus;
01108
01109 int yytoken = 0;
01110 #if YYERROR_VERBOSE
01111
01112 char yymsgbuf[128];
01113 char *yymsg = yymsgbuf;
01114 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
01115 #endif
01116
01117
01118
01119
01120
01121
01122
01123
01124
01125
01126 yytype_int16 yyssa[YYINITDEPTH];
01127 yytype_int16 *yyss = yyssa;
01128 yytype_int16 *yyssp;
01129
01130
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
01142
01143 YYSTYPE yyval;
01144
01145
01146
01147
01148 int yylen = 0;
01149
01150 YYDPRINTF ((stderr, "Starting parse\n"));
01151
01152 yystate = 0;
01153 yyerrstatus = 0;
01154 yynerrs = 0;
01155 yychar = YYEMPTY;
01156
01157
01158
01159
01160
01161
01162 yyssp = yyss;
01163 yyvsp = yyvs;
01164
01165 goto yysetstate;
01166
01167
01168
01169
01170 yynewstate:
01171
01172
01173 yyssp++;
01174
01175 yysetstate:
01176 *yyssp = yystate;
01177
01178 if (yyss + yystacksize - 1 <= yyssp)
01179 {
01180
01181 YYSIZE_T yysize = yyssp - yyss + 1;
01182
01183 #ifdef yyoverflow
01184 {
01185
01186
01187
01188 YYSTYPE *yyvs1 = yyvs;
01189 yytype_int16 *yyss1 = yyss;
01190
01191
01192
01193
01194
01195
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
01206 # ifndef YYSTACK_RELOCATE
01207 goto yyexhaustedlab;
01208 # else
01209
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
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
01249
01250 yybackup:
01251
01252
01253
01254
01255
01256 yyn = yypact[yystate];
01257 if (yyn == YYPACT_NINF)
01258 goto yydefault;
01259
01260
01261
01262
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
01281
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
01298
01299 if (yyerrstatus)
01300 yyerrstatus--;
01301
01302
01303 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
01304
01305
01306 if (yychar != YYEOF)
01307 yychar = YYEMPTY;
01308
01309 yystate = yyn;
01310 *++yyvsp = yylval;
01311
01312 goto yynewstate;
01313
01314
01315
01316
01317
01318 yydefault:
01319 yyn = yydefact[yystate];
01320 if (yyn == 0)
01321 goto yyerrlab;
01322 goto yyreduce;
01323
01324
01325
01326
01327
01328 yyreduce:
01329
01330 yylen = yyr2[yyn];
01331
01332
01333
01334
01335
01336
01337
01338
01339
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
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
01388
01389
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
01404
01405 yyerrlab:
01406
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
01452
01453
01454 if (yychar <= YYEOF)
01455 {
01456
01457 if (yychar == YYEOF)
01458 YYABORT;
01459 }
01460 else
01461 {
01462 yydestruct ("Error: discarding",
01463 yytoken, &yylval);
01464 yychar = YYEMPTY;
01465 }
01466 }
01467
01468
01469
01470 goto yyerrlab1;
01471
01472
01473
01474
01475
01476 yyerrorlab:
01477
01478
01479
01480
01481 if ( 0)
01482 goto yyerrorlab;
01483
01484
01485
01486 YYPOPSTACK (yylen);
01487 yylen = 0;
01488 YY_STACK_PRINT (yyss, yyssp);
01489 yystate = *yyssp;
01490 goto yyerrlab1;
01491
01492
01493
01494
01495
01496 yyerrlab1:
01497 yyerrstatus = 3;
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
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
01532 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
01533
01534 yystate = yyn;
01535 goto yynewstate;
01536
01537
01538
01539
01540
01541 yyacceptlab:
01542 yyresult = 0;
01543 goto yyreturn;
01544
01545
01546
01547
01548 yyabortlab:
01549 yyresult = 1;
01550 goto yyreturn;
01551
01552 #ifndef yyoverflow
01553
01554
01555
01556 yyexhaustedlab:
01557 yyerror (YY_("memory exhausted"));
01558 yyresult = 2;
01559
01560 #endif
01561
01562 yyreturn:
01563 if (yychar != YYEOF && yychar != YYEMPTY)
01564 yydestruct ("Cleanup: discarding lookahead",
01565 yytoken, &yylval);
01566
01567
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