Main Page | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals

ast_expr.c File Reference

#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <locale.h>
#include <ctype.h>
#include <err.h>
#include <errno.h>
#include <regex.h>
#include <limits.h>
#include <asterisk/ast_expr.h>
#include <asterisk/logger.h>

Go to the source code of this file.

Data Structures

struct  val
struct  parser_control
struct  yyltype
union  YYSTYPE
union  yyalloc

Defines

#define YYBISON   1
#define YYSKELETON_NAME   "yacc.c"
#define YYPURE   1
#define YYLSP_NEEDED   1
#define yyparse   ast_yyparse
#define yylex   ast_yylex
#define yyerror   ast_yyerror
#define yylval   ast_yylval
#define yychar   ast_yychar
#define yydebug   ast_yydebug
#define yynerrs   ast_yynerrs
#define yylloc   ast_yylloc
#define NE   258
#define LE   259
#define GE   260
#define TOKEN   261
#define QUAD_MIN   (-0x7fffffffffffffffL-1)
#define QUAD_MAX   (0x7fffffffffffffffL)
#define YYPARSE_PARAM   kota
#define YYLEX_PARAM   kota
#define YYLTYPE   yyltype
#define YYLTYPE_IS_TRIVIAL   1
#define ast_yyerror(x)   ast_yyerror(x,&yyloc,kota)
#define YYDEBUG   0
#define YYERROR_VERBOSE   0
#define yystype   YYSTYPE
#define YYSTYPE_IS_DECLARED   1
#define YYSTYPE_IS_TRIVIAL   1
#define YYFREE   free
#define YYMALLOC   malloc
#define YYSTACK_ALLOC   YYMALLOC
#define YYSTACK_FREE   YYFREE
#define YYSTACK_GAP_MAXIMUM   (sizeof (union yyalloc) - 1)
#define YYSTACK_BYTES(N)
#define YYCOPY(To, From, Count)
#define YYSTACK_RELOCATE(Stack)
#define YYFINAL   6
#define YYLAST   83
#define YYNTOKENS   20
#define YYNNTS   3
#define YYNRULES   18
#define YYNSTATES   36
#define YYUNDEFTOK   2
#define YYMAXUTOK   261
#define YYTRANSLATE(YYX)   ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
#define YYPACT_NINF   -13
#define YYTABLE_NINF   -1
#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 yyerrorlab
#define YYFAIL   goto yyerrlab
#define YYRECOVERING()   (!!yyerrstatus)
#define YYBACKUP(Token, Value)
#define YYTERROR   1
#define YYERRCODE   256
#define YYRHSLOC(Rhs, K)   ((Rhs)[K])
#define YYLLOC_DEFAULT(Current, Rhs, N)
#define YY_LOCATION_PRINT(File, Loc)
#define YYLEX   yylex (&yylval, &yylloc, YYLEX_PARAM)
#define YYDPRINTF(Args)
#define YY_SYMBOL_PRINT(Title, Type, Value, Location)
#define YY_STACK_PRINT(Bottom, Top)
#define YY_REDUCE_PRINT(Rule)
#define YYINITDEPTH   200
#define YYMAXDEPTH   10000
#define YYPOPSTACK   (yyvsp--, yyssp--, yylsp--)
#define ast_yyerror(x)   ast_yyerror(x, YYLTYPE *yylloc, struct parser_control *karoto)

Typedefs

typedef yyltype yyltype
typedef YYSTYPE YYSTYPE
typedef short int yysigned_char

Enumerations

enum  yytokentype { NE = 258, LE = 259, GE = 260, TOKEN = 261 }
enum  valtype { integer, numeric_string, string }

Functions

int yyparse ()
int yyparse (void *YYPARSE_PARAM)
char * ast_expr (char *arg)


Define Documentation

#define ast_yyerror  )     ast_yyerror(x, YYLTYPE *yylloc, struct parser_control *karoto)
 

Definition at line 1799 of file ast_expr.c.

#define ast_yyerror  )     ast_yyerror(x,&yyloc,kota)
 

Definition at line 1799 of file ast_expr.c.

#define GE   260
 

Definition at line 72 of file ast_expr.c.

#define LE   259
 

Definition at line 71 of file ast_expr.c.

#define NE   258
 

Definition at line 70 of file ast_expr.c.

#define QUAD_MAX   (0x7fffffffffffffffL)
 

Definition at line 113 of file ast_expr.c.

#define QUAD_MIN   (-0x7fffffffffffffffL-1)
 

Definition at line 110 of file ast_expr.c.

#define TOKEN   261
 

Definition at line 73 of file ast_expr.c.

#define YY_LOCATION_PRINT File,
Loc   ) 
 

Value:

fprintf (File, "%d.%d-%d.%d",       \
              (Loc).first_line, (Loc).first_column,   \
              (Loc).last_line,  (Loc).last_column)

