Codename Pineapple

Home page | Mailing list | Docs

Last updated: Sat Feb 3 05:01:00 2007

Asterisk developer's documentation :: Codename Pineapple


ast_expr2.c File Reference

#include "asterisk.h"
#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.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 dependency graph for ast_expr2.c:

Go to the source code of this file.

Data Structures

struct  parse_io
struct  val
union  yyalloc
struct  yyltype
union  YYSTYPE

Defines

#define ast_yyerror(x)   ast_yyerror(x, YYLTYPE *yylloc, struct parse_io *parseio)
#define ast_yyerror(x)   ast_yyerror(x,&yyloc,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 QUAD_MAX   (0x7fffffffffffffffLL)
#define QUAD_MIN   (-0x7fffffffffffffffLL-1)
#define TOK_AND   261
#define TOK_COLON   275
#define TOK_COLONCOLON   258
#define TOK_COMPL   273
#define TOK_COND   259
#define TOK_DIV   271
#define TOK_EQ   267
#define TOK_EQTILDE   274
#define TOK_GE   264
#define TOK_GT   266
#define TOK_LE   263
#define TOK_LP   276
#define TOK_LT   265
#define TOK_MINUS   268
#define TOK_MOD   270
#define TOK_MULT   272
#define TOK_NE   262
#define TOK_OR   260
#define TOK_PLUS   269
#define TOK_RP   277
#define TOKEN   278
#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.3"
#define yychar   ast_yychar
#define yyclearin   (yychar = YYEMPTY)
#define YYCOPY(To, From, Count)
#define YYDEBUG   0
#define yydebug   ast_yydebug
#define YYDPRINTF(Args)
#define YYEMPTY   (-2)
#define YYEOF   0
#define YYERRCODE   256
#define yyerrok   (yyerrstatus = 0)
#define YYERROR   goto yyerrorlab
#define yyerror   ast_yyerror
#define YYERROR_VERBOSE   1
#define YYERROR_VERBOSE   1
#define YYFAIL   goto yyerrlab
#define YYFINAL   10
#define YYFREE   free
#define YYID(n)   (n)
#define YYINITDEPTH   200
#define YYLAST   140
#define YYLEX   yylex (&yylval, &yylloc, YYLEX_PARAM)
#define yylex   ast_yylex
#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   278
#define yynerrs   ast_yynerrs
#define YYNNTS   3
#define YYNRULES   23
#define YYNSTATES   46
#define YYNTOKENS   24
#define YYPACT_NINF   -13
#define yyparse   ast_yyparse
#define YYPARSE_PARAM   parseio
#define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
#define YYPURE   1
#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)
#define yystype   YYSTYPE
#define YYSTYPE_IS_DECLARED   1
#define YYSTYPE_IS_TRIVIAL   1
#define YYTABLE_NINF   -1
#define YYTERROR   1
#define YYTOKEN_TABLE   0
#define YYTRANSLATE(YYX)   ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
#define YYUNDEFTOK   2
#define YYUSE(e)   ((void) (e))

Typedefs

typedef void * yyscan_t
typedef short int yytype_int16
typedef short int yytype_int8
typedef unsigned short int yytype_uint16
typedef unsigned char yytype_uint8

Enumerations

enum  valtype { AST_EXPR_integer, AST_EXPR_numeric_string, AST_EXPR_string }
enum  yytokentype {
  TOK_COLONCOLON = 258, TOK_COND = 259, TOK_OR = 260, TOK_AND = 261,
  TOK_NE = 262, TOK_LE = 263, TOK_GE = 264, TOK_LT = 265,
  TOK_GT = 266, TOK_EQ = 267, TOK_MINUS = 268, TOK_PLUS = 269,
  TOK_MOD = 270, TOK_DIV = 271, TOK_MULT = 272, TOK_COMPL = 273,
  TOK_EQTILDE = 274, TOK_COLON = 275, TOK_LP = 276, TOK_RP = 277,
  TOKEN = 278
}

Functions

