Asterisk - The Open Source Telephony Project GIT-master-f3e88d3
Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
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>
Include dependency graph for ast_expr2f.c:

Go to the source code of this file.

Data Structures

struct  parse_io
 
struct  val
 
struct  yy_buffer_state
 
struct  yy_trans_info
 
struct  yyguts_t
 

Macros

#define ast_yywrap(n)   1
 
#define ASTMM_LIBC   ASTMM_REDIRECT
 
#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

◆ ast_yywrap

#define ast_yywrap (   n)    1

Definition at line 331 of file ast_expr2f.c.

◆ ASTMM_LIBC

#define ASTMM_LIBC   ASTMM_REDIRECT

Definition at line 1 of file ast_expr2f.c.

◆ BEGIN

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

Definition at line 145 of file ast_expr2f.c.

◆ ECHO

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

Definition at line 554 of file ast_expr2f.c.

◆ EOB_ACT_CONTINUE_SCAN

#define EOB_ACT_CONTINUE_SCAN   0

Definition at line 176 of file ast_expr2f.c.

◆ EOB_ACT_END_OF_FILE

#define EOB_ACT_END_OF_FILE   1

Definition at line 177 of file ast_expr2f.c.

◆ EOB_ACT_LAST_MATCH

#define EOB_ACT_LAST_MATCH   2

Definition at line 178 of file ast_expr2f.c.

◆ FLEX_BETA

#define FLEX_BETA

Definition at line 17 of file ast_expr2f.c.

◆ FLEX_SCANNER

#define FLEX_SCANNER

Definition at line 12 of file ast_expr2f.c.

◆ FLEXINT_H

#define FLEXINT_H

Definition at line 33 of file ast_expr2f.c.

◆ FP___FMOD

#define FP___FMOD   fmod

Definition at line 527 of file ast_expr2f.c.

◆ FP___PRINTF

#define FP___PRINTF   "%.16g"

Definition at line 526 of file ast_expr2f.c.

◆ FP___STRTOD

#define FP___STRTOD   strtod

Definition at line 528 of file ast_expr2f.c.

◆ FP___TYPE

#define FP___TYPE   double

Definition at line 529 of file ast_expr2f.c.

◆ INITIAL

#define INITIAL   0

Definition at line 604 of file ast_expr2f.c.

◆ INT16_MAX

#define INT16_MAX   (32767)

Definition at line 76 of file ast_expr2f.c.

◆ INT16_MIN

#define INT16_MIN   (-32767-1)

Definition at line 67 of file ast_expr2f.c.

◆ INT32_MAX

#define INT32_MAX   (2147483647)

Definition at line 79 of file ast_expr2f.c.

◆ INT32_MIN

#define INT32_MIN   (-2147483647-1)

Definition at line 70 of file ast_expr2f.c.

◆ INT8_MAX

#define INT8_MAX   (127)

Definition at line 73 of file ast_expr2f.c.

◆ INT8_MIN

#define INT8_MIN   (-128)

Definition at line 64 of file ast_expr2f.c.

◆ REJECT

#define REJECT   reject_used_but_not_detected

Definition at line 482 of file ast_expr2f.c.

◆ SET_COLUMNS

#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:843
#define YY_CURRENT_BUFFER_LVALUE
Definition: ast_expr2f.c:281
#define yyleng
Definition: ast_expr2f.c:135
char * yytext_r
Definition: ast_expr2f.c:648

Definition at line 571 of file ast_expr2f.c.

◆ SET_NUMERIC_STRING

#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:136
@ AST_EXPR_numeric_string
Definition: ast_expr2f.c:558
#define strdup(a)
Definition: astmm.h:163
#define calloc(a, b)
Definition: astmm.h:155
Definition: ast_expr2.c:325

Definition at line 583 of file ast_expr2f.c.

◆ SET_STRING

#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)
@ AST_EXPR_string
Definition: ast_expr2f.c:558

Definition at line 577 of file ast_expr2f.c.

◆ trail

#define trail   2

Definition at line 606 of file ast_expr2f.c.

◆ UINT16_MAX

#define UINT16_MAX   (65535U)

Definition at line 85 of file ast_expr2f.c.

◆ UINT32_MAX

#define UINT32_MAX   (4294967295U)

Definition at line 88 of file ast_expr2f.c.

◆ UINT8_MAX

#define UINT8_MAX   (255U)

Definition at line 82 of file ast_expr2f.c.

◆ unput

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

Definition at line 196 of file ast_expr2f.c.

◆ var

#define var   1
Examples
app_skel.c.

Definition at line 605 of file ast_expr2f.c.

◆ YY_AT_BOL

#define YY_AT_BOL ( )    (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)

Definition at line 327 of file ast_expr2f.c.

◆ YY_BREAK

#define YY_BREAK   break;

Definition at line 830 of file ast_expr2f.c.

◆ YY_BUF_SIZE

#define YY_BUF_SIZE   16384

Definition at line 164 of file ast_expr2f.c.

◆ YY_BUFFER_EOF_PENDING

#define YY_BUFFER_EOF_PENDING   2

Definition at line 263 of file ast_expr2f.c.

◆ YY_BUFFER_NEW

#define YY_BUFFER_NEW   0

Definition at line 251 of file ast_expr2f.c.

◆ YY_BUFFER_NORMAL

#define YY_BUFFER_NORMAL   1

Definition at line 252 of file ast_expr2f.c.

◆ YY_CURRENT_BUFFER

#define YY_CURRENT_BUFFER
Value:
: NULL)
#define NULL
Definition: resample.c:96
YY_BUFFER_STATE * yy_buffer_stack
Definition: ast_expr2f.c:631
size_t yy_buffer_stack_top
Definition: ast_expr2f.c:629

Definition at line 274 of file ast_expr2f.c.

◆ YY_CURRENT_BUFFER_LVALUE

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

Definition at line 281 of file ast_expr2f.c.

◆ YY_DECL

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

Definition at line 817 of file ast_expr2f.c.

◆ YY_DECL_IS_OURS

#define YY_DECL_IS_OURS   1

Definition at line 812 of file ast_expr2f.c.

◆ YY_DO_BEFORE_ACTION

#define YY_DO_BEFORE_ACTION

Definition at line 348 of file ast_expr2f.c.

◆ YY_END_OF_BUFFER

#define YY_END_OF_BUFFER   39

Definition at line 357 of file ast_expr2f.c.

◆ YY_END_OF_BUFFER_CHAR

#define YY_END_OF_BUFFER_CHAR   0

Definition at line 160 of file ast_expr2f.c.

◆ YY_EXIT_FAILURE

#define YY_EXIT_FAILURE   2

Definition at line 2004 of file ast_expr2f.c.

◆ YY_EXTRA_TYPE

#define YY_EXTRA_TYPE   void *

Definition at line 617 of file ast_expr2f.c.

◆ YY_FATAL_ERROR

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

Definition at line 803 of file ast_expr2f.c.

◆ yy_flex_debug

#define yy_flex_debug   yyg->yy_flex_debug_r

Definition at line 139 of file ast_expr2f.c.

◆ YY_FLEX_MAJOR_VERSION

#define YY_FLEX_MAJOR_VERSION   2

Definition at line 13 of file ast_expr2f.c.

◆ YY_FLEX_MINOR_VERSION

#define YY_FLEX_MINOR_VERSION   5

Definition at line 14 of file ast_expr2f.c.

◆ YY_FLEX_SUBMINOR_VERSION

#define YY_FLEX_SUBMINOR_VERSION   35

Definition at line 15 of file ast_expr2f.c.

◆ YY_FLUSH_BUFFER

#define YY_FLUSH_BUFFER   ast_yy_flush_buffer(YY_CURRENT_BUFFER ,yyscanner)

Definition at line 295 of file ast_expr2f.c.

◆ YY_INPUT

#define YY_INPUT (   buf,
  result,
  max_size 
)

Definition at line 756 of file ast_expr2f.c.

◆ YY_INT_ALIGNED

#define YY_INT_ALIGNED   short int

Definition at line 8 of file ast_expr2f.c.

◆ YY_LESS_LINENO

#define YY_LESS_LINENO (   n)

Definition at line 180 of file ast_expr2f.c.

◆ YY_MORE_ADJ

#define YY_MORE_ADJ   yyg->yy_more_len

Definition at line 484 of file ast_expr2f.c.

◆ yy_new_buffer

#define yy_new_buffer   ast_yy_create_buffer

Definition at line 305 of file ast_expr2f.c.

◆ YY_NEW_FILE

#define YY_NEW_FILE   ast_yyrestart(yyin ,yyscanner )

Definition at line 158 of file ast_expr2f.c.

◆ YY_NULL

#define YY_NULL   0

Definition at line 115 of file ast_expr2f.c.

◆ YY_NUM_RULES

#define YY_NUM_RULES   38

Definition at line 356 of file ast_expr2f.c.

◆ YY_READ_BUF_SIZE

#define YY_READ_BUF_SIZE   8192

Definition at line 741 of file ast_expr2f.c.

◆ YY_RESTORE_YY_MORE_OFFSET

