Wed Jan 8 2020 09:49:57

Asterisk developer's documentation


ast_expr2f.c File Reference

Dialplan Expression Lexical Scanner. More...

#include "asterisk.h"
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <stdlib.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 "asterisk/channel.h"
#include "ast_expr2.h"
#include <unistd.h>

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
 

Macros

#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 FLEXINT_H
 
#define FP___FMOD   fmod
 
#define FP___PRINTF   "%.16g"
 
#define FP___STRTOD   strtod
 
#define FP___TYPE   double
 
#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   39
 
#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   38
 
#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 YY_STRUCT_YY_BUFFER_STATE
 
#define YY_TYPEDEF_YY_BUFFER_STATE
 
#define YY_TYPEDEF_YY_SCANNER_T
 
#define YY_TYPEDEF_YY_SIZE_T
 
#define YY_USER_ACTION
 
#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_number, AST_EXPR_numeric_string, AST_EXPR_string, AST_EXPR_number,
  AST_EXPR_numeric_string, AST_EXPR_string
}
 

Functions

int ast_expr (char *expr, char *buf, int length, struct ast_channel *chan)
 Evaluate the given expression. More...
 
void ast_expr_clear_extra_error_info (void)
 
void ast_expr_register_extra_error_info (char *message)
 
int ast_str_expr (struct ast_str **str, ssize_t maxlen, struct ast_channel *chan, char *expr)
 Evaluate the given expression. More...
 
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 *, YYLTYPE *, struct parse_io *)
 
int ast_yyerror (const char *s, yyltype *loc, struct parse_io *parseio)
 
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)
 
 if (!yyg->yy_init)
 
static int input (yyscan_t yyscanner)
 
int isatty (int)
 
 while (1)
 
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)
 
static void yyunput (int c, register char *yy_bp, yyscan_t yyscanner)
 

Variables

static int curlycount = 0
 
static const char *const expr2_token_equivs1 []
 
static const char *const expr2_token_equivs2 []
 
char extra_error_message [4095]
 
int extra_error_message_supplied = 0
 
static yyconst flex_int16_t yy_accept [63]
 
register int yy_act
 
static yyconst flex_int16_t yy_base [70]
 
register char * yy_bp
 
static yyconst flex_int16_t yy_chk [159]
 
register char * yy_cp
 
 YY_DECL
 
static yyconst flex_int16_t yy_def [70]
 
static yyconst flex_int32_t yy_ec [256]
 
static yyconst flex_int32_t yy_meta [29]
 
static yyconst flex_int16_t yy_nxt [159]
 
struct yyguts_tyyg = (struct yyguts_t*)yyscanner
 
 yylloc = yylloc_param
 
 yylval = yylval_param
 

Detailed Description

Dialplan Expression Lexical Scanner.

Definition in file ast_expr2f.c.

Macro Definition Documentation

#define ast_yywrap (   n)    1

Definition at line 330 of file ast_expr2f.c.

Referenced by input(), and while().

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

Definition at line 144 of file ast_expr2f.c.

Referenced by while().

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

Definition at line 555 of file ast_expr2f.c.

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

#define EOB_ACT_CONTINUE_SCAN   0

Definition at line 175 of file ast_expr2f.c.

Referenced by input(), while(), and yy_get_next_buffer().

#define EOB_ACT_END_OF_FILE   1

Definition at line 176 of file ast_expr2f.c.

Referenced by input(), while(), and yy_get_next_buffer().

#define EOB_ACT_LAST_MATCH   2

Definition at line 177 of file ast_expr2f.c.

Referenced by input(), while(), and yy_get_next_buffer().

#define FLEX_BETA

Definition at line 16 of file ast_expr2f.c.

#define FLEX_SCANNER

Definition at line 11 of file ast_expr2f.c.

#define FLEXINT_H

Definition at line 32 of file ast_expr2f.c.

#define FP___FMOD   fmod

Definition at line 528 of file ast_expr2f.c.

#define FP___PRINTF   "%.16g"

Definition at line 527 of file ast_expr2f.c.

Referenced by ast_expr(), and ast_str_expr().

#define FP___STRTOD   strtod

Definition at line 529 of file ast_expr2f.c.

#define FP___TYPE   double

Definition at line 530 of file ast_expr2f.c.

#define INITIAL   0

Definition at line 605 of file ast_expr2f.c.

Referenced by while().

#define INT16_MAX   (32767)

Definition at line 75 of file ast_expr2f.c.

#define INT16_MIN   (-32767-1)

Definition at line 66 of file ast_expr2f.c.

#define INT32_MAX   (2147483647)

Definition at line 78 of file ast_expr2f.c.

Referenced by ast_parse_arg().

#define INT32_MIN   (-2147483647-1)

Definition at line 69 of file ast_expr2f.c.

Referenced by ast_parse_arg().

#define INT8_MAX   (127)

Definition at line 72 of file ast_expr2f.c.

#define INT8_MIN   (-128)

Definition at line 63 of file ast_expr2f.c.

#define REJECT   reject_used_but_not_detected

Definition at line 481 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)
struct yyguts_t * yyg
Definition: ast_expr2f.c:848
#define yyleng
Definition: ast_expr2f.c:134
#define YY_CURRENT_BUFFER_LVALUE
Definition: ast_expr2f.c:280
char * yytext_r
Definition: ast_expr2f.c:649

Definition at line 572 of file ast_expr2f.c.

Referenced by while().

#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)
#define yytext
Definition: ast_expr2f.c:135
Definition: ast_expr2.c:325
#define calloc(a, b)
Definition: astmm.h:79
#define strdup(a)
Definition: astmm.h:106

Definition at line 584 of file ast_expr2f.c.

Referenced by while().

#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)
#define yytext
Definition: ast_expr2f.c:135
Definition: ast_expr2.c:325
#define calloc(a, b)
Definition: astmm.h:79
#define strdup(a)
Definition: astmm.h:106

Definition at line 578 of file ast_expr2f.c.

Referenced by while().

#define trail   2

Definition at line 607 of file ast_expr2f.c.

Referenced by while().

#define UINT16_MAX   (65535U)

Definition at line 84 of file ast_expr2f.c.

#define UINT32_MAX   (4294967295U)

Definition at line 87 of file ast_expr2f.c.

Referenced by ast_parse_arg().

#define UINT8_MAX   (255U)

Definition at line 81 of file ast_expr2f.c.

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

Definition at line 195 of file ast_expr2f.c.

Referenced by while().

#define var   1

Definition at line 606 of file ast_expr2f.c.

Referenced by __init_manager(), acf_iaxvar_read(), acf_iaxvar_write(), acf_sprintf(), actual_load_config(), add_cfg_entry(), add_rt_cfg_entry(), add_rt_multi_cfg_entry(), aji_load_config(), append_channel_vars(), apply_options(), apply_options_full(), apply_outgoing(), array(), ast_bridge_timelimit(), ast_cdr_copy_vars(), ast_cdr_data_add_structure(), ast_cdr_serialize_variables(), ast_channeltype_list(), ast_config_text_file_save(), ast_http_get_post_vars(), ast_iax2_new(), ast_plc_reload(), ast_var_assign(), ast_variables_reverse(), ast_xmldoc_load_documentation(), authenticate_reply(), build_event_channel(), clearvar_prefix(), cli_realtime_load(), conf_exec(), conf_run(), config_module(), console_cmd(), crement_function_read(), find_conf(), find_conf_realtime(), find_realtime(), find_user_realtime(), free_channelvars(), function_realtime_read(), function_realtime_readdestroy(), get_insecure_variable_from_config(), get_insecure_variable_from_sippeers(), global_read(), gtalk_load_config(), handle_updates(), handle_uri(), http_post_callback(), iax2_call(), iax_parse_ies(), inherit_category(), init_logger_chain(), jingle_load_config(), ldap_loadentry(), ldap_table_config_add_attribute(), leave_queue(), load_config(), load_moh_classes(), local_ast_moh_start(), man_do_variable_value(), manager_sipnotify(), meetme_menu_admin_extended(), minivm_account_func_read(), misdn_hangup(), move_variables(), odbc_load_module(), osp_create_provider(), parse_config(), parse_cookies(), parse_variable_name(), pbx_builtin_serialize_variables(), pbx_substitute_variables_helper_full(), prep_email_sub_vars(), process_config(), process_text_line(), queue_function_queuewaitingcount(), realtime_alias(), realtime_common(), realtime_curl(), realtime_directory(), realtime_ldap(), realtime_ldap_entry_to_var(), realtime_ldap_result_to_vars(), realtime_multi_curl(), realtime_multi_ldap(), realtime_multi_odbc(), realtime_multi_pgsql(), realtime_odbc(), realtime_peer(), realtime_peer_get_sippeer_helper(), realtime_pgsql(), realtime_switch_common(), realtime_user(), realtimefield_read(), reload_followme(), reload_module(), reload_single_queue(), rt_extend_conf(), shared_read(), shared_variable_free(), shared_write(), shift_pop(), show_users_realtime(), sip_cli_notify(), sla_build_station(), sla_build_trunk(), socket_process(), transmit_invite(), unshift_push(), variable_named(), vm_change_password(), while(), write_password_to_file(), and xml_translate().

#define YY_AT_BOL ( )    (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)

Definition at line 326 of file ast_expr2f.c.

#define YY_BREAK   break;

Definition at line 835 of file ast_expr2f.c.

Referenced by while().

#define YY_BUF_SIZE   16384

Definition at line 163 of file ast_expr2f.c.

Referenced by ast_yyrestart(), and if().

#define YY_BUFFER_EOF_PENDING   2

Definition at line 262 of file ast_expr2f.c.

Referenced by yy_get_next_buffer().

#define YY_BUFFER_NEW   0

Definition at line 250 of file ast_expr2f.c.

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

#define YY_BUFFER_NORMAL   1

Definition at line 251 of file ast_expr2f.c.

Referenced by while().

#define YY_DECL
Value:
int ast_yylex \
(YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner)
int ast_yylex(YYSTYPE *yylval_param, YYLTYPE *yylloc_param, yyscan_t yyscanner)
void * yyscan_t
Definition: ael_structs.h:71

Definition at line 822 of file ast_expr2f.c.

#define YY_DECL_IS_OURS   1

Definition at line 817 of file ast_expr2f.c.

#define YY_DO_BEFORE_ACTION

Definition at line 347 of file ast_expr2f.c.

Referenced by while().

#define YY_END_OF_BUFFER   39

Definition at line 356 of file ast_expr2f.c.

Referenced by while().

#define YY_END_OF_BUFFER_CHAR   0
#define YY_EXIT_FAILURE   2

Definition at line 2009 of file ast_expr2f.c.

Referenced by yy_fatal_error().

#define YY_EXTRA_TYPE   void *

Definition at line 618 of file ast_expr2f.c.

#define YY_FATAL_ERROR (   msg)    yy_fatal_error( msg , yyscanner)
#define yy_flex_debug   yyg->yy_flex_debug_r

Definition at line 138 of file ast_expr2f.c.

Referenced by ast_yyget_debug(), and ast_yyset_debug().

#define YY_FLEX_MAJOR_VERSION   2

Definition at line 12 of file ast_expr2f.c.

#define YY_FLEX_MINOR_VERSION   5

Definition at line 13 of file ast_expr2f.c.

#define YY_FLEX_SUBMINOR_VERSION   35

Definition at line 14 of file ast_expr2f.c.

#define YY_FLUSH_BUFFER   ast_yy_flush_buffer(YY_CURRENT_BUFFER ,yyscanner)

Definition at line 294 of file ast_expr2f.c.

#define YY_INPUT (   buf,
  result,
  max_size 
)

Definition at line 761 of file ast_expr2f.c.

Referenced by yy_get_next_buffer().

#define YY_INT_ALIGNED   short int

Definition at line 7 of file ast_expr2f.c.

#define YY_LESS_LINENO (   n)

Definition at line 179 of file ast_expr2f.c.

#define YY_MORE_ADJ   yyg->yy_more_len

Definition at line 483 of file ast_expr2f.c.

Referenced by while(), yy_get_next_buffer(), and yy_get_previous_state().

#define yy_new_buffer   ast_yy_create_buffer

Definition at line 304 of file ast_expr2f.c.

#define YY_NEW_FILE   ast_yyrestart(yyin ,yyscanner )

Definition at line 157 of file ast_expr2f.c.

Referenced by input(), and while().

#define YY_NULL   0

Definition at line 114 of file ast_expr2f.c.

#define YY_NUM_RULES   38

Definition at line 355 of file ast_expr2f.c.

#define YY_READ_BUF_SIZE   8192

Definition at line 746 of file ast_expr2f.c.

Referenced by yy_get_next_buffer().

#define YY_RESTORE_YY_MORE_OFFSET

Definition at line 484 of file ast_expr2f.c.

Referenced by while().

#define YY_RULE_SETUP   YY_USER_ACTION

Definition at line 838 of file ast_expr2f.c.

Referenced by while().

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

Definition at line 121 of file ast_expr2f.c.

Referenced by while(), and yy_get_previous_state().

#define yy_set_bol (   at_bol)

Definition at line 316 of file ast_expr2f.c.

#define yy_set_interactive (   is_interactive)

Definition at line 306 of file ast_expr2f.c.

#define YY_SKIP_YYWRAP

Definition at line 331 of file ast_expr2f.c.

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

Definition at line 150 of file ast_expr2f.c.

