Main Page | Alphabetical List | Data Structures | 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 YYSTACK_ALLOC   malloc
#define YYSTACK_FREE   free
#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
#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 (&yylval, &yylloc, YYLEX_PARAM)
#define YYDPRINTF(Args)
#define YYDSYMPRINT(Args)
#define YYDSYMPRINTF(Title, Token, 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 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 1721 of file ast_expr.c.

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

Definition at line 1721 of file ast_expr.c.

#define GE   260
 

Definition at line 73 of file ast_expr.c.

#define LE   259
 

Definition at line 72 of file ast_expr.c.

#define NE   258
 

Definition at line 71 of file ast_expr.c.

#define QUAD_MAX   (0x7fffffffffffffffL)
 

Definition at line 114 of file ast_expr.c.

#define QUAD_MIN   (-0x7fffffffffffffffL-1)
 

Definition at line 111 of file ast_expr.c.

#define TOKEN   261
 

Definition at line 74 of file ast_expr.c.

#define YY_REDUCE_PRINT Rule   ) 
 

Definition at line 699 of file ast_expr.c.

Referenced by yyparse().

#define YY_STACK_PRINT Bottom,
Top   ) 
 

Definition at line 698 of file ast_expr.c.

Referenced by yyparse().

#define YYABORT   goto yyabortlab
 

Definition at line 546 of file ast_expr.c.

Referenced by yyparse().

#define YYACCEPT   goto yyacceptlab
 

Definition at line 545 of file ast_expr.c.

Referenced by yyparse().

#define YYBACKUP Token,
Value   ) 
 

Definition at line 564 of file ast_expr.c.

#define YYBISON   1
 

Definition at line 37 of file ast_expr.c.

#define yychar   ast_yychar
 

Definition at line 54 of file ast_expr.c.

Referenced by yyparse().

#define yyclearin   (yychar = YYEMPTY)
 

Definition at line 541 of file ast_expr.c.

#define YYCOPY To,
From,
Count   ) 
 

Definition at line 297 of file ast_expr.c.

#define YYDEBUG   0
 

Definition at line 191 of file ast_expr.c.

#define yydebug   ast_yydebug
 

Definition at line 55 of file ast_expr.c.

#define YYDPRINTF Args   ) 
 

Definition at line 695 of file ast_expr.c.

Referenced by yyparse().

#define YYDSYMPRINT Args   ) 
 

Definition at line 696 of file ast_expr.c.

#define YYDSYMPRINTF Title,
Token,
Value,
Location   ) 
 

Definition at line 697 of file ast_expr.c.

Referenced by yyparse().

#define YYEMPTY   (-2)
 

Definition at line 542 of file ast_expr.c.

Referenced by yyparse().

#define YYEOF   0
 

Definition at line 543 of file ast_expr.c.

Referenced by yyparse().

#define YYERRCODE   256
 

Definition at line 582 of file ast_expr.c.

#define yyerrok   (yyerrstatus = 0)
 

Definition at line 540 of file ast_expr.c.

#define YYERROR
 

Definition at line 547 of file ast_expr.c.

#define yyerror   ast_yyerror
 

Definition at line 52 of file ast_expr.c.

Referenced by yyparse().

#define YYERROR_VERBOSE   0
 

Definition at line 199 of file ast_expr.c.

#define YYFAIL   goto yyerrlab
 

Definition at line 560 of file ast_expr.c.

#define YYFINAL   6
 

Definition at line 333 of file ast_expr.c.

Referenced by yyparse().

#define YYINITDEPTH   200
 

Definition at line 705 of file ast_expr.c.

Referenced by yyparse().

#define YYLAST   83
 

Definition at line 335 of file ast_expr.c.

Referenced by yyparse().

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

Definition at line 598 of file ast_expr.c.

Referenced by yyparse().

#define yylex   ast_yylex
 

Definition at line 51 of file ast_expr.c.

#define YYLEX_PARAM   kota
 

Definition at line 118 of file ast_expr.c.

#define yylloc   ast_yylloc
 

Definition at line 57 of file ast_expr.c.

Referenced by yyparse().

#define YYLLOC_DEFAULT Current,
Rhs,
 ) 
 

Value:

Current.first_line = Rhs[1].first_line; \ Current.first_column = Rhs[1].first_column; \ Current.last_line = Rhs[N].last_line; \ Current.last_column = Rhs[N].last_column;
Definition at line 588 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 180 of file ast_expr.c.

Referenced by yyparse().

#define YYLTYPE_IS_TRIVIAL   1
 

Definition at line 181 of file ast_expr.c.

#define yylval   ast_yylval
 

