Thu Oct 11 06:42:49 2012

Asterisk developer's documentation


ast_expr2f.c File Reference

Dialplan Expression Lexical Scanner. More...

#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <stdlib.h>
#include "asterisk.h"
#include <sys/types.h>
#include <locale.h>
#include <ctype.h>
#include <regex.h>
#include <limits.h>
#include "asterisk/ast_expr.h"
#include "asterisk/logger.h"
#include "asterisk/strings.h"
#include "ast_expr2.h"
#include <unistd.h>

Include dependency graph for ast_expr2f.c:

Go to the source code of this file.

Data Structures

struct  parse_io
struct  val
struct  yy_buffer_state
struct  yy_trans_info
struct  yyguts_t

Defines

#define ast_yywrap(n)   1
#define BEGIN   yyg->yy_start = 1 + 2 *
#define ECHO   do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
#define EOB_ACT_CONTINUE_SCAN   0
#define EOB_ACT_END_OF_FILE   1
#define EOB_ACT_LAST_MATCH   2
#define FLEX_BETA
#define FLEX_SCANNER
#define INITIAL   0
#define INT16_MAX   (32767)
#define INT16_MIN   (-32767-1)
#define INT32_MAX   (2147483647)
#define INT32_MIN   (-2147483647-1)
#define INT8_MAX   (127)
#define INT8_MIN   (-128)
#define REJECT   reject_used_but_not_detected
#define SET_COLUMNS
#define SET_NUMERIC_STRING
#define SET_STRING
#define trail   2
#define UINT16_MAX   (65535U)
#define UINT32_MAX   (4294967295U)
#define UINT8_MAX   (255U)
#define unput(c)   yyunput( c, yyg->yytext_ptr , yyscanner )
#define var   1
#define YY_AT_BOL()   (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
#define YY_BREAK   break;
#define YY_BUF_SIZE   16384
#define YY_BUFFER_EOF_PENDING   2
#define YY_BUFFER_NEW   0
#define YY_BUFFER_NORMAL   1
#define YY_CURRENT_BUFFER
#define YY_CURRENT_BUFFER_LVALUE   yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]
#define YY_DECL
#define YY_DECL_IS_OURS   1
#define YY_DO_BEFORE_ACTION
#define YY_END_OF_BUFFER   37
#define YY_END_OF_BUFFER_CHAR   0
#define YY_EXIT_FAILURE   2
#define YY_EXTRA_TYPE   void *
#define YY_FATAL_ERROR(msg)   yy_fatal_error( msg , yyscanner)
#define yy_flex_debug   yyg->yy_flex_debug_r
#define YY_FLEX_MAJOR_VERSION   2
#define YY_FLEX_MINOR_VERSION   5
#define YY_FLEX_SUBMINOR_VERSION   35
#define YY_FLUSH_BUFFER   ast_yy_flush_buffer(YY_CURRENT_BUFFER ,yyscanner)
#define YY_INPUT(buf, result, max_size)
#define YY_INT_ALIGNED   short int
#define YY_LESS_LINENO(n)
#define YY_MORE_ADJ   yyg->yy_more_len
#define yy_new_buffer   ast_yy_create_buffer
#define YY_NEW_FILE   ast_yyrestart(yyin ,yyscanner )
#define YY_NULL   0
#define YY_NUM_RULES   36
#define YY_READ_BUF_SIZE   8192
#define YY_RESTORE_YY_MORE_OFFSET
#define YY_RULE_SETUP   YY_USER_ACTION
#define YY_SC_TO_UI(c)   ((unsigned int) (unsigned char) c)
#define yy_set_bol(at_bol)
#define yy_set_interactive(is_interactive)
#define YY_SKIP_YYWRAP
#define YY_START   ((yyg->yy_start - 1) / 2)
#define YY_START_STACK_INCR   25
#define YY_STATE_BUF_SIZE   ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
#define YY_STATE_EOF(state)   (YY_END_OF_BUFFER + state + 1)
#define yycolumn   (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
#define yyconst
#define yyextra   yyg->yyextra_r
#define yyin   yyg->yyin_r
#define yyleng   yyg->yyleng_r
#define yyless(n)
#define yyless(n)
#define yylineno   (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)
#define yylloc   yyg->yylloc_r
#define yylval   yyg->yylval_r
#define yymore()   (yyg->yy_more_flag = 1)
#define yyout   yyg->yyout_r
#define YYSTATE   YY_START
#define YYTABLES_NAME   "yytables"
#define yyterminate()   return YY_NULL
#define yytext   yyg->yytext_r
#define yytext_ptr   yytext_r

Typedefs

typedef short int flex_int16_t
typedef int flex_int32_t
typedef signed char flex_int8_t
typedef unsigned short int flex_uint16_t
typedef unsigned int flex_uint32_t
typedef unsigned char flex_uint8_t
typedef struct yy_buffer_stateYY_BUFFER_STATE
typedef unsigned char YY_CHAR
typedef size_t yy_size_t
typedef int yy_state_type
typedef void * yyscan_t

Enumerations

enum  valtype {
  AST_EXPR_integer, AST_EXPR_numeric_string, AST_EXPR_string, AST_EXPR_integer,
  AST_EXPR_numeric_string, AST_EXPR_string
}

Functions

