Yattm - unified GTK instant-messaging client logo
   [Generated for version 0.2-17 - Mon Jan 6 19:01:23 GMT+1 2003]

Home - Main Page - Data Structures - File List - Data Fields - Globals

contact_parser.c

Go to the documentation of this file.
00001 /* A Bison parser, made from contact_parser.y
00002    by GNU bison 1.35.  */
00003 
00004 #define YYBISON 1  /* Identify Bison output.  */
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 /* YYTRANSLATE(YYLEX) -- Bison token number corresponding to YYLEX. */
00066 #define YYTRANSLATE(x) ((unsigned)(x) <= 264 ? yytranslate[x] : 26)
00067 
00068 /* YYTRANSLATE[YYLEX] -- Bison token number corresponding to YYLEX. */
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 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
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 /* YYTNAME[TOKEN_NUM] -- String name of the token TOKEN_NUM. */
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 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
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 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
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 /* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE
00155    doesn't specify something else to do.  Zero means the default is an
00156    error. */
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 /* -*-C-*-  Note some compilers choke on comments on `#line' lines.  */
00203 #line 3 "/usr/share/bison/bison.simple"
00204 
00205 /* Skeleton output parser for bison,
00206 
00207    Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software
00208    Foundation, Inc.
00209 
00210    This program is free software; you can redistribute it and/or modify
00211    it under the terms of the GNU General Public License as published by
00212    the Free Software Foundation; either version 2, or (at your option)
00213    any later version.
00214 
00215    This program is distributed in the hope that it will be useful,
00216    but WITHOUT ANY WARRANTY; without even the implied warranty of
00217    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00218    GNU General Public License for more details.
00219 
00220    You should have received a copy of the GNU General Public License
00221    along with this program; if not, write to the Free Software
00222    Foundation, Inc., 59 Temple Place - Suite 330,
00223    Boston, MA 02111-1307, USA.  */
00224 
00225 /* As a special exception, when this file is copied by Bison into a
00226    Bison output file, you may use that output file without restriction.
00227    This special exception was added by the Free Software Foundation
00228    in version 1.24 of Bison.  */
00229 
00230 /* This is the parser code that is written into each bison parser when
00231    the %semantic_parser declaration is not specified in the grammar.
00232    It was written by Richard Stallman by simplifying the hairy parser
00233    used when %semantic_parser is specified.  */
00234 
00235 /* All symbols defined below should begin with yy or YY, to avoid
00236    infringing on user name space.  This should be done even for local
00237    variables, as they might otherwise be expanded by user macros.
00238    There are some unavoidable exceptions within include files to
00239    define necessary library symbols; they are noted "INFRINGES ON
00240    USER NAME SPACE" below.  */
00241 
00242 #if ! defined (yyoverflow) || defined (YYERROR_VERBOSE)
00243 
00244 /* The parser invokes alloca or malloc; define the necessary symbols.  */
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    /* Pacify GCC's `empty if-body' warning. */
00262 #  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
00263 # else
00264 #  if defined (__STDC__) || defined (__cplusplus)
00265 #   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
00266 #   define YYSIZE_T size_t
00267 #  endif
00268 #  define YYSTACK_ALLOC malloc
00269 #  define YYSTACK_FREE free
00270 # endif
00271 #endif /* ! defined (yyoverflow) || defined (YYERROR_VERBOSE) */
00272 
00273 
00274 #if (! defined (yyoverflow) \
00275      && (! defined (__cplusplus) \
00276      || (YYLTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
00277 
00278 /* A type that is properly aligned for any stack member.  */
00279 union yyalloc
00280 {
00281   short yyss;
00282   YYSTYPE yyvs;
00283 # if YYLSP_NEEDED
00284   YYLTYPE yyls;
00285 # endif
00286 };
00287 
00288 /* The size of the maximum gap between one aligned stack and the next.  */
00289 # define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1)
00290 
00291 /* The size of an array large to enough to hold all stacks, each with
00292    N elements.  */
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 /* Copy COUNT objects from FROM to TO.  The source and destination do
00304    not overlap.  */
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 /* Relocate STACK from its old location to the new one.  The
00322    local variables YYSIZE and YYSTACKSIZE give the old and new number of
00323    elements in the stack, and YYPTR gives the new location of the
00324    stack.  Advance YYPTR to a properly aligned location for the next
00325    stack.  */
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> /* INFRINGES ON USER NAME SPACE */
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 /* Like YYERROR except do call yyerror.  This remains here temporarily
00364    to ease the transition to the new meaning of YYERROR, for GCC.
00365    Once GCC version 2 has supplanted version 1, this can go.  */
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 /* YYLLOC_DEFAULT -- Compute the default location (before the actions
00390    are run).
00391 
00392    When YYLLOC_DEFAULT is run, CURRENT is set the location of the
00393    first token.  By default, to implement support for ranges, extend
00394    its range to the last symbol.  */
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 /* YYLEX -- calling `yylex' with the right arguments.  */
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 /* !YYLSP_NEEDED */
00413 #  ifdef YYLEX_PARAM
00414 #   define YYLEX        yylex (&yylval, YYLEX_PARAM)
00415 #  else
00416 #   define YYLEX        yylex (&yylval)
00417 #  endif
00418 # endif /* !YYLSP_NEEDED */
00419 #else /* !YYPURE */
00420 # define YYLEX          yylex ()
00421 #endif /* !YYPURE */
00422 
00423 
00424 /* Enable debugging if requested.  */
00425 #if YYDEBUG
00426 
00427 # ifndef YYFPRINTF
00428 #  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
00429 #  define YYFPRINTF fprintf
00430 # endif
00431 
00432 # define YYDPRINTF(Args)            \
00433 do {                        \
00434   if (yydebug)                  \
00435     YYFPRINTF Args;             \
00436 } while (0)
00437 /* Nonzero means print parse trace.  It is left uninitialized so that
00438    multiple parsers can coexist.  */
00439 int yydebug;
00440 #else /* !YYDEBUG */
00441 # define YYDPRINTF(Args)
00442 #endif /* !YYDEBUG */
00443 
00444 /* YYINITDEPTH -- initial size of the parser's stacks.  */
00445 #ifndef YYINITDEPTH
00446 # define YYINITDEPTH 200
00447 #endif
00448 
00449 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
00450    if the built-in stack extension method is used).
00451 
00452    Do not make this value too large; the results are undefined if
00453    SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
00454    evaluated with infinite-precision integer arithmetic.  */
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 /* Return the length of YYSTR.  */
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 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
00494    YYDEST.  */
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 /* The user can define YYPARSE_PARAM as the name of an argument to be passed
00520    into yyparse.  The argument should have type void *.
00521    It should actually point to an object.
00522    Grammar actions can access the variable by casting it
00523    to the proper pointer type.  */
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 /* !YYPARSE_PARAM */
00534 # define YYPARSE_PARAM_ARG
00535 # define YYPARSE_PARAM_DECL
00536 #endif /* !YYPARSE_PARAM */
00537 
00538 /* Prevent warning if -Wstrict-prototypes.  */
00539 #ifdef __GNUC__
00540 # ifdef YYPARSE_PARAM
00541 int yyparse (void *);
00542 # else
00543 int yyparse (void);
00544 # endif
00545 #endif
00546 
00547 /* YY_DECL_VARIABLES -- depending whether we use a pure parser,
00548    variables are global, or local to YYPARSE.  */
00549 
00550 #define YY_DECL_NON_LSP_VARIABLES           \
00551 /* The lookahead symbol.  */                \
00552 int yychar;                     \
00553                             \
00554 /* The semantic value of the lookahead symbol. */   \
00555 YYSTYPE yylval;                     \
00556                             \
00557 /* Number of parse errors so far.  */           \
00558 int yynerrs;
00559 
00560 #if YYLSP_NEEDED
00561 # define YY_DECL_VARIABLES          \
00562 YY_DECL_NON_LSP_VARIABLES           \
00563                         \
00564 /* Location data for the lookahead symbol.  */  \
00565 YYLTYPE yylloc;
00566 #else
00567 # define YY_DECL_VARIABLES          \
00568 YY_DECL_NON_LSP_VARIABLES
00569 #endif
00570 
00571 
00572 /* If nonreentrant, generate the variables here. */
00573 
00574 #if !YYPURE
00575 YY_DECL_VARIABLES
00576 #endif  /* !YYPURE */
00577 
00578 int
00579 yyparse (YYPARSE_PARAM_ARG)
00580      YYPARSE_PARAM_DECL
00581 {
00582   /* If reentrant, generate the variables here. */
00583 #if YYPURE
00584   YY_DECL_VARIABLES
00585 #endif  /* !YYPURE */
00586 
00587   register int yystate;
00588   register int yyn;
00589   int yyresult;
00590   /* Number of tokens to shift before error messages enabled.  */
00591   int yyerrstatus;
00592   /* Lookahead token as an internal (translated) token number.  */
00593   int yychar1 = 0;
00594 
00595   /* Three stacks and their tools:
00596      `yyss': related to states,
00597      `yyvs': related to semantic values,
00598      `yyls': related to locations.
00599 
00600      Refer to the stacks thru separate pointers, to allow yyoverflow
00601      to reallocate them elsewhere.  */
00602 
00603   /* The state stack. */
00604   short yyssa[YYINITDEPTH];
00605   short *yyss = yyssa;
00606   register short *yyssp;
00607 
00608   /* The semantic value stack.  */
00609   YYSTYPE yyvsa[YYINITDEPTH];
00610   YYSTYPE *yyvs = yyvsa;
00611   register YYSTYPE *yyvsp;
00612 
00613 #if YYLSP_NEEDED
00614   /* The location stack.  */
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   /* The variables used to return semantic value and location from the
00630      action routines.  */
00631   YYSTYPE yyval;
00632 #if YYLSP_NEEDED
00633   YYLTYPE yyloc;
00634 #endif
00635 
00636   /* When reducing, the number of symbols on the RHS of the reduced
00637      rule. */
00638   int yylen;
00639 
00640   YYDPRINTF ((stderr, "Starting parse\n"));
00641 
00642   yystate = 0;
00643   yyerrstatus = 0;
00644   yynerrs = 0;
00645   yychar = YYEMPTY;     /* Cause a token to be read.  */
00646 
00647   /* Initialize stack pointers.
00648      Waste one element of value and location stack
00649      so that they stay on the same level as the state stack.
00650      The wasted elements are never initialized.  */
00651 
00652   yyssp = yyss;
00653   yyvsp = yyvs;
00654 #if YYLSP_NEEDED
00655   yylsp = yyls;
00656 #endif
00657   goto yysetstate;
00658 
00659 /*------------------------------------------------------------.
00660 | yynewstate -- Push a new state, which is found in yystate.  |
00661 `------------------------------------------------------------*/
00662  yynewstate:
00663   /* In all cases, when you get here, the value and location stacks
00664      have just been pushed. so pushing a state here evens the stacks.
00665      */
00666   yyssp++;
00667 
00668  yysetstate:
00669   *yyssp = yystate;
00670 
00671   if (yyssp >= yyss + yystacksize - 1)
00672     {
00673       /* Get the current used size of the three stacks, in elements.  */
00674       YYSIZE_T yysize = yyssp - yyss + 1;
00675 
00676 #ifdef yyoverflow
00677       {
00678     /* Give user a chance to reallocate the stack. Use copies of
00679        these so that the &'s don't force the real ones into
00680        memory.  */
00681     YYSTYPE *yyvs1 = yyvs;
00682     short *yyss1 = yyss;
00683 
00684     /* Each stack pointer address is followed by the size of the
00685        data in use in that stack, in bytes.  */
00686 # if YYLSP_NEEDED
00687     YYLTYPE *yyls1 = yyls;
00688     /* This used to be a conditional around just the two extra args,
00689        but that might be undefined if yyoverflow is a macro.  */
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 /* no yyoverflow */
00706 # ifndef YYSTACK_RELOCATE
00707       goto yyoverflowlab;
00708 # else
00709       /* Extend the stack our own way.  */
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 /* no yyoverflow */
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 | yybackup.  |
00754 `-----------*/
00755 yybackup:
00756 
00757 /* Do appropriate processing given the current state.  */
00758 /* Read a lookahead token if we need one and don't already have one.  */
00759 /* yyresume: */
00760 
00761   /* First try to decide what to do without reference to lookahead token.  */
00762 
00763   yyn = yypact[yystate];
00764   if (yyn == YYFLAG)
00765     goto yydefault;
00766 
00767   /* Not known => get a lookahead token if don't already have one.  */
00768 
00769   /* yychar is either YYEMPTY or YYEOF
00770      or a valid token in external form.  */
00771 
00772   if (yychar == YYEMPTY)
00773     {
00774       YYDPRINTF ((stderr, "Reading a token: "));
00775       yychar = YYLEX;
00776     }
00777 
00778   /* Convert token to internal form (in yychar1) for indexing tables with */
00779 
00780   if (yychar <= 0)      /* This means end of input. */
00781     {
00782       yychar1 = 0;
00783       yychar = YYEOF;       /* Don't call YYLEX any more */
00784 
00785       YYDPRINTF ((stderr, "Now at end of input.\n"));
00786     }
00787   else
00788     {
00789       yychar1 = YYTRANSLATE (yychar);
00790 
00791 #if YYDEBUG
00792      /* We have to keep this `#if YYDEBUG', since we use variables
00793     which are defined only if `YYDEBUG' is set.  */
00794       if (yydebug)
00795     {
00796       YYFPRINTF (stderr, "Next token is %d (%s",
00797              yychar, yytname[yychar1]);
00798       /* Give the individual parser a way to print the precise
00799          meaning of a token, for further debugging info.  */
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   /* yyn is what to do for this token type in this state.
00815      Negative => reduce, -yyn is rule number.
00816      Positive => shift, yyn is new state.
00817        New state is final state => don't bother to shift,
00818        just return success.
00819      0, or most negative number => error.  */
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   /* Shift the lookahead token.  */
00835   YYDPRINTF ((stderr, "Shifting token %d (%s), ",
00836           yychar, yytname[yychar1]));
00837 
00838   /* Discard the token being shifted unless it is eof.  */
00839   if (yychar != YYEOF)
00840     yychar = YYEMPTY;
00841 
00842   *++yyvsp = yylval;
00843 #if YYLSP_NEEDED
00844   *++yylsp = yylloc;
00845 #endif
00846 
00847   /* Count tokens shifted since error; after three, turn off error
00848      status.  */
00849   if (yyerrstatus)
00850     yyerrstatus--;
00851 
00852   yystate = yyn;
00853   goto yynewstate;
00854 
00855 
00856 /*-----------------------------------------------------------.
00857 | yydefault -- do the default action for the current state.  |
00858 `-----------------------------------------------------------*/
00859 yydefault:
00860   yyn = yydefact[yystate];
00861   if (yyn == 0)
00862     goto yyerrlab;
00863   goto yyreduce;
00864 
00865 
00866 /*-----------------------------.
00867 | yyreduce -- Do a reduction.  |
00868 `-----------------------------*/
00869 yyreduce:
00870   /* yyn is the number of a rule to reduce with.  */
00871   yylen = yyr2[yyn];
00872 
00873   /* If YYLEN is nonzero, implement the default value of the action:
00874      `$$ = $1'.
00875 
00876      Otherwise, the following line sets YYVAL to the semantic value of
00877      the lookahead token.  This behavior is undocumented and Bison
00878      users should not rely upon it.  Assigning to YYVAL
00879      unconditionally makes the parser a bit smaller, and it avoids a
00880      GCC warning that YYVAL may be used uninitialized.  */
00881   yyval = yyvsp[1-yylen];
00882 
00883 #if YYLSP_NEEDED
00884   /* Similarly for the default location.  Let the user run additional
00885      commands if for instance locations are ranges.  */
00886   yyloc = yylsp[1-yylen];
00887   YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
00888 #endif
00889 
00890 #if YYDEBUG
00891   /* We have to keep this `#if YYDEBUG', since we use variables which
00892      are defined only if `YYDEBUG' is set.  */
00893   if (yydebug)
00894     {
00895       int yyi;
00896 
00897       YYFPRINTF (stderr, "Reducing via rule %d (line %d), ",
00898          yyn, yyrline[yyn]);
00899 
00900       /* Print the symbols being reduced, and their result.  */
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   /* Now `shift' the result of the reduction.  Determine what state
01075      that goes to, based on the state we popped back to and the rule
01076      number reduced by.  */
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 | yyerrlab -- here on detecting error |
01091 `------------------------------------*/
01092 yyerrlab:
01093   /* If not already recovering from an error, report this error.  */
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       /* Start YYX at -YYN if negative to avoid negative indexes in
01109          YYCHECK.  */
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 /* defined (YYERROR_VERBOSE) */
01144     yyerror ("parse error");
01145     }
01146   goto yyerrlab1;
01147 
01148 
01149 /*--------------------------------------------------.
01150 | yyerrlab1 -- error raised explicitly by an action |
01151 `--------------------------------------------------*/
01152 yyerrlab1:
01153   if (yyerrstatus == 3)
01154     {
01155       /* If just tried and failed to reuse lookahead token after an
01156      error, discard it.  */
01157 
01158       /* return failure if at end of input */
01159       if (yychar == YYEOF)
01160     YYABORT;
01161       YYDPRINTF ((stderr, "Discarding token %d (%s).\n",
01162           yychar, yytname[yychar1]));
01163       yychar = YYEMPTY;
01164     }
01165 
01166   /* Else will try to reuse lookahead token after shifting the error
01167      token.  */
01168 
01169   yyerrstatus = 3;      /* Each real token shifted decrements this */
01170 
01171   goto yyerrhandle;
01172 
01173 
01174 /*-------------------------------------------------------------------.
01175 | yyerrdefault -- current state does not do anything special for the |
01176 | error token.                                                       |
01177 `-------------------------------------------------------------------*/
01178 yyerrdefault:
01179 #if 0
01180   /* This is wrong; only states that explicitly want error tokens
01181      should shift them.  */
01182 
01183   /* If its default is to accept any token, ok.  Otherwise pop it.  */
01184   yyn = yydefact[yystate];
01185   if (yyn)
01186     goto yydefault;
01187 #endif
01188 
01189 
01190 /*---------------------------------------------------------------.
01191 | yyerrpop -- pop the current state because it cannot handle the |
01192 | error token                                                    |
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 | yyerrhandle.  |
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 | yyacceptlab -- YYACCEPT comes here.  |
01253 `-------------------------------------*/
01254 yyacceptlab:
01255   yyresult = 0;
01256   goto yyreturn;
01257 
01258 /*-----------------------------------.
01259 | yyabortlab -- YYABORT comes here.  |
01260 `-----------------------------------*/
01261 yyabortlab:
01262   yyresult = 1;
01263   goto yyreturn;
01264 
01265 /*---------------------------------------------.
01266 | yyoverflowab -- parser overflow comes here.  |
01267 `---------------------------------------------*/
01268 yyoverflowlab:
01269   yyerror ("parser stack overflow");
01270   yyresult = 2;
01271   /* Fall through.  */
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"

Contact: Andy Maloney     [Documentation generated by doxygen]