Definition at line 53 of file ast_expr.c.

Referenced by yyparse().

#define YYMAXDEPTH   10000
 

Definition at line 720 of file ast_expr.c.

Referenced by yyparse().

#define YYMAXUTOK   261
 

Definition at line 348 of file ast_expr.c.

#define yynerrs   ast_yynerrs
 

Definition at line 56 of file ast_expr.c.

Referenced by yyparse().

#define YYNNTS   3
 

Definition at line 340 of file ast_expr.c.

#define YYNRULES   18
 

Definition at line 342 of file ast_expr.c.

#define YYNSTATES   36
 

Definition at line 344 of file ast_expr.c.

#define YYNTOKENS   20
 

Definition at line 338 of file ast_expr.c.

Referenced by yyparse().

#define YYPACT_NINF   -13
 

Definition at line 468 of file ast_expr.c.

Referenced by yyparse().

#define yyparse   ast_yyparse
 

Definition at line 50 of file ast_expr.c.

#define YYPARSE_PARAM   kota
 

Definition at line 117 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 562 of file ast_expr.c.

#define YYSIZE_T   unsigned int
 

Definition at line 537 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   malloc
 

Definition at line 263 of file ast_expr.c.

Referenced by yyparse().

#define YYSTACK_BYTES  ) 
 

Value:

((N) * (sizeof (short) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \ + 2 * YYSTACK_GAP_MAXIMUM)
Definition at line 286 of file ast_expr.c.

Referenced by yyparse().

#define YYSTACK_FREE   free
 

Definition at line 264 of file ast_expr.c.

Referenced by yyparse().

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

Definition at line 282 of file ast_expr.c.

#define YYSTACK_RELOCATE Stack   ) 
 

Definition at line 313 of file ast_expr.c.

Referenced by yyparse().

#define yystype   YYSTYPE
 

Definition at line 209 of file ast_expr.c.

#define YYSTYPE_IS_DECLARED   1
 

Definition at line 210 of file ast_expr.c.

#define YYSTYPE_IS_TRIVIAL   1
 

Definition at line 211 of file ast_expr.c.

#define YYTABLE_NINF   -1
 

Definition at line 487 of file ast_expr.c.

Referenced by yyparse().

#define YYTERROR   1
 

Definition at line 581 of file ast_expr.c.

Referenced by yyparse().

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

Definition at line 350 of file ast_expr.c.

Referenced by yyparse().

#define YYUNDEFTOK   2
 

Definition at line 347 of file ast_expr.c.


Typedef Documentation

typedef struct yyltype yyltype
 

typedef short yysigned_char
 

Definition at line 329 of file ast_expr.c.

typedef union YYSTYPE YYSTYPE
 


Enumeration Type Documentation

enum valtype
 

Enumeration values:
integer 
numeric_string 
string 
Definition at line 123 of file ast_expr.c.
00123 { 00124 integer, numeric_string, string 00125 } ;

enum yytokentype
 

Enumeration values:
NE 
LE 
GE 
TOKEN 
Definition at line 64 of file ast_expr.c.
00064 { 00065 NE = 258, 00066 LE = 259, 00067 GE = 260, 00068 TOKEN = 261 00069 };


Function Documentation

char* ast_expr char *  arg  ) 
 

Definition at line 1674 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().

01675 { 01676 struct parser_control karoto; 01677 01678 char *kota; 01679 char *pirouni; 01680 01681 kota=strdup(arg); 01682 karoto.result = NULL; 01683 karoto.firsttoken=1; 01684 karoto.argv=kota; 01685 karoto.arg_orig = arg; 01686 /* ast_yydebug = 1; */ 01687 01688 ast_yyparse ((void *)&karoto); 01689 01690 free(kota); 01691 01692 if (karoto.result==NULL) { 01693 pirouni=strdup("0"); 01694 return(pirouni); 01695 } else { 01696 if (karoto.result->type == integer) { 01697 pirouni=malloc(256); 01698 sprintf (pirouni,"%lld", (long long)karoto.result->u.i); 01699 } 01700 else { 01701 pirouni=strdup(karoto.result->u.s); 01702 } 01703 free(karoto.result); 01704 } 01705 return(pirouni); 01706 }

int yyparse void *  YYPARSE_PARAM  ) 
 

Definition at line 877 of file ast_expr.c.

References YYSTYPE::val, YY_REDUCE_PRINT, YY_STACK_PRINT, YYABORT, YYACCEPT, yychar, YYDPRINTF, YYDSYMPRINTF, 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.

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

int yyparse  ) 
 


Generated on Tue Aug 17 16:13:54 2004 for Asterisk by doxygen 1.3.8