Wed Jan 8 2020 09:49:57

Asterisk developer's documentation


ast_expr2.c File Reference
#include "asterisk.h"
#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <locale.h>
#include <unistd.h>
#include <ctype.h>
#include <errno.h>
#include <regex.h>
#include <limits.h>
#include "asterisk/ast_expr.h"
#include "asterisk/logger.h"
#include "asterisk/pbx.h"

Go to the source code of this file.

Data Structures

struct  expr_node
 
struct  parse_io
 
struct  val
 
union  yyalloc
 
struct  yyltype
 
union  YYSTYPE
 

Macros

#define ast_yyerror(x)   ast_yyerror(x,&yyloc,parseio)
 
#define ast_yyerror(x)   ast_yyerror(x, YYLTYPE *yylloc, struct parse_io *parseio)
 
#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);}
 
#define FP___PRINTF   "%.16g"
 
#define FP___TYPE   double
 
#define FUNC_ACOS   acosl
 
#define FUNC_ASIN   asinl
 
#define FUNC_ATAN   atanl
 
#define FUNC_ATAN2   atan2l
 
#define FUNC_CEIL   ceill
 
#define FUNC_COS   cosl
 
#define FUNC_EXP   expl
 
#define FUNC_EXP10   exp10l
 
#define FUNC_EXP2   exp2l
 
#define FUNC_FLOOR   floorl
 
#define FUNC_FMOD   fmodl
 
#define FUNC_LOG   logl
 
#define FUNC_LOG10   log10l
 
#define FUNC_LOG2   log2l
 
#define FUNC_POW   powl
 
#define FUNC_REMAINDER   remainderl
 
#define FUNC_RINT   rintl
 
#define FUNC_ROUND   roundl
 
#define FUNC_SIN   sinl
 
#define FUNC_SQRT   sqrtl
 
#define FUNC_STRTOD   strtold
 
#define FUNC_TAN   tanl
 
#define FUNC_TRUNC   truncl
 
#define QUAD_MAX   (0x7fffffffffffffffLL)
 
#define QUAD_MIN   (-0x7fffffffffffffffLL-1)
 
#define YY_(msgid)   msgid
 
#define YY_LOCATION_PRINT(File, Loc)
 
#define YY_REDUCE_PRINT(Rule)
 
#define YY_STACK_PRINT(Bottom, Top)
 
#define YY_SYMBOL_PRINT(Title, Type, Value, Location)
 
#define YYABORT   goto yyabortlab
 
#define YYACCEPT   goto yyacceptlab
 
#define YYBACKUP(Token, Value)
 
#define YYBISON   1
 
#define YYBISON_VERSION   "2.5"
 
#define YYCASE_(N, S)
 
#define yychar   ast_yychar
 
#define yyclearin   (yychar = YYEMPTY)
 
#define YYCOPY(To, From, Count)
 
#define YYCOPY_NEEDED   1
 
#define yydebug   ast_yydebug
 
#define YYDEBUG   0
 
#define YYDPRINTF(Args)
 
#define YYEMPTY   (-2)
 
#define YYENABLE_NLS   0
 
#define YYEOF   0
 
#define YYERRCODE   256
 
#define yyerrok   (yyerrstatus = 0)
 
#define yyerror   ast_yyerror
 
#define YYERROR   goto yyerrorlab
 
#define YYERROR_VERBOSE   1
 
#define YYERROR_VERBOSE   1
 
#define YYFAIL   goto yyerrlab
 
#define YYFINAL   11
 
#define YYFREE   free
 
#define YYID(n)   (n)
 
#define YYINITDEPTH   200
 
#define YYLAST   159
 
#define yylex   ast_yylex
 
#define YYLEX   yylex (&yylval, &yylloc, YYLEX_PARAM)
 
#define YYLEX_PARAM   ((struct parse_io *)parseio)->scanner
 
#define yylloc   ast_yylloc
 
#define YYLLOC_DEFAULT(Current, Rhs, N)
 
#define YYLSP_NEEDED   1
 
#define YYLTYPE   yyltype
 
#define YYLTYPE_IS_TRIVIAL   1
 
#define yylval   ast_yylval
 
#define YYMALLOC   malloc
 
#define YYMAXDEPTH   10000
 
#define YYMAXUTOK   280
 
#define yynerrs   ast_yynerrs
 
#define YYNNTS   4
 
#define YYNRULES   28
 
#define YYNSTATES   54
 
#define YYNTOKENS   26
 
#define YYPACT_NINF   -18
 
#define yypact_value_is_default(yystate)   ((yystate) == (-18))
 
#define yyparse   ast_yyparse
 
#define YYPARSE_PARAM   parseio
 
#define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
 
#define YYPULL   1
 
#define YYPURE   1
 
#define YYPUSH   0
 
#define YYRECOVERING()   (!!yyerrstatus)
 
#define YYRHSLOC(Rhs, K)   ((Rhs)[K])
 
#define YYSIZE_MAXIMUM   ((YYSIZE_T) -1)
 
#define YYSIZE_T   unsigned int
 
#define YYSKELETON_NAME   "yacc.c"
 
#define YYSTACK_ALLOC   YYMALLOC
 
#define YYSTACK_ALLOC_MAXIMUM   YYSIZE_MAXIMUM
 
#define YYSTACK_BYTES(N)
 
#define YYSTACK_FREE   YYFREE
 
#define YYSTACK_GAP_MAXIMUM   (sizeof (union yyalloc) - 1)
 
#define YYSTACK_RELOCATE(Stack_alloc, Stack)
 
#define yystype   YYSTYPE /* obsolescent; will be withdrawn */
 
#define YYSTYPE_IS_DECLARED   1
 
#define YYSTYPE_IS_TRIVIAL   1
 
#define YYSYNTAX_ERROR
 
#define YYTABLE_NINF   -1
 
#define yytable_value_is_error(yytable_value)   YYID (0)
 
#define YYTERROR   1
 
#define YYTOKEN_TABLE   0
 
#define YYTOKENTYPE
 
#define YYTRANSLATE(YYX)   ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
 
#define YYUNDEFTOK   2
 
#define YYUSE(e)   ((void) (e))
 

Typedefs

typedef struct yyltype yyltype
 
typedef void * yyscan_t
 
typedef union YYSTYPE YYSTYPE
 
typedef short int yytype_int16
 
typedef short int yytype_int8
 
typedef unsigned short int yytype_uint16
 
typedef unsigned char yytype_uint8
 

Enumerations

enum  node_type { AST_EXPR_NODE_COMMA, AST_EXPR_NODE_STRING, AST_EXPR_NODE_VAL }
 
enum  valtype {
  AST_EXPR_number, AST_EXPR_numeric_string, AST_EXPR_string, AST_EXPR_number,
  AST_EXPR_numeric_string, AST_EXPR_string
}
 
enum  yytokentype {
  TOK_COMMA = 258, TOK_COLONCOLON = 259, TOK_COND = 260, TOK_OR = 261,
  TOK_AND = 262, TOK_NE = 263, TOK_LE = 264, TOK_GE = 265,
  TOK_LT = 266, TOK_GT = 267, TOK_EQ = 268, TOK_MINUS = 269,
  TOK_PLUS = 270, TOK_MOD = 271, TOK_DIV = 272, TOK_MULT = 273,
  TOK_COMPL = 274, TOK_TILDETILDE = 275, TOK_EQTILDE = 276, TOK_COLON = 277,
  TOK_LP = 278, TOK_RP = 279, TOKEN = 280, TOK_COMMA = 258,
  TOK_COLONCOLON = 259, TOK_COND = 260, TOK_OR = 261, TOK_AND = 262,
  TOK_NE = 263, TOK_LE = 264, TOK_GE = 265, TOK_LT = 266,
  TOK_GT = 267, TOK_EQ = 268, TOK_MINUS = 269, TOK_PLUS = 270,
  TOK_MOD = 271, TOK_DIV = 272, TOK_MULT = 273, TOK_COMPL = 274,
  TOK_TILDETILDE = 275, TOK_EQTILDE = 276, TOK_COLON = 277, TOK_LP = 278,
  TOK_RP = 279, TOKEN = 280, KW_CONTEXT = 258, LC = 259,
  RC = 260, LP = 261, RP = 262, SEMI = 263,
  EQ = 264, COMMA = 265, COLON = 266, AMPER = 267,
  BAR = 268, AT = 269, KW_MACRO = 270, KW_GLOBALS = 271,
  KW_IGNOREPAT = 272, KW_SWITCH = 273, KW_IF = 274, KW_IFTIME = 275,
  KW_ELSE = 276, KW_RANDOM = 277, KW_ABSTRACT = 278, KW_EXTEND = 279,
  EXTENMARK = 280, KW_GOTO = 281, KW_JUMP = 282, KW_RETURN = 283,
  KW_BREAK = 284, KW_CONTINUE = 285, KW_REGEXTEN = 286, KW_HINT = 287,
  KW_FOR = 288, KW_WHILE = 289, KW_CASE = 290, KW_PATTERN = 291,
  KW_DEFAULT = 292, KW_CATCH = 293, KW_SWITCHES = 294, KW_ESWITCHES = 295,
  KW_INCLUDES = 296, KW_LOCAL = 297, word = 298, KW_CONTEXT = 258,
  LC = 259, RC = 260, LP = 261, RP = 262,
  SEMI = 263, EQ = 264, COMMA = 265, COLON = 266,
  AMPER = 267, BAR = 268, AT = 269, KW_MACRO = 270,
  KW_GLOBALS = 271, KW_IGNOREPAT = 272, KW_SWITCH = 273, KW_IF = 274,
  KW_IFTIME = 275, KW_ELSE = 276, KW_RANDOM = 277, KW_ABSTRACT = 278,
  KW_EXTEND = 279, EXTENMARK = 280, KW_GOTO = 281, KW_JUMP = 282,
  KW_RETURN = 283, KW_BREAK = 284, KW_CONTINUE = 285, KW_REGEXTEN = 286,
  KW_HINT = 287, KW_FOR = 288, KW_WHILE = 289, KW_CASE = 290,
  KW_PATTERN = 291, KW_DEFAULT = 292, KW_CATCH = 293, KW_SWITCHES = 294,
  KW_ESWITCHES = 295, KW_INCLUDES = 296, KW_LOCAL = 297, word = 298
}
 

Functions

static int chk_div __P ((FP___TYPE, FP___TYPE))
 
static int chk_minus __P ((FP___TYPE, FP___TYPE, FP___TYPE))
 
static void free_value __P ((struct val *))
 
static struct val *make_number __P ((FP___TYPE))
 
static struct val *make_str __P ((const char *))
 
static struct val *op_and __P ((struct val *, struct val *))
 
static struct val *op_cond __P ((struct val *, struct val *, struct val *))
 
int ast_yylex __P ((YYSTYPE *, YYLTYPE *, yyscan_t))
 
static struct expr_nodealloc_expr_node (enum node_type)
 
int ast_yyerror (const char *, YYLTYPE *, struct parse_io *)
 
static int chk_div (FP___TYPE a, FP___TYPE b)
 
static int chk_minus (FP___TYPE a, FP___TYPE b, FP___TYPE r)
 
static int chk_plus (FP___TYPE a, FP___TYPE b, FP___TYPE r)
 
static int chk_times (FP___TYPE a, FP___TYPE b, FP___TYPE r)
 
static char * compose_func_args (struct expr_node *arglist)
 
static void destroy_arglist (struct expr_node *arglist)
 
 for (;;)
 
static void free_value (struct val *vp)
 
 if (yyss+yystacksize-1<=yyssp)
 
 if (yychar==YYEMPTY)
 
 if (yychar<=YYEOF)
 
 if (yyn<=0)
 
 if (!yyerrstatus)
 
 if (yyerrstatus==3)
 
static int is_really_num (char *str)
 
static int is_zero_or_null (struct val *vp)
 
static int isstring (struct val *vp)
 
static struct valmake_number (FP___TYPE i)
 
static struct valmake_str (const char *s)
 
static struct valop_and (struct val *a, struct val *b)
 
static struct valop_colon (struct val *a, struct val *b)
 
static struct valop_compl (struct val *a)
 
static struct valop_cond (struct val *a, struct val *b, struct val *c)
 
static struct valop_div (struct val *a, struct val *b)
 
static struct valop_eq (struct val *a, struct val *b)
 
static struct valop_eqtilde (struct val *a, struct val *b)
 
static struct valop_func (struct val *funcname, struct expr_node *arglist, struct ast_channel *chan)
 
static struct valop_ge (struct val *a, struct val *b)
 
static struct valop_gt (struct val *a, struct val *b)
 
static struct valop_le (struct val *a, struct val *b)
 
static struct valop_lt (struct val *a, struct val *b)
 
static struct valop_minus (struct val *a, struct val *b)
 
static struct valop_ne (struct val *a, struct val *b)
 
static struct valop_negate (struct val *a)
 
static struct valop_or (struct val *a, struct val *b)
 
static struct valop_plus (struct val *a, struct val *b)
 
static struct valop_rem (struct val *a, struct val *b)
 
static struct valop_tildetilde (struct val *a, struct val *b)
 
static struct valop_times (struct val *a, struct val *b)
 
static void strip_quotes (struct val *vp)
 
 switch (yytype)
 
 switch (yyn)
 
static int to_number (struct val *vp)
 
static void to_string (struct val *vp)
 
 while (yyssp!=yyss)
 
 YY_REDUCE_PRINT (yyn)
 
 YY_STACK_PRINT (yyss, yyssp)
 
 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp)
 
 YY_SYMBOL_PRINT ("Next token is", yytoken,&yylval,&yylloc)
 
 YY_SYMBOL_PRINT ("Shifting", yytoken,&yylval,&yylloc)
 
 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn],&yyval,&yyloc)
 
 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp)
 
 yydestruct ("Cleanup: discarding lookahead", yytoken,&yylval,&yylloc)
 
 YYDPRINTF ((stderr,"Starting parse\n"))
 
 YYDPRINTF ((stderr,"Entering state %d\n", yystate))
 
return YYID (yyresult)
 
 YYLLOC_DEFAULT (yyloc,(yylsp-yylen), yylen)
 
 YYLLOC_DEFAULT (yyloc, yyerror_range, 2)
 
int yyparse ()
 
 YYPOPSTACK (yylen)
 
 YYSTACK_FREE (yyss)
 
 YYSTACK_FREE (yymsg)
 
static int yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, yytype_int16 *yyssp, int yytoken)
 
static YYSIZE_T yytnamerr (char *yyres, const char *yystr)
 
 YYUSE (yylocationp)
 

Variables

yynewstate __pad0__
 
yyexhaustedlab __pad10__
 
yyreturn __pad11__
 
yysetstate __pad1__
 
yybackup __pad2__
 
yydefault __pad3__
 
yyreduce __pad4__
 
yyerrlab __pad5__
 
yyerrorlab __pad6__
 
yyerrlab1 __pad7__
 
yyacceptlab __pad8__
 
yyabortlab __pad9__
 
 continue
 
 else
 
char extra_error_message [4095]
 
int extra_error_message_supplied
 
yylloc first_column = yylloc.last_column = 1
 
yylloc first_line = yylloc.last_line = 1
 
 YYACCEPT
 
goto yybackup
 
 yychar = YYEMPTY
 
static const yytype_int8 yycheck []
 
return yyd
 
static const yytype_uint8 yydefact []
 
goto yydefault
 
static const yytype_int8 yydefgoto []
 
static char *char * yydest
 
goto yyerrlab
 
goto yyerrlab1
 
YYLTYPE yyerror_range [3] = yylloc
 
int yyerrstatus = 0
 
return yylen = 0
 
YYLTYPE yylloc
 
YYLTYPE yyloc
 
YYLTYPEyylocationp
 
YYLTYPEyyls = yylsa
 
YYLTYPE yylsa [YYINITDEPTH]
 
YYLTYPEyylsp = yyls
 
YYSTYPE yylval
 
static void const char * yymsg = "Deleting"
 
YYSIZE_T yymsg_alloc = sizeof yymsgbuf
 
char yymsgbuf [128]
 
int yyn = yytoken
 
int yynerrs = 0
 
goto yynewstate
 
static const yytype_int16 yypact []
 
int void * YYPARSE_PARAM
 
static const yytype_int8 yypgoto []
 
static const yytype_uint8 yyr1 []
 
static const yytype_uint8 yyr2 []
 
goto yyreduce
 
int yyresult = 2
 
goto yyreturn
 
const char * yys = yysrc
 
goto yysetstate
 
const char * yysrc
 
yytype_int16yyss = yyssa
 
yytype_int16 yyssa [YYINITDEPTH]
 
yytype_int16yyssp = yyss
 
YYSIZE_T yystacksize = YYINITDEPTH
 
int yystate = 0
 
static const yytype_uint8 yystos []
 
static YYSIZE_T const char * yystr
 
static const yytype_uint8 yytable []
 
static const char *const yytname []
 
int yytoken = 0
 
static const yytype_uint8 yytranslate []
 
int yytype
 
YYSTYPE yyval = yyvsp[1-yylen]
 
YYSTYPEyyvaluep
 
YYSTYPEyyvs = yyvsa
 
YYSTYPE yyvsa [YYINITDEPTH]
 
YYSTYPEyyvsp = yyvs
 

Macro Definition Documentation

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

Definition at line 2785 of file ast_expr2.c.

#define ast_yyerror (   x)    ast_yyerror(x, YYLTYPE *yylloc, struct parse_io *parseio)

Definition at line 2785 of file ast_expr2.c.

#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);}

Definition at line 412 of file ast_expr2.c.

Referenced by switch().

#define FP___PRINTF   "%.16g"

Definition at line 110 of file ast_expr2.c.

Referenced by compose_func_args(), and to_string().

#define FP___TYPE   double

Definition at line 111 of file ast_expr2.c.

Referenced by op_and(), op_colon(), op_eq(), op_eqtilde(), op_func(), op_ge(), op_gt(), op_le(), op_lt(), op_ne(), and to_number().

#define FUNC_ACOS   acosl

Definition at line 133 of file ast_expr2.c.

Referenced by op_func().

#define FUNC_ASIN   asinl

Definition at line 139 of file ast_expr2.c.

Referenced by op_func().

#define FUNC_ATAN   atanl

Definition at line 145 of file ast_expr2.c.

Referenced by op_func().

#define FUNC_ATAN2   atan2l

Definition at line 151 of file ast_expr2.c.

Referenced by op_func().

#define FUNC_CEIL   ceill