Referenced by while().

#define YY_START_STACK_INCR   25

Definition at line 803 of file ast_expr2f.c.

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

Definition at line 168 of file ast_expr2f.c.

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

Definition at line 154 of file ast_expr2f.c.

Referenced by while().

#define YY_STRUCT_YY_BUFFER_STATE

Definition at line 203 of file ast_expr2f.c.

#define YY_TYPEDEF_YY_BUFFER_STATE

Definition at line 171 of file ast_expr2f.c.

#define YY_TYPEDEF_YY_SCANNER_T

Definition at line 125 of file ast_expr2f.c.

#define YY_TYPEDEF_YY_SIZE_T

Definition at line 198 of file ast_expr2f.c.

#define YY_USER_ACTION

Definition at line 830 of file ast_expr2f.c.

#define yycolumn   (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)

Definition at line 137 of file ast_expr2f.c.

Referenced by ast_yyget_column(), and ast_yyset_column().

#define yyconst

Definition at line 110 of file ast_expr2f.c.

#define yyextra   yyg->yyextra_r

Definition at line 133 of file ast_expr2f.c.

Referenced by ast_yyget_extra(), and ast_yyset_extra().

#define yyleng   yyg->yyleng_r

Definition at line 134 of file ast_expr2f.c.

Referenced by ast_yyget_leng(), and while().

#define yyless (   n)

Definition at line 2021 of file ast_expr2f.c.

#define yyless (   n)

Definition at line 2021 of file ast_expr2f.c.

#define yylineno   (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)

Definition at line 136 of file ast_expr2f.c.

Referenced by ast_yyget_lineno(), and ast_yyset_lineno().

#define yylloc   yyg->yylloc_r

Definition at line 665 of file ast_expr2f.c.

#define yylval   yyg->yylval_r

Definition at line 663 of file ast_expr2f.c.

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

Definition at line 482 of file ast_expr2f.c.

Referenced by while().

#define yyout   yyg->yyout_r

Definition at line 132 of file ast_expr2f.c.

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

#define YYSTATE   YY_START

Definition at line 151 of file ast_expr2f.c.

#define YYTABLES_NAME   "yytables"

Definition at line 2373 of file ast_expr2f.c.

#define yyterminate ( )    return YY_NULL

Definition at line 798 of file ast_expr2f.c.

Referenced by while().

#define yytext   yyg->yytext_r

Definition at line 135 of file ast_expr2f.c.

Referenced by ast_yyerror(), ast_yyget_text(), and while().

#define yytext_ptr   yytext_r

Definition at line 337 of file ast_expr2f.c.

Typedef Documentation

typedef short int flex_int16_t

Definition at line 54 of file ast_expr2f.c.

typedef int flex_int32_t

Definition at line 55 of file ast_expr2f.c.

typedef signed char flex_int8_t

Definition at line 53 of file ast_expr2f.c.

typedef unsigned short int flex_uint16_t

Definition at line 57 of file ast_expr2f.c.

typedef unsigned int flex_uint32_t

Definition at line 58 of file ast_expr2f.c.

typedef unsigned char flex_uint8_t

Definition at line 56 of file ast_expr2f.c.

Definition at line 172 of file ast_expr2f.c.

typedef unsigned char YY_CHAR

Definition at line 333 of file ast_expr2f.c.

typedef size_t yy_size_t

Definition at line 199 of file ast_expr2f.c.

typedef int yy_state_type

Definition at line 335 of file ast_expr2f.c.

typedef void* yyscan_t

Definition at line 126 of file ast_expr2f.c.

Enumeration Type Documentation

enum valtype
Enumerator
AST_EXPR_number 
AST_EXPR_numeric_string 
AST_EXPR_string 
AST_EXPR_number 
AST_EXPR_numeric_string 
AST_EXPR_string 

Definition at line 558 of file ast_expr2f.c.

Function Documentation

int ast_expr ( char *  expr,
char *  buf,
int  length,
struct ast_channel chan 
)

Evaluate the given expression.

Parameters
exprAn expression
bufResult buffer
lengthSize of the result buffer, in bytes
chanChannel to use for evaluating included dialplan functions, if any
Returns
Length of the result string, in bytes

Definition at line 2396 of file ast_expr2f.c.

References ast_copy_string(), AST_EXPR_number, ast_yy_scan_string(), ast_yylex_destroy(), ast_yylex_init(), ast_yyparse(), FP___PRINTF, free, val::i, val::s, parse_io::scanner, parse_io::string, val::type, val::u, and parse_io::val.

Referenced by check_pval_item(), and pbx_substitute_variables_helper_full().

2397 {
2398  struct parse_io io = { .string = expr, .chan = chan };
2399  int return_value = 0;
2400 
2401  ast_yylex_init(&io.scanner);
2402 
2403  ast_yy_scan_string(expr, io.scanner);
2404 
2405  ast_yyparse ((void *) &io);
2406 
2408 
2409  if (!io.val) {
2410  if (length > 1) {
2411  strcpy(buf, "0");
2412  return_value = 1;
2413  }
2414  } else {
2415  if (io.val->type == AST_EXPR_number) {
2416  int res_length;
2417 
2418  res_length = snprintf(buf, length, FP___PRINTF, io.val->u.i);
2419  return_value = (res_length <= length) ? res_length : length;
2420  } else {
2421  if (io.val->u.s)
2422 #if defined(STANDALONE) || defined(LOW_MEMORY) || defined(STANDALONE)
2423  strncpy(buf, io.val->u.s, length - 1);
2424 #else /* !STANDALONE && !LOW_MEMORY */
2425  ast_copy_string(buf, io.val->u.s, length);
2426 #endif /* STANDALONE || LOW_MEMORY */
2427  else
2428  buf[0] = 0;
2429  return_value = strlen(buf);
2430  free(io.val->u.s);
2431  }
2432  free(io.val);
2433  }
2434  return return_value;
2435 }
int ast_yyparse(void *)
#define FP___PRINTF
Definition: ast_expr2f.c:527
FP___TYPE i
Definition: ast_expr2.c:329
static struct io_context * io
Definition: chan_gtalk.c:228
YY_BUFFER_STATE ast_yy_scan_string(yyconst char *yy_str, yyscan_t yyscanner)
Definition: ast_expr2f.c:1965
struct val * val
Definition: ast_expr2.c:351
yyscan_t scanner
Definition: ael_structs.h:78
enum valtype type
Definition: ast_expr2.c:326
char * s
Definition: ast_expr2.c:328
int ast_yylex_init(yyscan_t *scanner)
Definition: ast_expr2f.c:2212
union val::@218 u
#define free(a)
Definition: astmm.h:94
int ast_yylex_destroy(yyscan_t yyscanner)
Definition: ast_expr2f.c:2303
void ast_copy_string(char *dst, const char *src, size_t size)
Size-limited null-terminating string copy.
Definition: strings.h:223
void ast_expr_clear_extra_error_info ( void  )

Definition at line 2475 of file ast_expr2f.c.

Referenced by check_pval_item().

2476 {
2478  extra_error_message[0] = 0;
2479 }
int extra_error_message_supplied
Definition: ast_expr2f.c:2465
char extra_error_message[4095]
Definition: ast_expr2f.c:2464
void ast_expr_register_extra_error_info ( char *  message)

Definition at line 2469 of file ast_expr2f.c.

Referenced by check_pval_item().

2470 {
2472  strcpy(extra_error_message, message);
2473 }
int extra_error_message_supplied
Definition: ast_expr2f.c:2465
char extra_error_message[4095]
Definition: ast_expr2f.c:2464
int ast_str_expr ( struct ast_str **  str,
ssize_t  maxlen,
struct ast_channel chan,
char *  expr 
)

Evaluate the given expression.

Parameters
strDynamic result buffer
maxlen<0 if the size of the buffer should remain constant, >0 if the size of the buffer should expand to that many bytes, maximum, or 0 for unlimited expansion of the result buffer
chanChannel to use for evaluating included dialplan functions, if any
exprAn expression
Returns
Length of the result string, in bytes

Definition at line 2438 of file ast_expr2f.c.

References AST_EXPR_number, ast_str_set(), ast_str_strlen(), ast_yy_scan_string(), ast_yylex_destroy(), ast_yylex_init(), ast_yyparse(), FP___PRINTF, free, val::i, val::s, parse_io::scanner, parse_io::string, val::type, val::u, and parse_io::val.

Referenced by ast_str_substitute_variables_full().

2439 {
2440  struct parse_io io = { .string = expr, .chan = chan };
2441 
2442  ast_yylex_init(&io.scanner);
2443  ast_yy_scan_string(expr, io.scanner);
2444  ast_yyparse ((void *) &io);
2446 
2447  if (!io.val) {
2448  ast_str_set(str, maxlen, "0");
2449  } else {
2450  if (io.val->type == AST_EXPR_number) {
2451  int res_length;
2452  ast_str_set(str, maxlen, FP___PRINTF, io.val->u.i);
2453  } else if (io.val->u.s) {
2454  ast_str_set(str, maxlen, "%s", io.val->u.s);
2455  free(io.val->u.s);
2456  }
2457  free(io.val);
2458  }
2459  return ast_str_strlen(*str);
2460 }
int ast_yyparse(void *)
#define FP___PRINTF
Definition: ast_expr2f.c:527
FP___TYPE i
Definition: ast_expr2.c:329
static struct io_context * io
Definition: chan_gtalk.c:228
YY_BUFFER_STATE ast_yy_scan_string(yyconst char *yy_str, yyscan_t yyscanner)
Definition: ast_expr2f.c:1965
struct val * val
Definition: ast_expr2.c:351
yyscan_t scanner
Definition: ael_structs.h:78
enum valtype type
Definition: ast_expr2.c:326
char * s
Definition: ast_expr2.c:328
int ast_str_set(struct ast_str **buf, ssize_t max_len, const char *fmt,...)
Set a dynamic string using variable arguments.
Definition: strings.h:874
int ast_yylex_init(yyscan_t *scanner)
Definition: ast_expr2f.c:2212
union val::@218 u
#define free(a)
Definition: astmm.h:94
int ast_yylex_destroy(yyscan_t yyscanner)
Definition: ast_expr2f.c:2303
size_t ast_str_strlen(const struct ast_str *buf)
Returns the current length of the string stored within buf.
Definition: strings.h:471
YY_BUFFER_STATE ast_yy_create_buffer ( FILE *  file,
int  size,
yyscan_t  yyscanner 
)

Allocate and initialize an input buffer state.

Parameters
fileA readable stream.
sizeThe character buffer size in bytes. When in doubt, use YY_BUF_SIZE.
yyscannerThe scanner object.
Returns
the allocated buffer state.

Definition at line 1716 of file ast_expr2f.c.

References ast_yy_init_buffer(), ast_yyalloc(), yy_buffer_state::yy_buf_size, yy_buffer_state::yy_ch_buf, YY_FATAL_ERROR, and yy_buffer_state::yy_is_our_buffer.

Referenced by ast_yyrestart(), and if().

1717 {
1718  YY_BUFFER_STATE b;
1719 
1720  b = (YY_BUFFER_STATE) ast_yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner );
1721  if ( ! b )
1722  YY_FATAL_ERROR( "out of dynamic memory in ast_yy_create_buffer()" );
1723 
1724  b->yy_buf_size = size;
1725 
1726  /* yy_ch_buf has to be 2 characters longer than the size given because
1727  * we need to put in 2 end-of-buffer characters.
1728  */
1729  b->yy_ch_buf = (char *) ast_yyalloc(b->yy_buf_size + 2 ,yyscanner );
1730  if ( ! b->yy_ch_buf )
1731  YY_FATAL_ERROR( "out of dynamic memory in ast_yy_create_buffer()" );
1732 
1733  b->yy_is_our_buffer = 1;
1734 
1735  ast_yy_init_buffer(b,file ,yyscanner);
1736 
1737  return b;
1738 }
#define YY_FATAL_ERROR(msg)
Definition: ast_expr2f.c:808
void * ast_yyalloc(yy_size_t, yyscan_t yyscanner)
Definition: ast_expr2f.c:2356
char * yy_ch_buf
Definition: ast_expr2f.c:208
yy_size_t yy_buf_size
Definition: ast_expr2f.c:214
struct yy_buffer_state * YY_BUFFER_STATE
Definition: ast_expr2f.c:172
static void ast_yy_init_buffer(YY_BUFFER_STATE b, FILE *file, yyscan_t yyscanner)
Definition: ast_expr2f.c:1768
void ast_yy_delete_buffer ( YY_BUFFER_STATE  b,
yyscan_t  yyscanner 
)

Destroy the buffer.

Parameters
ba buffer created with ast_yy_create_buffer()
yyscannerThe scanner object.

Definition at line 1744 of file ast_expr2f.c.

References ast_yyfree(), yy_buffer_state::yy_ch_buf, YY_CURRENT_BUFFER, YY_CURRENT_BUFFER_LVALUE, and yy_buffer_state::yy_is_our_buffer.

Referenced by ast_yylex_destroy(), and ast_yypop_buffer_state().