int ast_expr (char *expr, char *buf, int length)
void ast_expr_clear_extra_error_info (void)
void ast_expr_register_extra_error_info (char *message)
YY_BUFFER_STATE ast_yy_create_buffer (FILE *file, int size, yyscan_t yyscanner)
void ast_yy_delete_buffer (YY_BUFFER_STATE b, yyscan_t yyscanner)
void ast_yy_flush_buffer (YY_BUFFER_STATE b, yyscan_t yyscanner)
static void ast_yy_init_buffer (YY_BUFFER_STATE b, FILE *file, yyscan_t yyscanner)
static void ast_yy_load_buffer_state (yyscan_t yyscanner)
YY_BUFFER_STATE ast_yy_scan_buffer (char *base, yy_size_t size, yyscan_t yyscanner)
YY_BUFFER_STATE ast_yy_scan_bytes (yyconst char *bytes, int len, yyscan_t yyscanner)
YY_BUFFER_STATE ast_yy_scan_string (yyconst char *yy_str, yyscan_t yyscanner)
void ast_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer, yyscan_t yyscanner)
void * ast_yyalloc (yy_size_t, yyscan_t yyscanner)
static void ast_yyensure_buffer_stack (yyscan_t yyscanner)
int ast_yyerror (const char *s, yyltype *loc, struct parse_io *parseio)
int ast_yyerror (const char *, YYLTYPE *, struct parse_io *)
void ast_yyfree (void *, yyscan_t yyscanner)
int ast_yyget_column (yyscan_t yyscanner)
int ast_yyget_debug (yyscan_t yyscanner)
YY_EXTRA_TYPE ast_yyget_extra (yyscan_t yyscanner)
FILE * ast_yyget_in (yyscan_t yyscanner)
int ast_yyget_leng (yyscan_t yyscanner)
int ast_yyget_lineno (yyscan_t yyscanner)
YYLTYPEast_yyget_lloc (yyscan_t yyscanner)
YYSTYPEast_yyget_lval (yyscan_t yyscanner)
FILE * ast_yyget_out (yyscan_t yyscanner)
char * ast_yyget_text (yyscan_t yyscanner)
int ast_yylex (YYSTYPE *yylval_param, YYLTYPE *yylloc_param, yyscan_t yyscanner)
int ast_yylex_destroy (yyscan_t yyscanner)
int ast_yylex_init (yyscan_t *scanner)
int ast_yylex_init_extra (YY_EXTRA_TYPE user_defined, yyscan_t *scanner)
int ast_yyparse (void *)
void ast_yypop_buffer_state (yyscan_t yyscanner)
void ast_yypush_buffer_state (YY_BUFFER_STATE new_buffer, yyscan_t yyscanner)
void * ast_yyrealloc (void *, yy_size_t, yyscan_t yyscanner)
void ast_yyrestart (FILE *input_file, yyscan_t yyscanner)
void ast_yyset_column (int column_no, yyscan_t yyscanner)
void ast_yyset_debug (int debug_flag, yyscan_t yyscanner)
void ast_yyset_extra (YY_EXTRA_TYPE user_defined, yyscan_t yyscanner)
void ast_yyset_in (FILE *in_str, yyscan_t yyscanner)
void ast_yyset_lineno (int line_number, yyscan_t yyscanner)
void ast_yyset_lloc (YYLTYPE *yylloc_param, yyscan_t yyscanner)
void ast_yyset_lval (YYSTYPE *yylval_param, yyscan_t yyscanner)
void ast_yyset_out (FILE *out_str, yyscan_t yyscanner)
static char * expr2_token_subst (const char *mess)
static int input (yyscan_t yyscanner)
static void yy_fatal_error (yyconst char *msg, yyscan_t yyscanner)
static void yy_fatal_error (yyconst char msg[], yyscan_t yyscanner)
static int yy_get_next_buffer (yyscan_t yyscanner)
static yy_state_type yy_get_previous_state (yyscan_t yyscanner)
static int yy_init_globals (yyscan_t yyscanner)
static yy_state_type yy_try_NUL_trans (yy_state_type current_state, yyscan_t yyscanner)
static void yyunput (int c, char *buf_ptr, yyscan_t yyscanner)

Variables

static int curlycount = 0
static char * expr2_token_equivs1 []
static char * expr2_token_equivs2 []
char extra_error_message [4095]
int extra_error_message_supplied = 0
static yyconst flex_int16_t yy_accept [58]
static yyconst flex_int16_t yy_base [64]
static yyconst flex_int16_t yy_chk [141]
static yyconst flex_int16_t yy_def [64]
static yyconst flex_int32_t yy_ec [256]
static yyconst flex_int32_t yy_meta [27]
static yyconst flex_int16_t yy_nxt [141]


Detailed Description

Dialplan Expression Lexical Scanner.

Definition in file ast_expr2f.c.


Define Documentation

#define ast_yywrap (  )     1

Definition at line 329 of file ast_expr2f.c.

#define BEGIN   yyg->yy_start = 1 + 2 *

Definition at line 143 of file ast_expr2f.c.

#define ECHO   do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)

Definition at line 720 of file ast_expr2f.c.

Referenced by ast_hide_password(), ast_restore_tty(), and openserial().

#define EOB_ACT_CONTINUE_SCAN   0

Definition at line 174 of file ast_expr2f.c.

#define EOB_ACT_END_OF_FILE   1

Definition at line 175 of file ast_expr2f.c.

#define EOB_ACT_LAST_MATCH   2

Definition at line 176 of file ast_expr2f.c.

#define FLEX_BETA

Definition at line 14 of file ast_expr2f.c.

#define FLEX_SCANNER

Definition at line 9 of file ast_expr2f.c.

#define INITIAL   0

Definition at line 575 of file ast_expr2f.c.

#define INT16_MAX   (32767)

Definition at line 72 of file ast_expr2f.c.

Referenced by fsaturate().

#define INT16_MIN   (-32767-1)

Definition at line 63 of file ast_expr2f.c.

Referenced by fsaturate().

#define INT32_MAX   (2147483647)

Definition at line 75 of file ast_expr2f.c.

#define INT32_MIN   (-2147483647-1)

Definition at line 66 of file ast_expr2f.c.

#define INT8_MAX   (127)

Definition at line 69 of file ast_expr2f.c.

#define INT8_MIN   (-128)

Definition at line 60 of file ast_expr2f.c.

#define REJECT   reject_used_but_not_detected

Definition at line 475 of file ast_expr2f.c.

#define SET_COLUMNS

Value:

do {     \
   yylloc_param->first_column = (int)(yyg->yytext_r - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf); \
   yylloc_param->last_column += yyleng - 1; \
   yylloc_param->first_line = yylloc_param->last_line = 1; \
   } while (0)

Definition at line 543 of file ast_expr2f.c.

#define SET_NUMERIC_STRING

Value:

do {  \
   yylval_param->val = calloc(1, sizeof(struct val)); \
   yylval_param->val->type = AST_EXPR_numeric_string; \
   yylval_param->val->u.s = strdup(yytext);  \
   } while (0)

Definition at line 555 of file ast_expr2f.c.

#define SET_STRING

Value:

do {     \
   yylval_param->val = calloc(1, sizeof(struct val)); \
   yylval_param->val->type = AST_EXPR_string;      \
   yylval_param->val->u.s = strdup(yytext);     \
   } while (0)

Definition at line 549 of file ast_expr2f.c.

#define trail   2

Definition at line 577 of file ast_expr2f.c.

#define UINT16_MAX   (65535U)

Definition at line 81 of file ast_expr2f.c.

#define UINT32_MAX   (4294967295U)

Definition at line 84 of file ast_expr2f.c.

#define UINT8_MAX   (255U)

Definition at line 78 of file ast_expr2f.c.

#define unput (  )     yyunput( c, yyg->yytext_ptr , yyscanner )

Definition at line 194 of file ast_expr2f.c.

#define var   1

 
#define YY_AT_BOL (  )     (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)

Definition at line 325 of file ast_expr2f.c.

#define YY_BREAK   break;

Definition at line 801 of file ast_expr2f.c.

#define YY_BUF_SIZE   16384

Definition at line 162 of file ast_expr2f.c.

#define YY_BUFFER_EOF_PENDING   2

Definition at line 261 of file ast_expr2f.c.

#define YY_BUFFER_NEW   0

Definition at line 249 of file ast_expr2f.c.

Referenced by ast_yy_flush_buffer(), and ast_yy_scan_buffer().

#define YY_BUFFER_NORMAL   1

Definition at line 250 of file ast_expr2f.c.

#define YY_CURRENT_BUFFER

Value:

( yyg->yy_buffer_stack \
                          ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \
                          : NULL)

Definition at line 272 of file ast_expr2f.c.