#define YY_RESTORE_YY_MORE_OFFSET

Definition at line 485 of file ast_expr2f.c.

◆ YY_RULE_SETUP

#define YY_RULE_SETUP    YY_USER_ACTION

Definition at line 833 of file ast_expr2f.c.

◆ YY_SC_TO_UI

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

Definition at line 122 of file ast_expr2f.c.

◆ yy_set_bol

#define yy_set_bol (   at_bol)

Definition at line 317 of file ast_expr2f.c.

◆ yy_set_interactive

#define yy_set_interactive (   is_interactive)

Definition at line 307 of file ast_expr2f.c.

◆ YY_SKIP_YYWRAP

#define YY_SKIP_YYWRAP

Definition at line 332 of file ast_expr2f.c.

◆ YY_START

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

Definition at line 151 of file ast_expr2f.c.

◆ YY_START_STACK_INCR

#define YY_START_STACK_INCR   25

Definition at line 798 of file ast_expr2f.c.

◆ YY_STATE_BUF_SIZE

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

Definition at line 169 of file ast_expr2f.c.

◆ YY_STATE_EOF

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

Definition at line 155 of file ast_expr2f.c.

◆ YY_STRUCT_YY_BUFFER_STATE

#define YY_STRUCT_YY_BUFFER_STATE

Definition at line 204 of file ast_expr2f.c.

◆ YY_TYPEDEF_YY_BUFFER_STATE

#define YY_TYPEDEF_YY_BUFFER_STATE

Definition at line 172 of file ast_expr2f.c.

◆ YY_TYPEDEF_YY_SCANNER_T

#define YY_TYPEDEF_YY_SCANNER_T

Definition at line 126 of file ast_expr2f.c.

◆ YY_TYPEDEF_YY_SIZE_T

#define YY_TYPEDEF_YY_SIZE_T

Definition at line 199 of file ast_expr2f.c.

◆ YY_USER_ACTION

#define YY_USER_ACTION

Definition at line 825 of file ast_expr2f.c.

◆ yycolumn

#define yycolumn   (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)

Definition at line 138 of file ast_expr2f.c.

◆ yyconst

#define yyconst

Definition at line 111 of file ast_expr2f.c.

◆ yyextra

#define yyextra   yyg->yyextra_r

Definition at line 134 of file ast_expr2f.c.

◆ yyin

#define yyin   yyg->yyin_r

Definition at line 132 of file ast_expr2f.c.

◆ yyleng

#define yyleng   yyg->yyleng_r

Definition at line 135 of file ast_expr2f.c.

◆ yyless [1/2]

#define yyless (   n)

Definition at line 2016 of file ast_expr2f.c.

◆ yyless [2/2]

#define yyless (   n)

Definition at line 2016 of file ast_expr2f.c.

◆ yylineno

#define yylineno   (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)

Definition at line 137 of file ast_expr2f.c.

◆ yylloc

#define yylloc   yyg->yylloc_r

Definition at line 664 of file ast_expr2f.c.

◆ yylval

#define yylval   yyg->yylval_r

Definition at line 662 of file ast_expr2f.c.

◆ yymore

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

Definition at line 483 of file ast_expr2f.c.

◆ yyout

#define yyout   yyg->yyout_r

Definition at line 133 of file ast_expr2f.c.

◆ YYSTATE

#define YYSTATE   YY_START

Definition at line 152 of file ast_expr2f.c.

◆ YYTABLES_NAME

#define YYTABLES_NAME   "yytables"

Definition at line 2368 of file ast_expr2f.c.

◆ yyterminate

#define yyterminate ( )    return YY_NULL

Definition at line 793 of file ast_expr2f.c.

◆ yytext

#define yytext   yyg->yytext_r

Definition at line 136 of file ast_expr2f.c.

◆ yytext_ptr

#define yytext_ptr   yytext_r

Definition at line 338 of file ast_expr2f.c.

Typedef Documentation

◆ flex_int16_t

typedef short int flex_int16_t

Definition at line 55 of file ast_expr2f.c.

◆ flex_int32_t

typedef int flex_int32_t

Definition at line 56 of file ast_expr2f.c.

◆ flex_int8_t

typedef signed char flex_int8_t

Definition at line 54 of file ast_expr2f.c.

◆ flex_uint16_t

typedef unsigned short int flex_uint16_t

Definition at line 58 of file ast_expr2f.c.

◆ flex_uint32_t

typedef unsigned int flex_uint32_t

Definition at line 59 of file ast_expr2f.c.

◆ flex_uint8_t

typedef unsigned char flex_uint8_t

Definition at line 57 of file ast_expr2f.c.

◆ YY_BUFFER_STATE

Definition at line 173 of file ast_expr2f.c.

◆ YY_CHAR

typedef unsigned char YY_CHAR

Definition at line 334 of file ast_expr2f.c.

◆ yy_size_t

typedef size_t yy_size_t

Definition at line 200 of file ast_expr2f.c.

◆ yy_state_type

typedef int yy_state_type

Definition at line 336 of file ast_expr2f.c.

◆ yyscan_t

typedef void* yyscan_t

Definition at line 127 of file ast_expr2f.c.

Enumeration Type Documentation

◆ valtype

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 557 of file ast_expr2f.c.

Function Documentation

◆ ast_expr()

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 2391 of file ast_expr2f.c.

2392{
2393 struct parse_io io = { .string = expr, .chan = chan };
2394 int return_value = 0;
2395
2396 ast_yylex_init(&io.scanner);
2397
2398 ast_yy_scan_string(expr, io.scanner);
2399
2400 ast_yyparse ((void *) &io);
2401
2402 ast_yylex_destroy(io.scanner);
2403
2404 if (!io.val) {
2405 if (length > 1) {
2406 strcpy(buf, "0");
2407 return_value = 1;
2408 }
2409 } else {
2410 if (io.val->type == AST_EXPR_number) {
2411 int res_length;
2412
2413 res_length = snprintf(buf, length, FP___PRINTF, io.val->u.i);
2414 return_value = (res_length <= length) ? res_length : length;
2415 } else {
2416 if (io.val->u.s)
2417#if defined(STANDALONE) || defined(LOW_MEMORY) || defined(STANDALONE)
2418 strncpy(buf, io.val->u.s, length - 1);
2419#else /* !STANDALONE && !LOW_MEMORY */
2420 ast_copy_string(buf, io.val->u.s, length);
2421#endif /* STANDALONE || LOW_MEMORY */
2422 else
2423 buf[0] = 0;
2424 return_value = strlen(buf);
2425 free(io.val->u.s);
2426 }
2427 free(io.val);
2428 }
2429 return return_value;
2430}
int ast_yylex_destroy(yyscan_t yyscanner)
Definition: ast_expr2f.c:2298
int ast_yyparse(void *)
YY_BUFFER_STATE ast_yy_scan_string(yyconst char *yy_str, yyscan_t yyscanner)
Definition: ast_expr2f.c:1960
#define FP___PRINTF
Definition: ast_expr2f.c:526
int ast_yylex_init(yyscan_t *scanner)
Definition: ast_expr2f.c:2207
static struct io_context * io
Definition: chan_ooh323.c:401
char buf[BUFSIZE]
Definition: eagi_proxy.c:66
void free()
void ast_copy_string(char *dst, const char *src, size_t size)
Size-limited null-terminating string copy.
Definition: strings.h:425
struct ast_channel * chan
Definition: ast_expr2.c:353

References ast_copy_string(), AST_EXPR_number, ast_yy_scan_string(), ast_yylex_destroy(), ast_yylex_init(), ast_yyparse(), buf, parse_io::chan, FP___PRINTF, free(), and io.

Referenced by AST_TEST_DEFINE(), check_eval(), check_pval_item(), pbx_substitute_variables_helper_full(), and pbx_substitute_variables_helper_full_location().

◆ ast_expr_clear_extra_error_info()

void ast_expr_clear_extra_error_info ( void  )

Definition at line 2469 of file ast_expr2f.c.

2470{
2472 extra_error_message[0] = 0;
2473}
char extra_error_message[4095]
Definition: ast_expr2f.c:2458
int extra_error_message_supplied
Definition: ast_expr2f.c:2459

References extra_error_message, and extra_error_message_supplied.

Referenced by check_pval_item().

◆ ast_expr_register_extra_error_info()

void ast_expr_register_extra_error_info ( char *  message)

Definition at line 2463 of file ast_expr2f.c.

2464{
2467}

References extra_error_message, and extra_error_message_supplied.

Referenced by check_pval_item().

◆ ast_str_expr()

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 2433 of file ast_expr2f.c.

2434{
2435 struct parse_io io = { .string = expr, .chan = chan };
2436
2437 ast_yylex_init(&io.scanner);
2438 ast_yy_scan_string(expr, io.scanner);
2439 ast_yyparse ((void *) &io);
2440 ast_yylex_destroy(io.scanner);
2441
2442 if (!io.val) {
2443 ast_str_set(str, maxlen, "0");
2444 } else {
2445 if (io.val->type == AST_EXPR_number) {
2446 ast_str_set(str, maxlen, FP___PRINTF, io.val->u.i);
2447 } else if (io.val->u.s) {
2448 ast_str_set(str, maxlen, "%s", io.val->u.s);
2449 free(io.val->u.s);
2450 }
2451 free(io.val);
2452 }
2453 return ast_str_strlen(*str);
2454}
const char * str
Definition: app_jack.c:147
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:1113
size_t ast_str_strlen(const struct ast_str *buf)
Returns the current length of the string stored within buf.
Definition: strings.h:730