1745 {
1746  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1747 
1748  if ( ! b )
1749  return;
1750 
1751  if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1753 
1754  if ( b->yy_is_our_buffer )
1755  ast_yyfree((void *) b->yy_ch_buf ,yyscanner );
1756 
1757  ast_yyfree((void *) b ,yyscanner );
1758 }
struct yyguts_t * yyg
Definition: ast_expr2f.c:848
char * yy_ch_buf
Definition: ast_expr2f.c:208
#define YY_CURRENT_BUFFER
Definition: ast_expr2f.c:273
struct yy_buffer_state * YY_BUFFER_STATE
Definition: ast_expr2f.c:172
void ast_yyfree(void *, yyscan_t yyscanner)
Definition: ast_expr2f.c:2388
#define YY_CURRENT_BUFFER_LVALUE
Definition: ast_expr2f.c:280
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
bthe buffer state to be flushed, usually YY_CURRENT_BUFFER.
yyscannerThe scanner object.

Definition at line 1797 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().

1798 {
1799  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1800  if ( ! b )
1801  return;
1802 
1803  b->yy_n_chars = 0;
1804 
1805  /* We always need two end-of-buffer characters. The first causes
1806  * a transition to the end-of-buffer state. The second causes
1807  * a jam in that state.
1808  */
1811 
1812  b->yy_buf_pos = &b->yy_ch_buf[0];
1813 
1814  b->yy_at_bol = 1;
1816 
1817  if ( b == YY_CURRENT_BUFFER )
1818  ast_yy_load_buffer_state(yyscanner );
1819 }
struct yyguts_t * yyg
Definition: ast_expr2f.c:848
char * yy_ch_buf
Definition: ast_expr2f.c:208
#define YY_END_OF_BUFFER_CHAR
Definition: ast_expr2f.c:159
#define YY_BUFFER_NEW
Definition: ast_expr2f.c:250
#define YY_CURRENT_BUFFER
Definition: ast_expr2f.c:273
static void ast_yy_load_buffer_state(yyscan_t yyscanner)
Definition: ast_expr2f.c:1701
char * yy_buf_pos
Definition: ast_expr2f.c:209
static void ast_yy_init_buffer ( YY_BUFFER_STATE  b,
FILE *  file,
yyscan_t  yyscanner 
)
static

Definition at line 1768 of file ast_expr2f.c.

References ast_yy_flush_buffer(), errno, isatty(), 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.

Referenced by ast_yy_create_buffer(), and ast_yyrestart().

1770 {
1771  int oerrno = errno;
1772  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1773 
1774  ast_yy_flush_buffer(b ,yyscanner);
1775 
1776  b->yy_input_file = file;
1777  b->yy_fill_buffer = 1;
1778 
1779  /* If b is the current buffer, then ast_yy_init_buffer was _probably_
1780  * called from ast_yyrestart() or through yy_get_next_buffer.
1781  * In that case, we don't want to reset the lineno or column.
1782  */
1783  if (b != YY_CURRENT_BUFFER){
1784  b->yy_bs_lineno = 1;
1785  b->yy_bs_column = 0;
1786  }
1787 
1788  b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1789 
1790  errno = oerrno;
1791 }
struct yyguts_t * yyg
Definition: ast_expr2f.c:848
void ast_yy_flush_buffer(YY_BUFFER_STATE b, yyscan_t yyscanner)
Definition: ast_expr2f.c:1797
int errno
#define YY_CURRENT_BUFFER
Definition: ast_expr2f.c:273
int isatty(int)
FILE * yy_input_file
Definition: ast_expr2f.c:206
static void ast_yy_load_buffer_state ( yyscan_t  yyscanner)
static

Definition at line 1701 of file ast_expr2f.c.

References yyguts_t::yy_c_buf_p, YY_CURRENT_BUFFER_LVALUE, yyguts_t::yy_hold_char, yyguts_t::yy_n_chars, and yyin.

Referenced by ast_yy_flush_buffer(), ast_yy_switch_to_buffer(), ast_yypop_buffer_state(), ast_yypush_buffer_state(), ast_yyrestart(), and if().

1702 {
1703  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1704  yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1705  yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1706  yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1707  yyg->yy_hold_char = *yyg->yy_c_buf_p;
1708 }
char yy_hold_char
Definition: ast_expr2f.c:633
#define yyin
Definition: ast_expr2f.c:131
struct yyguts_t * yyg
Definition: ast_expr2f.c:848
char * yy_c_buf_p
Definition: ast_expr2f.c:636
int yy_n_chars
Definition: ast_expr2f.c:634
#define YY_CURRENT_BUFFER_LVALUE
Definition: ast_expr2f.c:280
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
basethe character buffer
sizethe size in bytes of the character buffer
yyscannerThe scanner object.
Returns
the newly allocated buffer state object.

Definition at line 1928 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().

1929 {
1930  YY_BUFFER_STATE b;
1931 
1932  if ( size < 2 ||
1933  base[size-2] != YY_END_OF_BUFFER_CHAR ||
1934  base[size-1] != YY_END_OF_BUFFER_CHAR )
1935  /* They forgot to leave room for the EOB's. */
1936  return 0;
1937 
1938  b = (YY_BUFFER_STATE) ast_yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner );
1939  if ( ! b )
1940  YY_FATAL_ERROR( "out of dynamic memory in ast_yy_scan_buffer()" );
1941 
1942  b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1943  b->yy_buf_pos = b->yy_ch_buf = base;
1944  b->yy_is_our_buffer = 0;
1945  b->yy_input_file = 0;
1946  b->yy_n_chars = b->yy_buf_size;
1947  b->yy_is_interactive = 0;
1948  b->yy_at_bol = 1;
1949  b->yy_fill_buffer = 0;
1951 
1952  ast_yy_switch_to_buffer(b ,yyscanner );
1953 
1954  return b;
1955 }
#define YY_FATAL_ERROR(msg)
Definition: ast_expr2f.c:808
void ast_yy_switch_to_buffer(YY_BUFFER_STATE new_buffer, yyscan_t yyscanner)
Definition: ast_expr2f.c:1669
void * ast_yyalloc(yy_size_t, yyscan_t yyscanner)
Definition: ast_expr2f.c:2356
char * yy_ch_buf
Definition: ast_expr2f.c:208
yy_size_t yy_buf_size
Definition: ast_expr2f.c:214
#define YY_END_OF_BUFFER_CHAR
Definition: ast_expr2f.c:159
#define YY_BUFFER_NEW
Definition: ast_expr2f.c:250
struct yy_buffer_state * YY_BUFFER_STATE
Definition: ast_expr2f.c:172
char * yy_buf_pos
Definition: ast_expr2f.c:209
FILE * yy_input_file
Definition: ast_expr2f.c:206
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
bytesthe byte buffer to scan
lenthe number of bytes in the buffer pointed to by bytes.
yyscannerThe scanner object.
Returns
the newly allocated buffer state object.

Definition at line 1978 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().

1979 {
1980  YY_BUFFER_STATE b;
1981  char *buf;
1982  yy_size_t n;
1983  int i;
1984 
1985  /* Get memory for full buffer, including space for trailing EOB's. */
1986  n = _yybytes_len + 2;
1987  buf = (char *) ast_yyalloc(n ,yyscanner );
1988  if ( ! buf )
1989  YY_FATAL_ERROR( "out of dynamic memory in ast_yy_scan_bytes()" );
1990 
1991  for ( i = 0; i < _yybytes_len; ++i )
1992  buf[i] = yybytes[i];
1993 
1994  buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
1995 
1996  b = ast_yy_scan_buffer(buf,n ,yyscanner);
1997  if ( ! b )
1998  YY_FATAL_ERROR( "bad buffer in ast_yy_scan_bytes()" );
1999 
2000  /* It's okay to grow etc. this buffer, and we should throw it
2001  * away when we're done.
2002  */
2003  b->yy_is_our_buffer = 1;
2004 
2005  return b;
2006 }
#define YY_FATAL_ERROR(msg)
Definition: ast_expr2f.c:808
void * ast_yyalloc(yy_size_t, yyscan_t yyscanner)
Definition: ast_expr2f.c:2356
#define YY_END_OF_BUFFER_CHAR
Definition: ast_expr2f.c:159
YY_BUFFER_STATE ast_yy_scan_buffer(char *base, yy_size_t size, yyscan_t yyscanner)
Definition: ast_expr2f.c:1928
size_t yy_size_t
Definition: ast_expr2f.c:199
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
yystra NUL-terminated string to scan
yyscannerThe 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 1965 of file ast_expr2f.c.

References ast_yy_scan_bytes().

Referenced by ast_expr(), and ast_str_expr().

1966 {
1967 
1968  return ast_yy_scan_bytes(yystr,strlen(yystr) ,yyscanner);
1969 }
YY_BUFFER_STATE ast_yy_scan_bytes(yyconst char *bytes, int len, yyscan_t yyscanner)
Definition: ast_expr2f.c:1978
static YYSIZE_T const char * yystr
Definition: ast_expr2.c:1261
void ast_yy_switch_to_buffer ( YY_BUFFER_STATE  new_buffer,
yyscan_t  yyscanner 
)

Switch to a different input buffer.

Parameters
new_bufferThe new input buffer.
yyscannerThe scanner object.

Definition at line 1669 of file ast_expr2f.c.

References ast_yy_load_buffer_state(), ast_yyensure_buffer_stack(), 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.

Referenced by ast_yy_scan_buffer().

1670 {
1671  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1672 
1673  /* TODO. We should be able to replace this entire function body
1674  * with
1675  * ast_yypop_buffer_state();
1676  * ast_yypush_buffer_state(new_buffer);
1677  */
1678  ast_yyensure_buffer_stack (yyscanner);
1679  if ( YY_CURRENT_BUFFER == new_buffer )
1680  return;
1681 
1682  if ( YY_CURRENT_BUFFER )
1683  {
1684  /* Flush out information for old buffer. */
1685  *yyg->yy_c_buf_p = yyg->yy_hold_char;
1686  YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
1687  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
1688  }
1689 
1690  YY_CURRENT_BUFFER_LVALUE = new_buffer;
1691  ast_yy_load_buffer_state(yyscanner );
1692 
1693  /* We don't actually know whether we did this switch during
1694  * EOF (ast_yywrap()) processing, but the only time this flag
1695  * is looked at is after ast_yywrap() is called, so it's safe
1696  * to go ahead and always set it.
1697  */
1698  yyg->yy_did_buffer_switch_on_eof = 1;
1699 }
char yy_hold_char
Definition: ast_expr2f.c:633
struct yyguts_t * yyg
Definition: ast_expr2f.c:848
char * yy_c_buf_p
Definition: ast_expr2f.c:636
int yy_did_buffer_switch_on_eof
Definition: ast_expr2f.c:639
int yy_n_chars
Definition: ast_expr2f.c:634
#define YY_CURRENT_BUFFER
Definition: ast_expr2f.c:273
static void ast_yy_load_buffer_state(yyscan_t yyscanner)
Definition: ast_expr2f.c:1701
#define YY_CURRENT_BUFFER_LVALUE
Definition: ast_expr2f.c:280
static void ast_yyensure_buffer_stack(yyscan_t yyscanner)
Definition: ast_expr2f.c:1878
void * ast_yyalloc ( yy_size_t  size,
yyscan_t  yyscanner 
)

Definition at line 2356 of file ast_expr2f.c.

References malloc.

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

2357 {
2358  return (void *) malloc( size );
2359 }
#define malloc(a)
Definition: astmm.h:88
static void ast_yyensure_buffer_stack ( yyscan_t  yyscanner)
static

Definition at line 1878 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_yy_switch_to_buffer(), ast_yypush_buffer_state(), ast_yyrestart(), and if().

1879 {
1880  int num_to_alloc;
1881  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1882 
1883  if (!yyg->yy_buffer_stack) {
1884 
1885  /* First allocation is just for 2 elements, since we don't know if this
1886  * scanner will even need a stack. We use 2 instead of 1 to avoid an
1887  * immediate realloc on the next call.
1888  */
1889  num_to_alloc = 1;
1891  (num_to_alloc * sizeof(struct yy_buffer_state*)
1892  , yyscanner);
1893  if ( ! yyg->yy_buffer_stack )
1894  YY_FATAL_ERROR( "out of dynamic memory in ast_yyensure_buffer_stack()" );
1895 
1896  memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1897 
1898  yyg->yy_buffer_stack_max = num_to_alloc;
1899  yyg->yy_buffer_stack_top = 0;
1900  return;
1901  }
1902 
1903  if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){
1904 
1905  /* Increase the buffer to prepare for a possible push. */
1906  int grow_size = 8 /* arbitrary grow size */;
1907 
1908  num_to_alloc = yyg->yy_buffer_stack_max + grow_size;
1910  (yyg->yy_buffer_stack,
1911  num_to_alloc * sizeof(struct yy_buffer_state*)
1912  , yyscanner);
1913  if ( ! yyg->yy_buffer_stack )
1914  YY_FATAL_ERROR( "out of dynamic memory in ast_yyensure_buffer_stack()" );
1915 
1916  /* zero only the new slots.*/
1917  memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*));
1918  yyg->yy_buffer_stack_max = num_to_alloc;
1919  }
1920 }
#define YY_FATAL_ERROR(msg)
Definition: ast_expr2f.c:808
struct yyguts_t * yyg
Definition: ast_expr2f.c:848
void * ast_yyalloc(yy_size_t, yyscan_t yyscanner)
Definition: ast_expr2f.c:2356
YY_BUFFER_STATE * yy_buffer_stack
Definition: ast_expr2f.c:632
void * ast_yyrealloc(void *, yy_size_t, yyscan_t yyscanner)
Definition: ast_expr2f.c:2361
size_t yy_buffer_stack_max
Definition: ast_expr2f.c:631
size_t yy_buffer_stack_top
Definition: ast_expr2f.c:630
int ast_yyerror ( const char *  ,
YYLTYPE ,
struct parse_io  
)
int ast_yyerror ( const char *  s,
yyltype loc,
struct parse_io parseio 
)