Referenced by ast_yy_flush_buffer(), ast_yy_init_buffer(), ast_yyget_column(), ast_yyget_lineno(), ast_yylex_destroy(), ast_yypop_buffer_state(), ast_yypush_buffer_state(), ast_yyset_column(), and ast_yyset_lineno().

#define YY_CURRENT_BUFFER_LVALUE   yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]

#define YY_DECL

Value:

int ast_yylex \
               (YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner)

Definition at line 788 of file ast_expr2f.c.

#define YY_DECL_IS_OURS   1

Definition at line 783 of file ast_expr2f.c.

#define YY_DO_BEFORE_ACTION

Definition at line 346 of file ast_expr2f.c.

#define YY_END_OF_BUFFER   37

Definition at line 355 of file ast_expr2f.c.

#define YY_END_OF_BUFFER_CHAR   0

Definition at line 158 of file ast_expr2f.c.

Referenced by ast_yy_flush_buffer(), ast_yy_scan_buffer(), and ast_yy_scan_bytes().

#define YY_EXIT_FAILURE   2

Definition at line 1965 of file ast_expr2f.c.

Referenced by yy_fatal_error().

#define YY_EXTRA_TYPE   void *

Definition at line 588 of file ast_expr2f.c.

#define YY_FATAL_ERROR ( msg   )     yy_fatal_error( msg , yyscanner)

Definition at line 774 of file ast_expr2f.c.

Referenced by ast_yy_scan_buffer(), ast_yy_scan_bytes(), and ast_yyensure_buffer_stack().

#define yy_flex_debug   yyg->yy_flex_debug_r

Definition at line 137 of file ast_expr2f.c.

Referenced by ast_yyget_debug(), and ast_yyset_debug().

#define YY_FLEX_MAJOR_VERSION   2

Definition at line 10 of file ast_expr2f.c.

#define YY_FLEX_MINOR_VERSION   5

Definition at line 11 of file ast_expr2f.c.

#define YY_FLEX_SUBMINOR_VERSION   35

Definition at line 12 of file ast_expr2f.c.

#define YY_FLUSH_BUFFER   ast_yy_flush_buffer(YY_CURRENT_BUFFER ,yyscanner)

Definition at line 293 of file ast_expr2f.c.

#define YY_INPUT ( buf,
result,
max_size   ) 

Definition at line 727 of file ast_expr2f.c.

#define YY_INT_ALIGNED   short int

Definition at line 5 of file ast_expr2f.c.

#define YY_LESS_LINENO (  ) 

Definition at line 178 of file ast_expr2f.c.

#define YY_MORE_ADJ   yyg->yy_more_len

Definition at line 477 of file ast_expr2f.c.

#define yy_new_buffer   ast_yy_create_buffer

Definition at line 303 of file ast_expr2f.c.

#define YY_NEW_FILE   ast_yyrestart(yyin ,yyscanner )

Definition at line 156 of file ast_expr2f.c.

#define YY_NULL   0

Definition at line 113 of file ast_expr2f.c.

#define YY_NUM_RULES   36

Definition at line 354 of file ast_expr2f.c.

#define YY_READ_BUF_SIZE   8192

Definition at line 712 of file ast_expr2f.c.

#define YY_RESTORE_YY_MORE_OFFSET

Definition at line 478 of file ast_expr2f.c.

#define YY_RULE_SETUP   YY_USER_ACTION

Definition at line 804 of file ast_expr2f.c.

#define YY_SC_TO_UI (  )     ((unsigned int) (unsigned char) c)

Definition at line 120 of file ast_expr2f.c.

#define yy_set_bol ( at_bol   ) 

Definition at line 315 of file ast_expr2f.c.

#define yy_set_interactive ( is_interactive   ) 

Definition at line 305 of file ast_expr2f.c.

#define YY_SKIP_YYWRAP

Definition at line 330 of file ast_expr2f.c.

#define YY_START   ((yyg->yy_start - 1) / 2)

Definition at line 149 of file ast_expr2f.c.

#define YY_START_STACK_INCR   25

Definition at line 769 of file ast_expr2f.c.

#define YY_STATE_BUF_SIZE   ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))

Definition at line 167 of file ast_expr2f.c.

#define YY_STATE_EOF ( state   )     (YY_END_OF_BUFFER + state + 1)

Definition at line 153 of file ast_expr2f.c.

#define yycolumn   (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)

Definition at line 136 of file ast_expr2f.c.

Referenced by ast_yyget_column(), and ast_yyset_column().

#define yyconst

Definition at line 109 of file ast_expr2f.c.

#define yyextra   yyg->yyextra_r

Definition at line 132 of file ast_expr2f.c.

Referenced by ast_yyget_extra(), and ast_yyset_extra().

#define yyin   yyg->yyin_r

Definition at line 130 of file ast_expr2f.c.

Referenced by ast_yyget_in(), ast_yyset_in(), and yy_init_globals().

#define yyleng   yyg->yyleng_r

Definition at line 133 of file ast_expr2f.c.

Referenced by ast_yyget_leng().

#define yyless (  ) 

Definition at line 1977 of file ast_expr2f.c.

#define yyless (  ) 

Definition at line 1977 of file ast_expr2f.c.

#define yylineno   (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)

Definition at line 135 of file ast_expr2f.c.

Referenced by ast_yyget_lineno(), and ast_yyset_lineno().

#define yylloc   yyg->yylloc_r

Definition at line 635 of file ast_expr2f.c.

#define yylval   yyg->yylval_r

Definition at line 633 of file ast_expr2f.c.

 
#define yymore (  )     (yyg->yy_more_flag = 1)

Definition at line 476 of file ast_expr2f.c.

#define yyout   yyg->yyout_r

Definition at line 131 of file ast_expr2f.c.

Referenced by ast_yyget_out(), ast_yyset_out(), and yy_init_globals().

#define YYSTATE   YY_START

Definition at line 150 of file ast_expr2f.c.

#define YYTABLES_NAME   "yytables"

Definition at line 2329 of file ast_expr2f.c.

 
#define yyterminate (  )     return YY_NULL

Definition at line 764 of file ast_expr2f.c.

#define yytext   yyg->yytext_r

Definition at line 134 of file ast_expr2f.c.

Referenced by ast_yyerror(), and ast_yyget_text().

#define yytext_ptr   yytext_r

Definition at line 336 of file ast_expr2f.c.


Typedef Documentation

typedef short int flex_int16_t

Definition at line 52 of file ast_expr2f.c.

typedef int flex_int32_t

Definition at line 53 of file ast_expr2f.c.

typedef signed char flex_int8_t

Definition at line 51 of file ast_expr2f.c.

typedef unsigned short int flex_uint16_t

Definition at line 55 of file ast_expr2f.c.

typedef unsigned int flex_uint32_t

Definition at line 56 of file ast_expr2f.c.

typedef unsigned char flex_uint8_t

Definition at line 54 of file ast_expr2f.c.

Definition at line 171 of file ast_expr2f.c.