References AST_EXPR_number, ast_str_set(), ast_str_strlen(), ast_yy_scan_string(), ast_yylex_destroy(), ast_yylex_init(), ast_yyparse(), parse_io::chan, FP___PRINTF, free(), io, and str.

Referenced by ast_str_substitute_variables_full2().

◆ ast_yy_create_buffer()

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 1711 of file ast_expr2f.c.

1712{
1714
1715 b = (YY_BUFFER_STATE) ast_yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner );
1716 if ( ! b )
1717 YY_FATAL_ERROR( "out of dynamic memory in ast_yy_create_buffer()" );
1718
1719 b->yy_buf_size = size;
1720
1721 /* yy_ch_buf has to be 2 characters longer than the size given because
1722 * we need to put in 2 end-of-buffer characters.
1723 */
1724 b->yy_ch_buf = (char *) ast_yyalloc(b->yy_buf_size + 2 ,yyscanner );
1725 if ( ! b->yy_ch_buf )
1726 YY_FATAL_ERROR( "out of dynamic memory in ast_yy_create_buffer()" );
1727
1728 b->yy_is_our_buffer = 1;
1729
1730 ast_yy_init_buffer(b,file ,yyscanner);
1731
1732 return b;
1733}
static void ast_yy_init_buffer(YY_BUFFER_STATE b, FILE *file, yyscan_t yyscanner)
Definition: ast_expr2f.c:1763
struct yy_buffer_state * YY_BUFFER_STATE
Definition: ast_expr2f.c:173
#define YY_FATAL_ERROR(msg)
Definition: ast_expr2f.c:803
void * ast_yyalloc(yy_size_t, yyscan_t yyscanner)
Definition: ast_expr2f.c:2351
static struct test_val b

References ast_yy_init_buffer(), ast_yyalloc(), b, make_ari_stubs::file, and YY_FATAL_ERROR.

Referenced by ast_yyrestart(), and if().

◆ ast_yy_delete_buffer()

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 1739 of file ast_expr2f.c.

1740{
1741 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1742
1743 if ( ! b )
1744 return;
1745
1746 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1748
1749 if ( b->yy_is_our_buffer )
1750 ast_yyfree((void *) b->yy_ch_buf ,yyscanner );
1751
1752 ast_yyfree((void *) b ,yyscanner );
1753}
void ast_yyfree(void *, yyscan_t yyscanner)
Definition: ast_expr2f.c:2383
#define YY_CURRENT_BUFFER
Definition: ast_expr2f.c:274

References ast_yyfree(), b, YY_CURRENT_BUFFER, YY_CURRENT_BUFFER_LVALUE, and yyg.

Referenced by ast_yylex_destroy(), and ast_yypop_buffer_state().

◆ ast_yy_flush_buffer()

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 1792 of file ast_expr2f.c.

1793{
1794 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1795 if ( ! b )
1796 return;
1797
1798 b->yy_n_chars = 0;
1799
1800 /* We always need two end-of-buffer characters. The first causes
1801 * a transition to the end-of-buffer state. The second causes
1802 * a jam in that state.
1803 */
1804 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1805 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1806
1807 b->yy_buf_pos = &b->yy_ch_buf[0];
1808
1809 b->yy_at_bol = 1;
1810 b->yy_buffer_status = YY_BUFFER_NEW;
1811
1812 if ( b == YY_CURRENT_BUFFER )
1813 ast_yy_load_buffer_state(yyscanner );
1814}
static void ast_yy_load_buffer_state(yyscan_t yyscanner)
Definition: ast_expr2f.c:1696
#define YY_BUFFER_NEW
Definition: ast_expr2f.c:251
#define YY_END_OF_BUFFER_CHAR
Definition: ast_expr2f.c:160

References ast_yy_load_buffer_state(), b, YY_BUFFER_NEW, YY_CURRENT_BUFFER, YY_END_OF_BUFFER_CHAR, and yyg.

Referenced by ast_yy_init_buffer().

◆ ast_yy_init_buffer()

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

Definition at line 1763 of file ast_expr2f.c.

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

References ast_yy_flush_buffer(), b, errno, make_ari_stubs::file, isatty(), YY_CURRENT_BUFFER, and yyg.

Referenced by ast_yy_create_buffer(), and ast_yyrestart().

◆ ast_yy_load_buffer_state()

static void ast_yy_load_buffer_state ( yyscan_t  yyscanner)
static

Definition at line 1696 of file ast_expr2f.c.

1697{
1698 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1700 yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1701 yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1703}
#define yyin
Definition: ast_expr2f.c:132
char yy_hold_char
Definition: ast_expr2f.c:632
int yy_n_chars
Definition: ast_expr2f.c:633
char * yy_c_buf_p
Definition: ast_expr2f.c:635

References yyguts_t::yy_c_buf_p, YY_CURRENT_BUFFER_LVALUE, yyguts_t::yy_hold_char, yyguts_t::yy_n_chars, yyg, 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().

◆ ast_yy_scan_buffer()

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 1923 of file ast_expr2f.c.

1924{
1926
1927 if ( size < 2 ||
1928 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1929 base[size-1] != YY_END_OF_BUFFER_CHAR )
1930 /* They forgot to leave room for the EOB's. */
1931 return 0;
1932
1933 b = (YY_BUFFER_STATE) ast_yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner );
1934 if ( ! b )
1935 YY_FATAL_ERROR( "out of dynamic memory in ast_yy_scan_buffer()" );
1936
1937 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1938 b->yy_buf_pos = b->yy_ch_buf = base;
1939 b->yy_is_our_buffer = 0;
1940 b->yy_input_file = 0;
1941 b->yy_n_chars = b->yy_buf_size;
1942 b->yy_is_interactive = 0;
1943 b->yy_at_bol = 1;
1944 b->yy_fill_buffer = 0;
1945 b->yy_buffer_status = YY_BUFFER_NEW;
1946
1947 ast_yy_switch_to_buffer(b ,yyscanner );
1948
1949 return b;
1950}
void ast_yy_switch_to_buffer(YY_BUFFER_STATE new_buffer, yyscan_t yyscanner)
Definition: ast_expr2f.c:1664

References ast_yy_switch_to_buffer(), ast_yyalloc(), b, YY_BUFFER_NEW, YY_END_OF_BUFFER_CHAR, and YY_FATAL_ERROR.

Referenced by ast_yy_scan_bytes().

◆ ast_yy_scan_bytes()

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 1973 of file ast_expr2f.c.

1974{
1976 char *buf;
1977 yy_size_t n;
1978 int i;
1979
1980 /* Get memory for full buffer, including space for trailing EOB's. */
1981 n = _yybytes_len + 2;
1982 buf = (char *) ast_yyalloc(n ,yyscanner );
1983 if ( ! buf )
1984 YY_FATAL_ERROR( "out of dynamic memory in ast_yy_scan_bytes()" );
1985
1986 for ( i = 0; i < _yybytes_len; ++i )
1987 buf[i] = yybytes[i];
1988
1989 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
1990
1991 b = ast_yy_scan_buffer(buf,n ,yyscanner);
1992 if ( ! b )
1993 YY_FATAL_ERROR( "bad buffer in ast_yy_scan_bytes()" );
1994
1995 /* It's okay to grow etc. this buffer, and we should throw it
1996 * away when we're done.
1997 */
1998 b->yy_is_our_buffer = 1;
1999
2000 return b;
2001}
YY_BUFFER_STATE ast_yy_scan_buffer(char *base, yy_size_t size, yyscan_t yyscanner)
Definition: ast_expr2f.c:1923
size_t yy_size_t
Definition: ast_expr2f.c:200

References ast_yy_scan_buffer(), ast_yyalloc(), b, buf, YY_END_OF_BUFFER_CHAR, and YY_FATAL_ERROR.

Referenced by ast_yy_scan_string().

◆ ast_yy_scan_string()

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 1960 of file ast_expr2f.c.

1961{
1962
1963 return ast_yy_scan_bytes(yystr,strlen(yystr) ,yyscanner);
1964}
YY_BUFFER_STATE ast_yy_scan_bytes(yyconst char *bytes, int len, yyscan_t yyscanner)
Definition: ast_expr2f.c:1973

References ast_yy_scan_bytes().

Referenced by ast_expr(), and ast_str_expr().

◆ ast_yy_switch_to_buffer()

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 1664 of file ast_expr2f.c.

