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>

Include dependency graph for ast_expr.c:

Include dependency graph

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 /* Identify Bison output. */
#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 YYLSP_NEEDED   1
#define GE   257
#define LE   258
#define NE   259
#define TOKEN   260
#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 YYSTYPE   yystype
#define YYSTYPE_IS_TRIVIAL   1
#define YYDEBUG   0
#define YYFINAL   36
#define YYFLAG   -32768
#define YYNTBASE   20
#define YYTRANSLATE(x)   ((unsigned)(x) <= 260 ? yytranslate[x] : 22)
#define YYLAST   83
#define YYPURE   1
#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 (&yylval, &yylloc, YYLEX_PARAM)
#define YYDPRINTF(Args)
#define YYINITDEPTH   200
#define YYMAXDEPTH   10000
#define YYPARSE_PARAM_ARG   YYPARSE_PARAM
#define YYPARSE_PARAM_DECL   void *YYPARSE_PARAM;
#define YY_DECL_NON_LSP_VARIABLES
#define YY_DECL_VARIABLES
#define YYPOPSTACK   (yyvsp--, yyssp--, yylsp--)
#define ast_yyerror(x)   ast_yyerror(x, YYLTYPE *yylloc, struct parser_control *karoto)

Typedefs

typedef yyltype yyltype

Enumerations

enum  valtype { integer, numeric_string, string }

Functions

int yyparse (YYPARSE_PARAM_ARG)
char * ast_expr (char *arg)


Define Documentation

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

Definition at line 1605 of file ast_expr.c.

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

Definition at line 1605 of file ast_expr.c.

#define GE   257
 

Definition at line 15 of file ast_expr.c.

#define LE   258
 

Definition at line 16 of file ast_expr.c.

#define NE   259
 

Definition at line 17 of file ast_expr.c.

#define QUAD_MAX   (0x7fffffffffffffffL)
 

Definition at line 47 of file ast_expr.c.

#define QUAD_MIN   (-0x7fffffffffffffffL-1)
 

Definition at line 44 of file ast_expr.c.

#define TOKEN   260
 

Definition at line 18 of file ast_expr.c.

#define YY_DECL_NON_LSP_VARIABLES
 

Definition at line 655 of file ast_expr.c.

#define YY_DECL_VARIABLES
 

Value:

YY_DECL_NON_LSP_VARIABLES \ \ /* Location data for the lookahead symbol. */ \ YYLTYPE yylloc;

Definition at line 666 of file ast_expr.c.

Referenced by yyparse().

#define YYABORT   goto yyabortlab
 

Definition at line 466 of file ast_expr.c.

Referenced by yyparse().

#define YYACCEPT   goto yyacceptlab
 

Definition at line 465 of file ast_expr.c.

Referenced by yyparse().

#define YYBACKUP Token,
Value   ) 
 

Definition at line 473 of file ast_expr.c.

#define YYBISON   1 /* Identify Bison output. */
 

Definition at line 4 of file ast_expr.c.

#define yychar   ast_yychar
 

Definition at line 10 of file ast_expr.c.

Referenced by yyparse().

#define yyclearin   (yychar = YYEMPTY)
 

Definition at line 462 of file ast_expr.c.

#define YYCOPY To,
From,
Count   ) 
 

Definition at line 415 of file ast_expr.c.

#define YYDEBUG   0
 

Definition at line 149 of file ast_expr.c.

#define yydebug   ast_yydebug
 

Definition at line 11 of file ast_expr.c.

Referenced by yyparse().

#define YYDPRINTF Args   ) 
 

Definition at line 546 of file ast_expr.c.

Referenced by yyparse().

#define YYEMPTY   -2
 

Definition at line 463 of file ast_expr.c.

Referenced by yyparse().

#define YYEOF   0
 

Definition at line 464 of file ast_expr.c.

Referenced by yyparse().

#define YYERRCODE   256
 

Definition at line 491 of file ast_expr.c.