typedef unsigned char YY_CHAR

Definition at line 332 of file ast_expr2f.c.

typedef size_t yy_size_t

Definition at line 198 of file ast_expr2f.c.

typedef int yy_state_type

Definition at line 334 of file ast_expr2f.c.

typedef void* yyscan_t

Definition at line 125 of file ast_expr2f.c.


Enumeration Type Documentation

enum valtype

Enumerator:
AST_EXPR_integer 
AST_EXPR_numeric_string 
AST_EXPR_string 
AST_EXPR_integer 
AST_EXPR_numeric_string 
AST_EXPR_string 

Definition at line 529 of file ast_expr2f.c.


Function Documentation

int ast_expr ( char *  expr,
char *  buf,
int  length 
)

Definition at line 2352 of file ast_expr2f.c.

References ast_copy_string(), AST_EXPR_integer, ast_yy_scan_string(), ast_yylex_destroy(), ast_yylex_init(), ast_yyparse(), free, parse_io::scanner, and parse_io::string.

Referenced by check_pval_item(), and pbx_substitute_variables_helper_full().

02353 {
02354    struct parse_io io;
02355    int return_value = 0;
02356    
02357    memset(&io, 0, sizeof(io));
02358    io.string = expr;  /* to pass to the error routine */
02359    
02360    ast_yylex_init(&io.scanner);
02361    
02362    ast_yy_scan_string(expr, io.scanner);
02363    
02364    ast_yyparse ((void *) &io);
02365 
02366    ast_yylex_destroy(io.scanner);
02367 
02368    if (!io.val) {
02369       if (length > 1) {
02370          strcpy(buf, "0");
02371          return_value = 1;
02372       }
02373    } else {
02374       if (io.val->type == AST_EXPR_integer) {
02375          int res_length;
02376 
02377          res_length = snprintf(buf, length, "%ld", (long int) io.val->u.i);
02378          return_value = (res_length <= length) ? res_length : length;
02379       } else {
02380 #if defined(STANDALONE) || defined(LOW_MEMORY) || defined(STANDALONE_AEL)
02381          strncpy(buf, io.val->u.s, length - 1);
02382 #else /* !STANDALONE && !LOW_MEMORY */
02383          ast_copy_string(buf, io.val->u.s, length);
02384 #endif /* STANDALONE || LOW_MEMORY */
02385          return_value = strlen(buf);
02386          free(io.val->u.s);
02387       }
02388       free(io.val);
02389    }
02390    return return_value;
02391 }

void ast_expr_clear_extra_error_info ( void   ) 

Definition at line 2405 of file ast_expr2f.c.

Referenced by check_pval_item().

02406 {
02407        extra_error_message_supplied=0;
02408        extra_error_message[0] = 0;
02409 }

void ast_expr_register_extra_error_info ( char *  message  ) 

Definition at line 2399 of file ast_expr2f.c.

Referenced by check_pval_item().

02400 {
02401        extra_error_message_supplied=1;
02402        strcpy(extra_error_message, message);
02403 }

YY_BUFFER_STATE ast_yy_create_buffer ( FILE *  file,
int  size,
yyscan_t  yyscanner 
)

void ast_yy_delete_buffer ( YY_BUFFER_STATE  b,
yyscan_t  yyscanner 
)

void ast_yy_flush_buffer ( YY_BUFFER_STATE  b,
yyscan_t  yyscanner 
)

Discard all buffered characters. On the next scan, YY_INPUT will be called.

Parameters:
b the buffer state to be flushed, usually YY_CURRENT_BUFFER.
yyscanner The scanner object.

Definition at line 1753 of file ast_expr2f.c.

References ast_yy_load_buffer_state(), yy_buffer_state::yy_at_bol, yy_buffer_state::yy_buf_pos, YY_BUFFER_NEW, yy_buffer_state::yy_buffer_status, yy_buffer_state::yy_ch_buf, YY_CURRENT_BUFFER, YY_END_OF_BUFFER_CHAR, and yy_buffer_state::yy_n_chars.

Referenced by ast_yy_init_buffer().

01754 {
01755     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
01756    if ( ! b )
01757       return;
01758 
01759    b->yy_n_chars = 0;
01760 
01761    /* We always need two end-of-buffer characters.  The first causes
01762     * a transition to the end-of-buffer state.  The second causes
01763     * a jam in that state.
01764     */
01765    b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
01766    b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
01767 
01768    b->yy_buf_pos = &b->yy_ch_buf[0];
01769 
01770    b->yy_at_bol = 1;
01771    b->yy_buffer_status = YY_BUFFER_NEW;
01772 
01773    if ( b == YY_CURRENT_BUFFER )
01774       ast_yy_load_buffer_state(yyscanner );
01775 }

static void ast_yy_init_buffer ( YY_BUFFER_STATE  b,
FILE *  file,
yyscan_t  yyscanner 
) [static]

The main scanner function which does all the work.

Definition at line 1724 of file ast_expr2f.c.

References ast_yy_flush_buffer(), errno, yy_buffer_state::yy_bs_column, yy_buffer_state::yy_bs_lineno, YY_CURRENT_BUFFER, yy_buffer_state::yy_fill_buffer, yy_buffer_state::yy_input_file, and yy_buffer_state::yy_is_interactive.

01726 {
01727    int oerrno = errno;
01728     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
01729 
01730    ast_yy_flush_buffer(b ,yyscanner);
01731 
01732    b->yy_input_file = file;
01733    b->yy_fill_buffer = 1;
01734 
01735     /* If b is the current buffer, then ast_yy_init_buffer was _probably_
01736      * called from ast_yyrestart() or through yy_get_next_buffer.
01737      * In that case, we don't want to reset the lineno or column.
01738      */
01739     if (b != YY_CURRENT_BUFFER){
01740         b->yy_bs_lineno = 1;
01741         b->yy_bs_column = 0;
01742     }
01743 
01744         b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
01745     
01746    errno = oerrno;
01747 }

static void ast_yy_load_buffer_state ( yyscan_t  yyscanner  )  [static]

YY_BUFFER_STATE ast_yy_scan_buffer ( char *  base,
yy_size_t  size,
yyscan_t  yyscanner 
)

Setup the input buffer state to scan directly from a user-specified character buffer.

Parameters:
base the character buffer
size the size in bytes of the character buffer
yyscanner The scanner object.
Returns:
the newly allocated buffer state object.

Definition at line 1884 of file ast_expr2f.c.

References ast_yy_switch_to_buffer(), ast_yyalloc(), yy_buffer_state::yy_at_bol, yy_buffer_state::yy_buf_pos, yy_buffer_state::yy_buf_size, YY_BUFFER_NEW, yy_buffer_state::yy_buffer_status, yy_buffer_state::yy_ch_buf, YY_END_OF_BUFFER_CHAR, YY_FATAL_ERROR, yy_buffer_state::yy_fill_buffer, yy_buffer_state::yy_input_file, yy_buffer_state::yy_is_interactive, yy_buffer_state::yy_is_our_buffer, and yy_buffer_state::yy_n_chars.