Definition at line 211 of file ast_expr2.c.

Referenced by op_func().

#define FUNC_COS   cosl

Definition at line 115 of file ast_expr2.c.

Referenced by op_func().

#define FUNC_EXP   expl

Definition at line 175 of file ast_expr2.c.

Referenced by op_func().

#define FUNC_EXP10   exp10l

Definition at line 241 of file ast_expr2.c.

Referenced by op_func().

#define FUNC_EXP2   exp2l
Note
Oddly enough, some platforms have some ISO C99 functions, but not others, so we define the missing functions in terms of their mathematical identities.

Definition at line 233 of file ast_expr2.c.

Referenced by op_func().

#define FUNC_FLOOR   floorl

Definition at line 205 of file ast_expr2.c.

Referenced by op_func().

#define FUNC_FMOD   fmodl

Definition at line 193 of file ast_expr2.c.

Referenced by op_rem().

#define FUNC_LOG   logl

Definition at line 181 of file ast_expr2.c.

Referenced by op_func().

#define FUNC_LOG10   log10l

Definition at line 261 of file ast_expr2.c.

Referenced by op_func().

#define FUNC_LOG2   log2l

Definition at line 249 of file ast_expr2.c.

Referenced by op_func().

#define FUNC_POW   powl

Definition at line 157 of file ast_expr2.c.

Referenced by op_func().

#define FUNC_REMAINDER   remainderl

Definition at line 187 of file ast_expr2.c.

Referenced by op_func().

#define FUNC_RINT   rintl

Definition at line 169 of file ast_expr2.c.

Referenced by op_func().

#define FUNC_ROUND   roundl

Definition at line 217 of file ast_expr2.c.

Referenced by op_func().

#define FUNC_SIN   sinl

Definition at line 121 of file ast_expr2.c.

Referenced by op_func().

#define FUNC_SQRT   sqrtl

Definition at line 163 of file ast_expr2.c.

Referenced by op_func().

#define FUNC_STRTOD   strtold

Definition at line 199 of file ast_expr2.c.

Referenced by op_func(), and to_number().

#define FUNC_TAN   tanl

Definition at line 127 of file ast_expr2.c.

Referenced by op_func().

#define FUNC_TRUNC   truncl

Definition at line 223 of file ast_expr2.c.

Referenced by op_func().

#define QUAD_MAX   (0x7fffffffffffffffLL)

Definition at line 308 of file ast_expr2.c.

#define QUAD_MIN   (-0x7fffffffffffffffLL-1)

Definition at line 305 of file ast_expr2.c.

Referenced by chk_div(), and chk_minus().

#define YY_ (   msgid)    msgid

Definition at line 571 of file ast_expr2.c.

Referenced by if(), and yysyntax_error().

#define YY_LOCATION_PRINT (   File,
  Loc 
)
Value:
fprintf (File, "%d.%d-%d.%d", \
(Loc).first_line, (Loc).first_column, \
(Loc).last_line, (Loc).last_column)
yylloc first_column
Definition: ast_expr2.c:1858
yylloc first_line
Definition: ast_expr2.c:1857

Definition at line 1042 of file ast_expr2.c.

#define YY_REDUCE_PRINT (   Rule)

Definition at line 1226 of file ast_expr2.c.

#define YY_STACK_PRINT (   Bottom,
  Top 
)

Definition at line 1225 of file ast_expr2.c.

Referenced by for().

#define YY_SYMBOL_PRINT (   Title,
  Type,
  Value,
  Location 
)

Definition at line 1224 of file ast_expr2.c.

#define YYABORT   goto yyabortlab

Definition at line 968 of file ast_expr2.c.

Referenced by for(), and if().

#define YYACCEPT   goto yyacceptlab

Definition at line 967 of file ast_expr2.c.

#define YYBACKUP (   Token,
  Value 
)

Definition at line 989 of file ast_expr2.c.

#define YYBISON   1

Definition at line 44 of file ast_expr2.c.

#define YYBISON_VERSION   "2.5"

Definition at line 47 of file ast_expr2.c.

#define YYCASE_ (   N,
  S 
)
Value:
case N: \
yyformat = S; \
break
#define S(e)

Referenced by yysyntax_error().

#define yychar   ast_yychar

Definition at line 69 of file ast_expr2.c.

#define yyclearin   (yychar = YYEMPTY)

Definition at line 963 of file ast_expr2.c.

#define YYCOPY (   To,
  From,
  Count 
)

Definition at line 720 of file ast_expr2.c.

#define YYCOPY_NEEDED   1

Definition at line 692 of file ast_expr2.c.

#define yydebug   ast_yydebug

Definition at line 70 of file ast_expr2.c.

#define YYDEBUG   0

Definition at line 420 of file ast_expr2.c.

#define YYDPRINTF (   Args)

Definition at line 1223 of file ast_expr2.c.

Referenced by if().

#define YYEMPTY   (-2)

Definition at line 964 of file ast_expr2.c.

Referenced by if(), and yysyntax_error().

#define YYENABLE_NLS   0

Definition at line 310 of file ast_expr2.c.

#define YYEOF   0

Definition at line 965 of file ast_expr2.c.

Referenced by if().

#define YYERRCODE   256

Definition at line 1007 of file ast_expr2.c.

#define yyerrok   (yyerrstatus = 0)

Definition at line 962 of file ast_expr2.c.

#define yyerror   ast_yyerror

Definition at line 67 of file ast_expr2.c.

Referenced by if().

#define YYERROR   goto yyerrorlab

Definition at line 969 of file ast_expr2.c.

#define YYERROR_VERBOSE   1

Definition at line 426 of file ast_expr2.c.

#define YYERROR_VERBOSE   1

Definition at line 426 of file ast_expr2.c.

#define YYFAIL   goto yyerrlab

Definition at line 979 of file ast_expr2.c.

#define YYFINAL   11

Definition at line 733 of file ast_expr2.c.

#define YYFREE   free

Definition at line 660 of file ast_expr2.c.

#define YYID (   n)    (n)

Definition at line 584 of file ast_expr2.c.

#define YYINITDEPTH   200

Definition at line 1232 of file ast_expr2.c.

#define YYLAST   159

Definition at line 735 of file ast_expr2.c.

Referenced by for(), and yysyntax_error().

#define yylex   ast_yylex

Definition at line 66 of file ast_expr2.c.

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

Definition at line 1055 of file ast_expr2.c.

Referenced by if().

#define YYLEX_PARAM   ((struct parse_io *)parseio)->scanner

Definition at line 312 of file ast_expr2.c.

#define yylloc   ast_yylloc

Definition at line 72 of file ast_expr2.c.

Referenced by ael_yyget_lloc(), ael_yyset_lloc(), ast_yyget_lloc(), and ast_yyset_lloc().

#define YYLLOC_DEFAULT (   Current,
  Rhs,
 
)

Definition at line 1016 of file ast_expr2.c.

#define YYLSP_NEEDED   1

Definition at line 62 of file ast_expr2.c.

#define YYLTYPE   yyltype

Definition at line 400 of file ast_expr2.c.

#define YYLTYPE_IS_TRIVIAL   1

Definition at line 401 of file ast_expr2.c.

#define yylval   ast_yylval

Definition at line 68 of file ast_expr2.c.

Referenced by ael_yyget_lval(), ael_yyset_lval(), ast_yyget_lval(), ast_yyset_lval(), and while().

#define YYMALLOC   malloc

Definition at line 653 of file ast_expr2.c.

#define YYMAXDEPTH   10000

Definition at line 1243 of file ast_expr2.c.

Referenced by if().

#define YYMAXUTOK   280

Definition at line 748 of file ast_expr2.c.

#define yynerrs   ast_yynerrs

Definition at line 71 of file ast_expr2.c.

Referenced by if().

#define YYNNTS   4

Definition at line 740 of file ast_expr2.c.

#define YYNRULES   28

Definition at line 742 of file ast_expr2.c.

#define YYNSTATES   54

Definition at line 744 of file ast_expr2.c.

#define YYNTOKENS   26

Definition at line 738 of file ast_expr2.c.

Referenced by yysyntax_error().

#define YYPACT_NINF   -18

Definition at line 883 of file ast_expr2.c.

#define yypact_value_is_default (   yystate)    ((yystate) == (-18))

Definition at line 924 of file ast_expr2.c.

Referenced by for(), and yysyntax_error().

#define yyparse   ast_yyparse

Definition at line 65 of file ast_expr2.c.

#define YYPARSE_PARAM   parseio

Definition at line 311 of file ast_expr2.c.

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

Definition at line 1828 of file ast_expr2.c.

Referenced by for(), and while().

#define YYPULL   1

Definition at line 59 of file ast_expr2.c.

#define YYPURE   1

Definition at line 53 of file ast_expr2.c.

#define YYPUSH   0

Definition at line 56 of file ast_expr2.c.

#define YYRECOVERING ( )    (!!yyerrstatus)

Definition at line 987 of file ast_expr2.c.

#define YYRHSLOC (   Rhs,
 
)    ((Rhs)[K])

Definition at line 1014 of file ast_expr2.c.

#define YYSIZE_MAXIMUM   ((YYSIZE_T) -1)

Definition at line 561 of file ast_expr2.c.

#define YYSIZE_T   unsigned int

Definition at line 557 of file ast_expr2.c.

Referenced by if(), yysyntax_error(), and yytnamerr().

#define YYSKELETON_NAME   "yacc.c"

Definition at line 50 of file ast_expr2.c.

#define YYSTACK_ALLOC   YYMALLOC

Definition at line 639 of file ast_expr2.c.

Referenced by if().

#define YYSTACK_ALLOC_MAXIMUM   YYSIZE_MAXIMUM

Definition at line 642 of file ast_expr2.c.

Referenced by yysyntax_error().