Definition at line 615 of file ast_expr.c.

#define YY_REDUCE_PRINT Rule   ) 
 

Definition at line 722 of file ast_expr.c.

Referenced by yyparse().

#define YY_STACK_PRINT Bottom,
Top   ) 
 

Definition at line 721 of file ast_expr.c.

Referenced by yyparse().

#define YY_SYMBOL_PRINT Title,
Type,
Value,
Location   ) 
 

Definition at line 720 of file ast_expr.c.

Referenced by yyparse().

#define YYABORT   goto yyabortlab
 

Definition at line 549 of file ast_expr.c.

Referenced by yyparse().

#define YYACCEPT   goto yyacceptlab
 

Definition at line 548 of file ast_expr.c.

Referenced by yyparse().

#define YYBACKUP Token,
Value   ) 
 

Definition at line 561 of file ast_expr.c.

#define YYBISON   1
 

Definition at line 37 of file ast_expr.c.

#define yychar   ast_yychar
 

Definition at line 53 of file ast_expr.c.

Referenced by yyparse().

#define yyclearin   (yychar = YYEMPTY)
 

Definition at line 544 of file ast_expr.c.

#define YYCOPY To,
From,
Count   ) 
 

Definition at line 300 of file ast_expr.c.

#define YYDEBUG   0
 

Definition at line 190 of file ast_expr.c.

#define yydebug   ast_yydebug
 

Definition at line 54 of file ast_expr.c.

#define YYDPRINTF Args   ) 
 

Definition at line 719 of file ast_expr.c.

Referenced by yyparse().

#define YYEMPTY   (-2)
 

Definition at line 545 of file ast_expr.c.

Referenced by yyparse().

#define YYEOF   0
 

Definition at line 546 of file ast_expr.c.

Referenced by yyparse().

#define YYERRCODE   256
 

Definition at line 580 of file ast_expr.c.

#define yyerrok   (yyerrstatus = 0)
 

Definition at line 543 of file ast_expr.c.

#define YYERROR   goto yyerrorlab
 

Definition at line 550 of file ast_expr.c.

#define yyerror   ast_yyerror
 

Definition at line 51 of file ast_expr.c.

Referenced by yyparse().

#define YYERROR_VERBOSE   0
 

Definition at line 198 of file ast_expr.c.

#define YYFAIL   goto yyerrlab
 

Definition at line 557 of file ast_expr.c.

#define YYFINAL   6
 

Definition at line 336 of file ast_expr.c.

Referenced by yyparse().

#define YYFREE   free
 

Definition at line 239 of file ast_expr.c.

#define YYINITDEPTH   200
 

Definition at line 728 of file ast_expr.c.

Referenced by yyparse().

#define YYLAST   83
 

Definition at line 338 of file ast_expr.c.

Referenced by yyparse().

#define YYLEX   yylex (&yylval, &yylloc, YYLEX_PARAM)
 

Definition at line 628 of file ast_expr.c.

Referenced by yyparse().

#define yylex   ast_yylex
 

Definition at line 50 of file ast_expr.c.

#define YYLEX_PARAM   kota
 

Definition at line 117 of file ast_expr.c.

#define yylloc   ast_yylloc
 

Definition at line 56 of file ast_expr.c.

Referenced by yyparse().

#define YYLLOC_DEFAULT Current,
Rhs,
 ) 
 

Definition at line 589 of file ast_expr.c.

Referenced by yyparse().

#define YYLSP_NEEDED   1
 

Definition at line 46 of file ast_expr.c.

#define YYLTYPE   yyltype
 

Definition at line 179 of file ast_expr.c.

Referenced by yyparse().

#define YYLTYPE_IS_TRIVIAL   1
 

Definition at line 180 of file ast_expr.c.

#define yylval   ast_yylval
 

Definition at line 52 of file ast_expr.c.

Referenced by yyparse().

#define YYMALLOC   malloc
 

Definition at line 242 of file ast_expr.c.

#define YYMAXDEPTH   10000
 

Definition at line 739 of file ast_expr.c.

Referenced by yyparse().

#define YYMAXUTOK   261
 

Definition at line 351 of file ast_expr.c.

#define yynerrs   ast_yynerrs
 

Definition at line 55 of file ast_expr.c.

Referenced by yyparse().

#define YYNNTS   3
 

Definition at line 343 of file ast_expr.c.

#define YYNRULES   18
 

Definition at line 345 of file ast_expr.c.

#define YYNSTATES   36
 

Definition at line 347 of file ast_expr.c.

#define YYNTOKENS   20
 

Definition at line 341 of file ast_expr.c.

Referenced by yyparse().

#define YYPACT_NINF   -13
 