Referenced by ast_yy_scan_bytes().

01885 {
01886    YY_BUFFER_STATE b;
01887     
01888    if ( size < 2 ||
01889         base[size-2] != YY_END_OF_BUFFER_CHAR ||
01890         base[size-1] != YY_END_OF_BUFFER_CHAR )
01891       /* They forgot to leave room for the EOB's. */
01892       return 0;
01893 
01894    b = (YY_BUFFER_STATE) ast_yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner );
01895    if ( ! b )
01896       YY_FATAL_ERROR( "out of dynamic memory in ast_yy_scan_buffer()" );
01897 
01898    b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
01899    b->yy_buf_pos = b->yy_ch_buf = base;
01900    b->yy_is_our_buffer = 0;
01901    b->yy_input_file = 0;
01902    b->yy_n_chars = b->yy_buf_size;
01903    b->yy_is_interactive = 0;
01904    b->yy_at_bol = 1;
01905    b->yy_fill_buffer = 0;
01906    b->yy_buffer_status = YY_BUFFER_NEW;
01907 
01908    ast_yy_switch_to_buffer(b ,yyscanner );
01909 
01910    return b;
01911 }

YY_BUFFER_STATE ast_yy_scan_bytes ( yyconst char *  yybytes,
int  _yybytes_len,
yyscan_t  yyscanner 
)

Setup the input buffer state to scan the given bytes. The next call to ast_yylex() will scan from a copy of bytes.

Parameters:
bytes the byte buffer to scan
len the number of bytes in the buffer pointed to by bytes.
yyscanner The scanner object.
Returns:
the newly allocated buffer state object.

Definition at line 1934 of file ast_expr2f.c.

References ast_yy_scan_buffer(), ast_yyalloc(), YY_END_OF_BUFFER_CHAR, YY_FATAL_ERROR, and yy_buffer_state::yy_is_our_buffer.

Referenced by ast_yy_scan_string().

01935 {
01936    YY_BUFFER_STATE b;
01937    char *buf;
01938    yy_size_t n;
01939    int i;
01940     
01941    /* Get memory for full buffer, including space for trailing EOB's. */
01942    n = _yybytes_len + 2;
01943    buf = (char *) ast_yyalloc(n ,yyscanner );
01944    if ( ! buf )
01945       YY_FATAL_ERROR( "out of dynamic memory in ast_yy_scan_bytes()" );
01946 
01947    for ( i = 0; i < _yybytes_len; ++i )
01948       buf[i] = yybytes[i];
01949 
01950    buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
01951 
01952    b = ast_yy_scan_buffer(buf,n ,yyscanner);
01953    if ( ! b )
01954       YY_FATAL_ERROR( "bad buffer in ast_yy_scan_bytes()" );
01955 
01956    /* It's okay to grow etc. this buffer, and we should throw it
01957     * away when we're done.
01958     */
01959    b->yy_is_our_buffer = 1;
01960 
01961    return b;
01962 }

YY_BUFFER_STATE ast_yy_scan_string ( yyconst char *  yystr,
yyscan_t  yyscanner 
)

Setup the input buffer state to scan a string. The next call to ast_yylex() will scan from a copy of str.

Parameters:
yystr a NUL-terminated string to scan
yyscanner The scanner object.
Returns:
the newly allocated buffer state object.
Note:
If you want to scan bytes that may contain NUL values, then use ast_yy_scan_bytes() instead.

Definition at line 1921 of file ast_expr2f.c.

References ast_yy_scan_bytes().

Referenced by ast_expr().

01922 {
01923     
01924    return ast_yy_scan_bytes(yystr,strlen(yystr) ,yyscanner);
01925 }

void ast_yy_switch_to_buffer ( YY_BUFFER_STATE  new_buffer,
yyscan_t  yyscanner 
)

Referenced by ast_yy_scan_buffer().

void * ast_yyalloc ( yy_size_t  size,
yyscan_t  yyscanner 
)

Definition at line 2312 of file ast_expr2f.c.

References malloc.

Referenced by ast_yy_scan_buffer(), ast_yy_scan_bytes(), ast_yyensure_buffer_stack(), ast_yylex_init(), and ast_yylex_init_extra().

02313 {
02314    return (void *) malloc( size );
02315 }

static void ast_yyensure_buffer_stack ( yyscan_t  yyscanner  )  [static]

Definition at line 1834 of file ast_expr2f.c.

References ast_yyalloc(), ast_yyrealloc(), yyguts_t::yy_buffer_stack, yyguts_t::yy_buffer_stack_max, yyguts_t::yy_buffer_stack_top, and YY_FATAL_ERROR.

Referenced by ast_yypush_buffer_state().

01835 {
01836    int num_to_alloc;
01837     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
01838 
01839    if (!yyg->yy_buffer_stack) {
01840 
01841       /* First allocation is just for 2 elements, since we don't know if this
01842        * scanner will even need a stack. We use 2 instead of 1 to avoid an
01843        * immediate realloc on the next call.
01844          */
01845       num_to_alloc = 1;
01846       yyg->yy_buffer_stack = (struct yy_buffer_state**)ast_yyalloc
01847                         (num_to_alloc * sizeof(struct yy_buffer_state*)
01848                         , yyscanner);
01849       if ( ! yyg->yy_buffer_stack )
01850          YY_FATAL_ERROR( "out of dynamic memory in ast_yyensure_buffer_stack()" );
01851                           
01852       memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
01853             
01854       yyg->yy_buffer_stack_max = num_to_alloc;
01855       yyg->yy_buffer_stack_top = 0;
01856       return;
01857    }
01858 
01859    if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){
01860 
01861       /* Increase the buffer to prepare for a possible push. */
01862       int grow_size = 8 /* arbitrary grow size */;
01863 
01864       num_to_alloc = yyg->yy_buffer_stack_max + grow_size;
01865       yyg->yy_buffer_stack = (struct yy_buffer_state**)ast_yyrealloc
01866                         (yyg->yy_buffer_stack,
01867                         num_to_alloc * sizeof(struct yy_buffer_state*)
01868                         , yyscanner);
01869       if ( ! yyg->yy_buffer_stack )
01870          YY_FATAL_ERROR( "out of dynamic memory in ast_yyensure_buffer_stack()" );
01871 
01872       /* zero only the new slots.*/
01873       memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*));
01874       yyg->yy_buffer_stack_max = num_to_alloc;
01875    }
01876 }

int ast_yyerror ( const char *  s,
yyltype loc,
struct parse_io parseio 
)

Definition at line 2505 of file ast_expr2f.c.

References ast_log(), expr2_token_subst(), free, LOG_WARNING, parse_io::scanner, parse_io::string, YY_CURRENT_BUFFER_LVALUE, and yytext.

