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 File Reference

#include <gtk/gtk.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "globals.h"
#include "account.h"
#include "value_pair.h"
#include "service.h"
#include "util.h"

Include dependency graph for contact_parser.c:

Include dependency graph

Go to the source code of this file.

Data Structures

union  yyalloc
union  yystype

Defines

#define YYBISON   1
#define yyparse   contactparse
#define yylex   contactlex
#define yyerror   contacterror
#define yylval   contactlval
#define yychar   contactchar
#define yydebug   contactdebug
#define yynerrs   contactnerrs
#define ACCOUNT   257
#define END_ACCOUNT   258
#define GROUP   259
#define END_GROUP   260
#define CONTACT   261
#define END_CONTACT   262
#define IDENTIFIER   263
#define STRING   264
#define contacterror(error)   printf("Parse error on line %d: %s\n", Line_contact, error );
#define YYSTYPE   yystype
#define YYSTYPE_IS_TRIVIAL   1
#define YYDEBUG   0
#define YYFINAL   36
#define YYFLAG   -32768
#define YYNTBASE   14
#define YYTRANSLATE(x)   ((unsigned)(x) <= 264 ? yytranslate[x] : 26)
#define YYLAST   25
#define YYSTACK_ALLOC   malloc
#define YYSTACK_FREE   free
#define YYSTACK_GAP_MAX   (sizeof (union yyalloc) - 1)
#define YYSTACK_BYTES(N)
#define YYCOPY(To, From, Count)
#define YYSTACK_RELOCATE(Stack)
#define YYSIZE_T   unsigned int
#define yyerrok   (yyerrstatus = 0)
#define yyclearin   (yychar = YYEMPTY)
#define YYEMPTY   -2
#define YYEOF   0
#define YYACCEPT   goto yyacceptlab
#define YYABORT   goto yyabortlab
#define YYERROR   goto yyerrlab1
#define YYFAIL   goto yyerrlab
#define YYRECOVERING()   (!!yyerrstatus)
#define YYBACKUP(Token, Value)
#define YYTERROR   1
#define YYERRCODE   256
#define YYLLOC_DEFAULT(Current, Rhs, N)
#define YYLEX   yylex ()
#define YYDPRINTF(Args)
#define YYINITDEPTH   200
#define YYMAXDEPTH   10000
#define YYPARSE_PARAM_ARG
#define YYPARSE_PARAM_DECL
#define YY_DECL_NON_LSP_VARIABLES
#define YY_DECL_VARIABLES   YY_DECL_NON_LSP_VARIABLES
#define YYPOPSTACK   (yyvsp--, yyssp--)

Functions

int contactlex ()
YY_DECL_VARIABLES int yyparse (YYPARSE_PARAM_ARG) YYPARSE_PARAM_DECL

Variables

int Line_contact
contactcur_contact = NULL
grouplistcur_group = NULL
const char yytranslate []
const short yyr1 []
const short yyr2 []
const short yydefact []
const short yydefgoto []
const short yypact []
const short yypgoto []
const short yytable []
const short yycheck []


Define Documentation

#define ACCOUNT   257
 

Definition at line 13 of file contact_parser.c.

#define CONTACT   261
 

Definition at line 17 of file contact_parser.c.

#define contacterror error       printf("Parse error on line %d: %s\n", Line_contact, error );
 

Definition at line 36 of file contact_parser.c.

#define END_ACCOUNT   258
 

Definition at line 14 of file contact_parser.c.

#define END_CONTACT   262
 

Definition at line 18 of file contact_parser.c.

#define END_GROUP   260
 

Definition at line 16 of file contact_parser.c.

#define GROUP   259
 

Definition at line 15 of file contact_parser.c.

#define IDENTIFIER   263
 

Definition at line 19 of file contact_parser.c.

#define STRING   264
 

Definition at line 20 of file contact_parser.c.

#define YY_DECL_NON_LSP_VARIABLES
 

Value:

\
int yychar;                     \
                            \
    \
YYSTYPE yylval;                     \
                            \
            \
int yynerrs;

Definition at line 550 of file contact_parser.c.

#define YY_DECL_VARIABLES   YY_DECL_NON_LSP_VARIABLES
 

Definition at line 567 of file contact_parser.c.

Referenced by yyparse().

#define YYABORT   goto yyabortlab
 

Definition at line 361 of file contact_parser.c.

Referenced by yyparse().

#define YYACCEPT   goto yyacceptlab
 

Definition at line 360 of file contact_parser.c.

Referenced by yyparse().

#define YYBACKUP Token,
Value   
 

Value:

do                              \
  if (yychar == YYEMPTY && yylen == 1)              \
    {                               \
      yychar = (Token);                     \
      yylval = (Value);                     \
      yychar1 = YYTRANSLATE (yychar);               \
      YYPOPSTACK;                       \
      goto yybackup;                        \
    }                               \
  else                              \
    {                               \
      yyerror ("syntax error: cannot back up");         \
      YYERROR;                          \
    }                               \
