Asterisk - The Open Source Telephony Project  18.5.0
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>
47 typedef int8_t flex_int8_t;
48 typedef uint8_t flex_uint8_t;
49 typedef int16_t flex_int16_t;
50 typedef uint16_t flex_uint16_t;
51 typedef int32_t flex_int32_t;
52 typedef uint32_t flex_uint32_t;
53 #else
54 typedef signed char flex_int8_t;
55 typedef short int flex_int16_t;
56 typedef int flex_int32_t;
57 typedef unsigned char flex_uint8_t;
58 typedef unsigned short int flex_uint16_t;
59 typedef unsigned int flex_uint32_t;
60 
61 /* Limits of integral types. */
62 #ifndef INT8_MIN
63 #define INT8_MIN (-128)
64 #endif
65 #ifndef INT16_MIN
66 #define INT16_MIN (-32767-1)
67 #endif
68 #ifndef INT32_MIN
69 #define INT32_MIN (-2147483647-1)
70 #endif
71 #ifndef INT8_MAX
72 #define INT8_MAX (127)
73 #endif
74 #ifndef INT16_MAX
75 #define INT16_MAX (32767)
76 #endif
77 #ifndef INT32_MAX
78 #define INT32_MAX (2147483647)
79 #endif
80 #ifndef UINT8_MAX
81 #define UINT8_MAX (255U)
82 #endif
83 #ifndef UINT16_MAX
84 #define UINT16_MAX (65535U)
85 #endif
86 #ifndef UINT32_MAX
87 #define UINT32_MAX (4294967295U)
88 #endif
89 
90 #endif /* ! C99 */
91 
92 #endif /* ! FLEXINT_H */
93 
94 #ifdef __cplusplus
95 
96 /* The "const" storage-class-modifier is valid. */
97 #define YY_USE_CONST
98 
99 #else /* ! __cplusplus */
100 
101 /* C99 requires __STDC__ to be defined as 1. */
102 #if defined (__STDC__)
103 
104 #define YY_USE_CONST
105 
106 #endif /* defined (__STDC__) */
107 #endif /* ! __cplusplus */
108 
109 #ifdef YY_USE_CONST
110 #define yyconst const
111 #else
112 #define yyconst
113 #endif
114 
115 /* Returned upon end-of-file. */
116 #define YY_NULL 0
117 
118 /* Promotes a possibly negative, possibly signed char to an unsigned
119  * integer for use as an array index. If the signed char is negative,
120  * we want to instead treat it as an 8-bit unsigned char, hence the
121  * double cast.
122  */
123 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
124 
125 /* An opaque pointer. */
126 #ifndef YY_TYPEDEF_YY_SCANNER_T
127 #define YY_TYPEDEF_YY_SCANNER_T
128 typedef void* yyscan_t;
129 #endif
130 
131 /* For convenience, these vars (plus the bison vars far below)
132  are macros in the reentrant scanner. */
133 #define yyin yyg->yyin_r
134 #define yyout yyg->yyout_r
135 #define yyextra yyg->yyextra_r
136 #define yyleng yyg->yyleng_r
137 #define yytext yyg->yytext_r
138 #define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)
139 #define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
140 #define yy_flex_debug yyg->yy_flex_debug_r
141 
142 /* Enter a start condition. This macro really ought to take a parameter,
143  * but we do it the disgusting crufty way forced on us by the ()-less
144  * definition of BEGIN.
145  */
146 #define BEGIN yyg->yy_start = 1 + 2 *
147 
148 /* Translate the current start state into a value that can be later handed
149  * to BEGIN to return to the state. The YYSTATE alias is for lex
150  * compatibility.
151  */
152 #define YY_START ((yyg->yy_start - 1) / 2)
153 #define YYSTATE YY_START
154 
155 /* Action number for EOF rule of a given start state. */
156 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
157 
158 /* Special action meaning "start processing a new file". */
159 #define YY_NEW_FILE ast_yyrestart(yyin ,yyscanner )
160 
161 #define YY_END_OF_BUFFER_CHAR 0
162 
163 /* Size of default input buffer. */
164 #ifndef YY_BUF_SIZE
165 #ifdef __ia64__
166 /* On IA-64, the buffer size is 16k, not 8k.
167  * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
168  * Ditto for the __ia64__ case accordingly.
169  */
170 #define YY_BUF_SIZE 32768
171 #else
172 #define YY_BUF_SIZE 16384
173 #endif /* __ia64__ */
174 #endif
175 
176 /* The state buf must be large enough to hold one state per character in the main buffer.
177  */
178 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
179 
180 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
181 #define YY_TYPEDEF_YY_BUFFER_STATE
183 #endif
184 
185 #define EOB_ACT_CONTINUE_SCAN 0
186 #define EOB_ACT_END_OF_FILE 1
187 #define EOB_ACT_LAST_MATCH 2
188 
189  #define YY_LESS_LINENO(n)
190 
191 /* Return all but the first "n" matched characters back to the input stream. */
192 #define yyless(n) \
193  do \
194  { \
195  /* Undo effects of setting up yytext. */ \
196  int yyless_macro_arg = (n); \
197  YY_LESS_LINENO(yyless_macro_arg);\
198  *yy_cp = yyg->yy_hold_char; \
199  YY_RESTORE_YY_MORE_OFFSET \
200  yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
201  YY_DO_BEFORE_ACTION; /* set up yytext again */ \
202  } \
203  while ( 0 )
204 
205 #define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
206 
207 #ifndef YY_TYPEDEF_YY_SIZE_T
208 #define YY_TYPEDEF_YY_SIZE_T
209 typedef size_t yy_size_t;
210 #endif
211 
212 #ifndef YY_STRUCT_YY_BUFFER_STATE
213 #define YY_STRUCT_YY_BUFFER_STATE
215  {
217 
218  char *yy_ch_buf; /* input buffer */
219  char *yy_buf_pos; /* current position in input buffer */
220 
221  /* Size of input buffer in bytes, not including room for EOB
222  * characters.
223  */
225 
226  /* Number of characters read into yy_ch_buf, not including EOB
227  * characters.
228  */
230 
231  /* Whether we "own" the buffer - i.e., we know we created it,
232  * and can realloc() it to grow it, and should free() it to
233  * delete it.
234  */
236 
237  /* Whether this is an "interactive" input source; if so, and
238  * if we're using stdio for input, then we want to use getc()
239  * instead of fread(), to make sure we stop fetching input after
240  * each newline.
241  */
243 
244  /* Whether we're considered to be at the beginning of a line.
245  * If so, '^' rules will be active on the next match, otherwise
246  * not.
247  */
249 
250  int yy_bs_lineno; /**< The line count. */
251  int yy_bs_column; /**< The column count. */
252 
253  /* Whether to try to fill the input buffer when we reach the
254  * end of it.
255  */
257 
259 
260 #define YY_BUFFER_NEW 0
261 #define YY_BUFFER_NORMAL 1
262  /* When an EOF's been seen but there's still some text to process
263  * then we mark the buffer as YY_EOF_PENDING, to indicate that we
264  * shouldn't try reading from the input source any more. We might
265  * still have a bunch of tokens to match, though, because of
266  * possible backing-up.
267  *
268  * When we actually see the EOF, we change the status to "new"
269  * (via ast_yyrestart()), so that the user can continue scanning by
270  * just pointing yyin at a new input file.
271  */
272 #define YY_BUFFER_EOF_PENDING 2
273 
274  };
275 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
276 
277 /* We provide macros for accessing buffer states in case in the
278  * future we want to put the buffer states in a more general
279  * "scanner state".
280  *
281  * Returns the top of the stack, or NULL.
282  */
283 #define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \
284  ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \
285  : NULL)
286 
287 /* Same as previous macro, but useful when we know that the buffer stack is not
288  * NULL or when we need an lvalue. For internal use only.
289  */
290 #define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]
291 
292 void ast_yyrestart (FILE *input_file ,yyscan_t yyscanner );
293 void ast_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
294 YY_BUFFER_STATE ast_yy_create_buffer (FILE *file,int size ,yyscan_t yyscanner );
295 void ast_yy_delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
296 void ast_yy_flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
297 void ast_yypush_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
298 void ast_yypop_buffer_state (yyscan_t yyscanner );
299 
300 static void ast_yyensure_buffer_stack (yyscan_t yyscanner );
301 static void ast_yy_load_buffer_state (yyscan_t yyscanner );
302 static void ast_yy_init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner );
303 
304 #define YY_FLUSH_BUFFER ast_yy_flush_buffer(YY_CURRENT_BUFFER ,yyscanner)
305 
306 YY_BUFFER_STATE ast_yy_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner );
307 YY_BUFFER_STATE ast_yy_scan_string (yyconst char *yy_str ,yyscan_t yyscanner );
308 YY_BUFFER_STATE ast_yy_scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner );
309 
310 void *ast_yyalloc (yy_size_t ,yyscan_t yyscanner );
311 void *ast_yyrealloc (void *,yy_size_t ,yyscan_t yyscanner );
312 void ast_yyfree (void * ,yyscan_t yyscanner );
313 
314 #define yy_new_buffer ast_yy_create_buffer
315 
316 #define yy_set_interactive(is_interactive) \
317  { \
318  if ( ! YY_CURRENT_BUFFER ){ \
319  ast_yyensure_buffer_stack (yyscanner); \
320  YY_CURRENT_BUFFER_LVALUE = \
321  ast_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
322  } \
323  YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
324  }
325 
326 #define yy_set_bol(at_bol) \
327  { \
328  if ( ! YY_CURRENT_BUFFER ){\
329  ast_yyensure_buffer_stack (yyscanner); \
330  YY_CURRENT_BUFFER_LVALUE = \
331  ast_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
332  } \
333  YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
334  }
335 
336 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
337 
338 /* Begin user sect3 */
339 
340 #define ast_yywrap(n) 1
341 #define YY_SKIP_YYWRAP
342 
343 typedef unsigned char YY_CHAR;
344 
345 typedef int yy_state_type;
346 
347 #define yytext_ptr yytext_r
348 
349 static yy_state_type yy_get_previous_state (yyscan_t yyscanner );
350 static yy_state_type yy_try_NUL_trans (yy_state_type current_state ,yyscan_t yyscanner);
351 static int yy_get_next_buffer (yyscan_t yyscanner );
352 static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner );
353 
354 /* Done after the current pattern has been matched and before the
355  * corresponding action - sets up yytext.
356  */
357 #define YY_DO_BEFORE_ACTION \
358  yyg->yytext_ptr = yy_bp; \
359  yyg->yytext_ptr -= yyg->yy_more_len; \
360  yyleng = (size_t) (yy_cp - yyg->yytext_ptr); \
361  yyg->yy_hold_char = *yy_cp; \
362  *yy_cp = '\0'; \
363  yyg->yy_c_buf_p = yy_cp;
364 
365 #define YY_NUM_RULES 38
366 #define YY_END_OF_BUFFER 39
367 /* This struct is not used in this scanner,
368  but its presence is necessary. */
370  {
373  };
375  { 0,
376  0, 0, 0, 0, 35, 35, 39, 38, 27, 29,
377  21, 38, 31, 38, 19, 2, 24, 25, 17, 14,
378  15, 16, 18, 30, 22, 10, 3, 9, 20, 1,
379  38, 38, 34, 33, 35, 37, 37, 13, 0, 28,
380  31, 0, 26, 5, 31, 30, 23, 12, 6, 7,
381  11, 4, 8, 0, 34, 33, 35, 0, 36, 32,
382  30, 0
383  } ;
384 
386  { 0,
387  1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
388  1, 1, 2, 1, 1, 1, 1, 1, 1, 1,
389  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
390  1, 2, 4, 5, 6, 7, 8, 9, 6, 10,
391  11, 12, 13, 14, 15, 16, 17, 18, 18, 18,
392  18, 18, 18, 18, 18, 18, 18, 19, 6, 20,
393  21, 22, 23, 6, 6, 6, 6, 6, 6, 6,
394  6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
395  6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
396  1, 6, 1, 6, 6, 1, 6, 6, 6, 6,
397 
398  6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
399  6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
400  6, 6, 24, 25, 26, 27, 1, 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, 28, 28, 28, 28, 28,
406  28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
407  28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
408 
409  28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
410  28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
411  28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
412  28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
413  28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
414  28, 28, 28, 28, 28
415  } ;
416 
418  { 0,
419  1, 2, 2, 2, 1, 3, 3, 2, 2, 2,
420  2, 2, 2, 1, 2, 3, 2, 3, 2, 2,
421  2, 2, 2, 1, 2, 1, 1, 3
422  } ;
423 
425  { 0,
426  0, 0, 5, 6, 32, 60, 73, 130, 130, 130,
427  51, 66, 63, 45, 130, 59, 130, 130, 130, 130,
428  130, 130, 130, 83, 45, 42, 13, 41, 130, 32,
429  28, 17, 130, 130, 47, 130, 29, 130, 47, 130,
430  44, 25, 130, 130, 29, 0, 130, 130, 130, 130,
431  130, 130, 130, 18, 130, 130, 38, 12, 130, 130,
432  0, 130, 111, 114, 117, 32, 120, 123, 126
433  } ;
434 
436  { 0,
437  62, 1, 63, 63, 64, 64, 62, 62, 62, 62,
438  62, 65, 66, 67, 62, 62, 62, 62, 62, 62,
439  62, 62, 62, 62, 62, 62, 62, 62, 62, 62,
440  62, 68, 62, 62, 69, 62, 62, 62, 65, 62,
441  66, 67, 62, 62, 41, 24, 62, 62, 62, 62,
442  62, 62, 62, 68, 62, 62, 69, 62, 62, 62,
443  45, 0, 62, 62, 62, 62, 62, 62, 62
444  } ;
445 
447  { 0,
448  8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
449  18, 19, 20, 21, 22, 13, 23, 24, 25, 26,
450  27, 28, 29, 8, 30, 8, 31, 13, 33, 33,
451  34, 34, 35, 49, 41, 59, 35, 35, 37, 50,
452  55, 55, 56, 56, 58, 35, 61, 35, 60, 35,
453  42, 40, 59, 58, 53, 35, 52, 35, 35, 35,
454  35, 51, 48, 47, 35, 35, 37, 44, 43, 42,
455  40, 38, 62, 35, 62, 35, 62, 35, 62, 62,
456  62, 62, 62, 35, 62, 35, 35, 35, 41, 42,
457  62, 62, 62, 62, 62, 62, 62, 62, 45, 62,
458 
459  46, 62, 62, 62, 62, 62, 62, 62, 62, 62,
460  41, 32, 32, 32, 36, 36, 36, 39, 39, 39,
461  41, 41, 41, 54, 54, 54, 57, 62, 57, 7,
462  62, 62, 62, 62, 62, 62, 62, 62, 62, 62,
463  62, 62, 62, 62, 62, 62, 62, 62, 62, 62,
464  62, 62, 62, 62, 62, 62, 62, 62
465  } ;
466 
468  { 0,
469  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
470  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
471  1, 1, 1, 1, 1, 1, 1, 1, 3, 4,
472  3, 4, 5, 27, 66, 58, 5, 5, 5, 27,
473  32, 54, 32, 54, 57, 5, 45, 5, 42, 5,
474  41, 39, 37, 35, 31, 5, 30, 5, 5, 5,
475  6, 28, 26, 25, 6, 6, 6, 16, 14, 13,
476  12, 11, 7, 6, 0, 6, 0, 6, 0, 0,
477  0, 0, 0, 6, 0, 6, 6, 6, 24, 24,
478  0, 0, 0, 0, 0, 0, 0, 0, 24, 0,
479 
480  24, 0, 0, 0, 0, 0, 0, 0, 0, 0,
481  24, 63, 63, 63, 64, 64, 64, 65, 65, 65,
482  67, 67, 67, 68, 68, 68, 69, 0, 69, 62,
483  62, 62, 62, 62, 62, 62, 62, 62, 62, 62,
484  62, 62, 62, 62, 62, 62, 62, 62, 62, 62,
485  62, 62, 62, 62, 62, 62, 62, 62
486  } ;
487 
488 /* The intent behind this definition is that it'll catch
489  * any uses of REJECT which flex missed.
490  */
491 #define REJECT reject_used_but_not_detected
492 #define yymore() (yyg->yy_more_flag = 1)
493 #define YY_MORE_ADJ yyg->yy_more_len
494 #define YY_RESTORE_YY_MORE_OFFSET
495 #line 1 "ast_expr2.fl"
496 #line 2 "ast_expr2.fl"
497 /*
498  * Asterisk -- An open source telephony toolkit.
499  *
500  * Copyright (C) 1999 - 2006, Digium, Inc.
501  *
502  * Mark Spencer <[email protected]>
503  *
504  * See http://www.asterisk.org for more information about
505  * the Asterisk project. Please do not directly contact
506  * any of the maintainers of this project for assistance;
507  * the project provides a web site, mailing lists and IRC
508  * channels for your use.
509  *
510  * This program is free software, distributed under the terms of
511  * the GNU General Public License Version 2. See the LICENSE file
512  * at the top of the source tree.
513  */
514 
515 /*! \file
516  *
517  * \brief Dialplan Expression Lexical Scanner
518  */
519 
520 #include <sys/types.h>
521 #include <stdio.h>
522 
523 #if defined(STANDALONE)
524 #ifndef __USE_ISOC99
525 #define __USE_ISOC99 1
526 #endif
527 #endif
528 
529 #ifdef __USE_ISOC99
530 #define FP___PRINTF "%.18Lg"
531 #define FP___FMOD fmodl
532 #define FP___STRTOD strtold
533 #define FP___TYPE long double
534 #else
535 #define FP___PRINTF "%.16g"
536 #define FP___FMOD fmod
537 #define FP___STRTOD strtod
538 #define FP___TYPE double
539 #endif
540 
541 #include <stdlib.h>
542 #include <string.h>
543 #include <locale.h>
544 #include <ctype.h>
545 #if !defined(SOLARIS) && !defined(__CYGWIN__)
546 /* #include <err.h> */
547 #else
548 #define quad_t int64_t
549 #endif
550 #include <errno.h>
551 #include <regex.h>
552 #include <limits.h>
553 
554 #include "asterisk/ast_expr.h"
555 #include "asterisk/logger.h"
556 #ifndef STANDALONE
557 #include "asterisk/strings.h"
558 #include "asterisk/channel.h"
559 #endif
560 
561 /* Conditionally redefine the macro from flex 2.5.35, in case someone uses flex <2.5.35 to regenerate this file. */
562 #ifndef ECHO
563 #define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
564 #endif
565 
566 enum valtype {
568 } ;
569 
570 struct val {
571  enum valtype type;
572  union {
573  char *s;
574  FP___TYPE i; /* long double or just double if it's a bad day */
575  } u;
576 } ;
577 
578 #include "ast_expr2.h" /* the o/p of the bison on ast_expr2.y */
579 
580 #define SET_COLUMNS do { \
581  yylloc_param->first_column = (int)(yyg->yytext_r - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf); \
582  yylloc_param->last_column += yyleng - 1; \
583  yylloc_param->first_line = yylloc_param->last_line = 1; \
584  } while (0)
585 
586 #define SET_STRING do { \
587  yylval_param->val = calloc(1, sizeof(struct val)); \
588  yylval_param->val->type = AST_EXPR_string; \
589  yylval_param->val->u.s = strdup(yytext); \
590  } while (0)
591 
592 #define SET_NUMERIC_STRING do { \
593  yylval_param->val = calloc(1, sizeof(struct val)); \
594  yylval_param->val->type = AST_EXPR_numeric_string; \
595  yylval_param->val->u.s = strdup(yytext); \
596  } while (0)
597 
598 struct parse_io
599 {
600  char *string;
601  struct val *val;
602  yyscan_t scanner;
603  struct ast_channel *chan;
604 };
605 
606 void ast_yyset_column(int column_no, yyscan_t yyscanner);
607 int ast_yyget_column(yyscan_t yyscanner);
608 static int curlycount = 0;
609 static char *expr2_token_subst(const char *mess);
610 
611 #line 611 "ast_expr2f.c"
612 
613 #define INITIAL 0
614 #define var 1
615 #define trail 2
616 
617 #ifndef YY_NO_UNISTD_H
618 /* Special case for "unistd.h", since it is non-ANSI. We include it way
619  * down here because we want the user's section 1 to have been scanned first.
620  * The user has a chance to override it with an option.
621  */
622 #include <unistd.h>
623 #endif
624 
625 #ifndef YY_EXTRA_TYPE
626 #define YY_EXTRA_TYPE void *
627 #endif
628 
629 /* Holds the entire state of the reentrant scanner. */
630 struct yyguts_t
631  {
632 
633  /* User-defined. Not touched by flex. */
635 
636  /* The rest are the same as the globals declared in the non-reentrant scanner. */
637  FILE *yyin_r, *yyout_r;
638  size_t yy_buffer_stack_top; /**< index of top of stack. */
639  size_t yy_buffer_stack_max; /**< capacity of stack. */
640  YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */
643  int yyleng_r;
644  char *yy_c_buf_p;
645  int yy_init;
646  int yy_start;
653 
656 
657  char *yytext_r;
660 
662 
664 
665  }; /* end struct yyguts_t */
666 
667 static int yy_init_globals (yyscan_t yyscanner );
668 
669  /* This must go here because YYSTYPE and YYLTYPE are included
670  * from bison output in section 1.*/
671  # define yylval yyg->yylval_r
672 
673  # define yylloc yyg->yylloc_r
674 
675 int ast_yylex_init (yyscan_t* scanner);
676 
677 int ast_yylex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner);
678 
679 /* Accessor methods to globals.
680  These are made visible to non-reentrant scanners for convenience. */
681 
682 int ast_yylex_destroy (yyscan_t yyscanner );
683 
684 int ast_yyget_debug (yyscan_t yyscanner );
685 
686 void ast_yyset_debug (int debug_flag ,yyscan_t yyscanner );
687 
689 
690 void ast_yyset_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner );
691 
692 FILE *ast_yyget_in (yyscan_t yyscanner );
693 
694 void ast_yyset_in (FILE * in_str ,yyscan_t yyscanner );
695 
696 FILE *ast_yyget_out (yyscan_t yyscanner );
697 
698 void ast_yyset_out (FILE * out_str ,yyscan_t yyscanner );
699 
700 int ast_yyget_leng (yyscan_t yyscanner );
701 
702 char *ast_yyget_text (yyscan_t yyscanner );
703 
704 int ast_yyget_lineno (yyscan_t yyscanner );
705 
706 void ast_yyset_lineno (int line_number ,yyscan_t yyscanner );
707 
708 YYSTYPE * ast_yyget_lval (yyscan_t yyscanner );
709 
710 void ast_yyset_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner );
711 
712  YYLTYPE *ast_yyget_lloc (yyscan_t yyscanner );
713 
714  void ast_yyset_lloc (YYLTYPE * yylloc_param ,yyscan_t yyscanner );
715 
716 /* Macros after this point can all be overridden by user definitions in
717  * section 1.
718  */
719 
720 #ifndef YY_SKIP_YYWRAP
721 #ifdef __cplusplus
722 extern "C" int ast_yywrap (yyscan_t yyscanner );
723 #else
724 extern int ast_yywrap (yyscan_t yyscanner );
725 #endif
726 #endif
727 
728  static void yyunput (int c,char *buf_ptr ,yyscan_t yyscanner);
729 
730 #ifndef yytext_ptr
731 static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner);
732 #endif
733 
734 #ifdef YY_NEED_STRLEN
735 static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner);
736 #endif
737 
738 #ifndef YY_NO_INPUT
739 
740 #ifdef __cplusplus
741 static int yyinput (yyscan_t yyscanner );
742 #else
743 static int input (yyscan_t yyscanner );
744 #endif
745 
746 #endif
747 
748 /* Amount of stuff to slurp up with each read. */
749 #ifndef YY_READ_BUF_SIZE
750 #ifdef __ia64__
751 /* On IA-64, the buffer size is 16k, not 8k */
752 #define YY_READ_BUF_SIZE 16384
753 #else
754 #define YY_READ_BUF_SIZE 8192
755 #endif /* __ia64__ */
756 #endif
757 
758 /* Copy whatever the last rule matched to the standard output. */
759 #ifndef ECHO
760 /* This used to be an fputs(), but since the string might contain NUL's,
761  * we now use fwrite().
762  */
763 #define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
764 #endif
765 
766 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
767  * is returned in "result".
768  */
769 #ifndef YY_INPUT
770 #define YY_INPUT(buf,result,max_size) \
771  if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
772  { \
773  int c = '*'; \
774  size_t n; \
775  for ( n = 0; n < max_size && \
776  (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
777  buf[n] = (char) c; \
778  if ( c == '\n' ) \
779  buf[n++] = (char) c; \
780  if ( c == EOF && ferror( yyin ) ) \
781  YY_FATAL_ERROR( "input in flex scanner failed" ); \
782  result = n; \
783  } \
784  else \
785  { \
786  errno=0; \
787  while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
788  { \
789  if( errno != EINTR) \
790  { \
791  YY_FATAL_ERROR( "input in flex scanner failed" ); \
792  break; \
793  } \
794  errno=0; \
795  clearerr(yyin); \
796  } \
797  }\
798 \
799 
800 #endif
801 
802 /* No semi-colon after return; correct usage is to write "yyterminate();" -
803  * we don't want an extra ';' after the "return" because that will cause
804  * some compilers to complain about unreachable statements.
805  */
806 #ifndef yyterminate
807 #define yyterminate() return YY_NULL
808 #endif
809 
810 /* Number of entries by which start-condition stack grows. */
811 #ifndef YY_START_STACK_INCR
812 #define YY_START_STACK_INCR 25
813 #endif
814 
815 /* Report a fatal error. */
816 #ifndef YY_FATAL_ERROR
817 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner)
818 #endif
819 
820 /* end tables serialization structures and prototypes */
821 
822 /* Default declaration of generated scanner - a define so the user can
823  * easily add parameters.
824  */
825 #ifndef YY_DECL
826 #define YY_DECL_IS_OURS 1
827 
828 extern int ast_yylex \
829  (YYSTYPE * yylval_param,YYLTYPE * yylloc_param ,yyscan_t yyscanner);
830 
831 #define YY_DECL int ast_yylex \
832  (YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner)
833 #endif /* !YY_DECL */
834 
835 /* Code executed at the beginning of each rule, after yytext and yyleng
836  * have been set up.
837  */
838 #ifndef YY_USER_ACTION
839 #define YY_USER_ACTION
840 #endif
841 
842 /* Code executed at the end of each rule. */
843 #ifndef YY_BREAK
844 #define YY_BREAK break;
845 #endif
846 
847 #define YY_RULE_SETUP \
848  YY_USER_ACTION
849 
850 /** The main scanner function which does all the work.
851  */
852 YY_DECL
853 {
854  register yy_state_type yy_current_state;
855  register char *yy_cp, *yy_bp;
856  register int yy_act;
857  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
858 
859 #line 130 "ast_expr2.fl"
860 
861 
862 #line 862 "ast_expr2f.c"
863 
864  yylval = yylval_param;
865 
866  yylloc = yylloc_param;
867 
868  if ( !yyg->yy_init )
869  {
870  yyg->yy_init = 1;
871 
872 #ifdef YY_USER_INIT
873  YY_USER_INIT;
874 #endif
875 
876  if ( ! yyg->yy_start )
877  yyg->yy_start = 1; /* first start state */
878 
879  if ( ! yyin )
880  yyin = stdin;
881 
882  if ( ! yyout )
883  yyout = stdout;
884 
885  if ( ! YY_CURRENT_BUFFER ) {
886  ast_yyensure_buffer_stack (yyscanner);
889  }
890 
891  ast_yy_load_buffer_state(yyscanner );
892  }
893 
894  while ( 1 ) /* loops until end-of-file is reached */
895  {
896  yyg->yy_more_len = 0;
897  if ( yyg->yy_more_flag )
898  {
899  yyg->yy_more_len = yyg->yy_c_buf_p - yyg->yytext_ptr;
900  yyg->yy_more_flag = 0;
901  }
902  yy_cp = yyg->yy_c_buf_p;
903 
904  /* Support of yytext. */
905  *yy_cp = yyg->yy_hold_char;
906 
907  /* yy_bp points to the position in yy_ch_buf of the start of
908  * the current run.
909  */
910  yy_bp = yy_cp;
911 
912  yy_current_state = yyg->yy_start;
913 yy_match:
914  do
915  {
916  register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
917  if ( yy_accept[yy_current_state] )
918  {
919  yyg->yy_last_accepting_state = yy_current_state;
921  }
922  while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
923  {
924  yy_current_state = (int) yy_def[yy_current_state];
925  if ( yy_current_state >= 63 )
926  yy_c = yy_meta[(unsigned int) yy_c];
927  }
928  yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
929  ++yy_cp;
930  }
931  while ( yy_current_state != 62 );
932  yy_cp = yyg->yy_last_accepting_cpos;
933  yy_current_state = yyg->yy_last_accepting_state;
934 
935 yy_find_action:
936  yy_act = yy_accept[yy_current_state];
937 
939 
940 do_action: /* This label is used only to access EOF actions. */
941 
942  switch ( yy_act )
943  { /* beginning of action switch */
944  case 0: /* must back up */
945  /* undo the effects of YY_DO_BEFORE_ACTION */
946  *yy_cp = yyg->yy_hold_char;
947  yy_cp = yyg->yy_last_accepting_cpos;
948  yy_current_state = yyg->yy_last_accepting_state;
949  goto yy_find_action;
950 
951 case 1:
953 #line 132 "ast_expr2.fl"
954 { SET_COLUMNS; SET_STRING; return TOK_OR;}
955  YY_BREAK
956 case 2:
958 #line 133 "ast_expr2.fl"
959 { SET_COLUMNS; SET_STRING; return TOK_AND;}
960  YY_BREAK
961 case 3:
963 #line 134 "ast_expr2.fl"
964 { SET_COLUMNS; SET_STRING; return TOK_EQ;}
965  YY_BREAK
966 case 4:
968 #line 135 "ast_expr2.fl"
969 { SET_COLUMNS; SET_STRING; return TOK_OR;}
970  YY_BREAK
971 case 5:
973 #line 136 "ast_expr2.fl"
974 { SET_COLUMNS; SET_STRING; return TOK_AND;}
975  YY_BREAK
976 case 6:
978 #line 137 "ast_expr2.fl"
979 { SET_COLUMNS; SET_STRING; return TOK_EQ;}
980  YY_BREAK
981 case 7:
983 #line 138 "ast_expr2.fl"
985  YY_BREAK
986 case 8:
988 #line 139 "ast_expr2.fl"
990  YY_BREAK
991 case 9:
993 #line 140 "ast_expr2.fl"
994 { SET_COLUMNS; SET_STRING; return TOK_GT;}
995  YY_BREAK
996 case 10:
998 #line 141 "ast_expr2.fl"
999 { SET_COLUMNS; SET_STRING; return TOK_LT;}
1000  YY_BREAK
1001 case 11:
1003 #line 142 "ast_expr2.fl"
1004 { SET_COLUMNS; SET_STRING; return TOK_GE;}
1005  YY_BREAK
1006 case 12:
1008 #line 143 "ast_expr2.fl"
1009 { SET_COLUMNS; SET_STRING; return TOK_LE;}
1010  YY_BREAK
1011 case 13:
1013 #line 144 "ast_expr2.fl"
1014 { SET_COLUMNS; SET_STRING; return TOK_NE;}
1015  YY_BREAK
1016 case 14:
1018 #line 145 "ast_expr2.fl"
1019 { SET_COLUMNS; SET_STRING; return TOK_PLUS;}
1020  YY_BREAK
1021 case 15:
1023 #line 146 "ast_expr2.fl"
1024 { SET_COLUMNS; SET_STRING; return TOK_COMMA;}
1025  YY_BREAK
1026 case 16:
1028 #line 147 "ast_expr2.fl"
1029 { SET_COLUMNS; SET_STRING; return TOK_MINUS;}
1030  YY_BREAK
1031 case 17:
1033 #line 148 "ast_expr2.fl"
1034 { SET_COLUMNS; SET_STRING; return TOK_MULT;}
1035  YY_BREAK
1036 case 18:
1038 #line 149 "ast_expr2.fl"
1039 { SET_COLUMNS; SET_STRING; return TOK_DIV;}
1040  YY_BREAK
1041 case 19:
1043 #line 150 "ast_expr2.fl"
1044 { SET_COLUMNS; SET_STRING; return TOK_MOD;}
1045  YY_BREAK
1046 case 20:
1048 #line 151 "ast_expr2.fl"
1049 { SET_COLUMNS; SET_STRING; return TOK_COND;}
1050  YY_BREAK
1051 case 21:
1053 #line 152 "ast_expr2.fl"
1054 { SET_COLUMNS; SET_STRING; return TOK_COMPL;}
1055  YY_BREAK
1056 case 22:
1058 #line 153 "ast_expr2.fl"
1059 { SET_COLUMNS; SET_STRING; return TOK_COLON;}
1060  YY_BREAK
1061 case 23:
1063 #line 154 "ast_expr2.fl"
1065  YY_BREAK
1066 case 24:
1068 #line 155 "ast_expr2.fl"
1069 { SET_COLUMNS; SET_STRING; return TOK_LP;}
1070  YY_BREAK
1071 case 25:
1073 #line 156 "ast_expr2.fl"
1074 { SET_COLUMNS; SET_STRING; return TOK_RP;}
1075  YY_BREAK
1076 case 26:
1078 #line 157 "ast_expr2.fl"
1079 {
1080  /* gather the contents of ${} expressions, with trailing stuff,
1081  * into a single TOKEN.
1082  * They are much more complex now than they used to be
1083  */
1084  curlycount = 0;
1085  BEGIN(var);
1086  yymore();
1087  }
1088  YY_BREAK
1089 case 27:
1091 #line 167 "ast_expr2.fl"
1092 {}
1093  YY_BREAK
1094 case 28:
1095 /* rule 28 can match eol */
1097 #line 168 "ast_expr2.fl"
1098 {SET_COLUMNS; SET_STRING; return TOKEN;}
1099  YY_BREAK
1100 case 29:
1101 /* rule 29 can match eol */
1103 #line 170 "ast_expr2.fl"
1104 {/* what to do with eol */}
1105  YY_BREAK
1106 case 30:
1108 #line 171 "ast_expr2.fl"
1109 {
1110  SET_COLUMNS;
1111  /* the original behavior of the expression parser was
1112  * to bring in numbers as a numeric string
1113  */
1115  return TOKEN;
1116  }
1117  YY_BREAK
1118 case 31:
1119 /* rule 31 can match eol */
1121 #line 180 "ast_expr2.fl"
1122 {
1123  SET_COLUMNS;
1124  SET_STRING;
1125  return TOKEN;
1126  }
1127  YY_BREAK
1128 case 32:
1129 /* rule 32 can match eol */
1131 #line 186 "ast_expr2.fl"
1132 {
1133  curlycount = 0;
1134  BEGIN(var);
1135  yymore();
1136  }
1137  YY_BREAK
1138 case 33:
1139 /* rule 33 can match eol */
1141 #line 192 "ast_expr2.fl"
1142 {
1143  curlycount--;
1144  if (curlycount < 0) {
1145  BEGIN(trail);
1146  yymore();
1147  } else {
1148  yymore();
1149  }
1150  }
1151  YY_BREAK
1152 case 34:
1153 /* rule 34 can match eol */
1155 #line 202 "ast_expr2.fl"
1156 {
1157  curlycount++;
1158  yymore();
1159  }
1160  YY_BREAK
1161 case 35:
1163 #line 208 "ast_expr2.fl"
1164 {
1165  BEGIN(0);
1166  SET_COLUMNS;
1167  SET_STRING;
1168  return TOKEN;
1169  }
1170  YY_BREAK
1171 case 36:
1173 #line 215 "ast_expr2.fl"
1174 {
1175  curlycount = 0;
1176  BEGIN(var);
1177  yymore();
1178  }
1179  YY_BREAK
1180 case 37:
1181 /* rule 37 can match eol */
1183 #line 221 "ast_expr2.fl"
1184 {
1185  char c = yytext[yyleng-1];
1186  BEGIN(0);
1187  unput(c);
1188  SET_COLUMNS;
1189  SET_STRING;
1190  return TOKEN;
1191  }
1192  YY_BREAK
1193 case YY_STATE_EOF(trail):
1194 #line 230 "ast_expr2.fl"
1195 {
1196  BEGIN(0);
1197  SET_COLUMNS;
1198  SET_STRING;
1199  return TOKEN;
1200  /*actually, if an expr is only a variable ref, this could happen a LOT */
1201  }
1202  YY_BREAK
1203 case 38:
1205 #line 238 "ast_expr2.fl"
1206 ECHO;
1207  YY_BREAK
1208 #line 1208 "ast_expr2f.c"
1209 case YY_STATE_EOF(INITIAL):
1210 case YY_STATE_EOF(var):
1211  yyterminate();
1212 
1213  case YY_END_OF_BUFFER:
1214  {
1215  /* Amount of text matched not including the EOB char. */
1216  int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1;
1217 
1218  /* Undo the effects of YY_DO_BEFORE_ACTION. */
1219  *yy_cp = yyg->yy_hold_char;
1221 
1222  if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1223  {
1224  /* We're scanning a new file or input source. It's
1225  * possible that this happened because the user
1226  * just pointed yyin at a new source and called
1227  * ast_yylex(). If so, then we have to assure
1228  * consistency between YY_CURRENT_BUFFER and our
1229  * globals. Here is the right place to do so, because
1230  * this is the first action (other than possibly a
1231  * back-up) that will match for the new input source.
1232  */
1233  yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1234  YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
1235  YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1236  }
1237 
1238  /* Note that here we test for yy_c_buf_p "<=" to the position
1239  * of the first EOB in the buffer, since yy_c_buf_p will
1240  * already have been incremented past the NUL character
1241  * (since all states make transitions on EOB to the
1242  * end-of-buffer state). Contrast this with the test
1243  * in input().
1244  */
1245  if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
1246  { /* This was really a NUL. */
1247  yy_state_type yy_next_state;
1248 
1249  yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text;
1250 
1251  yy_current_state = yy_get_previous_state( yyscanner );
1252 
1253  /* Okay, we're now positioned to make the NUL
1254  * transition. We couldn't have
1255  * yy_get_previous_state() go ahead and do it
1256  * for us because it doesn't know how to deal
1257  * with the possibility of jamming (and we don't
1258  * want to build jamming into it because then it
1259  * will run more slowly).
1260  */
1261 
1262  yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner);
1263 
1264  yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1265 
1266  if ( yy_next_state )
1267  {
1268  /* Consume the NUL. */
1269  yy_cp = ++yyg->yy_c_buf_p;
1270  yy_current_state = yy_next_state;
1271  goto yy_match;
1272  }
1273 
1274  else
1275  {
1276  yy_cp = yyg->yy_last_accepting_cpos;
1277  yy_current_state = yyg->yy_last_accepting_state;
1278  goto yy_find_action;
1279  }
1280  }
1281 
1282  else switch ( yy_get_next_buffer( yyscanner ) )
1283  {
1284  case EOB_ACT_END_OF_FILE:
1285  {
1286  yyg->yy_did_buffer_switch_on_eof = 0;
1287 
1288  if ( ast_yywrap(yyscanner ) )
1289  {
1290  /* Note: because we've taken care in
1291  * yy_get_next_buffer() to have set up
1292  * yytext, we can now set up
1293  * yy_c_buf_p so that if some total
1294  * hoser (like flex itself) wants to
1295  * call the scanner after we return the
1296  * YY_NULL, it'll still work - another
1297  * YY_NULL will get returned.
1298  */
1299  yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ;
1300 
1301  yy_act = YY_STATE_EOF(YY_START);
1302  goto do_action;
1303  }
1304 
1305  else
1306  {
1307  if ( ! yyg->yy_did_buffer_switch_on_eof )
1308  YY_NEW_FILE;
1309  }
1310  break;
1311  }
1312 
1313  case EOB_ACT_CONTINUE_SCAN:
1314  yyg->yy_c_buf_p =
1315  yyg->yytext_ptr + yy_amount_of_matched_text;
1316 
1317  yy_current_state = yy_get_previous_state( yyscanner );
1318 
1319  yy_cp = yyg->yy_c_buf_p;
1320  yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1321  goto yy_match;
1322 
1323  case EOB_ACT_LAST_MATCH:
1324  yyg->yy_c_buf_p =
1325  &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars];
1326 
1327  yy_current_state = yy_get_previous_state( yyscanner );
1328 
1329  yy_cp = yyg->yy_c_buf_p;
1330  yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1331  goto yy_find_action;
1332  }
1333  break;
1334  }
1335 
1336  default:
1338  "fatal flex scanner internal error--no action found" );
1339  } /* end of action switch */
1340  } /* end of scanning one token */
1341 } /* end of ast_yylex */
1342 
1343 /* yy_get_next_buffer - try to read in a new buffer
1344  *
1345  * Returns a code representing an action:
1346  * EOB_ACT_LAST_MATCH -
1347  * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1348  * EOB_ACT_END_OF_FILE - end of file
1349  */
1350 static int yy_get_next_buffer (yyscan_t yyscanner)
1351 {
1352  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1353  register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1354  register char *source = yyg->yytext_ptr;
1355  register int number_to_move, i;
1356  int ret_val;
1357 
1358  if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] )
1360  "fatal flex scanner internal error--end of buffer missed" );
1361 
1362  if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1363  { /* Don't try to fill the buffer, so this is an EOF. */
1364  if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 )
1365  {
1366  /* We matched a single character, the EOB, so
1367  * treat this as a final EOF.
1368  */
1369  return EOB_ACT_END_OF_FILE;
1370  }
1371 
1372  else
1373  {
1374  /* We matched some text prior to the EOB, first
1375  * process it.
1376  */
1377  return EOB_ACT_LAST_MATCH;
1378  }
1379  }
1380 
1381  /* Try to read more data. */
1382 
1383  /* First move last chars to start of buffer. */
1384  number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1;
1385 
1386  for ( i = 0; i < number_to_move; ++i )
1387  *(dest++) = *(source++);
1388 
1389  if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1390  /* don't do the read, it's not guaranteed to return an EOF,
1391  * just force an EOF
1392  */
1393  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0;
1394 
1395  else
1396  {
1397  int num_to_read =
1398  YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1399 
1400  while ( num_to_read <= 0 )
1401  { /* Not enough room in the buffer - grow it. */
1402 
1403  /* just a shorter name for the current buffer */
1404  YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
1405 
1406  int yy_c_buf_p_offset =
1407  (int) (yyg->yy_c_buf_p - b->yy_ch_buf);
1408 
1409  if ( b->yy_is_our_buffer )
1410  {
1411  int new_size = b->yy_buf_size * 2;
1412 
1413  if ( new_size <= 0 )
1414  b->yy_buf_size += b->yy_buf_size / 8;
1415  else
1416  b->yy_buf_size *= 2;
1417 
1418  b->yy_ch_buf = (char *)
1419  /* Include room in for 2 EOB chars. */
1420  ast_yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ,yyscanner );
1421  }
1422  else
1423  /* Can't grow it, we don't own it. */
1424  b->yy_ch_buf = 0;
1425 
1426  if ( ! b->yy_ch_buf )
1428  "fatal error - scanner input buffer overflow" );
1429 
1430  yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1431 
1432  num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1433  number_to_move - 1;
1434 
1435  }
1436 
1437  if ( num_to_read > YY_READ_BUF_SIZE )
1438  num_to_read = YY_READ_BUF_SIZE;
1439 
1440  /* Read in more data. */
1441  YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1442  yyg->yy_n_chars, (size_t) num_to_read );
1443 
1444  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
1445  }
1446 
1447  if ( yyg->yy_n_chars == 0 )
1448  {
1449  if ( number_to_move == YY_MORE_ADJ )
1450  {
1451  ret_val = EOB_ACT_END_OF_FILE;
1452  ast_yyrestart(yyin ,yyscanner);
1453  }
1454 
1455  else
1456  {
1457  ret_val = EOB_ACT_LAST_MATCH;
1458  YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1460  }
1461  }
1462 
1463  else
1464  ret_val = EOB_ACT_CONTINUE_SCAN;
1465 
1466  if ((yy_size_t) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1467  /* Extend the array by 50%, plus the number we really need. */
1468  yy_size_t new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
1469  YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) ast_yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner );
1470  if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1471  YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1472  }
1473 
1474  yyg->yy_n_chars += number_to_move;
1477 
1478  yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1479 
1480  return ret_val;
1481 }
1482 
1483 /* yy_get_previous_state - get the state just before the EOB char was reached */
1484 
1486 {
1487  register yy_state_type yy_current_state;
1488  register char *yy_cp;
1489  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1490 
1491  yy_current_state = yyg->yy_start;
1492 
1493  for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp )
1494  {
1495  register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1496  if ( yy_accept[yy_current_state] )
1497  {
1498  yyg->yy_last_accepting_state = yy_current_state;
1500  }
1501  while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1502  {
1503  yy_current_state = (int) yy_def[yy_current_state];
1504  if ( yy_current_state >= 63 )
1505  yy_c = yy_meta[(unsigned int) yy_c];
1506  }
1507  yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1508  }
1509 
1510  return yy_current_state;
1511 }
1512 
1513 /* yy_try_NUL_trans - try to make a transition on the NUL character
1514  *
1515  * synopsis
1516  * next_state = yy_try_NUL_trans( current_state );
1517  */
1518  static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner)
1519 {
1520  register int yy_is_jam;
1521  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */
1522  register char *yy_cp = yyg->yy_c_buf_p;
1523 
1524  register YY_CHAR yy_c = 1;
1525  if ( yy_accept[yy_current_state] )
1526  {
1527  yyg->yy_last_accepting_state = yy_current_state;
1529  }
1530  while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1531  {
1532  yy_current_state = (int) yy_def[yy_current_state];
1533  if ( yy_current_state >= 63 )
1534  yy_c = yy_meta[(unsigned int) yy_c];
1535  }
1536  yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1537  yy_is_jam = (yy_current_state == 62);
1538 
1539  return yy_is_jam ? 0 : yy_current_state;
1540 }
1541 
1542  static void yyunput (int c, register char * yy_bp , yyscan_t yyscanner)
1543 {
1544  register char *yy_cp;
1545  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1546 
1547  yy_cp = yyg->yy_c_buf_p;
1548 
1549  /* undo effects of setting up yytext */
1550  *yy_cp = yyg->yy_hold_char;
1551 
1552  if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1553  { /* need to shift things up to make room */
1554  /* +2 for EOB chars. */
1555  register int number_to_move = yyg->yy_n_chars + 2;
1556  register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
1557  YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
1558  register char *source =
1559  &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
1560 
1561  while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1562  *--dest = *--source;
1563 
1564  yy_cp += (int) (dest - source);
1565  yy_bp += (int) (dest - source);
1566  YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
1567  yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
1568 
1569  if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1570  YY_FATAL_ERROR( "flex scanner push-back overflow" );
1571  }
1572 
1573  *--yy_cp = (char) c;
1574 
1575  yyg->yytext_ptr = yy_bp;
1576  yyg->yy_hold_char = *yy_cp;
1577  yyg->yy_c_buf_p = yy_cp;
1578 }
1579 
1580 #ifndef YY_NO_INPUT
1581 #ifdef __cplusplus
1582  static int yyinput (yyscan_t yyscanner)
1583 #else
1584  static int input (yyscan_t yyscanner)
1585 #endif
1586 
1587 {
1588  int c;
1589  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1590 
1591  *yyg->yy_c_buf_p = yyg->yy_hold_char;
1592 
1593  if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
1594  {
1595  /* yy_c_buf_p now points to the character we want to return.
1596  * If this occurs *before* the EOB characters, then it's a
1597  * valid NUL; if not, then we've hit the end of the buffer.
1598  */
1599  if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
1600  /* This was really a NUL. */
1601  *yyg->yy_c_buf_p = '\0';
1602 
1603  else
1604  { /* need more input */
1605  int offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
1606  ++yyg->yy_c_buf_p;
1607 
1608  switch ( yy_get_next_buffer( yyscanner ) )
1609  {
1610  case EOB_ACT_LAST_MATCH:
1611  /* This happens because yy_g_n_b()
1612  * sees that we've accumulated a
1613  * token and flags that we need to
1614  * try matching the token before
1615  * proceeding. But for input(),
1616  * there's no matching to consider.
1617  * So convert the EOB_ACT_LAST_MATCH
1618  * to EOB_ACT_END_OF_FILE.
1619  */
1620 
1621  /* Reset buffer status. */
1622  ast_yyrestart(yyin ,yyscanner);
1623 
1624  /*FALLTHROUGH*/
1625 
1626  case EOB_ACT_END_OF_FILE:
1627  {
1628  if ( ast_yywrap(yyscanner ) )
1629  return EOF;
1630 
1631  if ( ! yyg->yy_did_buffer_switch_on_eof )
1632  YY_NEW_FILE;
1633 #ifdef __cplusplus
1634  return yyinput(yyscanner);
1635 #else
1636  return input(yyscanner);
1637 #endif
1638  }
1639 
1640  case EOB_ACT_CONTINUE_SCAN:
1641  yyg->yy_c_buf_p = yyg->yytext_ptr + offset;
1642  break;
1643  }
1644  }
1645  }
1646 
1647  c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */
1648  *yyg->yy_c_buf_p = '\0'; /* preserve yytext */
1649  yyg->yy_hold_char = *++yyg->yy_c_buf_p;
1650 
1651  return c;
1652 }
1653 #endif /* ifndef YY_NO_INPUT */
1654 
1655 /** Immediately switch to a different input stream.
1656  * @param input_file A readable stream.
1657  * @param yyscanner The scanner object.
1658  * @note This function does not reset the start condition to @c INITIAL .
1659  */
1660  void ast_yyrestart (FILE * input_file , yyscan_t yyscanner)
1661 {
1662  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1663 
1664  if ( ! YY_CURRENT_BUFFER ){
1665  ast_yyensure_buffer_stack (yyscanner);
1668  }
1669 
1670  ast_yy_init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner);
1671  ast_yy_load_buffer_state(yyscanner );
1672 }
1673 
1674 /** Switch to a different input buffer.
1675  * @param new_buffer The new input buffer.
1676  * @param yyscanner The scanner object.
1677  */
1678  void ast_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
1679 {
1680  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1681 
1682  /* TODO. We should be able to replace this entire function body
1683  * with
1684  * ast_yypop_buffer_state();
1685  * ast_yypush_buffer_state(new_buffer);
1686  */
1687  ast_yyensure_buffer_stack (yyscanner);
1688  if ( YY_CURRENT_BUFFER == new_buffer )
1689  return;
1690 
1691  if ( YY_CURRENT_BUFFER )
1692  {
1693  /* Flush out information for old buffer. */
1694  *yyg->yy_c_buf_p = yyg->yy_hold_char;
1695  YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
1696  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
1697  }
1698 
1699  YY_CURRENT_BUFFER_LVALUE = new_buffer;
1700  ast_yy_load_buffer_state(yyscanner );
1701 
1702  /* We don't actually know whether we did this switch during
1703  * EOF (ast_yywrap()) processing, but the only time this flag
1704  * is looked at is after ast_yywrap() is called, so it's safe
1705  * to go ahead and always set it.
1706  */
1707  yyg->yy_did_buffer_switch_on_eof = 1;
1708 }
1709 
1710 static void ast_yy_load_buffer_state (yyscan_t yyscanner)
1711 {
1712  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1713  yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1714  yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1715  yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1716  yyg->yy_hold_char = *yyg->yy_c_buf_p;
1717 }
1718 
1719 /** Allocate and initialize an input buffer state.
1720  * @param file A readable stream.
1721  * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1722  * @param yyscanner The scanner object.
1723  * @return the allocated buffer state.
1724  */
1725  YY_BUFFER_STATE ast_yy_create_buffer (FILE * file, int size , yyscan_t yyscanner)
1726 {
1727  YY_BUFFER_STATE b;
1728 
1729  b = (YY_BUFFER_STATE) ast_yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner );
1730  if ( ! b )
1731  YY_FATAL_ERROR( "out of dynamic memory in ast_yy_create_buffer()" );
1732 
1733  b->yy_buf_size = size;
1734 
1735  /* yy_ch_buf has to be 2 characters longer than the size given because
1736  * we need to put in 2 end-of-buffer characters.
1737  */
1738  b->yy_ch_buf = (char *) ast_yyalloc(b->yy_buf_size + 2 ,yyscanner );
1739  if ( ! b->yy_ch_buf )
1740  YY_FATAL_ERROR( "out of dynamic memory in ast_yy_create_buffer()" );
1741 
1742  b->yy_is_our_buffer = 1;
1743 
1744  ast_yy_init_buffer(b,file ,yyscanner);
1745 
1746  return b;
1747 }
1748 
1749 /** Destroy the buffer.
1750  * @param b a buffer created with ast_yy_create_buffer()
1751  * @param yyscanner The scanner object.
1752  */
1753  void ast_yy_delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
1754 {
1755  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1756 
1757  if ( ! b )
1758  return;
1759 
1760  if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1762 
1763  if ( b->yy_is_our_buffer )
1764  ast_yyfree((void *) b->yy_ch_buf ,yyscanner );
1765 
1766  ast_yyfree((void *) b ,yyscanner );
1767 }
1768 
1769 #ifndef __cplusplus
1770 extern int isatty (int );
1771 #endif /* __cplusplus */
1772 
1773 /* Initializes or reinitializes a buffer.
1774  * This function is sometimes called more than once on the same buffer,
1775  * such as during a ast_yyrestart() or at EOF.
1776  */
1777  static void ast_yy_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner)
1778 
1779 {
1780  int oerrno = errno;
1781  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1782 
1783  ast_yy_flush_buffer(b ,yyscanner);
1784 
1785  b->yy_input_file = file;
1786  b->yy_fill_buffer = 1;
1787 
1788  /* If b is the current buffer, then ast_yy_init_buffer was _probably_
1789  * called from ast_yyrestart() or through yy_get_next_buffer.
1790  * In that case, we don't want to reset the lineno or column.
1791  */
1792  if (b != YY_CURRENT_BUFFER){
1793  b->yy_bs_lineno = 1;
1794  b->yy_bs_column = 0;
1795  }
1796 
1797  b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1798 
1799  errno = oerrno;
1800 }
1801 
1802 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
1803  * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
1804  * @param yyscanner The scanner object.
1805  */
1806  void ast_yy_flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
1807 {
1808  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1809  if ( ! b )
1810  return;
1811 
1812  b->yy_n_chars = 0;
1813 
1814  /* We always need two end-of-buffer characters. The first causes
1815  * a transition to the end-of-buffer state. The second causes
1816  * a jam in that state.
1817  */
1820 
1821  b->yy_buf_pos = &b->yy_ch_buf[0];
1822 
1823  b->yy_at_bol = 1;
1825 
1826  if ( b == YY_CURRENT_BUFFER )
1827  ast_yy_load_buffer_state(yyscanner );
1828 }
1829 
1830 /** Pushes the new state onto the stack. The new state becomes
1831  * the current state. This function will allocate the stack
1832  * if necessary.
1833  * @param new_buffer The new state.
1834  * @param yyscanner The scanner object.
1835  */
1836 void ast_yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
1837 {
1838  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1839  if (new_buffer == NULL)
1840  return;
1841 
1842  ast_yyensure_buffer_stack(yyscanner);
1843 
1844  /* This block is copied from ast_yy_switch_to_buffer. */
1845  if ( YY_CURRENT_BUFFER )
1846  {
1847  /* Flush out information for old buffer. */
1848  *yyg->yy_c_buf_p = yyg->yy_hold_char;
1849  YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
1850  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
1851  }
1852 
1853  /* Only push if top exists. Otherwise, replace top. */
1854  if (YY_CURRENT_BUFFER)
1855  yyg->yy_buffer_stack_top++;
1856  YY_CURRENT_BUFFER_LVALUE = new_buffer;
1857 
1858  /* copied from ast_yy_switch_to_buffer. */
1859  ast_yy_load_buffer_state(yyscanner );
1860  yyg->yy_did_buffer_switch_on_eof = 1;
1861 }
1862 
1863 /** Removes and deletes the top of the stack, if present.
1864  * The next element becomes the new top.
1865  * @param yyscanner The scanner object.
1866  */
1868 {
1869  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1870  if (!YY_CURRENT_BUFFER)
1871  return;
1872 
1875  if (yyg->yy_buffer_stack_top > 0)
1876  --yyg->yy_buffer_stack_top;
1877 
1878  if (YY_CURRENT_BUFFER) {
1879  ast_yy_load_buffer_state(yyscanner );
1880  yyg->yy_did_buffer_switch_on_eof = 1;
1881  }
1882 }
1883 
1884 /* Allocates the stack if it does not exist.
1885  * Guarantees space for at least one push.
1886  */
1887 static void ast_yyensure_buffer_stack (yyscan_t yyscanner)
1888 {
1889  int num_to_alloc;
1890  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1891 
1892  if (!yyg->yy_buffer_stack) {
1893 
1894  /* First allocation is just for 2 elements, since we don't know if this
1895  * scanner will even need a stack. We use 2 instead of 1 to avoid an
1896  * immediate realloc on the next call.
1897  */
1898  num_to_alloc = 1;
1900  (num_to_alloc * sizeof(struct yy_buffer_state*)
1901  , yyscanner);
1902  if ( ! yyg->yy_buffer_stack )
1903  YY_FATAL_ERROR( "out of dynamic memory in ast_yyensure_buffer_stack()" );
1904 
1905  memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1906 
1907  yyg->yy_buffer_stack_max = num_to_alloc;
1908  yyg->yy_buffer_stack_top = 0;
1909  return;
1910  }
1911 
1912  if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){
1913 
1914  /* Increase the buffer to prepare for a possible push. */
1915  int grow_size = 8 /* arbitrary grow size */;
1916 
1917  num_to_alloc = yyg->yy_buffer_stack_max + grow_size;
1919  (yyg->yy_buffer_stack,
1920  num_to_alloc * sizeof(struct yy_buffer_state*)
1921  , yyscanner);
1922  if ( ! yyg->yy_buffer_stack )
1923  YY_FATAL_ERROR( "out of dynamic memory in ast_yyensure_buffer_stack()" );
1924 
1925  /* zero only the new slots.*/
1926  memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*));
1927  yyg->yy_buffer_stack_max = num_to_alloc;
1928  }
1929 }
1930 
1931 /** Setup the input buffer state to scan directly from a user-specified character buffer.
1932  * @param base the character buffer
1933  * @param size the size in bytes of the character buffer
1934  * @param yyscanner The scanner object.
1935  * @return the newly allocated buffer state object.
1936  */
1937 YY_BUFFER_STATE ast_yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner)
1938 {
1939  YY_BUFFER_STATE b;
1940 
1941  if ( size < 2 ||
1942  base[size-2] != YY_END_OF_BUFFER_CHAR ||
1943  base[size-1] != YY_END_OF_BUFFER_CHAR )
1944  /* They forgot to leave room for the EOB's. */
1945  return 0;
1946 
1947  b = (YY_BUFFER_STATE) ast_yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner );
1948  if ( ! b )
1949  YY_FATAL_ERROR( "out of dynamic memory in ast_yy_scan_buffer()" );
1950 
1951  b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1952  b->yy_buf_pos = b->yy_ch_buf = base;
1953  b->yy_is_our_buffer = 0;
1954  b->yy_input_file = 0;
1955  b->yy_n_chars = b->yy_buf_size;
1956  b->yy_is_interactive = 0;
1957  b->yy_at_bol = 1;
1958  b->yy_fill_buffer = 0;
1960 
1961  ast_yy_switch_to_buffer(b ,yyscanner );
1962 
1963  return b;
1964 }
1965 
1966 /** Setup the input buffer state to scan a string. The next call to ast_yylex() will
1967  * scan from a @e copy of @a str.
1968  * @param yystr a NUL-terminated string to scan
1969  * @param yyscanner The scanner object.
1970  * @return the newly allocated buffer state object.
1971  * @note If you want to scan bytes that may contain NUL values, then use
1972  * ast_yy_scan_bytes() instead.
1973  */
1974 YY_BUFFER_STATE ast_yy_scan_string (yyconst char * yystr , yyscan_t yyscanner)
1975 {
1976 
1977  return ast_yy_scan_bytes(yystr,strlen(yystr) ,yyscanner);
1978 }
1979 
1980 /** Setup the input buffer state to scan the given bytes. The next call to ast_yylex() will
1981  * scan from a @e copy of @a bytes.
1982  * @param yybytes the byte buffer to scan
1983  * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
1984  * @param yyscanner The scanner object.
1985  * @return the newly allocated buffer state object.
1986  */
1987 YY_BUFFER_STATE ast_yy_scan_bytes (yyconst char * yybytes, int _yybytes_len , yyscan_t yyscanner)
1988 {
1989  YY_BUFFER_STATE b;
1990  char *buf;
1991  yy_size_t n;
1992  int i;
1993 
1994  /* Get memory for full buffer, including space for trailing EOB's. */
1995  n = _yybytes_len + 2;
1996  buf = (char *) ast_yyalloc(n ,yyscanner );
1997  if ( ! buf )
1998  YY_FATAL_ERROR( "out of dynamic memory in ast_yy_scan_bytes()" );
1999 
2000  for ( i = 0; i < _yybytes_len; ++i )
2001  buf[i] = yybytes[i];
2002 
2003  buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
2004 
2005  b = ast_yy_scan_buffer(buf,n ,yyscanner);
2006  if ( ! b )
2007  YY_FATAL_ERROR( "bad buffer in ast_yy_scan_bytes()" );
2008 
2009  /* It's okay to grow etc. this buffer, and we should throw it
2010  * away when we're done.
2011  */
2012  b->yy_is_our_buffer = 1;
2013 
2014  return b;
2015 }
2016 
2017 #ifndef YY_EXIT_FAILURE
2018 #define YY_EXIT_FAILURE 2
2019 #endif
2020 
2021 static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner)
2022 {
2023  (void) fprintf( stderr, "%s\n", msg );
2024  exit( YY_EXIT_FAILURE );
2025 }
2026 
2027 /* Redefine yyless() so it works in section 3 code. */
2028 
2029 #undef yyless
2030 #define yyless(n) \
2031  do \
2032  { \
2033  /* Undo effects of setting up yytext. */ \
2034  int yyless_macro_arg = (n); \
2035  YY_LESS_LINENO(yyless_macro_arg);\
2036  yytext[yyleng] = yyg->yy_hold_char; \
2037  yyg->yy_c_buf_p = yytext + yyless_macro_arg; \
2038  yyg->yy_hold_char = *yyg->yy_c_buf_p; \
2039  *yyg->yy_c_buf_p = '\0'; \
2040  yyleng = yyless_macro_arg; \
2041  } \
2042  while ( 0 )
2043 
2044 /* Accessor methods (get/set functions) to struct members. */
2045 
2046 /** Get the user-defined data for this scanner.
2047  * @param yyscanner The scanner object.
2048  */
2050 {
2051  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2052  return yyextra;
2053 }
2054 
2055 /** Get the current line number.
2056  * @param yyscanner The scanner object.
2057  */
2059 {
2060  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2061 
2062  if (! YY_CURRENT_BUFFER)
2063  return 0;
2064 
2065  return yylineno;
2066 }
2067 
2068 /** Get the current column number.
2069  * @param yyscanner The scanner object.
2070  */
2072 {
2073  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2074 
2075  if (! YY_CURRENT_BUFFER)
2076  return 0;
2077 
2078  return yycolumn;
2079 }
2080 
2081 /** Get the input stream.
2082  * @param yyscanner The scanner object.
2083  */
2084 FILE *ast_yyget_in (yyscan_t yyscanner)
2085 {
2086  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2087  return yyin;
2088 }
2089 
2090 /** Get the output stream.
2091  * @param yyscanner The scanner object.
2092  */
2093 FILE *ast_yyget_out (yyscan_t yyscanner)
2094 {
2095  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2096  return yyout;
2097 }
2098 
2099 /** Get the length of the current token.
2100  * @param yyscanner The scanner object.
2101  */
2102 int ast_yyget_leng (yyscan_t yyscanner)
2103 {
2104  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2105  return yyleng;
2106 }
2107 
2108 /** Get the current token.
2109  * @param yyscanner The scanner object.
2110  */
2111 
2112 char *ast_yyget_text (yyscan_t yyscanner)
2113 {
2114  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2115  return yytext;
2116 }
2117 
2118 /** Set the user-defined data. This data is never touched by the scanner.
2119  * @param user_defined The data to be associated with this scanner.
2120  * @param yyscanner The scanner object.
2121  */
2122 void ast_yyset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner)
2123 {
2124  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2125  yyextra = user_defined ;
2126 }
2127 
2128 /** Set the current line number.
2129  * @param line_number
2130  * @param yyscanner The scanner object.
2131  */
2132 void ast_yyset_lineno (int line_number , yyscan_t yyscanner)
2133 {
2134  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2135 
2136  /* lineno is only valid if an input buffer exists. */
2137  if (! YY_CURRENT_BUFFER )
2138  yy_fatal_error( "ast_yyset_lineno called with no buffer" , yyscanner);
2139 
2140  yylineno = line_number;
2141 }
2142 
2143 /** Set the current column.
2144  * \param column_no line_number
2145  * \param yyscanner The scanner object.
2146  */
2147 void ast_yyset_column (int column_no , yyscan_t yyscanner)
2148 {
2149  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2150 
2151  /* column is only valid if an input buffer exists. */
2152  if (! YY_CURRENT_BUFFER )
2153  yy_fatal_error( "ast_yyset_column called with no buffer" , yyscanner);
2154 
2155  yycolumn = column_no;
2156 }
2157 
2158 /** Set the input stream. This does not discard the current
2159  * input buffer.
2160  * @param in_str A readable stream.
2161  * @param yyscanner The scanner object.
2162  * @see ast_yy_switch_to_buffer
2163  */
2164 void ast_yyset_in (FILE * in_str , yyscan_t yyscanner)
2165 {
2166  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2167  yyin = in_str ;
2168 }
2169 
2170 void ast_yyset_out (FILE * out_str , yyscan_t yyscanner)
2171 {
2172  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2173  yyout = out_str ;
2174 }
2175 
2176 int ast_yyget_debug (yyscan_t yyscanner)
2177 {
2178  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2179  return yy_flex_debug;
2180 }
2181 
2182 void ast_yyset_debug (int bdebug , yyscan_t yyscanner)
2183 {
2184  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2185  yy_flex_debug = bdebug ;
2186 }
2187 
2188 /* Accessor methods for yylval and yylloc */
2189 
2191 {
2192  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2193  return yylval;
2194 }
2195 
2196 void ast_yyset_lval (YYSTYPE * yylval_param , yyscan_t yyscanner)
2197 {
2198  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2199  yylval = yylval_param;
2200 }
2201 
2203 {
2204  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2205  return yylloc;
2206 }
2207 
2208 void ast_yyset_lloc (YYLTYPE * yylloc_param , yyscan_t yyscanner)
2209 {
2210  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2211  yylloc = yylloc_param;
2212 }
2213 
2214 /* User-visible API */
2215 
2216 /* ast_yylex_init is special because it creates the scanner itself, so it is
2217  * the ONLY reentrant function that doesn't take the scanner as the last argument.
2218  * That's why we explicitly handle the declaration, instead of using our macros.
2219  */
2220 
2221 int ast_yylex_init(yyscan_t* ptr_yy_globals)
2222 
2223 {
2224  if (ptr_yy_globals == NULL){
2225  errno = EINVAL;
2226  return 1;
2227  }
2228 
2229  *ptr_yy_globals = (yyscan_t) ast_yyalloc ( sizeof( struct yyguts_t ), NULL );
2230 
2231  if (*ptr_yy_globals == NULL){
2232  errno = ENOMEM;
2233  return 1;
2234  }
2235 
2236  /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */
2237  memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
2238 
2239  return yy_init_globals ( *ptr_yy_globals );
2240 }
2241 
2242 /* ast_yylex_init_extra has the same functionality as ast_yylex_init, but follows the
2243  * convention of taking the scanner as the last argument. Note however, that
2244  * this is a *pointer* to a scanner, as it will be allocated by this call (and
2245  * is the reason, too, why this function also must handle its own declaration).
2246  * The user defined value in the first argument will be available to ast_yyalloc in
2247  * the yyextra field.
2248  */
2249 
2250 int ast_yylex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals )
2251 
2252 {
2253  struct yyguts_t dummy_yyguts;
2254 
2255  ast_yyset_extra (yy_user_defined, &dummy_yyguts);
2256 
2257  if (ptr_yy_globals == NULL){
2258  errno = EINVAL;
2259  return 1;
2260  }
2261 
2262  *ptr_yy_globals = (yyscan_t) ast_yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
2263 
2264  if (*ptr_yy_globals == NULL){
2265  errno = ENOMEM;
2266  return 1;
2267  }
2268 
2269  /* By setting to 0xAA, we expose bugs in
2270  yy_init_globals. Leave at 0x00 for releases. */
2271  memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
2272 
2273  ast_yyset_extra (yy_user_defined, *ptr_yy_globals);
2274 
2275  return yy_init_globals ( *ptr_yy_globals );
2276 }
2277 
2278 static int yy_init_globals (yyscan_t yyscanner)
2279 {
2280  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2281  /* Initialization is the same as for the non-reentrant scanner.
2282  * This function is called from ast_yylex_destroy(), so don't allocate here.
2283  */
2284 
2285  yyg->yy_buffer_stack = 0;
2286  yyg->yy_buffer_stack_top = 0;
2287  yyg->yy_buffer_stack_max = 0;
2288  yyg->yy_c_buf_p = (char *) 0;
2289  yyg->yy_init = 0;
2290  yyg->yy_start = 0;
2291 
2292  yyg->yy_start_stack_ptr = 0;
2293  yyg->yy_start_stack_depth = 0;
2294  yyg->yy_start_stack = NULL;
2295 
2296 /* Defined in main.c */
2297 #ifdef YY_STDINIT
2298  yyin = stdin;
2299  yyout = stdout;
2300 #else
2301  yyin = (FILE *) 0;
2302  yyout = (FILE *) 0;
2303 #endif
2304 
2305  /* For future reference: Set errno on error, since we are called by
2306  * ast_yylex_init()
2307  */
2308  return 0;
2309 }
2310 
2311 /* ast_yylex_destroy is for both reentrant and non-reentrant scanners. */
2313 {
2314  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2315 
2316  /* Pop the buffer stack, destroying each element. */
2317  while(YY_CURRENT_BUFFER){
2320  ast_yypop_buffer_state(yyscanner);
2321  }
2322 
2323  /* Destroy the stack itself. */
2324  ast_yyfree(yyg->yy_buffer_stack ,yyscanner);
2325  yyg->yy_buffer_stack = NULL;
2326 
2327  /* Destroy the start condition stack. */
2328  ast_yyfree(yyg->yy_start_stack ,yyscanner );
2329  yyg->yy_start_stack = NULL;
2330 
2331  /* Reset the globals. This is important in a non-reentrant scanner so the next time
2332  * ast_yylex() is called, initialization will occur. */
2333  yy_init_globals( yyscanner);
2334 
2335  /* Destroy the main struct (reentrant only). */
2336  ast_yyfree ( yyscanner , yyscanner );
2337  yyscanner = NULL;
2338  return 0;
2339 }
2340 
2341 /*
2342  * Internal utility routines.
2343  */
2344 
2345 #ifndef yytext_ptr
2346 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner)
2347 {
2348  register int i;
2349  for ( i = 0; i < n; ++i )
2350  s1[i] = s2[i];
2351 }
2352 #endif
2353 
2354 #ifdef YY_NEED_STRLEN
2355 static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner)
2356 {
2357  register int n;
2358  for ( n = 0; s[n]; ++n )
2359  ;
2360 
2361  return n;
2362 }
2363 #endif
2364 
2365 void *ast_yyalloc (yy_size_t size , yyscan_t yyscanner)
2366 {
2367  return (void *) malloc( size );
2368 }
2369 
2370 void *ast_yyrealloc (void * ptr, yy_size_t size , yyscan_t yyscanner)
2371 {
2372  /* The cast to (char *) in the following accommodates both
2373  * implementations that use char* generic pointers, and those
2374  * that use void* generic pointers. It works with the latter
2375  * because both ANSI C and C++ allow castless assignment from
2376  * any pointer type to void*, and deal with argument conversions
2377  * as though doing an assignment.
2378  */
2379  return (void *) realloc( (char *) ptr, size );
2380 }
2381 
2382 #define YYTABLES_NAME "yytables"
2383 
2384 #line 238 "ast_expr2.fl"
2385 
2386 
2387 
2388 /* I'm putting the interface routine to the whole parse here in the flexer input file
2389  mainly because of all the flexer initialization that has to be done. Shouldn't matter
2390  where it is, as long as it's somewhere. I didn't want to define a prototype for the
2391  ast_yy_scan_string in the .y file, because then, I'd have to define YY_BUFFER_STATE there...
2392  UGH! that would be inappropriate. */
2393 
2394 int ast_yyparse(void *); /* need to/should define this prototype for the call to yyparse */
2395 int ast_yyerror(const char *, YYLTYPE *, struct parse_io *); /* likewise */
2396 
2397 void ast_yyfree(void *ptr, yyscan_t yyscanner)
2398 {
2399  /* the normal generated ast_yyfree func just frees its first arg;
2400  this get complaints on some systems, as sometimes this
2401  arg is a nil ptr! It's usually not fatal, but is irritating! */
2402  free( (char *) ptr );
2403 }
2404 
2405 int ast_expr(char *expr, char *buf, int length, struct ast_channel *chan)
2406 {
2407  struct parse_io io = { .string = expr, .chan = chan };
2408  int return_value = 0;
2409 
2410  ast_yylex_init(&io.scanner);
2411 
2412  ast_yy_scan_string(expr, io.scanner);
2413 
2414  ast_yyparse ((void *) &io);
2415 
2416  ast_yylex_destroy(io.scanner);
2417 
2418  if (!io.val) {
2419  if (length > 1) {
2420  strcpy(buf, "0");
2421  return_value = 1;
2422  }
2423  } else {
2424  if (io.val->type == AST_EXPR_number) {
2425  int res_length;
2426 
2427  res_length = snprintf(buf, length, FP___PRINTF, io.val->u.i);
2428  return_value = (res_length <= length) ? res_length : length;
2429  } else {
2430  if (io.val->u.s)
2431 #if defined(STANDALONE) || defined(LOW_MEMORY) || defined(STANDALONE)
2432  strncpy(buf, io.val->u.s, length - 1);
2433 #else /* !STANDALONE && !LOW_MEMORY */
2434  ast_copy_string(buf, io.val->u.s, length);
2435 #endif /* STANDALONE || LOW_MEMORY */
2436  else
2437  buf[0] = 0;
2438  return_value = strlen(buf);
2439  free(io.val->u.s);
2440  }
2441  free(io.val);
2442  }
2443  return return_value;
2444 }
2445 
2446 #ifndef STANDALONE
2447 int ast_str_expr(struct ast_str **str, ssize_t maxlen, struct ast_channel *chan, char *expr)
2448 {
2449  struct parse_io io = { .string = expr, .chan = chan };
2450 
2451  ast_yylex_init(&io.scanner);
2452  ast_yy_scan_string(expr, io.scanner);
2453  ast_yyparse ((void *) &io);
2454  ast_yylex_destroy(io.scanner);
2455 
2456  if (!io.val) {
2457  ast_str_set(str, maxlen, "0");
2458  } else {
2459  if (io.val->type == AST_EXPR_number) {
2460  ast_str_set(str, maxlen, FP___PRINTF, io.val->u.i);
2461  } else if (io.val->u.s) {
2462  ast_str_set(str, maxlen, "%s", io.val->u.s);
2463  free(io.val->u.s);
2464  }
2465  free(io.val);
2466  }
2467  return ast_str_strlen(*str);
2468 }
2469 #endif
2470 
2471 
2476 
2478 {
2479  extra_error_message_supplied=1;
2480  strcpy(extra_error_message, message);
2481 }
2482 
2484 {
2485  extra_error_message_supplied=0;
2486  extra_error_message[0] = 0;
2487 }
2488 
2489 static const char * const expr2_token_equivs1[] =
2490 {
2491  "TOKEN",
2492  "TOK_COND",
2493  "TOK_COLONCOLON",
2494  "TOK_OR",
2495  "TOK_AND",
2496  "TOK_EQ",
2497  "TOK_GT",
2498  "TOK_LT",
2499  "TOK_GE",
2500  "TOK_LE",
2501  "TOK_NE",
2502  "TOK_PLUS",
2503  "TOK_MINUS",
2504  "TOK_MULT",
2505  "TOK_DIV",
2506  "TOK_MOD",
2507  "TOK_COMPL",
2508  "TOK_COLON",
2509  "TOK_EQTILDE",
2510  "TOK_COMMA",
2511  "TOK_RP",
2512  "TOK_LP"
2513 };
2514 
2515 static const char * const expr2_token_equivs2[] =
2516 {
2517  "<token>",
2518  "?",
2519  "::",
2520  "|",
2521  "&",
2522  "=",
2523  ">",
2524  "<",
2525  ">=",
2526  "<=",
2527  "!=",
2528  "+",
2529  "-",
2530  "*",
2531  "/",
2532  "%",
2533  "!",
2534  ":",
2535  "=~",
2536  ",",
2537  ")",
2538  "("
2539 };
2540 
2541 
2542 static char *expr2_token_subst(const char *mess)
2543 {
2544  /* calc a length, malloc, fill, and return; yyerror had better free it! */
2545  int len=0,i;
2546  const char *p;
2547  char *res, *s;
2548  const char *t;
2549  int expr2_token_equivs_entries = sizeof(expr2_token_equivs1)/sizeof(char*);
2550 
2551  for (p=mess; *p; p++) {
2552  for (i=0; i<expr2_token_equivs_entries; i++) {
2553  if ( strncmp(p,expr2_token_equivs1[i],strlen(expr2_token_equivs1[i])) == 0 )
2554  {
2555  len+=strlen(expr2_token_equivs2[i])+2;
2556  p += strlen(expr2_token_equivs1[i])-1;
2557  break;
2558  }
2559  }
2560  len++;
2561  }
2562  res = (char*)malloc(len+1);
2563  res[0] = 0;
2564  s = res;
2565  for (p=mess; *p;) {
2566  int found = 0;
2567  for (i=0; i<expr2_token_equivs_entries; i++) {
2568  if ( strncmp(p,expr2_token_equivs1[i],strlen(expr2_token_equivs1[i])) == 0 ) {
2569  *s++ = '\'';
2570  for (t=expr2_token_equivs2[i]; *t;) {
2571  *s++ = *t++;
2572  }
2573  *s++ = '\'';
2574  p += strlen(expr2_token_equivs1[i]);
2575  found = 1;
2576  break;
2577  }
2578  }
2579  if( !found )
2580  *s++ = *p++;
2581  }
2582  *s++ = 0;
2583  return res;
2584 }
2585 
2586 int ast_yyerror (const char *s, yyltype *loc, struct parse_io *parseio )
2587 {
2588  struct yyguts_t * yyg = (struct yyguts_t*)(parseio->scanner);
2589  char spacebuf[8000]; /* best safe than sorry */
2590  int i=0;
2591  char *s2 = expr2_token_subst(s);
2592  spacebuf[0] = 0;
2593 
2594  for (i = 0; i < (int)(yytext - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf); i++) {
2595  spacebuf[i] = ' ';
2596  }
2597  /* uh... assuming yyg is defined, then I can use the yycolumn macro,
2598  which is the same thing as... get this:
2599  yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]->yy_bs_column
2600  I was tempted to just use yy_buf_pos in the STATE, but..., well:
2601  a. the yy_buf_pos is the current position in the buffer, which
2602  may not relate to the entire string/buffer because of the
2603  buffering.
2604  b. but, analysis of the situation is that when you use the
2605  ast_yy_scan_string func, it creates a single buffer the size of
2606  string, so the two would be the same...
2607  so, in the end, the yycolumn macro is available, shorter, therefore easier. */
2608 
2609  spacebuf[i++] = '^';
2610  spacebuf[i] = 0;
2611 
2612 #ifdef STANDALONE3
2613  /* easier to read in the standalone version */
2614  printf("ast_yyerror(): %s syntax error: %s; Input:\n%s\n%s\n",
2615  (extra_error_message_supplied ? extra_error_message : ""), s2, parseio->string, spacebuf);
2616 #else
2617  ast_log(LOG_WARNING,"ast_yyerror(): %s syntax error: %s; Input:\n%s\n%s\n",
2618  (extra_error_message_supplied ? extra_error_message : ""), s2, parseio->string, spacebuf);
2619 #endif
2620 #ifndef STANDALONE
2621  ast_log(LOG_WARNING,"If you have questions, please refer to https://wiki.asterisk.org/wiki/display/AST/Channel+Variables\n");
2622 #endif
2623  free(s2);
2624  return(0);
2625 }
int ast_yyget_leng(yyscan_t yyscanner)
Definition: ast_expr2f.c:2102
#define YY_FATAL_ERROR(msg)
Definition: ast_expr2f.c:817
void ast_expr_clear_extra_error_info(void)
Definition: ast_expr2f.c:2483
static const char type[]
Definition: chan_ooh323.c:109
#define yyextra
Definition: ast_expr2f.c:135
void ast_yy_switch_to_buffer(YY_BUFFER_STATE new_buffer, yyscan_t yyscanner)
Definition: ast_expr2f.c:1678
int yyleng_r
Definition: ast_expr2f.c:643
void ast_yyset_out(FILE *out_str, yyscan_t yyscanner)
Definition: ast_expr2f.c:2170
Main Channel structure associated with a channel.
#define YY_START
Definition: ast_expr2f.c:152
int ast_yylex_init_extra(YY_EXTRA_TYPE user_defined, yyscan_t *scanner)
Definition: ast_expr2f.c:2250
int yylineno_r
Definition: ast_expr2f.c:654
char yy_hold_char
Definition: ast_expr2f.c:641
Asterisk main include file. File version handling, generic pbx functions.
signed char flex_int8_t
Definition: ast_expr2f.c:54
#define yycolumn
Definition: ast_expr2f.c:139
int ast_yyparse(void *)
#define FP___PRINTF
Definition: ast_expr2f.c:535
#define yyin
Definition: ast_expr2f.c:133
void ast_yyset_column(int column_no, yyscan_t yyscanner)
Definition: ast_expr2f.c:2147
#define YY_EXIT_FAILURE
Definition: ast_expr2f.c:2018
int yy_flex_debug_r
Definition: ast_expr2f.c:655
#define yytext
Definition: ast_expr2f.c:137
String manipulation functions.
struct yyguts_t * yyg
Definition: ast_expr2f.c:857
Definition: ast_expr2.c:325
#define YY_READ_BUF_SIZE
Definition: ast_expr2f.c:754
short int16_t
Definition: db.h:59
#define YY_END_OF_BUFFER
Definition: ast_expr2f.c:366
#define realloc(a, b)
Definition: astmm.h:163
char * yy_c_buf_p
Definition: ast_expr2f.c:644
#define YY_DO_BEFORE_ACTION
Definition: ast_expr2f.c:357
void * ast_yyalloc(yy_size_t, yyscan_t yyscanner)
Definition: ast_expr2f.c:2365
static int curlycount
Definition: ast_expr2f.c:608
YY_EXTRA_TYPE ast_yyget_extra(yyscan_t yyscanner)
Definition: ast_expr2f.c:2049
static int yy_init_globals(yyscan_t yyscanner)
Definition: ast_expr2f.c:2278
char buf[BUFSIZE]
Definition: eagi_proxy.c:66
YY_BUFFER_STATE ast_yy_create_buffer(FILE *file, int size, yyscan_t yyscanner)
Definition: ast_expr2f.c:1725
#define LOG_WARNING
Definition: logger.h:274
char * yy_ch_buf
Definition: ast_expr2f.c:218
#define yyconst
Definition: ast_expr2f.c:112
unsigned short int flex_uint16_t
Definition: ast_expr2f.c:58
#define YY_NEW_FILE
Definition: ast_expr2f.c:159
YYLTYPE * ast_yyget_lloc(yyscan_t yyscanner)
Definition: ast_expr2f.c:2202
#define var
Definition: ast_expr2f.c:614
void ast_yy_flush_buffer(YY_BUFFER_STATE b, yyscan_t yyscanner)
Definition: ast_expr2f.c:1806
static yy_state_type yy_try_NUL_trans(yy_state_type current_state, yyscan_t yyscanner)
Definition: ast_expr2f.c:1518
#define BEGIN
Definition: ast_expr2f.c:146
FILE * ast_yyget_out(yyscan_t yyscanner)
Definition: ast_expr2f.c:2093
YY_BUFFER_STATE ast_yy_scan_bytes(yyconst char *bytes, int len, yyscan_t yyscanner)
Definition: ast_expr2f.c:1987
char extra_error_message[4095]
Definition: ast_expr2f.c:2472
YY_BUFFER_STATE ast_yy_scan_string(yyconst char *yy_str, yyscan_t yyscanner)
Definition: ast_expr2f.c:1974
#define YY_STATE_EOF(state)
Definition: ast_expr2f.c:156
const char * string
Definition: presencestate.c:71
static struct test_val c
yyscan_t scanner
Definition: ael_structs.h:78
const char * str
Definition: app_jack.c:147
int ast_yylex(YYSTYPE *yylval_param, YYLTYPE *yylloc_param, yyscan_t yyscanner)
#define NULL
Definition: resample.c:96
#define EOB_ACT_END_OF_FILE
Definition: ast_expr2f.c:186
yy_size_t yy_buf_size
Definition: ast_expr2f.c:224
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:2447
static int input(yyscan_t yyscanner)
Definition: ast_expr2f.c:1584
YY_BUFFER_STATE * yy_buffer_stack
Definition: ast_expr2f.c:640
#define EOB_ACT_CONTINUE_SCAN
Definition: ast_expr2f.c:185
int yy_start_stack_depth
Definition: ast_expr2f.c:649
int yy_init
Definition: ast_expr2f.c:645
#define yy_flex_debug
Definition: ast_expr2f.c:140
void * ast_yyrealloc(void *, yy_size_t, yyscan_t yyscanner)
Definition: ast_expr2f.c:2370
#define YY_BREAK
Definition: ast_expr2f.c:844
void ast_yyset_extra(YY_EXTRA_TYPE user_defined, yyscan_t yyscanner)
Definition: ast_expr2f.c:2122
YYSTYPE * yylval_r
Definition: ast_expr2f.c:661
struct ast_channel * chan
Definition: ast_expr2.c:353
#define YY_RESTORE_YY_MORE_OFFSET
Definition: ast_expr2f.c:494
void * yyscan_t
Definition: ast_expr2f.c:128
void ast_yyset_lval(YYSTYPE *yylval_param, yyscan_t yyscanner)
Definition: ast_expr2f.c:2196
#define YY_END_OF_BUFFER_CHAR
Definition: ast_expr2f.c:161
int * yy_start_stack
Definition: ast_expr2f.c:650
#define YY_DECL
Definition: ast_expr2f.c:831
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:1065
#define yyleng
Definition: ast_expr2f.c:136
void ast_expr_register_extra_error_info(char *message)
Definition: ast_expr2f.c:2477
char * malloc()
int yy_start
Definition: ast_expr2f.c:646
#define ast_log
Definition: astobj2.c:42
#define YY_BUFFER_EOF_PENDING
Definition: ast_expr2f.c:272
#define SET_STRING
Definition: ast_expr2f.c:586
void free()
General Asterisk PBX channel definitions.
int ast_yylex_init(yyscan_t *scanner)
Definition: ast_expr2f.c:2221
static const char *const expr2_token_equivs1[]
Definition: ast_expr2f.c:2489
static const char *const expr2_token_equivs2[]
Definition: ast_expr2f.c:2515
YYLTYPE * yylloc_r
Definition: ast_expr2f.c:663
void ast_yyset_debug(int debug_flag, yyscan_t yyscanner)
Definition: ast_expr2f.c:2182
char * ast_yyget_text(yyscan_t yyscanner)
Definition: ast_expr2f.c:2112
int ast_yyerror(const char *, YYLTYPE *, struct parse_io *)
YY_EXTRA_TYPE yyextra_r
Definition: ast_expr2f.c:634
flex_int32_t yy_nxt
Definition: ast_expr2f.c:372
int yy_start_stack_ptr
Definition: ast_expr2f.c:648
#define INITIAL
Definition: ast_expr2f.c:613
static void yy_fatal_error(yyconst char msg[], yyscan_t yyscanner)
int yy_did_buffer_switch_on_eof
Definition: ast_expr2f.c:647
#define unput(c)
Definition: ast_expr2f.c:205
int yy_state_type
Definition: ast_expr2f.c:345
void ast_yyset_lineno(int line_number, yyscan_t yyscanner)
Definition: ast_expr2f.c:2132
#define yymore()
Definition: ast_expr2f.c:492
int yy_more_flag
Definition: ast_expr2f.c:658
register char * yy_cp
Definition: ast_expr2f.c:855
void ast_yyrestart(FILE *input_file, yyscan_t yyscanner)
Definition: ast_expr2f.c:1660
The descriptor of a dynamic string XXX storage will be optimized later if needed We use the ts field ...
Definition: strings.h:584
#define YY_SC_TO_UI(c)
Definition: ast_expr2f.c:123
register char * yy_bp
Definition: ast_expr2f.c:855
static yyconst flex_int16_t yy_chk[159]
Definition: ast_expr2f.c:467
static yyconst flex_int16_t yy_base[70]
Definition: ast_expr2f.c:424
int yy_n_chars
Definition: ast_expr2f.c:642
static int len(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t buflen)
int errno
int ast_expr(char *expr, char *buf, int length, struct ast_channel *chan)
Evaluate the given expression.
Definition: ast_expr2f.c:2405
char * yy_last_accepting_cpos
Definition: ast_expr2f.c:652
void ast_yypop_buffer_state(yyscan_t yyscanner)
Definition: ast_expr2f.c:1867
#define YY_BUFFER_NORMAL
Definition: ast_expr2f.c:261
int ast_yylex_destroy(yyscan_t yyscanner)
Definition: ast_expr2f.c:2312
#define YY_BUFFER_NEW
Definition: ast_expr2f.c:260
static yy_state_type yy_get_previous_state(yyscan_t yyscanner)
Definition: ast_expr2f.c:1485
#define trail
Definition: ast_expr2f.c:615
void ast_yyset_in(FILE *in_str, yyscan_t yyscanner)
Definition: ast_expr2f.c:2164
#define YY_CURRENT_BUFFER
Definition: ast_expr2f.c:283
unsigned char YY_CHAR
Definition: ast_expr2f.c:343
static int yy_get_next_buffer(yyscan_t yyscanner)
Definition: ast_expr2f.c:1350
unsigned char flex_uint8_t
Definition: ast_expr2f.c:57
FILE * ast_yyget_in(yyscan_t yyscanner)
Definition: ast_expr2f.c:2084
#define yylloc
Definition: ast_expr2f.c:673
static void ast_yy_load_buffer_state(yyscan_t yyscanner)
Definition: ast_expr2f.c:1710
unsigned int flex_uint32_t
Definition: ast_expr2f.c:59
struct yy_buffer_state * YY_BUFFER_STATE
Definition: ast_expr2f.c:182
void ast_yyfree(void *, yyscan_t yyscanner)
Definition: ast_expr2f.c:2397
static char * expr2_token_subst(const char *mess)
Definition: ast_expr2f.c:2542
Support for logging to various files, console and syslog Configuration in file logger.conf.
#define YY_EXTRA_TYPE
Definition: ast_expr2f.c:626
int ast_yyget_debug(yyscan_t yyscanner)
Definition: ast_expr2f.c:2176
#define YY_CURRENT_BUFFER_LVALUE
Definition: ast_expr2f.c:290
#define ast_yywrap(n)
Definition: ast_expr2f.c:340
#define SET_NUMERIC_STRING
Definition: ast_expr2f.c:592
void ast_yy_delete_buffer(YY_BUFFER_STATE b, yyscan_t yyscanner)
Definition: ast_expr2f.c:1753
size_t ast_str_strlen(const struct ast_str *buf)
Returns the current length of the string stored within buf.
Definition: strings.h:688
static yyconst flex_int32_t yy_meta[29]
Definition: ast_expr2f.c:417
#define yylineno
Definition: ast_expr2f.c:138
#define YY_INPUT(buf, result, max_size)
Definition: ast_expr2f.c:770
static void yyunput(int c, char *buf_ptr, yyscan_t yyscanner)
short int flex_int16_t
Definition: ast_expr2f.c:55
int flex_int32_t
Definition: ast_expr2f.c:56
#define YY_RULE_SETUP
Definition: ast_expr2f.c:847
void ast_copy_string(char *dst, const char *src, size_t size)
Size-limited null-terminating string copy.
Definition: strings.h:401
static yyconst flex_int16_t yy_nxt[159]
Definition: ast_expr2f.c:446
void * yyscan_t
Definition: ael_structs.h:71
#define FP___TYPE
Definition: ast_expr2f.c:538
void ast_yypush_buffer_state(YY_BUFFER_STATE new_buffer, yyscan_t yyscanner)
Definition: ast_expr2f.c:1836
FILE * yyout_r
Definition: ast_expr2f.c:637
int isatty(int)
int yy_more_len
Definition: ast_expr2f.c:659
static struct test_val b
int ast_yyget_column(yyscan_t yyscanner)
Definition: ast_expr2f.c:2071
#define yyterminate()
Definition: ast_expr2f.c:807
static void ast_yyensure_buffer_stack(yyscan_t yyscanner)
Definition: ast_expr2f.c:1887
size_t yy_buffer_stack_max
Definition: ast_expr2f.c:639
#define yylval
Definition: ast_expr2f.c:671
int int32_t
Definition: db.h:60
char * string
Definition: ast_expr2.c:350
__signed char int8_t
Definition: db.h:58
YY_BUFFER_STATE ast_yy_scan_buffer(char *base, yy_size_t size, yyscan_t yyscanner)
Definition: ast_expr2f.c:1937
#define SET_COLUMNS
Definition: ast_expr2f.c:580
register int yy_act
Definition: ast_expr2f.c:856
#define YY_BUF_SIZE
Definition: ast_expr2f.c:172
YYSTYPE * ast_yyget_lval(yyscan_t yyscanner)
Definition: ast_expr2f.c:2190
valtype
Definition: ast_expr2.c:317
size_t yy_size_t
Definition: ast_expr2f.c:209
yy_state_type yy_last_accepting_state
Definition: ast_expr2f.c:651
flex_int32_t yy_verify
Definition: ast_expr2f.c:371
int extra_error_message_supplied
Definition: ast_expr2f.c:2473
#define ECHO
Definition: ast_expr2f.c:563
#define YY_MORE_ADJ
Definition: ast_expr2f.c:493
#define yyout
Definition: ast_expr2f.c:134
int ast_yyget_lineno(yyscan_t yyscanner)
Definition: ast_expr2f.c:2058
static void ast_yy_init_buffer(YY_BUFFER_STATE b, FILE *file, yyscan_t yyscanner)
Definition: ast_expr2f.c:1777
size_t yy_buffer_stack_top
Definition: ast_expr2f.c:638
void ast_yyset_lloc(YYLTYPE *yylloc_param, yyscan_t yyscanner)
Definition: ast_expr2f.c:2208
static yyconst flex_int32_t yy_ec[256]
Definition: ast_expr2f.c:385
char * yytext_r
Definition: ast_expr2f.c:657
char * yy_buf_pos
Definition: ast_expr2f.c:219
static yyconst flex_int16_t yy_accept[63]
Definition: ast_expr2f.c:374
static yyconst flex_int16_t yy_def[70]
Definition: ast_expr2f.c:435
#define EOB_ACT_LAST_MATCH
Definition: ast_expr2f.c:187
FILE * yy_input_file
Definition: ast_expr2f.c:216