#define yyerrok   (yyerrstatus = 0)
 

Definition at line 461 of file ast_expr.c.

#define YYERROR   goto yyerrlab1
 

Definition at line 467 of file ast_expr.c.

#define yyerror   ast_yyerror
 

Definition at line 8 of file ast_expr.c.

Referenced by yyparse().

#define YYFAIL   goto yyerrlab
 

Definition at line 471 of file ast_expr.c.

#define YYFINAL   36
 

Definition at line 154 of file ast_expr.c.

Referenced by yyparse().

#define YYFLAG   -32768
 

Definition at line 155 of file ast_expr.c.

Referenced by yyparse().

#define YYINITDEPTH   200
 

Definition at line 551 of file ast_expr.c.

Referenced by yyparse().

#define YYLAST   83
 

Definition at line 277 of file ast_expr.c.

Referenced by yyparse().

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

Definition at line 513 of file ast_expr.c.

Referenced by yyparse().

#define yylex   ast_yylex
 

Definition at line 7 of file ast_expr.c.

#define YYLEX_PARAM   kota
 

Definition at line 51 of file ast_expr.c.

#define YYLLOC_DEFAULT Current,
Rhs,
 ) 
 

Value:

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

Definition at line 502 of file ast_expr.c.

Referenced by yyparse().

#define YYLSP_NEEDED   1
 

Definition at line 13 of file ast_expr.c.

#define YYLTYPE   yyltype
 

Definition at line 113 of file ast_expr.c.

Referenced by yyparse().

#define YYLTYPE_IS_TRIVIAL   1
 

Definition at line 114 of file ast_expr.c.

#define yylval   ast_yylval
 

Definition at line 9 of file ast_expr.c.

Referenced by yyparse().

#define YYMAXDEPTH   10000
 

Definition at line 566 of file ast_expr.c.

Referenced by yyparse().

#define yynerrs   ast_yynerrs
 

Definition at line 12 of file ast_expr.c.

Referenced by yyparse().

#define YYNTBASE   20
 

Definition at line 156 of file ast_expr.c.

Referenced by yyparse().

#define yyparse   ast_yyparse
 

Definition at line 6 of file ast_expr.c.

#define YYPARSE_PARAM   kota
 

Definition at line 50 of file ast_expr.c.

#define YYPARSE_PARAM_ARG   YYPARSE_PARAM
 

Definition at line 635 of file ast_expr.c.

#define YYPARSE_PARAM_DECL   void *YYPARSE_PARAM;
 

Definition at line 636 of file ast_expr.c.

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

#define YYPURE   1
 

Definition at line 305 of file ast_expr.c.

 
#define YYRECOVERING  )     (!!yyerrstatus)
 

Definition at line 472 of file ast_expr.c.

#define YYSIZE_T   unsigned int
 

Definition at line 458 of file ast_expr.c.

Referenced by yyparse().

#define YYSTACK_ALLOC   malloc
 

Definition at line 373 of file ast_expr.c.

Referenced by yyparse().

#define YYSTACK_BYTES  ) 
 

Value:

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

Definition at line 399 of file ast_expr.c.

Referenced by yyparse().

#define YYSTACK_FREE   free
 

Definition at line 374 of file ast_expr.c.

Referenced by yyparse().

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

Definition at line 394 of file ast_expr.c.

#define YYSTACK_RELOCATE Stack   ) 
 

Definition at line 431 of file ast_expr.c.

Referenced by yyparse().

#define YYSTYPE   yystype
 

Definition at line 127 of file ast_expr.c.

Referenced by yyparse().

#define YYSTYPE_IS_TRIVIAL   1
 

Definition at line 128 of file ast_expr.c.

#define YYTERROR   1
 

Definition at line 490 of file ast_expr.c.

Referenced by yyparse().

#define YYTRANSLATE  )     ((unsigned)(x) <= 260 ? yytranslate[x] : 22)
 