while (0)

Definition at line 368 of file contact_parser.c.

#define YYBISON   1
 

Definition at line 4 of file contact_parser.c.

#define yychar   contactchar
 

Definition at line 10 of file contact_parser.c.

Referenced by yyparse().

#define yyclearin   (yychar = YYEMPTY)
 

Definition at line 357 of file contact_parser.c.

#define YYCOPY To,
From,
Count   
 

Value:

do                  \
    {                   \
      register YYSIZE_T yyi;        \
      for (yyi = 0; yyi < (Count); yyi++)   \
        (To)[yyi] = (From)[yyi];        \
    }                   \
      while (0)

Definition at line 310 of file contact_parser.c.

#define YYDEBUG   0
 

Definition at line 56 of file contact_parser.c.

#define yydebug   contactdebug
 

Definition at line 11 of file contact_parser.c.

#define YYDPRINTF Args   
 

Definition at line 441 of file contact_parser.c.

#define YYEMPTY   -2
 

Definition at line 358 of file contact_parser.c.

Referenced by yyparse().

#define YYEOF   0
 

Definition at line 359 of file contact_parser.c.

Referenced by yyparse().

#define YYERRCODE   256
 

Definition at line 386 of file contact_parser.c.

#define yyerrok   (yyerrstatus = 0)
 

Definition at line 356 of file contact_parser.c.

#define YYERROR   goto yyerrlab1
 

Definition at line 362 of file contact_parser.c.

#define yyerror   contacterror
 

Definition at line 8 of file contact_parser.c.

#define YYFAIL   goto yyerrlab
 

Definition at line 366 of file contact_parser.c.

#define YYFINAL   36
 

Definition at line 61 of file contact_parser.c.

Referenced by yyparse().

#define YYFLAG   -32768
 

Definition at line 62 of file contact_parser.c.

Referenced by yyparse().

#define YYINITDEPTH   200
 

Definition at line 446 of file contact_parser.c.

Referenced by yyparse().

#define YYLAST   25
 

Definition at line 186 of file contact_parser.c.

Referenced by yyparse().

#define YYLEX   yylex ()
 

Definition at line 420 of file contact_parser.c.

Referenced by yyparse().

#define yylex   contactlex
 

Definition at line 7 of file contact_parser.c.

#define YYLLOC_DEFAULT Current,
Rhs,
 
 

Value:

Current.last_line   = Rhs[N].last_line; \
   Current.last_column = Rhs[N].last_column;

Definition at line 397 of file contact_parser.c.

#define yylval   contactlval
 

Definition at line 9 of file contact_parser.c.

Referenced by yyparse().

#define YYMAXDEPTH   10000
 

Definition at line 461 of file contact_parser.c.

Referenced by yyparse().

#define yynerrs   contactnerrs
 

Definition at line 12 of file contact_parser.c.

Referenced by yyparse().

#define YYNTBASE   14
 

Definition at line 63 of file contact_parser.c.

Referenced by yyparse().

#define yyparse   contactparse
 

Definition at line 6 of file contact_parser.c.

#define YYPARSE_PARAM_ARG
 

Definition at line 534 of file contact_parser.c.

Referenced by yyparse().

#define YYPARSE_PARAM_DECL
 

Definition at line 535 of file contact_parser.c.

Referenced by yyparse().

#define YYPOPSTACK   (yyvsp--, yyssp--)
 

 
#define YYRECOVERING      (!!yyerrstatus)
 

Definition at line 367 of file contact_parser.c.

#define YYSIZE_T   unsigned int
 

Definition at line 353 of file contact_parser.c.

Referenced by yyparse().

#define YYSTACK_ALLOC   malloc
 

Definition at line 268 of file contact_parser.c.

#define YYSTACK_BYTES  
 

Value:

((N) * (sizeof (short) + sizeof (YYSTYPE))              \
      + YYSTACK_GAP_MAX)

Definition at line 298 of file contact_parser.c.

#define YYSTACK_FREE   free
 

Definition at line 269 of file contact_parser.c.

#define YYSTACK_GAP_MAX   (sizeof (union yyalloc) - 1)
 

Definition at line 289 of file contact_parser.c.

#define YYSTACK_RELOCATE Stack   
 

Value:

do                                  \
      {                                 \
    YYSIZE_T yynewbytes;                        \
    YYCOPY (&yyptr->Stack, Stack, yysize);              \
    Stack = &yyptr->Stack;                      \
    yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAX;   \
    yyptr += yynewbytes / sizeof (*yyptr);              \
      }                                 \
    while (0)

Definition at line 326 of file contact_parser.c.

#define YYSTYPE   yystype
 

Definition at line 52 of file contact_parser.c.

#define YYSTYPE_IS_TRIVIAL   1
 

Definition at line 53 of file contact_parser.c.

#define YYTERROR   1
 

