#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <stdlib.h>
#include <inttypes.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 | __STDC_LIMIT_MACROS 1 |
#define | ast_yywrap(n) 1 |
#define | BEGIN yyg->yy_start = 1 + 2 * |
#define | ECHO (void) fwrite( yytext, yyleng, 1, yyout ) |
#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 int ast_yylex (YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner) |
#define | YY_DECL_IS_OURS 1 |
#define | YY_DO_BEFORE_ACTION |
#define | YY_END_OF_BUFFER 36 |
#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 33 |
#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 35 |
#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 int16_t | flex_int16_t |
typedef int32_t | flex_int32_t |
typedef int8_t | flex_int8_t |
typedef uint16_t | flex_uint16_t |
typedef uint32_t | flex_uint32_t |
typedef uint8_t | flex_uint8_t |
typedef yy_buffer_state * | YY_BUFFER_STATE |
typedef unsigned char | YY_CHAR |
typedef unsigned int | 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) |
YYLTYPE * | ast_yyget_lloc (yyscan_t yyscanner) |
YYSTYPE * | ast_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_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 [55] |
static yyconst flex_int16_t | yy_base [61] |
static yyconst flex_int16_t | yy_chk [127] |
static yyconst flex_int16_t | yy_def [61] |
static yyconst flex_int32_t | yy_ec [256] |
static yyconst flex_int32_t | yy_meta [26] |
static yyconst flex_int16_t | yy_nxt [127] |
Definition in file ast_expr2f.c.
#define __STDC_LIMIT_MACROS 1 |
Definition at line 40 of file ast_expr2f.c.
#define ast_yywrap | ( | n | ) | 1 |
Definition at line 334 of file ast_expr2f.c.
#define BEGIN yyg->yy_start = 1 + 2 * |
Definition at line 143 of file ast_expr2f.c.
#define ECHO (void) fwrite( yytext, yyleng, 1, yyout ) |
Definition at line 717 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 576 of file ast_expr2f.c.
#define INT16_MAX (32767) |
#define INT16_MIN (-32767-1) |
#define INT32_MAX (2147483647) |
Definition at line 76 of file ast_expr2f.c.
#define INT32_MIN (-2147483647-1) |
Definition at line 67 of file ast_expr2f.c.
#define INT8_MAX (127) |
Definition at line 70 of file ast_expr2f.c.
#define INT8_MIN (-128) |
Definition at line 61 of file ast_expr2f.c.
#define REJECT reject_used_but_not_detected |
Definition at line 476 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 544 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 556 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 550 of file ast_expr2f.c.
#define trail 2 |
Definition at line 578 of file ast_expr2f.c.
#define UINT16_MAX (65535U) |
Definition at line 82 of file ast_expr2f.c.
#define UINT32_MAX (4294967295U) |
Definition at line 85 of file ast_expr2f.c.
#define UINT8_MAX (255U) |
Definition at line 79 of file ast_expr2f.c.
#define unput | ( | c | ) | yyunput( c, yyg->yytext_ptr , yyscanner ) |
Definition at line 194 of file ast_expr2f.c.
#define var 1 |
Definition at line 577 of file ast_expr2f.c.
Referenced by acf_sprintf(), aji_create_client(), aji_load_config(), append_mailbox_mapping(), apply_options(), apply_options_full(), apply_outgoing(), ast_cdr_copy_vars(), ast_cdr_serialize_variables(), ast_channeltype_list(), ast_var_assign(), ast_var_delete(), ast_var_full_name(), ast_var_name(), ast_var_value(), astman_get_variables(), cli_realtime_load(), conf_exec(), config_text_file_save(), find_conf(), find_conf_realtime(), find_user_realtime(), function_realtime_read(), global_read(), gtalk_create_member(), gtalk_load_config(), handle_updates(), handle_uri(), html_translate(), inherit_category(), init_logger_chain(), init_manager(), load_config(), load_module(), load_moh_classes(), move_variables(), odbc_load_module(), parse_config(), parse_cookies(), pbx_builtin_serialize_variables(), pbx_substitute_variables_helper_full(), process_my_load_module(), queue_function_queuewaitingcount(), realtime_alias(), realtime_canmatch(), realtime_common(), realtime_directory(), realtime_exec(), realtime_exists(), realtime_matchmore(), realtime_multi_odbc(), realtime_multi_pgsql(), realtime_odbc(), realtime_peer(), realtime_pgsql(), realtime_switch_common(), realtime_user(), reload_followme(), reload_queues(), retrieve_astcfgint(), sip_notify(), sla_add_trunk_to_station(), sla_build_station(), sla_build_trunk(), tds_load_module(), update_realtime_member_field(), vm_change_password(), and xml_translate().
#define YY_AT_BOL | ( | ) | (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) |
Definition at line 330 of file ast_expr2f.c.
#define YY_BREAK break; |
Definition at line 796 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 266 of file ast_expr2f.c.
#define YY_BUFFER_NEW 0 |
Definition at line 254 of file ast_expr2f.c.
Referenced by ast_yy_flush_buffer(), and ast_yy_scan_buffer().
#define YY_BUFFER_NORMAL 1 |
Definition at line 255 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 277 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] |
Definition at line 284 of file ast_expr2f.c.
Referenced by ast_yyerror(), ast_yylex_destroy(), ast_yypop_buffer_state(), and ast_yypush_buffer_state().
Definition at line 784 of file ast_expr2f.c.
#define YY_DECL_IS_OURS 1 |
Definition at line 780 of file ast_expr2f.c.
#define YY_DO_BEFORE_ACTION |
Definition at line 351 of file ast_expr2f.c.
#define YY_END_OF_BUFFER 36 |
Definition at line 360 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 |
#define YY_EXTRA_TYPE void * |
Definition at line 589 of file ast_expr2f.c.
#define YY_FATAL_ERROR | ( | msg | ) | yy_fatal_error( msg , yyscanner) |
Definition at line 771 of file ast_expr2f.c.
Referenced by ast_yy_scan_buffer(), and ast_yy_scan_bytes().
#define yy_flex_debug yyg->yy_flex_debug_r |
Definition at line 135 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 33 |
Definition at line 12 of file ast_expr2f.c.
#define YY_FLUSH_BUFFER ast_yy_flush_buffer(YY_CURRENT_BUFFER ,yyscanner) |
Definition at line 298 of file ast_expr2f.c.
#define YY_INPUT | ( | buf, | |||
result, | |||||
max_size | ) |
Definition at line 724 of file ast_expr2f.c.
#define YY_INT_ALIGNED short int |
Definition at line 5 of file ast_expr2f.c.
#define YY_LESS_LINENO | ( | n | ) |
Definition at line 178 of file ast_expr2f.c.
#define YY_MORE_ADJ yyg->yy_more_len |
Definition at line 478 of file ast_expr2f.c.
#define yy_new_buffer ast_yy_create_buffer |
Definition at line 308 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 111 of file ast_expr2f.c.
#define YY_NUM_RULES 35 |
Definition at line 359 of file ast_expr2f.c.
#define YY_READ_BUF_SIZE 8192 |
Definition at line 709 of file ast_expr2f.c.
#define YY_RESTORE_YY_MORE_OFFSET |
Definition at line 479 of file ast_expr2f.c.
#define YY_RULE_SETUP YY_USER_ACTION |
Definition at line 799 of file ast_expr2f.c.
#define YY_SC_TO_UI | ( | c | ) | ((unsigned int) (unsigned char) c) |
Definition at line 118 of file ast_expr2f.c.
#define yy_set_bol | ( | at_bol | ) |
Definition at line 320 of file ast_expr2f.c.
#define yy_set_interactive | ( | is_interactive | ) |
Definition at line 310 of file ast_expr2f.c.
#define YY_SKIP_YYWRAP |
Definition at line 335 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 766 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.
Definition at line 153 of file ast_expr2f.c.
#define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column) |
Definition at line 134 of file ast_expr2f.c.
Referenced by ast_yyget_column(), and ast_yyset_column().
#define yyconst |
Definition at line 107 of file ast_expr2f.c.
#define yyextra yyg->yyextra_r |
Definition at line 130 of file ast_expr2f.c.
Referenced by ast_yyget_extra(), and ast_yyset_extra().
#define yyin yyg->yyin_r |
Definition at line 128 of file ast_expr2f.c.
Referenced by ast_yyget_in(), ast_yyset_in(), and yy_init_globals().
#define yyleng yyg->yyleng_r |
#define yyless | ( | n | ) |
Definition at line 1949 of file ast_expr2f.c.
#define yyless | ( | n | ) |
Definition at line 1949 of file ast_expr2f.c.
#define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno) |
Definition at line 133 of file ast_expr2f.c.
Referenced by ast_yyget_lineno(), and ast_yyset_lineno().
#define yylloc yyg->yylloc_r |
Definition at line 636 of file ast_expr2f.c.
#define yylval yyg->yylval_r |
Definition at line 634 of file ast_expr2f.c.
#define yymore | ( | ) | (yyg->yy_more_flag = 1) |
Definition at line 477 of file ast_expr2f.c.
#define yyout yyg->yyout_r |
Definition at line 129 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 2265 of file ast_expr2f.c.
#define yyterminate | ( | ) | return YY_NULL |
Definition at line 761 of file ast_expr2f.c.
#define yytext yyg->yytext_r |
#define yytext_ptr yytext_r |
Definition at line 341 of file ast_expr2f.c.
typedef int16_t flex_int16_t |
Definition at line 46 of file ast_expr2f.c.
typedef int32_t flex_int32_t |
Definition at line 48 of file ast_expr2f.c.
typedef int8_t flex_int8_t |
Definition at line 44 of file ast_expr2f.c.
typedef uint16_t flex_uint16_t |
Definition at line 47 of file ast_expr2f.c.
typedef uint32_t flex_uint32_t |
Definition at line 49 of file ast_expr2f.c.
typedef uint8_t flex_uint8_t |
Definition at line 45 of file ast_expr2f.c.
typedef struct yy_buffer_state* YY_BUFFER_STATE |
Definition at line 171 of file ast_expr2f.c.
typedef unsigned char YY_CHAR |
Definition at line 337 of file ast_expr2f.c.
typedef unsigned int yy_size_t |
Definition at line 203 of file ast_expr2f.c.
typedef int yy_state_type |
Definition at line 339 of file ast_expr2f.c.
typedef void* yyscan_t |
Definition at line 123 of file ast_expr2f.c.
enum valtype |
AST_EXPR_integer | |
AST_EXPR_numeric_string | |
AST_EXPR_string | |
AST_EXPR_integer | |
AST_EXPR_numeric_string | |
AST_EXPR_string |
Definition at line 530 of file ast_expr2f.c.
00530 { 00531 AST_EXPR_integer, AST_EXPR_numeric_string, AST_EXPR_string 00532 } ;
int ast_expr | ( | char * | expr, | |
char * | buf, | |||
int | length | |||
) |
Definition at line 2288 of file ast_expr2f.c.
References AST_EXPR_integer, ast_yy_scan_string(), ast_yylex_destroy(), ast_yylex_init(), ast_yyparse(), free, and io.
Referenced by check_pval_item(), and pbx_substitute_variables_helper_full().
02289 { 02290 struct parse_io io; 02291 int return_value = 0; 02292 02293 memset(&io, 0, sizeof(io)); 02294 io.string = expr; /* to pass to the error routine */ 02295 02296 ast_yylex_init(&io.scanner); 02297 02298 ast_yy_scan_string(expr, io.scanner); 02299 02300 ast_yyparse ((void *) &io); 02301 02302 ast_yylex_destroy(io.scanner); 02303 02304 if (!io.val) { 02305 if (length > 1) { 02306 strcpy(buf, "0"); 02307 return_value = 1; 02308 } 02309 } else { 02310 if (io.val->type == AST_EXPR_integer) { 02311 int res_length; 02312 02313 res_length = snprintf(buf, length, "%ld", (long int) io.val->u.i); 02314 return_value = (res_length <= length) ? res_length : length; 02315 } else { 02316 #if defined(STANDALONE) || defined(LOW_MEMORY) || defined(STANDALONE_AEL) 02317 strncpy(buf, io.val->u.s, length - 1); 02318 #else /* !STANDALONE && !LOW_MEMORY */ 02319 ast_copy_string(buf, io.val->u.s, length); 02320 #endif /* STANDALONE || LOW_MEMORY */ 02321 return_value = strlen(buf); 02322 free(io.val->u.s); 02323 } 02324 free(io.val); 02325 } 02326 return return_value; 02327 }
void ast_expr_clear_extra_error_info | ( | void | ) |
Definition at line 2341 of file ast_expr2f.c.
Referenced by check_pval_item().
02342 { 02343 extra_error_message_supplied=0; 02344 extra_error_message[0] = 0; 02345 }
void ast_expr_register_extra_error_info | ( | char * | message | ) |
Definition at line 2335 of file ast_expr2f.c.
Referenced by check_pval_item().
02336 { 02337 extra_error_message_supplied=1; 02338 strcpy(extra_error_message, message); 02339 }
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 | |||
) |
Referenced by ast_yylex_destroy(), and ast_yypop_buffer_state().
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.
b | the buffer state to be flushed, usually YY_CURRENT_BUFFER . | |
yyscanner | The scanner object. |
Definition at line 1729 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().
01730 { 01731 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 01732 if ( ! b ) 01733 return; 01734 01735 b->yy_n_chars = 0; 01736 01737 /* We always need two end-of-buffer characters. The first causes 01738 * a transition to the end-of-buffer state. The second causes 01739 * a jam in that state. 01740 */ 01741 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; 01742 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; 01743 01744 b->yy_buf_pos = &b->yy_ch_buf[0]; 01745 01746 b->yy_at_bol = 1; 01747 b->yy_buffer_status = YY_BUFFER_NEW; 01748 01749 if ( b == YY_CURRENT_BUFFER ) 01750 ast_yy_load_buffer_state(yyscanner ); 01751 }
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 1700 of file ast_expr2f.c.
References ast_yy_flush_buffer(), errno, and YY_CURRENT_BUFFER.
01702 { 01703 int oerrno = errno; 01704 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 01705 01706 ast_yy_flush_buffer(b ,yyscanner); 01707 01708 b->yy_input_file = file; 01709 b->yy_fill_buffer = 1; 01710 01711 /* If b is the current buffer, then ast_yy_init_buffer was _probably_ 01712 * called from ast_yyrestart() or through yy_get_next_buffer. 01713 * In that case, we don't want to reset the lineno or column. 01714 */ 01715 if (b != YY_CURRENT_BUFFER){ 01716 b->yy_bs_lineno = 1; 01717 b->yy_bs_column = 0; 01718 } 01719 01720 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; 01721 01722 errno = oerrno; 01723 }
static void ast_yy_load_buffer_state | ( | yyscan_t | yyscanner | ) | [static] |
Referenced by ast_yy_flush_buffer(), ast_yypop_buffer_state(), and ast_yypush_buffer_state().
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.
base | the character buffer | |
size | the size in bytes of the character buffer | |
yyscanner | The scanner object. |
Definition at line 1856 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().
01857 { 01858 YY_BUFFER_STATE b; 01859 01860 if ( size < 2 || 01861 base[size-2] != YY_END_OF_BUFFER_CHAR || 01862 base[size-1] != YY_END_OF_BUFFER_CHAR ) 01863 /* They forgot to leave room for the EOB's. */ 01864 return 0; 01865 01866 b = (YY_BUFFER_STATE) ast_yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner ); 01867 if ( ! b ) 01868 YY_FATAL_ERROR( "out of dynamic memory in ast_yy_scan_buffer()" ); 01869 01870 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ 01871 b->yy_buf_pos = b->yy_ch_buf = base; 01872 b->yy_is_our_buffer = 0; 01873 b->yy_input_file = 0; 01874 b->yy_n_chars = b->yy_buf_size; 01875 b->yy_is_interactive = 0; 01876 b->yy_at_bol = 1; 01877 b->yy_fill_buffer = 0; 01878 b->yy_buffer_status = YY_BUFFER_NEW; 01879 01880 ast_yy_switch_to_buffer(b ,yyscanner ); 01881 01882 return b; 01883 }
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.
bytes | the byte buffer to scan | |
len | the number of bytes in the buffer pointed to by bytes. | |
yyscanner | The scanner object. |
Definition at line 1906 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().
01907 { 01908 YY_BUFFER_STATE b; 01909 char *buf; 01910 yy_size_t n; 01911 int i; 01912 01913 /* Get memory for full buffer, including space for trailing EOB's. */ 01914 n = _yybytes_len + 2; 01915 buf = (char *) ast_yyalloc(n ,yyscanner ); 01916 if ( ! buf ) 01917 YY_FATAL_ERROR( "out of dynamic memory in ast_yy_scan_bytes()" ); 01918 01919 for ( i = 0; i < _yybytes_len; ++i ) 01920 buf[i] = yybytes[i]; 01921 01922 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; 01923 01924 b = ast_yy_scan_buffer(buf,n ,yyscanner); 01925 if ( ! b ) 01926 YY_FATAL_ERROR( "bad buffer in ast_yy_scan_bytes()" ); 01927 01928 /* It's okay to grow etc. this buffer, and we should throw it 01929 * away when we're done. 01930 */ 01931 b->yy_is_our_buffer = 1; 01932 01933 return b; 01934 }
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.
str | a NUL-terminated string to scan | |
yyscanner | The scanner object. |
Definition at line 1893 of file ast_expr2f.c.
References ast_yy_scan_bytes().
Referenced by ast_expr().
01894 { 01895 01896 return ast_yy_scan_bytes(yystr,strlen(yystr) ,yyscanner); 01897 }
void ast_yy_switch_to_buffer | ( | YY_BUFFER_STATE | new_buffer, | |
yyscan_t | yyscanner | |||
) |
Referenced by ast_yy_scan_buffer().
Definition at line 2248 of file ast_expr2f.c.
References malloc.
Referenced by ast_yy_scan_buffer(), ast_yy_scan_bytes(), ast_yyensure_buffer_stack(), and ast_yylex_init().
02249 { 02250 return (void *) malloc( size ); 02251 }
static void ast_yyensure_buffer_stack | ( | yyscan_t | yyscanner | ) | [static] |
Definition at line 1810 of file ast_expr2f.c.
References ast_yyalloc(), ast_yyrealloc(), yyguts_t::yy_buffer_stack, yyguts_t::yy_buffer_stack_max, and yyguts_t::yy_buffer_stack_top.
Referenced by ast_yypush_buffer_state().
01811 { 01812 int num_to_alloc; 01813 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 01814 01815 if (!yyg->yy_buffer_stack) { 01816 01817 /* First allocation is just for 2 elements, since we don't know if this 01818 * scanner will even need a stack. We use 2 instead of 1 to avoid an 01819 * immediate realloc on the next call. 01820 */ 01821 num_to_alloc = 1; 01822 yyg->yy_buffer_stack = (struct yy_buffer_state**)ast_yyalloc 01823 (num_to_alloc * sizeof(struct yy_buffer_state*) 01824 , yyscanner); 01825 01826 memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*)); 01827 01828 yyg->yy_buffer_stack_max = num_to_alloc; 01829 yyg->yy_buffer_stack_top = 0; 01830 return; 01831 } 01832 01833 if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){ 01834 01835 /* Increase the buffer to prepare for a possible push. */ 01836 int grow_size = 8 /* arbitrary grow size */; 01837 01838 num_to_alloc = yyg->yy_buffer_stack_max + grow_size; 01839 yyg->yy_buffer_stack = (struct yy_buffer_state**)ast_yyrealloc 01840 (yyg->yy_buffer_stack, 01841 num_to_alloc * sizeof(struct yy_buffer_state*) 01842 , yyscanner); 01843 01844 /* zero only the new slots.*/ 01845 memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*)); 01846 yyg->yy_buffer_stack_max = num_to_alloc; 01847 } 01848 }
Definition at line 2441 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.
02442 { 02443 struct yyguts_t * yyg = (struct yyguts_t*)(parseio->scanner); 02444 char spacebuf[8000]; /* best safe than sorry */ 02445 char spacebuf2[8000]; /* best safe than sorry */ 02446 int i=0; 02447 char *s2 = expr2_token_subst(s); 02448 spacebuf[0] = 0; 02449 02450 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, 02451 which is the same thing as... get this: 02452 yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]->yy_bs_column 02453 I was tempted to just use yy_buf_pos in the STATE, but..., well: 02454 a. the yy_buf_pos is the current position in the buffer, which 02455 may not relate to the entire string/buffer because of the 02456 buffering. 02457 b. but, analysis of the situation is that when you use the 02458 ast_yy_scan_string func, it creates a single buffer the size of 02459 string, so the two would be the same... 02460 so, in the end, the yycolumn macro is available, shorter, therefore easier. */ 02461 spacebuf2[i++]='^'; 02462 spacebuf2[i]= 0; 02463 02464 #ifdef STANDALONE3 02465 /* easier to read in the standalone version */ 02466 printf("ast_yyerror(): %s syntax error: %s; Input:\n%s\n%s\n", 02467 (extra_error_message_supplied?extra_error_message:""), s2, parseio->string,spacebuf2); 02468 #else 02469 ast_log(LOG_WARNING,"ast_yyerror(): %s syntax error: %s; Input:\n%s\n%s\n", 02470 (extra_error_message_supplied?extra_error_message:""), s2, parseio->string,spacebuf2); 02471 #endif 02472 #ifndef STANDALONE 02473 ast_log(LOG_WARNING,"If you have questions, please refer to doc/channelvariables.txt in the asterisk source.\n"); 02474 #endif 02475 free(s2); 02476 return(0); 02477 }
void ast_yyfree | ( | void * | , | |
yyscan_t | yyscanner | |||
) |
Definition at line 2280 of file ast_expr2f.c.
References free.
Referenced by ast_yylex_destroy().
02281 { 02282 if (ptr) /* the normal generated ast_yyfree func just frees its first arg; 02283 this get complaints on some systems, as sometimes this 02284 arg is a nil ptr! It's usually not fatal, but is irritating! */ 02285 free( (char *) ptr ); 02286 }
int ast_yyget_column | ( | yyscan_t | yyscanner | ) |
Get the current column number.
yyscanner | The scanner object. |
Definition at line 1990 of file ast_expr2f.c.
References YY_CURRENT_BUFFER, and yycolumn.
01991 { 01992 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 01993 01994 if (! YY_CURRENT_BUFFER) 01995 return 0; 01996 01997 return yycolumn; 01998 }
int ast_yyget_debug | ( | yyscan_t | yyscanner | ) |
Definition at line 2095 of file ast_expr2f.c.
References yy_flex_debug.
02096 { 02097 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 02098 return yy_flex_debug; 02099 }
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 | ) |
Get the current line number.
yyscanner | The scanner object. |
Definition at line 1977 of file ast_expr2f.c.
References YY_CURRENT_BUFFER, and yylineno.
01978 { 01979 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 01980 01981 if (! YY_CURRENT_BUFFER) 01982 return 0; 01983 01984 return yylineno; 01985 }
FILE * ast_yyget_out | ( | yyscan_t | yyscanner | ) |
char * ast_yyget_text | ( | yyscan_t | yyscanner | ) |
int ast_yylex_destroy | ( | yyscan_t | yyscanner | ) |
Definition at line 2195 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().
02196 { 02197 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 02198 02199 /* Pop the buffer stack, destroying each element. */ 02200 while(YY_CURRENT_BUFFER){ 02201 ast_yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner ); 02202 YY_CURRENT_BUFFER_LVALUE = NULL; 02203 ast_yypop_buffer_state(yyscanner); 02204 } 02205 02206 /* Destroy the stack itself. */ 02207 ast_yyfree(yyg->yy_buffer_stack ,yyscanner); 02208 yyg->yy_buffer_stack = NULL; 02209 02210 /* Destroy the start condition stack. */ 02211 ast_yyfree(yyg->yy_start_stack ,yyscanner ); 02212 yyg->yy_start_stack = NULL; 02213 02214 /* Reset the globals. This is important in a non-reentrant scanner so the next time 02215 * ast_yylex() is called, initialization will occur. */ 02216 yy_init_globals( yyscanner); 02217 02218 /* Destroy the main struct (reentrant only). */ 02219 ast_yyfree ( yyscanner , yyscanner ); 02220 yyscanner = NULL; 02221 return 0; 02222 }
int ast_yylex_init | ( | yyscan_t * | scanner | ) |
Definition at line 2140 of file ast_expr2f.c.
References ast_yyalloc(), errno, and yy_init_globals().
Referenced by ast_expr().
02142 { 02143 if (ptr_yy_globals == NULL){ 02144 errno = EINVAL; 02145 return 1; 02146 } 02147 02148 *ptr_yy_globals = (yyscan_t) ast_yyalloc ( sizeof( struct yyguts_t ), NULL ); 02149 02150 if (*ptr_yy_globals == NULL){ 02151 errno = ENOMEM; 02152 return 1; 02153 } 02154 02155 /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */ 02156 memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); 02157 02158 return yy_init_globals ( *ptr_yy_globals ); 02159 }
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.
yyscanner | The scanner object. |
Definition at line 1790 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().
01791 { 01792 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 01793 if (!YY_CURRENT_BUFFER) 01794 return; 01795 01796 ast_yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner); 01797 YY_CURRENT_BUFFER_LVALUE = NULL; 01798 if (yyg->yy_buffer_stack_top > 0) 01799 --yyg->yy_buffer_stack_top; 01800 01801 if (YY_CURRENT_BUFFER) { 01802 ast_yy_load_buffer_state(yyscanner ); 01803 yyg->yy_did_buffer_switch_on_eof = 1; 01804 } 01805 }
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.
new_buffer | The new state. | |
yyscanner | The scanner object. |
Definition at line 1759 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.
01760 { 01761 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 01762 if (new_buffer == NULL) 01763 return; 01764 01765 ast_yyensure_buffer_stack(yyscanner); 01766 01767 /* This block is copied from ast_yy_switch_to_buffer. */ 01768 if ( YY_CURRENT_BUFFER ) 01769 { 01770 /* Flush out information for old buffer. */ 01771 *yyg->yy_c_buf_p = yyg->yy_hold_char; 01772 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p; 01773 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; 01774 } 01775 01776 /* Only push if top exists. Otherwise, replace top. */ 01777 if (YY_CURRENT_BUFFER) 01778 yyg->yy_buffer_stack_top++; 01779 YY_CURRENT_BUFFER_LVALUE = new_buffer; 01780 01781 /* copied from ast_yy_switch_to_buffer. */ 01782 ast_yy_load_buffer_state(yyscanner ); 01783 yyg->yy_did_buffer_switch_on_eof = 1; 01784 }
Definition at line 2253 of file ast_expr2f.c.
References realloc.
Referenced by ast_yyensure_buffer_stack().
02254 { 02255 /* The cast to (char *) in the following accommodates both 02256 * implementations that use char* generic pointers, and those 02257 * that use void* generic pointers. It works with the latter 02258 * because both ANSI C and C++ allow castless assignment from 02259 * any pointer type to void*, and deal with argument conversions 02260 * as though doing an assignment. 02261 */ 02262 return (void *) realloc( (char *) ptr, size ); 02263 }
void ast_yyrestart | ( | FILE * | input_file, | |
yyscan_t | yyscanner | |||
) |
void ast_yyset_column | ( | int | column_no, | |
yyscan_t | yyscanner | |||
) |
Set the current column.
line_number | ||
yyscanner | The scanner object. |
Definition at line 2066 of file ast_expr2f.c.
References YY_CURRENT_BUFFER, yy_fatal_error(), and yycolumn.
02067 { 02068 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 02069 02070 /* column is only valid if an input buffer exists. */ 02071 if (! YY_CURRENT_BUFFER ) 02072 yy_fatal_error( "ast_yyset_column called with no buffer" , yyscanner); 02073 02074 yycolumn = column_no; 02075 }
void ast_yyset_debug | ( | int | debug_flag, | |
yyscan_t | yyscanner | |||
) |
Definition at line 2101 of file ast_expr2f.c.
References yy_flex_debug.
02102 { 02103 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 02104 yy_flex_debug = bdebug ; 02105 }
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.
user_defined | The data to be associated with this scanner. | |
yyscanner | The scanner object. |
Definition at line 2041 of file ast_expr2f.c.
References yyextra.
02042 { 02043 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 02044 yyextra = user_defined ; 02045 }
void ast_yyset_in | ( | FILE * | in_str, | |
yyscan_t | yyscanner | |||
) |
Set the input stream. This does not discard the current input buffer.
in_str | A readable stream. | |
yyscanner | The scanner object. |
Definition at line 2083 of file ast_expr2f.c.
References yyin.
void ast_yyset_lineno | ( | int | line_number, | |
yyscan_t | yyscanner | |||
) |
Set the current line number.
line_number | ||
yyscanner | The scanner object. |
Definition at line 2051 of file ast_expr2f.c.
References YY_CURRENT_BUFFER, yy_fatal_error(), and yylineno.
02052 { 02053 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 02054 02055 /* lineno is only valid if an input buffer exists. */ 02056 if (! YY_CURRENT_BUFFER ) 02057 yy_fatal_error( "ast_yyset_lineno called with no buffer" , yyscanner); 02058 02059 yylineno = line_number; 02060 }
void ast_yyset_out | ( | FILE * | out_str, | |
yyscan_t | yyscanner | |||
) |
static char * expr2_token_subst | ( | const char * | mess | ) | [static] |
Definition at line 2398 of file ast_expr2f.c.
References len, malloc, and t.
Referenced by ast_yyerror().
02399 { 02400 /* calc a length, malloc, fill, and return; yyerror had better free it! */ 02401 int len=0,i; 02402 const char *p; 02403 char *res, *s,*t; 02404 int expr2_token_equivs_entries = sizeof(expr2_token_equivs1)/sizeof(char*); 02405 02406 for (p=mess; *p; p++) { 02407 for (i=0; i<expr2_token_equivs_entries; i++) { 02408 if ( strncmp(p,expr2_token_equivs1[i],strlen(expr2_token_equivs1[i])) == 0 ) 02409 { 02410 len+=strlen(expr2_token_equivs2[i])+2; 02411 p += strlen(expr2_token_equivs1[i])-1; 02412 break; 02413 } 02414 } 02415 len++; 02416 } 02417 res = (char*)malloc(len+1); 02418 res[0] = 0; 02419 s = res; 02420 for (p=mess; *p;) { 02421 int found = 0; 02422 for (i=0; i<expr2_token_equivs_entries; i++) { 02423 if ( strncmp(p,expr2_token_equivs1[i],strlen(expr2_token_equivs1[i])) == 0 ) { 02424 *s++ = '\''; 02425 for (t=expr2_token_equivs2[i]; *t;) { 02426 *s++ = *t++; 02427 } 02428 *s++ = '\''; 02429 p += strlen(expr2_token_equivs1[i]); 02430 found = 1; 02431 break; 02432 } 02433 } 02434 if( !found ) 02435 *s++ = *p++; 02436 } 02437 *s++ = 0; 02438 return res; 02439 }
static int input | ( | yyscan_t | yyscanner | ) | [static] |
Referenced by app_exec(), conf_exec(), conf_run(), and hasvoicemail_exec().
static void yy_fatal_error | ( | yyconst char * | msg, | |
yyscan_t | yyscanner | |||
) | [static] |
Definition at line 1940 of file ast_expr2f.c.
References YY_EXIT_FAILURE.
01941 { 01942 (void) fprintf( stderr, "%s\n", msg ); 01943 exit( YY_EXIT_FAILURE ); 01944 }
static void yy_fatal_error | ( | yyconst char | msg[], | |
yyscan_t | yyscanner | |||
) | [static] |
Referenced by ast_yyset_column(), and ast_yyset_lineno().
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 2161 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(), and ast_yylex_init().
02162 { 02163 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 02164 /* Initialization is the same as for the non-reentrant scanner. 02165 * This function is called from ast_yylex_destroy(), so don't allocate here. 02166 */ 02167 02168 yyg->yy_buffer_stack = 0; 02169 yyg->yy_buffer_stack_top = 0; 02170 yyg->yy_buffer_stack_max = 0; 02171 yyg->yy_c_buf_p = (char *) 0; 02172 yyg->yy_init = 0; 02173 yyg->yy_start = 0; 02174 02175 yyg->yy_start_stack_ptr = 0; 02176 yyg->yy_start_stack_depth = 0; 02177 yyg->yy_start_stack = NULL; 02178 02179 /* Defined in main.c */ 02180 #ifdef YY_STDINIT 02181 yyin = stdin; 02182 yyout = stdout; 02183 #else 02184 yyin = (FILE *) 0; 02185 yyout = (FILE *) 0; 02186 #endif 02187 02188 /* For future reference: Set errno on error, since we are called by 02189 * ast_yylex_init() 02190 */ 02191 return 0; 02192 }
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] |
int curlycount = 0 [static] |
Definition at line 571 of file ast_expr2f.c.
char* expr2_token_equivs1[] [static] |
Definition at line 2347 of file ast_expr2f.c.
char* expr2_token_equivs2[] [static] |
Definition at line 2372 of file ast_expr2f.c.
char extra_error_message[4095] |
Definition at line 2330 of file ast_expr2f.c.
int extra_error_message_supplied = 0 |
Definition at line 2331 of file ast_expr2f.c.
yyconst flex_int16_t yy_accept[55] [static] |
Definition at line 368 of file ast_expr2f.c.
yyconst flex_int16_t yy_base[61] [static] |
Definition at line 417 of file ast_expr2f.c.
yyconst flex_int16_t yy_chk[127] [static] |
Definition at line 455 of file ast_expr2f.c.
yyconst flex_int16_t yy_def[61] [static] |
Definition at line 427 of file ast_expr2f.c.
yyconst flex_int32_t yy_ec[256] [static] |
Definition at line 378 of file ast_expr2f.c.
yyconst flex_int32_t yy_meta[26] [static] |
Definition at line 410 of file ast_expr2f.c.
yyconst flex_int16_t yy_nxt[127] [static] |
Definition at line 437 of file ast_expr2f.c.