02506 {  
02507    struct yyguts_t * yyg = (struct yyguts_t*)(parseio->scanner);
02508    char spacebuf[8000]; /* best safe than sorry */
02509    char spacebuf2[8000]; /* best safe than sorry */
02510    int i=0;
02511    char *s2 = expr2_token_subst(s);
02512    spacebuf[0] = 0;
02513    
02514    for(i=0;i< (int)(yytext - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf);i++) spacebuf2[i] = ' ';  /* uh... assuming yyg is defined, then I can use the yycolumn macro,
02515                                                                         which is the same thing as... get this:
02516                                        yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]->yy_bs_column
02517                                        I was tempted to just use yy_buf_pos in the STATE, but..., well:
02518                                           a. the yy_buf_pos is the current position in the buffer, which
02519                                              may not relate to the entire string/buffer because of the
02520                                              buffering.
02521                                           b. but, analysis of the situation is that when you use the
02522                                              ast_yy_scan_string func, it creates a single buffer the size of
02523                                              string, so the two would be the same... 
02524                                        so, in the end, the yycolumn macro is available, shorter, therefore easier. */
02525    spacebuf2[i++]='^';
02526    spacebuf2[i]= 0;
02527 
02528 #ifdef STANDALONE3
02529    /* easier to read in the standalone version */
02530    printf("ast_yyerror(): %s syntax error: %s; Input:\n%s\n%s\n",  
02531          (extra_error_message_supplied?extra_error_message:""), s2, parseio->string,spacebuf2);
02532 #else
02533    ast_log(LOG_WARNING,"ast_yyerror(): %s syntax error: %s; Input:\n%s\n%s\n",  
02534          (extra_error_message_supplied?extra_error_message:""), s2, parseio->string,spacebuf2);
02535 #endif
02536 #ifndef STANDALONE
02537    ast_log(LOG_WARNING,"If you have questions, please refer to doc/channelvariables.txt.\n");
02538 #endif
02539    free(s2);
02540    return(0);
02541 }

int ast_yyerror ( const char *  ,
YYLTYPE ,
struct parse_io  
)

void ast_yyfree ( void *  ptr,
yyscan_t  yyscanner 
)

Definition at line 2344 of file ast_expr2f.c.

References free.

Referenced by ast_yylex_destroy().

02345 {
02346       if (ptr) /* the normal generated ast_yyfree func just frees its first arg;
02347                     this get complaints on some systems, as sometimes this
02348                     arg is a nil ptr! It's usually not fatal, but is irritating! */
02349               free( (char *) ptr );
02350 }

int ast_yyget_column ( yyscan_t  yyscanner  ) 

Get the current column number.

Parameters:
yyscanner The scanner object.

Definition at line 2018 of file ast_expr2f.c.

References YY_CURRENT_BUFFER, and yycolumn.

02019 {
02020     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
02021     
02022         if (! YY_CURRENT_BUFFER)
02023             return 0;
02024     
02025     return yycolumn;
02026 }

int ast_yyget_debug ( yyscan_t  yyscanner  ) 

Definition at line 2123 of file ast_expr2f.c.

References yy_flex_debug.

02124 {
02125     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
02126     return yy_flex_debug;
02127 }

YY_EXTRA_TYPE ast_yyget_extra ( yyscan_t  yyscanner  ) 

Get the user-defined data for this scanner.

Parameters:
yyscanner The scanner object.

Definition at line 1996 of file ast_expr2f.c.

References yyextra.

01997 {
01998     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
01999     return yyextra;
02000 }

FILE * ast_yyget_in ( yyscan_t  yyscanner  ) 

Get the input stream.

Parameters:
yyscanner The scanner object.

Definition at line 2031 of file ast_expr2f.c.

References yyin.

02032 {
02033     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
02034     return yyin;
02035 }

int ast_yyget_leng ( yyscan_t  yyscanner  ) 

Get the length of the current token.

Parameters:
yyscanner The scanner object.

Definition at line 2049 of file ast_expr2f.c.

References yyleng.

02050 {
02051     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
02052     return yyleng;
02053 }

int ast_yyget_lineno ( yyscan_t  yyscanner  ) 

Get the current line number.

Parameters:
yyscanner The scanner object.

Definition at line 2005 of file ast_expr2f.c.

References YY_CURRENT_BUFFER, and yylineno.

02006 {
02007     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
02008     
02009         if (! YY_CURRENT_BUFFER)
02010             return 0;
02011     
02012     return yylineno;
02013 }

YYLTYPE * ast_yyget_lloc ( yyscan_t  yyscanner  ) 

Definition at line 2149 of file ast_expr2f.c.

References yylloc.

02150 {
02151     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
02152     return yylloc;
02153 }

YYSTYPE * ast_yyget_lval ( yyscan_t  yyscanner  ) 

Definition at line 2137 of file ast_expr2f.c.

References yylval.

02138 {
02139     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
02140     return yylval;
02141 }

FILE * ast_yyget_out ( yyscan_t  yyscanner  ) 

Get the output stream.

Parameters:
yyscanner The scanner object.

Definition at line 2040 of file ast_expr2f.c.

References yyout.

02041 {
02042     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
02043     return yyout;
02044 }

char * ast_yyget_text ( yyscan_t  yyscanner  ) 

Get the current token.

Parameters:
yyscanner The scanner object.

Definition at line 2059 of file ast_expr2f.c.

References yytext.

02060 {
02061     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
02062     return yytext;
02063 }

int ast_yylex ( YYSTYPE yylval_param,
YYLTYPE yylloc_param,
yyscan_t  yyscanner 
)

int ast_yylex_destroy ( yyscan_t  yyscanner  ) 

Definition at line 2259 of file ast_expr2f.c.

References ast_yy_delete_buffer(), ast_yyfree(), ast_yypop_buffer_state(), yyguts_t::yy_buffer_stack, YY_CURRENT_BUFFER, YY_CURRENT_BUFFER_LVALUE, yy_init_globals(), and yyguts_t::yy_start_stack.

Referenced by ast_expr().

02260 {
02261     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
02262 
02263     /* Pop the buffer stack, destroying each element. */
02264    while(YY_CURRENT_BUFFER){
02265       ast_yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner );
02266       YY_CURRENT_BUFFER_LVALUE = NULL;
02267       ast_yypop_buffer_state(yyscanner);
02268    }
02269 
02270    /* Destroy the stack itself. */
02271    ast_yyfree(yyg->yy_buffer_stack ,yyscanner);
02272    yyg->yy_buffer_stack = NULL;
02273 
02274     /* Destroy the start condition stack. */
02275         ast_yyfree(yyg->yy_start_stack ,yyscanner );
02276         yyg->yy_start_stack = NULL;
02277 
02278     /* Reset the globals. This is important in a non-reentrant scanner so the next time
02279      * ast_yylex() is called, initialization will occur. */
02280     yy_init_globals( yyscanner);
02281 
02282     /* Destroy the main struct (reentrant only). */
02283     ast_yyfree ( yyscanner , yyscanner );
02284     yyscanner = NULL;
02285     return 0;
02286 }

int ast_yylex_init ( yyscan_t scanner  ) 

Definition at line 2168 of file ast_expr2f.c.

