47 #define YYBISON_VERSION "2.5"
50 #define YYSKELETON_NAME "yacc.c"
62 #define YYLSP_NEEDED 1
65 #define yyparse ast_yyparse
66 #define yylex ast_yylex
67 #define yyerror ast_yyerror
68 #define yylval ast_yylval
69 #define yychar ast_yychar
70 #define yydebug ast_yydebug
71 #define yynerrs ast_yynerrs
72 #define yylloc ast_yylloc
94 #include <sys/types.h>
97 #if !defined(STANDALONE) && !defined(STANDALONE2) \
102 #define __USE_ISOC99 1
107 #define FP___PRINTF "%.18Lg"
108 #define FP___TYPE long double
110 #define FP___PRINTF "%.16g"
111 #define FP___TYPE double
115 #define FUNC_COS cosl
116 #elif defined(HAVE_COS)
117 #define FUNC_COS (long double)cos
121 #define FUNC_SIN sinl
122 #elif defined(HAVE_SIN)
123 #define FUNC_SIN (long double)sin
127 #define FUNC_TAN tanl
128 #elif defined(HAVE_TAN)
129 #define FUNC_TAN (long double)tan
133 #define FUNC_ACOS acosl
134 #elif defined(HAVE_ACOS)
135 #define FUNC_ACOS (long double)acos
139 #define FUNC_ASIN asinl
140 #elif defined(HAVE_ASIN)
141 #define FUNC_ASIN (long double)asin
145 #define FUNC_ATAN atanl
146 #elif defined(HAVE_ATAN)
147 #define FUNC_ATAN (long double)atan
151 #define FUNC_ATAN2 atan2l
152 #elif defined(HAVE_ATAN2)
153 #define FUNC_ATAN2 (long double)atan2
157 #define FUNC_POW powl
158 #elif defined(HAVE_POW)
159 #define FUNC_POW (long double)pow
163 #define FUNC_SQRT sqrtl
164 #elif defined(HAVE_SQRT)
165 #define FUNC_SQRT (long double)sqrt
169 #define FUNC_RINT rintl
170 #elif defined(HAVE_RINT)
171 #define FUNC_RINT (long double)rint
175 #define FUNC_EXP expl
176 #elif defined(HAVE_EXP)
177 #define FUNC_EXP (long double)exp
181 #define FUNC_LOG logl
182 #elif defined(HAVE_LOG)
183 #define FUNC_LOG (long double)log
186 #ifdef HAVE_REMAINDERL
187 #define FUNC_REMAINDER remainderl
188 #elif defined(HAVE_REMAINDER)
189 #define FUNC_REMAINDER (long double)remainder
193 #define FUNC_FMOD fmodl
194 #elif defined(HAVE_FMOD)
195 #define FUNC_FMOD (long double)fmod
199 #define FUNC_STRTOD strtold
200 #elif defined(HAVE_STRTOD)
201 #define FUNC_STRTOD (long double)strtod
205 #define FUNC_FLOOR floorl
206 #elif defined(HAVE_FLOOR)
207 #define FUNC_FLOOR (long double)floor
211 #define FUNC_CEIL ceill
212 #elif defined(HAVE_CEIL)
213 #define FUNC_CEIL (long double)ceil
217 #define FUNC_ROUND roundl
218 #elif defined(HAVE_ROUND)
219 #define FUNC_ROUND (long double)round
223 #define FUNC_TRUNC truncl
224 #elif defined(HAVE_TRUNC)
225 #define FUNC_TRUNC (long double)trunc
233 #define FUNC_EXP2 exp2l
234 #elif (defined(HAVE_EXPL) && defined(HAVE_LOGL))
235 #define FUNC_EXP2(x) expl((x) * logl(2.0))
236 #elif (defined(HAVE_EXP) && defined(HAVE_LOG))
237 #define FUNC_EXP2(x) (long double)exp((x) * log(2.0))
241 #define FUNC_EXP10 exp10l
242 #elif (defined(HAVE_EXPL) && defined(HAVE_LOGL))
243 #define FUNC_EXP10(x) expl((x) * logl(10.0))
244 #elif (defined(HAVE_EXP) && defined(HAVE_LOG))
245 #define FUNC_EXP10(x) (long double)exp((x) * log(10.0))
249 #define FUNC_LOG2 log2l
250 #elif defined(HAVE_LOGL)
251 #define FUNC_LOG2(x) (logl(x) / logl(2.0))
252 #elif defined(HAVE_LOG10L)
253 #define FUNC_LOG2(x) (log10l(x) / log10l(2.0))
254 #elif defined(HAVE_LOG2)
255 #define FUNC_LOG2 (long double)log2
256 #elif defined(HAVE_LOG)
257 #define FUNC_LOG2(x) ((long double)log(x) / log(2.0))
261 #define FUNC_LOG10 log10l
262 #elif defined(HAVE_LOGL)
263 #define FUNC_LOG10(x) (logl(x) / logl(10.0))
264 #elif defined(HAVE_LOG2L)
265 #define FUNC_LOG10(x) (log2l(x) / log2l(10.0))
266 #elif defined(HAVE_LOG10)
267 #define FUNC_LOG10(x) (long double)log10(x)
268 #elif defined(HAVE_LOG)
269 #define FUNC_LOG10(x) ((long double)log(x) / log(10.0))
282 #if !defined(SOLARIS) && !defined(__CYGWIN__)
285 #define quad_t int64_t
293 #if !defined(STANDALONE) && !defined(STANDALONE2)
297 #if defined(LONG_LONG_MIN) && !defined(QUAD_MIN)
298 #define QUAD_MIN LONG_LONG_MIN
300 #if defined(LONG_LONG_MAX) && !defined(QUAD_MAX)
301 #define QUAD_MAX LONG_LONG_MAX
304 # if ! defined(QUAD_MIN)
305 # define QUAD_MIN (-0x7fffffffffffffffLL-1)
307 # if ! defined(QUAD_MAX)
308 # define QUAD_MAX (0x7fffffffffffffffLL)
310 #define YYENABLE_NLS 0
311 #define YYPARSE_PARAM parseio
312 #define YYLEX_PARAM ((struct parse_io *)parseio)->scanner
313 #define YYERROR_VERBOSE 1
321 #if defined(STANDALONE) || defined(STANDALONE2)
322 void ast_log(
int level,
const char *file,
int line,
const char *
function,
const char *fmt, ...) __attribute__ ((
format (printf,5,6)));
400 # define YYLTYPE yyltype
401 # define YYLTYPE_IS_TRIVIAL 1
411 #define ast_yyerror(x) ast_yyerror(x,&yyloc,parseio)
412 #define DESTROY(x) {if((x)->type == AST_EXPR_numeric_string || (x)->type == AST_EXPR_string) free((x)->u.s); (x)->u.s = 0; free(x);}
416 #line 417 "ast_expr2.c"
424 #ifdef YYERROR_VERBOSE
425 # undef YYERROR_VERBOSE
426 # define YYERROR_VERBOSE 1
428 # define YYERROR_VERBOSE 0
432 #ifndef YYTOKEN_TABLE
433 # define YYTOKEN_TABLE 0
471 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
476 #line 345 "ast_expr2.y"
484 #line 485 "ast_expr2.c"
486 # define YYSTYPE_IS_TRIVIAL 1
487 # define yystype YYSTYPE
488 # define YYSTYPE_IS_DECLARED 1
491 #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
499 # define yyltype YYLTYPE
500 # define YYLTYPE_IS_DECLARED 1
501 # define YYLTYPE_IS_TRIVIAL 1
508 #line 350 "ast_expr2.y"
514 #line 515 "ast_expr2.c"
528 #elif (defined __STDC__ || defined __C99__FUNC__ \
529 || defined __cplusplus || defined _MSC_VER)
548 # ifdef __SIZE_TYPE__
549 # define YYSIZE_T __SIZE_TYPE__
550 # elif defined size_t
551 # define YYSIZE_T size_t
552 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
553 || defined __cplusplus || defined _MSC_VER)
555 # define YYSIZE_T size_t
557 # define YYSIZE_T unsigned int
561 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
564 # if defined YYENABLE_NLS && YYENABLE_NLS
566 # include <libintl.h>
567 # define YY_(msgid) dgettext ("bison-runtime", msgid)
571 # define YY_(msgid) msgid
576 #if ! defined lint || defined __GNUC__
577 # define YYUSE(e) ((void) (e))
586 #if (defined __STDC__ || defined __C99__FUNC__ \
587 || defined __cplusplus || defined _MSC_VER)
600 #if ! defined yyoverflow || YYERROR_VERBOSE
604 # ifdef YYSTACK_USE_ALLOCA
605 # if YYSTACK_USE_ALLOCA
607 # define YYSTACK_ALLOC __builtin_alloca
608 # elif defined __BUILTIN_VA_ARG_INCR
611 # define YYSTACK_ALLOC __alloca
612 # elif defined _MSC_VER
614 # define alloca _alloca
616 # define YYSTACK_ALLOC alloca
617 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
618 || defined __cplusplus || defined _MSC_VER)
620 # ifndef EXIT_SUCCESS
621 # define EXIT_SUCCESS 0
628 # ifdef YYSTACK_ALLOC
630 # define YYSTACK_FREE(Ptr) do { ; } while (YYID (0))
631 # ifndef YYSTACK_ALLOC_MAXIMUM
636 # define YYSTACK_ALLOC_MAXIMUM 4032
639 # define YYSTACK_ALLOC YYMALLOC
640 # define YYSTACK_FREE YYFREE
641 # ifndef YYSTACK_ALLOC_MAXIMUM
642 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
644 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
645 && ! ((defined YYMALLOC || defined malloc) \
646 && (defined YYFREE || defined free)))
648 # ifndef EXIT_SUCCESS
649 # define EXIT_SUCCESS 0
653 # define YYMALLOC malloc
654 # if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
655 || defined __cplusplus || defined _MSC_VER)
661 # if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
662 || defined __cplusplus || defined _MSC_VER)
670 #if (! defined yyoverflow \
671 && (! defined __cplusplus \
672 || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
673 && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
684 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
688 # define YYSTACK_BYTES(N) \
689 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
690 + 2 * YYSTACK_GAP_MAXIMUM)
692 # define YYCOPY_NEEDED 1
699 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
702 YYSIZE_T yynewbytes; \
703 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
704 Stack = &yyptr->Stack_alloc; \
705 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
706 yyptr += yynewbytes / sizeof (*yyptr); \
712 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
716 # if defined __GNUC__ && 1 < __GNUC__
717 # define YYCOPY(To, From, Count) \
718 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
720 # define YYCOPY(To, From, Count) \
724 for (yyi = 0; yyi < (Count); yyi++) \
725 (To)[yyi] = (From)[yyi]; \
748 #define YYMAXUTOK 280
750 #define YYTRANSLATE(YYX) \
751 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
756 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
757 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
758 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
759 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
760 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
761 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
762 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
763 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
764 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
765 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
766 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
767 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
768 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
769 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
770 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
771 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
772 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
773 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
774 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
775 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
776 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
777 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
778 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
779 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
780 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
781 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
782 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
783 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
790 static const yytype_uint8 yyprhs[] =
792 0, 0, 3, 5, 6, 8, 12, 15, 20, 22,
793 26, 30, 34, 38, 42, 46, 50, 54, 58, 62,
794 66, 69, 72, 76, 80, 84, 88, 92, 98
798 static const yytype_int8 yyrhs[] =
800 27, 0, -1, 29, -1, -1, 29, -1, 28, 3,
801 29, -1, 28, 3, -1, 25, 23, 28, 24, -1,
802 25, -1, 23, 29, 24, -1, 29, 6, 29, -1,
803 29, 7, 29, -1, 29, 13, 29, -1, 29, 12,
804 29, -1, 29, 11, 29, -1, 29, 10, 29, -1,
805 29, 9, 29, -1, 29, 8, 29, -1, 29, 15,
806 29, -1, 29, 14, 29, -1, 14, 29, -1, 19,
807 29, -1, 29, 18, 29, -1, 29, 17, 29, -1,
808 29, 16, 29, -1, 29, 22, 29, -1, 29, 21,
809 29, -1, 29, 5, 29, 4, 29, -1, 29, 20,
814 static const yytype_uint16 yyrline[] =
816 0, 374, 374, 382, 389, 390, 396, 405, 411, 412,
817 416, 420, 424, 428, 432, 436, 440, 444, 448, 452,
818 456, 460, 464, 468, 472, 476, 480, 484, 489
822 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
827 "$end",
"error",
"$undefined",
"TOK_COMMA",
"TOK_COLONCOLON",
828 "TOK_COND",
"TOK_OR",
"TOK_AND",
"TOK_NE",
"TOK_LE",
"TOK_GE",
"TOK_LT",
829 "TOK_GT",
"TOK_EQ",
"TOK_MINUS",
"TOK_PLUS",
"TOK_MOD",
"TOK_DIV",
830 "TOK_MULT",
"TOK_COMPL",
"TOK_TILDETILDE",
"TOK_EQTILDE",
"TOK_COLON",
831 "TOK_LP",
"TOK_RP",
"TOKEN",
"$accept",
"start",
"arglist",
"expr", 0
838 static const yytype_uint16 yytoknum[] =
840 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
841 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
842 275, 276, 277, 278, 279, 280
847 static const yytype_uint8
yyr1[] =
849 0, 26, 27, 27, 28, 28, 28, 29, 29, 29,
850 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
851 29, 29, 29, 29, 29, 29, 29, 29, 29
855 static const yytype_uint8
yyr2[] =
857 0, 2, 1, 0, 1, 3, 2, 4, 1, 3,
858 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
859 2, 2, 3, 3, 3, 3, 3, 5, 3
867 3, 0, 0, 0, 8, 0, 2, 20, 21, 0,
868 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,
869 0, 0, 0, 0, 0, 0, 0, 0, 0, 9,
870 0, 4, 0, 10, 11, 17, 16, 15, 14, 13,
871 12, 19, 18, 24, 23, 22, 28, 26, 25, 6,
883 #define YYPACT_NINF -18
886 118, 118, 118, 118, -15, 6, 65, -17, -17, 25,
887 118, -18, 118, 118, 118, 118, 118, 118, 118, 118,
888 118, 118, 118, 118, 118, 118, 118, 118, 118, -18,
889 4, 65, 47, 98, 113, 130, 130, 130, 130, 130,
890 130, 137, 137, -17, -17, -17, -18, -18, -18, 118,
903 #define YYTABLE_NINF -1
906 7, 8, 9, 26, 27, 28, 11, 49, 10, 31,
907 0, 32, 33, 34, 35, 36, 37, 38, 39, 40,
908 41, 42, 43, 44, 45, 46, 47, 48, 50, 0,
909 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
910 22, 23, 24, 25, 0, 26, 27, 28, 52, 29,
911 53, 51, 12, 13, 14, 15, 16, 17, 18, 19,
912 20, 21, 22, 23, 24, 25, 0, 26, 27, 28,
913 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
914 22, 23, 24, 25, 0, 26, 27, 28, 13, 14,
915 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
916 25, 0, 26, 27, 28, 14, 15, 16, 17, 18,
917 19, 20, 21, 22, 23, 24, 25, 0, 26, 27,
918 28, 15, 16, 17, 18, 19, 20, 21, 22, 23,
919 24, 25, 1, 26, 27, 28, 0, 2, 0, 0,
920 0, 3, 0, 4, 21, 22, 23, 24, 25, 0,
921 26, 27, 28, 23, 24, 25, 0, 26, 27, 28
924 #define yypact_value_is_default(yystate) \
927 #define yytable_value_is_error(yytable_value) \
932 1, 2, 3, 20, 21, 22, 0, 3, 23, 10,
933 -1, 12, 13, 14, 15, 16, 17, 18, 19, 20,
934 21, 22, 23, 24, 25, 26, 27, 28, 24, -1,
935 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
936 15, 16, 17, 18, -1, 20, 21, 22, 49, 24,
937 51, 4, 5, 6, 7, 8, 9, 10, 11, 12,
938 13, 14, 15, 16, 17, 18, -1, 20, 21, 22,
939 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
940 15, 16, 17, 18, -1, 20, 21, 22, 6, 7,
941 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
942 18, -1, 20, 21, 22, 7, 8, 9, 10, 11,
943 12, 13, 14, 15, 16, 17, 18, -1, 20, 21,
944 22, 8, 9, 10, 11, 12, 13, 14, 15, 16,
945 17, 18, 14, 20, 21, 22, -1, 19, -1, -1,
946 -1, 23, -1, 25, 14, 15, 16, 17, 18, -1,
947 20, 21, 22, 16, 17, 18, -1, 20, 21, 22
954 0, 14, 19, 23, 25, 27, 29, 29, 29, 29,
955 23, 0, 5, 6, 7, 8, 9, 10, 11, 12,
956 13, 14, 15, 16, 17, 18, 20, 21, 22, 24,
957 28, 29, 29, 29, 29, 29, 29, 29, 29, 29,
958 29, 29, 29, 29, 29, 29, 29, 29, 29, 3,
962 #define yyerrok (yyerrstatus = 0)
963 #define yyclearin (yychar = YYEMPTY)
967 #define YYACCEPT goto yyacceptlab
968 #define YYABORT goto yyabortlab
969 #define YYERROR goto yyerrorlab
979 #define YYFAIL goto yyerrlab
987 #define YYRECOVERING() (!!yyerrstatus)
989 #define YYBACKUP(Token, Value) \
991 if (yychar == YYEMPTY && yylen == 1) \
1000 yyerror (YY_("syntax error: cannot back up")); \
1007 #define YYERRCODE 256
1014 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
1015 #ifndef YYLLOC_DEFAULT
1016 # define YYLLOC_DEFAULT(Current, Rhs, N) \
1020 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
1021 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
1022 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
1023 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
1027 (Current).first_line = (Current).last_line = \
1028 YYRHSLOC (Rhs, 0).last_line; \
1029 (Current).first_column = (Current).last_column = \
1030 YYRHSLOC (Rhs, 0).last_column; \
1040 #ifndef YY_LOCATION_PRINT
1041 # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
1042 # define YY_LOCATION_PRINT(File, Loc) \
1043 fprintf (File, "%d.%d-%d.%d", \
1044 (Loc).first_line, (Loc).first_column, \
1045 (Loc).last_line, (Loc).last_column)
1047 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
1055 # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
1057 # define YYLEX yylex (&yylval, &yylloc)
1065 # define YYFPRINTF fprintf
1068 # define YYDPRINTF(Args) \
1074 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
1078 YYFPRINTF (stderr, "%s ", Title); \
1079 yy_symbol_print (stderr, \
1080 Type, Value, Location); \
1081 YYFPRINTF (stderr, "\n"); \
1091 #if (defined __STDC__ || defined __C99__FUNC__ \
1092 || defined __cplusplus || defined _MSC_VER)
1097 yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp)
1100 YYSTYPE const * const yyvaluep;
1101 YYLTYPE const * const yylocationp;
1106 YYUSE (yylocationp);
1109 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
1125 #if (defined __STDC__ || defined __C99__FUNC__ \
1126 || defined __cplusplus || defined _MSC_VER)
1128 yy_symbol_print (FILE *yyoutput,
int yytype,
YYSTYPE const *
const yyvaluep,
YYLTYPE const *
const yylocationp)
1131 yy_symbol_print (yyoutput, yytype, yyvaluep, yylocationp)
1134 YYSTYPE const * const yyvaluep;
1135 YYLTYPE const * const yylocationp;
1139 YYFPRINTF (yyoutput,
"token %s (", yytname[yytype]);
1141 YYFPRINTF (yyoutput,
"nterm %s (", yytname[yytype]);
1144 YYFPRINTF (yyoutput,
": ");
1145 yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp);
1146 YYFPRINTF (yyoutput,
")");
1154 #if (defined __STDC__ || defined __C99__FUNC__ \
1155 || defined __cplusplus || defined _MSC_VER)
1157 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
1160 yy_stack_print (yybottom, yytop)
1161 yytype_int16 *yybottom;
1162 yytype_int16 *yytop;
1165 YYFPRINTF (stderr,
"Stack now");
1166 for (; yybottom <= yytop; yybottom++)
1168 int yybot = *yybottom;
1169 YYFPRINTF (stderr,
" %d", yybot);
1171 YYFPRINTF (stderr,
"\n");
1174 # define YY_STACK_PRINT(Bottom, Top) \
1177 yy_stack_print ((Bottom), (Top)); \
1185 #if (defined __STDC__ || defined __C99__FUNC__ \
1186 || defined __cplusplus || defined _MSC_VER)
1191 yy_reduce_print (yyvsp, yylsp, yyrule)
1197 int yynrhs = yyr2[yyrule];
1199 unsigned long int yylno = yyrline[yyrule];
1200 YYFPRINTF (stderr,
"Reducing stack by rule %d (line %lu):\n",
1203 for (yyi = 0; yyi < yynrhs; yyi++)
1205 YYFPRINTF (stderr,
" $%d = ", yyi + 1);
1206 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
1207 &(yyvsp[(yyi + 1) - (yynrhs)])
1208 , &(yylsp[(yyi + 1) - (yynrhs)]) );
1209 YYFPRINTF (stderr,
"\n");
1213 # define YY_REDUCE_PRINT(Rule) \
1216 yy_reduce_print (yyvsp, yylsp, Rule); \
1223 # define YYDPRINTF(Args)
1224 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1225 # define YY_STACK_PRINT(Bottom, Top)
1226 # define YY_REDUCE_PRINT(Rule)
1232 # define YYINITDEPTH 200
1243 # define YYMAXDEPTH 10000
1250 # if defined __GLIBC__ && defined _STRING_H
1251 # define yystrlen strlen
1254 #if (defined __STDC__ || defined __C99__FUNC__ \
1255 || defined __cplusplus || defined _MSC_VER)
1257 yystrlen (
const char *
yystr)
1265 for (yylen = 0; yystr[
yylen]; yylen++)
1273 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1274 # define yystpcpy stpcpy
1278 #if (defined __STDC__ || defined __C99__FUNC__ \
1279 || defined __cplusplus || defined _MSC_VER)
1284 yystpcpy (yydest, yysrc)
1292 while ((*yyd++ = *yys++) !=
'\0')
1314 char const *yyp =
yystr;
1321 goto do_not_strip_quotes;
1325 goto do_not_strip_quotes;
1338 do_not_strip_quotes: ;
1342 return yystrlen (yystr);
1344 return yystpcpy (yyres, yystr) - yyres;
1363 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1365 const char *yyformat = 0;
1367 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1402 yyarg[yycount++] = yytname[
yytoken];
1408 int yyxbegin = yyn < 0 ? -yyn : 0;
1410 int yychecklim =
YYLAST - yyn + 1;
1414 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1415 if (yycheck[yyx + yyn] == yyx && yyx !=
YYTERROR
1418 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1424 yyarg[yycount++] = yytname[yyx];
1425 yysize1 = yysize +
yytnamerr (0, yytname[yyx]);
1426 if (! (yysize <= yysize1
1436 # define YYCASE_(N, S) \
1441 YYCASE_(1,
YY_(
"syntax error, unexpected %s"));
1442 YYCASE_(2,
YY_(
"syntax error, unexpected %s, expecting %s"));
1443 YYCASE_(3,
YY_(
"syntax error, unexpected %s, expecting %s or %s"));
1444 YYCASE_(4,
YY_(
"syntax error, unexpected %s, expecting %s or %s or %s"));
1445 YYCASE_(5,
YY_(
"syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1449 yysize1 = yysize + yystrlen (yyformat);
1454 if (*yymsg_alloc < yysize)
1456 *yymsg_alloc = 2 * yysize;
1457 if (! (yysize <= *yymsg_alloc
1469 while ((*yyp = *yyformat) !=
'\0')
1470 if (*yyp ==
'%' && yyformat[1] ==
's' && yyi < yycount)
1490 #if (defined __STDC__ || defined __C99__FUNC__ \
1491 || defined __cplusplus || defined _MSC_VER)
1496 yydestruct (yymsg, yytype, yyvaluep, yylocationp)
1504 YYUSE (yylocationp);
1515 #line 368 "ast_expr2.y"
1519 #line 1520 "ast_expr2.c"
1524 #line 368 "ast_expr2.y"
1528 #line 1529 "ast_expr2.c"
1533 #line 368 "ast_expr2.y"
1537 #line 1538 "ast_expr2.c"
1542 #line 368 "ast_expr2.y"
1546 #line 1547 "ast_expr2.c"
1551 #line 368 "ast_expr2.y"
1555 #line 1556 "ast_expr2.c"
1560 #line 368 "ast_expr2.y"
1564 #line 1565 "ast_expr2.c"
1569 #line 368 "ast_expr2.y"
1573 #line 1574 "ast_expr2.c"
1578 #line 368 "ast_expr2.y"
1582 #line 1583 "ast_expr2.c"
1587 #line 368 "ast_expr2.y"
1591 #line 1592 "ast_expr2.c"
1596 #line 368 "ast_expr2.y"
1600 #line 1601 "ast_expr2.c"
1605 #line 368 "ast_expr2.y"
1609 #line 1610 "ast_expr2.c"
1614 #line 368 "ast_expr2.y"
1618 #line 1619 "ast_expr2.c"
1623 #line 368 "ast_expr2.y"
1627 #line 1628 "ast_expr2.c"
1632 #line 368 "ast_expr2.y"
1636 #line 1637 "ast_expr2.c"
1641 #line 368 "ast_expr2.y"
1645 #line 1646 "ast_expr2.c"
1650 #line 368 "ast_expr2.y"
1654 #line 1655 "ast_expr2.c"
1659 #line 368 "ast_expr2.y"
1663 #line 1664 "ast_expr2.c"
1668 #line 368 "ast_expr2.y"
1672 #line 1673 "ast_expr2.c"
1677 #line 368 "ast_expr2.y"
1681 #line 1682 "ast_expr2.c"
1686 #line 368 "ast_expr2.y"
1690 #line 1691 "ast_expr2.c"
1695 #line 368 "ast_expr2.y"
1699 #line 1700 "ast_expr2.c"
1704 #line 368 "ast_expr2.y"
1708 #line 1709 "ast_expr2.c"
1713 #line 368 "ast_expr2.y"
1717 #line 1718 "ast_expr2.c"
1727 #ifdef YYPARSE_PARAM
1728 #if defined __STDC__ || defined __cplusplus
1734 #if defined __STDC__ || defined __cplusplus
1746 #ifdef YYPARSE_PARAM
1747 #if (defined __STDC__ || defined __C99__FUNC__ \
1748 || defined __cplusplus || defined _MSC_VER)
1754 void *YYPARSE_PARAM;
1757 #if (defined __STDC__ || defined __C99__FUNC__ \
1758 || defined __cplusplus || defined _MSC_VER)
1828 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
1840 YYDPRINTF ((stderr,
"Starting parse\n"));
1855 #if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
1874 if (yyss + yystacksize - 1 <= yyssp)
1877 YYSIZE_T yysize = yyssp - yyss + 1;
1885 yytype_int16 *yyss1 =
yyss;
1892 yyoverflow (
YY_(
"memory exhausted"),
1893 &yyss1, yysize *
sizeof (*yyssp),
1894 &yyvs1, yysize *
sizeof (*yyvsp),
1895 &yyls1, yysize *
sizeof (*yylsp),
1903 # ifndef YYSTACK_RELOCATE
1904 goto yyexhaustedlab;
1908 goto yyexhaustedlab;
1914 yytype_int16 *yyss1 =
yyss;
1918 goto yyexhaustedlab;
1922 # undef YYSTACK_RELOCATE
1929 yyssp = yyss + yysize - 1;
1930 yyvsp = yyvs + yysize - 1;
1931 yylsp = yyls + yysize - 1;
1933 YYDPRINTF ((stderr,
"Stack size increased to %lu\n",
1934 (
unsigned long int) yystacksize));
1936 if (yyss + yystacksize - 1 <= yyssp)
1940 YYDPRINTF ((stderr,
"Entering state %d\n", yystate));
1965 YYDPRINTF ((stderr,
"Reading a token: "));
1971 yychar = yytoken =
YYEOF;
1972 YYDPRINTF ((stderr,
"Now at end of input.\n"));
1983 if (yyn < 0 ||
YYLAST < yyn || yycheck[yyn] != yytoken)
2036 yyval = yyvsp[1-
yylen];
2046 #line 374 "ast_expr2.y"
2048 ((
struct parse_io *)parseio)->val->type = (yyvsp[(1) - (1)].
val)->
type;
2060 #line 382 "ast_expr2.y"
2070 #line 389 "ast_expr2.y"
2077 #line 390 "ast_expr2.y"
2081 for (t=(yyvsp[(1) - (3)].arglist);t->
right;t=t->
right)
2083 (yyval.
arglist) = (yyvsp[(1) - (3)].arglist); t->
right = x; x->
val = (yyvsp[(3) - (3)].
val);}
2089 #line 396 "ast_expr2.y"
2093 for (t=(yyvsp[(1) - (2)].arglist);t->
right;t=t->
right)
2101 #line 405 "ast_expr2.y"
2113 #line 411 "ast_expr2.y"
2114 {(yyval.
val) = (yyvsp[(1) - (1)].
val);}
2120 #line 412 "ast_expr2.y"
2121 { (yyval.
val) = (yyvsp[(2) - (3)].
val);
2122 (
yyloc).
first_column = (yylsp[(1) - (3)]).first_column; (
yyloc).last_column = (yylsp[(3) - (3)]).last_column;
2130 #line 416 "ast_expr2.y"
2131 { (yyval.
val) =
op_or ((yyvsp[(1) - (3)].
val), (yyvsp[(3) - (3)].
val));
2133 (
yyloc).
first_column = (yylsp[(1) - (3)]).first_column; (
yyloc).last_column = (yylsp[(3) - (3)]).last_column;
2140 #line 420 "ast_expr2.y"
2141 { (yyval.
val) =
op_and ((yyvsp[(1) - (3)].
val), (yyvsp[(3) - (3)].
val));
2143 (
yyloc).
first_column = (yylsp[(1) - (3)]).first_column; (
yyloc).last_column = (yylsp[(3) - (3)]).last_column;
2150 #line 424 "ast_expr2.y"
2151 { (yyval.
val) =
op_eq ((yyvsp[(1) - (3)].
val), (yyvsp[(3) - (3)].
val));
2153 (
yyloc).
first_column = (yylsp[(1) - (3)]).first_column; (
yyloc).last_column = (yylsp[(3) - (3)]).last_column;
2160 #line 428 "ast_expr2.y"
2161 { (yyval.
val) =
op_gt ((yyvsp[(1) - (3)].
val), (yyvsp[(3) - (3)].
val));
2163 (
yyloc).
first_column = (yylsp[(1) - (3)]).first_column; (
yyloc).last_column = (yylsp[(3) - (3)]).last_column;
2170 #line 432 "ast_expr2.y"
2171 { (yyval.
val) =
op_lt ((yyvsp[(1) - (3)].
val), (yyvsp[(3) - (3)].
val));
2173 (
yyloc).
first_column = (yylsp[(1) - (3)]).first_column; (
yyloc).last_column = (yylsp[(3) - (3)]).last_column;
2180 #line 436 "ast_expr2.y"
2181 { (yyval.
val) =
op_ge ((yyvsp[(1) - (3)].
val), (yyvsp[(3) - (3)].
val));
2183 (
yyloc).
first_column = (yylsp[(1) - (3)]).first_column; (
yyloc).last_column = (yylsp[(3) - (3)]).last_column;
2190 #line 440 "ast_expr2.y"
2191 { (yyval.
val) =
op_le ((yyvsp[(1) - (3)].
val), (yyvsp[(3) - (3)].
val));
2193 (
yyloc).
first_column = (yylsp[(1) - (3)]).first_column; (
yyloc).last_column = (yylsp[(3) - (3)]).last_column;
2200 #line 444 "ast_expr2.y"
2201 { (yyval.
val) =
op_ne ((yyvsp[(1) - (3)].
val), (yyvsp[(3) - (3)].
val));
2203 (
yyloc).
first_column = (yylsp[(1) - (3)]).first_column; (
yyloc).last_column = (yylsp[(3) - (3)]).last_column;
2210 #line 448 "ast_expr2.y"
2213 (
yyloc).
first_column = (yylsp[(1) - (3)]).first_column; (
yyloc).last_column = (yylsp[(3) - (3)]).last_column;
2220 #line 452 "ast_expr2.y"
2223 (
yyloc).
first_column = (yylsp[(1) - (3)]).first_column; (
yyloc).last_column = (yylsp[(3) - (3)]).last_column;
2230 #line 456 "ast_expr2.y"
2233 (
yyloc).
first_column = (yylsp[(1) - (2)]).first_column; (
yyloc).last_column = (yylsp[(2) - (2)]).last_column;
2240 #line 460 "ast_expr2.y"
2243 (
yyloc).
first_column = (yylsp[(1) - (2)]).first_column; (
yyloc).last_column = (yylsp[(2) - (2)]).last_column;
2250 #line 464 "ast_expr2.y"
2253 (
yyloc).
first_column = (yylsp[(1) - (3)]).first_column; (
yyloc).last_column = (yylsp[(3) - (3)]).last_column;
2260 #line 468 "ast_expr2.y"
2261 { (yyval.
val) =
op_div ((yyvsp[(1) - (3)].
val), (yyvsp[(3) - (3)].
val));
2263 (
yyloc).
first_column = (yylsp[(1) - (3)]).first_column; (
yyloc).last_column = (yylsp[(3) - (3)]).last_column;
2270 #line 472 "ast_expr2.y"
2271 { (yyval.
val) =
op_rem ((yyvsp[(1) - (3)].
val), (yyvsp[(3) - (3)].
val));
2273 (
yyloc).
first_column = (yylsp[(1) - (3)]).first_column; (
yyloc).last_column = (yylsp[(3) - (3)]).last_column;
2280 #line 476 "ast_expr2.y"
2283 (
yyloc).
first_column = (yylsp[(1) - (3)]).first_column; (
yyloc).last_column = (yylsp[(3) - (3)]).last_column;
2290 #line 480 "ast_expr2.y"
2293 (
yyloc).
first_column = (yylsp[(1) - (3)]).first_column; (
yyloc).last_column = (yylsp[(3) - (3)]).last_column;
2300 #line 484 "ast_expr2.y"
2301 { (yyval.
val) =
op_cond ((yyvsp[(1) - (5)].
val), (yyvsp[(3) - (5)].
val), (yyvsp[(5) - (5)].
val));
2304 (
yyloc).
first_column = (yylsp[(1) - (5)]).first_column; (
yyloc).last_column = (yylsp[(3) - (5)]).last_column;
2311 #line 489 "ast_expr2.y"
2314 (
yyloc).
first_column = (yylsp[(1) - (3)]).first_column; (
yyloc).last_column = (yylsp[(3) - (3)]).last_column;
2321 #line 2322 "ast_expr2.c"
2351 if (0 <= yystate && yystate <=
YYLAST && yycheck[yystate] == *yyssp)
2371 #if ! YYERROR_VERBOSE
2374 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
2377 char const *yymsgp =
YY_(
"syntax error");
2378 int yysyntax_error_status;
2380 if (yysyntax_error_status == 0)
2382 else if (yysyntax_error_status == 1)
2384 if (yymsg != yymsgbuf)
2391 yysyntax_error_status = 2;
2400 if (yysyntax_error_status == 2)
2401 goto yyexhaustedlab;
2403 # undef YYSYNTAX_ERROR
2407 yyerror_range[1] =
yylloc;
2409 if (yyerrstatus == 3)
2414 if (yychar <=
YYEOF)
2417 if (yychar ==
YYEOF)
2423 yytoken, &yylval, &yylloc);
2444 yyerror_range[1] = yylsp[1-
yylen];
2478 yyerror_range[1] = *
yylsp;
2480 yystos[yystate], yyvsp, yylsp);
2488 yyerror_range[2] =
yylloc;
2515 #if !defined(yyoverflow) || YYERROR_VERBOSE
2532 yytoken, &yylval, &yylloc);
2538 while (yyssp != yyss)
2541 yystos[*yyssp], yyvsp, yylsp);
2549 if (yymsg != yymsgbuf)
2553 return YYID (yyresult);
2559 #line 495 "ast_expr2.y"
2580 vp = (
struct val *)
malloc (
sizeof (*vp));
2598 vp = (
struct val *)
malloc (
sizeof (*vp));
2599 if (vp == NULL || ((vp->
u.
s =
strdup (s)) == NULL)) {
2607 for (i = 0, isint = (isdigit(s[0]) || s[0] ==
'-' || s[0]==
'.'); isint && i < strlen(s); i++)
2609 if (!isdigit(s[i]) && s[
i] !=
'.') {
2672 if( vp->
u.
s[0] ==
'"' && vp->
u.
s[strlen(vp->
u.
s)-1] ==
'"' )
2680 if( *f && *f !=
'"' )
2697 tmp =
malloc ((
size_t)25);
2721 return (vp->
u.
i == 0);
2730 void ast_log(
int level,
const char *file,
int line,
const char *
function,
const char *fmt, ...)
2735 printf(
"LOG: lev:%d file:%s line:%d func: %s ",
2736 level, file, line,
function);
2743 int main(
int argc,
char **argv) {
2751 if( access(argv[1],F_OK)== 0 )
2755 infile = fopen(argv[1],
"r");
2758 printf(
"Sorry, couldn't open %s for reading!\n", argv[1]);
2761 while( fgets(s,
sizeof(s),infile) )
2763 if( s[strlen(s)-1] ==
'\n' )
2766 ret =
ast_expr(s, out,
sizeof(out), NULL);
2767 printf(
"Expression: %s Result: [%d] '%s'\n",
2774 if (
ast_expr(argv[1], s,
sizeof(s), NULL))
2775 printf(
"=====%s======\n",s);
2777 printf(
"No result\n");
2785 #define ast_yyerror(x) ast_yyerror(x, YYLTYPE *yylloc, struct parse_io *parseio)
2798 arglist_next = arglist->
right;
2804 arglist = arglist_next;
2808 #if !defined(STANDALONE) && !defined(STANDALONE2)
2822 total_len += strlen(t->
val->
u.
s);
2829 argbuf =
malloc(total_len);
2841 strcat(argbuf,numbuf);
2843 strcat(argbuf,t->
val->
u.
s);
2853 if ( strspn(str,
"-0123456789. ") == strlen(str))
2862 if (strspn(funcname->
u.
s,
"ABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789") == strlen(funcname->
u.
s))
2867 }
else if (strcmp(funcname->
u.
s,
"COS") == 0) {
2868 if (arglist && !arglist->
right && arglist->
val){
2878 }
else if (strcmp(funcname->
u.
s,
"SIN") == 0) {
2879 if (arglist && !arglist->
right && arglist->
val){
2889 }
else if (strcmp(funcname->
u.
s,
"TAN") == 0) {
2890 if (arglist && !arglist->
right && arglist->
val){
2900 }
else if (strcmp(funcname->
u.
s,
"ACOS") == 0) {
2901 if (arglist && !arglist->
right && arglist->
val){
2911 }
else if (strcmp(funcname->
u.
s,
"ASIN") == 0) {
2912 if (arglist && !arglist->
right && arglist->
val){
2922 }
else if (strcmp(funcname->
u.
s,
"ATAN") == 0) {
2923 if (arglist && !arglist->
right && arglist->
val){
2933 }
else if (strcmp(funcname->
u.
s,
"ATAN2") == 0) {
2945 }
else if (strcmp(funcname->
u.
s,
"POW") == 0) {
2957 }
else if (strcmp(funcname->
u.
s,
"SQRT") == 0) {
2958 if (arglist && !arglist->
right && arglist->
val){
2968 }
else if (strcmp(funcname->
u.
s,
"FLOOR") == 0) {
2969 if (arglist && !arglist->
right && arglist->
val){
2979 }
else if (strcmp(funcname->
u.
s,
"CEIL") == 0) {
2980 if (arglist && !arglist->
right && arglist->
val){
2990 }
else if (strcmp(funcname->
u.
s,
"ROUND") == 0) {
2991 if (arglist && !arglist->
right && arglist->
val){
3001 }
else if (strcmp(funcname->
u.
s,
"RINT") == 0) {
3002 if (arglist && !arglist->
right && arglist->
val){
3012 }
else if (strcmp(funcname->
u.
s,
"TRUNC") == 0) {
3013 if (arglist && !arglist->
right && arglist->
val){
3023 }
else if (strcmp(funcname->
u.
s,
"EXP") == 0) {
3024 if (arglist && !arglist->
right && arglist->
val){
3034 }
else if (strcmp(funcname->
u.
s,
"EXP2") == 0) {
3035 if (arglist && !arglist->
right && arglist->
val){
3045 }
else if (strcmp(funcname->
u.
s,
"EXP10") == 0) {
3046 if (arglist && !arglist->
right && arglist->
val){
3056 }
else if (strcmp(funcname->
u.
s,
"LOG") == 0) {
3057 if (arglist && !arglist->
right && arglist->
val){
3067 }
else if (strcmp(funcname->
u.
s,
"LOG2") == 0) {
3068 if (arglist && !arglist->
right && arglist->
val){
3078 }
else if (strcmp(funcname->
u.
s,
"LOG10") == 0) {
3079 if (arglist && !arglist->
right && arglist->
val){
3088 #ifdef FUNC_REMAINDER
3089 }
else if (strcmp(funcname->
u.
s,
"REMAINDER") == 0) {
3102 #if !defined(STANDALONE) && !defined(STANDALONE2)
3111 char workspace[512];
3113 f->
read(chan, funcname->
u.
s, argbuf, workspace,
sizeof(workspace));
3125 ast_log(
LOG_ERROR,
"Error! '%s' doesn't appear to be an available function!\n", funcname->
u.
s);
3129 ast_log(
LOG_ERROR,
"Error! '%s' is not available in the standalone version!\n", funcname->
u.
s);
3178 #ifdef DEBUG_FOR_CONVERSIONS
3180 sprintf(buffer,
"Converting '%s' and '%s' ", a->
u.
s, b->
u.
s);
3184 #ifdef DEBUG_FOR_CONVERSIONS
3282 if( strlen(a->
u.
s) && strcmp(a->
u.
s,
"\"\"") != 0 && strcmp(a->
u.
s,
"0") != 0 )
3338 if (a > 0 && b > 0 && r <= 0)
3341 if (a < 0 && b < 0 && r >= 0)
3353 if( !extra_error_message_supplied )
3397 if( !extra_error_message_supplied )
3410 if( !extra_error_message_supplied )
3432 if( !extra_error_message_supplied )
3469 if( a->
u.
s[0] == 0 )
3471 else if (strlen(a->
u.
s) == 1 && a->
u.
s[0] ==
'0' )
3483 if( a->
u.
s[0] == 0 )
3485 else if (strlen(a->
u.
s) == 1 && a->
u.
s[0] ==
'0' )
3519 if( !extra_error_message_supplied )
3552 if( !extra_error_message_supplied )
3558 if( !extra_error_message_supplied )
3585 if( !extra_error_message_supplied )
3622 if ((eval = regcomp (&rp, b->
u.
s, REG_EXTENDED)) != 0) {
3623 regerror (eval, &rp, errbuf,
sizeof(errbuf));
3632 if (regexec(&rp, a->
u.
s, (
size_t)2, rm, 0) == 0 && rm[0].rm_so == 0) {
3633 if (rm[1].rm_so >= 0) {
3634 *(a->
u.
s + rm[1].rm_eo) =
'\0';
3641 if (rp.re_nsub == 0) {
3673 if ((eval = regcomp (&rp, b->
u.
s, REG_EXTENDED)) != 0) {
3674 regerror (eval, &rp, errbuf,
sizeof(errbuf));
3683 if (regexec(&rp, a->
u.
s, (
size_t)2, rm, 0) == 0 ) {
3684 if (rm[1].rm_so >= 0) {
3685 *(a->
u.
s + rm[1].rm_eo) =
'\0';
3692 if (rp.re_nsub == 0) {
3720 vs =
malloc(strlen(a->
u.
s)+strlen(b->
u.
s)+1);
static const yytype_uint8 yydefact[]
static struct val * op_gt(struct val *a, struct val *b)
Main Channel structure associated with a channel.
struct parse_io * parseio
Asterisk main include file. File version handling, generic pbx functions.
static struct val * op_ge(struct val *a, struct val *b)
unsigned char yytype_uint8
#define YYLLOC_DEFAULT(Current, Rhs, N)
int main(int argc, char *argv[])
static struct val * op_eqtilde(struct val *a, struct val *b)
#define YY_SYMBOL_PRINT(Title, Type, Value, Location)
static const yytype_uint8 yyr1[]
static struct val * op_rem(struct val *a, struct val *b)
static const yytype_uint8 yytable[]
yytype_int16 yyssa[YYINITDEPTH]
static int chk_times(FP___TYPE a, FP___TYPE b, FP___TYPE r)
YYSTYPE yyvsa[YYINITDEPTH]
static int yysyntax_error(YYSIZE_T *yymsg_alloc, char **yymsg, yytype_int16 *yyssp, int yytoken)
static const yytype_int16 yypact[]
#define YY_REDUCE_PRINT(Rule)
#define yypact_value_is_default(yystate)
static const yytype_int8 yydefgoto[]
int extra_error_message_supplied
static void to_string(struct val *vp)
static struct val * op_le(struct val *a, struct val *b)
int ast_yylex(YYSTYPE *yylval_param, YYLTYPE *yylloc_param, yyscan_t yyscanner)
#define YYSTACK_ALLOC_MAXIMUM
static struct val * op_colon(struct val *a, struct val *b)
static YYSIZE_T yytnamerr(char *yyres, const char *yystr)
struct expr_node * arglist
static struct expr_node * alloc_expr_node(enum node_type)
struct ast_channel * chan
static struct val * make_str(const char *s)
YYLTYPE yylsa[YYINITDEPTH]
static struct val * op_div(struct val *a, struct val *b)
static void destroy_arglist(struct expr_node *arglist)
static struct val * op_cond(struct val *a, struct val *b, struct val *c)
#define yytable_value_is_error(yytable_value)
static char *char * yydest
Data structure associated with a custom dialplan function.
static struct val * op_and(struct val *a, struct val *b)
static int chk_minus(FP___TYPE a, FP___TYPE b, FP___TYPE r)
static int chk_div __P((FP___TYPE, FP___TYPE))
static struct val * op_tildetilde(struct val *a, struct val *b)
Core PBX routines and definitions.
static const yytype_uint8 yytranslate[]
struct ast_custom_function * ast_custom_function_find(const char *name)
static char * compose_func_args(struct expr_node *arglist)
static int chk_div(FP___TYPE a, FP___TYPE b)
char extra_error_message[4095]
static struct val * op_func(struct val *funcname, struct expr_node *arglist, struct ast_channel *chan)
unsigned short int yytype_uint16
static int to_number(struct val *vp)
yydestruct("Cleanup: discarding lookahead", yytoken,&yylval,&yylloc)
static const yytype_uint8 yystos[]
static struct val * op_compl(struct val *a)
void ast_log(int level, const char *file, int line, const char *function, const char *fmt,...)
Used for sending a log message This is the standard logger function. Probably the only way you will i...
static void const char * yymsg
static int isstring(struct val *vp)
static struct val * op_minus(struct val *a, struct val *b)
static struct val * op_lt(struct val *a, struct val *b)
static const char *const yytname[]
#define YY_LOCATION_PRINT(File, Loc)
static int chk_plus(FP___TYPE a, FP___TYPE b, FP___TYPE r)
Support for logging to various files, console and syslog Configuration in file logger.conf.
static void free_value(struct val *vp)
#define YY_STACK_PRINT(Bottom, Top)
static struct val * op_plus(struct val *a, struct val *b)
static const yytype_int8 yypgoto[]
static const yytype_int8 yycheck[]
static struct val * op_ne(struct val *a, struct val *b)
static struct val * op_negate(struct val *a)
#define YYSTACK_RELOCATE(Stack_alloc, Stack)
static struct val * op_or(struct val *a, struct val *b)
static struct val * make_number(FP___TYPE i)
static struct val * op_times(struct val *a, struct val *b)
static snd_pcm_format_t format
static struct val * op_eq(struct val *a, struct val *b)
static const yytype_uint8 yyr2[]
int ast_expr(char *expr, char *buf, int length, struct ast_channel *chan)
Evaluate the given expression.
static int is_really_num(char *str)
static int is_zero_or_null(struct val *vp)
static void strip_quotes(struct val *vp)
#define ASTERISK_FILE_VERSION(file, version)
Register/unregister a source code file with the core.
static YYSIZE_T const char * yystr