Definition at line 159 of file ast_expr.c.

Referenced by yyparse().


Typedef Documentation

typedef struct yyltype yyltype
 


Enumeration Type Documentation

enum valtype
 

Enumeration values:
integer 
numeric_string 
string 

Definition at line 56 of file ast_expr.c.

00056 { 00057 integer, numeric_string, string 00058 } ;


Function Documentation

char* ast_expr char *  arg  ) 
 

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

01559 { 01560 struct parser_control karoto; 01561 01562 char *kota; 01563 char *pirouni; 01564 01565 kota=strdup(arg); 01566 karoto.result = NULL; 01567 karoto.firsttoken=1; 01568 karoto.argv=kota; 01569 karoto.arg_orig = arg; 01570 /* ast_yydebug = 1; */ 01571 01572 ast_yyparse ((void *)&karoto); 01573 01574 free(kota); 01575 01576 if (karoto.result==NULL) { 01577 pirouni=strdup("0"); 01578 return(pirouni); 01579 } else { 01580 if (karoto.result->type == integer) { 01581 pirouni=malloc(256); 01582 sprintf (pirouni,"%lld", (long long)karoto.result->u.i); 01583 } 01584 else { 01585 pirouni=strdup(karoto.result->u.s); 01586 } 01587 free(karoto.result); 01588 } 01589 return(pirouni); 01590 }

int yyparse YYPARSE_PARAM_ARG   ) 
 

Definition at line 684 of file ast_expr.c.

References YY_DECL_VARIABLES, YYABORT, YYACCEPT, yychar, yydebug, YYDPRINTF, YYEMPTY, YYEOF, yyerror, YYFINAL, YYFLAG, YYINITDEPTH, YYLAST, YYLEX, YYLLOC_DEFAULT, YYLTYPE, yylval, YYMAXDEPTH, yynerrs, YYNTBASE, YYSIZE_T, YYSTACK_ALLOC, YYSTACK_BYTES, YYSTACK_FREE, YYSTACK_RELOCATE, YYSTYPE, YYTERROR, and YYTRANSLATE.