Definition at line 2578 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.

2579 {
2580  struct yyguts_t * yyg = (struct yyguts_t*)(parseio->scanner);
2581  char spacebuf[8000]; /* best safe than sorry */
2582  char spacebuf2[8000]; /* best safe than sorry */
2583  int i=0;
2584  char *s2 = expr2_token_subst(s);
2585  spacebuf[0] = 0;
2586 
2587  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,
2588  which is the same thing as... get this:
2589  yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]->yy_bs_column
2590  I was tempted to just use yy_buf_pos in the STATE, but..., well:
2591  a. the yy_buf_pos is the current position in the buffer, which
2592  may not relate to the entire string/buffer because of the
2593  buffering.
2594  b. but, analysis of the situation is that when you use the
2595  ast_yy_scan_string func, it creates a single buffer the size of
2596  string, so the two would be the same...
2597  so, in the end, the yycolumn macro is available, shorter, therefore easier. */
2598  spacebuf2[i++]='^';
2599  spacebuf2[i]= 0;
2600 
2601 #ifdef STANDALONE3
2602  /* easier to read in the standalone version */
2603  printf("ast_yyerror(): %s syntax error: %s; Input:\n%s\n%s\n",
2604  (extra_error_message_supplied?extra_error_message:""), s2, parseio->string,spacebuf2);
2605 #else
2606  ast_log(LOG_WARNING,"ast_yyerror(): %s syntax error: %s; Input:\n%s\n%s\n",
2607  (extra_error_message_supplied?extra_error_message:""), s2, parseio->string,spacebuf2);
2608 #endif
2609 #ifndef STANDALONE
2610  ast_log(LOG_WARNING,"If you have questions, please refer to https://wiki.asterisk.org/wiki/display/AST/Channel+Variables\n");
2611 #endif
2612  free(s2);
2613  return(0);
2614 }
#define yytext
Definition: ast_expr2f.c:135
struct yyguts_t * yyg
Definition: ast_expr2f.c:848
#define LOG_WARNING
Definition: logger.h:144
int extra_error_message_supplied
Definition: ast_expr2f.c:2465
yyscan_t scanner
Definition: ael_structs.h:78
char extra_error_message[4095]
Definition: ast_expr2f.c:2464
#define free(a)
Definition: astmm.h:94
void ast_log(int level, const char *file, int line, const char *function, const char *fmt,...)
Used for sending a log message This is the standard logger function. Probably the only way you will i...
Definition: logger.c:1207
static char * expr2_token_subst(const char *mess)
Definition: ast_expr2f.c:2534
#define YY_CURRENT_BUFFER_LVALUE
Definition: ast_expr2f.c:280
char * string
Definition: ast_expr2.c:350
void ast_yyfree ( void *  ptr,
yyscan_t  yyscanner 
)

Definition at line 2388 of file ast_expr2f.c.

References free.

Referenced by ast_yy_delete_buffer(), and ast_yylex_destroy().

2389 {
2390  /* the normal generated ast_yyfree func just frees its first arg;
2391  this get complaints on some systems, as sometimes this
2392  arg is a nil ptr! It's usually not fatal, but is irritating! */
2393  free( (char *) ptr );
2394 }
#define free(a)
Definition: astmm.h:94
int ast_yyget_column ( yyscan_t  yyscanner)

Get the current column number.

Parameters
yyscannerThe scanner object.

Definition at line 2062 of file ast_expr2f.c.

References YY_CURRENT_BUFFER, and yycolumn.

2063 {
2064  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2065 
2066  if (! YY_CURRENT_BUFFER)
2067  return 0;
2068 
2069  return yycolumn;
2070 }
#define yycolumn
Definition: ast_expr2f.c:137
struct yyguts_t * yyg
Definition: ast_expr2f.c:848
#define YY_CURRENT_BUFFER
Definition: ast_expr2f.c:273
int ast_yyget_debug ( yyscan_t  yyscanner)

Definition at line 2167 of file ast_expr2f.c.

References yy_flex_debug.

2168 {
2169  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2170  return yy_flex_debug;
2171 }
struct yyguts_t * yyg
Definition: ast_expr2f.c:848
#define yy_flex_debug
Definition: ast_expr2f.c:138
YY_EXTRA_TYPE ast_yyget_extra ( yyscan_t  yyscanner)

Get the user-defined data for this scanner.

Parameters
yyscannerThe scanner object.

Definition at line 2040 of file ast_expr2f.c.

References yyextra.

2041 {
2042  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2043  return yyextra;
2044 }
#define yyextra
Definition: ast_expr2f.c:133
struct yyguts_t * yyg
Definition: ast_expr2f.c:848
FILE * ast_yyget_in ( yyscan_t  yyscanner)

Get the input stream.

Parameters
yyscannerThe scanner object.

Definition at line 2075 of file ast_expr2f.c.

References yyin.

2076 {
2077  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2078  return yyin;
2079 }
#define yyin
Definition: ast_expr2f.c:131
struct yyguts_t * yyg
Definition: ast_expr2f.c:848
int ast_yyget_leng ( yyscan_t  yyscanner)

Get the length of the current token.

Parameters
yyscannerThe scanner object.

Definition at line 2093 of file ast_expr2f.c.

References yyleng.

2094 {
2095  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2096  return yyleng;
2097 }
struct yyguts_t * yyg
Definition: ast_expr2f.c:848
#define yyleng
Definition: ast_expr2f.c:134
int ast_yyget_lineno ( yyscan_t  yyscanner)

Get the current line number.

Parameters
yyscannerThe scanner object.

Definition at line 2049 of file ast_expr2f.c.

References YY_CURRENT_BUFFER, and yylineno.

2050 {
2051  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2052 
2053  if (! YY_CURRENT_BUFFER)
2054  return 0;
2055 
2056  return yylineno;
2057 }
struct yyguts_t * yyg
Definition: ast_expr2f.c:848
#define YY_CURRENT_BUFFER
Definition: ast_expr2f.c:273
#define yylineno
Definition: ast_expr2f.c:136
YYLTYPE * ast_yyget_lloc ( yyscan_t  yyscanner)

Definition at line 2193 of file ast_expr2f.c.

References yylloc.

2194 {
2195  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2196  return yylloc;
2197 }
struct yyguts_t * yyg
Definition: ast_expr2f.c:848
#define yylloc
Definition: ast_expr2.c:72
YYSTYPE * ast_yyget_lval ( yyscan_t  yyscanner)

Definition at line 2181 of file ast_expr2f.c.

References yylval.

2182 {
2183  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2184  return yylval;
2185 }
struct yyguts_t * yyg
Definition: ast_expr2f.c:848
#define yylval
Definition: ast_expr2.c:68
FILE * ast_yyget_out ( yyscan_t  yyscanner)

Get the output stream.

Parameters
yyscannerThe scanner object.

Definition at line 2084 of file ast_expr2f.c.

References yyout.

2085 {
2086  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2087  return yyout;
2088 }
struct yyguts_t * yyg
Definition: ast_expr2f.c:848
#define yyout
Definition: ast_expr2f.c:132
char * ast_yyget_text ( yyscan_t  yyscanner)

Get the current token.

Parameters
yyscannerThe scanner object.

Definition at line 2103 of file ast_expr2f.c.

References yytext.

2104 {
2105  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2106  return yytext;
2107 }
#define yytext
Definition: ast_expr2f.c:135
struct yyguts_t * yyg
Definition: ast_expr2f.c:848
int ast_yylex ( YYSTYPE yylval_param,
YYLTYPE yylloc_param,
yyscan_t  yyscanner 
)
int ast_yylex_destroy ( yyscan_t  yyscanner)

Definition at line 2303 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(), and ast_str_expr().

2304 {
2305  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2306 
2307  /* Pop the buffer stack, destroying each element. */
2308  while(YY_CURRENT_BUFFER){
2310  YY_CURRENT_BUFFER_LVALUE = NULL;
2311  ast_yypop_buffer_state(yyscanner);
2312  }
2313 
2314  /* Destroy the stack itself. */
2315  ast_yyfree(yyg->yy_buffer_stack ,yyscanner);
2316  yyg->yy_buffer_stack = NULL;
2317 
2318  /* Destroy the start condition stack. */
2319  ast_yyfree(yyg->yy_start_stack ,yyscanner );
2320  yyg->yy_start_stack = NULL;
2321 
2322  /* Reset the globals. This is important in a non-reentrant scanner so the next time
2323  * ast_yylex() is called, initialization will occur. */
2324  yy_init_globals( yyscanner);
2325 
2326  /* Destroy the main struct (reentrant only). */
2327  ast_yyfree ( yyscanner , yyscanner );
2328  yyscanner = NULL;
2329  return 0;
2330 }
struct yyguts_t * yyg
Definition: ast_expr2f.c:848
static int yy_init_globals(yyscan_t yyscanner)
Definition: ast_expr2f.c:2269
YY_BUFFER_STATE * yy_buffer_stack
Definition: ast_expr2f.c:632
int * yy_start_stack
Definition: ast_expr2f.c:642
void ast_yypop_buffer_state(yyscan_t yyscanner)
Definition: ast_expr2f.c:1858
#define YY_CURRENT_BUFFER
Definition: ast_expr2f.c:273
void ast_yyfree(void *, yyscan_t yyscanner)
Definition: ast_expr2f.c:2388
#define YY_CURRENT_BUFFER_LVALUE
Definition: ast_expr2f.c:280
void ast_yy_delete_buffer(YY_BUFFER_STATE b, yyscan_t yyscanner)
Definition: ast_expr2f.c:1744
int ast_yylex_init ( yyscan_t scanner)

Definition at line 2212 of file ast_expr2f.c.

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

Referenced by ast_expr(), and ast_str_expr().

2214 {
2215  if (ptr_yy_globals == NULL){
2216  errno = EINVAL;
2217  return 1;
2218  }
2219 
2220  *ptr_yy_globals = (yyscan_t) ast_yyalloc ( sizeof( struct yyguts_t ), NULL );
2221 
2222  if (*ptr_yy_globals == NULL){
2223  errno = ENOMEM;
2224  return 1;
2225  }
2226 
2227  /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */
2228  memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
2229 
2230  return yy_init_globals ( *ptr_yy_globals );
2231 }
void * ast_yyalloc(yy_size_t, yyscan_t yyscanner)
Definition: ast_expr2f.c:2356
static int yy_init_globals(yyscan_t yyscanner)
Definition: ast_expr2f.c:2269
int errno
void * yyscan_t
Definition: ael_structs.h:71
int ast_yylex_init_extra ( YY_EXTRA_TYPE  user_defined,
yyscan_t scanner 
)

Definition at line 2241 of file ast_expr2f.c.

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

2243 {
2244  struct yyguts_t dummy_yyguts;
2245 
2246  ast_yyset_extra (yy_user_defined, &dummy_yyguts);
2247 
2248  if (ptr_yy_globals == NULL){
2249  errno = EINVAL;
2250  return 1;
2251  }
2252 
2253  *ptr_yy_globals = (yyscan_t) ast_yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
2254 
2255  if (*ptr_yy_globals == NULL){
2256  errno = ENOMEM;
2257  return 1;
2258  }
2259 
2260  /* By setting to 0xAA, we expose bugs in
2261  yy_init_globals. Leave at 0x00 for releases. */
2262  memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
2263 
2264  ast_yyset_extra (yy_user_defined, *ptr_yy_globals);
2265 
2266  return yy_init_globals ( *ptr_yy_globals );
2267 }
void * ast_yyalloc(yy_size_t, yyscan_t yyscanner)
Definition: ast_expr2f.c:2356
static int yy_init_globals(yyscan_t yyscanner)
Definition: ast_expr2f.c:2269
void ast_yyset_extra(YY_EXTRA_TYPE user_defined, yyscan_t yyscanner)
Definition: ast_expr2f.c:2113
int errno
void * yyscan_t
Definition: ael_structs.h:71
int ast_yyparse ( void *  )

Referenced by ast_expr(), and ast_str_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
yyscannerThe scanner object.

Definition at line 1858 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().

1859 {
1860  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1861  if (!YY_CURRENT_BUFFER)
1862  return;
1863 
1865  YY_CURRENT_BUFFER_LVALUE = NULL;
1866  if (yyg->yy_buffer_stack_top > 0)
1867  --yyg->yy_buffer_stack_top;
1868 
1869  if (YY_CURRENT_BUFFER) {
1870  ast_yy_load_buffer_state(yyscanner );
1871  yyg->yy_did_buffer_switch_on_eof = 1;
1872  }
1873 }
struct yyguts_t * yyg
Definition: ast_expr2f.c:848
int yy_did_buffer_switch_on_eof
Definition: ast_expr2f.c:639
#define YY_CURRENT_BUFFER
Definition: ast_expr2f.c:273
static void ast_yy_load_buffer_state(yyscan_t yyscanner)
Definition: ast_expr2f.c:1701
#define YY_CURRENT_BUFFER_LVALUE
Definition: ast_expr2f.c:280
void ast_yy_delete_buffer(YY_BUFFER_STATE b, yyscan_t yyscanner)
Definition: ast_expr2f.c:1744
size_t yy_buffer_stack_top
Definition: ast_expr2f.c:630
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_bufferThe new state.
yyscannerThe scanner object.