1665{
1666 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1667
1668 /* TODO. We should be able to replace this entire function body
1669 * with
1670 * ast_yypop_buffer_state();
1671 * ast_yypush_buffer_state(new_buffer);
1672 */
1673 ast_yyensure_buffer_stack (yyscanner);
1674 if ( YY_CURRENT_BUFFER == new_buffer )
1675 return;
1676
1677 if ( YY_CURRENT_BUFFER )
1678 {
1679 /* Flush out information for old buffer. */
1683 }
1684
1685 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1686 ast_yy_load_buffer_state(yyscanner );
1687
1688 /* We don't actually know whether we did this switch during
1689 * EOF (ast_yywrap()) processing, but the only time this flag
1690 * is looked at is after ast_yywrap() is called, so it's safe
1691 * to go ahead and always set it.
1692 */
1694}
static void ast_yyensure_buffer_stack(yyscan_t yyscanner)
Definition: ast_expr2f.c:1873
int yy_did_buffer_switch_on_eof
Definition: ast_expr2f.c:638

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, yyguts_t::yy_n_chars, and yyg.

Referenced by ast_yy_scan_buffer().

◆ ast_yyalloc()

void * ast_yyalloc ( yy_size_t  size,
yyscan_t  yyscanner 
)

Definition at line 2351 of file ast_expr2f.c.

2352{
2353 return (void *) malloc( size );
2354}
char * malloc()

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().

◆ ast_yyensure_buffer_stack()

static void ast_yyensure_buffer_stack ( yyscan_t  yyscanner)
static

Definition at line 1873 of file ast_expr2f.c.

1874{
1875 int num_to_alloc;
1876 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1877
1878 if (!yyg->yy_buffer_stack) {
1879
1880 /* First allocation is just for 2 elements, since we don't know if this
1881 * scanner will even need a stack. We use 2 instead of 1 to avoid an
1882 * immediate realloc on the next call.
1883 */
1884 num_to_alloc = 1;
1886 (num_to_alloc * sizeof(struct yy_buffer_state*)
1887 , yyscanner);
1888 if ( ! yyg->yy_buffer_stack )
1889 YY_FATAL_ERROR( "out of dynamic memory in ast_yyensure_buffer_stack()" );
1890
1891 memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1892
1893 yyg->yy_buffer_stack_max = num_to_alloc;
1895 return;
1896 }
1897
1899
1900 /* Increase the buffer to prepare for a possible push. */
1901 int grow_size = 8 /* arbitrary grow size */;
1902
1903 num_to_alloc = yyg->yy_buffer_stack_max + grow_size;
1906 num_to_alloc * sizeof(struct yy_buffer_state*)
1907 , yyscanner);
1908 if ( ! yyg->yy_buffer_stack )
1909 YY_FATAL_ERROR( "out of dynamic memory in ast_yyensure_buffer_stack()" );
1910
1911 /* zero only the new slots.*/
1912 memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*));
1913 yyg->yy_buffer_stack_max = num_to_alloc;
1914 }
1915}
void * ast_yyrealloc(void *, yy_size_t, yyscan_t yyscanner)
Definition: ast_expr2f.c:2356
size_t yy_buffer_stack_max
Definition: ast_expr2f.c:630

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

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

◆ ast_yyerror() [1/2]

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

◆ ast_yyerror() [2/2]

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

Definition at line 2572 of file ast_expr2f.c.

2573{
2574 struct yyguts_t * yyg = (struct yyguts_t*)(parseio->scanner);
2575 char spacebuf[8000]; /* best safe than sorry */
2576 int i=0;
2577 char *s2 = expr2_token_subst(s);
2578 spacebuf[0] = 0;
2579
2580 for (i = 0; i < (int)(yytext - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf); i++) {
2581 spacebuf[i] = ' ';
2582 }
2583 /* uh... assuming yyg is defined, then I can use the yycolumn macro,
2584 which is the same thing as... get this:
2585 yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]->yy_bs_column
2586 I was tempted to just use yy_buf_pos in the STATE, but..., well:
2587 a. the yy_buf_pos is the current position in the buffer, which
2588 may not relate to the entire string/buffer because of the
2589 buffering.
2590 b. but, analysis of the situation is that when you use the
2591 ast_yy_scan_string func, it creates a single buffer the size of
2592 string, so the two would be the same...
2593 so, in the end, the yycolumn macro is available, shorter, therefore easier. */
2594
2595 spacebuf[i++] = '^';
2596 spacebuf[i] = 0;
2597
2598#ifdef STANDALONE3
2599 /* easier to read in the standalone version */
2600 printf("ast_yyerror(): %s syntax error: %s; Input:\n%s\n%s\n",
2601 (extra_error_message_supplied ? extra_error_message : ""), s2, parseio->string, spacebuf);
2602#else
2603 ast_log(LOG_WARNING,"ast_yyerror(): %s syntax error: %s; Input:\n%s\n%s\n",
2604 (extra_error_message_supplied ? extra_error_message : ""), s2, parseio->string, spacebuf);
2605#endif
2606#ifndef STANDALONE
2607 ast_log(LOG_WARNING,"If you have questions, please refer to https://docs.asterisk.org/Configuration/Dialplan/Variables/Channel-Variables/\n");
2608#endif
2609 free(s2);
2610 return(0);
2611}
static char * expr2_token_subst(const char *mess)
Definition: ast_expr2f.c:2528
#define ast_log
Definition: astobj2.c:42
#define LOG_WARNING
yyscan_t scanner
Definition: ael_structs.h:78
char * string
Definition: ast_expr2.c:350

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

◆ ast_yyfree()

void ast_yyfree ( void *  ptr,
yyscan_t  yyscanner 
)

Definition at line 2383 of file ast_expr2f.c.

2384{
2385 /* the normal generated ast_yyfree func just frees its first arg;
2386 this get complaints on some systems, as sometimes this
2387 arg is a nil ptr! It's usually not fatal, but is irritating! */
2388 free( (char *) ptr );
2389}

References free().

Referenced by ast_yy_delete_buffer(), and ast_yylex_destroy().

◆ ast_yyget_column()

int ast_yyget_column ( yyscan_t  yyscanner)

Get the current column number.

Parameters
yyscannerThe scanner object.

Definition at line 2057 of file ast_expr2f.c.

2058{
2059 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2060
2061 if (! YY_CURRENT_BUFFER)
2062 return 0;
2063
2064 return yycolumn;
2065}
#define yycolumn
Definition: ast_expr2f.c:138

References YY_CURRENT_BUFFER, yycolumn, and yyg.

◆ ast_yyget_debug()

int ast_yyget_debug ( yyscan_t  yyscanner)

Definition at line 2162 of file ast_expr2f.c.

2163{
2164 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2165 return yy_flex_debug;
2166}
#define yy_flex_debug
Definition: ast_expr2f.c:139

References yy_flex_debug, and yyg.

◆ ast_yyget_extra()

YY_EXTRA_TYPE ast_yyget_extra ( yyscan_t  yyscanner)

Get the user-defined data for this scanner.

Parameters
yyscannerThe scanner object.

Definition at line 2035 of file ast_expr2f.c.

2036{
2037 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2038 return yyextra;
2039}
#define yyextra
Definition: ast_expr2f.c:134

References yyextra, and yyg.

◆ ast_yyget_in()

FILE * ast_yyget_in ( yyscan_t  yyscanner)

Get the input stream.

Parameters
yyscannerThe scanner object.

Definition at line 2070 of file ast_expr2f.c.

2071{
2072 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2073 return yyin;
2074}

References yyg, and yyin.

◆ ast_yyget_leng()

int ast_yyget_leng ( yyscan_t  yyscanner)

Get the length of the current token.

Parameters
yyscannerThe scanner object.

Definition at line 2088 of file ast_expr2f.c.

2089{
2090 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2091 return yyleng;
2092}

References yyg, and yyleng.

◆ ast_yyget_lineno()

int ast_yyget_lineno ( yyscan_t  yyscanner)

Get the current line number.

Parameters
yyscannerThe scanner object.

Definition at line 2044 of file ast_expr2f.c.

2045{
2046 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2047
2048 if (! YY_CURRENT_BUFFER)
2049 return 0;
2050
2051 return yylineno;
2052}
#define yylineno
Definition: ast_expr2f.c:137

References YY_CURRENT_BUFFER, yyg, and yylineno.

◆ ast_yyget_lloc()

YYLTYPE * ast_yyget_lloc ( yyscan_t  yyscanner)

Definition at line 2188 of file ast_expr2f.c.

2189{
2190 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2191 return yylloc;
2192}
#define yylloc
Definition: ast_expr2f.c:664

References yyg, and yylloc.

◆ ast_yyget_lval()

YYSTYPE * ast_yyget_lval ( yyscan_t  yyscanner)

Definition at line 2176 of file ast_expr2f.c.

2177{
2178 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2179 return yylval;
2180}
#define yylval
Definition: ast_expr2f.c:662

References yyg, and yylval.

◆ ast_yyget_out()

FILE * ast_yyget_out ( yyscan_t  yyscanner)

Get the output stream.

Parameters
yyscannerThe scanner object.

Definition at line 2079 of file ast_expr2f.c.

2080{
2081 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2082 return yyout;
2083}
#define yyout
Definition: ast_expr2f.c:133

References yyg, and yyout.

◆ ast_yyget_text()