#define YYSTACK_BYTES (   N)
Value:
((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
#define YYSTACK_GAP_MAXIMUM
Definition: ast_expr2.c:684
short int yytype_int16
Definition: ast_expr2.c:544
union YYSTYPE YYSTYPE

Definition at line 688 of file ast_expr2.c.

Referenced by if().

#define YYSTACK_FREE   YYFREE

Definition at line 640 of file ast_expr2.c.

Referenced by if().

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

Definition at line 684 of file ast_expr2.c.

#define YYSTACK_RELOCATE (   Stack_alloc,
  Stack 
)

Definition at line 699 of file ast_expr2.c.

Referenced by if().

#define yystype   YYSTYPE /* obsolescent; will be withdrawn */

Definition at line 487 of file ast_expr2.c.

#define YYSTYPE_IS_DECLARED   1

Definition at line 488 of file ast_expr2.c.

#define YYSTYPE_IS_TRIVIAL   1

Definition at line 486 of file ast_expr2.c.

#define YYSYNTAX_ERROR
Value:
YYSIZE_T yymsg_alloc
Definition: ast_expr2.c:1825
yytype_int16 * yyssp
Definition: ast_expr2.c:1795
static int yysyntax_error(YYSIZE_T *yymsg_alloc, char **yymsg, yytype_int16 *yyssp, int yytoken)
Definition: ast_expr2.c:1357
static void const char * yymsg
Definition: ast_expr2.c:1497
int yytoken
Definition: ast_expr2.c:1815

Referenced by if().

#define YYTABLE_NINF   -1

Definition at line 903 of file ast_expr2.c.

#define yytable_value_is_error (   yytable_value)    YYID (0)

Definition at line 927 of file ast_expr2.c.

Referenced by if(), and yysyntax_error().

#define YYTERROR   1

Definition at line 1006 of file ast_expr2.c.

Referenced by for(), and yysyntax_error().

#define YYTOKEN_TABLE   0

Definition at line 433 of file ast_expr2.c.

#define YYTOKENTYPE

Definition at line 439 of file ast_expr2.c.

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

Definition at line 750 of file ast_expr2.c.

#define YYUNDEFTOK   2

Definition at line 747 of file ast_expr2.c.

#define YYUSE (   e)    ((void) (e))

Definition at line 577 of file ast_expr2.c.

Typedef Documentation

typedef struct yyltype yyltype
typedef void* yyscan_t

Definition at line 346 of file ast_expr2.c.

typedef union YYSTYPE YYSTYPE
typedef short int yytype_int16

Definition at line 544 of file ast_expr2.c.

typedef short int yytype_int8

Definition at line 532 of file ast_expr2.c.

typedef unsigned short int yytype_uint16

Definition at line 538 of file ast_expr2.c.

typedef unsigned char yytype_uint8

Definition at line 523 of file ast_expr2.c.

Enumeration Type Documentation

enum node_type
Enumerator
AST_EXPR_NODE_COMMA 
AST_EXPR_NODE_STRING 
AST_EXPR_NODE_VAL 

Definition at line 333 of file ast_expr2.c.

enum valtype
Enumerator
AST_EXPR_number 
AST_EXPR_numeric_string 
AST_EXPR_string 
AST_EXPR_number 
AST_EXPR_numeric_string 
AST_EXPR_string 

Definition at line 317 of file ast_expr2.c.

Enumerator
TOK_COMMA 
TOK_COLONCOLON 
TOK_COND 
TOK_OR 
TOK_AND 
TOK_NE 
TOK_LE 
TOK_GE 
TOK_LT 
TOK_GT 
TOK_EQ 
TOK_MINUS 
TOK_PLUS 
TOK_MOD 
TOK_DIV 
TOK_MULT 
TOK_COMPL 
TOK_TILDETILDE 
TOK_EQTILDE 
TOK_COLON 
TOK_LP 
TOK_RP 
TOKEN 
TOK_COMMA 
TOK_COLONCOLON 
TOK_COND 
TOK_OR 
TOK_AND 
TOK_NE 
TOK_LE 
TOK_GE 
TOK_LT 
TOK_GT 
TOK_EQ 
TOK_MINUS 
TOK_PLUS 
TOK_MOD 
TOK_DIV 
TOK_MULT 
TOK_COMPL 
TOK_TILDETILDE 
TOK_EQTILDE 
TOK_COLON 
TOK_LP 
TOK_RP 
TOKEN 
KW_CONTEXT 
LC 
RC 
LP 
RP 
SEMI 
EQ 
COMMA 
COLON 
AMPER 
BAR 
AT 
KW_MACRO 
KW_GLOBALS 
KW_IGNOREPAT 
KW_SWITCH 
KW_IF 
KW_IFTIME 
KW_ELSE 
KW_RANDOM 
KW_ABSTRACT 
KW_EXTEND 
EXTENMARK 
KW_GOTO 
KW_JUMP 
KW_RETURN 
KW_BREAK 
KW_CONTINUE 
KW_REGEXTEN 
KW_HINT 
KW_FOR 
KW_WHILE 
KW_CASE 
KW_PATTERN 
KW_DEFAULT 
KW_CATCH 
KW_SWITCHES 
KW_ESWITCHES 
KW_INCLUDES 
KW_LOCAL 
word 
KW_CONTEXT 
LC 
RC 
LP 
RP 
SEMI 
EQ 
COMMA 
COLON 
AMPER 
BAR 
AT 
KW_MACRO 
KW_GLOBALS 
KW_IGNOREPAT 
KW_SWITCH 
KW_IF 
KW_IFTIME 
KW_ELSE 
KW_RANDOM 
KW_ABSTRACT 
KW_EXTEND 
EXTENMARK 
KW_GOTO 
KW_JUMP 
KW_RETURN 
KW_BREAK 
KW_CONTINUE 
KW_REGEXTEN 
KW_HINT 
KW_FOR 
KW_WHILE 
KW_CASE 
KW_PATTERN 
KW_DEFAULT 
KW_CATCH 
KW_SWITCHES 
KW_ESWITCHES 
KW_INCLUDES 
KW_LOCAL 
word 

Definition at line 442 of file ast_expr2.c.

442  {
443  TOK_COMMA = 258,
444  TOK_COLONCOLON = 259,
445  TOK_COND = 260,
446  TOK_OR = 261,
447  TOK_AND = 262,
448  TOK_NE = 263,
449  TOK_LE = 264,
450  TOK_GE = 265,
451  TOK_LT = 266,
452  TOK_GT = 267,
453  TOK_EQ = 268,
454  TOK_MINUS = 269,
455  TOK_PLUS = 270,
456  TOK_MOD = 271,
457  TOK_DIV = 272,
458  TOK_MULT = 273,
459  TOK_COMPL = 274,
460  TOK_TILDETILDE = 275,
461  TOK_EQTILDE = 276,
462  TOK_COLON = 277,
463  TOK_LP = 278,
464  TOK_RP = 279,
465  TOKEN = 280
466  };

Function Documentation

static int chk_div __P ( (FP___TYPE, FP___TYPE )
static
static int chk_times __P ( (FP___TYPE, FP___TYPE, FP___TYPE )
static
static void to_string __P ( (struct val *)  )
static
static struct val* make_number __P ( (FP___TYPE )
static
static struct val* make_str __P ( (const char *)  )
static
static struct val *op_times __P ( (struct val *, struct val *)  )
static
static struct val* op_cond __P ( (struct val *, struct val *, struct val *)  )
static
int ast_yylex __P ( (YYSTYPE *, YYLTYPE *, yyscan_t )
static struct expr_node * alloc_expr_node ( enum node_type  nt)
static

Definition at line 2562 of file ast_expr2.c.

References ast_log(), calloc, LOG_ERROR, and expr_node::type.

Referenced by switch().

2563 {
2564  struct expr_node *x = calloc(1,sizeof(struct expr_node));
2565  if (!x) {
2566  ast_log(LOG_ERROR, "Allocation for expr_node FAILED!!\n");
2567  return 0;
2568  }
2569  x->type = nt;
2570  return x;
2571 }
enum node_type type
Definition: ast_expr2.c:339
#define calloc(a, b)
Definition: astmm.h:79
#define LOG_ERROR
Definition: logger.h:155
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...
Definition: logger.c:1207
int ast_yyerror ( const char *  ,
YYLTYPE ,
struct parse_io  
)
static int chk_div ( FP___TYPE  a,
FP___TYPE  b 
)
static

Definition at line 3534 of file ast_expr2.c.

References QUAD_MIN.

Referenced by op_div().

3535 {
3536  /* div by zero has been taken care of before */
3537  /* only QUAD_MIN / -1 causes overflow */
3538  if (a == QUAD_MIN && b == -1)
3539  return 1;
3540  /* everything else is OK */
3541  return 0;
3542 }
#define QUAD_MIN
Definition: ast_expr2.c:305
static int chk_minus ( FP___TYPE  a,
FP___TYPE  b,
FP___TYPE  r 
)
static

Definition at line 3378 of file ast_expr2.c.

References chk_plus(), and QUAD_MIN.

Referenced by op_minus(), and op_negate().

3379 {
3380  /* special case subtraction of QUAD_MIN */
3381  if (b == QUAD_MIN) {
3382  if (a >= 0)
3383  return 1;
3384  else
3385  return 0;
3386  }
3387  /* this is allowed for b != QUAD_MIN */
3388  return chk_plus (a, -b, r);
3389 }
static int chk_plus(FP___TYPE a, FP___TYPE b, FP___TYPE r)
Definition: ast_expr2.c:3335
#define QUAD_MIN
Definition: ast_expr2.c:305
static int chk_plus ( FP___TYPE  a,
FP___TYPE  b,
FP___TYPE  r 
)
static

Definition at line 3335 of file ast_expr2.c.

Referenced by chk_minus(), and op_plus().

3336 {
3337  /* sum of two positive numbers must be positive */
3338  if (a > 0 && b > 0 && r <= 0)
3339  return 1;
3340  /* sum of two negative numbers must be negative */
3341  if (a < 0 && b < 0 && r >= 0)
3342  return 1;
3343  /* all other cases are OK */
3344  return 0;
3345 }
static int chk_times ( FP___TYPE  a,
FP___TYPE  b,
FP___TYPE  r 
)
static

Definition at line 3500 of file ast_expr2.c.

Referenced by op_times().

3501 {
3502  /* special case: first operand is 0, no overflow possible */
3503  if (a == 0)
3504  return 0;
3505  /* cerify that result of division matches second operand */
3506  if (r / a != b)
3507  return 1;
3508  return 0;
3509 }
static char* compose_func_args ( struct expr_node arglist)
static

Definition at line 2809 of file ast_expr2.c.

References AST_EXPR_number, ast_log(), FP___PRINTF, val::i, LOG_NOTICE, malloc, expr_node::right, val::s, val::type, val::u, and expr_node::val.

Referenced by op_func().

2810 {
2811  struct expr_node *t = arglist;
2812  char *argbuf;
2813  int total_len = 0;
2814 
2815  while (t) {
2816  if (t != arglist)
2817  total_len += 1; /* for the sep */
2818  if (t->val) {
2819  if (t->val->type == AST_EXPR_number)
2820  total_len += 25; /* worst case */
2821  else
2822  total_len += strlen(t->val->u.s);
2823  }
2824 
2825  t = t->right;
2826  }
2827  total_len++; /* for the null */
2828  ast_log(LOG_NOTICE,"argbuf allocated %d bytes;\n", total_len);
2829  argbuf = malloc(total_len);
2830  argbuf[0] = 0;
2831  t = arglist;
2832  while (t) {
2833  char numbuf[30];
2834 
2835  if (t != arglist)
2836  strcat(argbuf,",");
2837 
2838  if (t->val) {
2839  if (t->val->type == AST_EXPR_number) {
2840  sprintf(numbuf,FP___PRINTF,t->val->u.i);
2841  strcat(argbuf,numbuf);
2842  } else
2843  strcat(argbuf,t->val->u.s);
2844  }
2845  t = t->right;
2846  }
2847  ast_log(LOG_NOTICE,"argbuf uses %d bytes;\n", (int) strlen(argbuf));
2848  return argbuf;
2849 }
#define malloc(a)
Definition: astmm.h:88
FP___TYPE i
Definition: ast_expr2.c:329
enum valtype type
Definition: ast_expr2.c:326
char * s
Definition: ast_expr2.c:328
struct expr_node * right
Definition: ast_expr2.c:342
union val::@218 u
#define FP___PRINTF
Definition: ast_expr2.c:110
struct val * val
Definition: ast_expr2.c:340
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...
Definition: logger.c:1207
#define LOG_NOTICE
Definition: logger.h:133
static void destroy_arglist ( struct expr_node arglist)
static

Definition at line 2792 of file ast_expr2.c.

References free, free_value(), expr_node::right, and expr_node::val.

Referenced by switch().

2793 {
2794  struct expr_node *arglist_next;
2795 
2796  while (arglist)
2797  {
2798  arglist_next = arglist->right;
2799  if (arglist->val)
2800  free_value(arglist->val);
2801  arglist->val = 0;
2802  arglist->right = 0;
2803  free(arglist);
2804  arglist = arglist_next;
2805  }
2806 }
struct expr_node * right
Definition: ast_expr2.c:342
#define free(a)
Definition: astmm.h:94
struct val * val
Definition: ast_expr2.c:340
static void free_value(struct val *vp)
Definition: ast_expr2.c:2624
for ( ;;  )

Definition at line 2460 of file ast_expr2.c.

References YY_STACK_PRINT, YYABORT, yydestruct(), YYLAST, yylsp, yyn, yypact_value_is_default, YYPOPSTACK, yyssp, yystate, and YYTERROR.

Referenced by adsi_transmit_message_full(), isdn_msg_get_index(), measurenoise(), oss_read(), plc_fillin(), red_t140_to_red(), resample_frame(), stack_init(), tzload(), and udptl_build_packet().

2461  {
2462  yyn = yypact[yystate];
2464  {
2465  yyn += YYTERROR;
2466  if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
2467  {
2468  yyn = yytable[yyn];
2469  if (0 < yyn)
2470  break;
2471  }
2472  }
2473 
2474  /* Pop the current state because it cannot handle the error token. */
2475  if (yyssp == yyss)
2476  YYABORT;
2477 
2478  yyerror_range[1] = *yylsp;
2479  yydestruct ("Error: popping",
2480  yystos[yystate], yyvsp, yylsp);
2481  YYPOPSTACK (1);
2482  yystate = *yyssp;
2484  }
yytype_int16 * yyss
Definition: ast_expr2.c:1794
#define YYPOPSTACK(N)
Definition: ast_expr2.c:1828
static const yytype_uint8 yytable[]
Definition: ast_expr2.c:904
yytype_int16 * yyssp
Definition: ast_expr2.c:1795
static const yytype_int16 yypact[]
Definition: ast_expr2.c:884
#define YYABORT
Definition: ast_expr2.c:968
YYLTYPE * yylsp
Definition: ast_expr2.c:1805
#define yypact_value_is_default(yystate)
Definition: ast_expr2.c:924
int yystate
Definition: ast_expr2.c:1780
#define YYTERROR
Definition: ast_expr2.c:1006
YYSTYPE * yyvsp
Definition: ast_expr2.c:1800
int yyn
Definition: ast_expr2.c:1812
#define YYLAST
Definition: ast_expr2.c:735
yydestruct("Cleanup: discarding lookahead", yytoken,&yylval,&yylloc)
static const yytype_uint8 yystos[]
Definition: ast_expr2.c:952
YYLTYPE yyerror_range[3]
Definition: ast_expr2.c:1808
#define YY_STACK_PRINT(Bottom, Top)
Definition: ast_expr2.c:1225
static const yytype_int8 yycheck[]
Definition: ast_expr2.c:930
static void free_value ( struct val vp)
static

Definition at line 2624 of file ast_expr2.c.

References AST_EXPR_numeric_string, AST_EXPR_string, free, val::s, val::type, and val::u.

Referenced by destroy_arglist(), op_and(), op_colon(), op_compl(), op_cond(), op_div(), op_eq(), op_eqtilde(), op_ge(), op_gt(), op_le(), op_lt(), op_minus(), op_ne(), op_negate(), op_or(), op_plus(), op_rem(), op_tildetilde(), op_times(), and switch().

2625 {
2626  if (vp==NULL) {
2627  return;
2628  }
2629  if (vp->type == AST_EXPR_string || vp->type == AST_EXPR_numeric_string)
2630  free (vp->u.s);
2631  free(vp);
2632 }
enum valtype type
Definition: ast_expr2.c:326
char * s
Definition: ast_expr2.c:328
union val::@218 u
#define free(a)
Definition: astmm.h:94
if ( yyss+yystacksize-1<=  yyssp)

Definition at line 1874 of file ast_expr2.c.

References YY_, YYABORT, YYDPRINTF, yyls, yyalloc::yyls_alloc, YYMAXDEPTH, YYSIZE_T, yyss, yyalloc::yyss_alloc, YYSTACK_ALLOC, YYSTACK_BYTES, YYSTACK_FREE, YYSTACK_RELOCATE, yyvs, and yyalloc::yyvs_alloc.

Referenced by __ast_read(), __ast_str_helper(), __ast_str_helper2(), aji_client_connect(), ast_hashtab_dup(), ast_hashtab_resize(), ast_rtcp_read(), ast_str_make_space(), ast_stun_request(), cli_complete(), dahdi_accept_r2_call_exec(), dahdi_send_callrerouting_facility_exec(), dahdi_send_keypad_facility_exec(), defer_full_frame(), dundi_send(), g726_write(), get_filestream(), h263_read(), h264_read(), handle_bchan(), handle_cli_data_get(), handle_err(), handle_mgmt(), handle_request_subscribe(), history_get(), local_setoption(), MD5Update(), misdn_lib_get_free_bc(), misdn_lib_get_port_info(), misdn_lib_isdn_event_catcher(), ogg_vorbis_close(), ogg_vorbis_read(), ogg_vorbis_seek(), ogg_vorbis_tell(), ogg_vorbis_write(), oh323_answer(), oh323_call(), oh323_digit_begin(), oh323_digit_end(), oh323_hangup(), oh323_set_rtp_peer(), oh323_write(), oss_write(), park_call_full(), parse_release_complete(), pbx_builtin_background(), phone_write_buf(), pitch_shift(), send_trunk(), smdi_msg_find(), socket_read(), speex_callback(), switch_video_out(), tzload(), update(), wav_close(), wav_open(), wav_seek(), and wav_write().

1875  {
1876  /* Get the current used size of the three stacks, in elements. */
1877  YYSIZE_T yysize = yyssp - yyss + 1;
1878 
1879 #ifdef yyoverflow
1880  {
1881  /* Give user a chance to reallocate the stack. Use copies of
1882  these so that the &'s don't force the real ones into
1883  memory. */
1884  YYSTYPE *yyvs1 = yyvs;
1885  yytype_int16 *yyss1 = yyss;
1886  YYLTYPE *yyls1 = yyls;
1887 
1888  /* Each stack pointer address is followed by the size of the
1889  data in use in that stack, in bytes. This used to be a
1890  conditional around just the two extra args, but that might
1891  be undefined if yyoverflow is a macro. */
1892  yyoverflow (YY_("memory exhausted"),
1893  &yyss1, yysize * sizeof (*yyssp),
1894  &yyvs1, yysize * sizeof (*yyvsp),
1895  &yyls1, yysize * sizeof (*yylsp),
1896  &yystacksize);
1897 
1898  yyls = yyls1;
1899  yyss = yyss1;
1900  yyvs = yyvs1;
1901  }
1902 #else /* no yyoverflow */
1903 # ifndef YYSTACK_RELOCATE
1904  goto yyexhaustedlab;
1905 # else
1906  /* Extend the stack our own way. */
1907  if (YYMAXDEPTH <= yystacksize)
1908  goto yyexhaustedlab;
1909  yystacksize *= 2;
1910  if (YYMAXDEPTH < yystacksize)
1912 
1913  {
1914  yytype_int16 *yyss1 = yyss;
1915  union yyalloc *yyptr =
1917  if (! yyptr)
1918  goto yyexhaustedlab;
1919  YYSTACK_RELOCATE (yyss_alloc, yyss);
1922 # undef YYSTACK_RELOCATE
1923  if (yyss1 != yyssa)
1924  YYSTACK_FREE (yyss1);
1925  }
1926 # endif
1927 #endif /* no yyoverflow */
1928 
1929  yyssp = yyss + yysize - 1;
1930  yyvsp = yyvs + yysize - 1;
1931  yylsp = yyls + yysize - 1;
1932 
1933  YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1934  (unsigned long int) yystacksize));
1935 
1936  if (yyss + yystacksize - 1 <= yyssp)
1937  YYABORT;
1938  }
#define YYSTACK_ALLOC
Definition: ast_expr2.c:639
yytype_int16 * yyss
Definition: ast_expr2.c:1794
yytype_int16 * yyssp
Definition: ast_expr2.c:1795
yytype_int16 yyssa[YYINITDEPTH]
Definition: ast_expr2.c:1793
#define YYABORT
Definition: ast_expr2.c:968
YYLTYPE * yylsp
Definition: ast_expr2.c:1805
short int yytype_int16
Definition: ast_expr2.c:544
#define YYSIZE_T
Definition: ast_expr2.c:557
YYLTYPE * yyls
Definition: ast_expr2.c:1804
#define YYSTACK_BYTES(N)
Definition: ast_expr2.c:688
YYSTYPE yyvs_alloc
Definition: ast_expr2.c:679
YYSTYPE * yyvsp
Definition: ast_expr2.c:1800
YYSTYPE * yyvs
Definition: ast_expr2.c:1799
#define YYMAXDEPTH
Definition: ast_expr2.c:1243
YYLTYPE yyls_alloc
Definition: ast_expr2.c:680
#define YY_(msgid)
Definition: ast_expr2.c:571
#define YYSTACK_FREE
Definition: ast_expr2.c:640
YYSIZE_T yystacksize
Definition: ast_expr2.c:1810
yytype_int16 yyss_alloc
Definition: ast_expr2.c:678
#define YYSTACK_RELOCATE(Stack_alloc, Stack)
Definition: ast_expr2.c:699
#define YYDPRINTF(Args)
Definition: ast_expr2.c:1223
if ( yychar  = YYEMPTY)

Definition at line 1963 of file ast_expr2.c.

References YYDPRINTF, and YYLEX.

1964  {
1965  YYDPRINTF ((stderr, "Reading a token: "));
1966  yychar = YYLEX;
1967  }
#define yychar
Definition: ast_expr2.c:69
#define YYLEX
Definition: ast_expr2.c:1055
#define YYDPRINTF(Args)
Definition: ast_expr2.c:1223
if ( yychar<=  YYEOF)

Definition at line 1969 of file ast_expr2.c.

References YYDPRINTF, and YYEOF.

1970  {
1971  yychar = yytoken = YYEOF;
1972  YYDPRINTF ((stderr, "Now at end of input.\n"));
1973  }
#define YYEOF
Definition: ast_expr2.c:965
#define yychar
Definition: ast_expr2.c:69
#define YYDPRINTF(Args)
Definition: ast_expr2.c:1223
int yytoken
Definition: ast_expr2.c:1815
if ( yyn<=  0)

Definition at line 1986 of file ast_expr2.c.

References yyerrlab, yyn, yyreduce, and yytable_value_is_error.

1987  {
1989  goto yyerrlab;
1990  yyn = -yyn;
1991  goto yyreduce;
1992  }
goto yyerrlab
Definition: ast_expr2.c:2017
#define yytable_value_is_error(yytable_value)
Definition: ast_expr2.c:927
int yyn
Definition: ast_expr2.c:1812
goto yyreduce
Definition: ast_expr2.c:2018
if ( yyerrstatus)

Definition at line 2368 of file ast_expr2.c.

References YY_, yyerror, yymsg, yymsgbuf, yynerrs, YYSTACK_ALLOC, YYSTACK_FREE, and YYSYNTAX_ERROR.

2369  {
2370  ++yynerrs;
2371 #if ! YYERROR_VERBOSE
2372  yyerror (YY_("syntax error"));
2373 #else
2374 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
2375  yyssp, yytoken)
2376  {
2377  char const *yymsgp = YY_("syntax error");
2378  int yysyntax_error_status;
2379  yysyntax_error_status = YYSYNTAX_ERROR;
2380  if (yysyntax_error_status == 0)
2381  yymsgp = yymsg;
2382  else if (yysyntax_error_status == 1)
2383  {
2384  if (yymsg != yymsgbuf)
2385  YYSTACK_FREE (yymsg);
2386  yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
2387  if (!yymsg)
2388  {
2389  yymsg = yymsgbuf;
2390  yymsg_alloc = sizeof yymsgbuf;
2391  yysyntax_error_status = 2;
2392  }
2393  else
2394  {
2395  yysyntax_error_status = YYSYNTAX_ERROR;
2396  yymsgp = yymsg;
2397  }
2398  }
2399  yyerror (yymsgp);
2400  if (yysyntax_error_status == 2)
2401  goto yyexhaustedlab;
2402  }
2403 # undef YYSYNTAX_ERROR
2404 #endif
2405  }
char yymsgbuf[128]
Definition: ast_expr2.c:1823
#define YYSTACK_ALLOC
Definition: ast_expr2.c:639
#define yyerror
Definition: ast_expr2.c:67
YYSIZE_T yymsg_alloc
Definition: ast_expr2.c:1825
#define yynerrs
Definition: ast_expr2.c:71
#define YYSYNTAX_ERROR
static void const char * yymsg
Definition: ast_expr2.c:1497
#define YY_(msgid)
Definition: ast_expr2.c:571
#define YYSTACK_FREE
Definition: ast_expr2.c:640
if ( yyerrstatus  = = 3)

Definition at line 2409 of file ast_expr2.c.

References YYABORT, yydestruct(), YYEMPTY, and YYEOF.

2410  {
2411  /* If just tried and failed to reuse lookahead token after an
2412  error, discard it. */
2413 
2414  if (yychar <= YYEOF)
2415  {
2416  /* Return failure if at end of input. */
2417  if (yychar == YYEOF)
2418  YYABORT;
2419  }
2420  else
2421  {
2422  yydestruct ("Error: discarding",
2423  yytoken, &yylval, &yylloc);
2424  yychar = YYEMPTY;
2425  }
2426  }
#define YYABORT
Definition: ast_expr2.c:968
#define YYEOF
Definition: ast_expr2.c:965
#define yychar
Definition: ast_expr2.c:69
#define YYEMPTY
Definition: ast_expr2.c:964
yydestruct("Cleanup: discarding lookahead", yytoken,&yylval,&yylloc)
#define yylloc
Definition: ast_expr2.c:72
#define yylval
Definition: ast_expr2.c:68
int yytoken
Definition: ast_expr2.c:1815
static int is_really_num ( char *  str)
static

Definition at line 2851 of file ast_expr2.c.

Referenced by op_func().

2852 {
2853  if ( strspn(str,"-0123456789. ") == strlen(str))
2854  return 1;
2855  else
2856  return 0;
2857 }
const char * str
Definition: app_jack.c:144
static int is_zero_or_null ( struct val vp)
static

Definition at line 2718 of file ast_expr2.c.

References AST_EXPR_number, val::i, val::s, to_number(), val::type, and val::u.

Referenced by op_and(), and op_or().

2719 {
2720  if (vp->type == AST_EXPR_number) {
2721  return (vp->u.i == 0);
2722  } else {
2723  return (*vp->u.s == 0 || (to_number(vp) && vp->u.i == 0));
2724  }
2725  /* NOTREACHED */
2726 }
FP___TYPE i
Definition: ast_expr2.c:329
enum valtype type
Definition: ast_expr2.c:326
char * s
Definition: ast_expr2.c:328
union val::@218 u
static int to_number(struct val *vp)
Definition: ast_expr2.c:2636
static int isstring ( struct val vp)
static

Definition at line 2710 of file ast_expr2.c.

References AST_EXPR_string, and val::type.

Referenced by op_cond(), op_eq(), op_ge(), op_gt(), op_le(), op_lt(), and op_ne().

2711 {
2712  /* only TRUE if this string is not a valid number */
2713  return (vp->type == AST_EXPR_string);
2714 }
enum valtype type
Definition: ast_expr2.c:326
static struct val* make_number ( FP___TYPE  i)
static

Definition at line 2576 of file ast_expr2.c.

References AST_EXPR_number, ast_log(), val::i, LOG_WARNING, malloc, val::type, and val::u.

Referenced by op_and(), op_colon(), op_compl(), op_div(), op_eq(), op_eqtilde(), op_func(), op_ge(), op_gt(), op_le(), op_lt(), op_minus(), op_ne(), op_negate(), op_plus(), op_rem(), and op_times().

2577 {
2578  struct val *vp;
2579 
2580  vp = (struct val *) malloc (sizeof (*vp));
2581  if (vp == NULL) {
2582  ast_log(LOG_WARNING, "malloc() failed\n");
2583  return(NULL);
2584  }
2585 
2586  vp->type = AST_EXPR_number;
2587  vp->u.i = i;
2588  return vp;
2589 }
#define malloc(a)
Definition: astmm.h:88
Definition: ast_expr2.c:325
FP___TYPE i
Definition: ast_expr2.c:329
#define LOG_WARNING
Definition: logger.h:144
enum valtype type
Definition: ast_expr2.c:326
union val::@218 u
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...
Definition: logger.c:1207
static struct val* make_str ( const char *  s)
static

Definition at line 2592 of file ast_expr2.c.

References AST_EXPR_numeric_string, AST_EXPR_string, ast_log(), free, val::i, LOG_WARNING, malloc, val::s, strdup, val::type, and val::u.

Referenced by op_colon(), op_eqtilde(), op_func(), op_tildetilde(), and switch().

2593 {
2594  struct val *vp;
2595  size_t i;
2596  int isint; /* this started out being a test for an integer, but then ended up being a test for a float */
2597 
2598  vp = (struct val *) malloc (sizeof (*vp));
2599  if (vp == NULL || ((vp->u.s = strdup (s)) == NULL)) {
2600  if (vp) {
2601  free(vp);
2602  }
2603  ast_log(LOG_WARNING,"malloc() failed\n");
2604  return(NULL);
2605  }
2606 
2607  for (i = 0, isint = (isdigit(s[0]) || s[0] == '-' || s[0]=='.'); isint && i < strlen(s); i++)
2608  {
2609  if (!isdigit(s[i]) && s[i] != '.') {
2610  isint = 0;
2611  break;
2612  }
2613  }
2614  if (isint)
2616  else
2617  vp->type = AST_EXPR_string;
2618 
2619  return vp;
2620 }
#define malloc(a)
Definition: astmm.h:88
Definition: ast_expr2.c:325
FP___TYPE i
Definition: ast_expr2.c:329
#define LOG_WARNING
Definition: logger.h:144
enum valtype type
Definition: ast_expr2.c:326
char * s
Definition: ast_expr2.c:328
union val::@218 u
#define free(a)
Definition: astmm.h:94
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...
Definition: logger.c:1207
#define strdup(a)
Definition: astmm.h:106
static struct val* op_and ( struct val a,
struct val b 
)
static

Definition at line 3156 of file ast_expr2.c.

References FP___TYPE, free_value(), is_zero_or_null(), and make_number().

Referenced by switch().

3157 {
3158  if (is_zero_or_null (a) || is_zero_or_null (b)) {
3159  free_value (a);
3160  free_value (b);
3161  return (make_number ((FP___TYPE)0.0));
3162  } else {
3163  free_value (b);
3164  return (a);
3165  }
3166 }
#define FP___TYPE
Definition: ast_expr2.c:111
static void free_value(struct val *vp)
Definition: ast_expr2.c:2624
static struct val * make_number(FP___TYPE i)
Definition: ast_expr2.c:2576
static int is_zero_or_null(struct val *vp)
Definition: ast_expr2.c:2718
static struct val* op_colon ( struct val a,
struct val b 
)
static

Definition at line 3607 of file ast_expr2.c.

References ast_log(), FP___TYPE, free_value(), LOG_WARNING, make_number(), make_str(), val::s, strip_quotes(), to_string(), and val::u.

Referenced by switch().

3608 {
3609  regex_t rp;
3610  regmatch_t rm[2];
3611  char errbuf[256];
3612  int eval;
3613  struct val *v;
3614 
3615  /* coerce to both arguments to strings */
3616  to_string(a);
3617  to_string(b);
3618  /* strip double quotes from both -- they'll screw up the pattern, and the search string starting at ^ */
3619  strip_quotes(a);
3620  strip_quotes(b);
3621  /* compile regular expression */
3622  if ((eval = regcomp (&rp, b->u.s, REG_EXTENDED)) != 0) {
3623  regerror (eval, &rp, errbuf, sizeof(errbuf));
3624  ast_log(LOG_WARNING, "regcomp() error : %s\n", errbuf);
3625  free_value(a);
3626  free_value(b);
3627  return make_str("");
3628  }
3629 
3630  /* compare string against pattern */
3631  /* remember that patterns are anchored to the beginning of the line */
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';
3635  v = make_str (a->u.s + rm[1].rm_so);
3636 
3637  } else {
3638  v = make_number ((FP___TYPE)(rm[0].rm_eo - rm[0].rm_so));
3639  }
3640  } else {
3641  if (rp.re_nsub == 0) {
3642  v = make_number ((FP___TYPE)0);
3643  } else {
3644  v = make_str ("");
3645  }
3646  }
3647 
3648  /* free arguments and pattern buffer */
3649  free_value (a);
3650  free_value (b);
3651  regfree (&rp);
3652 
3653  return v;
3654 }
Definition: ast_expr2.c:325
#define FP___TYPE
Definition: ast_expr2.c:111
#define LOG_WARNING
Definition: logger.h:144
static void to_string(struct val *vp)
Definition: ast_expr2.c:2690
char * s
Definition: ast_expr2.c:328
static struct val * make_str(const char *s)
Definition: ast_expr2.c:2592
union val::@218 u
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...
Definition: logger.c:1207
static void free_value(struct val *vp)
Definition: ast_expr2.c:2624
static struct val * make_number(FP___TYPE i)
Definition: ast_expr2.c:2576
static void strip_quotes(struct val *vp)
Definition: ast_expr2.c:2667
static struct val* op_compl ( struct val a)
static