Definition at line 385 of file contact_parser.c.

Referenced by yyparse().

#define YYTRANSLATE      ((unsigned)(x) <= 264 ? yytranslate[x] : 26)
 

Definition at line 66 of file contact_parser.c.

Referenced by yyparse().


Function Documentation

int contactlex  
 

YY_DECL_VARIABLES int yyparse YYPARSE_PARAM_ARG   
 

Definition at line 579 of file contact_parser.c.

References contact::accounts, YYSTYPE::acnt, _trigger::action, YYSTYPE::cntct, contact::default_chatb, contact::default_filetransb, escape_string(), get_service_id(), get_trigger_action_num(), get_trigger_type_num(), contact::group, YYSTYPE::grp, contact::icon_handler, _value_pair::key, contact::label, contact::language, contact::list_item, _grouplist::members, _grouplist::name, contact::nick, _trigger::param, contact::pix, local_account::service_id, contact::status, YYSTYPE::string, contact::tree, _grouplist::tree, contact::trigger, _trigger::type, unescape_string(), YYSTYPE::val, YYSTYPE::vals, _value_pair::value, value_pair_free(), value_pair_get_value(), YY_DECL_VARIABLES, YYABORT, YYACCEPT, yychar, yycheck, yydefact, yydefgoto, YYDPRINTF, YYEMPTY, YYEOF, yyerror, YYFINAL, YYFLAG, YYINITDEPTH, YYLAST, YYLEX, YYLLOC_DEFAULT, yylval, YYMAXDEPTH, yynerrs, YYNTBASE, yypact, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL, yypgoto, yyr1, yyr2, YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE, YYSTACK_RELOCATE, yytable, YYTERROR, and YYTRANSLATE.

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 }


Variable Documentation

struct contact* cur_contact = NULL [static]
 

Definition at line 37 of file contact_parser.c.

grouplist* cur_group = NULL [static]
 

Definition at line 38 of file contact_parser.c.

int Line_contact
 

Definition at line 35 of file contact_parser.c.

const short yycheck[] [static]
 

Initial value:

{
       7,     5,    10,     9,    13,    10,    13,    15,     7,     6,
      11,     3,    20,     8,    12,    23,     9,    11,     4,     0,
       0,    12,    29,    23,     3,    15
}

Definition at line 196 of file contact_parser.c.

Referenced by yyparse().

const short yydefact[] [static]
 

Initial value:

{
      16,     0,     1,    16,     3,     0,     4,    14,     2,     0,
      16,    13,    15,     0,     0,    16,     7,     8,     5,     6,
      16,     0,     0,    16,    11,     0,     9,    10,     0,     0,
       0,     0,     0,    12,     0,     0,     0
}

Definition at line 157 of file contact_parser.c.

Referenced by yyparse().

const short yydefgoto[] [static]
 

Initial value:

{
      34,     2,     3,    10,    14,    15,    20,    22,    23,     6,
       7,     4
}

Definition at line 165 of file contact_parser.c.

Referenced by yyparse().

const short yypact[] [static]
 

Initial value:

{
      -4,    -6,-32768,    -4,-32768,    -9,-32768,    -6,-32768,    -5,
       1,-32768,-32768,    -6,     3,     1,-32768,-32768,-32768,-32768,
      -1,     8,     5,    -1,-32768,     7,-32768,-32768,     2,    -6,
       6,    14,     9,-32768,    19,    20,-32768
}

Definition at line 171 of file contact_parser.c.

Referenced by yyparse().

const short yypgoto[] [static]
 

Initial value:

{
  -32768,    21,-32768,-32768,    10,-32768,-32768,     0,-32768,    -7,
  -32768,    -8
}

Definition at line 179 of file contact_parser.c.

Referenced by yyparse().

const short yyr1[] [static]
 

Initial value:

{
       0,    14,    15,    15,    17,    16,    18,    18,    20,    19,
      21,    21,    22,    23,    23,    24,    25
}

Definition at line 141 of file contact_parser.c.

Referenced by yyparse().

const short yyr2[] [static]
 

Initial value:

{
       0,     1,     2,     1,     0,     5,     2,     1,     0,     5,
       2,     1,     8,     2,     1,     3,     0
}

Definition at line 148 of file contact_parser.c.

Referenced by yyparse().

const short yytable[] [static]
 

Initial value:

{
      11,     1,    16,     5,     9,    12,    17,    16,    13,    18,
      21,    25,    24,    26,    29,    24,    28,    31,    32,    35,
      36,    33,    30,    27,     8,    19
}

Definition at line 189 of file contact_parser.c.

Referenced by yyparse().

const char yytranslate[] [static]
 

Initial value:

{
       0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
      11,    13,    12,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     1,     3,     4,     5,
       6,     7,     8,     9,    10
}

Definition at line 69 of file contact_parser.c.


Contact: Andy Maloney     [Documentation generated by doxygen]