Wed Jan 8 2020 09:49:42

Asterisk developer's documentation


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