Definition at line 3446 of file ast_expr2.c.

References AST_EXPR_number, AST_EXPR_numeric_string, AST_EXPR_string, free_value(), val::i, make_number(), val::s, val::type, and val::u.

Referenced by switch().

3447 {
3448  int v1 = 1;
3449  struct val *r;
3450 
3451  if( !a )
3452  {
3453  v1 = 0;
3454  }
3455  else
3456  {
3457  switch( a->type )
3458  {
3459  case AST_EXPR_number:
3460  if( a->u.i == 0 )
3461  v1 = 0;
3462  break;
3463 
3464  case AST_EXPR_string:
3465  if( a->u.s == 0 )
3466  v1 = 0;
3467  else
3468  {
3469  if( a->u.s[0] == 0 )
3470  v1 = 0;
3471  else if (strlen(a->u.s) == 1 && a->u.s[0] == '0' )
3472  v1 = 0;
3473  else
3474  v1 = atoi(a->u.s);
3475  }
3476  break;
3477 
3479  if( a->u.s == 0 )
3480  v1 = 0;
3481  else
3482  {
3483  if( a->u.s[0] == 0 )
3484  v1 = 0;
3485  else if (strlen(a->u.s) == 1 && a->u.s[0] == '0' )
3486  v1 = 0;
3487  else
3488  v1 = atoi(a->u.s);
3489  }
3490  break;
3491  }
3492  }
3493 
3494  r = make_number (!v1);
3495  free_value (a);
3496  return r;
3497 }
Definition: ast_expr2.c:325
FP___TYPE i
Definition: ast_expr2.c:329
enum valtype type
Definition: ast_expr2.c:326
char * s
Definition: ast_expr2.c:328
union val::@218 u
static void free_value(struct val *vp)
Definition: ast_expr2.c:2624
static struct val * make_number(FP___TYPE i)
Definition: ast_expr2.c:2576
static struct val* op_cond ( struct val a,
struct val b,
struct val c 
)
static

Definition at line 3276 of file ast_expr2.c.

References free_value(), val::i, isstring(), val::s, to_number(), and val::u.

Referenced by switch().

3277 {
3278  struct val *r;
3279 
3280  if( isstring(a) )
3281  {
3282  if( strlen(a->u.s) && strcmp(a->u.s, "\"\"") != 0 && strcmp(a->u.s,"0") != 0 )
3283  {
3284  free_value(a);
3285  free_value(c);
3286  r = b;
3287  }
3288  else
3289  {
3290  free_value(a);
3291  free_value(b);
3292  r = c;
3293  }
3294  }
3295  else
3296  {
3297  (void)to_number(a);
3298  if( a->u.i )
3299  {
3300  free_value(a);
3301  free_value(c);
3302  r = b;
3303  }
3304  else
3305  {
3306  free_value(a);
3307  free_value(b);
3308  r = c;
3309  }
3310  }
3311  return r;
3312 }
Definition: ast_expr2.c:325
FP___TYPE i
Definition: ast_expr2.c:329
char * s
Definition: ast_expr2.c:328
union val::@218 u
static int to_number(struct val *vp)
Definition: ast_expr2.c:2636
static int isstring(struct val *vp)
Definition: ast_expr2.c:2710
static void free_value(struct val *vp)
Definition: ast_expr2.c:2624
static struct val* op_div ( struct val a,
struct val b 
)
static

Definition at line 3545 of file ast_expr2.c.

References ast_log(), chk_div(), free_value(), val::i, LOG_WARNING, make_number(), to_number(), and val::u.

Referenced by switch().

3546 {
3547  struct val *r;
3548 
3549  if (!to_number (a)) {
3550  free_value(a);
3551  free_value(b);
3553  ast_log(LOG_WARNING, "non-numeric argument\n");
3554  return make_number(0);
3555  } else if (!to_number (b)) {
3556  free_value(a);
3557  free_value(b);
3559  ast_log(LOG_WARNING, "non-numeric argument\n");
3560  return make_number(INT_MAX);
3561  }
3562 
3563  if (b->u.i == 0) {
3564  ast_log(LOG_WARNING, "division by zero\n");
3565  free_value(a);
3566  free_value(b);
3567  return make_number(INT_MAX);
3568  }
3569 
3570  r = make_number (a->u.i / b->u.i);
3571  if (chk_div (a->u.i, b->u.i)) {
3572  ast_log(LOG_WARNING, "overflow\n");
3573  }
3574  free_value (a);
3575  free_value (b);
3576  return r;
3577 }
Definition: ast_expr2.c:325
FP___TYPE i
Definition: ast_expr2.c:329
#define LOG_WARNING
Definition: logger.h:144
int extra_error_message_supplied
Definition: ast_expr2f.c:2465
union val::@218 u
static int chk_div(FP___TYPE a, FP___TYPE b)
Definition: ast_expr2.c:3534
static int to_number(struct val *vp)
Definition: ast_expr2.c:2636
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...
Definition: logger.c:1207
static void free_value(struct val *vp)
Definition: ast_expr2.c:2624
static struct val * make_number(FP___TYPE i)
Definition: ast_expr2.c:2576
static struct val* op_eq ( struct val a,
struct val b 
)
static

Definition at line 3169 of file ast_expr2.c.

References ast_log(), FP___TYPE, free_value(), val::i, isstring(), LOG_WARNING, make_number(), val::s, to_number(), to_string(), and val::u.

Referenced by switch().

3170 {
3171  struct val *r;
3172 
3173  if (isstring (a) || isstring (b)) {
3174  to_string (a);
3175  to_string (b);
3176  r = make_number ((FP___TYPE)(strcoll (a->u.s, b->u.s) == 0));
3177  } else {
3178 #ifdef DEBUG_FOR_CONVERSIONS
3179  char buffer[2000];
3180  sprintf(buffer,"Converting '%s' and '%s' ", a->u.s, b->u.s);
3181 #endif
3182  (void)to_number(a);
3183  (void)to_number(b);
3184 #ifdef DEBUG_FOR_CONVERSIONS
3185  ast_log(LOG_WARNING,"%s to '%lld' and '%lld'\n", buffer, a->u.i, b->u.i);
3186 #endif
3187  r = make_number ((FP___TYPE)(a->u.i == b->u.i));
3188  }
3189 
3190  free_value (a);
3191  free_value (b);
3192  return r;
3193 }
Definition: ast_expr2.c:325
FP___TYPE i
Definition: ast_expr2.c:329
#define FP___TYPE
Definition: ast_expr2.c:111
#define LOG_WARNING
Definition: logger.h:144
static void to_string(struct val *vp)
Definition: ast_expr2.c:2690
char * s
Definition: ast_expr2.c:328
union val::@218 u
static int to_number(struct val *vp)
Definition: ast_expr2.c:2636
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...
Definition: logger.c:1207
static int isstring(struct val *vp)
Definition: ast_expr2.c:2710
static void free_value(struct val *vp)
Definition: ast_expr2.c:2624
static struct val * make_number(FP___TYPE i)
Definition: ast_expr2.c:2576
static struct val* op_eqtilde ( struct val a,
struct val b 
)
static

Definition at line 3658 of file ast_expr2.c.

References ast_log(), FP___TYPE, free_value(), LOG_WARNING, make_number(), make_str(), val::s, strip_quotes(), to_string(), and val::u.

Referenced by switch().

3659 {
3660  regex_t rp;
3661  regmatch_t rm[2];
3662  char errbuf[256];
3663  int eval;
3664  struct val *v;
3665 
3666  /* coerce to both arguments to strings */
3667  to_string(a);
3668  to_string(b);
3669  /* strip double quotes from both -- they'll screw up the pattern, and the search string starting at ^ */
3670  strip_quotes(a);
3671  strip_quotes(b);
3672  /* compile regular expression */
3673  if ((eval = regcomp (&rp, b->u.s, REG_EXTENDED)) != 0) {
3674  regerror (eval, &rp, errbuf, sizeof(errbuf));
3675  ast_log(LOG_WARNING, "regcomp() error : %s\n", errbuf);
3676  free_value(a);
3677  free_value(b);
3678  return make_str("");
3679  }
3680 
3681  /* compare string against pattern */
3682  /* remember that patterns are anchored to the beginning of the line */
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';
3686  v = make_str (a->u.s + rm[1].rm_so);
3687 
3688  } else {
3689  v = make_number ((FP___TYPE)(rm[0].rm_eo - rm[0].rm_so));
3690  }
3691  } else {
3692  if (rp.re_nsub == 0) {
3693  v = make_number ((FP___TYPE)0.0);
3694  } else {
3695  v = make_str ("");
3696  }
3697  }
3698 
3699  /* free arguments and pattern buffer */
3700  free_value (a);
3701  free_value (b);
3702  regfree (&rp);
3703 
3704  return v;
3705 }
Definition: ast_expr2.c:325
#define FP___TYPE
Definition: ast_expr2.c:111
#define LOG_WARNING
Definition: logger.h:144
static void to_string(struct val *vp)
Definition: ast_expr2.c:2690
char * s
Definition: ast_expr2.c:328
static struct val * make_str(const char *s)
Definition: ast_expr2.c:2592
union val::@218 u
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...
Definition: logger.c:1207
static void free_value(struct val *vp)
Definition: ast_expr2.c:2624
static struct val * make_number(FP___TYPE i)
Definition: ast_expr2.c:2576
static void strip_quotes(struct val *vp)
Definition: ast_expr2.c:2667
static struct val * op_func ( struct val funcname,
struct expr_node arglist,
struct ast_channel chan 
)
static

Definition at line 2860 of file ast_expr2.c.

References ast_custom_function_find(), ast_log(), compose_func_args(), f, FP___TYPE, free, FUNC_ACOS, FUNC_ASIN, FUNC_ATAN, FUNC_ATAN2, FUNC_CEIL, FUNC_COS, FUNC_EXP, FUNC_EXP10, FUNC_EXP2, FUNC_FLOOR, FUNC_LOG, FUNC_LOG10, FUNC_LOG2, FUNC_POW, FUNC_REMAINDER, FUNC_RINT, FUNC_ROUND, FUNC_SIN, FUNC_SQRT, FUNC_STRTOD, FUNC_TAN, FUNC_TRUNC, val::i, is_really_num(), LOG_ERROR, LOG_WARNING, make_number(), make_str(), ast_custom_function::read, expr_node::right, val::s, to_number(), val::u, and expr_node::val.

Referenced by switch().