int ast_yylex __P ((YYSTYPE *, YYLTYPE *, yyscan_t))
static struct val *op_cond __P ((struct val *, struct val *, struct val *))
static struct val *op_and __P ((struct val *, struct val *))
static struct val *make_str __P ((const char *))
static struct val *make_integer __P ((quad_t))
static void free_value __P ((struct val *))
static int chk_minus __P ((quad_t, quad_t, quad_t))
static int chk_div __P ((quad_t, quad_t))
int ast_yyerror (const char *, YYLTYPE *, struct parse_io *)
static int chk_div (quad_t a, quad_t b)
static int chk_minus (quad_t a, quad_t b, quad_t r)
static int chk_plus (quad_t a, quad_t b, quad_t r)
static int chk_times (quad_t a, quad_t b, quad_t r)
static void free_value (struct val *vp)
static int is_zero_or_null (struct val *vp)
static int isstring (struct val *vp)
static struct valmake_integer (quad_t 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_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_times (struct val *a, struct val *b)
static void strip_quotes (struct val *vp)
static quad_t to_integer (struct val *vp)
static void to_string (struct val *vp)
static void yydestruct (char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp) const
int yyparse (void *YYPARSE_PARAM)
int yyparse ()
static char * yystpcpy (char *yydest, const char *yysrc)
static YYSIZE_T yystrlen (char *yystr) const
static YYSIZE_T yysyntax_error (char *yyresult, int yystate, int yychar)
static YYSIZE_T yytnamerr (char *yyres, const char *yystr)

Variables

char extra_error_message [4095]
int extra_error_message_supplied
static const yytype_int8 yycheck []
static const yytype_uint8 yydefact []
static const yytype_int8 yydefgoto []
static const yytype_int8 yypact []
static const yytype_int8 yypgoto []
static const yytype_uint8 yyr1 []
static const yytype_uint8 yyr2 []
static const yytype_uint8 yystos []
static const yytype_uint8 yytable []
static const char *const yytname []
static const yytype_uint8 yytranslate []


Define Documentation

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

Definition at line 2304 of file ast_expr2.c.

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

Definition at line 2304 of file ast_expr2.c.

#define DESTROY  )     {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 264 of file ast_expr2.c.

Referenced by yyparse().

#define QUAD_MAX   (0x7fffffffffffffffLL)
 

Definition at line 178 of file ast_expr2.c.

#define QUAD_MIN   (-0x7fffffffffffffffLL-1)
 

Definition at line 175 of file ast_expr2.c.

Referenced by chk_div(), and chk_minus().

#define TOK_AND   261
 

Definition at line 104 of file ast_expr2.c.

#define TOK_COLON   275
 

Definition at line 118 of file ast_expr2.c.

#define TOK_COLONCOLON   258
 

Definition at line 101 of file ast_expr2.c.

#define TOK_COMPL   273
 

Definition at line 116 of file ast_expr2.c.

#define TOK_COND   259
 

Definition at line 102 of file ast_expr2.c.

#define TOK_DIV   271
 

Definition at line 114 of file ast_expr2.c.

#define TOK_EQ   267
 

Definition at line 110 of file ast_expr2.c.

#define TOK_EQTILDE   274
 

Definition at line 117 of file ast_expr2.c.

#define TOK_GE   264
 

Definition at line 107 of file ast_expr2.c.

#define TOK_GT   266
 

Definition at line 109 of file ast_expr2.c.

#define TOK_LE   263
 

Definition at line 106 of file ast_expr2.c.

#define TOK_LP   276
 

Definition at line 119 of file ast_expr2.c.

#define TOK_LT   265
 

Definition at line 108 of file ast_expr2.c.

#define TOK_MINUS   268
 

Definition at line 111 of file ast_expr2.c.

#define TOK_MOD   270
 

Definition at line 113 of file ast_expr2.c.

#define TOK_MULT   272
 

Definition at line 115 of file ast_expr2.c.

#define TOK_NE   262
 

Definition at line 105 of file ast_expr2.c.

#define TOK_OR   260
 

Definition at line 103 of file ast_expr2.c.

#define TOK_PLUS   269
 

Definition at line 112 of file ast_expr2.c.

#define TOK_RP   277
 

Definition at line 120 of file ast_expr2.c.

#define TOKEN   278
 

Definition at line 121 of file ast_expr2.c.

#define YY_ msgid   )     msgid
 

Definition at line 377 of file ast_expr2.c.

Referenced by yyparse(), 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)

Definition at line 823 of file ast_expr2.c.

#define YY_REDUCE_PRINT Rule   ) 
 

Definition at line 1004 of file ast_expr2.c.

Referenced by yyparse().

#define YY_STACK_PRINT Bottom,
Top   ) 
 

Definition at line 1003 of file ast_expr2.c.

Referenced by yyparse().

#define YY_SYMBOL_PRINT Title,
Type,
Value,
Location   ) 
 

Definition at line 1002 of file ast_expr2.c.

Referenced by yydestruct(), and yyparse().

#define YYABORT   goto yyabortlab
 

Definition at line 757 of file ast_expr2.c.

Referenced by yyparse().

#define YYACCEPT   goto yyacceptlab
 

Definition at line 756 of file ast_expr2.c.

Referenced by yyparse().

#define YYBACKUP Token,
Value   ) 
 

Definition at line 769 of file ast_expr2.c.

#define YYBISON   1
 

Definition at line 47 of file ast_expr2.c.

#define YYBISON_VERSION   "2.3"
 

Definition at line 50 of file ast_expr2.c.

#define yychar   ast_yychar
 

Definition at line 66 of file ast_expr2.c.

Referenced by yyparse().

#define yyclearin   (yychar = YYEMPTY)
 

Definition at line 752 of file ast_expr2.c.

#define YYCOPY To,
From,
Count   ) 
 

Definition at line 505 of file ast_expr2.c.

#define YYDEBUG   0
 

Definition at line 269 of file ast_expr2.c.

#define yydebug   ast_yydebug
 

Definition at line 67 of file ast_expr2.c.

#define YYDPRINTF Args   ) 
 

Definition at line 1001 of file ast_expr2.c.

Referenced by yyparse().