References ast_yyalloc(), errno, and yy_init_globals().

Referenced by ast_expr().

02170 {
02171     if (ptr_yy_globals == NULL){
02172         errno = EINVAL;
02173         return 1;
02174     }
02175 
02176     *ptr_yy_globals = (yyscan_t) ast_yyalloc ( sizeof( struct yyguts_t ), NULL );
02177 
02178     if (*ptr_yy_globals == NULL){
02179         errno = ENOMEM;
02180         return 1;
02181     }
02182 
02183     /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */
02184     memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
02185 
02186     return yy_init_globals ( *ptr_yy_globals );
02187 }

int ast_yylex_init_extra ( YY_EXTRA_TYPE  user_defined,
yyscan_t scanner 
)

Definition at line 2197 of file ast_expr2f.c.

References ast_yyalloc(), ast_yyset_extra(), errno, and yy_init_globals().

02199 {
02200     struct yyguts_t dummy_yyguts;
02201 
02202     ast_yyset_extra (yy_user_defined, &dummy_yyguts);
02203 
02204     if (ptr_yy_globals == NULL){
02205         errno = EINVAL;
02206         return 1;
02207     }
02208    
02209     *ptr_yy_globals = (yyscan_t) ast_yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
02210    
02211     if (*ptr_yy_globals == NULL){
02212         errno = ENOMEM;
02213         return 1;
02214     }
02215     
02216     /* By setting to 0xAA, we expose bugs in
02217     yy_init_globals. Leave at 0x00 for releases. */
02218     memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
02219     
02220     ast_yyset_extra (yy_user_defined, *ptr_yy_globals);
02221     
02222     return yy_init_globals ( *ptr_yy_globals );
02223 }

int ast_yyparse ( void *   ) 

Referenced by ast_expr().

void ast_yypop_buffer_state ( yyscan_t  yyscanner  ) 

Removes and deletes the top of the stack, if present. The next element becomes the new top.

Parameters:
yyscanner The scanner object.

Definition at line 1814 of file ast_expr2f.c.

References ast_yy_delete_buffer(), ast_yy_load_buffer_state(), yyguts_t::yy_buffer_stack_top, YY_CURRENT_BUFFER, YY_CURRENT_BUFFER_LVALUE, and yyguts_t::yy_did_buffer_switch_on_eof.

Referenced by ast_yylex_destroy().

01815 {
01816     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
01817    if (!YY_CURRENT_BUFFER)
01818       return;
01819 
01820    ast_yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner);
01821    YY_CURRENT_BUFFER_LVALUE = NULL;
01822    if (yyg->yy_buffer_stack_top > 0)
01823       --yyg->yy_buffer_stack_top;
01824 
01825    if (YY_CURRENT_BUFFER) {
01826       ast_yy_load_buffer_state(yyscanner );
01827       yyg->yy_did_buffer_switch_on_eof = 1;
01828    }
01829 }

void ast_yypush_buffer_state ( YY_BUFFER_STATE  new_buffer,
yyscan_t  yyscanner 
)

Pushes the new state onto the stack. The new state becomes the current state. This function will allocate the stack if necessary.

Parameters:
new_buffer The new state.
yyscanner The scanner object.

Definition at line 1783 of file ast_expr2f.c.

References ast_yy_load_buffer_state(), ast_yyensure_buffer_stack(), yyguts_t::yy_buffer_stack_top, yyguts_t::yy_c_buf_p, YY_CURRENT_BUFFER, YY_CURRENT_BUFFER_LVALUE, yyguts_t::yy_did_buffer_switch_on_eof, yyguts_t::yy_hold_char, and yyguts_t::yy_n_chars.

01784 {
01785     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
01786    if (new_buffer == NULL)
01787       return;
01788 
01789    ast_yyensure_buffer_stack(yyscanner);
01790 
01791    /* This block is copied from ast_yy_switch_to_buffer. */
01792    if ( YY_CURRENT_BUFFER )
01793       {
01794       /* Flush out information for old buffer. */
01795       *yyg->yy_c_buf_p = yyg->yy_hold_char;
01796       YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
01797       YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
01798       }
01799 
01800    /* Only push if top exists. Otherwise, replace top. */
01801    if (YY_CURRENT_BUFFER)
01802       yyg->yy_buffer_stack_top++;
01803    YY_CURRENT_BUFFER_LVALUE = new_buffer;
01804 
01805    /* copied from ast_yy_switch_to_buffer. */
01806    ast_yy_load_buffer_state(yyscanner );
01807    yyg->yy_did_buffer_switch_on_eof = 1;
01808 }

void * ast_yyrealloc ( void *  ptr,
yy_size_t  size,
yyscan_t  yyscanner 
)

Definition at line 2317 of file ast_expr2f.c.

References realloc.

Referenced by ast_yyensure_buffer_stack().

02318 {
02319    /* The cast to (char *) in the following accommodates both
02320     * implementations that use char* generic pointers, and those
02321     * that use void* generic pointers.  It works with the latter
02322     * because both ANSI C and C++ allow castless assignment from
02323     * any pointer type to void*, and deal with argument conversions
02324     * as though doing an assignment.
02325     */
02326    return (void *) realloc( (char *) ptr, size );
02327 }

void ast_yyrestart ( FILE *  input_file,
yyscan_t  yyscanner 
)

void ast_yyset_column ( int  column_no,
yyscan_t  yyscanner 
)

Set the current column.

Parameters:
line_number 
yyscanner The scanner object.

Definition at line 2094 of file ast_expr2f.c.

References YY_CURRENT_BUFFER, yy_fatal_error(), and yycolumn.

02095 {
02096     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
02097 
02098         /* column is only valid if an input buffer exists. */
02099         if (! YY_CURRENT_BUFFER )
02100            yy_fatal_error( "ast_yyset_column called with no buffer" , yyscanner); 
02101     
02102     yycolumn = column_no;
02103 }

void ast_yyset_debug ( int  debug_flag,
yyscan_t  yyscanner 
)

Definition at line 2129 of file ast_expr2f.c.

References yy_flex_debug.

02130 {
02131     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
02132     yy_flex_debug = bdebug ;
02133 }

void ast_yyset_extra ( YY_EXTRA_TYPE  user_defined,
yyscan_t  yyscanner 
)

Set the user-defined data. This data is never touched by the scanner.

Parameters:
user_defined The data to be associated with this scanner.
yyscanner The scanner object.

Definition at line 2069 of file ast_expr2f.c.

References yyextra.

Referenced by ast_yylex_init_extra().

02070 {
02071     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
02072     yyextra = user_defined ;
02073 }

void ast_yyset_in ( FILE *  in_str,
yyscan_t  yyscanner 
)

Set the input stream. This does not discard the current input buffer.

Parameters:
in_str A readable stream.
yyscanner The scanner object.
See also:
ast_yy_switch_to_buffer

Definition at line 2111 of file ast_expr2f.c.

References yyin.

02112 {
02113     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
02114     yyin = in_str ;
02115 }