char * ast_yyget_text ( yyscan_t  yyscanner)

Get the current token.

Parameters
yyscannerThe scanner object.

Definition at line 2098 of file ast_expr2f.c.

2099{
2100 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2101 return yytext;
2102}

References yyg, and yytext.

◆ ast_yylex()

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

◆ ast_yylex_destroy()

int ast_yylex_destroy ( yyscan_t  yyscanner)

Definition at line 2298 of file ast_expr2f.c.

2299{
2300 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2301
2302 /* Pop the buffer stack, destroying each element. */
2303 while(YY_CURRENT_BUFFER){
2306 ast_yypop_buffer_state(yyscanner);
2307 }
2308
2309 /* Destroy the stack itself. */
2310 ast_yyfree(yyg->yy_buffer_stack ,yyscanner);
2312
2313 /* Destroy the start condition stack. */
2314 ast_yyfree(yyg->yy_start_stack ,yyscanner );
2316
2317 /* Reset the globals. This is important in a non-reentrant scanner so the next time
2318 * ast_yylex() is called, initialization will occur. */
2319 yy_init_globals( yyscanner);
2320
2321 /* Destroy the main struct (reentrant only). */
2322 ast_yyfree ( yyscanner , yyscanner );
2323 yyscanner = NULL;
2324 return 0;
2325}
static int yy_init_globals(yyscan_t yyscanner)
Definition: ast_expr2f.c:2264
void ast_yypop_buffer_state(yyscan_t yyscanner)
Definition: ast_expr2f.c:1853
void ast_yy_delete_buffer(YY_BUFFER_STATE b, yyscan_t yyscanner)
Definition: ast_expr2f.c:1739
int * yy_start_stack
Definition: ast_expr2f.c:641

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

Referenced by ast_expr(), and ast_str_expr().

◆ ast_yylex_init()

int ast_yylex_init ( yyscan_t scanner)

Definition at line 2207 of file ast_expr2f.c.

2209{
2210 if (ptr_yy_globals == NULL){
2211 errno = EINVAL;
2212 return 1;
2213 }
2214
2215 *ptr_yy_globals = (yyscan_t) ast_yyalloc ( sizeof( struct yyguts_t ), NULL );
2216
2217 if (*ptr_yy_globals == NULL){
2218 errno = ENOMEM;
2219 return 1;
2220 }
2221
2222 /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */
2223 memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
2224
2225 return yy_init_globals ( *ptr_yy_globals );
2226}
void * yyscan_t
Definition: ast_expr2f.c:127

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

Referenced by ast_expr(), and ast_str_expr().

◆ ast_yylex_init_extra()

int ast_yylex_init_extra ( YY_EXTRA_TYPE  user_defined,
yyscan_t scanner 
)

Definition at line 2236 of file ast_expr2f.c.

2238{
2239 struct yyguts_t dummy_yyguts;
2240
2241 ast_yyset_extra (yy_user_defined, &dummy_yyguts);
2242
2243 if (ptr_yy_globals == NULL){
2244 errno = EINVAL;
2245 return 1;
2246 }
2247
2248 *ptr_yy_globals = (yyscan_t) ast_yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
2249
2250 if (*ptr_yy_globals == NULL){
2251 errno = ENOMEM;
2252 return 1;
2253 }
2254
2255 /* By setting to 0xAA, we expose bugs in
2256 yy_init_globals. Leave at 0x00 for releases. */
2257 memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
2258
2259 ast_yyset_extra (yy_user_defined, *ptr_yy_globals);
2260
2261 return yy_init_globals ( *ptr_yy_globals );
2262}
void ast_yyset_extra(YY_EXTRA_TYPE user_defined, yyscan_t yyscanner)
Definition: ast_expr2f.c:2108

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

◆ ast_yyparse()

int ast_yyparse ( void *  )

Referenced by ast_expr(), and ast_str_expr().

◆ ast_yypop_buffer_state()

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 1853 of file ast_expr2f.c.

1854{
1855 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1856 if (!YY_CURRENT_BUFFER)
1857 return;
1858
1861 if (yyg->yy_buffer_stack_top > 0)
1863
1864 if (YY_CURRENT_BUFFER) {
1865 ast_yy_load_buffer_state(yyscanner );
1867 }
1868}

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

Referenced by ast_yylex_destroy().

◆ ast_yypush_buffer_state()

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 1822 of file ast_expr2f.c.

1823{
1824 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1825 if (new_buffer == NULL)
1826 return;
1827
1828 ast_yyensure_buffer_stack(yyscanner);
1829
1830 /* This block is copied from ast_yy_switch_to_buffer. */
1831 if ( YY_CURRENT_BUFFER )
1832 {
1833 /* Flush out information for old buffer. */
1837 }
1838
1839 /* Only push if top exists. Otherwise, replace top. */
1842 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1843
1844 /* copied from ast_yy_switch_to_buffer. */
1845 ast_yy_load_buffer_state(yyscanner );
1847}

References ast_yy_load_buffer_state(), ast_yyensure_buffer_stack(), NULL, 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, yyguts_t::yy_n_chars, and yyg.

◆ ast_yyrealloc()

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

Definition at line 2356 of file ast_expr2f.c.

2357{
2358 /* The cast to (char *) in the following accommodates both
2359 * implementations that use char* generic pointers, and those
2360 * that use void* generic pointers. It works with the latter
2361 * because both ANSI C and C++ allow castless assignment from
2362 * any pointer type to void*, and deal with argument conversions
2363 * as though doing an assignment.
2364 */
2365 return (void *) realloc( (char *) ptr, size );
2366}
#define realloc(a, b)
Definition: astmm.h:161

References realloc.

Referenced by ast_yyensure_buffer_stack(), and yy_get_next_buffer().

◆ ast_yyrestart()

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 1646 of file ast_expr2f.c.

1647{
1648 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1649
1650 if ( ! YY_CURRENT_BUFFER ){
1651 ast_yyensure_buffer_stack (yyscanner);
1654 }
1655
1656 ast_yy_init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner);
1657 ast_yy_load_buffer_state(yyscanner );
1658}
YY_BUFFER_STATE ast_yy_create_buffer(FILE *file, int size, yyscan_t yyscanner)
Definition: ast_expr2f.c:1711
#define YY_BUF_SIZE
Definition: ast_expr2f.c:164

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, yyg, and yyin.

Referenced by input(), and yy_get_next_buffer().

◆ ast_yyset_column()

void ast_yyset_column ( int  column_no,
yyscan_t  yyscanner 
)

Set the current column.

Parameters
line_number
yyscannerThe scanner object.

Definition at line 2133 of file ast_expr2f.c.

2134{
2135 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2136
2137 /* column is only valid if an input buffer exists. */
2138 if (! YY_CURRENT_BUFFER )
2139 yy_fatal_error( "ast_yyset_column called with no buffer" , yyscanner);
2140
2141 yycolumn = column_no;
2142}
static void yy_fatal_error(yyconst char msg[], yyscan_t yyscanner)

References YY_CURRENT_BUFFER, yy_fatal_error(), yycolumn, and yyg.

◆ ast_yyset_debug()

void ast_yyset_debug ( int  debug_flag,
yyscan_t  yyscanner 
)

Definition at line 2168 of file ast_expr2f.c.

2169{
2170 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2171 yy_flex_debug = bdebug ;
2172}

References yy_flex_debug, and yyg.

◆ ast_yyset_extra()

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 2108 of file ast_expr2f.c.

2109{
2110 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2111 yyextra = user_defined ;
2112}

References yyextra, and yyg.

Referenced by ast_yylex_init_extra().

◆ ast_yyset_in()

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 2150 of file ast_expr2f.c.

2151{
2152 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2153 yyin = in_str ;
2154}

References yyg, and yyin.

◆ ast_yyset_lineno()

void ast_yyset_lineno ( int  line_number,
yyscan_t  yyscanner 
)

Set the current line number.

Parameters
line_number
yyscannerThe scanner object.

Definition at line 2118 of file ast_expr2f.c.

2119{
2120 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2121
2122 /* lineno is only valid if an input buffer exists. */
2123 if (! YY_CURRENT_BUFFER )
2124 yy_fatal_error( "ast_yyset_lineno called with no buffer" , yyscanner);
2125
2126 yylineno = line_number;
2127}

References YY_CURRENT_BUFFER, yy_fatal_error(), yyg, and yylineno.

◆ ast_yyset_lloc()

void ast_yyset_lloc ( YYLTYPE yylloc_param,
yyscan_t  yyscanner 
)

Definition at line 2194 of file ast_expr2f.c.

2195{
2196 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2197 yylloc = yylloc_param;
2198}

References yyg, and yylloc.

◆ ast_yyset_lval()

void ast_yyset_lval ( YYSTYPE yylval_param,
yyscan_t  yyscanner 
)

Definition at line 2182 of file ast_expr2f.c.

2183{
2184 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2185 yylval = yylval_param;
2186}

References yyg, and yylval.

◆ ast_yyset_out()

void ast_yyset_out ( FILE *  out_str,
yyscan_t  yyscanner 
)

Definition at line 2156 of file ast_expr2f.c.