#define YYEMPTY   (-2)
 

Definition at line 753 of file ast_expr2.c.

Referenced by yyparse().

#define YYEOF   0
 

Definition at line 754 of file ast_expr2.c.

Referenced by yyparse().

#define YYERRCODE   256
 

Definition at line 788 of file ast_expr2.c.

#define yyerrok   (yyerrstatus = 0)
 

Definition at line 751 of file ast_expr2.c.

#define YYERROR   goto yyerrorlab
 

Definition at line 758 of file ast_expr2.c.

#define yyerror   ast_yyerror
 

Definition at line 64 of file ast_expr2.c.

Referenced by yyparse().

#define YYERROR_VERBOSE   1
 

Definition at line 275 of file ast_expr2.c.

#define YYERROR_VERBOSE   1
 

Definition at line 275 of file ast_expr2.c.

#define YYFAIL   goto yyerrlab
 

Definition at line 765 of file ast_expr2.c.

#define YYFINAL   10
 

Definition at line 535 of file ast_expr2.c.

Referenced by yyparse().

#define YYFREE   free
 

Definition at line 466 of file ast_expr2.c.

#define YYID  )     (n)
 

Definition at line 390 of file ast_expr2.c.

#define YYINITDEPTH   200
 

Definition at line 1010 of file ast_expr2.c.

Referenced by yyparse().

#define YYLAST   140
 

Definition at line 537 of file ast_expr2.c.

Referenced by yyparse(), and yysyntax_error().

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

Definition at line 836 of file ast_expr2.c.

Referenced by yyparse().

#define yylex   ast_yylex
 

Definition at line 63 of file ast_expr2.c.

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

Definition at line 182 of file ast_expr2.c.

#define yylloc   ast_yylloc
 

Definition at line 69 of file ast_expr2.c.

Referenced by ast_yyget_lloc(), ast_yyset_lloc(), and yyparse().

#define YYLLOC_DEFAULT Current,
Rhs,
 ) 
 

Definition at line 797 of file ast_expr2.c.

Referenced by yyparse().

#define YYLSP_NEEDED   1
 

Definition at line 59 of file ast_expr2.c.

#define YYLTYPE   yyltype
 

Definition at line 252 of file ast_expr2.c.

#define YYLTYPE_IS_TRIVIAL   1
 

Definition at line 253 of file ast_expr2.c.

#define yylval   ast_yylval
 

Definition at line 65 of file ast_expr2.c.

Referenced by ast_yyget_lval(), ast_yyset_lval(), and yyparse().

#define YYMALLOC   malloc
 

Definition at line 459 of file ast_expr2.c.

#define YYMAXDEPTH   10000
 

Definition at line 1021 of file ast_expr2.c.

Referenced by yyparse().

#define YYMAXUTOK   278
 

Definition at line 550 of file ast_expr2.c.

#define yynerrs   ast_yynerrs
 

Definition at line 68 of file ast_expr2.c.

Referenced by yyparse().

#define YYNNTS   3
 

Definition at line 542 of file ast_expr2.c.

#define YYNRULES   23
 

Definition at line 544 of file ast_expr2.c.

#define YYNSTATES   46
 

Definition at line 546 of file ast_expr2.c.

#define YYNTOKENS   24
 

Definition at line 540 of file ast_expr2.c.

Referenced by yyparse(), and yysyntax_error().

#define YYPACT_NINF   -13
 

Definition at line 681 of file ast_expr2.c.

Referenced by yyparse(), and yysyntax_error().

#define yyparse   ast_yyparse
 

Definition at line 62 of file ast_expr2.c.

#define YYPARSE_PARAM   parseio
 

Definition at line 181 of file ast_expr2.c.

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

Referenced by yyparse().

#define YYPURE   1
 

Definition at line 56 of file ast_expr2.c.

 
#define YYRECOVERING  )     (!!yyerrstatus)
 

Definition at line 767 of file ast_expr2.c.

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

Definition at line 795 of file ast_expr2.c.

#define YYSIZE_MAXIMUM   ((YYSIZE_T) -1)
 

Definition at line 367 of file ast_expr2.c.

#define YYSIZE_T   unsigned int
 

Definition at line 363 of file ast_expr2.c.

Referenced by yyparse(), yystrlen(), yysyntax_error(), and yytnamerr().

#define YYSKELETON_NAME   "yacc.c"
 

Definition at line 53 of file ast_expr2.c.

#define YYSTACK_ALLOC   YYMALLOC
 

Definition at line 445 of file ast_expr2.c.

Referenced by yyparse().

#define YYSTACK_ALLOC_MAXIMUM   YYSIZE_MAXIMUM
 

Definition at line 448 of file ast_expr2.c.

Referenced by yyparse().

#define YYSTACK_BYTES  ) 
 

Value:

((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
      + 2 * YYSTACK_GAP_MAXIMUM)

Definition at line 494 of file ast_expr2.c.

Referenced by yyparse().

#define YYSTACK_FREE   YYFREE
 

Definition at line 446 of file ast_expr2.c.

Referenced by yyparse().

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

Definition at line 490