Definition at line 1827 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.

1828 {
1829  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1830  if (new_buffer == NULL)
1831  return;
1832 
1833  ast_yyensure_buffer_stack(yyscanner);
1834 
1835  /* This block is copied from ast_yy_switch_to_buffer. */
1836  if ( YY_CURRENT_BUFFER )
1837  {
1838  /* Flush out information for old buffer. */
1839  *yyg->yy_c_buf_p = yyg->yy_hold_char;
1840  YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
1841  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
1842  }
1843 
1844  /* Only push if top exists. Otherwise, replace top. */
1845  if (YY_CURRENT_BUFFER)
1846  yyg->yy_buffer_stack_top++;
1847  YY_CURRENT_BUFFER_LVALUE = new_buffer;
1848 
1849  /* copied from ast_yy_switch_to_buffer. */
1850  ast_yy_load_buffer_state(yyscanner );
1851  yyg->yy_did_buffer_switch_on_eof = 1;
1852 }
char yy_hold_char
Definition: ast_expr2f.c:633
struct yyguts_t * yyg
Definition: ast_expr2f.c:848
char * yy_c_buf_p
Definition: ast_expr2f.c:636
int yy_did_buffer_switch_on_eof
Definition: ast_expr2f.c:639
int yy_n_chars
Definition: ast_expr2f.c:634
#define YY_CURRENT_BUFFER
Definition: ast_expr2f.c:273
static void ast_yy_load_buffer_state(yyscan_t yyscanner)
Definition: ast_expr2f.c:1701
#define YY_CURRENT_BUFFER_LVALUE
Definition: ast_expr2f.c:280
static void ast_yyensure_buffer_stack(yyscan_t yyscanner)
Definition: ast_expr2f.c:1878
size_t yy_buffer_stack_top
Definition: ast_expr2f.c:630
void * ast_yyrealloc ( void *  ptr,
yy_size_t  size,
yyscan_t  yyscanner 
)

Definition at line 2361 of file ast_expr2f.c.

References realloc.

Referenced by ast_yyensure_buffer_stack(), and yy_get_next_buffer().

2362 {
2363  /* The cast to (char *) in the following accommodates both
2364  * implementations that use char* generic pointers, and those
2365  * that use void* generic pointers. It works with the latter
2366  * because both ANSI C and C++ allow castless assignment from
2367  * any pointer type to void*, and deal with argument conversions
2368  * as though doing an assignment.
2369  */
2370  return (void *) realloc( (char *) ptr, size );
2371 }
#define realloc(a, b)
Definition: astmm.h:100
void ast_yyrestart ( FILE *  input_file,
yyscan_t  yyscanner 
)

Immediately switch to a different input stream.

Parameters
input_fileA readable stream.
yyscannerThe scanner object.
Note
This function does not reset the start condition to INITIAL .

Definition at line 1651 of file ast_expr2f.c.

References ast_yy_create_buffer(), ast_yy_init_buffer(), ast_yy_load_buffer_state(), ast_yyensure_buffer_stack(), YY_BUF_SIZE, YY_CURRENT_BUFFER, YY_CURRENT_BUFFER_LVALUE, and yyin.

Referenced by input(), and yy_get_next_buffer().

1652 {
1653  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1654 
1655  if ( ! YY_CURRENT_BUFFER ){
1656  ast_yyensure_buffer_stack (yyscanner);
1659  }
1660 
1661  ast_yy_init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner);
1662  ast_yy_load_buffer_state(yyscanner );
1663 }
#define yyin
Definition: ast_expr2f.c:131
struct yyguts_t * yyg
Definition: ast_expr2f.c:848
YY_BUFFER_STATE ast_yy_create_buffer(FILE *file, int size, yyscan_t yyscanner)
Definition: ast_expr2f.c:1716
#define YY_CURRENT_BUFFER
Definition: ast_expr2f.c:273
static void ast_yy_load_buffer_state(yyscan_t yyscanner)
Definition: ast_expr2f.c:1701
#define YY_CURRENT_BUFFER_LVALUE
Definition: ast_expr2f.c:280
static void ast_yyensure_buffer_stack(yyscan_t yyscanner)
Definition: ast_expr2f.c:1878
#define YY_BUF_SIZE
Definition: ast_expr2f.c:163
static void ast_yy_init_buffer(YY_BUFFER_STATE b, FILE *file, yyscan_t yyscanner)
Definition: ast_expr2f.c:1768
void ast_yyset_column ( int  column_no,
yyscan_t  yyscanner 
)

Set the current column.

Parameters
line_number
yyscannerThe scanner object.

Definition at line 2138 of file ast_expr2f.c.

References YY_CURRENT_BUFFER, yy_fatal_error(), and yycolumn.

2139 {
2140  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2141 
2142  /* column is only valid if an input buffer exists. */
2143  if (! YY_CURRENT_BUFFER )
2144  yy_fatal_error( "ast_yyset_column called with no buffer" , yyscanner);
2145 
2146  yycolumn = column_no;
2147 }
#define yycolumn
Definition: ast_expr2f.c:137
struct yyguts_t * yyg
Definition: ast_expr2f.c:848
static void yy_fatal_error(yyconst char msg[], yyscan_t yyscanner)
#define YY_CURRENT_BUFFER
Definition: ast_expr2f.c:273
void ast_yyset_debug ( int  debug_flag,
yyscan_t  yyscanner 
)

Definition at line 2173 of file ast_expr2f.c.

References yy_flex_debug.

2174 {
2175  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2176  yy_flex_debug = bdebug ;
2177 }
struct yyguts_t * yyg
Definition: ast_expr2f.c:848
#define yy_flex_debug
Definition: ast_expr2f.c:138
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_definedThe data to be associated with this scanner.
yyscannerThe scanner object.

Definition at line 2113 of file ast_expr2f.c.

References yyextra.

Referenced by ast_yylex_init_extra().

2114 {
2115  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2116  yyextra = user_defined ;
2117 }
#define yyextra
Definition: ast_expr2f.c:133
struct yyguts_t * yyg
Definition: ast_expr2f.c:848
void ast_yyset_in ( FILE *  in_str,
yyscan_t  yyscanner 
)

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

Parameters
in_strA readable stream.
yyscannerThe scanner object.
See Also
ast_yy_switch_to_buffer

Definition at line 2155 of file ast_expr2f.c.

References yyin.

2156 {
2157  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2158  yyin = in_str ;
2159 }
#define yyin
Definition: ast_expr2f.c:131
struct yyguts_t * yyg
Definition: ast_expr2f.c:848
void ast_yyset_lineno ( int  line_number,
yyscan_t  yyscanner 
)

Set the current line number.

Parameters
line_number
yyscannerThe scanner object.

Definition at line 2123 of file ast_expr2f.c.

References YY_CURRENT_BUFFER, yy_fatal_error(), and yylineno.

2124 {
2125  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2126 
2127  /* lineno is only valid if an input buffer exists. */
2128  if (! YY_CURRENT_BUFFER )
2129  yy_fatal_error( "ast_yyset_lineno called with no buffer" , yyscanner);
2130 
2131  yylineno = line_number;
2132 }
struct yyguts_t * yyg
Definition: ast_expr2f.c:848
static void yy_fatal_error(yyconst char msg[], yyscan_t yyscanner)
#define YY_CURRENT_BUFFER
Definition: ast_expr2f.c:273
#define yylineno
Definition: ast_expr2f.c:136
void ast_yyset_lloc ( YYLTYPE yylloc_param,
yyscan_t  yyscanner 
)

Definition at line 2199 of file ast_expr2f.c.

References yylloc.

2200 {
2201  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2202  yylloc = yylloc_param;
2203 }
struct yyguts_t * yyg
Definition: ast_expr2f.c:848
#define yylloc
Definition: ast_expr2.c:72
void ast_yyset_lval ( YYSTYPE yylval_param,
yyscan_t  yyscanner 
)

Definition at line 2187 of file ast_expr2f.c.

References yylval.

2188 {
2189  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2190  yylval = yylval_param;
2191 }
struct yyguts_t * yyg
Definition: ast_expr2f.c:848
#define yylval
Definition: ast_expr2.c:68
void ast_yyset_out ( FILE *  out_str,
yyscan_t  yyscanner 
)

Definition at line 2161 of file ast_expr2f.c.

References yyout.

2162 {
2163  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2164  yyout = out_str ;
2165 }
struct yyguts_t * yyg
Definition: ast_expr2f.c:848
#define yyout
Definition: ast_expr2f.c:132
static char * expr2_token_subst ( const char *  mess)
static

Definition at line 2534 of file ast_expr2f.c.

References expr2_token_equivs1, len(), and malloc.

Referenced by ast_yyerror().

2535 {
2536  /* calc a length, malloc, fill, and return; yyerror had better free it! */
2537  int len=0,i;
2538  const char *p;
2539  char *res, *s;
2540  const char *t;
2541  int expr2_token_equivs_entries = sizeof(expr2_token_equivs1)/sizeof(char*);
2542 
2543  for (p=mess; *p; p++) {
2544  for (i=0; i<expr2_token_equivs_entries; i++) {
2545  if ( strncmp(p,expr2_token_equivs1[i],strlen(expr2_token_equivs1[i])) == 0 )
2546  {
2547  len+=strlen(expr2_token_equivs2[i])+2;
2548  p += strlen(expr2_token_equivs1[i])-1;
2549  break;
2550  }
2551  }
2552  len++;
2553  }
2554  res = (char*)malloc(len+1);
2555  res[0] = 0;
2556  s = res;
2557  for (p=mess; *p;) {
2558  int found = 0;
2559  for (i=0; i<expr2_token_equivs_entries; i++) {
2560  if ( strncmp(p,expr2_token_equivs1[i],strlen(expr2_token_equivs1[i])) == 0 ) {
2561  *s++ = '\'';
2562  for (t=expr2_token_equivs2[i]; *t;) {
2563  *s++ = *t++;
2564  }
2565  *s++ = '\'';
2566  p += strlen(expr2_token_equivs1[i]);
2567  found = 1;
2568  break;
2569  }
2570  }
2571  if( !found )
2572  *s++ = *p++;
2573  }
2574  *s++ = 0;
2575  return res;
2576 }
#define malloc(a)
Definition: astmm.h:88
static const char *const expr2_token_equivs1[]
Definition: ast_expr2f.c:2481
static const char *const expr2_token_equivs2[]
Definition: ast_expr2f.c:2507
static int len(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t buflen)
if ( !yyg->  yy_init)

Definition at line 859 of file ast_expr2f.c.

References ast_yy_create_buffer(), ast_yy_load_buffer_state(), ast_yyensure_buffer_stack(), YY_BUF_SIZE, YY_CURRENT_BUFFER, YY_CURRENT_BUFFER_LVALUE, yyguts_t::yy_init, yyguts_t::yy_start, yyin, and yyout.

860  {
861  yyg->yy_init = 1;
862 
863 #ifdef YY_USER_INIT
864  YY_USER_INIT;
865 #endif
866 
867  if ( ! yyg->yy_start )
868  yyg->yy_start = 1; /* first start state */
869 
870  if ( ! yyin )
871  yyin = stdin;
872 
873  if ( ! yyout )
874  yyout = stdout;
875 
876  if ( ! YY_CURRENT_BUFFER ) {
877  ast_yyensure_buffer_stack (yyscanner);
880  }
881 
882  ast_yy_load_buffer_state(yyscanner );
883  }
#define yyin
Definition: ast_expr2f.c:131
struct yyguts_t * yyg
Definition: ast_expr2f.c:848
YY_BUFFER_STATE ast_yy_create_buffer(FILE *file, int size, yyscan_t yyscanner)
Definition: ast_expr2f.c:1716
int yy_init
Definition: ast_expr2f.c:637
int yy_start
Definition: ast_expr2f.c:638
#define YY_CURRENT_BUFFER
Definition: ast_expr2f.c:273
static void ast_yy_load_buffer_state(yyscan_t yyscanner)
Definition: ast_expr2f.c:1701
#define YY_CURRENT_BUFFER_LVALUE
Definition: ast_expr2f.c:280
static void ast_yyensure_buffer_stack(yyscan_t yyscanner)
Definition: ast_expr2f.c:1878
#define YY_BUF_SIZE
Definition: ast_expr2f.c:163
#define yyout
Definition: ast_expr2f.c:132
static int input ( yyscan_t  yyscanner)
static

Definition at line 1575 of file ast_expr2f.c.

References ast_yyrestart(), ast_yywrap, EOB_ACT_CONTINUE_SCAN, EOB_ACT_END_OF_FILE, EOB_ACT_LAST_MATCH, yyguts_t::yy_c_buf_p, YY_CURRENT_BUFFER_LVALUE, yyguts_t::yy_did_buffer_switch_on_eof, YY_END_OF_BUFFER_CHAR, yy_get_next_buffer(), yyguts_t::yy_hold_char, yyguts_t::yy_n_chars, YY_NEW_FILE, and yyin.

Referenced by eivr_comm(), get_calleridname(), and strip_control_and_high().