2157{
2158 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2159 yyout = out_str ;
2160}

References yyg, and yyout.

◆ expr2_token_subst()

static char * expr2_token_subst ( const char *  mess)
static

Definition at line 2528 of file ast_expr2f.c.

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

References expr2_token_equivs1, expr2_token_equivs2, len(), and malloc().

Referenced by ast_yyerror().

◆ if()

if ( !yyg->  yy_init)

Definition at line 854 of file ast_expr2f.c.

855 {
856 yyg->yy_init = 1;
857
858#ifdef YY_USER_INIT
859 YY_USER_INIT;
860#endif
861
862 if ( ! yyg->yy_start )
863 yyg->yy_start = 1; /* first start state */
864
865 if ( ! yyin )
866 yyin = stdin;
867
868 if ( ! yyout )
869 yyout = stdout;
870
871 if ( ! YY_CURRENT_BUFFER ) {
872 ast_yyensure_buffer_stack (yyscanner);
875 }
876
877 ast_yy_load_buffer_state(yyscanner );
878 }
int yy_start
Definition: ast_expr2f.c:637
int yy_init
Definition: ast_expr2f.c:636

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, yyg, yyin, and yyout.

Referenced by __add_ovflpage(), __addel(), __ast_str_helper(), __ast_str_helper2(), __big_delete(), __big_split(), __bt_put(), __bt_split(), __delpair(), __hash_open(), __rec_vmap(), __rec_vpipe(), apply_contact_acl(), apply_endpoint_contact_acl(), ast_cel_fabricate_channel_from_event(), ast_format_cmp(), ast_rtcp_generate_report(), ast_set_default_eid(), ast_sip_set_request_transport_details(), ast_sip_update_to_uri(), ast_sorcery_wizard_unregister(), ast_stun_request(), ast_unreal_setoption(), ast_variable_lists_match(), cli_complete(), cli_show_subscription_common(), defer_full_frame(), dundi_send(), fax_gateway_detect_v21(), g726_write(), generate_parked_user(), get_filestream(), h263_read(), h264_read(), hash_access(), hash_delete(), hash_fd(), hash_get(), hash_put(), hash_seq(), hash_sync(), history_get(), is_allowed_tel_uri_request(), lintospeex_feedback(), MD5Update(), newbuf(), ogg_speex_read(), ogg_vorbis_close(), ogg_vorbis_read(), ogg_vorbis_seek(), ogg_vorbis_tell(), ogg_vorbis_write(), pitch_shift(), read_dirs_cb(), sdp_search(), send_trunk(), socket_read(), speex_callback(), tzload(), ugly_split(), update(), update_filter(), update_lost_stats(), wav_close(), wav_open(), wav_seek(), wav_write(), and xmpp_connect_hook().

◆ input()

static int input ( yyscan_t  yyscanner)
static

Definition at line 1570 of file ast_expr2f.c.

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

References ast_yyrestart(), ast_yywrap, c, EOB_ACT_CONTINUE_SCAN, EOB_ACT_END_OF_FILE, EOB_ACT_LAST_MATCH, input(), 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, yyg, and yyin.

Referenced by alloc_resampler(), ast_json_load_file(), ast_json_load_str(), ast_json_load_string(), ast_md5_hash(), ast_sha1_hash(), ast_sha1_hash_uint(), ast_sip_sanitize_xml(), ast_slinear_saturated_add(), ast_slinear_saturated_divide(), ast_slinear_saturated_divide_float(), ast_slinear_saturated_multiply(), ast_slinear_saturated_multiply_float(), ast_slinear_saturated_subtract(), AST_TEST_DEFINE(), ast_variable_list_from_quoted_string(), ast_variable_list_from_string(), ast_vector_string_split(), eivr_comm(), escape_and_substitute(), file2display(), get_user_input(), ham84_(), input(), readawaysamples(), strip_control_and_high(), and test_xml().

◆ isatty()

int isatty ( int  )

◆ while()

while ( )

Definition at line 880 of file ast_expr2f.c.