void ast_yyset_lineno ( int  line_number,
yyscan_t  yyscanner 
)

Set the current line number.

Parameters:
line_number 
yyscanner The scanner object.

Definition at line 2079 of file ast_expr2f.c.

References YY_CURRENT_BUFFER, yy_fatal_error(), and yylineno.

02080 {
02081     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
02082 
02083         /* lineno is only valid if an input buffer exists. */
02084         if (! YY_CURRENT_BUFFER )
02085            yy_fatal_error( "ast_yyset_lineno called with no buffer" , yyscanner); 
02086     
02087     yylineno = line_number;
02088 }

void ast_yyset_lloc ( YYLTYPE yylloc_param,
yyscan_t  yyscanner 
)

Definition at line 2155 of file ast_expr2f.c.

References yylloc.

02156 {
02157     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
02158     yylloc = yylloc_param;
02159 }

void ast_yyset_lval ( YYSTYPE yylval_param,
yyscan_t  yyscanner 
)

Definition at line 2143 of file ast_expr2f.c.

References yylval.

02144 {
02145     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
02146     yylval = yylval_param;
02147 }

void ast_yyset_out ( FILE *  out_str,
yyscan_t  yyscanner 
)

Definition at line 2117 of file ast_expr2f.c.

References yyout.

02118 {
02119     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
02120     yyout = out_str ;
02121 }

static char * expr2_token_subst ( const char *  mess  )  [static]

Definition at line 2462 of file ast_expr2f.c.

References len(), malloc, and t.

Referenced by ast_yyerror().

02463 {
02464    /* calc a length, malloc, fill, and return; yyerror had better free it! */
02465    int len=0,i;
02466    const char *p;
02467    char *res, *s,*t;
02468    int expr2_token_equivs_entries = sizeof(expr2_token_equivs1)/sizeof(char*);
02469 
02470    for (p=mess; *p; p++) {
02471       for (i=0; i<expr2_token_equivs_entries; i++) {
02472          if ( strncmp(p,expr2_token_equivs1[i],strlen(expr2_token_equivs1[i])) == 0 )
02473          {
02474             len+=strlen(expr2_token_equivs2[i])+2;
02475             p += strlen(expr2_token_equivs1[i])-1;
02476             break;
02477          }
02478       }
02479       len++;
02480    }
02481    res = (char*)malloc(len+1);
02482    res[0] = 0;
02483    s = res;
02484    for (p=mess; *p;) {
02485       int found = 0;
02486       for (i=0; i<expr2_token_equivs_entries; i++) {
02487          if ( strncmp(p,expr2_token_equivs1[i],strlen(expr2_token_equivs1[i])) == 0 ) {
02488             *s++ = '\'';
02489             for (t=expr2_token_equivs2[i]; *t;) {
02490                *s++ = *t++;
02491             }
02492             *s++ = '\'';
02493             p += strlen(expr2_token_equivs1[i]);
02494             found = 1;
02495             break;
02496          }
02497       }
02498       if( !found )
02499          *s++ = *p++;
02500    }
02501    *s++ = 0;
02502    return res;
02503 }

static int input ( yyscan_t  yyscanner  )  [static]

static void yy_fatal_error ( yyconst char *  msg,
yyscan_t  yyscanner 
) [static]

Definition at line 1968 of file ast_expr2f.c.

References YY_EXIT_FAILURE.

01969 {
01970       (void) fprintf( stderr, "%s\n", msg );
01971    exit( YY_EXIT_FAILURE );
01972 }

static void yy_fatal_error ( yyconst char  msg[],
yyscan_t  yyscanner 
) [static]

static int yy_get_next_buffer ( yyscan_t  yyscanner  )  [static]

static yy_state_type yy_get_previous_state ( yyscan_t  yyscanner  )  [static]

static int yy_init_globals ( yyscan_t  yyscanner  )  [static]

Definition at line 2225 of file ast_expr2f.c.

References yyguts_t::yy_buffer_stack, yyguts_t::yy_buffer_stack_max, yyguts_t::yy_buffer_stack_top, yyguts_t::yy_c_buf_p, yyguts_t::yy_init, yyguts_t::yy_start, yyguts_t::yy_start_stack, yyguts_t::yy_start_stack_depth, yyguts_t::yy_start_stack_ptr, yyin, and yyout.

Referenced by ast_yylex_destroy(), ast_yylex_init(), and ast_yylex_init_extra().

02226 {
02227     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
02228     /* Initialization is the same as for the non-reentrant scanner.
02229      * This function is called from ast_yylex_destroy(), so don't allocate here.
02230      */
02231 
02232     yyg->yy_buffer_stack = 0;
02233     yyg->yy_buffer_stack_top = 0;
02234     yyg->yy_buffer_stack_max = 0;
02235     yyg->yy_c_buf_p = (char *) 0;
02236     yyg->yy_init = 0;
02237     yyg->yy_start = 0;
02238 
02239     yyg->yy_start_stack_ptr = 0;
02240     yyg->yy_start_stack_depth = 0;
02241     yyg->yy_start_stack =  NULL;
02242 
02243 /* Defined in main.c */
02244 #ifdef YY_STDINIT
02245     yyin = stdin;
02246     yyout = stdout;
02247 #else
02248     yyin = (FILE *) 0;
02249     yyout = (FILE *) 0;
02250 #endif
02251 
02252     /* For future reference: Set errno on error, since we are called by
02253      * ast_yylex_init()
02254      */
02255     return 0;
02256 }

static yy_state_type yy_try_NUL_trans ( yy_state_type  current_state,
yyscan_t  yyscanner 
) [static]

static void yyunput ( int  c,
char *  buf_ptr,
yyscan_t  yyscanner 
) [static]


Variable Documentation

int curlycount = 0 [static]

Definition at line 570 of file ast_expr2f.c.

char* expr2_token_equivs1[] [static]

Definition at line 2411 of file ast_expr2f.c.

char* expr2_token_equivs2[] [static]

Definition at line 2436 of file ast_expr2f.c.

char extra_error_message[4095]

Definition at line 2394 of file ast_expr2f.c.

Definition at line 2395 of file ast_expr2f.c.

yyconst flex_int16_t yy_accept[58] [static]

Definition at line 363 of file ast_expr2f.c.

yyconst flex_int16_t yy_base[64] [static]

Definition at line 412 of file ast_expr2f.c.

yyconst flex_int16_t yy_chk[141] [static]

Definition at line 453 of file ast_expr2f.c.

yyconst flex_int16_t yy_def[64] [static]

Definition at line 423 of file ast_expr2f.c.

yyconst flex_int32_t yy_ec[256] [static]

Definition at line 373 of file ast_expr2f.c.

yyconst flex_int32_t yy_meta[27] [static]

Definition at line 405 of file ast_expr2f.c.

yyconst flex_int16_t yy_nxt[141] [static]

Definition at line 434 of file ast_expr2f.c.


Generated on Thu Oct 11 06:42:49 2012 for Asterisk - the Open Source PBX by  doxygen 1.5.6