Definition at line 471 of file ast_expr.c.

Referenced by yyparse().

#define yyparse   ast_yyparse
 

Definition at line 49 of file ast_expr.c.

#define YYPARSE_PARAM   kota
 

Definition at line 116 of file ast_expr.c.

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

Referenced by yyparse().

#define YYPURE   1
 

Definition at line 43 of file ast_expr.c.

 
#define YYRECOVERING  )     (!!yyerrstatus)
 

Definition at line 559 of file ast_expr.c.

#define YYRHSLOC Rhs,
 )     ((Rhs)[K])
 

Definition at line 587 of file ast_expr.c.

#define YYSIZE_T   unsigned int
 

Definition at line 540 of file ast_expr.c.

Referenced by yyparse().

#define YYSKELETON_NAME   "yacc.c"
 

Definition at line 40 of file ast_expr.c.

#define YYSTACK_ALLOC   YYMALLOC
 

Definition at line 265 of file ast_expr.c.

Referenced by yyparse().

#define YYSTACK_BYTES  ) 
 

Value:

((N) * (sizeof (short int) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
      + 2 * YYSTACK_GAP_MAXIMUM)

Definition at line 289 of file ast_expr.c.

Referenced by yyparse().

#define YYSTACK_FREE   YYFREE
 

Definition at line 266 of file ast_expr.c.

Referenced by yyparse().

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

Definition at line 285 of file ast_expr.c.

#define YYSTACK_RELOCATE Stack   ) 
 

Definition at line 316 of file ast_expr.c.

Referenced by yyparse().

#define yystype   YYSTYPE
 

Definition at line 208 of file ast_expr.c.

#define YYSTYPE_IS_DECLARED   1
 

Definition at line 209 of file ast_expr.c.

#define YYSTYPE_IS_TRIVIAL   1
 

Definition at line 210 of file ast_expr.c.

#define YYTABLE_NINF   -1
 

Definition at line 490 of file ast_expr.c.

Referenced by yyparse().

#define YYTERROR   1
 

Definition at line 579 of file ast_expr.c.

Referenced by yyparse().

#define YYTRANSLATE YYX   )     ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
 

Definition at line 353 of file ast_expr.c.

Referenced by yyparse().

#define YYUNDEFTOK   2
 

Definition at line 350 of file ast_expr.c.


Typedef Documentation

typedef struct yyltype yyltype
 

typedef short int yysigned_char
 

Definition at line 332 of file ast_expr.c.

typedef union YYSTYPE YYSTYPE
 


Enumeration Type Documentation

enum valtype
 

Enumerator:
integer 
numeric_string 
string 

Definition at line 122 of file ast_expr.c.

00122              {
00123    integer, numeric_string, string
00124 } ;

enum yytokentype
 

Enumerator:
NE 
LE 
GE 
TOKEN 

Definition at line 63 of file ast_expr.c.

00063                     {
00064      NE = 258,
00065      LE = 259,
00066      GE = 260,
00067      TOKEN = 261
00068    };


Function Documentation

char* ast_expr char *  arg  ) 
 

Definition at line 1752 of file ast_expr.c.

References parser_control::arg_orig, parser_control::argv, parser_control::firsttoken, free, integer, malloc, parser_control::result, and strdup.

Referenced by pbx_substitute_variables_helper().

01753 {
01754    struct parser_control karoto;
01755 
01756    char *kota;
01757    char *pirouni;
01758    
01759    kota=strdup(arg);
01760    karoto.result = NULL;
01761    karoto.firsttoken=1;
01762    karoto.argv=kota;
01763    karoto.arg_orig = arg;
01764    /* ast_yydebug = 1; */
01765    
01766    ast_yyparse ((void *)&karoto);
01767 
01768    free(kota);
01769 
01770    if (karoto.result==NULL) {
01771       pirouni=strdup("0");
01772       return(pirouni);
01773    } else {
01774       if (karoto.result->type == integer) {
01775          pirouni=malloc(256);
01776          sprintf (pirouni,"%lld", (long long)karoto.result->u.i);
01777       }
01778       else {
01779          pirouni=strdup(karoto.result->u.s);
01780       }
01781       free(karoto.result);
01782    }
01783    return(pirouni);
01784 }

int yyparse void *  YYPARSE_PARAM  ) 
 

Definition at line 903 of file ast_expr.c.

References YYSTYPE::val, YY_REDUCE_PRINT, YY_STACK_PRINT, YY_SYMBOL_PRINT, YYABORT, YYACCEPT, yychar, YYDPRINTF, YYEMPTY, YYEOF, yyerror, YYFINAL, YYINITDEPTH, YYLAST, YYLEX, yylloc, YYLLOC_DEFAULT, YYLTYPE, yylval, YYMAXDEPTH, yynerrs, YYNTOKENS, YYPACT_NINF, YYPOPSTACK, YYSIZE_T, YYSTACK_ALLOC, YYSTACK_BYTES, YYSTACK_FREE, YYSTACK_RELOCATE, YYTABLE_NINF, YYTERROR, and YYTRANSLATE.

