49 #define YYBISON_VERSION "2.4.1" 52 #define YYSKELETON_NAME "yacc.c" 64 #define YYLSP_NEEDED 1 67 #define yyparse ast_yyparse 68 #define yylex ast_yylex 69 #define yyerror ast_yyerror 70 #define yylval ast_yylval 71 #define yychar ast_yychar 72 #define yydebug ast_yydebug 73 #define yynerrs ast_yynerrs 74 #define yylloc ast_yylloc 94 #define ASTMM_LIBC ASTMM_REDIRECT 97 #include <sys/types.h> 100 #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 419 "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 487 "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 517 "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) 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 _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ 618 || defined __cplusplus || defined _MSC_VER) 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 _STDLIB_H \ 645 && ! ((defined YYMALLOC || defined malloc) \ 646 && (defined YYFREE || defined free))) 653 # define YYMALLOC malloc 654 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ 655 || defined __cplusplus || defined _MSC_VER) 661 # if ! defined free && ! defined _STDLIB_H && (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) 695 # if defined __GNUC__ && 1 < __GNUC__ 696 # define YYCOPY(To, From, Count) \ 697 __builtin_memcpy (To, From, (Count) * sizeof (*(From))) 699 # define YYCOPY(To, From, Count) \ 703 for (yyi = 0; yyi < (Count); yyi++) \ 704 (To)[yyi] = (From)[yyi]; \ 715 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \ 718 YYSIZE_T yynewbytes; \ 719 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ 720 Stack = &yyptr->Stack_alloc; \ 721 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ 722 yyptr += yynewbytes / sizeof (*yyptr); \ 744 #define YYMAXUTOK 280 746 #define YYTRANSLATE(YYX) \ 747 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) 752 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
753 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
754 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
755 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
756 2, 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, 1, 2, 3, 4,
778 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
779 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
786 static const yytype_uint8 yyprhs[] =
788 0, 0, 3, 5, 6, 8, 12, 15, 20, 22,
789 26, 30, 34, 38, 42, 46, 50, 54, 58, 62,
790 66, 69, 72, 76, 80, 84, 88, 92, 98
794 static const yytype_int8 yyrhs[] =
796 27, 0, -1, 29, -1, -1, 29, -1, 28, 3,
797 29, -1, 28, 3, -1, 25, 23, 28, 24, -1,
798 25, -1, 23, 29, 24, -1, 29, 6, 29, -1,
799 29, 7, 29, -1, 29, 13, 29, -1, 29, 12,
800 29, -1, 29, 11, 29, -1, 29, 10, 29, -1,
801 29, 9, 29, -1, 29, 8, 29, -1, 29, 15,
802 29, -1, 29, 14, 29, -1, 14, 29, -1, 19,
803 29, -1, 29, 18, 29, -1, 29, 17, 29, -1,
804 29, 16, 29, -1, 29, 22, 29, -1, 29, 21,
805 29, -1, 29, 5, 29, 4, 29, -1, 29, 20,
810 static const yytype_uint16 yyrline[] =
812 0, 374, 374, 382, 389, 390, 396, 405, 411, 412,
813 416, 420, 424, 428, 432, 436, 440, 444, 448, 452,
814 456, 460, 464, 468, 472, 476, 480, 484, 489
818 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE 823 "$end",
"error",
"$undefined",
"TOK_COMMA",
"TOK_COLONCOLON",
824 "TOK_COND",
"TOK_OR",
"TOK_AND",
"TOK_NE",
"TOK_LE",
"TOK_GE",
"TOK_LT",
825 "TOK_GT",
"TOK_EQ",
"TOK_MINUS",
"TOK_PLUS",
"TOK_MOD",
"TOK_DIV",
826 "TOK_MULT",
"TOK_COMPL",
"TOK_TILDETILDE",
"TOK_EQTILDE",
"TOK_COLON",
827 "TOK_LP",
"TOK_RP",
"TOKEN",
"$accept",
"start",
"arglist",
"expr", 0
834 static const yytype_uint16 yytoknum[] =
836 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
837 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
838 275, 276, 277, 278, 279, 280
843 static const yytype_uint8
yyr1[] =
845 0, 26, 27, 27, 28, 28, 28, 29, 29, 29,
846 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
847 29, 29, 29, 29, 29, 29, 29, 29, 29
851 static const yytype_uint8
yyr2[] =
853 0, 2, 1, 0, 1, 3, 2, 4, 1, 3,
854 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
855 2, 2, 3, 3, 3, 3, 3, 5, 3
863 3, 0, 0, 0, 8, 0, 2, 20, 21, 0,
864 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,
865 0, 0, 0, 0, 0, 0, 0, 0, 0, 9,
866 0, 4, 0, 10, 11, 17, 16, 15, 14, 13,
867 12, 19, 18, 24, 23, 22, 28, 26, 25, 6,
879 #define YYPACT_NINF -18 882 118, 118, 118, 118, -15, 6, 65, -17, -17, 25,
883 118, -18, 118, 118, 118, 118, 118, 118, 118, 118,
884 118, 118, 118, 118, 118, 118, 118, 118, 118, -18,
885 4, 65, 47, 98, 113, 130, 130, 130, 130, 130,
886 130, 137, 137, -17, -17, -17, -18, -18, -18, 118,
900 #define YYTABLE_NINF -1 903 7, 8, 9, 26, 27, 28, 11, 49, 10, 31,
904 0, 32, 33, 34, 35, 36, 37, 38, 39, 40,
905 41, 42, 43, 44, 45, 46, 47, 48, 50, 0,
906 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
907 22, 23, 24, 25, 0, 26, 27, 28, 52, 29,
908 53, 51, 12, 13, 14, 15, 16, 17, 18, 19,
909 20, 21, 22, 23, 24, 25, 0, 26, 27, 28,
910 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
911 22, 23, 24, 25, 0, 26, 27, 28, 13, 14,
912 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
913 25, 0, 26, 27, 28, 14, 15, 16, 17, 18,
914 19, 20, 21, 22, 23, 24, 25, 0, 26, 27,
915 28, 15, 16, 17, 18, 19, 20, 21, 22, 23,
916 24, 25, 1, 26, 27, 28, 0, 2, 0, 0,
917 0, 3, 0, 4, 21, 22, 23, 24, 25, 0,
918 26, 27, 28, 23, 24, 25, 0, 26, 27, 28
923 1, 2, 3, 20, 21, 22, 0, 3, 23, 10,
924 -1, 12, 13, 14, 15, 16, 17, 18, 19, 20,
925 21, 22, 23, 24, 25, 26, 27, 28, 24, -1,
926 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
927 15, 16, 17, 18, -1, 20, 21, 22, 49, 24,
928 51, 4, 5, 6, 7, 8, 9, 10, 11, 12,
929 13, 14, 15, 16, 17, 18, -1, 20, 21, 22,
930 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
931 15, 16, 17, 18, -1, 20, 21, 22, 6, 7,
932 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
933 18, -1, 20, 21, 22, 7, 8, 9, 10, 11,
934 12, 13, 14, 15, 16, 17, 18, -1, 20, 21,
935 22, 8, 9, 10, 11, 12, 13, 14, 15, 16,
936 17, 18, 14, 20, 21, 22, -1, 19, -1, -1,
937 -1, 23, -1, 25, 14, 15, 16, 17, 18, -1,
938 20, 21, 22, 16, 17, 18, -1, 20, 21, 22
945 0, 14, 19, 23, 25, 27, 29, 29, 29, 29,
946 23, 0, 5, 6, 7, 8, 9, 10, 11, 12,
947 13, 14, 15, 16, 17, 18, 20, 21, 22, 24,
948 28, 29, 29, 29, 29, 29, 29, 29, 29, 29,
949 29, 29, 29, 29, 29, 29, 29, 29, 29, 3,
953 #define yyerrok (yyerrstatus = 0) 954 #define yyclearin (yychar = YYEMPTY) 958 #define YYACCEPT goto yyacceptlab 959 #define YYABORT goto yyabortlab 960 #define YYERROR goto yyerrorlab 967 #define YYFAIL goto yyerrlab 969 #define YYRECOVERING() (!!yyerrstatus) 971 #define YYBACKUP(Token, Value) \ 973 if (yychar == YYEMPTY && yylen == 1) \ 977 yytoken = YYTRANSLATE (yychar); \ 983 yyerror (YY_("syntax error: cannot back up")); \ 990 #define YYERRCODE 256 997 #define YYRHSLOC(Rhs, K) ((Rhs)[K]) 998 #ifndef YYLLOC_DEFAULT 999 # define YYLLOC_DEFAULT(Current, Rhs, N) \ 1003 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ 1004 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ 1005 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ 1006 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ 1010 (Current).first_line = (Current).last_line = \ 1011 YYRHSLOC (Rhs, 0).last_line; \ 1012 (Current).first_column = (Current).last_column = \ 1013 YYRHSLOC (Rhs, 0).last_column; \ 1023 #ifndef YY_LOCATION_PRINT 1024 # if YYLTYPE_IS_TRIVIAL 1025 # define YY_LOCATION_PRINT(File, Loc) \ 1026 fprintf (File, "%d.%d-%d.%d", \ 1027 (Loc).first_line, (Loc).first_column, \ 1028 (Loc).last_line, (Loc).last_column) 1030 # define YY_LOCATION_PRINT(File, Loc) ((void) 0) 1038 # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM) 1040 # define YYLEX yylex (&yylval, &yylloc) 1048 # define YYFPRINTF fprintf 1051 # define YYDPRINTF(Args) \ 1057 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ 1061 YYFPRINTF (stderr, "%s ", Title); \ 1062 yy_symbol_print (stderr, \ 1063 Type, Value, Location); \ 1064 YYFPRINTF (stderr, "\n"); \ 1074 #if (defined __STDC__ || defined __C99__FUNC__ \ 1075 || defined __cplusplus || defined _MSC_VER) 1077 yy_symbol_value_print (FILE *yyoutput,
int yytype,
YYSTYPE const *
const yyvaluep,
YYLTYPE const *
const yylocationp)
1080 yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp)
1083 YYSTYPE const *
const yyvaluep;
1084 YYLTYPE const *
const yylocationp;
1089 YYUSE (yylocationp);
1092 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
1108 #if (defined __STDC__ || defined __C99__FUNC__ \ 1109 || defined __cplusplus || defined _MSC_VER) 1111 yy_symbol_print (FILE *yyoutput,
int yytype,
YYSTYPE const *
const yyvaluep,
YYLTYPE const *
const yylocationp)
1114 yy_symbol_print (yyoutput, yytype, yyvaluep, yylocationp)
1117 YYSTYPE const *
const yyvaluep;
1118 YYLTYPE const *
const yylocationp;
1122 YYFPRINTF (yyoutput,
"token %s (", yytname[yytype]);
1124 YYFPRINTF (yyoutput,
"nterm %s (", yytname[yytype]);
1127 YYFPRINTF (yyoutput,
": ");
1128 yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp);
1129 YYFPRINTF (yyoutput,
")");
1137 #if (defined __STDC__ || defined __C99__FUNC__ \ 1138 || defined __cplusplus || defined _MSC_VER) 1140 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
1143 yy_stack_print (yybottom, yytop)
1144 yytype_int16 *yybottom;
1145 yytype_int16 *yytop;
1148 YYFPRINTF (stderr,
"Stack now");
1149 for (; yybottom <= yytop; yybottom++)
1151 int yybot = *yybottom;
1152 YYFPRINTF (stderr,
" %d", yybot);
1154 YYFPRINTF (stderr,
"\n");
1157 # define YY_STACK_PRINT(Bottom, Top) \ 1160 yy_stack_print ((Bottom), (Top)); \ 1168 #if (defined __STDC__ || defined __C99__FUNC__ \ 1169 || defined __cplusplus || defined _MSC_VER) 1174 yy_reduce_print (yyvsp, yylsp, yyrule)
1180 int yynrhs = yyr2[yyrule];
1182 unsigned long int yylno = yyrline[yyrule];
1183 YYFPRINTF (stderr,
"Reducing stack by rule %d (line %lu):\n",
1186 for (yyi = 0; yyi < yynrhs; yyi++)
1188 YYFPRINTF (stderr,
" $%d = ", yyi + 1);
1189 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
1190 &(yyvsp[(yyi + 1) - (yynrhs)])
1191 , &(yylsp[(yyi + 1) - (yynrhs)]) );
1192 YYFPRINTF (stderr,
"\n");
1196 # define YY_REDUCE_PRINT(Rule) \ 1199 yy_reduce_print (yyvsp, yylsp, Rule); \ 1206 # define YYDPRINTF(Args) 1207 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) 1208 # define YY_STACK_PRINT(Bottom, Top) 1209 # define YY_REDUCE_PRINT(Rule) 1215 # define YYINITDEPTH 200 1226 # define YYMAXDEPTH 10000 1234 # if defined __GLIBC__ && defined _STRING_H 1235 # define yystrlen strlen 1238 #if (defined __STDC__ || defined __C99__FUNC__ \ 1239 || defined __cplusplus || defined _MSC_VER) 1249 for (yylen = 0; yystr[yylen]; yylen++)
1257 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE 1258 # define yystpcpy stpcpy 1262 #if (defined __STDC__ || defined __C99__FUNC__ \ 1263 || defined __cplusplus || defined _MSC_VER) 1265 yystpcpy (
char *yydest,
const char *yysrc)
1274 const char *yys = yysrc;
1276 while ((*yyd++ = *yys++) !=
'\0')
1298 char const *yyp = yystr;
1305 goto do_not_strip_quotes;
1309 goto do_not_strip_quotes;
1322 do_not_strip_quotes: ;
1328 return yystpcpy (yyres, yystr) - yyres;
1342 int yyn = yypact[yystate];
1352 int yysize_overflow = 0;
1353 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1354 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1360 YY_(
"syntax error, unexpected %s");
1361 YY_(
"syntax error, unexpected %s, expecting %s");
1362 YY_(
"syntax error, unexpected %s, expecting %s or %s");
1363 YY_(
"syntax error, unexpected %s, expecting %s or %s or %s");
1364 YY_(
"syntax error, unexpected %s, expecting %s or %s or %s or %s");
1368 static char const yyunexpected[] =
"syntax error, unexpected %s";
1369 static char const yyexpecting[] =
", expecting %s";
1370 static char const yyor[] =
" or %s";
1371 char yyformat[
sizeof yyunexpected
1372 +
sizeof yyexpecting - 1
1373 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
1374 * (
sizeof yyor - 1))];
1375 char const *yyprefix = yyexpecting;
1379 int yyxbegin = yyn < 0 ? -yyn : 0;
1382 int yychecklim =
YYLAST - yyn + 1;
1386 yyarg[0] = yytname[yytype];
1387 yyfmt =
yystpcpy (yyformat, yyunexpected);
1389 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1390 if (yycheck[yyx + yyn] == yyx && yyx !=
YYTERROR)
1392 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1396 yyformat[
sizeof yyunexpected - 1] =
'\0';
1399 yyarg[yycount++] = yytname[yyx];
1400 yysize1 = yysize +
yytnamerr (0, yytname[yyx]);
1401 yysize_overflow |= (yysize1 < yysize);
1403 yyfmt =
yystpcpy (yyfmt, yyprefix);
1407 yyf =
YY_(yyformat);
1409 yysize_overflow |= (yysize1 < yysize);
1412 if (yysize_overflow)
1420 char *yyp = yyresult;
1422 while ((*yyp = *yyf) !=
'\0')
1424 if (*yyp ==
'%' && yyf[1] ==
's' && yyi < yycount)
1447 #if (defined __STDC__ || defined __C99__FUNC__ \ 1448 || defined __cplusplus || defined _MSC_VER) 1461 YYUSE (yylocationp);
1472 #line 368 "ast_expr2.y" 1476 #line 1479 "ast_expr2.c" 1481 #line 368 "ast_expr2.y" 1485 #line 1488 "ast_expr2.c" 1490 #line 368 "ast_expr2.y" 1494 #line 1497 "ast_expr2.c" 1499 #line 368 "ast_expr2.y" 1503 #line 1506 "ast_expr2.c" 1508 #line 368 "ast_expr2.y" 1512 #line 1515 "ast_expr2.c" 1517 #line 368 "ast_expr2.y" 1521 #line 1524 "ast_expr2.c" 1526 #line 368 "ast_expr2.y" 1530 #line 1533 "ast_expr2.c" 1535 #line 368 "ast_expr2.y" 1539 #line 1542 "ast_expr2.c" 1544 #line 368 "ast_expr2.y" 1548 #line 1551 "ast_expr2.c" 1553 #line 368 "ast_expr2.y" 1557 #line 1560 "ast_expr2.c" 1562 #line 368 "ast_expr2.y" 1566 #line 1569 "ast_expr2.c" 1571 #line 368 "ast_expr2.y" 1575 #line 1578 "ast_expr2.c" 1580 #line 368 "ast_expr2.y" 1584 #line 1587 "ast_expr2.c" 1589 #line 368 "ast_expr2.y" 1593 #line 1596 "ast_expr2.c" 1598 #line 368 "ast_expr2.y" 1602 #line 1605 "ast_expr2.c" 1607 #line 368 "ast_expr2.y" 1611 #line 1614 "ast_expr2.c" 1616 #line 368 "ast_expr2.y" 1620 #line 1623 "ast_expr2.c" 1625 #line 368 "ast_expr2.y" 1629 #line 1632 "ast_expr2.c" 1634 #line 368 "ast_expr2.y" 1638 #line 1641 "ast_expr2.c" 1643 #line 368 "ast_expr2.y" 1647 #line 1650 "ast_expr2.c" 1652 #line 368 "ast_expr2.y" 1656 #line 1659 "ast_expr2.c" 1661 #line 368 "ast_expr2.y" 1665 #line 1668 "ast_expr2.c" 1670 #line 368 "ast_expr2.y" 1674 #line 1677 "ast_expr2.c" 1683 #ifdef YYPARSE_PARAM 1684 #if defined __STDC__ || defined __cplusplus 1690 #if defined __STDC__ || defined __cplusplus 1705 #ifdef YYPARSE_PARAM 1706 #if (defined __STDC__ || defined __C99__FUNC__ \ 1707 || defined __cplusplus || defined _MSC_VER) 1716 #if (defined __STDC__ || defined __C99__FUNC__ \ 1717 || defined __cplusplus || defined _MSC_VER) 1754 yytype_int16 *yyssp;
1783 char *yymsg = yymsgbuf;
1784 YYSIZE_T yymsg_alloc =
sizeof yymsgbuf;
1787 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N)) 1799 YYDPRINTF ((stderr,
"Starting parse\n"));
1814 #if YYLTYPE_IS_TRIVIAL 1833 if (yyss + yystacksize - 1 <= yyssp)
1836 YYSIZE_T yysize = yyssp - yyss + 1;
1844 yytype_int16 *yyss1 = yyss;
1851 yyoverflow (
YY_(
"memory exhausted"),
1852 &yyss1, yysize *
sizeof (*yyssp),
1853 &yyvs1, yysize *
sizeof (*yyvsp),
1854 &yyls1, yysize *
sizeof (*yylsp),
1862 # ifndef YYSTACK_RELOCATE 1863 goto yyexhaustedlab;
1867 goto yyexhaustedlab;
1873 yytype_int16 *yyss1 = yyss;
1877 goto yyexhaustedlab;
1881 # undef YYSTACK_RELOCATE 1888 yyssp = yyss + yysize - 1;
1889 yyvsp = yyvs + yysize - 1;
1890 yylsp = yyls + yysize - 1;
1892 YYDPRINTF ((stderr,
"Stack size increased to %lu\n",
1893 (
unsigned long int) yystacksize));
1895 if (yyss + yystacksize - 1 <= yyssp)
1899 YYDPRINTF ((stderr,
"Entering state %d\n", yystate));
1915 yyn = yypact[yystate];
1924 YYDPRINTF ((stderr,
"Reading a token: "));
1928 if (yychar <=
YYEOF)
1930 yychar = yytoken =
YYEOF;
1931 YYDPRINTF ((stderr,
"Now at end of input.\n"));
1942 if (yyn < 0 ||
YYLAST < yyn || yycheck[yyn] != yytoken)
1974 yyn = yydefact[yystate];
1995 yyval = yyvsp[1-yylen];
2005 #line 374 "ast_expr2.y" 2007 ((
struct parse_io *)parseio)->val->type = (yyvsp[(1) - (1)].
val)->
type;
2019 #line 382 "ast_expr2.y" 2029 #line 389 "ast_expr2.y" 2036 #line 390 "ast_expr2.y" 2040 for (t=(yyvsp[(1) - (3)].arglist);t->
right;t=t->
right)
2042 (yyval.
arglist) = (yyvsp[(1) - (3)].arglist); t->
right = x; x->
val = (yyvsp[(3) - (3)].
val);;}
2048 #line 396 "ast_expr2.y" 2052 for (t=(yyvsp[(1) - (2)].arglist);t->
right;t=t->
right)
2060 #line 405 "ast_expr2.y" 2072 #line 411 "ast_expr2.y" 2073 {(yyval.
val) = (yyvsp[(1) - (1)].
val);;}
2079 #line 412 "ast_expr2.y" 2080 { (yyval.
val) = (yyvsp[(2) - (3)].
val);
2081 (yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column;
2082 (yyloc).first_line=0; (yyloc).last_line=0;
2089 #line 416 "ast_expr2.y" 2090 { (yyval.
val) =
op_or ((yyvsp[(1) - (3)].
val), (yyvsp[(3) - (3)].
val));
2092 (yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column;
2093 (yyloc).first_line=0; (yyloc).last_line=0;;}
2099 #line 420 "ast_expr2.y" 2100 { (yyval.
val) =
op_and ((yyvsp[(1) - (3)].
val), (yyvsp[(3) - (3)].
val));
2102 (yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column;
2103 (yyloc).first_line=0; (yyloc).last_line=0;;}
2109 #line 424 "ast_expr2.y" 2110 { (yyval.
val) =
op_eq ((yyvsp[(1) - (3)].
val), (yyvsp[(3) - (3)].
val));
2112 (yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column;
2113 (yyloc).first_line=0; (yyloc).last_line=0;;}
2119 #line 428 "ast_expr2.y" 2120 { (yyval.
val) =
op_gt ((yyvsp[(1) - (3)].
val), (yyvsp[(3) - (3)].
val));
2122 (yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column;
2123 (yyloc).first_line=0; (yyloc).last_line=0;;}
2129 #line 432 "ast_expr2.y" 2130 { (yyval.
val) =
op_lt ((yyvsp[(1) - (3)].
val), (yyvsp[(3) - (3)].
val));
2132 (yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column;
2133 (yyloc).first_line=0; (yyloc).last_line=0;;}
2139 #line 436 "ast_expr2.y" 2140 { (yyval.
val) =
op_ge ((yyvsp[(1) - (3)].
val), (yyvsp[(3) - (3)].
val));
2142 (yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column;
2143 (yyloc).first_line=0; (yyloc).last_line=0;;}
2149 #line 440 "ast_expr2.y" 2150 { (yyval.
val) =
op_le ((yyvsp[(1) - (3)].
val), (yyvsp[(3) - (3)].
val));
2152 (yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column;
2153 (yyloc).first_line=0; (yyloc).last_line=0;;}
2159 #line 444 "ast_expr2.y" 2160 { (yyval.
val) =
op_ne ((yyvsp[(1) - (3)].
val), (yyvsp[(3) - (3)].
val));
2162 (yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column;
2163 (yyloc).first_line=0; (yyloc).last_line=0;;}
2169 #line 448 "ast_expr2.y" 2172 (yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column;
2173 (yyloc).first_line=0; (yyloc).last_line=0;;}
2179 #line 452 "ast_expr2.y" 2182 (yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column;
2183 (yyloc).first_line=0; (yyloc).last_line=0;;}
2189 #line 456 "ast_expr2.y" 2192 (yyloc).first_column = (yylsp[(1) - (2)]).first_column; (yyloc).last_column = (yylsp[(2) - (2)]).last_column;
2193 (yyloc).first_line=0; (yyloc).last_line=0;;}
2199 #line 460 "ast_expr2.y" 2202 (yyloc).first_column = (yylsp[(1) - (2)]).first_column; (yyloc).last_column = (yylsp[(2) - (2)]).last_column;
2203 (yyloc).first_line=0; (yyloc).last_line=0;;}
2209 #line 464 "ast_expr2.y" 2212 (yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column;
2213 (yyloc).first_line=0; (yyloc).last_line=0;;}
2219 #line 468 "ast_expr2.y" 2220 { (yyval.
val) =
op_div ((yyvsp[(1) - (3)].
val), (yyvsp[(3) - (3)].
val));
2222 (yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column;
2223 (yyloc).first_line=0; (yyloc).last_line=0;;}
2229 #line 472 "ast_expr2.y" 2230 { (yyval.
val) =
op_rem ((yyvsp[(1) - (3)].
val), (yyvsp[(3) - (3)].
val));
2232 (yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column;
2233 (yyloc).first_line=0; (yyloc).last_line=0;;}
2239 #line 476 "ast_expr2.y" 2242 (yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column;
2243 (yyloc).first_line=0; (yyloc).last_line=0;;}
2249 #line 480 "ast_expr2.y" 2252 (yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column;
2253 (yyloc).first_line=0; (yyloc).last_line=0;;}
2259 #line 484 "ast_expr2.y" 2260 { (yyval.
val) =
op_cond ((yyvsp[(1) - (5)].
val), (yyvsp[(3) - (5)].
val), (yyvsp[(5) - (5)].
val));
2263 (yyloc).first_column = (yylsp[(1) - (5)]).first_column; (yyloc).last_column = (yylsp[(3) - (5)]).last_column;
2264 (yyloc).first_line=0; (yyloc).last_line=0;;}
2270 #line 489 "ast_expr2.y" 2273 (yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column;
2274 (yyloc).first_line=0; (yyloc).last_line=0;;}
2280 #line 2283 "ast_expr2.c" 2298 yystate = yypgoto[yyn -
YYNTOKENS] + *yyssp;
2299 if (0 <= yystate && yystate <=
YYLAST && yycheck[yystate] == *yyssp)
2300 yystate = yytable[yystate];
2315 #if ! YYERROR_VERBOSE 2325 if (yymsg != yymsgbuf)
2329 yymsg_alloc = yyalloc;
2333 yymsg_alloc =
sizeof yymsgbuf;
2337 if (0 < yysize && yysize <= yymsg_alloc)
2346 goto yyexhaustedlab;
2352 yyerror_range[0] =
yylloc;
2354 if (yyerrstatus == 3)
2359 if (yychar <=
YYEOF)
2362 if (yychar ==
YYEOF)
2368 yytoken, &yylval, &yylloc);
2389 yyerror_range[0] = yylsp[1-yylen];
2407 yyn = yypact[yystate];
2423 yyerror_range[0] = *yylsp;
2425 yystos[yystate], yyvsp, yylsp);
2433 yyerror_range[1] =
yylloc;
2460 #if !defined(yyoverflow) || YYERROR_VERBOSE 2473 yytoken, &yylval, &yylloc);
2478 while (yyssp != yyss)
2481 yystos[*yyssp], yyvsp, yylsp);
2489 if (yymsg != yymsgbuf)
2493 return YYID (yyresult);
2499 #line 495 "ast_expr2.y" 2520 vp = (
struct val *)
malloc (
sizeof (*vp));
2538 vp = (
struct val *)
malloc (
sizeof (*vp));
2547 for (i = 0, isint = (isdigit(s[0]) || s[0] ==
'-' || s[0]==
'.'); isint && i < strlen(s); i++)
2549 if (!isdigit(s[i]) && s[
i] !=
'.') {
2612 if( vp->
u.
s[0] ==
'"' && vp->
u.
s[strlen(vp->
u.
s)-1] ==
'"' )
2620 if( *f && *f !=
'"' )
2659 return (vp->
u.
i == 0);
2668 void ast_log(
int level,
const char *file,
int line,
const char *
function,
const char *fmt, ...)
2673 printf(
"LOG: lev:%d file:%s line:%d func: %s ",
2674 level, file, line,
function);
2681 int main(
int argc,
char **argv) {
2689 if( access(argv[1],F_OK)== 0 )
2693 infile = fopen(argv[1],
"r");
2696 printf(
"Sorry, couldn't open %s for reading!\n", argv[1]);
2699 while( fgets(s,
sizeof(s),infile) )
2701 if( s[strlen(s)-1] ==
'\n' )
2705 printf(
"Expression: %s Result: [%d] '%s'\n",
2713 printf(
"=====%s======\n",s);
2715 printf(
"No result\n");
2723 #define ast_yyerror(x) ast_yyerror(x, YYLTYPE *yylloc, struct parse_io *parseio) 2736 arglist_next = arglist->
right;
2742 arglist = arglist_next;
2746 #if !defined(STANDALONE) && !defined(STANDALONE2) 2760 total_len += strlen(t->
val->
u.
s);
2767 argbuf =
malloc(total_len);
2779 strcat(argbuf,numbuf);
2781 strcat(argbuf,t->
val->
u.
s);
2791 if ( strspn(str,
"-0123456789. ") == strlen(str))
2800 if (strspn(funcname->
u.
s,
"ABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789") == strlen(funcname->
u.
s))
2805 }
else if (strcmp(funcname->
u.
s,
"COS") == 0) {
2806 if (arglist && !arglist->
right && arglist->
val){
2816 }
else if (strcmp(funcname->
u.
s,
"SIN") == 0) {
2817 if (arglist && !arglist->
right && arglist->
val){
2827 }
else if (strcmp(funcname->
u.
s,
"TAN") == 0) {
2828 if (arglist && !arglist->
right && arglist->
val){
2838 }
else if (strcmp(funcname->
u.
s,
"ACOS") == 0) {
2839 if (arglist && !arglist->
right && arglist->
val){
2849 }
else if (strcmp(funcname->
u.
s,
"ASIN") == 0) {
2850 if (arglist && !arglist->
right && arglist->
val){
2860 }
else if (strcmp(funcname->
u.
s,
"ATAN") == 0) {
2861 if (arglist && !arglist->
right && arglist->
val){
2871 }
else if (strcmp(funcname->
u.
s,
"ATAN2") == 0) {
2883 }
else if (strcmp(funcname->
u.
s,
"POW") == 0) {
2895 }
else if (strcmp(funcname->
u.
s,
"SQRT") == 0) {
2896 if (arglist && !arglist->
right && arglist->
val){
2906 }
else if (strcmp(funcname->
u.
s,
"FLOOR") == 0) {
2907 if (arglist && !arglist->
right && arglist->
val){
2917 }
else if (strcmp(funcname->
u.
s,
"CEIL") == 0) {
2918 if (arglist && !arglist->
right && arglist->
val){
2928 }
else if (strcmp(funcname->
u.
s,
"ROUND") == 0) {
2929 if (arglist && !arglist->
right && arglist->
val){
2939 }
else if (strcmp(funcname->
u.
s,
"RINT") == 0) {
2940 if (arglist && !arglist->
right && arglist->
val){
2950 }
else if (strcmp(funcname->
u.
s,
"TRUNC") == 0) {
2951 if (arglist && !arglist->
right && arglist->
val){
2961 }
else if (strcmp(funcname->
u.
s,
"EXP") == 0) {
2962 if (arglist && !arglist->
right && arglist->
val){
2972 }
else if (strcmp(funcname->
u.
s,
"EXP2") == 0) {
2973 if (arglist && !arglist->
right && arglist->
val){
2983 }
else if (strcmp(funcname->
u.
s,
"EXP10") == 0) {
2984 if (arglist && !arglist->
right && arglist->
val){
2994 }
else if (strcmp(funcname->
u.
s,
"LOG") == 0) {
2995 if (arglist && !arglist->
right && arglist->
val){
3005 }
else if (strcmp(funcname->
u.
s,
"LOG2") == 0) {
3006 if (arglist && !arglist->
right && arglist->
val){
3016 }
else if (strcmp(funcname->
u.
s,
"LOG10") == 0) {
3017 if (arglist && !arglist->
right && arglist->
val){
3026 #ifdef FUNC_REMAINDER 3027 }
else if (strcmp(funcname->
u.
s,
"REMAINDER") == 0) {
3038 }
else if (strcmp(funcname->
u.
s,
"ABS") == 0) {
3039 if (arglist && !arglist->
right && arglist->
val) {
3049 #if !defined(STANDALONE) && !defined(STANDALONE2) 3058 char workspace[512];
3060 f->
read(chan, funcname->
u.
s, argbuf, workspace,
sizeof(workspace));
3072 ast_log(
LOG_ERROR,
"Error! '%s' doesn't appear to be an available function!\n", funcname->
u.
s);
3076 ast_log(
LOG_ERROR,
"Error! '%s' is not available in the standalone version!\n", funcname->
u.
s);
3125 #ifdef DEBUG_FOR_CONVERSIONS 3127 sprintf(buffer,
"Converting '%s' and '%s' ", a->
u.
s, b->
u.
s);
3131 #ifdef DEBUG_FOR_CONVERSIONS 3229 if( strlen(a->
u.
s) && strcmp(a->
u.
s,
"\"\"") != 0 && strcmp(a->
u.
s,
"0") != 0 )
3285 if (a > 0 && b > 0 && r <= 0)
3288 if (a < 0 && b < 0 && r >= 0)
3416 if( a->
u.
s[0] == 0 )
3418 else if (strlen(a->
u.
s) == 1 && a->
u.
s[0] ==
'0' )
3430 if( a->
u.
s[0] == 0 )
3432 else if (strlen(a->
u.
s) == 1 && a->
u.
s[0] ==
'0' )
3569 if ((eval = regcomp (&rp, b->
u.
s, REG_EXTENDED)) != 0) {
3570 regerror (eval, &rp, errbuf,
sizeof(errbuf));
3579 if (regexec(&rp, a->
u.
s, (
size_t)2, rm, 0) == 0 && rm[0].rm_so == 0) {
3580 if (rm[1].rm_so >= 0) {
3581 *(a->
u.
s + rm[1].rm_eo) =
'\0';
3588 if (rp.re_nsub == 0) {
3620 if ((eval = regcomp (&rp, b->
u.
s, REG_EXTENDED)) != 0) {
3621 regerror (eval, &rp, errbuf,
sizeof(errbuf));
3630 if (regexec(&rp, a->
u.
s, (
size_t)2, rm, 0) == 0 ) {
3631 if (rm[1].rm_so >= 0) {
3632 *(a->
u.
s + rm[1].rm_eo) =
'\0';
3639 if (rp.re_nsub == 0) {
3667 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.
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[]
static int chk_times(FP___TYPE a, FP___TYPE b, FP___TYPE r)
static const yytype_int16 yypact[]
static char * yystpcpy(char *yydest, const char *yysrc)
#define YY_REDUCE_PRINT(Rule)
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)
static void yydestruct(char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp) const
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)
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)
static YYSIZE_T yysyntax_error(char *yyresult, int yystate, int yychar)
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)
static const yytype_uint8 yystos[]
static struct val * op_compl(struct val *a)
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 YYSIZE_T yystrlen(char *yystr) const
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)
int asprintf(char **str, const char *fmt,...)
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)