Asterisk - The Open Source Telephony Project GIT-master-67613d1
ast_expr2f.c
Go to the documentation of this file.
1#define ASTMM_LIBC ASTMM_REDIRECT
2#include "asterisk.h"
3
4#line 2 "ast_expr2f.c"
5
6#line 4 "ast_expr2f.c"
7
8#define YY_INT_ALIGNED short int
9
10/* A lexical scanner generated by flex */
11
12#define FLEX_SCANNER
13#define YY_FLEX_MAJOR_VERSION 2
14#define YY_FLEX_MINOR_VERSION 5
15#define YY_FLEX_SUBMINOR_VERSION 35
16#if YY_FLEX_SUBMINOR_VERSION > 0
17#define FLEX_BETA
18#endif
19
20/* First, we deal with platform-specific or compiler-specific issues. */
21
22/* begin standard C headers. */
23#include <stdio.h>
24#include <string.h>
25#include <errno.h>
26#include <stdlib.h>
27
28/* end standard C headers. */
29
30/* flex integer type definitions */
31
32#ifndef FLEXINT_H
33#define FLEXINT_H
34
35/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
36
37#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
38
39/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
40 * if you want the limit (max/min) macros for int types.
41 */
42#ifndef __STDC_LIMIT_MACROS
43#define __STDC_LIMIT_MACROS 1
44#endif
45
46#include <inttypes.h>
47typedef int8_t flex_int8_t;
48typedef uint8_t flex_uint8_t;
49typedef int16_t flex_int16_t;
50typedef uint16_t flex_uint16_t;
51typedef int32_t flex_int32_t;
52typedef uint32_t flex_uint32_t;
53#else
54typedef signed char flex_int8_t;
55typedef short int flex_int16_t;
56typedef int flex_int32_t;
57typedef unsigned char flex_uint8_t;
58typedef unsigned short int flex_uint16_t;
59typedef unsigned int flex_uint32_t;
60#endif /* ! C99 */
61
62/* Limits of integral types. */
63#ifndef INT8_MIN
64#define INT8_MIN (-128)
65#endif
66#ifndef INT16_MIN
67#define INT16_MIN (-32767-1)
68#endif
69#ifndef INT32_MIN
70#define INT32_MIN (-2147483647-1)
71#endif
72#ifndef INT8_MAX
73#define INT8_MAX (127)
74#endif
75#ifndef INT16_MAX
76#define INT16_MAX (32767)
77#endif
78#ifndef INT32_MAX
79#define INT32_MAX (2147483647)
80#endif
81#ifndef UINT8_MAX
82#define UINT8_MAX (255U)
83#endif
84#ifndef UINT16_MAX
85#define UINT16_MAX (65535U)
86#endif
87#ifndef UINT32_MAX
88#define UINT32_MAX (4294967295U)
89#endif
90
91#endif /* ! FLEXINT_H */
92
93#ifdef __cplusplus
94
95/* The "const" storage-class-modifier is valid. */
96#define YY_USE_CONST
97
98#else /* ! __cplusplus */
99
100/* C99 requires __STDC__ to be defined as 1. */
101#if defined (__STDC__)
102
103#define YY_USE_CONST
104
105#endif /* defined (__STDC__) */
106#endif /* ! __cplusplus */
107
108#ifdef YY_USE_CONST
109#define yyconst const
110#else
111#define yyconst
112#endif
113
114/* Returned upon end-of-file. */
115#define YY_NULL 0
116
117/* Promotes a possibly negative, possibly signed char to an unsigned
118 * integer for use as an array index. If the signed char is negative,
119 * we want to instead treat it as an 8-bit unsigned char, hence the
120 * double cast.
121 */
122#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
123
124/* An opaque pointer. */
125#ifndef YY_TYPEDEF_YY_SCANNER_T
126#define YY_TYPEDEF_YY_SCANNER_T
127typedef void* yyscan_t;
128#endif
129
130/* For convenience, these vars (plus the bison vars far below)
131 are macros in the reentrant scanner. */
132#define yyin yyg->yyin_r
133#define yyout yyg->yyout_r
134#define yyextra yyg->yyextra_r
135#define yyleng yyg->yyleng_r
136#define yytext yyg->yytext_r
137#define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)
138#define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
139#define yy_flex_debug yyg->yy_flex_debug_r
140
141/* Enter a start condition. This macro really ought to take a parameter,
142 * but we do it the disgusting crufty way forced on us by the ()-less
143 * definition of BEGIN.
144 */
145#define BEGIN yyg->yy_start = 1 + 2 *
146
147/* Translate the current start state into a value that can be later handed
148 * to BEGIN to return to the state. The YYSTATE alias is for lex
149 * compatibility.
150 */
151#define YY_START ((yyg->yy_start - 1) / 2)
152#define YYSTATE YY_START
153
154/* Action number for EOF rule of a given start state. */
155#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
156
157/* Special action meaning "start processing a new file". */
158#define YY_NEW_FILE ast_yyrestart(yyin ,yyscanner )
159
160#define YY_END_OF_BUFFER_CHAR 0
161
162/* Size of default input buffer. */
163#ifndef YY_BUF_SIZE
164#define YY_BUF_SIZE 16384
165#endif
166
167/* The state buf must be large enough to hold one state per character in the main buffer.
168 */
169#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
170
171#ifndef YY_TYPEDEF_YY_BUFFER_STATE
172#define YY_TYPEDEF_YY_BUFFER_STATE
174#endif
175
176#define EOB_ACT_CONTINUE_SCAN 0
177#define EOB_ACT_END_OF_FILE 1
178#define EOB_ACT_LAST_MATCH 2
179
180 #define YY_LESS_LINENO(n)
181
182/* Return all but the first "n" matched characters back to the input stream. */
183#define yyless(n) \
184 do \
185 { \
186 /* Undo effects of setting up yytext. */ \
187 int yyless_macro_arg = (n); \
188 YY_LESS_LINENO(yyless_macro_arg);\
189 *yy_cp = yyg->yy_hold_char; \
190 YY_RESTORE_YY_MORE_OFFSET \
191 yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
192 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
193 } \
194 while ( 0 )
195
196#define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
197
198#ifndef YY_TYPEDEF_YY_SIZE_T
199#define YY_TYPEDEF_YY_SIZE_T
200typedef size_t yy_size_t;
201#endif
202
203#ifndef YY_STRUCT_YY_BUFFER_STATE
204#define YY_STRUCT_YY_BUFFER_STATE
206 {
208
209 char *yy_ch_buf; /* input buffer */
210 char *yy_buf_pos; /* current position in input buffer */
211
212 /* Size of input buffer in bytes, not including room for EOB
213 * characters.
214 */
216
217 /* Number of characters read into yy_ch_buf, not including EOB
218 * characters.
219 */
221
222 /* Whether we "own" the buffer - i.e., we know we created it,
223 * and can realloc() it to grow it, and should free() it to
224 * delete it.
225 */
227
228 /* Whether this is an "interactive" input source; if so, and
229 * if we're using stdio for input, then we want to use getc()
230 * instead of fread(), to make sure we stop fetching input after
231 * each newline.
232 */
234
235 /* Whether we're considered to be at the beginning of a line.
236 * If so, '^' rules will be active on the next match, otherwise
237 * not.
238 */
240
241 int yy_bs_lineno; /**< The line count. */
242 int yy_bs_column; /**< The column count. */
243
244 /* Whether to try to fill the input buffer when we reach the
245 * end of it.
246 */
248
250
251#define YY_BUFFER_NEW 0
252#define YY_BUFFER_NORMAL 1
253 /* When an EOF's been seen but there's still some text to process
254 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
255 * shouldn't try reading from the input source any more. We might
256 * still have a bunch of tokens to match, though, because of
257 * possible backing-up.
258 *
259 * When we actually see the EOF, we change the status to "new"
260 * (via ast_yyrestart()), so that the user can continue scanning by
261 * just pointing yyin at a new input file.
262 */
263#define YY_BUFFER_EOF_PENDING 2
264
265 };
266#endif /* !YY_STRUCT_YY_BUFFER_STATE */
267
268/* We provide macros for accessing buffer states in case in the
269 * future we want to put the buffer states in a more general
270 * "scanner state".
271 *
272 * Returns the top of the stack, or NULL.
273 */
274#define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \
275 ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \
276 : NULL)
277
278/* Same as previous macro, but useful when we know that the buffer stack is not
279 * NULL or when we need an lvalue. For internal use only.
280 */
281#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]
282
283void ast_yyrestart (FILE *input_file ,yyscan_t yyscanner );
284void ast_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
285YY_BUFFER_STATE ast_yy_create_buffer (FILE *file,int size ,yyscan_t yyscanner );
288void ast_yypush_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
289void ast_yypop_buffer_state (yyscan_t yyscanner );
290
291static void ast_yyensure_buffer_stack (yyscan_t yyscanner );
292static void ast_yy_load_buffer_state (yyscan_t yyscanner );
293static void ast_yy_init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner );
294
295#define YY_FLUSH_BUFFER ast_yy_flush_buffer(YY_CURRENT_BUFFER ,yyscanner)
296
297YY_BUFFER_STATE ast_yy_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner );
298YY_BUFFER_STATE ast_yy_scan_string (yyconst char *yy_str ,yyscan_t yyscanner );
299YY_BUFFER_STATE ast_yy_scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner );
300
301void *ast_yyalloc (yy_size_t ,yyscan_t yyscanner );
302void *ast_yyrealloc (void *,yy_size_t ,yyscan_t yyscanner );
303void ast_yyfree (void * ,yyscan_t yyscanner );
304
305#define yy_new_buffer ast_yy_create_buffer
306
307#define yy_set_interactive(is_interactive) \
308 { \
309 if ( ! YY_CURRENT_BUFFER ){ \
310 ast_yyensure_buffer_stack (yyscanner); \
311 YY_CURRENT_BUFFER_LVALUE = \
312 ast_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
313 } \
314 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
315 }
316
317#define yy_set_bol(at_bol) \
318 { \
319 if ( ! YY_CURRENT_BUFFER ){\
320 ast_yyensure_buffer_stack (yyscanner); \
321 YY_CURRENT_BUFFER_LVALUE = \
322 ast_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
323 } \
324 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
325 }
326
327#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
328
329/* Begin user sect3 */
330
331#define ast_yywrap(n) 1
332#define YY_SKIP_YYWRAP
333
334typedef unsigned char YY_CHAR;
335
336typedef int yy_state_type;
337
338#define yytext_ptr yytext_r
339
341static yy_state_type yy_try_NUL_trans (yy_state_type current_state ,yyscan_t yyscanner);
342static int yy_get_next_buffer (yyscan_t yyscanner );
343static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner );
344
345/* Done after the current pattern has been matched and before the
346 * corresponding action - sets up yytext.
347 */
348#define YY_DO_BEFORE_ACTION \
349 yyg->yytext_ptr = yy_bp; \
350 yyg->yytext_ptr -= yyg->yy_more_len; \
351 yyleng = (size_t) (yy_cp - yyg->yytext_ptr); \
352 yyg->yy_hold_char = *yy_cp; \
353 *yy_cp = '\0'; \
354 yyg->yy_c_buf_p = yy_cp;
355
356#define YY_NUM_RULES 38
357#define YY_END_OF_BUFFER 39
358/* This struct is not used in this scanner,
359 but its presence is necessary. */
361 {
364 };
366 { 0,
367 0, 0, 0, 0, 35, 35, 39, 38, 27, 29,
368 21, 38, 31, 38, 19, 2, 24, 25, 17, 14,
369 15, 16, 18, 30, 22, 10, 3, 9, 20, 1,
370 38, 38, 34, 33, 35, 37, 37, 13, 0, 28,
371 31, 0, 26, 5, 31, 30, 23, 12, 6, 7,
372 11, 4, 8, 0, 34, 33, 35, 0, 36, 32,
373 30, 0
374 } ;
375
377 { 0,
378 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
379 1, 1, 2, 1, 1, 1, 1, 1, 1, 1,
380 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
381 1, 2, 4, 5, 6, 7, 8, 9, 6, 10,
382 11, 12, 13, 14, 15, 16, 17, 18, 18, 18,
383 18, 18, 18, 18, 18, 18, 18, 19, 6, 20,
384 21, 22, 23, 6, 6, 6, 6, 6, 6, 6,
385 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
386 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
387 1, 6, 1, 6, 6, 1, 6, 6, 6, 6,
388
389 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
390 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
391 6, 6, 24, 25, 26, 27, 1, 28, 28, 28,
392 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
393 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
394 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
395 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
396 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
397 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
398 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
399
400 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
401 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
402 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
403 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
404 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
405 28, 28, 28, 28, 28
406 } ;
407
409 { 0,
410 1, 2, 2, 2, 1, 3, 3, 2, 2, 2,
411 2, 2, 2, 1, 2, 3, 2, 3, 2, 2,
412 2, 2, 2, 1, 2, 1, 1, 3
413 } ;
414
416 { 0,
417 0, 0, 5, 6, 32, 60, 73, 130, 130, 130,
418 51, 66, 63, 45, 130, 59, 130, 130, 130, 130,
419 130, 130, 130, 83, 45, 42, 13, 41, 130, 32,
420 28, 17, 130, 130, 47, 130, 29, 130, 47, 130,
421 44, 25, 130, 130, 29, 0, 130, 130, 130, 130,
422 130, 130, 130, 18, 130, 130, 38, 12, 130, 130,
423 0, 130, 111, 114, 117, 32, 120, 123, 126
424 } ;
425
427 { 0,
428 62, 1, 63, 63, 64, 64, 62, 62, 62, 62,
429 62, 65, 66, 67, 62, 62, 62, 62, 62, 62,
430 62, 62, 62, 62, 62, 62, 62, 62, 62, 62,
431 62, 68, 62, 62, 69, 62, 62, 62, 65, 62,
432 66, 67, 62, 62, 41, 24, 62, 62, 62, 62,
433 62, 62, 62, 68, 62, 62, 69, 62, 62, 62,
434 45, 0, 62, 62, 62, 62, 62, 62, 62
435 } ;
436
438 { 0,
439 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
440 18, 19, 20, 21, 22, 13, 23, 24, 25, 26,
441 27, 28, 29, 8, 30, 8, 31, 13, 33, 33,
442 34, 34, 35, 49, 41, 59, 35, 35, 37, 50,
443 55, 55, 56, 56, 58, 35, 61, 35, 60, 35,
444 42, 40, 59, 58, 53, 35, 52, 35, 35, 35,
445 35, 51, 48, 47, 35, 35, 37, 44, 43, 42,
446 40, 38, 62, 35, 62, 35, 62, 35, 62, 62,
447 62, 62, 62, 35, 62, 35, 35, 35, 41, 42,
448 62, 62, 62, 62, 62, 62, 62, 62, 45, 62,
449
450 46, 62, 62, 62, 62, 62, 62, 62, 62, 62,
451 41, 32, 32, 32, 36, 36, 36, 39, 39, 39,
452 41, 41, 41, 54, 54, 54, 57, 62, 57, 7,
453 62, 62, 62, 62, 62, 62, 62, 62, 62, 62,
454 62, 62, 62, 62, 62, 62, 62, 62, 62, 62,
455 62, 62, 62, 62, 62, 62, 62, 62
456 } ;
457
459 { 0,
460 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
461 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
462 1, 1, 1, 1, 1, 1, 1, 1, 3, 4,
463 3, 4, 5, 27, 66, 58, 5, 5, 5, 27,
464 32, 54, 32, 54, 57, 5, 45, 5, 42, 5,
465 41, 39, 37, 35, 31, 5, 30, 5, 5, 5,
466 6, 28, 26, 25, 6, 6, 6, 16, 14, 13,
467 12, 11, 7, 6, 0, 6, 0, 6, 0, 0,
468 0, 0, 0, 6, 0, 6, 6, 6, 24, 24,
469 0, 0, 0, 0, 0, 0, 0, 0, 24, 0,
470
471 24, 0, 0, 0, 0, 0, 0, 0, 0, 0,
472 24, 63, 63, 63, 64, 64, 64, 65, 65, 65,
473 67, 67, 67, 68, 68, 68, 69, 0, 69, 62,
474 62, 62, 62, 62, 62, 62, 62, 62, 62, 62,
475 62, 62, 62, 62, 62, 62, 62, 62, 62, 62,
476 62, 62, 62, 62, 62, 62, 62, 62
477 } ;
478
479/* The intent behind this definition is that it'll catch
480 * any uses of REJECT which flex missed.
481 */
482#define REJECT reject_used_but_not_detected
483#define yymore() (yyg->yy_more_flag = 1)
484#define YY_MORE_ADJ yyg->yy_more_len
485#define YY_RESTORE_YY_MORE_OFFSET
486#line 1 "ast_expr2.fl"
487#line 2 "ast_expr2.fl"
488/*
489 * Asterisk -- An open source telephony toolkit.
490 *
491 * Copyright (C) 1999 - 2006, Digium, Inc.
492 *
493 * Mark Spencer <markster@digium.com>
494 *
495 * See http://www.asterisk.org for more information about
496 * the Asterisk project. Please do not directly contact
497 * any of the maintainers of this project for assistance;
498 * the project provides a web site, mailing lists and IRC
499 * channels for your use.
500 *
501 * This program is free software, distributed under the terms of
502 * the GNU General Public License Version 2. See the LICENSE file
503 * at the top of the source tree.
504 */
505
506/*! \file
507 *
508 * \brief Dialplan Expression Lexical Scanner
509 */
510
511#include <sys/types.h>
512#include <stdio.h>
513
514#if defined(STANDALONE)
515#ifndef __USE_ISOC99
516#define __USE_ISOC99 1
517#endif
518#endif
519
520#ifdef __USE_ISOC99
521#define FP___PRINTF "%.18Lg"
522#define FP___FMOD fmodl
523#define FP___STRTOD strtold
524#define FP___TYPE long double
525#else
526#define FP___PRINTF "%.16g"
527#define FP___FMOD fmod
528#define FP___STRTOD strtod
529#define FP___TYPE double
530#endif
531
532#include <stdlib.h>
533#include <string.h>
534#include <locale.h>
535#include <ctype.h>
536#if !defined(SOLARIS) && !defined(__CYGWIN__)
537/* #include <err.h> */
538#else
539#define quad_t int64_t
540#endif
541#include <errno.h>
542#include <regex.h>
543#include <limits.h>
544
545#include "asterisk/ast_expr.h"
546#include "asterisk/logger.h"
547#ifndef STANDALONE
548#include "asterisk/strings.h"
549#include "asterisk/channel.h"
550#endif
551
552/* Conditionally redefine the macro from flex 2.5.35, in case someone uses flex <2.5.35 to regenerate this file. */
553#ifndef ECHO
554#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
555#endif
556
559} ;
560
561struct val {
562 enum valtype type;
563 union {
564 char *s;
565 FP___TYPE i; /* long double or just double if it's a bad day */
566 } u;
567} ;
568
569#include "ast_expr2.h" /* the o/p of the bison on ast_expr2.y */
570
571#define SET_COLUMNS do { \
572 yylloc_param->first_column = (int)(yyg->yytext_r - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf); \
573 yylloc_param->last_column += yyleng - 1; \
574 yylloc_param->first_line = yylloc_param->last_line = 1; \
575 } while (0)
576
577#define SET_STRING do { \
578 yylval_param->val = calloc(1, sizeof(struct val)); \
579 yylval_param->val->type = AST_EXPR_string; \
580 yylval_param->val->u.s = strdup(yytext); \
581 } while (0)
582
583#define SET_NUMERIC_STRING do { \
584 yylval_param->val = calloc(1, sizeof(struct val)); \
585 yylval_param->val->type = AST_EXPR_numeric_string; \
586 yylval_param->val->u.s = strdup(yytext); \
587 } while (0)
588
589struct parse_io
590{
591 char *string;
592 struct val *val;
594 struct ast_channel *chan;
595};
596
597void ast_yyset_column(int column_no, yyscan_t yyscanner);
598int ast_yyget_column(yyscan_t yyscanner);
599static int curlycount = 0;
600static char *expr2_token_subst(const char *mess);
601
602#line 600 "ast_expr2f.c"
603
604#define INITIAL 0
605#define var 1
606#define trail 2
607
608#ifndef YY_NO_UNISTD_H
609/* Special case for "unistd.h", since it is non-ANSI. We include it way
610 * down here because we want the user's section 1 to have been scanned first.
611 * The user has a chance to override it with an option.
612 */
613#include <unistd.h>
614#endif
615
616#ifndef YY_EXTRA_TYPE
617#define YY_EXTRA_TYPE void *
618#endif
619
620/* Holds the entire state of the reentrant scanner. */
622 {
623
624 /* User-defined. Not touched by flex. */
626
627 /* The rest are the same as the globals declared in the non-reentrant scanner. */
629 size_t yy_buffer_stack_top; /**< index of top of stack. */
630 size_t yy_buffer_stack_max; /**< capacity of stack. */
631 YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */
644
647
648 char *yytext_r;
651
653
655
656 }; /* end struct yyguts_t */
657
658static int yy_init_globals (yyscan_t yyscanner );
659
660 /* This must go here because YYSTYPE and YYLTYPE are included
661 * from bison output in section 1.*/
662 # define yylval yyg->yylval_r
663
664 # define yylloc yyg->yylloc_r
665
666int ast_yylex_init (yyscan_t* scanner);
667
668int ast_yylex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner);
669
670/* Accessor methods to globals.
671 These are made visible to non-reentrant scanners for convenience. */
672
673int ast_yylex_destroy (yyscan_t yyscanner );
674
675int ast_yyget_debug (yyscan_t yyscanner );
676
677void ast_yyset_debug (int debug_flag ,yyscan_t yyscanner );
678
680
681void ast_yyset_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner );
682
683FILE *ast_yyget_in (yyscan_t yyscanner );
684
685void ast_yyset_in (FILE * in_str ,yyscan_t yyscanner );
686
687FILE *ast_yyget_out (yyscan_t yyscanner );
688
689void ast_yyset_out (FILE * out_str ,yyscan_t yyscanner );
690
691int ast_yyget_leng (yyscan_t yyscanner );
692
693char *ast_yyget_text (yyscan_t yyscanner );
694
695int ast_yyget_lineno (yyscan_t yyscanner );
696
697void ast_yyset_lineno (int line_number ,yyscan_t yyscanner );
698
699YYSTYPE * ast_yyget_lval (yyscan_t yyscanner );
700
701void ast_yyset_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner );
702
703 YYLTYPE *ast_yyget_lloc (yyscan_t yyscanner );
704
705 void ast_yyset_lloc (YYLTYPE * yylloc_param ,yyscan_t yyscanner );
706
707/* Macros after this point can all be overridden by user definitions in
708 * section 1.
709 */
710
711#ifndef YY_SKIP_YYWRAP
712#ifdef __cplusplus
713extern "C" int ast_yywrap (yyscan_t yyscanner );
714#else
715extern int ast_yywrap (yyscan_t yyscanner );
716#endif
717#endif
718
719 static void yyunput (int c,char *buf_ptr ,yyscan_t yyscanner);
720
721#ifndef yytext_ptr
722static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner);
723#endif
724
725#ifdef YY_NEED_STRLEN
726static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner);
727#endif
728
729#ifndef YY_NO_INPUT
730
731#ifdef __cplusplus
732static int yyinput (yyscan_t yyscanner );
733#else
734static int input (yyscan_t yyscanner );
735#endif
736
737#endif
738
739/* Amount of stuff to slurp up with each read. */
740#ifndef YY_READ_BUF_SIZE
741#define YY_READ_BUF_SIZE 8192
742#endif
743
744/* Copy whatever the last rule matched to the standard output. */
745#ifndef ECHO
746/* This used to be an fputs(), but since the string might contain NUL's,
747 * we now use fwrite().
748 */
749#define ECHO fwrite( yytext, yyleng, 1, yyout )
750#endif
751
752/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
753 * is returned in "result".
754 */
755#ifndef YY_INPUT
756#define YY_INPUT(buf,result,max_size) \
757 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
758 { \
759 int c = '*'; \
760 int n; \
761 for ( n = 0; n < max_size && \
762 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
763 buf[n] = (char) c; \
764 if ( c == '\n' ) \
765 buf[n++] = (char) c; \
766 if ( c == EOF && ferror( yyin ) ) \
767 YY_FATAL_ERROR( "input in flex scanner failed" ); \
768 result = n; \
769 } \
770 else \
771 { \
772 errno=0; \
773 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
774 { \
775 if( errno != EINTR) \
776 { \
777 YY_FATAL_ERROR( "input in flex scanner failed" ); \
778 break; \
779 } \
780 errno=0; \
781 clearerr(yyin); \
782 } \
783 }\
784\
785
786#endif
787
788/* No semi-colon after return; correct usage is to write "yyterminate();" -
789 * we don't want an extra ';' after the "return" because that will cause
790 * some compilers to complain about unreachable statements.
791 */
792#ifndef yyterminate
793#define yyterminate() return YY_NULL
794#endif
795
796/* Number of entries by which start-condition stack grows. */
797#ifndef YY_START_STACK_INCR
798#define YY_START_STACK_INCR 25
799#endif
800
801/* Report a fatal error. */
802#ifndef YY_FATAL_ERROR
803#define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner)
804#endif
805
806/* end tables serialization structures and prototypes */
807
808/* Default declaration of generated scanner - a define so the user can
809 * easily add parameters.
810 */
811#ifndef YY_DECL
812#define YY_DECL_IS_OURS 1
813
814extern int ast_yylex \
815 (YYSTYPE * yylval_param,YYLTYPE * yylloc_param ,yyscan_t yyscanner);
816
817#define YY_DECL int ast_yylex \
818 (YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner)
819#endif /* !YY_DECL */
820
821/* Code executed at the beginning of each rule, after yytext and yyleng
822 * have been set up.
823 */
824#ifndef YY_USER_ACTION
825#define YY_USER_ACTION
826#endif
827
828/* Code executed at the end of each rule. */
829#ifndef YY_BREAK
830#define YY_BREAK break;
831#endif
832
833#define YY_RULE_SETUP \
834 YY_USER_ACTION
835
836/** The main scanner function which does all the work.
837 */
839{
840 register yy_state_type yy_current_state;
841 register char *yy_cp, *yy_bp;
842 register int yy_act;
843 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
844
845#line 128 "ast_expr2.fl"
846
847
848#line 846 "ast_expr2f.c"
849
850 yylval = yylval_param;
851
852 yylloc = yylloc_param;
853
854 if ( !yyg->yy_init )
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 }
879
880 while ( 1 ) /* loops until end-of-file is reached */
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 */
1327} /* end of ast_yylex */
1328
1329/* yy_get_next_buffer - try to read in a new buffer
1330 *
1331 * Returns a code representing an action:
1332 * EOB_ACT_LAST_MATCH -
1333 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1334 * EOB_ACT_END_OF_FILE - end of file
1335 */
1336static int yy_get_next_buffer (yyscan_t yyscanner)
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}
1468
1469/* yy_get_previous_state - get the state just before the EOB char was reached */
1470
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}
1498
1499/* yy_try_NUL_trans - try to make a transition on the NUL character
1500 *
1501 * synopsis
1502 * next_state = yy_try_NUL_trans( current_state );
1503 */
1504 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner)
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}
1527
1528 static void yyunput (int c, register char * yy_bp , yyscan_t yyscanner)
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}
1565
1566#ifndef YY_NO_INPUT
1567#ifdef __cplusplus
1568 static int yyinput (yyscan_t yyscanner)
1569#else
1570 static int input (yyscan_t yyscanner)
1571#endif
1572
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}
1639#endif /* ifndef YY_NO_INPUT */
1640
1641/** Immediately switch to a different input stream.
1642 * @param input_file A readable stream.
1643 * @param yyscanner The scanner object.
1644 * @note This function does not reset the start condition to @c INITIAL .
1645 */
1646 void ast_yyrestart (FILE * input_file , yyscan_t yyscanner)
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}
1659
1660/** Switch to a different input buffer.
1661 * @param new_buffer The new input buffer.
1662 * @param yyscanner The scanner object.
1663 */
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}
1695
1696static void ast_yy_load_buffer_state (yyscan_t yyscanner)
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}
1704
1705/** Allocate and initialize an input buffer state.
1706 * @param file A readable stream.
1707 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1708 * @param yyscanner The scanner object.
1709 * @return the allocated buffer state.
1710 */
1711 YY_BUFFER_STATE ast_yy_create_buffer (FILE * file, int size , yyscan_t yyscanner)
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}
1734
1735/** Destroy the buffer.
1736 * @param b a buffer created with ast_yy_create_buffer()
1737 * @param yyscanner The scanner object.
1738 */
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}
1754
1755#ifndef __cplusplus
1756extern int isatty (int );
1757#endif /* __cplusplus */
1758
1759/* Initializes or reinitializes a buffer.
1760 * This function is sometimes called more than once on the same buffer,
1761 * such as during a ast_yyrestart() or at EOF.
1762 */
1763 static void ast_yy_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner)
1764
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}
1787
1788/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
1789 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
1790 * @param yyscanner The scanner object.
1791 */
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}
1815
1816/** Pushes the new state onto the stack. The new state becomes
1817 * the current state. This function will allocate the stack
1818 * if necessary.
1819 * @param new_buffer The new state.
1820 * @param yyscanner The scanner object.
1821 */
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}
1848
1849/** Removes and deletes the top of the stack, if present.
1850 * The next element becomes the new top.
1851 * @param yyscanner The scanner object.
1852 */
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}
1869
1870/* Allocates the stack if it does not exist.
1871 * Guarantees space for at least one push.
1872 */
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}
1916
1917/** Setup the input buffer state to scan directly from a user-specified character buffer.
1918 * @param base the character buffer
1919 * @param size the size in bytes of the character buffer
1920 * @param yyscanner The scanner object.
1921 * @return the newly allocated buffer state object.
1922 */
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}
1951
1952/** Setup the input buffer state to scan a string. The next call to ast_yylex() will
1953 * scan from a @e copy of @a str.
1954 * @param yystr a NUL-terminated string to scan
1955 * @param yyscanner The scanner object.
1956 * @return the newly allocated buffer state object.
1957 * @note If you want to scan bytes that may contain NUL values, then use
1958 * ast_yy_scan_bytes() instead.
1959 */
1961{
1962
1963 return ast_yy_scan_bytes(yystr,strlen(yystr) ,yyscanner);
1964}
1965
1966/** Setup the input buffer state to scan the given bytes. The next call to ast_yylex() will
1967 * scan from a @e copy of @a bytes.
1968 * @param bytes the byte buffer to scan
1969 * @param len the number of bytes in the buffer pointed to by @a bytes.
1970 * @param yyscanner The scanner object.
1971 * @return the newly allocated buffer state object.
1972 */
1973YY_BUFFER_STATE ast_yy_scan_bytes (yyconst char * yybytes, int _yybytes_len , yyscan_t yyscanner)
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}
2002
2003#ifndef YY_EXIT_FAILURE
2004#define YY_EXIT_FAILURE 2
2005#endif
2006
2007static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner)
2008{
2009 (void) fprintf( stderr, "%s\n", msg );
2010 exit( YY_EXIT_FAILURE );
2011}
2012
2013/* Redefine yyless() so it works in section 3 code. */
2014
2015#undef yyless
2016#define yyless(n) \
2017 do \
2018 { \
2019 /* Undo effects of setting up yytext. */ \
2020 int yyless_macro_arg = (n); \
2021 YY_LESS_LINENO(yyless_macro_arg);\
2022 yytext[yyleng] = yyg->yy_hold_char; \
2023 yyg->yy_c_buf_p = yytext + yyless_macro_arg; \
2024 yyg->yy_hold_char = *yyg->yy_c_buf_p; \
2025 *yyg->yy_c_buf_p = '\0'; \
2026 yyleng = yyless_macro_arg; \
2027 } \
2028 while ( 0 )
2029
2030/* Accessor methods (get/set functions) to struct members. */
2031
2032/** Get the user-defined data for this scanner.
2033 * @param yyscanner The scanner object.
2034 */
2036{
2037 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2038 return yyextra;
2039}
2040
2041/** Get the current line number.
2042 * @param yyscanner The scanner object.
2043 */
2045{
2046 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2047
2048 if (! YY_CURRENT_BUFFER)
2049 return 0;
2050
2051 return yylineno;
2052}
2053
2054/** Get the current column number.
2055 * @param yyscanner The scanner object.
2056 */
2058{
2059 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2060
2061 if (! YY_CURRENT_BUFFER)
2062 return 0;
2063
2064 return yycolumn;
2065}
2066
2067/** Get the input stream.
2068 * @param yyscanner The scanner object.
2069 */
2070FILE *ast_yyget_in (yyscan_t yyscanner)
2071{
2072 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2073 return yyin;
2074}
2075
2076/** Get the output stream.
2077 * @param yyscanner The scanner object.
2078 */
2079FILE *ast_yyget_out (yyscan_t yyscanner)
2080{
2081 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2082 return yyout;
2083}
2084
2085/** Get the length of the current token.
2086 * @param yyscanner The scanner object.
2087 */
2089{
2090 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2091 return yyleng;
2092}
2093
2094/** Get the current token.
2095 * @param yyscanner The scanner object.
2096 */
2097
2098char *ast_yyget_text (yyscan_t yyscanner)
2099{
2100 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2101 return yytext;
2102}
2103
2104/** Set the user-defined data. This data is never touched by the scanner.
2105 * @param user_defined The data to be associated with this scanner.
2106 * @param yyscanner The scanner object.
2107 */
2108void ast_yyset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner)
2109{
2110 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2111 yyextra = user_defined ;
2112}
2113
2114/** Set the current line number.
2115 * @param line_number
2116 * @param yyscanner The scanner object.
2117 */
2118void ast_yyset_lineno (int line_number , yyscan_t yyscanner)
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}
2128
2129/** Set the current column.
2130 * @param line_number
2131 * @param yyscanner The scanner object.
2132 */
2133void ast_yyset_column (int column_no , yyscan_t yyscanner)
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}
2143
2144/** Set the input stream. This does not discard the current
2145 * input buffer.
2146 * @param in_str A readable stream.
2147 * @param yyscanner The scanner object.
2148 * @see ast_yy_switch_to_buffer
2149 */
2150void ast_yyset_in (FILE * in_str , yyscan_t yyscanner)
2151{
2152 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2153 yyin = in_str ;
2154}
2155
2156void ast_yyset_out (FILE * out_str , yyscan_t yyscanner)
2157{
2158 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2159 yyout = out_str ;
2160}
2161
2163{
2164 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2165 return yy_flex_debug;
2166}
2167
2168void ast_yyset_debug (int bdebug , yyscan_t yyscanner)
2169{
2170 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2171 yy_flex_debug = bdebug ;
2172}
2173
2174/* Accessor methods for yylval and yylloc */
2175
2177{
2178 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2179 return yylval;
2180}
2181
2182void ast_yyset_lval (YYSTYPE * yylval_param , yyscan_t yyscanner)
2183{
2184 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2185 yylval = yylval_param;
2186}
2187
2189{
2190 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2191 return yylloc;
2192}
2193
2194void ast_yyset_lloc (YYLTYPE * yylloc_param , yyscan_t yyscanner)
2195{
2196 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2197 yylloc = yylloc_param;
2198}
2199
2200/* User-visible API */
2201
2202/* ast_yylex_init is special because it creates the scanner itself, so it is
2203 * the ONLY reentrant function that doesn't take the scanner as the last argument.
2204 * That's why we explicitly handle the declaration, instead of using our macros.
2205 */
2206
2207int ast_yylex_init(yyscan_t* ptr_yy_globals)
2208
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}
2227
2228/* ast_yylex_init_extra has the same functionality as ast_yylex_init, but follows the
2229 * convention of taking the scanner as the last argument. Note however, that
2230 * this is a *pointer* to a scanner, as it will be allocated by this call (and
2231 * is the reason, too, why this function also must handle its own declaration).
2232 * The user defined value in the first argument will be available to ast_yyalloc in
2233 * the yyextra field.
2234 */
2235
2236int ast_yylex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals )
2237
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}
2263
2264static int yy_init_globals (yyscan_t yyscanner)
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}
2296
2297/* ast_yylex_destroy is for both reentrant and non-reentrant scanners. */
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}
2326
2327/*
2328 * Internal utility routines.
2329 */
2330
2331#ifndef yytext_ptr
2332static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner)
2333{
2334 register int i;
2335 for ( i = 0; i < n; ++i )
2336 s1[i] = s2[i];
2337}
2338#endif
2339
2340#ifdef YY_NEED_STRLEN
2341static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner)
2342{
2343 register int n;
2344 for ( n = 0; s[n]; ++n )
2345 ;
2346
2347 return n;
2348}
2349#endif
2350
2351void *ast_yyalloc (yy_size_t size , yyscan_t yyscanner)
2352{
2353 return (void *) malloc( size );
2354}
2355
2356void *ast_yyrealloc (void * ptr, yy_size_t size , yyscan_t yyscanner)
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}
2367
2368#define YYTABLES_NAME "yytables"
2369
2370#line 236 "ast_expr2.fl"
2371
2372
2373
2374/* I'm putting the interface routine to the whole parse here in the flexer input file
2375 mainly because of all the flexer initialization that has to be done. Shouldn't matter
2376 where it is, as long as it's somewhere. I didn't want to define a prototype for the
2377 ast_yy_scan_string in the .y file, because then, I'd have to define YY_BUFFER_STATE there...
2378 UGH! that would be inappropriate. */
2379
2380int ast_yyparse(void *); /* need to/should define this prototype for the call to yyparse */
2381int ast_yyerror(const char *, YYLTYPE *, struct parse_io *); /* likewise */
2382
2383void ast_yyfree(void *ptr, yyscan_t yyscanner)
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}
2390
2391int ast_expr(char *expr, char *buf, int length, struct ast_channel *chan)
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}
2431
2432#ifndef STANDALONE
2433int ast_str_expr(struct ast_str **str, ssize_t maxlen, struct ast_channel *chan, char *expr)
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}
2455#endif
2456
2457
2462
2464{
2467}
2468
2470{
2472 extra_error_message[0] = 0;
2473}
2474
2475static const char * const expr2_token_equivs1[] =
2476{
2477 "TOKEN",
2478 "TOK_COND",
2479 "TOK_COLONCOLON",
2480 "TOK_OR",
2481 "TOK_AND",
2482 "TOK_EQ",
2483 "TOK_GT",
2484 "TOK_LT",
2485 "TOK_GE",
2486 "TOK_LE",
2487 "TOK_NE",
2488 "TOK_PLUS",
2489 "TOK_MINUS",
2490 "TOK_MULT",
2491 "TOK_DIV",
2492 "TOK_MOD",
2493 "TOK_COMPL",
2494 "TOK_COLON",
2495 "TOK_EQTILDE",
2496 "TOK_COMMA",
2497 "TOK_RP",
2498 "TOK_LP"
2499};
2500
2501static const char * const expr2_token_equivs2[] =
2502{
2503 "<token>",
2504 "?",
2505 "::",
2506 "|",
2507 "&",
2508 "=",
2509 ">",
2510 "<",
2511 ">=",
2512 "<=",
2513 "!=",
2514 "+",
2515 "-",
2516 "*",
2517 "/",
2518 "%",
2519 "!",
2520 ":",
2521 "=~",
2522 ",",
2523 ")",
2524 "("
2525};
2526
2527
2528static char *expr2_token_subst(const char *mess)
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}
2571
2572int ast_yyerror (const char *s, yyltype *loc, struct parse_io *parseio )
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}
2612
void * yyscan_t
Definition: ael_structs.h:71
const char * str
Definition: app_jack.c:147
@ 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
valtype
Definition: ast_expr2.c:317
int ast_yylex_destroy(yyscan_t yyscanner)
Definition: ast_expr2f.c:2298
#define YY_NEW_FILE
Definition: ast_expr2f.c:158
YY_BUFFER_STATE ast_yy_create_buffer(FILE *file, int size, yyscan_t yyscanner)
Definition: ast_expr2f.c:1711
FILE * ast_yyget_out(yyscan_t yyscanner)
Definition: ast_expr2f.c:2079
#define yytext
Definition: ast_expr2f.c:136
#define yylloc
Definition: ast_expr2f.c:664
void ast_yyfree(void *, yyscan_t yyscanner)
Definition: ast_expr2f.c:2383
static const char *const expr2_token_equivs2[]
Definition: ast_expr2f.c:2501
unsigned char flex_uint8_t
Definition: ast_expr2f.c:57
void * yyscan_t
Definition: ast_expr2f.c:127
static void ast_yy_init_buffer(YY_BUFFER_STATE b, FILE *file, yyscan_t yyscanner)
Definition: ast_expr2f.c:1763
static void ast_yy_load_buffer_state(yyscan_t yyscanner)
Definition: ast_expr2f.c:1696
int ast_str_expr(struct ast_str **str, ssize_t maxlen, struct ast_channel *chan, char *expr)
Evaluate the given expression.
Definition: ast_expr2f.c:2433
int ast_yylex_init_extra(YY_EXTRA_TYPE user_defined, yyscan_t *scanner)
Definition: ast_expr2f.c:2236
#define var
Definition: ast_expr2f.c:605
unsigned char YY_CHAR
Definition: ast_expr2f.c:334
int ast_yyget_lineno(yyscan_t yyscanner)
Definition: ast_expr2f.c:2044
static int yy_init_globals(yyscan_t yyscanner)
Definition: ast_expr2f.c:2264
int ast_yyget_debug(yyscan_t yyscanner)
Definition: ast_expr2f.c:2162
#define YY_EXTRA_TYPE
Definition: ast_expr2f.c:617
YY_BUFFER_STATE ast_yy_scan_bytes(yyconst char *bytes, int len, yyscan_t yyscanner)
Definition: ast_expr2f.c:1973
static int yy_get_next_buffer(yyscan_t yyscanner)
Definition: ast_expr2f.c:1336
void ast_yyset_extra(YY_EXTRA_TYPE user_defined, yyscan_t yyscanner)
Definition: ast_expr2f.c:2108
void ast_yypop_buffer_state(yyscan_t yyscanner)
Definition: ast_expr2f.c:1853
#define trail
Definition: ast_expr2f.c:606
short int flex_int16_t
Definition: ast_expr2f.c:55
#define yy_flex_debug
Definition: ast_expr2f.c:139
YYLTYPE * ast_yyget_lloc(yyscan_t yyscanner)
Definition: ast_expr2f.c:2188
void ast_yy_switch_to_buffer(YY_BUFFER_STATE new_buffer, yyscan_t yyscanner)
Definition: ast_expr2f.c:1664
unsigned int flex_uint32_t
Definition: ast_expr2f.c:59
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
YY_BUFFER_STATE ast_yy_scan_buffer(char *base, yy_size_t size, yyscan_t yyscanner)
Definition: ast_expr2f.c:1923
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
void ast_yy_flush_buffer(YY_BUFFER_STATE b, yyscan_t yyscanner)
Definition: ast_expr2f.c:1792
void ast_expr_register_extra_error_info(char *message)
Definition: ast_expr2f.c:2463
struct yy_buffer_state * YY_BUFFER_STATE
Definition: ast_expr2f.c:173
#define yyout
Definition: ast_expr2f.c:133
#define YY_BUFFER_NEW
Definition: ast_expr2f.c:251
#define YY_RESTORE_YY_MORE_OFFSET
Definition: ast_expr2f.c:485
static int input(yyscan_t yyscanner)
Definition: ast_expr2f.c:1570
static void ast_yyensure_buffer_stack(yyscan_t yyscanner)
Definition: ast_expr2f.c:1873
int ast_yyparse(void *)
#define YY_BUFFER_NORMAL
Definition: ast_expr2f.c:252
void ast_yyset_lloc(YYLTYPE *yylloc_param, yyscan_t yyscanner)
Definition: ast_expr2f.c:2194
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 yyextra
Definition: ast_expr2f.c:134
#define SET_STRING
Definition: ast_expr2f.c:577
register char * yy_bp
Definition: ast_expr2f.c:841
#define yymore()
Definition: ast_expr2f.c:483
struct yyguts_t * yyg
Definition: ast_expr2f.c:843
static int curlycount
Definition: ast_expr2f.c:599
#define yylval
Definition: ast_expr2f.c:662
void ast_expr_clear_extra_error_info(void)
Definition: ast_expr2f.c:2469
int ast_expr(char *expr, char *buf, int length, struct ast_channel *chan)
Evaluate the given expression.
Definition: ast_expr2f.c:2391
signed char flex_int8_t
Definition: ast_expr2f.c:54
static yyconst flex_int16_t yy_def[70]
Definition: ast_expr2f.c:426
#define EOB_ACT_END_OF_FILE
Definition: ast_expr2f.c:177
register int yy_act
Definition: ast_expr2f.c:842
static void yyunput(int c, char *buf_ptr, yyscan_t yyscanner)
#define YY_CURRENT_BUFFER_LVALUE
Definition: ast_expr2f.c:281
void ast_yyrestart(FILE *input_file, yyscan_t yyscanner)
Definition: ast_expr2f.c:1646
void ast_yyset_lineno(int line_number, yyscan_t yyscanner)
Definition: ast_expr2f.c:2118
void ast_yy_delete_buffer(YY_BUFFER_STATE b, yyscan_t yyscanner)
Definition: ast_expr2f.c:1739
int flex_int32_t
Definition: ast_expr2f.c:56
#define ast_yywrap(n)
Definition: ast_expr2f.c:331
void ast_yyset_out(FILE *out_str, yyscan_t yyscanner)
Definition: ast_expr2f.c:2156
int ast_yyget_column(yyscan_t yyscanner)
Definition: ast_expr2f.c:2057
#define YY_START
Definition: ast_expr2f.c:151
static const char *const expr2_token_equivs1[]
Definition: ast_expr2f.c:2475
static char * expr2_token_subst(const char *mess)
Definition: ast_expr2f.c:2528
int yy_state_type
Definition: ast_expr2f.c:336
@ AST_EXPR_string
Definition: ast_expr2f.c:558
@ AST_EXPR_numeric_string
Definition: ast_expr2f.c:558
@ AST_EXPR_number
Definition: ast_expr2f.c:558
#define YY_CURRENT_BUFFER
Definition: ast_expr2f.c:274
#define SET_NUMERIC_STRING
Definition: ast_expr2f.c:583
int ast_yyget_leng(yyscan_t yyscanner)
Definition: ast_expr2f.c:2088
#define yyconst
Definition: ast_expr2f.c:111
static yyconst flex_int16_t yy_nxt[159]
Definition: ast_expr2f.c:437
#define INITIAL
Definition: ast_expr2f.c:604
#define yyin
Definition: ast_expr2f.c:132
static yyconst flex_int16_t yy_accept[63]
Definition: ast_expr2f.c:365
YY_BUFFER_STATE ast_yy_scan_string(yyconst char *yy_str, yyscan_t yyscanner)
Definition: ast_expr2f.c:1960
void ast_yyset_debug(int debug_flag, yyscan_t yyscanner)
Definition: ast_expr2f.c:2168
static void yy_fatal_error(yyconst char msg[], yyscan_t yyscanner)
#define YY_READ_BUF_SIZE
Definition: ast_expr2f.c:741
#define YY_INPUT(buf, result, max_size)
Definition: ast_expr2f.c:756
#define ECHO
Definition: ast_expr2f.c:554
#define YY_END_OF_BUFFER
Definition: ast_expr2f.c:357
#define FP___PRINTF
Definition: ast_expr2f.c:526
void ast_yypush_buffer_state(YY_BUFFER_STATE new_buffer, yyscan_t yyscanner)
Definition: ast_expr2f.c:1822
#define YY_STATE_EOF(state)
Definition: ast_expr2f.c:155
int isatty(int)
char extra_error_message[4095]
Definition: ast_expr2f.c:2458
#define BEGIN
Definition: ast_expr2f.c:145
#define YY_END_OF_BUFFER_CHAR
Definition: ast_expr2f.c:160
register char * yy_cp
Definition: ast_expr2f.c:841
FILE * ast_yyget_in(yyscan_t yyscanner)
Definition: ast_expr2f.c:2070
char * ast_yyget_text(yyscan_t yyscanner)
Definition: ast_expr2f.c:2098
#define YY_FATAL_ERROR(msg)
Definition: ast_expr2f.c:803
#define yyterminate()
Definition: ast_expr2f.c:793
int ast_yylex(YYSTYPE *yylval_param, YYLTYPE *yylloc_param, yyscan_t yyscanner)
unsigned short int flex_uint16_t
Definition: ast_expr2f.c:58
static yyconst flex_int32_t yy_ec[256]
Definition: ast_expr2f.c:376
void * ast_yyalloc(yy_size_t, yyscan_t yyscanner)
Definition: ast_expr2f.c:2351
#define YY_DO_BEFORE_ACTION
Definition: ast_expr2f.c:348
#define EOB_ACT_LAST_MATCH
Definition: ast_expr2f.c:178
void * ast_yyrealloc(void *, yy_size_t, yyscan_t yyscanner)
Definition: ast_expr2f.c:2356
size_t yy_size_t
Definition: ast_expr2f.c:200
#define YY_BUFFER_EOF_PENDING
Definition: ast_expr2f.c:263
#define yylineno
Definition: ast_expr2f.c:137
#define yycolumn
Definition: ast_expr2f.c:138
#define EOB_ACT_CONTINUE_SCAN
Definition: ast_expr2f.c:176
int ast_yylex_init(yyscan_t *scanner)
Definition: ast_expr2f.c:2207
int ast_yyerror(const char *, YYLTYPE *, struct parse_io *)
YYSTYPE * ast_yyget_lval(yyscan_t yyscanner)
Definition: ast_expr2f.c:2176
#define YY_DECL
Definition: ast_expr2f.c:817
#define YY_BUF_SIZE
Definition: ast_expr2f.c:164
#define YY_EXIT_FAILURE
Definition: ast_expr2f.c:2004
void ast_yyset_column(int column_no, yyscan_t yyscanner)
Definition: ast_expr2f.c:2133
static yy_state_type yy_get_previous_state(yyscan_t yyscanner)
Definition: ast_expr2f.c:1471
int extra_error_message_supplied
Definition: ast_expr2f.c:2459
#define YY_SC_TO_UI(c)
Definition: ast_expr2f.c:122
#define FP___TYPE
Definition: ast_expr2f.c:529
#define yyleng
Definition: ast_expr2f.c:135
void ast_yyset_in(FILE *in_str, yyscan_t yyscanner)
Definition: ast_expr2f.c:2150
YY_EXTRA_TYPE ast_yyget_extra(yyscan_t yyscanner)
Definition: ast_expr2f.c:2035
void ast_yyset_lval(YYSTYPE *yylval_param, yyscan_t yyscanner)
Definition: ast_expr2f.c:2182
Asterisk main include file. File version handling, generic pbx functions.
#define realloc(a, b)
Definition: astmm.h:161
#define ast_log
Definition: astobj2.c:42
static struct io_context * io
Definition: chan_ooh323.c:401
General Asterisk PBX channel definitions.
int int32_t
Definition: db.h:60
__signed char int8_t
Definition: db.h:58
short int16_t
Definition: db.h:59
char buf[BUFSIZE]
Definition: eagi_proxy.c:66
static int len(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t buflen)
char * malloc()
void free()
Support for logging to various files, console and syslog Configuration in file logger....
#define LOG_WARNING
int errno
#define NULL
Definition: resample.c:96
String manipulation functions.
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
void ast_copy_string(char *dst, const char *src, size_t size)
Size-limited null-terminating string copy.
Definition: strings.h:425
Main Channel structure associated with a channel.
Support for dynamic strings.
Definition: strings.h:623
struct val * val
Definition: ast_expr2.c:351
yyscan_t scanner
Definition: ael_structs.h:78
struct ast_channel * chan
Definition: ast_expr2.c:353
char * string
Definition: ast_expr2.c:350
Definition: ast_expr2.c:325
FP___TYPE i
Definition: ast_expr2.c:329
char * s
Definition: ast_expr2.c:328
enum valtype type
Definition: ast_expr2.c:326
union val::@295 u
yy_size_t yy_buf_size
Definition: ast_expr2f.c:215
FILE * yy_input_file
Definition: ast_expr2f.c:207
char * yy_ch_buf
Definition: ast_expr2f.c:209
char * yy_buf_pos
Definition: ast_expr2f.c:210
flex_int32_t yy_nxt
Definition: ast_expr2f.c:363
flex_int32_t yy_verify
Definition: ast_expr2f.c:362
char yy_hold_char
Definition: ast_expr2f.c:632
FILE * yyout_r
Definition: ast_expr2f.c:628
yy_state_type yy_last_accepting_state
Definition: ast_expr2f.c:642
int yy_start
Definition: ast_expr2f.c:637
char * yytext_r
Definition: ast_expr2f.c:648
int yy_start_stack_ptr
Definition: ast_expr2f.c:639
FILE * yyin_r
Definition: ast_expr2f.c:628
size_t yy_buffer_stack_max
Definition: ast_expr2f.c:630
YY_BUFFER_STATE * yy_buffer_stack
Definition: ast_expr2f.c:631
int yy_more_len
Definition: ast_expr2f.c:650
int yy_did_buffer_switch_on_eof
Definition: ast_expr2f.c:638
YYSTYPE * yylval_r
Definition: ast_expr2f.c:652
int yy_more_flag
Definition: ast_expr2f.c:649
int yyleng_r
Definition: ast_expr2f.c:634
YYLTYPE * yylloc_r
Definition: ast_expr2f.c:654
int yy_flex_debug_r
Definition: ast_expr2f.c:646
YY_EXTRA_TYPE yyextra_r
Definition: ast_expr2f.c:625
int yy_n_chars
Definition: ast_expr2f.c:633
char * yy_c_buf_p
Definition: ast_expr2f.c:635
int * yy_start_stack
Definition: ast_expr2f.c:641
int yy_start_stack_depth
Definition: ast_expr2f.c:640
char * yy_last_accepting_cpos
Definition: ast_expr2f.c:643
size_t yy_buffer_stack_top
Definition: ast_expr2f.c:629
int yylineno_r
Definition: ast_expr2f.c:645
int yy_init
Definition: ast_expr2f.c:636
static struct test_val b
static struct test_val c