00001
00002
00003
00004 #define YYBISON 1
00005
00006 #define yyparse contactparse
00007 #define yylex contactlex
00008 #define yyerror contacterror
00009 #define yylval contactlval
00010 #define yychar contactchar
00011 #define yydebug contactdebug
00012 #define yynerrs contactnerrs
00013 # define ACCOUNT 257
00014 # define END_ACCOUNT 258
00015 # define GROUP 259
00016 # define END_GROUP 260
00017 # define CONTACT 261
00018 # define END_CONTACT 262
00019 # define IDENTIFIER 263
00020 # define STRING 264
00021
00022 #line 2 "contact_parser.y"
00023
00024 #include <gtk/gtk.h>
00025 #include <stdio.h>
00026 #include <stdlib.h>
00027 #include <string.h>
00028
00029 #include "globals.h"
00030 #include "account.h"
00031 #include "value_pair.h"
00032 #include "service.h"
00033 #include "util.h"
00034
00035 extern int Line_contact;
00036 #define contacterror(error) printf("Parse error on line %d: %s\n", Line_contact, error );
00037 static struct contact * cur_contact = NULL;
00038 static grouplist * cur_group = NULL;
00039 extern int contactlex();
00040
00041
00042 #line 22 "contact_parser.y"
00043 #ifndef YYSTYPE
00044 typedef union {
00045 GList * vals;
00046 value_pair * val;
00047 grouplist * grp;
00048 gchar * string;
00049 eb_account * acnt;
00050 struct contact * cntct;
00051 } yystype;
00052 # define YYSTYPE yystype
00053 # define YYSTYPE_IS_TRIVIAL 1
00054 #endif
00055 #ifndef YYDEBUG
00056 # define YYDEBUG 0
00057 #endif
00058
00059
00060
00061 #define YYFINAL 36
00062 #define YYFLAG -32768
00063 #define YYNTBASE 14
00064
00065
00066 #define YYTRANSLATE(x) ((unsigned)(x) <= 264 ? yytranslate[x] : 26)
00067
00068
00069 static const char yytranslate[] =
00070 {
00071 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00072 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00073 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00074 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00075 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00076 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00077 11, 13, 12, 2, 2, 2, 2, 2, 2, 2,
00078 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00079 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00080 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00081 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00082 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00083 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00084 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00085 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00086 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00087 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00088 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00089 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00090 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00091 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00092 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00093 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00094 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00095 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00096 2, 2, 2, 2, 2, 2, 1, 3, 4, 5,
00097 6, 7, 8, 9, 10
00098 };
00099
00100 #if YYDEBUG
00101 static const short yyprhs[] =
00102 {
00103 0, 0, 2, 5, 7, 8, 14, 17, 19, 20,
00104 26, 29, 31, 40, 43, 45, 49
00105 };
00106 static const short yyrhs[] =
00107 {
00108 15, 0, 16, 15, 0, 25, 0, 0, 5, 23,
00109 17, 18, 6, 0, 19, 18, 0, 25, 0, 0,
00110 7, 23, 20, 21, 8, 0, 22, 21, 0, 25,
00111 0, 11, 3, 9, 12, 23, 11, 4, 12, 0,
00112 24, 23, 0, 24, 0, 9, 13, 10, 0, 0
00113 };
00114
00115 #endif
00116
00117 #if YYDEBUG
00118
00119 static const short yyrline[] =
00120 {
00121 0, 43, 47, 49, 52, 52, 67, 69, 72, 72,
00122 127, 129, 133, 148, 150, 154, 170
00123 };
00124 #endif
00125
00126
00127 #if (YYDEBUG) || defined YYERROR_VERBOSE
00128
00129
00130 static const char *const yytname[] =
00131 {
00132 "$", "error", "$undefined.", "ACCOUNT", "END_ACCOUNT", "GROUP",
00133 "END_GROUP", "CONTACT", "END_CONTACT", "IDENTIFIER", "STRING", "'<'",
00134 "'>'", "'='", "start", "group_list", "group", "@1", "contact_list",
00135 "contact", "@2", "account_list", "account", "value_list", "key_pair",
00136 "EPSILON", 0
00137 };
00138 #endif
00139
00140
00141 static const short yyr1[] =
00142 {
00143 0, 14, 15, 15, 17, 16, 18, 18, 20, 19,
00144 21, 21, 22, 23, 23, 24, 25
00145 };
00146
00147
00148 static const short yyr2[] =
00149 {
00150 0, 1, 2, 1, 0, 5, 2, 1, 0, 5,
00151 2, 1, 8, 2, 1, 3, 0
00152 };
00153
00154
00155
00156
00157 static const short yydefact[] =
00158 {
00159 16, 0, 1, 16, 3, 0, 4, 14, 2, 0,
00160 16, 13, 15, 0, 0, 16, 7, 8, 5, 6,
00161 16, 0, 0, 16, 11, 0, 9, 10, 0, 0,
00162 0, 0, 0, 12, 0, 0, 0
00163 };
00164
00165 static const short yydefgoto[] =
00166 {
00167 34, 2, 3, 10, 14, 15, 20, 22, 23, 6,
00168 7, 4
00169 };
00170
00171 static const short yypact[] =
00172 {
00173 -4, -6,-32768, -4,-32768, -9,-32768, -6,-32768, -5,
00174 1,-32768,-32768, -6, 3, 1,-32768,-32768,-32768,-32768,
00175 -1, 8, 5, -1,-32768, 7,-32768,-32768, 2, -6,
00176 6, 14, 9,-32768, 19, 20,-32768
00177 };
00178
00179 static const short yypgoto[] =
00180 {
00181 -32768, 21,-32768,-32768, 10,-32768,-32768, 0,-32768, -7,
00182 -32768, -8
00183 };
00184
00185
00186 #define YYLAST 25
00187
00188
00189 static const short yytable[] =
00190 {
00191 11, 1, 16, 5, 9, 12, 17, 16, 13, 18,
00192 21, 25, 24, 26, 29, 24, 28, 31, 32, 35,
00193 36, 33, 30, 27, 8, 19
00194 };
00195
00196 static const short yycheck[] =
00197 {
00198 7, 5, 10, 9, 13, 10, 13, 15, 7, 6,
00199 11, 3, 20, 8, 12, 23, 9, 11, 4, 0,
00200 0, 12, 29, 23, 3, 15
00201 };
00202
00203 #line 3 "/usr/share/bison/bison.simple"
00204
00205
00206
00207
00208
00209
00210
00211
00212
00213
00214
00215
00216
00217
00218
00219
00220
00221
00222
00223
00224
00225
00226
00227
00228
00229
00230
00231
00232
00233
00234
00235
00236
00237
00238
00239
00240
00241
00242 #if ! defined (yyoverflow) || defined (YYERROR_VERBOSE)
00243
00244
00245
00246 # if YYSTACK_USE_ALLOCA
00247 # define YYSTACK_ALLOC alloca
00248 # else
00249 # ifndef YYSTACK_USE_ALLOCA
00250 # if defined (alloca) || defined (_ALLOCA_H)
00251 # define YYSTACK_ALLOC alloca
00252 # else
00253 # ifdef __GNUC__
00254 # define YYSTACK_ALLOC __builtin_alloca
00255 # endif
00256 # endif
00257 # endif
00258 # endif
00259
00260 # ifdef YYSTACK_ALLOC
00261
00262 # define YYSTACK_FREE(Ptr) do { ; } while (0)
00263 # else
00264 # if defined (__STDC__) || defined (__cplusplus)
00265 # include <stdlib.h>
00266 # define YYSIZE_T size_t
00267 # endif
00268 # define YYSTACK_ALLOC malloc
00269 # define YYSTACK_FREE free
00270 # endif
00271 #endif
00272
00273
00274 #if (! defined (yyoverflow) \
00275 && (! defined (__cplusplus) \
00276 || (YYLTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
00277
00278
00279 union yyalloc
00280 {
00281 short yyss;
00282 YYSTYPE yyvs;
00283 # if YYLSP_NEEDED
00284 YYLTYPE yyls;
00285 # endif
00286 };
00287
00288
00289 # define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1)
00290
00291
00292
00293 # if YYLSP_NEEDED
00294 # define YYSTACK_BYTES(N) \
00295 ((N) * (sizeof (short) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
00296 + 2 * YYSTACK_GAP_MAX)
00297 # else
00298 # define YYSTACK_BYTES(N) \
00299 ((N) * (sizeof (short) + sizeof (YYSTYPE)) \
00300 + YYSTACK_GAP_MAX)
00301 # endif
00302
00303
00304
00305 # ifndef YYCOPY
00306 # if 1 < __GNUC__
00307 # define YYCOPY(To, From, Count) \
00308 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
00309 # else
00310 # define YYCOPY(To, From, Count) \
00311 do \
00312 { \
00313 register YYSIZE_T yyi; \
00314 for (yyi = 0; yyi < (Count); yyi++) \
00315 (To)[yyi] = (From)[yyi]; \
00316 } \
00317 while (0)
00318 # endif
00319 # endif
00320
00321
00322
00323
00324
00325
00326 # define YYSTACK_RELOCATE(Stack) \
00327 do \
00328 { \
00329 YYSIZE_T yynewbytes; \
00330 YYCOPY (&yyptr->Stack, Stack, yysize); \
00331 Stack = &yyptr->Stack; \
00332 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAX; \
00333 yyptr += yynewbytes / sizeof (*yyptr); \
00334 } \
00335 while (0)
00336
00337 #endif
00338
00339
00340 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
00341 # define YYSIZE_T __SIZE_TYPE__
00342 #endif
00343 #if ! defined (YYSIZE_T) && defined (size_t)
00344 # define YYSIZE_T size_t
00345 #endif
00346 #if ! defined (YYSIZE_T)
00347 # if defined (__STDC__) || defined (__cplusplus)
00348 # include <stddef.h>
00349 # define YYSIZE_T size_t
00350 # endif
00351 #endif
00352 #if ! defined (YYSIZE_T)
00353 # define YYSIZE_T unsigned int
00354 #endif
00355
00356 #define yyerrok (yyerrstatus = 0)
00357 #define yyclearin (yychar = YYEMPTY)
00358 #define YYEMPTY -2
00359 #define YYEOF 0
00360 #define YYACCEPT goto yyacceptlab
00361 #define YYABORT goto yyabortlab
00362 #define YYERROR goto yyerrlab1
00363
00364
00365
00366 #define YYFAIL goto yyerrlab
00367 #define YYRECOVERING() (!!yyerrstatus)
00368 #define YYBACKUP(Token, Value) \
00369 do \
00370 if (yychar == YYEMPTY && yylen == 1) \
00371 { \
00372 yychar = (Token); \
00373 yylval = (Value); \
00374 yychar1 = YYTRANSLATE (yychar); \
00375 YYPOPSTACK; \
00376 goto yybackup; \
00377 } \
00378 else \
00379 { \
00380 yyerror ("syntax error: cannot back up"); \
00381 YYERROR; \
00382 } \
00383 while (0)
00384
00385 #define YYTERROR 1
00386 #define YYERRCODE 256
00387
00388
00389
00390
00391
00392
00393
00394
00395
00396 #ifndef YYLLOC_DEFAULT
00397 # define YYLLOC_DEFAULT(Current, Rhs, N) \
00398 Current.last_line = Rhs[N].last_line; \
00399 Current.last_column = Rhs[N].last_column;
00400 #endif
00401
00402
00403
00404
00405 #if YYPURE
00406 # if YYLSP_NEEDED
00407 # ifdef YYLEX_PARAM
00408 # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
00409 # else
00410 # define YYLEX yylex (&yylval, &yylloc)
00411 # endif
00412 # else
00413 # ifdef YYLEX_PARAM
00414 # define YYLEX yylex (&yylval, YYLEX_PARAM)
00415 # else
00416 # define YYLEX yylex (&yylval)
00417 # endif
00418 # endif
00419 #else
00420 # define YYLEX yylex ()
00421 #endif
00422
00423
00424
00425 #if YYDEBUG
00426
00427 # ifndef YYFPRINTF
00428 # include <stdio.h>
00429 # define YYFPRINTF fprintf
00430 # endif
00431
00432 # define YYDPRINTF(Args) \
00433 do { \
00434 if (yydebug) \
00435 YYFPRINTF Args; \
00436 } while (0)
00437
00438
00439 int yydebug;
00440 #else
00441 # define YYDPRINTF(Args)
00442 #endif
00443
00444
00445 #ifndef YYINITDEPTH
00446 # define YYINITDEPTH 200
00447 #endif
00448
00449
00450
00451
00452
00453
00454
00455
00456 #if YYMAXDEPTH == 0
00457 # undef YYMAXDEPTH
00458 #endif
00459
00460 #ifndef YYMAXDEPTH
00461 # define YYMAXDEPTH 10000
00462 #endif
00463
00464 #ifdef YYERROR_VERBOSE
00465
00466 # ifndef yystrlen
00467 # if defined (__GLIBC__) && defined (_STRING_H)
00468 # define yystrlen strlen
00469 # else
00470
00471 static YYSIZE_T
00472 # if defined (__STDC__) || defined (__cplusplus)
00473 yystrlen (const char *yystr)
00474 # else
00475 yystrlen (yystr)
00476 const char *yystr;
00477 # endif
00478 {
00479 register const char *yys = yystr;
00480
00481 while (*yys++ != '\0')
00482 continue;
00483
00484 return yys - yystr - 1;
00485 }
00486 # endif
00487 # endif
00488
00489 # ifndef yystpcpy
00490 # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
00491 # define yystpcpy stpcpy
00492 # else
00493
00494
00495 static char *
00496 # if defined (__STDC__) || defined (__cplusplus)
00497 yystpcpy (char *yydest, const char *yysrc)
00498 # else
00499 yystpcpy (yydest, yysrc)
00500 char *yydest;
00501 const char *yysrc;
00502 # endif
00503 {
00504 register char *yyd = yydest;
00505 register const char *yys = yysrc;
00506
00507 while ((*yyd++ = *yys++) != '\0')
00508 continue;
00509
00510 return yyd - 1;
00511 }
00512 # endif
00513 # endif
00514 #endif
00515
00516 #line 315 "/usr/share/bison/bison.simple"
00517
00518
00519
00520
00521
00522
00523
00524
00525 #ifdef YYPARSE_PARAM
00526 # if defined (__STDC__) || defined (__cplusplus)
00527 # define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
00528 # define YYPARSE_PARAM_DECL
00529 # else
00530 # define YYPARSE_PARAM_ARG YYPARSE_PARAM
00531 # define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
00532 # endif
00533 #else
00534 # define YYPARSE_PARAM_ARG
00535 # define YYPARSE_PARAM_DECL
00536 #endif
00537
00538
00539 #ifdef __GNUC__
00540 # ifdef YYPARSE_PARAM
00541 int yyparse (void *);
00542 # else
00543 int yyparse (void);
00544 # endif
00545 #endif
00546
00547
00548
00549
00550 #define YY_DECL_NON_LSP_VARIABLES \
00551 \
00552 int yychar; \
00553 \
00554 \
00555 YYSTYPE yylval; \
00556 \
00557 \
00558 int yynerrs;
00559
00560 #if YYLSP_NEEDED
00561 # define YY_DECL_VARIABLES \
00562 YY_DECL_NON_LSP_VARIABLES \
00563 \
00564 \
00565 YYLTYPE yylloc;
00566 #else
00567 # define YY_DECL_VARIABLES \
00568 YY_DECL_NON_LSP_VARIABLES
00569 #endif
00570
00571
00572
00573
00574 #if !YYPURE
00575 YY_DECL_VARIABLES
00576 #endif
00577
00578 int
00579 yyparse (YYPARSE_PARAM_ARG)
00580 YYPARSE_PARAM_DECL
00581 {
00582
00583 #if YYPURE
00584 YY_DECL_VARIABLES
00585 #endif
00586
00587 register int yystate;
00588 register int yyn;
00589 int yyresult;
00590
00591 int yyerrstatus;
00592
00593 int yychar1 = 0;
00594
00595
00596
00597
00598
00599
00600
00601
00602
00603
00604 short yyssa[YYINITDEPTH];
00605 short *yyss = yyssa;
00606 register short *yyssp;
00607
00608
00609 YYSTYPE yyvsa[YYINITDEPTH];
00610 YYSTYPE *yyvs = yyvsa;
00611 register YYSTYPE *yyvsp;
00612
00613 #if YYLSP_NEEDED
00614
00615 YYLTYPE yylsa[YYINITDEPTH];
00616 YYLTYPE *yyls = yylsa;
00617 YYLTYPE *yylsp;
00618 #endif
00619
00620 #if YYLSP_NEEDED
00621 # define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
00622 #else
00623 # define YYPOPSTACK (yyvsp--, yyssp--)
00624 #endif
00625
00626 YYSIZE_T yystacksize = YYINITDEPTH;
00627
00628
00629
00630
00631 YYSTYPE yyval;
00632 #if YYLSP_NEEDED
00633 YYLTYPE yyloc;
00634 #endif
00635
00636
00637
00638 int yylen;
00639
00640 YYDPRINTF ((stderr, "Starting parse\n"));
00641
00642 yystate = 0;
00643 yyerrstatus = 0;
00644 yynerrs = 0;
00645 yychar = YYEMPTY;
00646
00647
00648
00649
00650
00651
00652 yyssp = yyss;
00653 yyvsp = yyvs;
00654 #if YYLSP_NEEDED
00655 yylsp = yyls;
00656 #endif
00657 goto yysetstate;
00658
00659
00660
00661
00662 yynewstate:
00663
00664
00665
00666 yyssp++;
00667
00668 yysetstate:
00669 *yyssp = yystate;
00670
00671 if (yyssp >= yyss + yystacksize - 1)
00672 {
00673
00674 YYSIZE_T yysize = yyssp - yyss + 1;
00675
00676 #ifdef yyoverflow
00677 {
00678
00679
00680
00681 YYSTYPE *yyvs1 = yyvs;
00682 short *yyss1 = yyss;
00683
00684
00685
00686 # if YYLSP_NEEDED
00687 YYLTYPE *yyls1 = yyls;
00688
00689
00690 yyoverflow ("parser stack overflow",
00691 &yyss1, yysize * sizeof (*yyssp),
00692 &yyvs1, yysize * sizeof (*yyvsp),
00693 &yyls1, yysize * sizeof (*yylsp),
00694 &yystacksize);
00695 yyls = yyls1;
00696 # else
00697 yyoverflow ("parser stack overflow",
00698 &yyss1, yysize * sizeof (*yyssp),
00699 &yyvs1, yysize * sizeof (*yyvsp),
00700 &yystacksize);
00701 # endif
00702 yyss = yyss1;
00703 yyvs = yyvs1;
00704 }
00705 #else
00706 # ifndef YYSTACK_RELOCATE
00707 goto yyoverflowlab;
00708 # else
00709
00710 if (yystacksize >= YYMAXDEPTH)
00711 goto yyoverflowlab;
00712 yystacksize *= 2;
00713 if (yystacksize > YYMAXDEPTH)
00714 yystacksize = YYMAXDEPTH;
00715
00716 {
00717 short *yyss1 = yyss;
00718 union yyalloc *yyptr =
00719 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
00720 if (! yyptr)
00721 goto yyoverflowlab;
00722 YYSTACK_RELOCATE (yyss);
00723 YYSTACK_RELOCATE (yyvs);
00724 # if YYLSP_NEEDED
00725 YYSTACK_RELOCATE (yyls);
00726 # endif
00727 # undef YYSTACK_RELOCATE
00728 if (yyss1 != yyssa)
00729 YYSTACK_FREE (yyss1);
00730 }
00731 # endif
00732 #endif
00733
00734 yyssp = yyss + yysize - 1;
00735 yyvsp = yyvs + yysize - 1;
00736 #if YYLSP_NEEDED
00737 yylsp = yyls + yysize - 1;
00738 #endif
00739
00740 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
00741 (unsigned long int) yystacksize));
00742
00743 if (yyssp >= yyss + yystacksize - 1)
00744 YYABORT;
00745 }
00746
00747 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
00748
00749 goto yybackup;
00750
00751
00752
00753
00754
00755 yybackup:
00756
00757
00758
00759
00760
00761
00762
00763 yyn = yypact[yystate];
00764 if (yyn == YYFLAG)
00765 goto yydefault;
00766
00767
00768
00769
00770
00771
00772 if (yychar == YYEMPTY)
00773 {
00774 YYDPRINTF ((stderr, "Reading a token: "));
00775 yychar = YYLEX;
00776 }
00777
00778
00779
00780 if (yychar <= 0)
00781 {
00782 yychar1 = 0;
00783 yychar = YYEOF;
00784
00785 YYDPRINTF ((stderr, "Now at end of input.\n"));
00786 }
00787 else
00788 {
00789 yychar1 = YYTRANSLATE (yychar);
00790
00791 #if YYDEBUG
00792
00793
00794 if (yydebug)
00795 {
00796 YYFPRINTF (stderr, "Next token is %d (%s",
00797 yychar, yytname[yychar1]);
00798
00799
00800 # ifdef YYPRINT
00801 YYPRINT (stderr, yychar, yylval);
00802 # endif
00803 YYFPRINTF (stderr, ")\n");
00804 }
00805 #endif
00806 }
00807
00808 yyn += yychar1;
00809 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
00810 goto yydefault;
00811
00812 yyn = yytable[yyn];
00813
00814
00815
00816
00817
00818
00819
00820
00821 if (yyn < 0)
00822 {
00823 if (yyn == YYFLAG)
00824 goto yyerrlab;
00825 yyn = -yyn;
00826 goto yyreduce;
00827 }
00828 else if (yyn == 0)
00829 goto yyerrlab;
00830
00831 if (yyn == YYFINAL)
00832 YYACCEPT;
00833
00834
00835 YYDPRINTF ((stderr, "Shifting token %d (%s), ",
00836 yychar, yytname[yychar1]));
00837
00838
00839 if (yychar != YYEOF)
00840 yychar = YYEMPTY;
00841
00842 *++yyvsp = yylval;
00843 #if YYLSP_NEEDED
00844 *++yylsp = yylloc;
00845 #endif
00846
00847
00848
00849 if (yyerrstatus)
00850 yyerrstatus--;
00851
00852 yystate = yyn;
00853 goto yynewstate;
00854
00855
00856
00857
00858
00859 yydefault:
00860 yyn = yydefact[yystate];
00861 if (yyn == 0)
00862 goto yyerrlab;
00863 goto yyreduce;
00864
00865
00866
00867
00868
00869 yyreduce:
00870
00871 yylen = yyr2[yyn];
00872
00873
00874
00875
00876
00877
00878
00879
00880
00881 yyval = yyvsp[1-yylen];
00882
00883 #if YYLSP_NEEDED
00884
00885
00886 yyloc = yylsp[1-yylen];
00887 YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
00888 #endif
00889
00890 #if YYDEBUG
00891
00892
00893 if (yydebug)
00894 {
00895 int yyi;
00896
00897 YYFPRINTF (stderr, "Reducing via rule %d (line %d), ",
00898 yyn, yyrline[yyn]);
00899
00900
00901 for (yyi = yyprhs[yyn]; yyrhs[yyi] > 0; yyi++)
00902 YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]);
00903 YYFPRINTF (stderr, " -> %s\n", yytname[yyr1[yyn]]);
00904 }
00905 #endif
00906
00907 switch (yyn) {
00908
00909 case 1:
00910 #line 44 "contact_parser.y"
00911 { groups = yyvsp[0].vals; }
00912 break;
00913 case 2:
00914 #line 48 "contact_parser.y"
00915 { yyval.vals = g_list_prepend( yyvsp[0].vals, yyvsp[-1].grp ); }
00916 break;
00917 case 3:
00918 #line 49 "contact_parser.y"
00919 { yyval.vals = 0; }
00920 break;
00921 case 4:
00922 #line 54 "contact_parser.y"
00923 {
00924 char * c;
00925 cur_group = g_new0(grouplist, 1);
00926 c = value_pair_get_value( yyvsp[0].vals, "NAME" );
00927 strcpy( cur_group->name, c );
00928 g_free(c);
00929 cur_group->tree = NULL;
00930 value_pair_free(yyvsp[0].vals);
00931 }
00932 break;
00933 case 5:
00934 #line 63 "contact_parser.y"
00935 { cur_group->members = yyvsp[-1].vals;
00936 yyval.grp = cur_group; }
00937 break;
00938 case 6:
00939 #line 68 "contact_parser.y"
00940 { yyval.vals = g_list_prepend( yyvsp[0].vals, yyvsp[-1].cntct ); }
00941 break;
00942 case 7:
00943 #line 69 "contact_parser.y"
00944 { yyval.vals = 0; }
00945 break;
00946 case 8:
00947 #line 74 "contact_parser.y"
00948 {
00949 char * c;
00950 cur_contact = g_new0( struct contact, 1 );
00951 c = value_pair_get_value( yyvsp[0].vals, "NAME" );
00952 strcpy( cur_contact->nick, c );
00953 g_free(c);
00954 c = value_pair_get_value( yyvsp[0].vals, "TRIGGER_TYPE" );
00955 cur_contact->trigger.type = get_trigger_type_num(c);
00956 g_free(c);
00957 c = value_pair_get_value( yyvsp[0].vals, "TRIGGER_ACTION" );
00958 cur_contact->trigger.action = get_trigger_action_num(c);
00959 g_free(c);
00960 c = value_pair_get_value( yyvsp[0].vals, "TRIGGER_PARAM" );
00961 if(c)
00962 {
00963 char *tmp = unescape_string(c);
00964 strcpy( cur_contact->trigger.param ,tmp );
00965 g_free(tmp);
00966 g_free(c);
00967 }
00968 else
00969 {
00970 cur_contact->trigger.param[0] = '\0';
00971 }
00972
00973 c = value_pair_get_value( yyvsp[0].vals, "LANGUAGE" );
00974 if(c!=NULL)
00975 {
00976 cur_contact->language[0] = c[0];
00977 cur_contact->language[1] = c[1];
00978 cur_contact->language[2] = '\0';
00979 g_free(c);
00980 } else {
00981 cur_contact->language[0] = '\0';
00982 }
00983
00984 c = value_pair_get_value( yyvsp[0].vals, "DEFAULT_PROTOCOL" );
00985 cur_contact->default_chatb = get_service_id(c);
00986 g_free(c);
00987 cur_contact->default_filetransb = cur_contact->default_chatb;
00988 cur_contact->group = cur_group;
00989 cur_contact->list_item = NULL;
00990 cur_contact->tree = NULL;
00991 cur_contact->pix = NULL;
00992 cur_contact->status = NULL;
00993 cur_contact->icon_handler = -1;
00994 cur_contact->label = NULL;
00995 value_pair_free(yyvsp[0].vals);
00996 }
00997 break;
00998 case 9:
00999 #line 123 "contact_parser.y"
01000 { cur_contact->accounts = yyvsp[-1].vals;
01001 yyval.cntct=cur_contact; }
01002 break;
01003 case 10:
01004 #line 128 "contact_parser.y"
01005 { yyval.vals = g_list_prepend( yyvsp[0].vals, yyvsp[-1].acnt ); }
01006 break;
01007 case 11:
01008 #line 129 "contact_parser.y"
01009 { yyval.vals = 0; }
01010 break;
01011 case 12:
01012 #line 135 "contact_parser.y"
01013 {
01014 {
01015 int id = get_service_id(yyvsp[-5].string);
01016
01017 yyval.acnt = eb_services[id].sc->read_account_config(yyvsp[-3].vals, cur_contact);
01018 yyval.acnt->service_id = id;
01019 value_pair_free(yyvsp[-3].vals);
01020 g_free(yyvsp[-5].string);
01021 }
01022 }
01023 break;
01024 case 13:
01025 #line 149 "contact_parser.y"
01026 { yyval.vals = g_list_append( yyvsp[0].vals, yyvsp[-1].val ); }
01027 break;
01028 case 14:
01029 #line 150 "contact_parser.y"
01030 { yyval.vals = g_list_append(NULL, yyvsp[0].val); }
01031 break;
01032 case 15:
01033 #line 156 "contact_parser.y"
01034 {
01035 {
01036 char * tmp = escape_string (yyvsp[0].string);
01037 value_pair * vp = g_new0( value_pair, 1 );
01038 strcpy( vp->key, yyvsp[-2].string );
01039 strcpy( vp->value, tmp );
01040 free(tmp);
01041 free(yyvsp[-2].string);
01042 free(yyvsp[0].string);
01043 yyval.val = vp;
01044 }
01045 }
01046 break;
01047 }
01048
01049 #line 705 "/usr/share/bison/bison.simple"
01050
01051
01052 yyvsp -= yylen;
01053 yyssp -= yylen;
01054 #if YYLSP_NEEDED
01055 yylsp -= yylen;
01056 #endif
01057
01058 #if YYDEBUG
01059 if (yydebug)
01060 {
01061 short *yyssp1 = yyss - 1;
01062 YYFPRINTF (stderr, "state stack now");
01063 while (yyssp1 != yyssp)
01064 YYFPRINTF (stderr, " %d", *++yyssp1);
01065 YYFPRINTF (stderr, "\n");
01066 }
01067 #endif
01068
01069 *++yyvsp = yyval;
01070 #if YYLSP_NEEDED
01071 *++yylsp = yyloc;
01072 #endif
01073
01074
01075
01076
01077
01078 yyn = yyr1[yyn];
01079
01080 yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
01081 if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
01082 yystate = yytable[yystate];
01083 else
01084 yystate = yydefgoto[yyn - YYNTBASE];
01085
01086 goto yynewstate;
01087
01088
01089
01090
01091
01092 yyerrlab:
01093
01094 if (!yyerrstatus)
01095 {
01096 ++yynerrs;
01097
01098 #ifdef YYERROR_VERBOSE
01099 yyn = yypact[yystate];
01100
01101 if (yyn > YYFLAG && yyn < YYLAST)
01102 {
01103 YYSIZE_T yysize = 0;
01104 char *yymsg;
01105 int yyx, yycount;
01106
01107 yycount = 0;
01108
01109
01110 for (yyx = yyn < 0 ? -yyn : 0;
01111 yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++)
01112 if (yycheck[yyx + yyn] == yyx)
01113 yysize += yystrlen (yytname[yyx]) + 15, yycount++;
01114 yysize += yystrlen ("parse error, unexpected ") + 1;
01115 yysize += yystrlen (yytname[YYTRANSLATE (yychar)]);
01116 yymsg = (char *) YYSTACK_ALLOC (yysize);
01117 if (yymsg != 0)
01118 {
01119 char *yyp = yystpcpy (yymsg, "parse error, unexpected ");
01120 yyp = yystpcpy (yyp, yytname[YYTRANSLATE (yychar)]);
01121
01122 if (yycount < 5)
01123 {
01124 yycount = 0;
01125 for (yyx = yyn < 0 ? -yyn : 0;
01126 yyx < (int) (sizeof (yytname) / sizeof (char *));
01127 yyx++)
01128 if (yycheck[yyx + yyn] == yyx)
01129 {
01130 const char *yyq = ! yycount ? ", expecting " : " or ";
01131 yyp = yystpcpy (yyp, yyq);
01132 yyp = yystpcpy (yyp, yytname[yyx]);
01133 yycount++;
01134 }
01135 }
01136 yyerror (yymsg);
01137 YYSTACK_FREE (yymsg);
01138 }
01139 else
01140 yyerror ("parse error; also virtual memory exhausted");
01141 }
01142 else
01143 #endif
01144 yyerror ("parse error");
01145 }
01146 goto yyerrlab1;
01147
01148
01149
01150
01151
01152 yyerrlab1:
01153 if (yyerrstatus == 3)
01154 {
01155
01156
01157
01158
01159 if (yychar == YYEOF)
01160 YYABORT;
01161 YYDPRINTF ((stderr, "Discarding token %d (%s).\n",
01162 yychar, yytname[yychar1]));
01163 yychar = YYEMPTY;
01164 }
01165
01166
01167
01168
01169 yyerrstatus = 3;
01170
01171 goto yyerrhandle;
01172
01173
01174
01175
01176
01177
01178 yyerrdefault:
01179 #if 0
01180
01181
01182
01183
01184 yyn = yydefact[yystate];
01185 if (yyn)
01186 goto yydefault;
01187 #endif
01188
01189
01190
01191
01192
01193
01194 yyerrpop:
01195 if (yyssp == yyss)
01196 YYABORT;
01197 yyvsp--;
01198 yystate = *--yyssp;
01199 #if YYLSP_NEEDED
01200 yylsp--;
01201 #endif
01202
01203 #if YYDEBUG
01204 if (yydebug)
01205 {
01206 short *yyssp1 = yyss - 1;
01207 YYFPRINTF (stderr, "Error: state stack now");
01208 while (yyssp1 != yyssp)
01209 YYFPRINTF (stderr, " %d", *++yyssp1);
01210 YYFPRINTF (stderr, "\n");
01211 }
01212 #endif
01213
01214
01215
01216
01217 yyerrhandle:
01218 yyn = yypact[yystate];
01219 if (yyn == YYFLAG)
01220 goto yyerrdefault;
01221
01222 yyn += YYTERROR;
01223 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
01224 goto yyerrdefault;
01225
01226 yyn = yytable[yyn];
01227 if (yyn < 0)
01228 {
01229 if (yyn == YYFLAG)
01230 goto yyerrpop;
01231 yyn = -yyn;
01232 goto yyreduce;
01233 }
01234 else if (yyn == 0)
01235 goto yyerrpop;
01236
01237 if (yyn == YYFINAL)
01238 YYACCEPT;
01239
01240 YYDPRINTF ((stderr, "Shifting error token, "));
01241
01242 *++yyvsp = yylval;
01243 #if YYLSP_NEEDED
01244 *++yylsp = yylloc;
01245 #endif
01246
01247 yystate = yyn;
01248 goto yynewstate;
01249
01250
01251
01252
01253
01254 yyacceptlab:
01255 yyresult = 0;
01256 goto yyreturn;
01257
01258
01259
01260
01261 yyabortlab:
01262 yyresult = 1;
01263 goto yyreturn;
01264
01265
01266
01267
01268 yyoverflowlab:
01269 yyerror ("parser stack overflow");
01270 yyresult = 2;
01271
01272
01273 yyreturn:
01274 #ifndef yyoverflow
01275 if (yyss != yyssa)
01276 YYSTACK_FREE (yyss);
01277 #endif
01278 return yyresult;
01279 }
01280 #line 171 "contact_parser.y"