2861 {
2862  if (strspn(funcname->u.s,"ABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789") == strlen(funcname->u.s))
2863  {
2864  struct val *result;
2865  if (0) {
2866 #ifdef FUNC_COS
2867  } else if (strcmp(funcname->u.s,"COS") == 0) {
2868  if (arglist && !arglist->right && arglist->val){
2869  to_number(arglist->val);
2870  result = make_number(FUNC_COS(arglist->val->u.i));
2871  return result;
2872  } else {
2873  ast_log(LOG_WARNING,"Wrong args to %s() function\n",funcname->u.s);
2874  return make_number(0.0);
2875  }
2876 #endif
2877 #ifdef FUNC_SIN
2878  } else if (strcmp(funcname->u.s,"SIN") == 0) {
2879  if (arglist && !arglist->right && arglist->val){
2880  to_number(arglist->val);
2881  result = make_number(FUNC_SIN(arglist->val->u.i));
2882  return result;
2883  } else {
2884  ast_log(LOG_WARNING,"Wrong args to %s() function\n",funcname->u.s);
2885  return make_number(0.0);
2886  }
2887 #endif
2888 #ifdef FUNC_TAN
2889  } else if (strcmp(funcname->u.s,"TAN") == 0) {
2890  if (arglist && !arglist->right && arglist->val){
2891  to_number(arglist->val);
2892  result = make_number(FUNC_TAN(arglist->val->u.i));
2893  return result;
2894  } else {
2895  ast_log(LOG_WARNING,"Wrong args to %s() function\n",funcname->u.s);
2896  return make_number(0.0);
2897  }
2898 #endif
2899 #ifdef FUNC_ACOS
2900  } else if (strcmp(funcname->u.s,"ACOS") == 0) {
2901  if (arglist && !arglist->right && arglist->val){
2902  to_number(arglist->val);
2903  result = make_number(FUNC_ACOS(arglist->val->u.i));
2904  return result;
2905  } else {
2906  ast_log(LOG_WARNING,"Wrong args to %s() function\n",funcname->u.s);
2907  return make_number(0.0);
2908  }
2909 #endif
2910 #ifdef FUNC_ASIN
2911  } else if (strcmp(funcname->u.s,"ASIN") == 0) {
2912  if (arglist && !arglist->right && arglist->val){
2913  to_number(arglist->val);
2914  result = make_number(FUNC_ASIN(arglist->val->u.i));
2915  return result;
2916  } else {
2917  ast_log(LOG_WARNING,"Wrong args to %s() function\n",funcname->u.s);
2918  return make_number(0.0);
2919  }
2920 #endif
2921 #ifdef FUNC_ATAN
2922  } else if (strcmp(funcname->u.s,"ATAN") == 0) {
2923  if (arglist && !arglist->right && arglist->val){
2924  to_number(arglist->val);
2925  result = make_number(FUNC_ATAN(arglist->val->u.i));
2926  return result;
2927  } else {
2928  ast_log(LOG_WARNING,"Wrong args to %s() function\n",funcname->u.s);
2929  return make_number(0.0);
2930  }
2931 #endif
2932 #ifdef FUNC_ATAN2
2933  } else if (strcmp(funcname->u.s,"ATAN2") == 0) {
2934  if (arglist && arglist->right && !arglist->right->right && arglist->val && arglist->right->val){
2935  to_number(arglist->val);
2936  to_number(arglist->right->val);
2937  result = make_number(FUNC_ATAN2(arglist->val->u.i, arglist->right->val->u.i));
2938  return result;
2939  } else {
2940  ast_log(LOG_WARNING,"Wrong args to %s() function\n",funcname->u.s);
2941  return make_number(0.0);
2942  }
2943 #endif
2944 #ifdef FUNC_POW
2945  } else if (strcmp(funcname->u.s,"POW") == 0) {
2946  if (arglist && arglist->right && !arglist->right->right && arglist->val && arglist->right->val){
2947  to_number(arglist->val);
2948  to_number(arglist->right->val);
2949  result = make_number(FUNC_POW(arglist->val->u.i, arglist->right->val->u.i));
2950  return result;
2951  } else {
2952  ast_log(LOG_WARNING,"Wrong args to %s() function\n",funcname->u.s);
2953  return make_number(0.0);
2954  }
2955 #endif
2956 #ifdef FUNC_SQRT
2957  } else if (strcmp(funcname->u.s,"SQRT") == 0) {
2958  if (arglist && !arglist->right && arglist->val){
2959  to_number(arglist->val);
2960  result = make_number(FUNC_SQRT(arglist->val->u.i));
2961  return result;
2962  } else {
2963  ast_log(LOG_WARNING,"Wrong args to %s() function\n",funcname->u.s);
2964  return make_number(0.0);
2965  }
2966 #endif
2967 #ifdef FUNC_FLOOR
2968  } else if (strcmp(funcname->u.s,"FLOOR") == 0) {
2969  if (arglist && !arglist->right && arglist->val){
2970  to_number(arglist->val);
2971  result = make_number(FUNC_FLOOR(arglist->val->u.i));
2972  return result;
2973  } else {
2974  ast_log(LOG_WARNING,"Wrong args to %s() function\n",funcname->u.s);
2975  return make_number(0.0);
2976  }
2977 #endif
2978 #ifdef FUNC_CEIL
2979  } else if (strcmp(funcname->u.s,"CEIL") == 0) {
2980  if (arglist && !arglist->right && arglist->val){
2981  to_number(arglist->val);
2982  result = make_number(FUNC_CEIL(arglist->val->u.i));
2983  return result;
2984  } else {
2985  ast_log(LOG_WARNING,"Wrong args to %s() function\n",funcname->u.s);
2986  return make_number(0.0);
2987  }
2988 #endif
2989 #ifdef FUNC_ROUND
2990  } else if (strcmp(funcname->u.s,"ROUND") == 0) {
2991  if (arglist && !arglist->right && arglist->val){
2992  to_number(arglist->val);
2993  result = make_number(FUNC_ROUND(arglist->val->u.i));
2994  return result;
2995  } else {
2996  ast_log(LOG_WARNING,"Wrong args to %s() function\n",funcname->u.s);
2997  return make_number(0.0);
2998  }
2999 #endif /* defined(FUNC_ROUND) */
3000 #ifdef FUNC_RINT
3001  } else if (strcmp(funcname->u.s,"RINT") == 0) {
3002  if (arglist && !arglist->right && arglist->val){
3003  to_number(arglist->val);
3004  result = make_number(FUNC_RINT(arglist->val->u.i));
3005  return result;
3006  } else {
3007  ast_log(LOG_WARNING,"Wrong args to %s() function\n",funcname->u.s);
3008  return make_number(0.0);
3009  }
3010 #endif
3011 #ifdef FUNC_TRUNC
3012  } else if (strcmp(funcname->u.s,"TRUNC") == 0) {
3013  if (arglist && !arglist->right && arglist->val){
3014  to_number(arglist->val);
3015  result = make_number(FUNC_TRUNC(arglist->val->u.i));
3016  return result;
3017  } else {
3018  ast_log(LOG_WARNING,"Wrong args to %s() function\n",funcname->u.s);
3019  return make_number(0.0);
3020  }
3021 #endif /* defined(FUNC_TRUNC) */
3022 #ifdef FUNC_EXP
3023  } else if (strcmp(funcname->u.s,"EXP") == 0) {
3024  if (arglist && !arglist->right && arglist->val){
3025  to_number(arglist->val);
3026  result = make_number(FUNC_EXP(arglist->val->u.i));
3027  return result;
3028  } else {
3029  ast_log(LOG_WARNING,"Wrong args to %s() function\n",funcname->u.s);
3030  return make_number(0.0);
3031  }
3032 #endif
3033 #ifdef FUNC_EXP2
3034  } else if (strcmp(funcname->u.s,"EXP2") == 0) {
3035  if (arglist && !arglist->right && arglist->val){
3036  to_number(arglist->val);
3037  result = make_number(FUNC_EXP2(arglist->val->u.i));
3038  return result;
3039  } else {
3040  ast_log(LOG_WARNING,"Wrong args to %s() function\n",funcname->u.s);
3041  return make_number(0.0);
3042  }
3043 #endif
3044 #ifdef FUNC_EXP10
3045  } else if (strcmp(funcname->u.s,"EXP10") == 0) {
3046  if (arglist && !arglist->right && arglist->val){
3047  to_number(arglist->val);
3048  result = make_number(FUNC_EXP10(arglist->val->u.i));
3049  return result;
3050  } else {
3051  ast_log(LOG_WARNING,"Wrong args to %s() function\n",funcname->u.s);
3052  return make_number(0.0);
3053  }
3054 #endif
3055 #ifdef FUNC_LOG
3056  } else if (strcmp(funcname->u.s,"LOG") == 0) {
3057  if (arglist && !arglist->right && arglist->val){
3058  to_number(arglist->val);
3059  result = make_number(FUNC_LOG(arglist->val->u.i));
3060  return result;
3061  } else {
3062  ast_log(LOG_WARNING,"Wrong args to %s() function\n",funcname->u.s);
3063  return make_number(0.0);
3064  }
3065 #endif
3066 #ifdef FUNC_LOG2
3067  } else if (strcmp(funcname->u.s,"LOG2") == 0) {
3068  if (arglist && !arglist->right && arglist->val){
3069  to_number(arglist->val);
3070  result = make_number(FUNC_LOG2(arglist->val->u.i));
3071  return result;
3072  } else {
3073  ast_log(LOG_WARNING,"Wrong args to %s() function\n",funcname->u.s);
3074  return make_number(0.0);
3075  }
3076 #endif
3077 #ifdef FUNC_LOG10
3078  } else if (strcmp(funcname->u.s,"LOG10") == 0) {
3079  if (arglist && !arglist->right && arglist->val){
3080  to_number(arglist->val);
3081  result = make_number(FUNC_LOG10(arglist->val->u.i));
3082  return result;
3083  } else {
3084  ast_log(LOG_WARNING,"Wrong args to %s() function\n",funcname->u.s);
3085  return make_number(0.0);
3086  }
3087 #endif
3088 #ifdef FUNC_REMAINDER
3089  } else if (strcmp(funcname->u.s,"REMAINDER") == 0) {
3090  if (arglist && arglist->right && !arglist->right->right && arglist->val && arglist->right->val){
3091  to_number(arglist->val);
3092  to_number(arglist->right->val);
3093  result = make_number(FUNC_REMAINDER(arglist->val->u.i, arglist->right->val->u.i));
3094  return result;
3095  } else {
3096  ast_log(LOG_WARNING,"Wrong args to %s() function\n",funcname->u.s);
3097  return make_number(0.0);
3098  }
3099 #endif
3100  } else {
3101  /* is this a custom function we should execute and collect the results of? */
3102 #if !defined(STANDALONE) && !defined(STANDALONE2)
3103  struct ast_custom_function *f = ast_custom_function_find(funcname->u.s);
3104  if (!chan)
3105  ast_log(LOG_WARNING,"Hey! chan is NULL.\n");
3106  if (!f)
3107  ast_log(LOG_WARNING,"Hey! could not find func %s.\n", funcname->u.s);
3108 
3109  if (f && chan) {
3110  if (f->read) {
3111  char workspace[512];
3112  char *argbuf = compose_func_args(arglist);
3113  f->read(chan, funcname->u.s, argbuf, workspace, sizeof(workspace));
3114  free(argbuf);
3115  if (is_really_num(workspace))
3116  return make_number(FUNC_STRTOD(workspace,(char **)NULL));
3117  else
3118  return make_str(workspace);
3119  } else {
3120  ast_log(LOG_ERROR,"Error! Function '%s' cannot be read!\n", funcname->u.s);
3121  return (make_number ((FP___TYPE)0.0));
3122  }
3123 
3124  } else {
3125  ast_log(LOG_ERROR, "Error! '%s' doesn't appear to be an available function!\n", funcname->u.s);
3126  return (make_number ((FP___TYPE)0.0));
3127  }
3128 #else
3129  ast_log(LOG_ERROR, "Error! '%s' is not available in the standalone version!\n", funcname->u.s);
3130  return (make_number ((FP___TYPE)0.0));
3131 #endif
3132  }
3133  }
3134  else
3135  {
3136  ast_log(LOG_ERROR, "Error! '%s' is not possibly a function name!\n", funcname->u.s);
3137  return (make_number ((FP___TYPE)0.0));
3138  }
3139  return (make_number ((FP___TYPE)0.0));
3140 }
#define FUNC_STRTOD
Definition: ast_expr2.c:199
#define FUNC_ATAN
Definition: ast_expr2.c:145
#define FUNC_FLOOR
Definition: ast_expr2.c:205
#define FUNC_LOG2
Definition: ast_expr2.c:249
#define FUNC_CEIL
Definition: ast_expr2.c:211
Definition: ast_expr2.c:325
FP___TYPE i
Definition: ast_expr2.c:329
#define FP___TYPE
Definition: ast_expr2.c:111
#define LOG_WARNING
Definition: logger.h:144
#define FUNC_SIN
Definition: ast_expr2.c:121
#define FUNC_EXP10
Definition: ast_expr2.c:241
char * s
Definition: ast_expr2.c:328
static struct val * make_str(const char *s)
Definition: ast_expr2.c:2592
struct expr_node * right
Definition: ast_expr2.c:342
#define FUNC_TRUNC
Definition: ast_expr2.c:223
#define FUNC_ATAN2
Definition: ast_expr2.c:151
Data structure associated with a custom dialplan function.
Definition: pbx.h:95
union val::@218 u
#define FUNC_LOG
Definition: ast_expr2.c:181
#define FUNC_ACOS
Definition: ast_expr2.c:133
struct ast_custom_function * ast_custom_function_find(const char *name)
Definition: pbx.c:3800
static char * compose_func_args(struct expr_node *arglist)
Definition: ast_expr2.c:2809
#define LOG_ERROR
Definition: logger.h:155
#define free(a)
Definition: astmm.h:94
static int to_number(struct val *vp)
Definition: ast_expr2.c:2636
#define FUNC_ASIN
Definition: ast_expr2.c:139
struct val * val
Definition: ast_expr2.c:340
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...
Definition: logger.c:1207
#define FUNC_RINT
Definition: ast_expr2.c:169
#define FUNC_EXP2
Definition: ast_expr2.c:233
#define FUNC_COS
Definition: ast_expr2.c:115
#define FUNC_LOG10
Definition: ast_expr2.c:261
static struct ast_format f[]
Definition: format_g726.c:181
ast_acf_read_fn_t read
Definition: pbx.h:106
#define FUNC_SQRT
Definition: ast_expr2.c:163
#define FUNC_TAN
Definition: ast_expr2.c:127
#define FUNC_POW
Definition: ast_expr2.c:157
static struct val * make_number(FP___TYPE i)
Definition: ast_expr2.c:2576
#define FUNC_EXP
Definition: ast_expr2.c:175
#define FUNC_ROUND
Definition: ast_expr2.c:217
static int is_really_num(char *str)
Definition: ast_expr2.c:2851
#define FUNC_REMAINDER
Definition: ast_expr2.c:187
static struct val* op_ge ( struct val a,
struct val b 
)
static

Definition at line 3236 of file ast_expr2.c.

References FP___TYPE, free_value(), val::i, isstring(), make_number(), val::s, to_number(), to_string(), and val::u.

Referenced by switch().

3237 {
3238  struct val *r;
3239 
3240  if (isstring (a) || isstring (b)) {
3241  to_string (a);
3242  to_string (b);
3243  r = make_number ((FP___TYPE)(strcoll (a->u.s, b->u.s) >= 0));
3244  } else {
3245  (void)to_number(a);
3246  (void)to_number(b);
3247  r = make_number ((FP___TYPE)(a->u.i >= b->u.i));
3248  }
3249 
3250  free_value (a);
3251  free_value (b);
3252  return r;
3253 }
Definition: ast_expr2.c:325
FP___TYPE i
Definition: ast_expr2.c:329
#define FP___TYPE
Definition: ast_expr2.c:111
static void to_string(struct val *vp)
Definition: ast_expr2.c:2690
char * s
Definition: ast_expr2.c:328
union val::@218 u
static int to_number(struct val *vp)
Definition: ast_expr2.c:2636
static int isstring(struct val *vp)
Definition: ast_expr2.c:2710
static void free_value(struct val *vp)
Definition: ast_expr2.c:2624
static struct val * make_number(FP___TYPE i)
Definition: ast_expr2.c:2576
static struct val* op_gt ( struct val a,
struct val b 
)
static

Definition at line 3196 of file ast_expr2.c.

References FP___TYPE, free_value(), val::i, isstring(), make_number(), val::s, to_number(), to_string(), and val::u.

Referenced by switch().

3197 {
3198  struct val *r;
3199 
3200  if (isstring (a) || isstring (b)) {
3201  to_string (a);
3202  to_string (b);
3203  r = make_number ((FP___TYPE)(strcoll (a->u.s, b->u.s) > 0));
3204  } else {
3205  (void)to_number(a);
3206  (void)to_number(b);
3207  r = make_number ((FP___TYPE)(a->u.i > b->u.i));
3208  }
3209 
3210  free_value (a);
3211  free_value (b);
3212  return r;
3213 }
Definition: ast_expr2.c:325
FP___TYPE i
Definition: ast_expr2.c:329
#define FP___TYPE
Definition: ast_expr2.c:111
static void to_string(struct val *vp)
Definition: ast_expr2.c:2690
char * s
Definition: ast_expr2.c:328
union val::@218 u
static int to_number(struct val *vp)
Definition: ast_expr2.c:2636
static int isstring(struct val *vp)
Definition: ast_expr2.c:2710
static void free_value(struct val *vp)
Definition: ast_expr2.c:2624
static struct val * make_number(FP___TYPE i)
Definition: ast_expr2.c:2576
static struct val* op_le ( struct val a,
struct val b 
)
static

Definition at line 3256 of file ast_expr2.c.

References FP___TYPE, free_value(), val::i, isstring(), make_number(), val::s, to_number(), to_string(), and val::u.

Referenced by switch().

3257 {
3258  struct val *r;
3259 
3260  if (isstring (a) || isstring (b)) {
3261  to_string (a);
3262  to_string (b);
3263  r = make_number ((FP___TYPE)(strcoll (a->u.s, b->u.s) <= 0));
3264  } else {
3265  (void)to_number(a);
3266  (void)to_number(b);
3267  r = make_number ((FP___TYPE)(a->u.i <= b->u.i));
3268  }
3269 
3270  free_value (a);
3271  free_value (b);
3272  return r;
3273 }
Definition: ast_expr2.c:325
FP___TYPE i
Definition: ast_expr2.c:329
#define FP___TYPE
Definition: ast_expr2.c:111
static void to_string(struct val *vp)
Definition: ast_expr2.c:2690
char * s
Definition: ast_expr2.c:328
union val::@218 u
static int to_number(struct val *vp)
Definition: ast_expr2.c:2636
static int isstring(struct val *vp)
Definition: ast_expr2.c:2710
static void free_value(struct val *vp)
Definition: ast_expr2.c:2624
static struct val * make_number(FP___TYPE i)
Definition: ast_expr2.c:2576
static struct val* op_lt ( struct val a,
struct val b 
)
static

Definition at line 3216 of file ast_expr2.c.

References FP___TYPE, free_value(), val::i, isstring(), make_number(), val::s, to_number(), to_string(), and val::u.

Referenced by switch().