1578 {
1579  int c;
1580  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1581 
1582  *yyg->yy_c_buf_p = yyg->yy_hold_char;
1583 
1584  if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
1585  {
1586  /* yy_c_buf_p now points to the character we want to return.
1587  * If this occurs *before* the EOB characters, then it's a
1588  * valid NUL; if not, then we've hit the end of the buffer.
1589  */
1590  if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
1591  /* This was really a NUL. */
1592  *yyg->yy_c_buf_p = '\0';
1593 
1594  else
1595  { /* need more input */
1596  int offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
1597  ++yyg->yy_c_buf_p;
1598 
1599  switch ( yy_get_next_buffer( yyscanner ) )
1600  {
1601  case EOB_ACT_LAST_MATCH:
1602  /* This happens because yy_g_n_b()
1603  * sees that we've accumulated a
1604  * token and flags that we need to
1605  * try matching the token before
1606  * proceeding. But for input(),
1607  * there's no matching to consider.
1608  * So convert the EOB_ACT_LAST_MATCH
1609  * to EOB_ACT_END_OF_FILE.
1610  */
1611 
1612  /* Reset buffer status. */
1613  ast_yyrestart(yyin ,yyscanner);
1614 
1615  /*FALLTHROUGH*/
1616 
1617  case EOB_ACT_END_OF_FILE:
1618  {
1619  if ( ast_yywrap(yyscanner ) )
1620  return EOF;
1621 
1622  if ( ! yyg->yy_did_buffer_switch_on_eof )
1623  YY_NEW_FILE;
1624 #ifdef __cplusplus
1625  return yyinput(yyscanner);
1626 #else
1627  return input(yyscanner);
1628 #endif
1629  }
1630 
1631  case EOB_ACT_CONTINUE_SCAN:
1632  yyg->yy_c_buf_p = yyg->yytext_ptr + offset;
1633  break;
1634  }
1635  }
1636  }
1637 
1638  c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */
1639  *yyg->yy_c_buf_p = '\0'; /* preserve yytext */
1640  yyg->yy_hold_char = *++yyg->yy_c_buf_p;
1641 
1642  return c;
1643 }
char yy_hold_char
Definition: ast_expr2f.c:633
#define yyin
Definition: ast_expr2f.c:131
struct yyguts_t * yyg
Definition: ast_expr2f.c:848
char * yy_c_buf_p
Definition: ast_expr2f.c:636
#define YY_NEW_FILE
Definition: ast_expr2f.c:157
#define EOB_ACT_END_OF_FILE
Definition: ast_expr2f.c:176
static int input(yyscan_t yyscanner)
Definition: ast_expr2f.c:1575
#define EOB_ACT_CONTINUE_SCAN
Definition: ast_expr2f.c:175
#define YY_END_OF_BUFFER_CHAR
Definition: ast_expr2f.c:159
int yy_did_buffer_switch_on_eof
Definition: ast_expr2f.c:639
void ast_yyrestart(FILE *input_file, yyscan_t yyscanner)
Definition: ast_expr2f.c:1651
int yy_n_chars
Definition: ast_expr2f.c:634
static int yy_get_next_buffer(yyscan_t yyscanner)
Definition: ast_expr2f.c:1341
#define YY_CURRENT_BUFFER_LVALUE
Definition: ast_expr2f.c:280
#define ast_yywrap(n)
Definition: ast_expr2f.c:330
#define EOB_ACT_LAST_MATCH
Definition: ast_expr2f.c:177
while ( )

Definition at line 885 of file ast_expr2f.c.

References ast_yywrap, BEGIN, ECHO, EOB_ACT_CONTINUE_SCAN, EOB_ACT_END_OF_FILE, EOB_ACT_LAST_MATCH, INITIAL, SET_COLUMNS, SET_NUMERIC_STRING, SET_STRING, TOK_AND, TOK_COLON, TOK_COLONCOLON, TOK_COMMA, TOK_COMPL, TOK_COND, TOK_DIV, TOK_EQ, TOK_EQTILDE, TOK_GE, TOK_GT, TOK_LE, TOK_LP, TOK_LT, TOK_MINUS, TOK_MOD, TOK_MULT, TOK_NE, TOK_OR, TOK_PLUS, TOK_RP, TOK_TILDETILDE, TOKEN, trail, unput, var, yy_accept, yy_base, YY_BREAK, YY_BUFFER_NEW, YY_BUFFER_NORMAL, yyguts_t::yy_c_buf_p, yy_chk, yy_cp, YY_CURRENT_BUFFER_LVALUE, yy_def, yyguts_t::yy_did_buffer_switch_on_eof, YY_DO_BEFORE_ACTION, yy_ec, YY_END_OF_BUFFER, YY_FATAL_ERROR, yy_get_next_buffer(), yy_get_previous_state(), yyguts_t::yy_hold_char, yyguts_t::yy_last_accepting_cpos, yyguts_t::yy_last_accepting_state, yy_meta, YY_MORE_ADJ, yyguts_t::yy_more_flag, yyguts_t::yy_more_len, yyguts_t::yy_n_chars, YY_NEW_FILE, yy_nxt, YY_RESTORE_YY_MORE_OFFSET, YY_RULE_SETUP, YY_SC_TO_UI, YY_START, yyguts_t::yy_start, YY_STATE_EOF, yy_try_NUL_trans(), yyin, yyleng, yymore, yyterminate, and yytext.