00916 {
00917   /* The look-ahead symbol.  */
00918 int yychar;
00919 
00920 /* The semantic value of the look-ahead symbol.  */
00921 YYSTYPE yylval;
00922 
00923 /* Number of syntax errors so far.  */
00924 int yynerrs;
00925 /* Location data for the look-ahead symbol.  */
00926 YYLTYPE yylloc;
00927 
00928   register int yystate;
00929   register int yyn;
00930   int yyresult;
00931   /* Number of tokens to shift before error messages enabled.  */
00932   int yyerrstatus;
00933   /* Look-ahead token as an internal (translated) token number.  */
00934   int yytoken = 0;
00935 
00936   /* Three stacks and their tools:
00937      `yyss': related to states,
00938      `yyvs': related to semantic values,
00939      `yyls': related to locations.
00940 
00941      Refer to the stacks thru separate pointers, to allow yyoverflow
00942      to reallocate them elsewhere.  */
00943 
00944   /* The state stack.  */
00945   short int yyssa[YYINITDEPTH];
00946   short int *yyss = yyssa;
00947   register short int *yyssp;
00948 
00949   /* The semantic value stack.  */
00950   YYSTYPE yyvsa[YYINITDEPTH];
00951   YYSTYPE *yyvs = yyvsa;
00952   register YYSTYPE *yyvsp;
00953 
00954   /* The location stack.  */
00955   YYLTYPE yylsa[YYINITDEPTH];
00956   YYLTYPE *yyls = yylsa;
00957   YYLTYPE *yylsp;
00958   /* The locations where the error started and ended. */
00959   YYLTYPE yyerror_range[2];
00960 
00961 #define YYPOPSTACK   (yyvsp--, yyssp--, yylsp--)
00962 
00963   YYSIZE_T yystacksize = YYINITDEPTH;
00964 
00965   /* The variables used to return semantic value and location from the
00966      action routines.  */
00967   YYSTYPE yyval;
00968   YYLTYPE yyloc;
00969 
00970   /* When reducing, the number of symbols on the RHS of the reduced
00971      rule.  */
00972   int yylen;
00973 
00974   YYDPRINTF ((stderr, "Starting parse\n"));
00975 
00976   yystate = 0;
00977   yyerrstatus = 0;
00978   yynerrs = 0;
00979   yychar = YYEMPTY;     /* Cause a token to be read.  */
00980 
00981   /* Initialize stack pointers.
00982      Waste one element of value and location stack
00983      so that they stay on the same level as the state stack.
00984      The wasted elements are never initialized.  */
00985 
00986   yyssp = yyss;
00987   yyvsp = yyvs;
00988   yylsp = yyls;
00989 #if YYLTYPE_IS_TRIVIAL
00990   /* Initialize the default location before parsing starts.  */
00991   yylloc.first_line   = yylloc.last_line   = 1;
00992   yylloc.first_column = yylloc.last_column = 0;
00993 #endif
00994 
00995 
00996   yyvsp[0] = yylval;
00997     yylsp[0] = yylloc;
00998 
00999   goto yysetstate;
01000 
01001 /*------------------------------------------------------------.
01002 | yynewstate -- Push a new state, which is found in yystate.  |
01003 `------------------------------------------------------------*/
01004  yynewstate:
01005   /* In all cases, when you get here, the value and location stacks
01006      have just been pushed. so pushing a state here evens the stacks.
01007      */
01008   yyssp++;
01009 
01010  yysetstate:
01011   *yyssp = yystate;
01012 
01013   if (yyss + yystacksize - 1 <= yyssp)
01014     {
01015       /* Get the current used size of the three stacks, in elements.  */
01016       YYSIZE_T yysize = yyssp - yyss + 1;
01017 
01018 #ifdef yyoverflow
01019       {
01020    /* Give user a chance to reallocate the stack. Use copies of
01021       these so that the &'s don't force the real ones into
01022       memory.  */
01023    YYSTYPE *yyvs1 = yyvs;
01024    short int *yyss1 = yyss;
01025    YYLTYPE *yyls1 = yyls;
01026 
01027    /* Each stack pointer address is followed by the size of the
01028       data in use in that stack, in bytes.  This used to be a
01029       conditional around just the two extra args, but that might
01030       be undefined if yyoverflow is a macro.  */
01031    yyoverflow ("parser stack overflow",
01032           &yyss1, yysize * sizeof (*yyssp),
01033           &yyvs1, yysize * sizeof (*yyvsp),
01034           &yyls1, yysize * sizeof (*yylsp),
01035           &yystacksize);
01036    yyls = yyls1;
01037    yyss = yyss1;
01038    yyvs = yyvs1;
01039       }
01040 #else /* no yyoverflow */
01041 # ifndef YYSTACK_RELOCATE
01042       goto yyoverflowlab;
01043 # else
01044       /* Extend the stack our own way.  */
01045       if (YYMAXDEPTH <= yystacksize)
01046    goto yyoverflowlab;
01047       yystacksize *= 2;
01048       if (YYMAXDEPTH < yystacksize)
01049    yystacksize = YYMAXDEPTH;
01050 
01051       {
01052    short int *yyss1 = yyss;
01053    union yyalloc *yyptr =
01054      (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
01055    if (! yyptr)
01056      goto yyoverflowlab;
01057    YYSTACK_RELOCATE (yyss);
01058    YYSTACK_RELOCATE (yyvs);
01059    YYSTACK_RELOCATE (yyls);
01060 #  undef YYSTACK_RELOCATE
01061    if (yyss1 != yyssa)
01062      YYSTACK_FREE (yyss1);
01063       }
01064 # endif
01065 #endif /* no yyoverflow */
01066 
01067       yyssp = yyss + yysize - 1;
01068       yyvsp = yyvs + yysize - 1;
01069       yylsp = yyls + yysize - 1;
01070 
01071       YYDPRINTF ((stderr, "Stack size increased to %lu\n",
01072         (unsigned long int) yystacksize));
01073 
01074       if (yyss + yystacksize - 1 <= yyssp)
01075    YYABORT;
01076     }
01077 
01078   YYDPRINTF ((stderr, "Entering state %d\n", yystate));
01079 
01080   goto yybackup;
01081 
01082 /*-----------.
01083 | yybackup.  |
01084 `-----------*/
01085 yybackup:
01086 
01087 /* Do appropriate processing given the current state.  */
01088 /* Read a look-ahead token if we need one and don't already have one.  */
01089 /* yyresume: */
01090 
01091   /* First try to decide what to do without reference to look-ahead token.  */
01092 
01093   yyn = yypact[yystate];
01094   if (yyn == YYPACT_NINF)
01095     goto yydefault;
01096 
01097   /* Not known => get a look-ahead token if don't already have one.  */
01098 
01099   /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol.  */
01100   if (yychar == YYEMPTY)
01101     {
01102       YYDPRINTF ((stderr, "Reading a token: "));
01103       yychar = YYLEX;
01104     }
01105 
01106   if (yychar <= YYEOF)
01107     {
01108       yychar = yytoken = YYEOF;
01109       YYDPRINTF ((stderr, "Now at end of input.\n"));
01110     }
01111   else
01112     {
01113       yytoken = YYTRANSLATE (yychar);
01114       YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
01115     }
01116 
01117   /* If the proper action on seeing token YYTOKEN is to reduce or to
01118      detect an error, take that action.  */
01119   yyn += yytoken;
01120   if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
01121     goto yydefault;
01122   yyn = yytable[yyn];
01123   if (yyn <= 0)
01124     {
01125       if (yyn == 0 || yyn == YYTABLE_NINF)
01126    goto yyerrlab;
01127       yyn = -yyn;
01128       goto yyreduce;
01129     }
01130 
01131   if (yyn == YYFINAL)
01132     YYACCEPT;
01133 
01134   /* Shift the look-ahead token.  */
01135   YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
01136 
01137   /* Discard the token being shifted unless it is eof.  */
01138   if (yychar != YYEOF)
01139     yychar = YYEMPTY;
01140 
01141   *++yyvsp = yylval;
01142   *++yylsp = yylloc;
01143 
01144   /* Count tokens shifted since error; after three, turn off error
01145      status.  */
01146   if (yyerrstatus)
01147     yyerrstatus--;
01148 
01149   yystate = yyn;
01150   goto yynewstate;
01151 
01152 
01153 /*-----------------------------------------------------------.
01154 | yydefault -- do the default action for the current state.  |
01155 `-----------------------------------------------------------*/
01156 yydefault:
01157   yyn = yydefact[yystate];
01158   if (yyn == 0)
01159     goto yyerrlab;
01160   goto yyreduce;
01161 
01162 
01163 /*-----------------------------.
01164 | yyreduce -- Do a reduction.  |
01165 `-----------------------------*/
01166 yyreduce:
01167   /* yyn is the number of a rule to reduce with.  */
01168   yylen = yyr2[yyn];
01169 
01170   /* If YYLEN is nonzero, implement the default value of the action:
01171      `$$ = $1'.
01172 
01173      Otherwise, the following line sets YYVAL to garbage.
01174      This behavior is undocumented and Bison
01175      users should not rely upon it.  Assigning to YYVAL
01176      unconditionally makes the parser a bit smaller, and it avoids a
01177      GCC warning that YYVAL may be used uninitialized.  */
01178   yyval = yyvsp[1-yylen];
01179 
01180   /* Default location. */
01181   YYLLOC_DEFAULT (yyloc, yylsp - yylen, yylen);
01182   YY_REDUCE_PRINT (yyn);
01183   switch (yyn)
01184     {
01185         case 2:
01186 #line 137 "ast_expr.y"
01187     { ((struct parser_control *)kota)->result = (yyval.val); ;}
01188     break;
01189 
01190   case 4:
01191 #line 141 "ast_expr.y"
01192     { (yyval.val) = (yyvsp[-1].val); (yyloc).first_column = (yylsp[-2]).first_column; (yyloc).last_column = (yylsp[0]).last_column; (yyloc).first_line=0; (yyloc).last_line=0;;}
01193     break;
01194 
01195   case 5:
01196 #line 142 "ast_expr.y"
01197     { (yyval.val) = op_or ((yyvsp[-2].val), (yyvsp[0].val)); (yyloc).first_column = (yylsp[-2]).first_column; (yyloc).last_column = (yylsp[0]).last_column; (yyloc).first_line=0; (yyloc).last_line=0;;}
01198     break;
01199 
01200   case 6:
01201 #line 143 "ast_expr.y"
01202     { (yyval.val) = op_and ((yyvsp[-2].val), (yyvsp[0].val)); (yyloc).first_column = (yylsp[-2]).first_column; (yyloc).last_column = (yylsp[0]).last_column; (yyloc).first_line=0; (yyloc).last_line=0;;}
01203     break;
01204 
01205   case 7:
01206 #line 144 "ast_expr.y"
01207     { (yyval.val) = op_eq ((yyvsp[-2].val), (yyvsp[0].val)); (yyloc).first_column = (yylsp[-2]).first_column; (yyloc).last_column = (yylsp[0]).last_column; (yyloc).first_line=0; (yyloc).last_line=0;;}
01208     break;
01209 
01210   case 8:
01211 #line 145 "ast_expr.y"
01212     { (yyval.val) = op_gt ((yyvsp[-2].val), (yyvsp[0].val)); (yyloc).first_column = (yylsp[-2]).first_column; (yyloc).last_column = (yylsp[0]).last_column; (yyloc).first_line=0; (yyloc).last_line=0;;}
01213     break;
01214 
01215   case 9:
01216 #line 146 "ast_expr.y"
01217     { (yyval.val) = op_lt ((yyvsp[-2].val), (yyvsp[0].val)); (yyloc).first_column = (yylsp[-2]).first_column; (yyloc).last_column = (yylsp[0]).last_column; (yyloc).first_line=0; (yyloc).last_line=0;;}
01218     break;
01219 
01220   case 10:
01221 #line 147 "ast_expr.y"
01222     { (yyval.val) = op_ge ((yyvsp[-2].val), (yyvsp[0].val)); (yyloc).first_column = (yylsp[-2]).first_column; (yyloc).last_column = (yylsp[0]).last_column; (yyloc).first_line=0; (yyloc).last_line=0;;}
01223     break;
01224 
01225   case 11:
01226 #line 148 "ast_expr.y"
01227     { (yyval.val) = op_le ((yyvsp[-2].val), (yyvsp[0].val)); (yyloc).first_column = (yylsp[-2]).first_column; (yyloc).last_column = (yylsp[0]).last_column; (yyloc).first_line=0; (yyloc).last_line=0;;}
01228     break;
01229 
01230   case 12:
01231 #line 149 "ast_expr.y"
01232     { (yyval.val) = op_ne ((yyvsp[-2].val), (yyvsp[0].val)); (yyloc).first_column = (yylsp[-2]).first_column; (yyloc).last_column = (yylsp[0]).last_column; (yyloc).first_line=0; (yyloc).last_line=0;;}
01233     break;
01234 
01235   case 13:
01236 #line 150 "ast_expr.y"
01237     { (yyval.val) = op_plus ((yyvsp[-2].val), (yyvsp[0].val)); (yyloc).first_column = (yylsp[-2]).first_column; (yyloc).last_column = (yylsp[0]).last_column; (yyloc).first_line=0; (yyloc).last_line=0;;}
01238     break;
01239 
01240   case 14:
01241 #line 151 "ast_expr.y"
01242     { (yyval.val) = op_minus ((yyvsp[-2].val), (yyvsp[0].val)); (yyloc).first_column = (yylsp[-2]).first_column; (yyloc).last_column = (yylsp[0]).last_column; (yyloc).first_line=0; (yyloc).last_line=0;;}
01243     break;
01244 
01245   case 15:
01246 #line 152 "ast_expr.y"
01247     { (yyval.val) = op_times ((yyvsp[-2].val), (yyvsp[0].val)); (yyloc).first_column = (yylsp[-2]).first_column; (yyloc).last_column = (yylsp[0]).last_column; (yyloc).first_line=0; (yyloc).last_line=0;;}
01248     break;
01249 
01250   case 16:
01251 #line 153 "ast_expr.y"
01252     { (yyval.val) = op_div ((yyvsp[-2].val), (yyvsp[0].val)); (yyloc).first_column = (yylsp[-2]).first_column; (yyloc).last_column = (yylsp[0]).last_column; (yyloc).first_line=0; (yyloc).last_line=0;;}
01253     break;
01254 
01255   case 17:
01256 #line 154 "ast_expr.y"
01257     { (yyval.val) = op_rem ((yyvsp[-2].val), (yyvsp[0].val)); (yyloc).first_column = (yylsp[-2]).first_column; (yyloc).last_column = (yylsp[0]).last_column; (yyloc).first_line=0; (yyloc).last_line=0;;}
01258     break;
01259 
01260   case 18:
01261 #line 155 "ast_expr.y"
01262     { (yyval.val) = op_colon ((yyvsp[-2].val), (yyvsp[0].val)); (yyloc).first_column = (yylsp[-2]).first_column; (yyloc).last_column = (yylsp[0]).last_column; (yyloc).first_line=0; (yyloc).last_line=0;;}
01263     break;
01264 
01265 
01266     }
01267 
01268 /* Line 1037 of yacc.c.  */
01269 #line 1270 "ast_expr.c"
01270 
01271   yyvsp -= yylen;
01272   yyssp -= yylen;
01273   yylsp -= yylen;
01274 
01275   YY_STACK_PRINT (yyss, yyssp);
01276 
01277   *++yyvsp = yyval;
01278   *++yylsp = yyloc;
01279 
01280   /* Now `shift' the result of the reduction.  Determine what state
01281      that goes to, based on the state we popped back to and the rule
01282      number reduced by.  */
01283 
01284   yyn = yyr1[yyn];
01285 
01286   yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
01287   if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
01288     yystate = yytable[yystate];
01289   else
01290     yystate = yydefgoto[yyn - YYNTOKENS];
01291 
01292   goto yynewstate;
01293 
01294 
01295 /*------------------------------------.
01296 | yyerrlab -- here on detecting error |
01297 `------------------------------------*/
01298 yyerrlab:
01299   /* If not already recovering from an error, report this error.  */
01300   if (!yyerrstatus)
01301     {
01302       ++yynerrs;
01303 #if YYERROR_VERBOSE
01304       yyn = yypact[yystate];
01305 
01306       if (YYPACT_NINF < yyn && yyn < YYLAST)
01307    {
01308      YYSIZE_T yysize = 0;
01309      int yytype = YYTRANSLATE (yychar);
01310      const char* yyprefix;
01311      char *yymsg;
01312      int yyx;
01313 
01314      /* Start YYX at -YYN if negative to avoid negative indexes in
01315         YYCHECK.  */
01316      int yyxbegin = yyn < 0 ? -yyn : 0;
01317 
01318      /* Stay within bounds of both yycheck and yytname.  */
01319      int yychecklim = YYLAST - yyn;
01320      int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
01321      int yycount = 0;
01322 
01323      yyprefix = ", expecting ";
01324      for (yyx = yyxbegin; yyx < yyxend; ++yyx)
01325        if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
01326          {
01327       yysize += yystrlen (yyprefix) + yystrlen (yytname [yyx]);
01328       yycount += 1;
01329       if (yycount == 5)
01330         {
01331           yysize = 0;
01332           break;
01333         }
01334          }
01335      yysize += (sizeof ("syntax error, unexpected ")
01336            + yystrlen (yytname[yytype]));
01337      yymsg = (char *) YYSTACK_ALLOC (yysize);
01338      if (yymsg != 0)
01339        {
01340          char *yyp = yystpcpy (yymsg, "syntax error, unexpected ");
01341          yyp = yystpcpy (yyp, yytname[yytype]);
01342 
01343          if (yycount < 5)
01344       {
01345         yyprefix = ", expecting ";
01346         for (yyx = yyxbegin; yyx < yyxend; ++yyx)
01347           if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
01348             {
01349          yyp = yystpcpy (yyp, yyprefix);
01350          yyp = yystpcpy (yyp, yytname[yyx]);
01351          yyprefix = " or ";
01352             }
01353       }
01354          yyerror (yymsg);
01355          YYSTACK_FREE (yymsg);
01356        }
01357      else
01358        yyerror ("syntax error; also virtual memory exhausted");
01359    }
01360       else
01361 #endif /* YYERROR_VERBOSE */
01362    yyerror ("syntax error");
01363     }
01364 
01365   yyerror_range[0] = yylloc;
01366 
01367   if (yyerrstatus == 3)
01368     {
01369       /* If just tried and failed to reuse look-ahead token after an
01370     error, discard it.  */
01371 
01372       if (yychar <= YYEOF)
01373         {
01374           /* If at end of input, pop the error token,
01375         then the rest of the stack, then return failure.  */
01376      if (yychar == YYEOF)
01377         for (;;)
01378           {
01379                  yyerror_range[0] = *yylsp;
01380        YYPOPSTACK;
01381        if (yyssp == yyss)
01382          YYABORT;
01383        yydestruct ("Error: popping",
01384                              yystos[*yyssp], yyvsp, yylsp);
01385           }
01386         }
01387       else
01388    {
01389      yydestruct ("Error: discarding", yytoken, &yylval, &yylloc);
01390      yychar = YYEMPTY;
01391    }
01392     }
01393 
01394   /* Else will try to reuse look-ahead token after shifting the error
01395      token.  */
01396   goto yyerrlab1;
01397 
01398 
01399 /*---------------------------------------------------.
01400 | yyerrorlab -- error raised explicitly by YYERROR.  |
01401 `---------------------------------------------------*/
01402 yyerrorlab:
01403 
01404 #ifdef __GNUC__
01405   /* Pacify GCC when the user code never invokes YYERROR and the label
01406      yyerrorlab therefore never appears in user code.  */
01407   if (0)
01408      goto yyerrorlab;
01409 #endif
01410 
01411   yyerror_range[0] = yylsp[1-yylen];
01412   yylsp -= yylen;
01413   yyvsp -= yylen;
01414   yyssp -= yylen;
01415   yystate = *yyssp;
01416   goto yyerrlab1;
01417 
01418 
01419 /*-------------------------------------------------------------.
01420 | yyerrlab1 -- common code for both syntax error and YYERROR.  |
01421 `-------------------------------------------------------------*/
01422 yyerrlab1:
01423   yyerrstatus = 3;   /* Each real token shifted decrements this.  */
01424 
01425   for (;;)
01426     {
01427       yyn = yypact[yystate];
01428       if (yyn != YYPACT_NINF)
01429    {
01430      yyn += YYTERROR;
01431      if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
01432        {
01433          yyn = yytable[yyn];
01434          if (0 < yyn)
01435       break;
01436        }
01437    }
01438 
01439       /* Pop the current state because it cannot handle the error token.  */
01440       if (yyssp == yyss)
01441    YYABORT;
01442 
01443       yyerror_range[0] = *yylsp;
01444       yydestruct ("Error: popping", yystos[yystate], yyvsp, yylsp);
01445       YYPOPSTACK;
01446       yystate = *yyssp;
01447       YY_STACK_PRINT (yyss, yyssp);
01448     }
01449 
01450   if (yyn == YYFINAL)
01451     YYACCEPT;
01452 
01453   *++yyvsp = yylval;
01454 
01455   yyerror_range[1] = yylloc;
01456   /* Using YYLLOC is tempting, but would change the location of
01457      the look-ahead.  YYLOC is available though. */
01458   YYLLOC_DEFAULT (yyloc, yyerror_range - 1, 2);
01459   *++yylsp = yyloc;
01460 
01461   /* Shift the error token. */
01462   YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
01463 
01464   yystate = yyn;
01465   goto yynewstate;
01466 
01467 
01468 /*-------------------------------------.
01469 | yyacceptlab -- YYACCEPT comes here.  |
01470 `-------------------------------------*/
01471 yyacceptlab:
01472   yyresult = 0;
01473   goto yyreturn;
01474 
01475 /*-----------------------------------.
01476 | yyabortlab -- YYABORT comes here.  |
01477 `-----------------------------------*/
01478 yyabortlab:
01479   yydestruct ("Error: discarding lookahead",
01480               yytoken, &yylval, &yylloc);
01481   yychar = YYEMPTY;
01482   yyresult = 1;
01483   goto yyreturn;
01484 
01485 #ifndef yyoverflow
01486 /*----------------------------------------------.
01487 | yyoverflowlab -- parser overflow comes here.  |
01488 `----------------------------------------------*/
01489 yyoverflowlab:
01490   yyerror ("parser stack overflow");
01491   yyresult = 2;
01492   /* Fall through.  */
01493 #endif
01494 
01495 yyreturn:
01496 #ifndef yyoverflow
01497   if (yyss != yyssa)
01498     YYSTACK_FREE (yyss);
01499 #endif
01500   return yyresult;
01501 }

int yyparse  ) 
 


Generated on Wed Aug 10 11:36:33 2005 for Asterisk by  doxygen 1.4.4