3217 {
3218  struct val *r;
3219 
3220  if (isstring (a) || isstring (b)) {
3221  to_string (a);
3222  to_string (b);
3223  r = make_number ((FP___TYPE)(strcoll (a->u.s, b->u.s) < 0));
3224  } else {
3225  (void)to_number(a);
3226  (void)to_number(b);
3227  r = make_number ((FP___TYPE)(a->u.i < b->u.i));
3228  }
3229 
3230  free_value (a);
3231  free_value (b);
3232  return r;
3233 }
Definition: ast_expr2.c:325
FP___TYPE i
Definition: ast_expr2.c:329
#define FP___TYPE
Definition: ast_expr2.c:111
static void to_string(struct val *vp)
Definition: ast_expr2.c:2690
char * s
Definition: ast_expr2.c:328
union val::@218 u
static int to_number(struct val *vp)
Definition: ast_expr2.c:2636
static int isstring(struct val *vp)
Definition: ast_expr2.c:2710
static void free_value(struct val *vp)
Definition: ast_expr2.c:2624
static struct val * make_number(FP___TYPE i)
Definition: ast_expr2.c:2576
static struct val* op_minus ( struct val a,
struct val b 
)
static

Definition at line 3392 of file ast_expr2.c.

References ast_log(), chk_minus(), free_value(), val::i, LOG_WARNING, make_number(), to_number(), and val::u.

Referenced by switch().

3393 {
3394  struct val *r;
3395 
3396  if (!to_number (a)) {
3398  ast_log(LOG_WARNING, "non-numeric argument\n");
3399  if (!to_number (b)) {
3400  free_value(a);
3401  free_value(b);
3402  return make_number(0);
3403  } else {
3404  r = make_number(0 - b->u.i);
3405  free_value(a);
3406  free_value(b);
3407  return (r);
3408  }
3409  } else if (!to_number(b)) {
3411  ast_log(LOG_WARNING, "non-numeric argument\n");
3412  free_value(b);
3413  return (a);
3414  }
3415 
3416  r = make_number (a->u.i - b->u.i);
3417  if (chk_minus (a->u.i, b->u.i, r->u.i)) {
3418  ast_log(LOG_WARNING, "overflow\n");
3419  }
3420  free_value (a);
3421  free_value (b);
3422  return r;
3423 }
Definition: ast_expr2.c:325
FP___TYPE i
Definition: ast_expr2.c:329
#define LOG_WARNING
Definition: logger.h:144
int extra_error_message_supplied
Definition: ast_expr2f.c:2465
static int chk_minus(FP___TYPE a, FP___TYPE b, FP___TYPE r)
Definition: ast_expr2.c:3378
union val::@218 u
static int to_number(struct val *vp)
Definition: ast_expr2.c:2636
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...
Definition: logger.c:1207
static void free_value(struct val *vp)
Definition: ast_expr2.c:2624
static struct val * make_number(FP___TYPE i)
Definition: ast_expr2.c:2576
static struct val* op_ne ( struct val a,
struct val b 
)
static

Definition at line 3315 of file ast_expr2.c.

References FP___TYPE, free_value(), val::i, isstring(), make_number(), val::s, to_number(), to_string(), and val::u.

Referenced by switch().

3316 {
3317  struct val *r;
3318 
3319  if (isstring (a) || isstring (b)) {
3320  to_string (a);
3321  to_string (b);
3322  r = make_number ((FP___TYPE)(strcoll (a->u.s, b->u.s) != 0));
3323  } else {
3324  (void)to_number(a);
3325  (void)to_number(b);
3326  r = make_number ((FP___TYPE)(a->u.i != b->u.i));
3327  }
3328 
3329  free_value (a);
3330  free_value (b);
3331  return r;
3332 }
Definition: ast_expr2.c:325
FP___TYPE i
Definition: ast_expr2.c:329
#define FP___TYPE
Definition: ast_expr2.c:111
static void to_string(struct val *vp)
Definition: ast_expr2.c:2690
char * s
Definition: ast_expr2.c:328
union val::@218 u
static int to_number(struct val *vp)
Definition: ast_expr2.c:2636
static int isstring(struct val *vp)
Definition: ast_expr2.c:2710
static void free_value(struct val *vp)
Definition: ast_expr2.c:2624
static struct val * make_number(FP___TYPE i)
Definition: ast_expr2.c:2576
static struct val* op_negate ( struct val a)
static

Definition at line 3426 of file ast_expr2.c.

References ast_log(), chk_minus(), free_value(), val::i, LOG_WARNING, make_number(), to_number(), and val::u.

Referenced by switch().

3427 {
3428  struct val *r;
3429 
3430  if (!to_number (a) ) {
3431  free_value(a);
3433  ast_log(LOG_WARNING, "non-numeric argument\n");
3434  return make_number(0);
3435  }
3436 
3437  r = make_number (- a->u.i);
3438  if (chk_minus (0, a->u.i, r->u.i)) {
3439  ast_log(LOG_WARNING, "overflow\n");
3440  }
3441  free_value (a);
3442  return r;
3443 }
Definition: ast_expr2.c:325
FP___TYPE i
Definition: ast_expr2.c:329
#define LOG_WARNING
Definition: logger.h:144
int extra_error_message_supplied
Definition: ast_expr2f.c:2465
static int chk_minus(FP___TYPE a, FP___TYPE b, FP___TYPE r)
Definition: ast_expr2.c:3378
union val::@218 u
static int to_number(struct val *vp)
Definition: ast_expr2.c:2636
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...
Definition: logger.c:1207
static void free_value(struct val *vp)
Definition: ast_expr2.c:2624
static struct val * make_number(FP___TYPE i)
Definition: ast_expr2.c:2576
static struct val* op_or ( struct val a,
struct val b 
)
static

Definition at line 3144 of file ast_expr2.c.

References free_value(), and is_zero_or_null().

Referenced by switch().

3145 {
3146  if (is_zero_or_null (a)) {
3147  free_value (a);
3148  return (b);
3149  } else {
3150  free_value (b);
3151  return (a);
3152  }
3153 }
static void free_value(struct val *vp)
Definition: ast_expr2.c:2624
static int is_zero_or_null(struct val *vp)
Definition: ast_expr2.c:2718
static struct val* op_plus ( struct val a,
struct val b 
)
static

Definition at line 3348 of file ast_expr2.c.

References ast_log(), chk_plus(), free_value(), val::i, LOG_WARNING, make_number(), to_number(), and val::u.

Referenced by switch().

3349 {
3350  struct val *r;
3351 
3352  if (!to_number (a)) {
3354  ast_log(LOG_WARNING,"non-numeric argument\n");
3355  if (!to_number (b)) {
3356  free_value(a);
3357  free_value(b);
3358  return make_number(0);
3359  } else {
3360  free_value(a);
3361  return (b);
3362  }
3363  } else if (!to_number(b)) {
3364  free_value(b);
3365  return (a);
3366  }
3367 
3368  r = make_number (a->u.i + b->u.i);
3369  if (chk_plus (a->u.i, b->u.i, r->u.i)) {
3370  ast_log(LOG_WARNING,"overflow\n");
3371  }
3372  free_value (a);
3373  free_value (b);
3374  return r;
3375 }
Definition: ast_expr2.c:325
FP___TYPE i
Definition: ast_expr2.c:329
#define LOG_WARNING
Definition: logger.h:144
int extra_error_message_supplied
Definition: ast_expr2f.c:2465
union val::@218 u
static int to_number(struct val *vp)
Definition: ast_expr2.c:2636
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...
Definition: logger.c:1207
static int chk_plus(FP___TYPE a, FP___TYPE b, FP___TYPE r)
Definition: ast_expr2.c:3335
static void free_value(struct val *vp)
Definition: ast_expr2.c:2624
static struct val * make_number(FP___TYPE i)
Definition: ast_expr2.c:2576
static struct val* op_rem ( struct val a,
struct val b 
)
static

Definition at line 3580 of file ast_expr2.c.

References ast_log(), free_value(), FUNC_FMOD, val::i, LOG_WARNING, make_number(), to_number(), and val::u.

Referenced by switch().

3581 {
3582  struct val *r;
3583 
3584  if (!to_number (a) || !to_number (b)) {
3586  ast_log(LOG_WARNING, "non-numeric argument\n");
3587  free_value(a);
3588  free_value(b);
3589  return make_number(0);
3590  }
3591 
3592  if (b->u.i == 0) {
3593  ast_log(LOG_WARNING, "div by zero\n");
3594  free_value(a);
3595  return(b);
3596  }
3597 
3598  r = make_number (FUNC_FMOD(a->u.i, b->u.i)); /* either fmod or fmodl if FP___TYPE is available */
3599  /* chk_rem necessary ??? */
3600  free_value (a);
3601  free_value (b);
3602  return r;
3603 }
Definition: ast_expr2.c:325
FP___TYPE i
Definition: ast_expr2.c:329
#define LOG_WARNING
Definition: logger.h:144
#define FUNC_FMOD
Definition: ast_expr2.c:193
int extra_error_message_supplied
Definition: ast_expr2f.c:2465
union val::@218 u
static int to_number(struct val *vp)
Definition: ast_expr2.c:2636
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...
Definition: logger.c:1207
static void free_value(struct val *vp)
Definition: ast_expr2.c:2624
static struct val * make_number(FP___TYPE i)
Definition: ast_expr2.c:2576
static struct val* op_tildetilde ( struct val a,
struct val b 
)
static

Definition at line 3708 of file ast_expr2.c.

References free_value(), make_str(), malloc, val::s, strip_quotes(), to_string(), and val::u.

Referenced by switch().

3709 {
3710  struct val *v;
3711  char *vs;
3712 
3713  /* coerce to both arguments to strings */
3714  to_string(a);
3715  to_string(b);
3716  /* strip double quotes from both -- */
3717  strip_quotes(a);
3718  strip_quotes(b);
3719 
3720  vs = malloc(strlen(a->u.s)+strlen(b->u.s)+1);
3721  strcpy(vs,a->u.s);
3722  strcat(vs,b->u.s);
3723 
3724  v = make_str(vs);
3725 
3726  /* free arguments */
3727  free_value(a);
3728  free_value(b);
3729 
3730  return v;
3731 }
#define malloc(a)
Definition: astmm.h:88
Definition: ast_expr2.c:325
static void to_string(struct val *vp)
Definition: ast_expr2.c:2690
char * s
Definition: ast_expr2.c:328
static struct val * make_str(const char *s)
Definition: ast_expr2.c:2592
union val::@218 u
static void free_value(struct val *vp)
Definition: ast_expr2.c:2624
static void strip_quotes(struct val *vp)
Definition: ast_expr2.c:2667
static struct val* op_times ( struct val a,
struct val b 
)
static

Definition at line 3512 of file ast_expr2.c.

References ast_log(), chk_times(), free_value(), val::i, LOG_WARNING, make_number(), to_number(), and val::u.

Referenced by switch().

3513 {
3514  struct val *r;
3515 
3516  if (!to_number (a) || !to_number (b)) {
3517  free_value(a);
3518  free_value(b);
3520  ast_log(LOG_WARNING, "non-numeric argument\n");
3521  return(make_number(0));
3522  }
3523 
3524  r = make_number (a->u.i * b->u.i);
3525  if (chk_times (a->u.i, b->u.i, r->u.i)) {
3526  ast_log(LOG_WARNING, "overflow\n");
3527  }
3528  free_value (a);
3529  free_value (b);
3530  return (r);
3531 }
Definition: ast_expr2.c:325
FP___TYPE i
Definition: ast_expr2.c:329
static int chk_times(FP___TYPE a, FP___TYPE b, FP___TYPE r)
Definition: ast_expr2.c:3500
#define LOG_WARNING
Definition: logger.h:144
int extra_error_message_supplied
Definition: ast_expr2f.c:2465
union val::@218 u
static int to_number(struct val *vp)
Definition: ast_expr2.c:2636
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...
Definition: logger.c:1207
static void free_value(struct val *vp)
Definition: ast_expr2.c:2624
static struct val * make_number(FP___TYPE i)
Definition: ast_expr2.c:2576
static void strip_quotes ( struct val vp)
static

Definition at line 2667 of file ast_expr2.c.

References AST_EXPR_numeric_string, AST_EXPR_string, f, val::s, val::type, and val::u.

Referenced by op_colon(), op_eqtilde(), and op_tildetilde().

2668 {
2669  if (vp->type != AST_EXPR_string && vp->type != AST_EXPR_numeric_string)
2670  return;
2671 
2672  if( vp->u.s[0] == '"' && vp->u.s[strlen(vp->u.s)-1] == '"' )
2673  {
2674  char *f, *t;
2675  f = vp->u.s;
2676  t = vp->u.s;
2677 
2678  while( *f )
2679  {
2680  if( *f && *f != '"' )
2681  *t++ = *f++;
2682  else
2683  f++;
2684  }
2685  *t = *f;
2686  }
2687 }
enum valtype type
Definition: ast_expr2.c:326
char * s
Definition: ast_expr2.c:328
union val::@218 u
static struct ast_format f[]
Definition: format_g726.c:181
switch ( yytype  )

Definition at line 1510 of file ast_expr2.c.

References free_value(), and YYSTYPE::val.

Referenced by ast_stun_handle_packet(), handle_timers(), and manager_event_handler().

1511  {
1512  case 4: /* "TOK_COLONCOLON" */
1513 
1514 /* Line 1391 of yacc.c */
1515 #line 368 "ast_expr2.y"
1516  { free_value((yyvaluep->val)); };
1517 
1518 /* Line 1391 of yacc.c */
1519 #line 1520 "ast_expr2.c"
1520  break;
1521  case 5: /* "TOK_COND" */
1522 
1523 /* Line 1391 of yacc.c */
1524 #line 368 "ast_expr2.y"
1525  { free_value((yyvaluep->val)); };
1526 
1527 /* Line 1391 of yacc.c */
1528 #line 1529 "ast_expr2.c"
1529  break;
1530  case 6: /* "TOK_OR" */
1531 
1532 /* Line 1391 of yacc.c */
1533 #line 368 "ast_expr2.y"
1534  { free_value((yyvaluep->val)); };
1535 
1536 /* Line 1391 of yacc.c */
1537 #line 1538 "ast_expr2.c"
1538  break;
1539  case 7: /* "TOK_AND" */
1540 
1541 /* Line 1391 of yacc.c */
1542 #line 368 "ast_expr2.y"
1543  { free_value((yyvaluep->val)); };
1544 
1545 /* Line 1391 of yacc.c */
1546 #line 1547 "ast_expr2.c"
1547  break;
1548  case 8: /* "TOK_NE" */
1549 
1550 /* Line 1391 of yacc.c */
1551 #line 368 "ast_expr2.y"
1552  { free_value((yyvaluep->val)); };
1553 
1554 /* Line 1391 of yacc.c */
1555 #line 1556 "ast_expr2.c"
1556  break;
1557  case 9: /* "TOK_LE" */
1558 
1559 /* Line 1391 of yacc.c */
1560 #line 368 "ast_expr2.y"
1561  { free_value((yyvaluep->val)); };
1562 
1563 /* Line 1391 of yacc.c */
1564 #line 1565 "ast_expr2.c"
1565  break;
1566  case 10: /* "TOK_GE" */
1567 
1568 /* Line 1391 of yacc.c */
1569 #line 368 "ast_expr2.y"
1570  { free_value((yyvaluep->val)); };
1571 
1572 /* Line 1391 of yacc.c */
1573 #line 1574 "ast_expr2.c"
1574  break;
1575  case 11: /* "TOK_LT" */
1576 
1577 /* Line 1391 of yacc.c */
1578 #line 368 "ast_expr2.y"
1579  { free_value((yyvaluep->val)); };
1580 
1581 /* Line 1391 of yacc.c */
1582 #line 1583 "ast_expr2.c"
1583  break;
1584  case 12: /* "TOK_GT" */
1585 
1586 /* Line 1391 of yacc.c */
1587 #line 368 "ast_expr2.y"
1588  { free_value((yyvaluep->val)); };
1589 
1590 /* Line 1391 of yacc.c */
1591 #line 1592 "ast_expr2.c"
1592  break;
1593  case 13: /* "TOK_EQ" */
1594 
1595 /* Line 1391 of yacc.c */
1596 #line 368 "ast_expr2.y"
1597  { free_value((yyvaluep->val)); };
1598 
1599 /* Line 1391 of yacc.c */
1600 #line 1601 "ast_expr2.c"
1601  break;
1602  case 14: /* "TOK_MINUS" */
1603 
1604 /* Line 1391 of yacc.c */
1605 #line 368 "ast_expr2.y"
1606  { free_value((yyvaluep->val)); };
1607 
1608 /* Line 1391 of yacc.c */
1609 #line 1610 "ast_expr2.c"
1610  break;
1611  case 15: /* "TOK_PLUS" */
1612 
1613 /* Line 1391 of yacc.c */
1614 #line 368 "ast_expr2.y"
1615  { free_value((yyvaluep->val)); };
1616 
1617 /* Line 1391 of yacc.c */
1618 #line 1619 "ast_expr2.c"
1619  break;
1620  case 16: /* "TOK_MOD" */
1621 
1622 /* Line 1391 of yacc.c */
1623 #line 368 "ast_expr2.y"
1624  { free_value((yyvaluep->val)); };
1625 
1626 /* Line 1391 of yacc.c */
1627 #line 1628 "ast_expr2.c"
1628  break;
1629  case 17: /* "TOK_DIV" */
1630 
1631 /* Line 1391 of yacc.c */
1632 #line 368 "ast_expr2.y"
1633  { free_value((yyvaluep->val)); };
1634 
1635 /* Line 1391 of yacc.c */
1636 #line 1637 "ast_expr2.c"
1637  break;
1638  case 18: /* "TOK_MULT" */
1639 
1640 /* Line 1391 of yacc.c */
1641 #line 368 "ast_expr2.y"
1642  { free_value((yyvaluep->val)); };
1643 
1644 /* Line 1391 of yacc.c */
1645 #line 1646 "ast_expr2.c"
1646  break;
1647  case 19: /* "TOK_COMPL" */
1648 
1649 /* Line 1391 of yacc.c */
1650 #line 368 "ast_expr2.y"
1651  { free_value((yyvaluep->val)); };
1652 
1653 /* Line 1391 of yacc.c */
1654 #line 1655 "ast_expr2.c"
1655  break;
1656  case 20: /* "TOK_TILDETILDE" */
1657 
1658 /* Line 1391 of yacc.c */
1659 #line 368 "ast_expr2.y"
1660  { free_value((yyvaluep->val)); };
1661 
1662 /* Line 1391 of yacc.c */
1663 #line 1664 "ast_expr2.c"
1664  break;
1665  case 21: /* "TOK_EQTILDE" */
1666 
1667 /* Line 1391 of yacc.c */
1668 #line 368 "ast_expr2.y"
1669  { free_value((yyvaluep->val)); };
1670 
1671 /* Line 1391 of yacc.c */
1672 #line 1673 "ast_expr2.c"
1673  break;
1674  case 22: /* "TOK_COLON" */
1675 
1676 /* Line 1391 of yacc.c */
1677 #line 368 "ast_expr2.y"
1678  { free_value((yyvaluep->val)); };
1679 
1680 /* Line 1391 of yacc.c */
1681 #line 1682 "ast_expr2.c"
1682  break;
1683  case 23: /* "TOK_LP" */
1684 
1685 /* Line 1391 of yacc.c */
1686 #line 368 "ast_expr2.y"
1687  { free_value((yyvaluep->val)); };
1688 
1689 /* Line 1391 of yacc.c */
1690 #line 1691 "ast_expr2.c"
1691  break;
1692  case 24: /* "TOK_RP" */
1693 
1694 /* Line 1391 of yacc.c */
1695 #line 368 "ast_expr2.y"
1696  { free_value((yyvaluep->val)); };
1697 
1698 /* Line 1391 of yacc.c */
1699 #line 1700 "ast_expr2.c"
1700  break;
1701  case 25: /* "TOKEN" */
1702 
1703 /* Line 1391 of yacc.c */
1704 #line 368 "ast_expr2.y"
1705  { free_value((yyvaluep->val)); };
1706 
1707 /* Line 1391 of yacc.c */
1708 #line 1709 "ast_expr2.c"
1709  break;
1710  case 29: /* "expr" */
1711 
1712 /* Line 1391 of yacc.c */
1713 #line 368 "ast_expr2.y"
1714  { free_value((yyvaluep->val)); };
1715 
1716 /* Line 1391 of yacc.c */
1717 #line 1718 "ast_expr2.c"
1718  break;
1719 
1720  default:
1721  break;
1722  }
struct val * val
Definition: ast_expr2.c:478
static void free_value(struct val *vp)
Definition: ast_expr2.c:2624
YYSTYPE * yyvaluep
Definition: ast_expr2.c:1499
switch ( yyn  )