886  {
887  yyg->yy_more_len = 0;
888  if ( yyg->yy_more_flag )
889  {
890  yyg->yy_more_len = yyg->yy_c_buf_p - yyg->yytext_ptr;
891  yyg->yy_more_flag = 0;
892  }
893  yy_cp = yyg->yy_c_buf_p;
894 
895  /* Support of yytext. */
896  *yy_cp = yyg->yy_hold_char;
897 
898  /* yy_bp points to the position in yy_ch_buf of the start of
899  * the current run.
900  */
901  yy_bp = yy_cp;
902 
903  yy_current_state = yyg->yy_start;
904 yy_match:
905  do
906  {
907  register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
908  if ( yy_accept[yy_current_state] )
909  {
910  yyg->yy_last_accepting_state = yy_current_state;
912  }
913  while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
914  {
915  yy_current_state = (int) yy_def[yy_current_state];
916  if ( yy_current_state >= 63 )
917  yy_c = yy_meta[(unsigned int) yy_c];
918  }
919  yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
920  ++yy_cp;
921  }
922  while ( yy_current_state != 62 );
924  yy_current_state = yyg->yy_last_accepting_state;
925 
926 yy_find_action:
927  yy_act = yy_accept[yy_current_state];
928 
930 
931 do_action: /* This label is used only to access EOF actions. */
932 
933  switch ( yy_act )
934  { /* beginning of action switch */
935  case 0: /* must back up */
936  /* undo the effects of YY_DO_BEFORE_ACTION */
937  *yy_cp = yyg->yy_hold_char;
939  yy_current_state = yyg->yy_last_accepting_state;
940  goto yy_find_action;
941 
942 case 1:
944 #line 132 "ast_expr2.fl"
945 { SET_COLUMNS; SET_STRING; return TOK_OR;}
946  YY_BREAK
947 case 2:
949 #line 133 "ast_expr2.fl"
950 { SET_COLUMNS; SET_STRING; return TOK_AND;}
951  YY_BREAK
952 case 3:
954 #line 134 "ast_expr2.fl"
955 { SET_COLUMNS; SET_STRING; return TOK_EQ;}
956  YY_BREAK
957 case 4:
959 #line 135 "ast_expr2.fl"
960 { SET_COLUMNS; SET_STRING; return TOK_OR;}
961  YY_BREAK
962 case 5:
964 #line 136 "ast_expr2.fl"
965 { SET_COLUMNS; SET_STRING; return TOK_AND;}
966  YY_BREAK
967 case 6:
969 #line 137 "ast_expr2.fl"
970 { SET_COLUMNS; SET_STRING; return TOK_EQ;}
971  YY_BREAK
972 case 7:
974 #line 138 "ast_expr2.fl"
976  YY_BREAK
977 case 8:
979 #line 139 "ast_expr2.fl"
981  YY_BREAK
982 case 9:
984 #line 140 "ast_expr2.fl"
985 { SET_COLUMNS; SET_STRING; return TOK_GT;}
986  YY_BREAK
987 case 10:
989 #line 141 "ast_expr2.fl"
990 { SET_COLUMNS; SET_STRING; return TOK_LT;}
991  YY_BREAK
992 case 11:
994 #line 142 "ast_expr2.fl"
995 { SET_COLUMNS; SET_STRING; return TOK_GE;}
996  YY_BREAK
997 case 12:
999 #line 143 "ast_expr2.fl"
1000 { SET_COLUMNS; SET_STRING; return TOK_LE;}
1001  YY_BREAK
1002 case 13:
1004 #line 144 "ast_expr2.fl"
1005 { SET_COLUMNS; SET_STRING; return TOK_NE;}
1006  YY_BREAK
1007 case 14:
1009 #line 145 "ast_expr2.fl"
1010 { SET_COLUMNS; SET_STRING; return TOK_PLUS;}
1011  YY_BREAK
1012 case 15:
1014 #line 146 "ast_expr2.fl"
1015 { SET_COLUMNS; SET_STRING; return TOK_COMMA;}
1016  YY_BREAK
1017 case 16:
1019 #line 147 "ast_expr2.fl"
1020 { SET_COLUMNS; SET_STRING; return TOK_MINUS;}
1021  YY_BREAK
1022 case 17:
1024 #line 148 "ast_expr2.fl"
1025 { SET_COLUMNS; SET_STRING; return TOK_MULT;}
1026  YY_BREAK
1027 case 18:
1029 #line 149 "ast_expr2.fl"
1030 { SET_COLUMNS; SET_STRING; return TOK_DIV;}
1031  YY_BREAK
1032 case 19:
1034 #line 150 "ast_expr2.fl"
1035 { SET_COLUMNS; SET_STRING; return TOK_MOD;}
1036  YY_BREAK
1037 case 20:
1039 #line 151 "ast_expr2.fl"
1040 { SET_COLUMNS; SET_STRING; return TOK_COND;}
1041  YY_BREAK
1042 case 21:
1044 #line 152 "ast_expr2.fl"
1045 { SET_COLUMNS; SET_STRING; return TOK_COMPL;}
1046  YY_BREAK
1047 case 22:
1049 #line 153 "ast_expr2.fl"
1050 { SET_COLUMNS; SET_STRING; return TOK_COLON;}
1051  YY_BREAK
1052 case 23:
1054 #line 154 "ast_expr2.fl"
1056  YY_BREAK
1057 case 24:
1059 #line 155 "ast_expr2.fl"
1060 { SET_COLUMNS; SET_STRING; return TOK_LP;}
1061  YY_BREAK
1062 case 25:
1064 #line 156 "ast_expr2.fl"
1065 { SET_COLUMNS; SET_STRING; return TOK_RP;}
1066  YY_BREAK
1067 case 26:
1069 #line 157 "ast_expr2.fl"
1070 {
1071  /* gather the contents of ${} expressions, with trailing stuff,
1072  * into a single TOKEN.
1073  * They are much more complex now than they used to be
1074  */
1075  curlycount = 0;
1076  BEGIN(var);
1077  yymore();
1078  }
1079  YY_BREAK
1080 case 27:
1082 #line 167 "ast_expr2.fl"
1083 {}
1084  YY_BREAK
1085 case 28:
1086 /* rule 28 can match eol */
1088 #line 168 "ast_expr2.fl"
1089 {SET_COLUMNS; SET_STRING; return TOKEN;}
1090  YY_BREAK
1091 case 29:
1092 /* rule 29 can match eol */
1094 #line 170 "ast_expr2.fl"
1095 {/* what to do with eol */}
1096  YY_BREAK
1097 case 30:
1099 #line 171 "ast_expr2.fl"
1100 {
1101  SET_COLUMNS;
1102  /* the original behavior of the expression parser was
1103  * to bring in numbers as a numeric string
1104  */
1106  return TOKEN;
1107  }
1108  YY_BREAK
1109 case 31:
1110 /* rule 31 can match eol */
1112 #line 180 "ast_expr2.fl"
1113 {
1114  SET_COLUMNS;
1115  SET_STRING;
1116  return TOKEN;
1117  }
1118  YY_BREAK
1119 case 32:
1120 /* rule 32 can match eol */
1122 #line 186 "ast_expr2.fl"
1123 {
1124  curlycount = 0;
1125  BEGIN(var);
1126  yymore();
1127  }
1128  YY_BREAK
1129 case 33:
1130 /* rule 33 can match eol */
1132 #line 192 "ast_expr2.fl"
1133 {
1134  curlycount--;
1135  if (curlycount < 0) {
1136  BEGIN(trail);
1137  yymore();
1138  } else {
1139  yymore();
1140  }
1141  }
1142  YY_BREAK
1143 case 34:
1144 /* rule 34 can match eol */
1146 #line 202 "ast_expr2.fl"
1147 {
1148  curlycount++;
1149  yymore();
1150  }
1151  YY_BREAK
1152 case 35:
1154 #line 208 "ast_expr2.fl"
1155 {
1156  BEGIN(0);
1157  SET_COLUMNS;
1158  SET_STRING;
1159  return TOKEN;
1160  }
1161  YY_BREAK
1162 case 36:
1164 #line 215 "ast_expr2.fl"
1165 {
1166  curlycount = 0;
1167  BEGIN(var);
1168  yymore();
1169  }
1170  YY_BREAK
1171 case 37:
1172 /* rule 37 can match eol */
1174 #line 221 "ast_expr2.fl"
1175 {
1176  char c = yytext[yyleng-1];
1177  BEGIN(0);
1178  unput(c);
1179  SET_COLUMNS;
1180  SET_STRING;
1181  return TOKEN;
1182  }
1183  YY_BREAK
1184 case YY_STATE_EOF(trail):
1185 #line 230 "ast_expr2.fl"
1186 {
1187  BEGIN(0);
1188  SET_COLUMNS;
1189  SET_STRING;
1190  return TOKEN;
1191  /*actually, if an expr is only a variable ref, this could happen a LOT */
1192  }
1193  YY_BREAK
1194 case 38:
1196 #line 238 "ast_expr2.fl"
1197 ECHO;
1198  YY_BREAK
1199 #line 1198 "ast_expr2f.c"
1200 case YY_STATE_EOF(INITIAL):
1201 case YY_STATE_EOF(var):
1202  yyterminate();
1203 
1204  case YY_END_OF_BUFFER:
1205  {
1206  /* Amount of text matched not including the EOB char. */
1207  int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1;
1208 
1209  /* Undo the effects of YY_DO_BEFORE_ACTION. */
1210  *yy_cp = yyg->yy_hold_char;
1212 
1213  if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1214  {
1215  /* We're scanning a new file or input source. It's
1216  * possible that this happened because the user
1217  * just pointed yyin at a new source and called
1218  * ast_yylex(). If so, then we have to assure
1219  * consistency between YY_CURRENT_BUFFER and our
1220  * globals. Here is the right place to do so, because
1221  * this is the first action (other than possibly a
1222  * back-up) that will match for the new input source.
1223  */
1224  yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1225  YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
1226  YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1227  }
1228 
1229  /* Note that here we test for yy_c_buf_p "<=" to the position
1230  * of the first EOB in the buffer, since yy_c_buf_p will
1231  * already have been incremented past the NUL character
1232  * (since all states make transitions on EOB to the
1233  * end-of-buffer state). Contrast this with the test
1234  * in input().
1235  */
1236  if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
1237  { /* This was really a NUL. */
1238  yy_state_type yy_next_state;
1239 
1240  yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text;
1241 
1242  yy_current_state = yy_get_previous_state( yyscanner );
1243 
1244  /* Okay, we're now positioned to make the NUL
1245  * transition. We couldn't have
1246  * yy_get_previous_state() go ahead and do it
1247  * for us because it doesn't know how to deal
1248  * with the possibility of jamming (and we don't
1249  * want to build jamming into it because then it
1250  * will run more slowly).
1251  */
1252 
1253  yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner);
1254 
1255  yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1256 
1257  if ( yy_next_state )
1258  {
1259  /* Consume the NUL. */
1260  yy_cp = ++yyg->yy_c_buf_p;
1261  yy_current_state = yy_next_state;
1262  goto yy_match;
1263  }
1264 
1265  else
1266  {
1268  yy_current_state = yyg->yy_last_accepting_state;
1269  goto yy_find_action;
1270  }
1271  }
1272 
1273  else switch ( yy_get_next_buffer( yyscanner ) )
1274  {
1275  case EOB_ACT_END_OF_FILE:
1276  {
1278 
1279  if ( ast_yywrap(yyscanner ) )
1280  {
1281  /* Note: because we've taken care in
1282  * yy_get_next_buffer() to have set up
1283  * yytext, we can now set up
1284  * yy_c_buf_p so that if some total
1285  * hoser (like flex itself) wants to
1286  * call the scanner after we return the
1287  * YY_NULL, it'll still work - another
1288  * YY_NULL will get returned.
1289  */
1290  yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ;
1291 
1293  goto do_action;
1294  }
1295 
1296  else
1297  {
1299  YY_NEW_FILE;
1300  }
1301  break;
1302  }
1303 
1304  case EOB_ACT_CONTINUE_SCAN:
1305  yyg->yy_c_buf_p =
1306  yyg->yytext_ptr + yy_amount_of_matched_text;
1307 
1308  yy_current_state = yy_get_previous_state( yyscanner );
1309 
1310  yy_cp = yyg->yy_c_buf_p;
1311  yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1312  goto yy_match;
1313 
1314  case EOB_ACT_LAST_MATCH:
1315  yyg->yy_c_buf_p =
1316  &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars];
1317 
1318  yy_current_state = yy_get_previous_state( yyscanner );
1319 
1320  yy_cp = yyg->yy_c_buf_p;
1321  yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1322  goto yy_find_action;
1323  }
1324  break;
1325  }
1326 
1327  default:
1329  "fatal flex scanner internal error--no action found" );
1330  } /* end of action switch */
1331  } /* end of scanning one token */
#define YY_FATAL_ERROR(msg)
Definition: ast_expr2f.c:808
#define YY_START
Definition: ast_expr2f.c:150
char yy_hold_char
Definition: ast_expr2f.c:633
#define yyin
Definition: ast_expr2f.c:131
#define yytext
Definition: ast_expr2f.c:135
struct yyguts_t * yyg
Definition: ast_expr2f.c:848
#define YY_END_OF_BUFFER
Definition: ast_expr2f.c:356
char * yy_c_buf_p
Definition: ast_expr2f.c:636
#define YY_DO_BEFORE_ACTION
Definition: ast_expr2f.c:347
static int curlycount
Definition: ast_expr2f.c:600
#define YY_NEW_FILE
Definition: ast_expr2f.c:157
#define var
Definition: ast_expr2f.c:606
static yy_state_type yy_try_NUL_trans(yy_state_type current_state, yyscan_t yyscanner)
Definition: ast_expr2f.c:1509
#define BEGIN
Definition: ast_expr2f.c:144
#define YY_STATE_EOF(state)
Definition: ast_expr2f.c:154
#define EOB_ACT_END_OF_FILE
Definition: ast_expr2f.c:176
#define EOB_ACT_CONTINUE_SCAN
Definition: ast_expr2f.c:175
#define YY_BREAK
Definition: ast_expr2f.c:835
#define YY_RESTORE_YY_MORE_OFFSET
Definition: ast_expr2f.c:484
#define yyleng
Definition: ast_expr2f.c:134
int yy_start
Definition: ast_expr2f.c:638
#define SET_STRING
Definition: ast_expr2f.c:578
#define INITIAL
Definition: ast_expr2f.c:605
int yy_did_buffer_switch_on_eof
Definition: ast_expr2f.c:639
#define unput(c)
Definition: ast_expr2f.c:195
int yy_state_type
Definition: ast_expr2f.c:335
#define yymore()
Definition: ast_expr2f.c:482
int yy_more_flag
Definition: ast_expr2f.c:650
register char * yy_cp
Definition: ast_expr2f.c:846
#define YY_SC_TO_UI(c)
Definition: ast_expr2f.c:121
register char * yy_bp
Definition: ast_expr2f.c:846
static yyconst flex_int16_t yy_chk[159]
Definition: ast_expr2f.c:457
static yyconst flex_int16_t yy_base[70]
Definition: ast_expr2f.c:414
int yy_n_chars
Definition: ast_expr2f.c:634
char * yy_last_accepting_cpos
Definition: ast_expr2f.c:644
#define YY_BUFFER_NORMAL
Definition: ast_expr2f.c:251
#define YY_BUFFER_NEW
Definition: ast_expr2f.c:250
static yy_state_type yy_get_previous_state(yyscan_t yyscanner)
Definition: ast_expr2f.c:1476
#define trail
Definition: ast_expr2f.c:607
unsigned char YY_CHAR
Definition: ast_expr2f.c:333
static int yy_get_next_buffer(yyscan_t yyscanner)
Definition: ast_expr2f.c:1341
#define YY_CURRENT_BUFFER_LVALUE
Definition: ast_expr2f.c:280
#define ast_yywrap(n)
Definition: ast_expr2f.c:330
#define SET_NUMERIC_STRING
Definition: ast_expr2f.c:584
static yyconst flex_int32_t yy_meta[29]
Definition: ast_expr2f.c:407
#define YY_RULE_SETUP
Definition: ast_expr2f.c:838
static yyconst flex_int16_t yy_nxt[159]
Definition: ast_expr2f.c:436
int yy_more_len
Definition: ast_expr2f.c:651
#define yyterminate()
Definition: ast_expr2f.c:798
#define SET_COLUMNS
Definition: ast_expr2f.c:572
register int yy_act
Definition: ast_expr2f.c:847
yy_state_type yy_last_accepting_state
Definition: ast_expr2f.c:643
#define ECHO
Definition: ast_expr2f.c:555
#define YY_MORE_ADJ
Definition: ast_expr2f.c:483
static yyconst flex_int32_t yy_ec[256]
Definition: ast_expr2f.c:375
static yyconst flex_int16_t yy_accept[63]
Definition: ast_expr2f.c:364
static yyconst flex_int16_t yy_def[70]
Definition: ast_expr2f.c:425
#define EOB_ACT_LAST_MATCH
Definition: ast_expr2f.c:177
static void yy_fatal_error ( yyconst char  msg[],
yyscan_t  yyscanner 
)
static
static void yy_fatal_error ( yyconst char *  msg,
yyscan_t  yyscanner 
)
static

Definition at line 2012 of file ast_expr2f.c.

References YY_EXIT_FAILURE.

2013 {
2014  (void) fprintf( stderr, "%s\n", msg );
2015  exit( YY_EXIT_FAILURE );
2016 }
#define YY_EXIT_FAILURE
Definition: ast_expr2f.c:2009
static int yy_get_next_buffer ( yyscan_t  yyscanner)
static

Definition at line 1341 of file ast_expr2f.c.

References ast_yyrealloc(), ast_yyrestart(), EOB_ACT_CONTINUE_SCAN, EOB_ACT_END_OF_FILE, EOB_ACT_LAST_MATCH, yy_buffer_state::yy_buf_size, YY_BUFFER_EOF_PENDING, yyguts_t::yy_c_buf_p, yy_buffer_state::yy_ch_buf, YY_CURRENT_BUFFER, YY_CURRENT_BUFFER_LVALUE, YY_END_OF_BUFFER_CHAR, YY_FATAL_ERROR, YY_INPUT, yy_buffer_state::yy_is_our_buffer, YY_MORE_ADJ, yyguts_t::yy_n_chars, YY_READ_BUF_SIZE, and yyin.

Referenced by input(), and while().

1342 {
1343  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1344  register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1345  register char *source = yyg->yytext_ptr;
1346  register int number_to_move, i;
1347  int ret_val;
1348 
1349  if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] )
1351  "fatal flex scanner internal error--end of buffer missed" );
1352 
1353  if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1354  { /* Don't try to fill the buffer, so this is an EOF. */
1355  if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 )
1356  {
1357  /* We matched a single character, the EOB, so
1358  * treat this as a final EOF.
1359  */
1360  return EOB_ACT_END_OF_FILE;
1361  }
1362 
1363  else
1364  {
1365  /* We matched some text prior to the EOB, first
1366  * process it.
1367  */
1368  return EOB_ACT_LAST_MATCH;
1369  }
1370  }
1371 
1372  /* Try to read more data. */
1373 
1374  /* First move last chars to start of buffer. */
1375  number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1;
1376 
1377  for ( i = 0; i < number_to_move; ++i )
1378  *(dest++) = *(source++);
1379 
1380  if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1381  /* don't do the read, it's not guaranteed to return an EOF,
1382  * just force an EOF
1383  */
1384  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0;
1385 
1386  else
1387  {
1388  int num_to_read =
1389  YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1390 
1391  while ( num_to_read <= 0 )
1392  { /* Not enough room in the buffer - grow it. */
1393 
1394  /* just a shorter name for the current buffer */
1396 
1397  int yy_c_buf_p_offset =
1398  (int) (yyg->yy_c_buf_p - b->yy_ch_buf);
1399 
1400  if ( b->yy_is_our_buffer )
1401  {
1402  int new_size = b->yy_buf_size * 2;
1403 
1404  if ( new_size <= 0 )
1405  b->yy_buf_size += b->yy_buf_size / 8;
1406  else
1407  b->yy_buf_size *= 2;
1408 
1409  b->yy_ch_buf = (char *)
1410  /* Include room in for 2 EOB chars. */
1411  ast_yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ,yyscanner );
1412  }
1413  else
1414  /* Can't grow it, we don't own it. */
1415  b->yy_ch_buf = 0;
1416 
1417  if ( ! b->yy_ch_buf )
1419  "fatal error - scanner input buffer overflow" );
1420 
1421  yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1422 
1423  num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1424  number_to_move - 1;
1425 
1426  }
1427 
1428  if ( num_to_read > YY_READ_BUF_SIZE )
1429  num_to_read = YY_READ_BUF_SIZE;
1430 
1431  /* Read in more data. */
1432  YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1433  yyg->yy_n_chars, (size_t) num_to_read );
1434 
1435  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
1436  }
1437 
1438  if ( yyg->yy_n_chars == 0 )
1439  {
1440  if ( number_to_move == YY_MORE_ADJ )
1441  {
1442  ret_val = EOB_ACT_END_OF_FILE;
1443  ast_yyrestart(yyin ,yyscanner);
1444  }
1445 
1446  else
1447  {
1448  ret_val = EOB_ACT_LAST_MATCH;
1449  YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1451  }
1452  }
1453 
1454  else
1455  ret_val = EOB_ACT_CONTINUE_SCAN;
1456 
1457  if ((yy_size_t) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1458  /* Extend the array by 50%, plus the number we really need. */
1459  yy_size_t new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
1460  YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) ast_yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner );
1461  if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1462  YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1463  }
1464 
1465  yyg->yy_n_chars += number_to_move;
1468 
1469  yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1470 
1471  return ret_val;
1472 }
#define YY_FATAL_ERROR(msg)
Definition: ast_expr2f.c:808
#define yyin
Definition: ast_expr2f.c:131
struct yyguts_t * yyg
Definition: ast_expr2f.c:848
#define YY_READ_BUF_SIZE
Definition: ast_expr2f.c:746
char * yy_c_buf_p
Definition: ast_expr2f.c:636
char * yy_ch_buf
Definition: ast_expr2f.c:208
#define EOB_ACT_END_OF_FILE
Definition: ast_expr2f.c:176
yy_size_t yy_buf_size
Definition: ast_expr2f.c:214
#define EOB_ACT_CONTINUE_SCAN
Definition: ast_expr2f.c:175
void * ast_yyrealloc(void *, yy_size_t, yyscan_t yyscanner)
Definition: ast_expr2f.c:2361
#define YY_END_OF_BUFFER_CHAR
Definition: ast_expr2f.c:159
#define YY_BUFFER_EOF_PENDING
Definition: ast_expr2f.c:262
void ast_yyrestart(FILE *input_file, yyscan_t yyscanner)
Definition: ast_expr2f.c:1651
int yy_n_chars
Definition: ast_expr2f.c:634
#define YY_CURRENT_BUFFER
Definition: ast_expr2f.c:273
#define YY_CURRENT_BUFFER_LVALUE
Definition: ast_expr2f.c:280
#define YY_INPUT(buf, result, max_size)
Definition: ast_expr2f.c:761
size_t yy_size_t
Definition: ast_expr2f.c:199
#define YY_MORE_ADJ
Definition: ast_expr2f.c:483
#define EOB_ACT_LAST_MATCH
Definition: ast_expr2f.c:177
static yy_state_type yy_get_previous_state ( yyscan_t  yyscanner)
static