881 {
882 yyg->yy_more_len = 0;
883 if ( yyg->yy_more_flag )
884 {
885 yyg->yy_more_len = yyg->yy_c_buf_p - yyg->yytext_ptr;
886 yyg->yy_more_flag = 0;
887 }
889
890 /* Support of yytext. */
892
893 /* yy_bp points to the position in yy_ch_buf of the start of
894 * the current run.
895 */
896 yy_bp = yy_cp;
897
898 yy_current_state = yyg->yy_start;
899yy_match:
900 do
901 {
902 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
903 if ( yy_accept[yy_current_state] )
904 {
905 yyg->yy_last_accepting_state = yy_current_state;
907 }
908 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
909 {
910 yy_current_state = (int) yy_def[yy_current_state];
911 if ( yy_current_state >= 63 )
912 yy_c = yy_meta[(unsigned int) yy_c];
913 }
914 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
915 ++yy_cp;
916 }
917 while ( yy_current_state != 62 );
919 yy_current_state = yyg->yy_last_accepting_state;
920
921yy_find_action:
922 yy_act = yy_accept[yy_current_state];
923
925
926do_action: /* This label is used only to access EOF actions. */
927
928 switch ( yy_act )
929 { /* beginning of action switch */
930 case 0: /* must back up */
931 /* undo the effects of YY_DO_BEFORE_ACTION */
934 yy_current_state = yyg->yy_last_accepting_state;
935 goto yy_find_action;
936
937case 1:
939#line 130 "ast_expr2.fl"
940{ SET_COLUMNS; SET_STRING; return TOK_OR;}
942case 2:
944#line 131 "ast_expr2.fl"
945{ SET_COLUMNS; SET_STRING; return TOK_AND;}
947case 3:
949#line 132 "ast_expr2.fl"
950{ SET_COLUMNS; SET_STRING; return TOK_EQ;}
952case 4:
954#line 133 "ast_expr2.fl"
955{ SET_COLUMNS; SET_STRING; return TOK_OR;}
957case 5:
959#line 134 "ast_expr2.fl"
960{ SET_COLUMNS; SET_STRING; return TOK_AND;}
962case 6:
964#line 135 "ast_expr2.fl"
965{ SET_COLUMNS; SET_STRING; return TOK_EQ;}
967case 7:
969#line 136 "ast_expr2.fl"
972case 8:
974#line 137 "ast_expr2.fl"
977case 9:
979#line 138 "ast_expr2.fl"
980{ SET_COLUMNS; SET_STRING; return TOK_GT;}
982case 10:
984#line 139 "ast_expr2.fl"
985{ SET_COLUMNS; SET_STRING; return TOK_LT;}
987case 11:
989#line 140 "ast_expr2.fl"
990{ SET_COLUMNS; SET_STRING; return TOK_GE;}
992case 12:
994#line 141 "ast_expr2.fl"
995{ SET_COLUMNS; SET_STRING; return TOK_LE;}
997case 13:
999#line 142 "ast_expr2.fl"
1000{ SET_COLUMNS; SET_STRING; return TOK_NE;}
1001 YY_BREAK
1002case 14:
1004#line 143 "ast_expr2.fl"
1005{ SET_COLUMNS; SET_STRING; return TOK_PLUS;}
1006 YY_BREAK
1007case 15:
1009#line 144 "ast_expr2.fl"
1010{ SET_COLUMNS; SET_STRING; return TOK_COMMA;}
1011 YY_BREAK
1012case 16:
1014#line 145 "ast_expr2.fl"
1015{ SET_COLUMNS; SET_STRING; return TOK_MINUS;}
1016 YY_BREAK
1017case 17:
1019#line 146 "ast_expr2.fl"
1020{ SET_COLUMNS; SET_STRING; return TOK_MULT;}
1021 YY_BREAK
1022case 18:
1024#line 147 "ast_expr2.fl"
1025{ SET_COLUMNS; SET_STRING; return TOK_DIV;}
1026 YY_BREAK
1027case 19:
1029#line 148 "ast_expr2.fl"
1030{ SET_COLUMNS; SET_STRING; return TOK_MOD;}
1031 YY_BREAK
1032case 20:
1034#line 149 "ast_expr2.fl"
1035{ SET_COLUMNS; SET_STRING; return TOK_COND;}
1036 YY_BREAK
1037case 21:
1039#line 150 "ast_expr2.fl"
1040{ SET_COLUMNS; SET_STRING; return TOK_COMPL;}
1041 YY_BREAK
1042case 22:
1044#line 151 "ast_expr2.fl"
1045{ SET_COLUMNS; SET_STRING; return TOK_COLON;}
1046 YY_BREAK
1047case 23:
1049#line 152 "ast_expr2.fl"
1051 YY_BREAK
1052case 24:
1054#line 153 "ast_expr2.fl"
1055{ SET_COLUMNS; SET_STRING; return TOK_LP;}
1056 YY_BREAK
1057case 25:
1059#line 154 "ast_expr2.fl"
1060{ SET_COLUMNS; SET_STRING; return TOK_RP;}
1061 YY_BREAK
1062case 26:
1064#line 155 "ast_expr2.fl"
1065{
1066 /* gather the contents of ${} expressions, with trailing stuff,
1067 * into a single TOKEN.
1068 * They are much more complex now than they used to be
1069 */
1070 curlycount = 0;
1071 BEGIN(var);
1072 yymore();
1073 }
1074 YY_BREAK
1075case 27:
1077#line 165 "ast_expr2.fl"
1078{}
1079 YY_BREAK
1080case 28:
1081/* rule 28 can match eol */
1083#line 166 "ast_expr2.fl"
1084{SET_COLUMNS; SET_STRING; return TOKEN;}
1085 YY_BREAK
1086case 29:
1087/* rule 29 can match eol */
1089#line 168 "ast_expr2.fl"
1090{/* what to do with eol */}
1091 YY_BREAK
1092case 30:
1094#line 169 "ast_expr2.fl"
1095{
1097 /* the original behavior of the expression parser was
1098 * to bring in numbers as a numeric string
1099 */
1101 return TOKEN;
1102 }
1103 YY_BREAK
1104case 31:
1105/* rule 31 can match eol */
1107#line 178 "ast_expr2.fl"
1108{
1110 SET_STRING;
1111 return TOKEN;
1112 }
1113 YY_BREAK
1114case 32:
1115/* rule 32 can match eol */
1117#line 184 "ast_expr2.fl"
1118{
1119 curlycount = 0;
1120 BEGIN(var);
1121 yymore();
1122 }
1123 YY_BREAK
1124case 33:
1125/* rule 33 can match eol */
1127#line 190 "ast_expr2.fl"
1128{
1129 curlycount--;
1130 if (curlycount < 0) {
1131 BEGIN(trail);
1132 yymore();
1133 } else {
1134 yymore();
1135 }
1136 }
1137 YY_BREAK
1138case 34:
1139/* rule 34 can match eol */
1141#line 200 "ast_expr2.fl"
1142{
1143 curlycount++;
1144 yymore();
1145 }
1146 YY_BREAK
1147case 35:
1149#line 206 "ast_expr2.fl"
1150{
1151 BEGIN(0);
1153 SET_STRING;
1154 return TOKEN;
1155 }
1156 YY_BREAK
1157case 36:
1159#line 213 "ast_expr2.fl"
1160{
1161 curlycount = 0;
1162 BEGIN(var);
1163 yymore();
1164 }
1165 YY_BREAK
1166case 37:
1167/* rule 37 can match eol */
1169#line 219 "ast_expr2.fl"
1170{
1171 char c = yytext[yyleng-1];
1172 BEGIN(0);
1173 unput(c);
1175 SET_STRING;
1176 return TOKEN;
1177 }
1178 YY_BREAK
1179case YY_STATE_EOF(trail):
1180#line 228 "ast_expr2.fl"
1181{
1182 BEGIN(0);
1184 SET_STRING;
1185 return TOKEN;
1186 /*actually, if an expr is only a variable ref, this could happen a LOT */
1187 }
1188 YY_BREAK
1189case 38:
1191#line 236 "ast_expr2.fl"
1192ECHO;
1193 YY_BREAK
1194#line 1192 "ast_expr2f.c"
1195case YY_STATE_EOF(INITIAL):
1196case YY_STATE_EOF(var):
1197 yyterminate();
1198
1199 case YY_END_OF_BUFFER:
1200 {
1201 /* Amount of text matched not including the EOB char. */
1202 int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1;
1203
1204 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1207
1208 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1209 {
1210 /* We're scanning a new file or input source. It's
1211 * possible that this happened because the user
1212 * just pointed yyin at a new source and called
1213 * ast_yylex(). If so, then we have to assure
1214 * consistency between YY_CURRENT_BUFFER and our
1215 * globals. Here is the right place to do so, because
1216 * this is the first action (other than possibly a
1217 * back-up) that will match for the new input source.
1218 */
1220 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
1221 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1222 }
1223
1224 /* Note that here we test for yy_c_buf_p "<=" to the position
1225 * of the first EOB in the buffer, since yy_c_buf_p will
1226 * already have been incremented past the NUL character
1227 * (since all states make transitions on EOB to the
1228 * end-of-buffer state). Contrast this with the test
1229 * in input().
1230 */
1231 if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
1232 { /* This was really a NUL. */
1233 yy_state_type yy_next_state;
1234
1235 yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text;
1236
1237 yy_current_state = yy_get_previous_state( yyscanner );
1238
1239 /* Okay, we're now positioned to make the NUL
1240 * transition. We couldn't have
1241 * yy_get_previous_state() go ahead and do it
1242 * for us because it doesn't know how to deal
1243 * with the possibility of jamming (and we don't
1244 * want to build jamming into it because then it
1245 * will run more slowly).
1246 */
1247
1248 yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner);
1249
1250 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1251
1252 if ( yy_next_state )
1253 {
1254 /* Consume the NUL. */
1255 yy_cp = ++yyg->yy_c_buf_p;
1256 yy_current_state = yy_next_state;
1257 goto yy_match;
1258 }
1259
1260 else
1261 {
1263 yy_current_state = yyg->yy_last_accepting_state;
1264 goto yy_find_action;
1265 }
1266 }
1267
1268 else switch ( yy_get_next_buffer( yyscanner ) )
1269 {
1271 {
1273
1274 if ( ast_yywrap(yyscanner ) )
1275 {
1276 /* Note: because we've taken care in
1277 * yy_get_next_buffer() to have set up
1278 * yytext, we can now set up
1279 * yy_c_buf_p so that if some total
1280 * hoser (like flex itself) wants to
1281 * call the scanner after we return the
1282 * YY_NULL, it'll still work - another
1283 * YY_NULL will get returned.
1284 */
1285 yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ;
1286
1288 goto do_action;
1289 }
1290
1291 else
1292 {
1295 }
1296 break;
1297 }
1298
1300 yyg->yy_c_buf_p =
1301 yyg->yytext_ptr + yy_amount_of_matched_text;
1302
1303 yy_current_state = yy_get_previous_state( yyscanner );
1304
1305 yy_cp = yyg->yy_c_buf_p;
1306 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1307 goto yy_match;
1308
1309 case EOB_ACT_LAST_MATCH:
1310 yyg->yy_c_buf_p =
1312
1313 yy_current_state = yy_get_previous_state( yyscanner );
1314
1315 yy_cp = yyg->yy_c_buf_p;
1316 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1317 goto yy_find_action;
1318 }
1319 break;
1320 }
1321
1322 default:
1324 "fatal flex scanner internal error--no action found" );
1325 } /* end of action switch */
1326 } /* end of scanning one token */
@ TOK_COLONCOLON
Definition: ast_expr2.c:444
@ TOK_TILDETILDE
Definition: ast_expr2.c:460
@ TOK_EQTILDE
Definition: ast_expr2.c:461
@ TOKEN
Definition: ast_expr2.c:465
@ TOK_LE
Definition: ast_expr2.c:449
@ TOK_COLON
Definition: ast_expr2.c:462
@ TOK_GT
Definition: ast_expr2.c:452
@ TOK_PLUS
Definition: ast_expr2.c:455
@ TOK_NE
Definition: ast_expr2.c:448
@ TOK_EQ
Definition: ast_expr2.c:453
@ TOK_LP
Definition: ast_expr2.c:463
@ TOK_COMMA
Definition: ast_expr2.c:443
@ TOK_DIV
Definition: ast_expr2.c:457
@ TOK_GE
Definition: ast_expr2.c:450
@ TOK_OR
Definition: ast_expr2.c:446
@ TOK_LT
Definition: ast_expr2.c:451
@ TOK_COND
Definition: ast_expr2.c:445
@ TOK_COMPL
Definition: ast_expr2.c:459
@ TOK_MINUS
Definition: ast_expr2.c:454
@ TOK_AND
Definition: ast_expr2.c:447
@ TOK_RP
Definition: ast_expr2.c:464
@ TOK_MOD
Definition: ast_expr2.c:456
@ TOK_MULT
Definition: ast_expr2.c:458
#define var
Definition: ast_expr2f.c:605
unsigned char YY_CHAR
Definition: ast_expr2f.c:334
#define trail
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:1504
#define SET_COLUMNS
Definition: ast_expr2f.c:571
static yyconst flex_int32_t yy_meta[29]
Definition: ast_expr2f.c:408
#define YY_BREAK
Definition: ast_expr2f.c:830
#define unput(c)
Definition: ast_expr2f.c:196
#define YY_RESTORE_YY_MORE_OFFSET
Definition: ast_expr2f.c:485
#define YY_BUFFER_NORMAL
Definition: ast_expr2f.c:252
static yyconst flex_int16_t yy_chk[159]
Definition: ast_expr2f.c:458
static yyconst flex_int16_t yy_base[70]
Definition: ast_expr2f.c:415
#define YY_MORE_ADJ
Definition: ast_expr2f.c:484
#define YY_RULE_SETUP
Definition: ast_expr2f.c:833
#define SET_STRING
Definition: ast_expr2f.c:577
register char * yy_bp
Definition: ast_expr2f.c:841
#define yymore()
Definition: ast_expr2f.c:483
static int curlycount
Definition: ast_expr2f.c:599
static yyconst flex_int16_t yy_def[70]
Definition: ast_expr2f.c:426
register int yy_act
Definition: ast_expr2f.c:842
#define YY_START
Definition: ast_expr2f.c:151
int yy_state_type
Definition: ast_expr2f.c:336
#define SET_NUMERIC_STRING
Definition: ast_expr2f.c:583
static yyconst flex_int16_t yy_nxt[159]
Definition: ast_expr2f.c:437
#define INITIAL
Definition: ast_expr2f.c:604
static yyconst flex_int16_t yy_accept[63]
Definition: ast_expr2f.c:365
#define ECHO
Definition: ast_expr2f.c:554
#define YY_END_OF_BUFFER
Definition: ast_expr2f.c:357
#define YY_STATE_EOF(state)
Definition: ast_expr2f.c:155
#define BEGIN
Definition: ast_expr2f.c:145
register char * yy_cp
Definition: ast_expr2f.c:841
#define yyterminate()
Definition: ast_expr2f.c:793
static yyconst flex_int32_t yy_ec[256]
Definition: ast_expr2f.c:376
#define YY_DO_BEFORE_ACTION
Definition: ast_expr2f.c:348
static yy_state_type yy_get_previous_state(yyscan_t yyscanner)
Definition: ast_expr2f.c:1471
#define YY_SC_TO_UI(c)
Definition: ast_expr2f.c:122
yy_state_type yy_last_accepting_state
Definition: ast_expr2f.c:642
int yy_more_len
Definition: ast_expr2f.c:650
int yy_more_flag
Definition: ast_expr2f.c:649
char * yy_last_accepting_cpos
Definition: ast_expr2f.c:643