Definition at line 2041 of file ast_expr2.c.

References alloc_expr_node(), YYSTYPE::arglist, AST_EXPR_NODE_VAL, AST_EXPR_number, AST_EXPR_string, calloc, DESTROY, destroy_arglist(), first_column, first_line, free, val::i, make_str(), op_and(), op_colon(), op_compl(), op_cond(), op_div(), op_eq(), op_eqtilde(), op_func(), op_ge(), op_gt(), op_le(), op_lt(), op_minus(), op_ne(), op_negate(), op_or(), op_plus(), op_rem(), op_tildetilde(), op_times(), parseio, expr_node::right, val::s, strdup, type, val::u, expr_node::val, YYSTYPE::val, and yyloc.

2042  {
2043  case 2:
2044 
2045 /* Line 1806 of yacc.c */
2046 #line 374 "ast_expr2.y"
2047  { ((struct parse_io *)parseio)->val = (struct val *)calloc(sizeof(struct val),1);
2048  ((struct parse_io *)parseio)->val->type = (yyvsp[(1) - (1)].val)->type;
2049  if( (yyvsp[(1) - (1)].val)->type == AST_EXPR_number )
2050  ((struct parse_io *)parseio)->val->u.i = (yyvsp[(1) - (1)].val)->u.i;
2051  else
2052  ((struct parse_io *)parseio)->val->u.s = (yyvsp[(1) - (1)].val)->u.s;
2053  free((yyvsp[(1) - (1)].val));
2054  }
2055  break;
2056 
2057  case 3:
2058 
2059 /* Line 1806 of yacc.c */
2060 #line 382 "ast_expr2.y"
2061  {/* nothing */ ((struct parse_io *)parseio)->val = (struct val *)calloc(sizeof(struct val),1);
2062  ((struct parse_io *)parseio)->val->type = AST_EXPR_string;
2063  ((struct parse_io *)parseio)->val->u.s = strdup("");
2064  }
2065  break;
2066 
2067  case 4:
2068 
2069 /* Line 1806 of yacc.c */
2070 #line 389 "ast_expr2.y"
2072  break;
2073 
2074  case 5:
2075 
2076 /* Line 1806 of yacc.c */
2077 #line 390 "ast_expr2.y"
2079  struct expr_node *t;
2080  DESTROY((yyvsp[(2) - (3)].val));
2081  for (t=(yyvsp[(1) - (3)].arglist);t->right;t=t->right)
2082  ;
2083  (yyval.arglist) = (yyvsp[(1) - (3)].arglist); t->right = x; x->val = (yyvsp[(3) - (3)].val);}
2084  break;
2085 
2086  case 6:
2087 
2088 /* Line 1806 of yacc.c */
2089 #line 396 "ast_expr2.y"
2091  struct expr_node *t; /* NULL args should OK */
2092  DESTROY((yyvsp[(2) - (2)].val));
2093  for (t=(yyvsp[(1) - (2)].arglist);t->right;t=t->right)
2094  ;
2095  (yyval.arglist) = (yyvsp[(1) - (2)].arglist); t->right = x; x->val = make_str("");}
2096  break;
2097 
2098  case 7:
2099 
2100 /* Line 1806 of yacc.c */
2101 #line 405 "ast_expr2.y"
2102  { (yyval.val) = op_func((yyvsp[(1) - (4)].val),(yyvsp[(3) - (4)].arglist), ((struct parse_io *)parseio)->chan);
2103  DESTROY((yyvsp[(2) - (4)].val));
2104  DESTROY((yyvsp[(4) - (4)].val));
2105  DESTROY((yyvsp[(1) - (4)].val));
2106  destroy_arglist((yyvsp[(3) - (4)].arglist));
2107  }
2108  break;
2109 
2110  case 8:
2111 
2112 /* Line 1806 of yacc.c */
2113 #line 411 "ast_expr2.y"
2114  {(yyval.val) = (yyvsp[(1) - (1)].val);}
2115  break;
2116 
2117  case 9:
2118 
2119 /* Line 1806 of yacc.c */
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;
2123  (yyloc).first_line=0; (yyloc).last_line=0;
2124  DESTROY((yyvsp[(1) - (3)].val)); DESTROY((yyvsp[(3) - (3)].val)); }
2125  break;
2126 
2127  case 10:
2128 
2129 /* Line 1806 of yacc.c */
2130 #line 416 "ast_expr2.y"
2131  { (yyval.val) = op_or ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val));
2132  DESTROY((yyvsp[(2) - (3)].val));
2133  (yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column;
2134  (yyloc).first_line=0; (yyloc).last_line=0;}
2135  break;
2136 
2137  case 11:
2138 
2139 /* Line 1806 of yacc.c */
2140 #line 420 "ast_expr2.y"
2141  { (yyval.val) = op_and ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val));
2142  DESTROY((yyvsp[(2) - (3)].val));
2143  (yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column;
2144  (yyloc).first_line=0; (yyloc).last_line=0;}
2145  break;
2146 
2147  case 12:
2148 
2149 /* Line 1806 of yacc.c */
2150 #line 424 "ast_expr2.y"
2151  { (yyval.val) = op_eq ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val));
2152  DESTROY((yyvsp[(2) - (3)].val));
2153  (yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column;
2154  (yyloc).first_line=0; (yyloc).last_line=0;}
2155  break;
2156 
2157  case 13:
2158 
2159 /* Line 1806 of yacc.c */
2160 #line 428 "ast_expr2.y"
2161  { (yyval.val) = op_gt ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val));
2162  DESTROY((yyvsp[(2) - (3)].val));
2163  (yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column;
2164  (yyloc).first_line=0; (yyloc).last_line=0;}
2165  break;
2166 
2167  case 14:
2168 
2169 /* Line 1806 of yacc.c */
2170 #line 432 "ast_expr2.y"
2171  { (yyval.val) = op_lt ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val));
2172  DESTROY((yyvsp[(2) - (3)].val));
2173  (yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column;
2174  (yyloc).first_line=0; (yyloc).last_line=0;}
2175  break;
2176 
2177  case 15:
2178 
2179 /* Line 1806 of yacc.c */
2180 #line 436 "ast_expr2.y"
2181  { (yyval.val) = op_ge ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val));
2182  DESTROY((yyvsp[(2) - (3)].val));
2183  (yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column;
2184  (yyloc).first_line=0; (yyloc).last_line=0;}
2185  break;
2186 
2187  case 16:
2188 
2189 /* Line 1806 of yacc.c */
2190 #line 440 "ast_expr2.y"
2191  { (yyval.val) = op_le ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val));
2192  DESTROY((yyvsp[(2) - (3)].val));
2193  (yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column;
2194  (yyloc).first_line=0; (yyloc).last_line=0;}
2195  break;
2196 
2197  case 17:
2198 
2199 /* Line 1806 of yacc.c */
2200 #line 444 "ast_expr2.y"
2201  { (yyval.val) = op_ne ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val));
2202  DESTROY((yyvsp[(2) - (3)].val));
2203  (yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column;
2204  (yyloc).first_line=0; (yyloc).last_line=0;}
2205  break;
2206 
2207  case 18:
2208 
2209 /* Line 1806 of yacc.c */
2210 #line 448 "ast_expr2.y"
2211  { (yyval.val) = op_plus ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val));
2212  DESTROY((yyvsp[(2) - (3)].val));
2213  (yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column;
2214  (yyloc).first_line=0; (yyloc).last_line=0;}
2215  break;
2216 
2217  case 19:
2218 
2219 /* Line 1806 of yacc.c */
2220 #line 452 "ast_expr2.y"
2221  { (yyval.val) = op_minus ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val));
2222  DESTROY((yyvsp[(2) - (3)].val));
2223  (yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column;
2224  (yyloc).first_line=0; (yyloc).last_line=0;}
2225  break;
2226 
2227  case 20:
2228 
2229 /* Line 1806 of yacc.c */
2230 #line 456 "ast_expr2.y"
2231  { (yyval.val) = op_negate ((yyvsp[(2) - (2)].val));
2232  DESTROY((yyvsp[(1) - (2)].val));
2233  (yyloc).first_column = (yylsp[(1) - (2)]).first_column; (yyloc).last_column = (yylsp[(2) - (2)]).last_column;
2234  (yyloc).first_line=0; (yyloc).last_line=0;}
2235  break;
2236 
2237  case 21:
2238 
2239 /* Line 1806 of yacc.c */
2240 #line 460 "ast_expr2.y"
2241  { (yyval.val) = op_compl ((yyvsp[(2) - (2)].val));
2242  DESTROY((yyvsp[(1) - (2)].val));
2243  (yyloc).first_column = (yylsp[(1) - (2)]).first_column; (yyloc).last_column = (yylsp[(2) - (2)]).last_column;
2244  (yyloc).first_line=0; (yyloc).last_line=0;}
2245  break;
2246 
2247  case 22:
2248 
2249 /* Line 1806 of yacc.c */
2250 #line 464 "ast_expr2.y"
2251  { (yyval.val) = op_times ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val));
2252  DESTROY((yyvsp[(2) - (3)].val));
2253  (yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column;
2254  (yyloc).first_line=0; (yyloc).last_line=0;}
2255  break;
2256 
2257  case 23:
2258 
2259 /* Line 1806 of yacc.c */
2260 #line 468 "ast_expr2.y"
2261  { (yyval.val) = op_div ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val));
2262  DESTROY((yyvsp[(2) - (3)].val));
2263  (yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column;
2264  (yyloc).first_line=0; (yyloc).last_line=0;}
2265  break;
2266 
2267  case 24:
2268 
2269 /* Line 1806 of yacc.c */
2270 #line 472 "ast_expr2.y"
2271  { (yyval.val) = op_rem ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val));
2272  DESTROY((yyvsp[(2) - (3)].val));
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;}
2275  break;
2276 
2277  case 25:
2278 
2279 /* Line 1806 of yacc.c */
2280 #line 476 "ast_expr2.y"
2281  { (yyval.val) = op_colon ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val));
2282  DESTROY((yyvsp[(2) - (3)].val));
2283  (yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column;
2284  (yyloc).first_line=0; (yyloc).last_line=0;}
2285  break;
2286 
2287  case 26:
2288 
2289 /* Line 1806 of yacc.c */
2290 #line 480 "ast_expr2.y"
2291  { (yyval.val) = op_eqtilde ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val));
2292  DESTROY((yyvsp[(2) - (3)].val));
2293  (yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column;
2294  (yyloc).first_line=0; (yyloc).last_line=0;}
2295  break;
2296 
2297  case 27:
2298 
2299 /* Line 1806 of yacc.c */
2300 #line 484 "ast_expr2.y"
2301  { (yyval.val) = op_cond ((yyvsp[(1) - (5)].val), (yyvsp[(3) - (5)].val), (yyvsp[(5) - (5)].val));
2302  DESTROY((yyvsp[(2) - (5)].val));
2303  DESTROY((yyvsp[(4) - (5)].val));
2304  (yyloc).first_column = (yylsp[(1) - (5)]).first_column; (yyloc).last_column = (yylsp[(3) - (5)]).last_column;
2305  (yyloc).first_line=0; (yyloc).last_line=0;}
2306  break;
2307 
2308  case 28:
2309 
2310 /* Line 1806 of yacc.c */
2311 #line 489 "ast_expr2.y"
2312  { (yyval.val) = op_tildetilde ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val));
2313  DESTROY((yyvsp[(2) - (3)].val));
2314  (yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column;
2315  (yyloc).first_line=0; (yyloc).last_line=0;}
2316  break;
2317 
2318 
2319 
2320 /* Line 1806 of yacc.c */
2321 #line 2322 "ast_expr2.c"
2322  default: break;
2323  }
static struct val * op_gt(struct val *a, struct val *b)
Definition: ast_expr2.c:3196
struct parse_io * parseio
Definition: ael.tab.c:1485
static struct val * op_ge(struct val *a, struct val *b)
Definition: ast_expr2.c:3236
static struct val * op_eqtilde(struct val *a, struct val *b)
Definition: ast_expr2.c:3658
Definition: ast_expr2.c:325
FP___TYPE i
Definition: ast_expr2.c:329
static struct val * op_rem(struct val *a, struct val *b)
Definition: ast_expr2.c:3580
yylloc first_column
Definition: ast_expr2.c:1858
YYLTYPE * yylsp
Definition: ast_expr2.c:1805
struct val * val
Definition: ast_expr2.c:478
static struct val * op_le(struct val *a, struct val *b)
Definition: ast_expr2.c:3256
static struct val * op_colon(struct val *a, struct val *b)
Definition: ast_expr2.c:3607
struct expr_node * arglist
Definition: ast_expr2.c:479
static struct expr_node * alloc_expr_node(enum node_type)
Definition: ast_expr2.c:2562
#define calloc(a, b)
Definition: astmm.h:79
char * s
Definition: ast_expr2.c:328
static struct val * make_str(const char *s)
Definition: ast_expr2.c:2592
struct expr_node * right
Definition: ast_expr2.c:342
static struct val * op_div(struct val *a, struct val *b)
Definition: ast_expr2.c:3545
static void destroy_arglist(struct expr_node *arglist)
Definition: ast_expr2.c:2792
static struct val * op_cond(struct val *a, struct val *b, struct val *c)
Definition: ast_expr2.c:3276
static struct val * op_and(struct val *a, struct val *b)
Definition: ast_expr2.c:3156
YYSTYPE yyval
Definition: ast_expr2.c:1818
YYSTYPE * yyvsp
Definition: ast_expr2.c:1800
union val::@218 u
static struct val * op_tildetilde(struct val *a, struct val *b)
Definition: ast_expr2.c:3708
static struct val * op_func(struct val *funcname, struct expr_node *arglist, struct ast_channel *chan)
Definition: ast_expr2.c:2860
#define free(a)
Definition: astmm.h:94
static struct val * op_compl(struct val *a)
Definition: ast_expr2.c:3446
struct val * val
Definition: ast_expr2.c:340
static struct val * op_minus(struct val *a, struct val *b)
Definition: ast_expr2.c:3392
static struct val * op_lt(struct val *a, struct val *b)
Definition: ast_expr2.c:3216
static const char type[]
Definition: chan_nbs.c:57
static struct val * op_plus(struct val *a, struct val *b)
Definition: ast_expr2.c:3348
#define DESTROY(x)
Definition: ast_expr2.c:412
YYLTYPE yyloc
Definition: ast_expr2.c:1819
static struct val * op_ne(struct val *a, struct val *b)
Definition: ast_expr2.c:3315
static struct val * op_negate(struct val *a)
Definition: ast_expr2.c:3426
static struct val * op_or(struct val *a, struct val *b)
Definition: ast_expr2.c:3144
#define strdup(a)
Definition: astmm.h:106
static struct val * op_times(struct val *a, struct val *b)
Definition: ast_expr2.c:3512
static struct val * op_eq(struct val *a, struct val *b)
Definition: ast_expr2.c:3169
yylloc first_line
Definition: ast_expr2.c:1857
static int to_number ( struct val vp)
static

Definition at line 2636 of file ast_expr2.c.

References AST_EXPR_number, AST_EXPR_string, ast_log(), errno, FP___TYPE, free, FUNC_STRTOD, val::i, LOG_WARNING, val::s, val::type, and val::u.

Referenced by is_zero_or_null(), op_cond(), op_div(), op_eq(), op_func(), op_ge(), op_gt(), op_le(), op_lt(), op_minus(), op_ne(), op_negate(), op_plus(), op_rem(), and op_times().