Definition at line 1476 of file ast_expr2f.c.

References yy_accept, yy_base, yyguts_t::yy_c_buf_p, yy_chk, yy_cp, yy_def, yy_ec, yyguts_t::yy_last_accepting_cpos, yyguts_t::yy_last_accepting_state, yy_meta, YY_MORE_ADJ, yy_nxt, YY_SC_TO_UI, and yyguts_t::yy_start.

Referenced by while().

1477 {
1478  register yy_state_type yy_current_state;
1479  register char *yy_cp;
1480  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1481 
1482  yy_current_state = yyg->yy_start;
1483 
1484  for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp )
1485  {
1486  register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1487  if ( yy_accept[yy_current_state] )
1488  {
1489  yyg->yy_last_accepting_state = yy_current_state;
1491  }
1492  while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1493  {
1494  yy_current_state = (int) yy_def[yy_current_state];
1495  if ( yy_current_state >= 63 )
1496  yy_c = yy_meta[(unsigned int) yy_c];
1497  }
1498  yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1499  }
1500 
1501  return yy_current_state;
1502 }
struct yyguts_t * yyg
Definition: ast_expr2f.c:848
char * yy_c_buf_p
Definition: ast_expr2f.c:636
int yy_start
Definition: ast_expr2f.c:638
int yy_state_type
Definition: ast_expr2f.c:335
register char * yy_cp
Definition: ast_expr2f.c:846
#define YY_SC_TO_UI(c)
Definition: ast_expr2f.c:121
static yyconst flex_int16_t yy_chk[159]
Definition: ast_expr2f.c:457
static yyconst flex_int16_t yy_base[70]
Definition: ast_expr2f.c:414
char * yy_last_accepting_cpos
Definition: ast_expr2f.c:644
unsigned char YY_CHAR
Definition: ast_expr2f.c:333
static yyconst flex_int32_t yy_meta[29]
Definition: ast_expr2f.c:407
static yyconst flex_int16_t yy_nxt[159]
Definition: ast_expr2f.c:436
yy_state_type yy_last_accepting_state
Definition: ast_expr2f.c:643
#define YY_MORE_ADJ
Definition: ast_expr2f.c:483
static yyconst flex_int32_t yy_ec[256]
Definition: ast_expr2f.c:375
static yyconst flex_int16_t yy_accept[63]
Definition: ast_expr2f.c:364
static yyconst flex_int16_t yy_def[70]
Definition: ast_expr2f.c:425
static int yy_init_globals ( yyscan_t  yyscanner)
static

Definition at line 2269 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().

2270 {
2271  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2272  /* Initialization is the same as for the non-reentrant scanner.
2273  * This function is called from ast_yylex_destroy(), so don't allocate here.
2274  */
2275 
2276  yyg->yy_buffer_stack = 0;
2277  yyg->yy_buffer_stack_top = 0;
2278  yyg->yy_buffer_stack_max = 0;
2279  yyg->yy_c_buf_p = (char *) 0;
2280  yyg->yy_init = 0;
2281  yyg->yy_start = 0;
2282 
2283  yyg->yy_start_stack_ptr = 0;
2284  yyg->yy_start_stack_depth = 0;
2285  yyg->yy_start_stack = NULL;
2286 
2287 /* Defined in main.c */
2288 #ifdef YY_STDINIT
2289  yyin = stdin;
2290  yyout = stdout;
2291 #else
2292  yyin = (FILE *) 0;
2293  yyout = (FILE *) 0;
2294 #endif
2295 
2296  /* For future reference: Set errno on error, since we are called by
2297  * ast_yylex_init()
2298  */
2299  return 0;
2300 }
#define yyin
Definition: ast_expr2f.c:131
struct yyguts_t * yyg
Definition: ast_expr2f.c:848
char * yy_c_buf_p
Definition: ast_expr2f.c:636
YY_BUFFER_STATE * yy_buffer_stack
Definition: ast_expr2f.c:632
int yy_start_stack_depth
Definition: ast_expr2f.c:641
int yy_init
Definition: ast_expr2f.c:637
int * yy_start_stack
Definition: ast_expr2f.c:642
int yy_start
Definition: ast_expr2f.c:638
int yy_start_stack_ptr
Definition: ast_expr2f.c:640
size_t yy_buffer_stack_max
Definition: ast_expr2f.c:631
#define yyout
Definition: ast_expr2f.c:132
size_t yy_buffer_stack_top
Definition: ast_expr2f.c:630
static yy_state_type yy_try_NUL_trans ( yy_state_type  current_state,
yyscan_t  yyscanner 
)
static

Definition at line 1509 of file ast_expr2f.c.

References yy_accept, yy_base, yyguts_t::yy_c_buf_p, yy_chk, yy_cp, yy_def, yyguts_t::yy_last_accepting_cpos, yyguts_t::yy_last_accepting_state, yy_meta, and yy_nxt.

Referenced by while().

1510 {
1511  register int yy_is_jam;
1512  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */
1513  register char *yy_cp = yyg->yy_c_buf_p;
1514 
1515  register YY_CHAR yy_c = 1;
1516  if ( yy_accept[yy_current_state] )
1517  {
1518  yyg->yy_last_accepting_state = yy_current_state;
1520  }
1521  while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1522  {
1523  yy_current_state = (int) yy_def[yy_current_state];
1524  if ( yy_current_state >= 63 )
1525  yy_c = yy_meta[(unsigned int) yy_c];
1526  }
1527  yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1528  yy_is_jam = (yy_current_state == 62);
1529 
1530  return yy_is_jam ? 0 : yy_current_state;
1531 }
struct yyguts_t * yyg
Definition: ast_expr2f.c:848
char * yy_c_buf_p
Definition: ast_expr2f.c:636
register char * yy_cp
Definition: ast_expr2f.c:846
static yyconst flex_int16_t yy_chk[159]
Definition: ast_expr2f.c:457
static yyconst flex_int16_t yy_base[70]
Definition: ast_expr2f.c:414
char * yy_last_accepting_cpos
Definition: ast_expr2f.c:644
unsigned char YY_CHAR
Definition: ast_expr2f.c:333
static yyconst flex_int32_t yy_meta[29]
Definition: ast_expr2f.c:407
static yyconst flex_int16_t yy_nxt[159]
Definition: ast_expr2f.c:436
yy_state_type yy_last_accepting_state
Definition: ast_expr2f.c:643
static yyconst flex_int16_t yy_accept[63]
Definition: ast_expr2f.c:364
static yyconst flex_int16_t yy_def[70]
Definition: ast_expr2f.c:425
static void yyunput ( int  c,
char *  buf_ptr,
yyscan_t  yyscanner 
)
static
static void yyunput ( int  c,
register char *  yy_bp,
yyscan_t  yyscanner 
)
static

Definition at line 1533 of file ast_expr2f.c.

References yy_bp, yyguts_t::yy_c_buf_p, yy_cp, YY_CURRENT_BUFFER_LVALUE, YY_FATAL_ERROR, yyguts_t::yy_hold_char, and yyguts_t::yy_n_chars.

1534 {
1535  register char *yy_cp;
1536  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1537 
1538  yy_cp = yyg->yy_c_buf_p;
1539 
1540  /* undo effects of setting up yytext */
1541  *yy_cp = yyg->yy_hold_char;
1542 
1543  if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1544  { /* need to shift things up to make room */
1545  /* +2 for EOB chars. */
1546  register int number_to_move = yyg->yy_n_chars + 2;
1547  register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
1548  YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
1549  register char *source =
1550  &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
1551 
1552  while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1553  *--dest = *--source;
1554 
1555  yy_cp += (int) (dest - source);
1556  yy_bp += (int) (dest - source);
1557  YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
1558  yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
1559 
1560  if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1561  YY_FATAL_ERROR( "flex scanner push-back overflow" );
1562  }
1563 
1564  *--yy_cp = (char) c;
1565 
1566  yyg->yytext_ptr = yy_bp;
1567  yyg->yy_hold_char = *yy_cp;
1568  yyg->yy_c_buf_p = yy_cp;
1569 }
#define YY_FATAL_ERROR(msg)
Definition: ast_expr2f.c:808
char yy_hold_char
Definition: ast_expr2f.c:633
struct yyguts_t * yyg
Definition: ast_expr2f.c:848
char * yy_c_buf_p
Definition: ast_expr2f.c:636
register char * yy_cp
Definition: ast_expr2f.c:846
register char * yy_bp
Definition: ast_expr2f.c:846
int yy_n_chars
Definition: ast_expr2f.c:634
#define YY_CURRENT_BUFFER_LVALUE
Definition: ast_expr2f.c:280

Variable Documentation

int curlycount = 0
static

Definition at line 600 of file ast_expr2f.c.

const char* const expr2_token_equivs1[]
static

Definition at line 2481 of file ast_expr2f.c.

Referenced by expr2_token_subst().

const char* const expr2_token_equivs2[]
static

Definition at line 2507 of file ast_expr2f.c.

char extra_error_message[4095]

Definition at line 2464 of file ast_expr2f.c.

int extra_error_message_supplied = 0

Definition at line 2465 of file ast_expr2f.c.

yyconst flex_int16_t yy_accept[63]
static

Definition at line 364 of file ast_expr2f.c.

Referenced by while(), yy_get_previous_state(), and yy_try_NUL_trans().

register int yy_act

Definition at line 847 of file ast_expr2f.c.

yyconst flex_int16_t yy_base[70]
static

Definition at line 414 of file ast_expr2f.c.

Referenced by while(), yy_get_previous_state(), and yy_try_NUL_trans().

register char * yy_bp

Definition at line 846 of file ast_expr2f.c.

Referenced by yyunput().

yyconst flex_int16_t yy_chk[159]
static

Definition at line 457 of file ast_expr2f.c.

Referenced by while(), yy_get_previous_state(), and yy_try_NUL_trans().

register char* yy_cp

Definition at line 846 of file ast_expr2f.c.

Referenced by while(), yy_get_previous_state(), yy_try_NUL_trans(), and yyunput().

YY_DECL
Initial value:
{
register yy_state_type yy_current_state
int yy_state_type
Definition: ast_expr2f.c:335

The main scanner function which does all the work.

Definition at line 844 of file ast_expr2f.c.

yyconst flex_int16_t yy_def[70]
static

Definition at line 425 of file ast_expr2f.c.

Referenced by while(), yy_get_previous_state(), and yy_try_NUL_trans().

yyconst flex_int32_t yy_ec[256]
static

Definition at line 375 of file ast_expr2f.c.

Referenced by while(), and yy_get_previous_state().

yyconst flex_int32_t yy_meta[29]
static

Definition at line 407 of file ast_expr2f.c.

Referenced by while(), yy_get_previous_state(), and yy_try_NUL_trans().

yyconst flex_int16_t yy_nxt[159]
static

Definition at line 436 of file ast_expr2f.c.

Referenced by while(), yy_get_previous_state(), and yy_try_NUL_trans().

struct yyguts_t* yyg = (struct yyguts_t*)yyscanner

Definition at line 848 of file ast_expr2f.c.

yylloc = yylloc_param

Definition at line 857 of file ast_expr2f.c.

yylval = yylval_param

Definition at line 855 of file ast_expr2f.c.