References ast_yywrap, BEGIN, c, curlycount, 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_act, yy_base, yy_bp, 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(), yyg, yyin, yyleng, yymore, yyterminate, and yytext.

Referenced by __addel(), __big_delete(), __big_return(), ast_sip_pubsub_has_eventlist_support(), find_challenge(), read_packet(), subscription_get_generator_from_rdata(), timesub(), and tzload().

◆ yy_fatal_error() [1/2]

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

Definition at line 2007 of file ast_expr2f.c.

2008{
2009 (void) fprintf( stderr, "%s\n", msg );
2010 exit( YY_EXIT_FAILURE );
2011}
#define YY_EXIT_FAILURE
Definition: ast_expr2f.c:2004

References YY_EXIT_FAILURE.

◆ yy_fatal_error() [2/2]

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

◆ yy_get_next_buffer()

static int yy_get_next_buffer ( yyscan_t  yyscanner)
static

Definition at line 1336 of file ast_expr2f.c.

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

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

Referenced by input(), and while().

◆ yy_get_previous_state()

static yy_state_type yy_get_previous_state ( yyscan_t  yyscanner)
static

Definition at line 1471 of file ast_expr2f.c.

1472{
1473 register yy_state_type yy_current_state;
1474 register char *yy_cp;
1475 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1476
1477 yy_current_state = yyg->yy_start;
1478
1479 for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp )
1480 {
1481 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1482 if ( yy_accept[yy_current_state] )
1483 {
1484 yyg->yy_last_accepting_state = yy_current_state;
1486 }
1487 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1488 {
1489 yy_current_state = (int) yy_def[yy_current_state];
1490 if ( yy_current_state >= 63 )
1491 yy_c = yy_meta[(unsigned int) yy_c];
1492 }
1493 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1494 }
1495
1496 return yy_current_state;
1497}

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, yyguts_t::yy_start, and yyg.

Referenced by while().

◆ yy_init_globals()

static int yy_init_globals ( yyscan_t  yyscanner)
static

Definition at line 2264 of file ast_expr2f.c.

2265{
2266 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2267 /* Initialization is the same as for the non-reentrant scanner.
2268 * This function is called from ast_yylex_destroy(), so don't allocate here.
2269 */
2270
2271 yyg->yy_buffer_stack = 0;
2274 yyg->yy_c_buf_p = (char *) 0;
2275 yyg->yy_init = 0;
2276 yyg->yy_start = 0;
2277
2281
2282/* Defined in main.c */
2283#ifdef YY_STDINIT
2284 yyin = stdin;
2285 yyout = stdout;
2286#else
2287 yyin = (FILE *) 0;
2288 yyout = (FILE *) 0;
2289#endif
2290
2291 /* For future reference: Set errno on error, since we are called by
2292 * ast_yylex_init()
2293 */
2294 return 0;
2295}
int yy_start_stack_ptr
Definition: ast_expr2f.c:639
int yy_start_stack_depth
Definition: ast_expr2f.c:640

References NULL, 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, yyg, yyin, and yyout.

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

◆ yy_try_NUL_trans()

static yy_state_type yy_try_NUL_trans ( yy_state_type  current_state,
yyscan_t  yyscanner 
)
static

Definition at line 1504 of file ast_expr2f.c.

1505{
1506 register int yy_is_jam;
1507 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */
1508 register char *yy_cp = yyg->yy_c_buf_p;
1509
1510 register YY_CHAR yy_c = 1;
1511 if ( yy_accept[yy_current_state] )
1512 {
1513 yyg->yy_last_accepting_state = yy_current_state;
1515 }
1516 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1517 {
1518 yy_current_state = (int) yy_def[yy_current_state];
1519 if ( yy_current_state >= 63 )
1520 yy_c = yy_meta[(unsigned int) yy_c];
1521 }
1522 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1523 yy_is_jam = (yy_current_state == 62);
1524
1525 return yy_is_jam ? 0 : yy_current_state;
1526}

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, yy_nxt, and yyg.

Referenced by while().

◆ yyunput() [1/2]

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

◆ yyunput() [2/2]

static void yyunput ( int  c,
register char *  yy_bp,
yyscan_t  yyscanner 
)
static

Definition at line 1528 of file ast_expr2f.c.

1529{
1530 register char *yy_cp;
1531 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1532
1533 yy_cp = yyg->yy_c_buf_p;
1534
1535 /* undo effects of setting up yytext */
1537
1538 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1539 { /* need to shift things up to make room */
1540 /* +2 for EOB chars. */
1541 register int number_to_move = yyg->yy_n_chars + 2;
1542 register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
1543 YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
1544 register char *source =
1545 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
1546
1547 while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1548 *--dest = *--source;
1549
1550 yy_cp += (int) (dest - source);
1551 yy_bp += (int) (dest - source);
1552 YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
1553 yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
1554
1555 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1556 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1557 }
1558
1559 *--yy_cp = (char) c;
1560
1561 yyg->yytext_ptr = yy_bp;
1563 yyg->yy_c_buf_p = yy_cp;
1564}

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

Variable Documentation

◆ curlycount

int curlycount = 0
static

Definition at line 599 of file ast_expr2f.c.

Referenced by while().

◆ expr2_token_equivs1

const char* const expr2_token_equivs1[]
static

Definition at line 2475 of file ast_expr2f.c.

Referenced by expr2_token_subst().

◆ expr2_token_equivs2

const char* const expr2_token_equivs2[]
static

Definition at line 2501 of file ast_expr2f.c.

Referenced by expr2_token_subst().

◆ extra_error_message

char extra_error_message[4095]

◆ extra_error_message_supplied

int extra_error_message_supplied = 0

◆ yy_accept

yyconst flex_int16_t yy_accept[63]
static

Definition at line 365 of file ast_expr2f.c.

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

◆ yy_act

register int yy_act

Definition at line 842 of file ast_expr2f.c.

Referenced by while().

◆ yy_base

yyconst flex_int16_t yy_base[70]
static

Definition at line 415 of file ast_expr2f.c.

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

◆ yy_bp

register char * yy_bp

Definition at line 841 of file ast_expr2f.c.

Referenced by while(), and yyunput().

◆ yy_chk

yyconst flex_int16_t yy_chk[159]
static

Definition at line 458 of file ast_expr2f.c.

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

◆ yy_cp

register char* yy_cp

Definition at line 841 of file ast_expr2f.c.

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

◆ YY_DECL

YY_DECL
Initial value:
{
register yy_state_type yy_current_state

The main scanner function which does all the work.

Definition at line 838 of file ast_expr2f.c.

◆ yy_def

yyconst flex_int16_t yy_def[70]
static

Definition at line 426 of file ast_expr2f.c.

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

◆ yy_ec

yyconst flex_int32_t yy_ec[256]
static

Definition at line 376 of file ast_expr2f.c.

Referenced by while(), and yy_get_previous_state().

◆ yy_meta

yyconst flex_int32_t yy_meta[29]
static

Definition at line 408 of file ast_expr2f.c.

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

◆ yy_nxt

yyconst flex_int16_t yy_nxt[159]
static

Definition at line 437 of file ast_expr2f.c.

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

◆ yyg

struct yyguts_t* yyg = (struct yyguts_t*)yyscanner

◆ yylloc

yylloc = yylloc_param

Definition at line 852 of file ast_expr2f.c.

◆ yylval

yylval = yylval_param

Definition at line 850 of file ast_expr2f.c.