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