00686 { 00687 /* If reentrant, generate the variables here. */ 00688 #if YYPURE 00689 YY_DECL_VARIABLES 00690 #endif /* !YYPURE */ 00691 00692 register int yystate; 00693 register int yyn; 00694 int yyresult; 00695 /* Number of tokens to shift before error messages enabled. */ 00696 int yyerrstatus; 00697 /* Lookahead token as an internal (translated) token number. */ 00698 int yychar1 = 0; 00699 00700 /* Three stacks and their tools: 00701 `yyss': related to states, 00702 `yyvs': related to semantic values, 00703 `yyls': related to locations. 00704 00705 Refer to the stacks thru separate pointers, to allow yyoverflow 00706 to reallocate them elsewhere. */ 00707 00708 /* The state stack. */ 00709 short yyssa[YYINITDEPTH]; 00710 short *yyss = yyssa; 00711 register short *yyssp; 00712 00713 /* The semantic value stack. */ 00714 YYSTYPE yyvsa[YYINITDEPTH]; 00715 YYSTYPE *yyvs = yyvsa; 00716 register YYSTYPE *yyvsp; 00717 00718 #if YYLSP_NEEDED 00719 /* The location stack. */ 00720 YYLTYPE yylsa[YYINITDEPTH]; 00721 YYLTYPE *yyls = yylsa; 00722 YYLTYPE *yylsp; 00723 #endif 00724 00725 #if YYLSP_NEEDED 00726 # define YYPOPSTACK (yyvsp--, yyssp--, yylsp--) 00727 #else 00728 # define YYPOPSTACK (yyvsp--, yyssp--) 00729 #endif 00730 00731 YYSIZE_T yystacksize = YYINITDEPTH; 00732 00733 00734 /* The variables used to return semantic value and location from the 00735 action routines. */ 00736 YYSTYPE yyval; 00737 #if YYLSP_NEEDED 00738 YYLTYPE yyloc; 00739 #endif 00740 00741 /* When reducing, the number of symbols on the RHS of the reduced 00742 rule. */ 00743 int yylen; 00744 00745 YYDPRINTF ((stderr, "Starting parse\n")); 00746 00747 yystate = 0; 00748 yyerrstatus = 0; 00749 yynerrs = 0; 00750 yychar = YYEMPTY; /* Cause a token to be read. */ 00751 00752 /* Initialize stack pointers. 00753 Waste one element of value and location stack 00754 so that they stay on the same level as the state stack. 00755 The wasted elements are never initialized. */ 00756 00757 yyssp = yyss; 00758 yyvsp = yyvs; 00759 #if YYLSP_NEEDED 00760 yylsp = yyls; 00761 #endif 00762 goto yysetstate; 00763 00764 /*------------------------------------------------------------. 00765 | yynewstate -- Push a new state, which is found in yystate. | 00766 `------------------------------------------------------------*/ 00767 yynewstate: 00768 /* In all cases, when you get here, the value and location stacks 00769 have just been pushed. so pushing a state here evens the stacks. 00770 */ 00771 yyssp++; 00772 00773 yysetstate: 00774 *yyssp = yystate; 00775 00776 if (yyssp >= yyss + yystacksize - 1) 00777 { 00778 /* Get the current used size of the three stacks, in elements. */ 00779 YYSIZE_T yysize = yyssp - yyss + 1; 00780 00781 #ifdef yyoverflow 00782 { 00783 /* Give user a chance to reallocate the stack. Use copies of 00784 these so that the &'s don't force the real ones into 00785 memory. */ 00786 YYSTYPE *yyvs1 = yyvs; 00787 short *yyss1 = yyss; 00788 00789 /* Each stack pointer address is followed by the size of the 00790 data in use in that stack, in bytes. */ 00791 # if YYLSP_NEEDED 00792 YYLTYPE *yyls1 = yyls; 00793 /* This used to be a conditional around just the two extra args, 00794 but that might be undefined if yyoverflow is a macro. */ 00795 yyoverflow ("parser stack overflow", 00796 &yyss1, yysize * sizeof (*yyssp), 00797 &yyvs1, yysize * sizeof (*yyvsp), 00798 &yyls1, yysize * sizeof (*yylsp), 00799 &yystacksize); 00800 yyls = yyls1; 00801 # else 00802 yyoverflow ("parser stack overflow", 00803 &yyss1, yysize * sizeof (*yyssp), 00804 &yyvs1, yysize * sizeof (*yyvsp), 00805 &yystacksize); 00806 # endif 00807 yyss = yyss1; 00808 yyvs = yyvs1; 00809 } 00810 #else /* no yyoverflow */ 00811 # ifndef YYSTACK_RELOCATE 00812 goto yyoverflowlab; 00813 # else 00814 /* Extend the stack our own way. */ 00815 if (yystacksize >= YYMAXDEPTH) 00816 goto yyoverflowlab; 00817 yystacksize *= 2; 00818 if (yystacksize > YYMAXDEPTH) 00819 yystacksize = YYMAXDEPTH; 00820 00821 { 00822 short *yyss1 = yyss; 00823 union yyalloc *yyptr = 00824 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); 00825 if (! yyptr) 00826 goto yyoverflowlab; 00827 YYSTACK_RELOCATE (yyss); 00828 YYSTACK_RELOCATE (yyvs); 00829 # if YYLSP_NEEDED 00830 YYSTACK_RELOCATE (yyls); 00831 # endif 00832 # undef YYSTACK_RELOCATE 00833 if (yyss1 != yyssa) 00834 YYSTACK_FREE (yyss1); 00835 } 00836 # endif 00837 #endif /* no yyoverflow */ 00838 00839 yyssp = yyss + yysize - 1; 00840 yyvsp = yyvs + yysize - 1; 00841 #if YYLSP_NEEDED 00842 yylsp = yyls + yysize - 1; 00843 #endif 00844 00845 YYDPRINTF ((stderr, "Stack size increased to %lu\n", 00846 (unsigned long int) yystacksize)); 00847 00848 if (yyssp >= yyss + yystacksize - 1) 00849 YYABORT; 00850 } 00851 00852 YYDPRINTF ((stderr, "Entering state %d\n", yystate)); 00853 00854 goto yybackup; 00855 00856 00857 /*-----------. 00858 | yybackup. | 00859 `-----------*/ 00860 yybackup: 00861 00862 /* Do appropriate processing given the current state. */ 00863 /* Read a lookahead token if we need one and don't already have one. */ 00864 /* yyresume: */ 00865 00866 /* First try to decide what to do without reference to lookahead token. */ 00867 00868 yyn = yypact[yystate]; 00869 if (yyn == YYFLAG) 00870 goto yydefault; 00871 00872 /* Not known => get a lookahead token if don't already have one. */ 00873 00874 /* yychar is either YYEMPTY or YYEOF 00875 or a valid token in external form. */ 00876 00877 if (yychar == YYEMPTY) 00878 { 00879 YYDPRINTF ((stderr, "Reading a token: ")); 00880 yychar = YYLEX; 00881 } 00882 00883 /* Convert token to internal form (in yychar1) for indexing tables with */ 00884 00885 if (yychar <= 0) /* This means end of input. */ 00886 { 00887 yychar1 = 0; 00888 yychar = YYEOF; /* Don't call YYLEX any more */ 00889 00890 YYDPRINTF ((stderr, "Now at end of input.\n")); 00891 } 00892 else 00893 { 00894 yychar1 = YYTRANSLATE (yychar); 00895 00896 #if YYDEBUG 00897 /* We have to keep this `#if YYDEBUG', since we use variables 00898 which are defined only if `YYDEBUG' is set. */ 00899 if (yydebug) 00900 { 00901 YYFPRINTF (stderr, "Next token is %d (%s", 00902 yychar, yytname[yychar1]); 00903 /* Give the individual parser a way to print the precise 00904 meaning of a token, for further debugging info. */ 00905 # ifdef YYPRINT 00906 YYPRINT (stderr, yychar, yylval); 00907 # endif 00908 YYFPRINTF (stderr, ")\n"); 00909 } 00910 #endif 00911 } 00912 00913 yyn += yychar1; 00914 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1) 00915 goto yydefault; 00916 00917 yyn = yytable[yyn]; 00918 00919 /* yyn is what to do for this token type in this state. 00920 Negative => reduce, -yyn is rule number. 00921 Positive => shift, yyn is new state. 00922 New state is final state => don't bother to shift, 00923 just return success. 00924 0, or most negative number => error. */ 00925 00926 if (yyn < 0) 00927 { 00928 if (yyn == YYFLAG) 00929 goto yyerrlab; 00930 yyn = -yyn; 00931 goto yyreduce; 00932 } 00933 else if (yyn == 0) 00934 goto yyerrlab; 00935 00936 if (yyn == YYFINAL) 00937 YYACCEPT; 00938 00939 /* Shift the lookahead token. */ 00940 YYDPRINTF ((stderr, "Shifting token %d (%s), ", 00941 yychar, yytname[yychar1])); 00942 00943 /* Discard the token being shifted unless it is eof. */ 00944 if (yychar != YYEOF) 00945 yychar = YYEMPTY; 00946 00947 *++yyvsp = yylval; 00948 #if YYLSP_NEEDED 00949 *++yylsp = yylloc; 00950 #endif 00951 00952 /* Count tokens shifted since error; after three, turn off error 00953 status. */ 00954 if (yyerrstatus) 00955 yyerrstatus--; 00956 00957 yystate = yyn; 00958 goto yynewstate; 00959 00960 00961 /*-----------------------------------------------------------. 00962 | yydefault -- do the default action for the current state. | 00963 `-----------------------------------------------------------*/ 00964 yydefault: 00965 yyn = yydefact[yystate]; 00966 if (yyn == 0) 00967 goto yyerrlab; 00968 goto yyreduce; 00969 00970 00971 /*-----------------------------. 00972 | yyreduce -- Do a reduction. | 00973 `-----------------------------*/ 00974 yyreduce: 00975 /* yyn is the number of a rule to reduce with. */ 00976 yylen = yyr2[yyn]; 00977 00978 /* If YYLEN is nonzero, implement the default value of the action: 00979 `$$ = $1'. 00980 00981 Otherwise, the following line sets YYVAL to the semantic value of 00982 the lookahead token. This behavior is undocumented and Bison 00983 users should not rely upon it. Assigning to YYVAL 00984 unconditionally makes the parser a bit smaller, and it avoids a 00985 GCC warning that YYVAL may be used uninitialized. */ 00986 yyval = yyvsp[1-yylen]; 00987 00988 #if YYLSP_NEEDED 00989 /* Similarly for the default location. Let the user run additional 00990 commands if for instance locations are ranges. */ 00991 yyloc = yylsp[1-yylen]; 00992 YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen); 00993 #endif 00994 00995 #if YYDEBUG 00996 /* We have to keep this `#if YYDEBUG', since we use variables which 00997 are defined only if `YYDEBUG' is set. */ 00998 if (yydebug) 00999 { 01000 int yyi; 01001 01002 YYFPRINTF (stderr, "Reducing via rule %d (line %d), ", 01003 yyn, yyrline[yyn]); 01004 01005 /* Print the symbols being reduced, and their result. */ 01006 for (yyi = yyprhs[yyn]; yyrhs[yyi] > 0; yyi++) 01007 YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]); 01008 YYFPRINTF (stderr, " -> %s\n", yytname[yyr1[yyn]]); 01009 } 01010 #endif 01011 01012 switch (yyn) { 01013 01014 case 1: 01015 #line 130 "ast_expr.y" 01016 { ((struct parser_control *)kota)->result = yyval.val; ; 01017 break;} 01018 case 3: 01019 #line 134 "ast_expr.y" 01020 { 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;; 01021 break;} 01022 case 4: 01023 #line 135 "ast_expr.y" 01024 { 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;; 01025 break;} 01026 case 5: 01027 #line 136 "ast_expr.y" 01028 { 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;; 01029 break;} 01030 case 6: 01031 #line 137 "ast_expr.y" 01032 { 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;; 01033 break;} 01034 case 7: 01035 #line 138 "ast_expr.y" 01036 { 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;; 01037 break;} 01038 case 8: 01039 #line 139 "ast_expr.y" 01040 { 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;; 01041 break;} 01042 case 9: 01043 #line 140 "ast_expr.y" 01044 { 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;; 01045 break;} 01046 case 10: 01047 #line 141 "ast_expr.y" 01048 { 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;; 01049 break;} 01050 case 11: 01051 #line 142 "ast_expr.y" 01052 { 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;; 01053 break;} 01054 case 12: 01055 #line 143 "ast_expr.y" 01056 { 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;; 01057 break;} 01058 case 13: 01059 #line 144 "ast_expr.y" 01060 { 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;; 01061 break;} 01062 case 14: 01063 #line 145 "ast_expr.y" 01064 { 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;; 01065 break;} 01066 case 15: 01067 #line 146 "ast_expr.y" 01068 { 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;; 01069 break;} 01070 case 16: 01071 #line 147 "ast_expr.y" 01072 { 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;; 01073 break;} 01074 case 17: 01075 #line 148 "ast_expr.y" 01076 { 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;; 01077 break;} 01078 } 01079 01080 #line 705 "/usr/share/bison/bison.simple" 01081 01082 01083 yyvsp -= yylen; 01084 yyssp -= yylen; 01085 #if YYLSP_NEEDED 01086 yylsp -= yylen; 01087 #endif 01088 01089 #if YYDEBUG 01090 if (yydebug) 01091 { 01092 short *yyssp1 = yyss - 1; 01093 YYFPRINTF (stderr, "state stack now"); 01094 while (yyssp1 != yyssp) 01095 YYFPRINTF (stderr, " %d", *++yyssp1); 01096 YYFPRINTF (stderr, "\n"); 01097 } 01098 #endif 01099 01100 *++yyvsp = yyval; 01101 #if YYLSP_NEEDED 01102 *++yylsp = yyloc; 01103 #endif 01104 01105 /* Now `shift' the result of the reduction. Determine what state 01106 that goes to, based on the state we popped back to and the rule 01107 number reduced by. */ 01108 01109 yyn = yyr1[yyn]; 01110 01111 yystate = yypgoto[yyn - YYNTBASE] + *yyssp; 01112 if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp) 01113 yystate = yytable[yystate]; 01114 else 01115 yystate = yydefgoto[yyn - YYNTBASE]; 01116 01117 goto yynewstate; 01118 01119 01120 /*------------------------------------. 01121 | yyerrlab -- here on detecting error | 01122 `------------------------------------*/ 01123 yyerrlab: 01124 /* If not already recovering from an error, report this error. */ 01125 if (!yyerrstatus) 01126 { 01127 ++yynerrs; 01128 01129 #ifdef YYERROR_VERBOSE 01130 yyn = yypact[yystate]; 01131 01132 if (yyn > YYFLAG && yyn < YYLAST) 01133 { 01134 YYSIZE_T yysize = 0; 01135 char *yymsg; 01136 int yyx, yycount; 01137 01138 yycount = 0; 01139 /* Start YYX at -YYN if negative to avoid negative indexes in 01140 YYCHECK. */ 01141 for (yyx = yyn < 0 ? -yyn : 0; 01142 yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++) 01143 if (yycheck[yyx + yyn] == yyx) 01144 yysize += yystrlen (yytname[yyx]) + 15, yycount++; 01145 yysize += yystrlen ("parse error, unexpected ") + 1; 01146 yysize += yystrlen (yytname[YYTRANSLATE (yychar)]); 01147 yymsg = (char *) YYSTACK_ALLOC (yysize); 01148 if (yymsg != 0) 01149 { 01150 char *yyp = yystpcpy (yymsg, "parse error, unexpected "); 01151 yyp = yystpcpy (yyp, yytname[YYTRANSLATE (yychar)]); 01152 01153 if (yycount < 5) 01154 { 01155 yycount = 0; 01156 for (yyx = yyn < 0 ? -yyn : 0; 01157 yyx < (int) (sizeof (yytname) / sizeof (char *)); 01158 yyx++) 01159 if (yycheck[yyx + yyn] == yyx) 01160 { 01161 const char *yyq = ! yycount ? ", expecting " : " or "; 01162 yyp = yystpcpy (yyp, yyq); 01163 yyp = yystpcpy (yyp, yytname[yyx]); 01164 yycount++; 01165 } 01166 } 01167 yyerror (yymsg); 01168 YYSTACK_FREE (yymsg); 01169 } 01170 else 01171 yyerror ("parse error; also virtual memory exhausted"); 01172 } 01173 else 01174 #endif /* defined (YYERROR_VERBOSE) */ 01175 yyerror ("parse error"); 01176 } 01177 goto yyerrlab1; 01178 01179 01180 /*--------------------------------------------------. 01181 | yyerrlab1 -- error raised explicitly by an action | 01182 `--------------------------------------------------*/ 01183 yyerrlab1: 01184 if (yyerrstatus == 3) 01185 { 01186 /* If just tried and failed to reuse lookahead token after an 01187 error, discard it. */ 01188 01189 /* return failure if at end of input */ 01190 if (yychar == YYEOF) 01191 YYABORT; 01192 YYDPRINTF ((stderr, "Discarding token %d (%s).\n", 01193 yychar, yytname[yychar1])); 01194 yychar = YYEMPTY; 01195 } 01196 01197 /* Else will try to reuse lookahead token after shifting the error 01198 token. */ 01199 01200 yyerrstatus = 3; /* Each real token shifted decrements this */ 01201 01202 goto yyerrhandle; 01203 01204 01205 /*-------------------------------------------------------------------. 01206 | yyerrdefault -- current state does not do anything special for the | 01207 | error token. | 01208 `-------------------------------------------------------------------*/ 01209 yyerrdefault: 01210 #if 0 01211 /* This is wrong; only states that explicitly want error tokens 01212 should shift them. */ 01213 01214 /* If its default is to accept any token, ok. Otherwise pop it. */ 01215 yyn = yydefact[yystate]; 01216 if (yyn) 01217 goto yydefault; 01218 #endif 01219 01220 01221 /*---------------------------------------------------------------. 01222 | yyerrpop -- pop the current state because it cannot handle the | 01223 | error token | 01224 `---------------------------------------------------------------*/ 01225 yyerrpop: 01226 if (yyssp == yyss) 01227 YYABORT; 01228 yyvsp--; 01229 yystate = *--yyssp; 01230 #if YYLSP_NEEDED 01231 yylsp--; 01232 #endif 01233 01234 #if YYDEBUG 01235 if (yydebug) 01236 { 01237 short *yyssp1 = yyss - 1; 01238 YYFPRINTF (stderr, "Error: state stack now"); 01239 while (yyssp1 != yyssp) 01240 YYFPRINTF (stderr, " %d", *++yyssp1); 01241 YYFPRINTF (stderr, "\n"); 01242 } 01243 #endif 01244 01245 /*--------------. 01246 | yyerrhandle. | 01247 `--------------*/ 01248 yyerrhandle: 01249 yyn = yypact[yystate]; 01250 if (yyn == YYFLAG) 01251 goto yyerrdefault; 01252 01253 yyn += YYTERROR; 01254 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR) 01255 goto yyerrdefault; 01256 01257 yyn = yytable[yyn]; 01258 if (yyn < 0) 01259 { 01260 if (yyn == YYFLAG) 01261 goto yyerrpop; 01262 yyn = -yyn; 01263 goto yyreduce; 01264 } 01265 else if (yyn == 0) 01266 goto yyerrpop; 01267 01268 if (yyn == YYFINAL) 01269 YYACCEPT; 01270 01271 YYDPRINTF ((stderr, "Shifting error token, ")); 01272 01273 *++yyvsp = yylval; 01274 #if YYLSP_NEEDED 01275 *++yylsp = yylloc; 01276 #endif 01277 01278 yystate = yyn; 01279 goto yynewstate; 01280 01281 01282 /*-------------------------------------. 01283 | yyacceptlab -- YYACCEPT comes here. | 01284 `-------------------------------------*/ 01285 yyacceptlab: 01286 yyresult = 0; 01287 goto yyreturn; 01288 01289 /*-----------------------------------. 01290 | yyabortlab -- YYABORT comes here. | 01291 `-----------------------------------*/ 01292 yyabortlab: 01293 yyresult = 1; 01294 goto yyreturn; 01295 01296 /*---------------------------------------------. 01297 | yyoverflowab -- parser overflow comes here. | 01298 `---------------------------------------------*/ 01299 yyoverflowlab: 01300 yyerror ("parser stack overflow"); 01301 yyresult = 2; 01302 /* Fall through. */ 01303 01304 yyreturn: 01305 #ifndef yyoverflow 01306 if (yyss != yyssa) 01307 YYSTACK_FREE (yyss); 01308 #endif 01309 return yyresult; 01310 }


Generated on Sat Jun 12 16:41:02 2004 for Asterisk by doxygen 1.3.7