2637 {
2638  FP___TYPE i;
2639 
2640  if (vp == NULL) {
2641  ast_log(LOG_WARNING,"vp==NULL in to_number()\n");
2642  return(0);
2643  }
2644 
2645  if (vp->type == AST_EXPR_number)
2646  return 1;
2647 
2648  if (vp->type == AST_EXPR_string)
2649  return 0;
2650 
2651  /* vp->type == AST_EXPR_numeric_string, make it numeric */
2652  errno = 0;
2653  i = FUNC_STRTOD(vp->u.s, (char**)0); /* either strtod, or strtold on a good day */
2654  if (errno != 0) {
2655  ast_log(LOG_WARNING,"Conversion of %s to number under/overflowed!\n", vp->u.s);
2656  free(vp->u.s);
2657  vp->u.s = 0;
2658  return(0);
2659  }
2660  free (vp->u.s);
2661  vp->u.i = i;
2662  vp->type = AST_EXPR_number;
2663  return 1;
2664 }
#define FUNC_STRTOD
Definition: ast_expr2.c:199
FP___TYPE i
Definition: ast_expr2.c:329
#define FP___TYPE
Definition: ast_expr2.c:111
#define LOG_WARNING
Definition: logger.h:144
enum valtype type
Definition: ast_expr2.c:326
char * s
Definition: ast_expr2.c:328
union val::@218 u
#define free(a)
Definition: astmm.h:94
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...
Definition: logger.c:1207
int errno
static void to_string ( struct val vp)
static

Definition at line 2690 of file ast_expr2.c.

References AST_EXPR_numeric_string, AST_EXPR_string, ast_log(), FP___PRINTF, val::i, LOG_WARNING, malloc, val::s, val::type, and val::u.

Referenced by op_colon(), op_eq(), op_eqtilde(), op_ge(), op_gt(), op_le(), op_lt(), op_ne(), and op_tildetilde().

2691 {
2692  char *tmp;
2693 
2694  if (vp->type == AST_EXPR_string || vp->type == AST_EXPR_numeric_string)
2695  return;
2696 
2697  tmp = malloc ((size_t)25);
2698  if (tmp == NULL) {
2699  ast_log(LOG_WARNING,"malloc() failed\n");
2700  return;
2701  }
2702 
2703  sprintf(tmp, FP___PRINTF, vp->u.i);
2704  vp->type = AST_EXPR_string;
2705  vp->u.s = tmp;
2706 }
#define malloc(a)
Definition: astmm.h:88
FP___TYPE i
Definition: ast_expr2.c:329
#define LOG_WARNING
Definition: logger.h:144
enum valtype type
Definition: ast_expr2.c:326
char * s
Definition: ast_expr2.c:328
union val::@218 u
#define FP___PRINTF
Definition: ast_expr2.c:110
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...
Definition: logger.c:1207
while ( yyssp!  = yyss)

Definition at line 2538 of file ast_expr2.c.

References yydestruct(), and YYPOPSTACK.

Referenced by timesub(), and tzload().

2539  {
2540  yydestruct ("Cleanup: popping",
2541  yystos[*yyssp], yyvsp, yylsp);
2542  YYPOPSTACK (1);
2543  }
#define YYPOPSTACK(N)
Definition: ast_expr2.c:1828
yytype_int16 * yyssp
Definition: ast_expr2.c:1795
YYLTYPE * yylsp
Definition: ast_expr2.c:1805
YYSTYPE * yyvsp
Definition: ast_expr2.c:1800
yydestruct("Cleanup: discarding lookahead", yytoken,&yylval,&yylloc)
static const yytype_uint8 yystos[]
Definition: ast_expr2.c:952
YY_REDUCE_PRINT ( yyn  )
YY_STACK_PRINT ( yyss  ,
yyssp   
)
YY_SYMBOL_PRINT ( yymsg  ,
yytype  ,
yyvaluep  ,
yylocationp   
)
YY_SYMBOL_PRINT ( "Next token is"  ,
yytoken  ,
yylval,
yylloc 
)
YY_SYMBOL_PRINT ( "Shifting"  ,
yytoken  ,
yylval,
yylloc 
)
YY_SYMBOL_PRINT ( )
YY_SYMBOL_PRINT ( "Shifting"  ,
yystos  [yyn],
yyvsp  ,
yylsp   
)
yydestruct ( "Cleanup: discarding lookahead"  ,
yytoken  ,
yylval,
yylloc 
)

Referenced by for(), if(), and while().

YYDPRINTF ( (stderr,"Starting parse\n")  )
YYDPRINTF ( (stderr,"Entering state %d\n", yystate)  )
return YYID ( yyresult  )
YYLLOC_DEFAULT ( yyloc  ,
(yylsp-yylen ,
yylen   
)
YYLLOC_DEFAULT ( yyloc  ,
yyerror_range  ,
 
)
int yyparse ( )
YYPOPSTACK ( yylen  )
YYSTACK_FREE ( yyss  )
YYSTACK_FREE ( yymsg  )
static int yysyntax_error ( YYSIZE_T yymsg_alloc,
char **  yymsg,
yytype_int16 yyssp,
int  yytoken 
)
static

Definition at line 1357 of file ast_expr2.c.

References YY_, YYCASE_, YYEMPTY, YYLAST, yymsg, yyn, YYNTOKENS, yypact_value_is_default, YYSIZE_T, yyssp, YYSTACK_ALLOC_MAXIMUM, yytable_value_is_error, YYTERROR, yytnamerr(), and yytoken.

1359 {
1360  YYSIZE_T yysize0 = yytnamerr (0, yytname[yytoken]);
1361  YYSIZE_T yysize = yysize0;
1362  YYSIZE_T yysize1;
1363  enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1364  /* Internationalized format string. */
1365  const char *yyformat = 0;
1366  /* Arguments of yyformat. */
1367  char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1368  /* Number of reported tokens (one for the "unexpected", one per
1369  "expected"). */
1370  int yycount = 0;
1371 
1372  /* There are many possibilities here to consider:
1373  - Assume YYFAIL is not used. It's too flawed to consider. See
1374  <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>
1375  for details. YYERROR is fine as it does not invoke this
1376  function.
1377  - If this state is a consistent state with a default action, then
1378  the only way this function was invoked is if the default action
1379  is an error action. In that case, don't check for expected
1380  tokens because there are none.
1381  - The only way there can be no lookahead present (in yychar) is if
1382  this state is a consistent state with a default action. Thus,
1383  detecting the absence of a lookahead is sufficient to determine
1384  that there is no unexpected or expected token to report. In that
1385  case, just report a simple "syntax error".
1386  - Don't assume there isn't a lookahead just because this state is a
1387  consistent state with a default action. There might have been a
1388  previous inconsistent state, consistent state with a non-default
1389  action, or user semantic action that manipulated yychar.
1390  - Of course, the expected token list depends on states to have
1391  correct lookahead information, and it depends on the parser not
1392  to perform extra reductions after fetching a lookahead from the
1393  scanner and before detecting a syntax error. Thus, state merging
1394  (from LALR or IELR) and default reductions corrupt the expected
1395  token list. However, the list is correct for canonical LR with
1396  one exception: it will still contain any token that will not be
1397  accepted due to an error action in a later state.
1398  */
1399  if (yytoken != YYEMPTY)
1400  {
1401  int yyn = yypact[*yyssp];
1402  yyarg[yycount++] = yytname[yytoken];
1403  if (!yypact_value_is_default (yyn))
1404  {
1405  /* Start YYX at -YYN if negative to avoid negative indexes in
1406  YYCHECK. In other words, skip the first -YYN actions for
1407  this state because they are default actions. */
1408  int yyxbegin = yyn < 0 ? -yyn : 0;
1409  /* Stay within bounds of both yycheck and yytname. */
1410  int yychecklim = YYLAST - yyn + 1;
1411  int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1412  int yyx;
1413 
1414  for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1415  if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
1416  && !yytable_value_is_error (yytable[yyx + yyn]))
1417  {
1418  if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1419  {
1420  yycount = 1;
1421  yysize = yysize0;
1422  break;
1423  }
1424  yyarg[yycount++] = yytname[yyx];
1425  yysize1 = yysize + yytnamerr (0, yytname[yyx]);
1426  if (! (yysize <= yysize1
1427  && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1428  return 2;
1429  yysize = yysize1;
1430  }
1431  }
1432  }
1433 
1434  switch (yycount)
1435  {
1436 # define YYCASE_(N, S) \
1437  case N: \
1438  yyformat = S; \
1439  break
1440  YYCASE_(0, YY_("syntax error"));
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"));
1446 # undef YYCASE_
1447  }
1448 
1449  yysize1 = yysize + yystrlen (yyformat);
1450  if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1451  return 2;
1452  yysize = yysize1;
1453 
1454  if (*yymsg_alloc < yysize)
1455  {
1456  *yymsg_alloc = 2 * yysize;
1457  if (! (yysize <= *yymsg_alloc
1460  return 1;
1461  }
1462 
1463  /* Avoid sprintf, as that infringes on the user's name space.
1464  Don't have undefined behavior even if the translation
1465  produced a string with the wrong number of "%s"s. */
1466  {
1467  char *yyp = *yymsg;
1468  int yyi = 0;
1469  while ((*yyp = *yyformat) != '\0')
1470  if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1471  {
1472  yyp += yytnamerr (yyp, yyarg[yyi++]);
1473  yyformat += 2;
1474  }
1475  else
1476  {
1477  yyp++;
1478  yyformat++;
1479  }
1480  }
1481  return 0;
1482 }
YYSIZE_T yymsg_alloc
Definition: ast_expr2.c:1825
static const yytype_uint8 yytable[]
Definition: ast_expr2.c:904
yytype_int16 * yyssp
Definition: ast_expr2.c:1795
static const yytype_int16 yypact[]
Definition: ast_expr2.c:884
#define yypact_value_is_default(yystate)
Definition: ast_expr2.c:924
#define YYSTACK_ALLOC_MAXIMUM
Definition: ast_expr2.c:642
static YYSIZE_T yytnamerr(char *yyres, const char *yystr)
Definition: ast_expr2.c:1309
#define YYTERROR
Definition: ast_expr2.c:1006
#define YYSIZE_T
Definition: ast_expr2.c:557
#define yytable_value_is_error(yytable_value)
Definition: ast_expr2.c:927
#define YYEMPTY
Definition: ast_expr2.c:964
int yyn
Definition: ast_expr2.c:1812
#define YYLAST
Definition: ast_expr2.c:735
#define YYNTOKENS
Definition: ast_expr2.c:738
static void const char * yymsg
Definition: ast_expr2.c:1497
static const char *const yytname[]
Definition: ast_expr2.c:825
#define YY_(msgid)
Definition: ast_expr2.c:571
static const yytype_int8 yycheck[]
Definition: ast_expr2.c:930
#define YYCASE_(N, S)
int yytoken
Definition: ast_expr2.c:1815
static YYSIZE_T yytnamerr ( char *  yyres,
const char *  yystr 
)
static

Definition at line 1309 of file ast_expr2.c.

References yyn, YYSIZE_T, and yystr.

Referenced by yysyntax_error().

1310 {
1311  if (*yystr == '"')
1312  {
1313  YYSIZE_T yyn = 0;
1314  char const *yyp = yystr;
1315 
1316  for (;;)
1317  switch (*++yyp)
1318  {
1319  case '\'':
1320  case ',':
1321  goto do_not_strip_quotes;
1322 
1323  case '\\':
1324  if (*++yyp != '\\')
1325  goto do_not_strip_quotes;
1326  /* Fall through. */
1327  default:
1328  if (yyres)
1329  yyres[yyn] = *yyp;
1330  yyn++;
1331  break;
1332 
1333  case '"':
1334  if (yyres)
1335  yyres[yyn] = '\0';
1336  return yyn;
1337  }
1338  do_not_strip_quotes: ;
1339  }
1340 
1341  if (! yyres)
1342  return yystrlen (yystr);
1343 
1344  return yystpcpy (yyres, yystr) - yyres;
1345 }
#define YYSIZE_T
Definition: ast_expr2.c:557
int yyn
Definition: ast_expr2.c:1812
static YYSIZE_T const char * yystr
Definition: ast_expr2.c:1261
YYUSE ( yylocationp  )

Variable Documentation

yynewstate __pad0__

Definition at line 1869 of file ast_expr2.c.

yyexhaustedlab __pad10__

Definition at line 2520 of file ast_expr2.c.

yyreturn __pad11__

Definition at line 2530 of file ast_expr2.c.

yysetstate __pad1__

Definition at line 1872 of file ast_expr2.c.

yybackup __pad2__

Definition at line 1956 of file ast_expr2.c.

yydefault __pad3__

Definition at line 2015 of file ast_expr2.c.

yyreduce __pad4__

Definition at line 2026 of file ast_expr2.c.

yyerrlab __pad5__

Definition at line 2365 of file ast_expr2.c.

yyerrorlab __pad6__

Definition at line 2442 of file ast_expr2.c.

yyerrlab1 __pad7__

Definition at line 2458 of file ast_expr2.c.

yyacceptlab __pad8__

Definition at line 2505 of file ast_expr2.c.

yyabortlab __pad9__

Definition at line 2512 of file ast_expr2.c.

continue
Initial value:
{
#define YYSIZE_T
Definition: ast_expr2.c:557
return yylen
Definition: ast_expr2.c:1267

Definition at line 1263 of file ast_expr2.c.

Referenced by callerid_feed_jp().

else
Initial value:
{
#define YYTRANSLATE(YYX)
Definition: ast_expr2.c:750
#define yychar
Definition: ast_expr2.c:69
int yytoken
Definition: ast_expr2.c:1815

Definition at line 1975 of file ast_expr2.c.

Referenced by ast_lock_path_flock().

char extra_error_message[4095]

Definition at line 2464 of file ast_expr2f.c.

int extra_error_message_supplied

Definition at line 2465 of file ast_expr2f.c.

yylloc first_column = yylloc.last_column = 1

Definition at line 1858 of file ast_expr2.c.

Referenced by npval(), and switch().

yylloc first_line = yylloc.last_line = 1

Definition at line 1857 of file ast_expr2.c.

Referenced by make_email_file(), npval(), sendmail(), sendpage(), and switch().

YYACCEPT

Definition at line 1943 of file ast_expr2.c.

goto yybackup

Definition at line 1945 of file ast_expr2.c.

yychar = YYEMPTY

Definition at line 1845 of file ast_expr2.c.

const yytype_int8 yycheck[]
static

Definition at line 930 of file ast_expr2.c.

return yyd

Definition at line 1295 of file ast_expr2.c.

const yytype_uint8 yydefact[]
static

Definition at line 865 of file ast_expr2.c.

goto yydefault

Definition at line 1958 of file ast_expr2.c.

const yytype_int8 yydefgoto[]
static
Initial value:
=
{
-1, 5, 30, 6
}

Definition at line 876 of file ast_expr2.c.

char* char* yydest
static

Definition at line 1285 of file ast_expr2.c.

goto yyerrlab

Definition at line 2017 of file ast_expr2.c.

Referenced by if().

goto yyerrlab1

Definition at line 2430 of file ast_expr2.c.

yyerror_range[2] = yylloc

Definition at line 1808 of file ast_expr2.c.

yyerrstatus = 0

Definition at line 1782 of file ast_expr2.c.

int yylen = 0

Definition at line 1267 of file ast_expr2.c.

YYLTYPE yylloc

Definition at line 1775 of file ast_expr2.c.

YYLTYPE yyloc

Definition at line 1819 of file ast_expr2.c.

Referenced by switch().

YYLTYPE* yylocationp

Definition at line 1500 of file ast_expr2.c.

yyls = yylsa

Definition at line 1804 of file ast_expr2.c.

Referenced by if().

Definition at line 1803 of file ast_expr2.c.

* yylsp = yyls

Definition at line 1805 of file ast_expr2.c.

Referenced by for().

YYSTYPE yylval
Initial value:
{
int yychar
#define yychar
Definition: ast_expr2.c:69

Definition at line 1767 of file ast_expr2.c.

char * yymsg = "Deleting"
static

Definition at line 1497 of file ast_expr2.c.

Referenced by if(), and yysyntax_error().

YYSIZE_T yymsg_alloc = sizeof yymsgbuf

Definition at line 1825 of file ast_expr2.c.

char yymsgbuf[128]

Definition at line 1823 of file ast_expr2.c.

Referenced by if().

yyn = yytoken

Definition at line 1812 of file ast_expr2.c.

Referenced by for(), if(), yysyntax_error(), and yytnamerr().

yynerrs = 0

Definition at line 1778 of file ast_expr2.c.

goto yynewstate

Definition at line 2008 of file ast_expr2.c.

const yytype_int16 yypact[]
static

Definition at line 884 of file ast_expr2.c.

int void* YYPARSE_PARAM

Definition at line 1754 of file ast_expr2.c.

const yytype_int8 yypgoto[]
static
Initial value:
=
{
-18, -18, -18, -1
}

Definition at line 895 of file ast_expr2.c.

const yytype_uint8 yyr1[]
static

Definition at line 847 of file ast_expr2.c.

const yytype_uint8 yyr2[]
static

Definition at line 855 of file ast_expr2.c.

goto yyreduce

Definition at line 2018 of file ast_expr2.c.

Referenced by if().

yyresult = 2

Definition at line 1813 of file ast_expr2.c.

goto yyreturn

Definition at line 2506 of file ast_expr2.c.

const char* yys = yysrc

Definition at line 1290 of file ast_expr2.c.

goto yysetstate

Definition at line 1861 of file ast_expr2.c.

const char* yysrc

Definition at line 1286 of file ast_expr2.c.

yyss = yyssa

Definition at line 1794 of file ast_expr2.c.

Referenced by if().

Definition at line 1793 of file ast_expr2.c.

yyssp = yyss

Definition at line 1795 of file ast_expr2.c.

Referenced by for(), and yysyntax_error().

yystacksize = YYINITDEPTH

Definition at line 1810 of file ast_expr2.c.

else yystate = 0

Definition at line 1780 of file ast_expr2.c.

Referenced by for().

const yytype_uint8 yystos[]
static

Definition at line 952 of file ast_expr2.c.

YYSIZE_T const char* yystr
static

Definition at line 1261 of file ast_expr2.c.

Referenced by yytnamerr().

const yytype_uint8 yytable[]
static

Definition at line 904 of file ast_expr2.c.

const char* const yytname[]
static

Definition at line 825 of file ast_expr2.c.

yytoken = 0

Definition at line 1815 of file ast_expr2.c.

Referenced by yysyntax_error().

const yytype_uint8 yytranslate[]
static

Definition at line 754 of file ast_expr2.c.

int yytype

Definition at line 1498 of file ast_expr2.c.

yyval = yyvsp[1-yylen]

Definition at line 1818 of file ast_expr2.c.

YYSTYPE* yyvaluep

Definition at line 1499 of file ast_expr2.c.

yyvs = yyvsa

Definition at line 1799 of file ast_expr2.c.

Referenced by if().

Definition at line 1798 of file ast_expr2.c.

* yyvsp = yyvs

Definition at line 1800 of file ast_expr2.c.