7 #define YY_INT_ALIGNED short int
9 /* A lexical scanner generated by flex */
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
19 /* First, we deal with platform-specific or compiler-specific issues. */
21 /* begin standard C headers. */
27 /* end standard C headers. */
29 /* flex integer type definitions */
34 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
36 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
38 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
39 * if you want the limit (max/min) macros for int types.
41 #ifndef __STDC_LIMIT_MACROS
42 #define __STDC_LIMIT_MACROS 1
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;
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;
60 /* Limits of integral types. */
62 #define INT8_MIN (-128)
65 #define INT16_MIN (-32767-1)
68 #define INT32_MIN (-2147483647-1)
71 #define INT8_MAX (127)
74 #define INT16_MAX (32767)
77 #define INT32_MAX (2147483647)
80 #define UINT8_MAX (255U)
83 #define UINT16_MAX (65535U)
86 #define UINT32_MAX (4294967295U)
91 #endif /* ! FLEXINT_H */
95 /* The "const" storage-class-modifier is valid. */
98 #else /* ! __cplusplus */
100 /* C99 requires __STDC__ to be defined as 1. */
101 #if defined (__STDC__)
105 #endif /* defined (__STDC__) */
106 #endif /* ! __cplusplus */
109 #define yyconst const
114 /* Returned upon end-of-file. */
117 /* Promotes a possibly negative, possibly signed char to an unsigned
118 * integer for use as an array index. If the signed char is negative,
119 * we want to instead treat it as an 8-bit unsigned char, hence the
122 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
124 /* An opaque pointer. */
125 #ifndef YY_TYPEDEF_YY_SCANNER_T
126 #define YY_TYPEDEF_YY_SCANNER_T
127 typedef void* yyscan_t;
130 /* For convenience, these vars (plus the bison vars far below)
131 are macros in the reentrant scanner. */
132 #define yyin yyg->yyin_r
133 #define yyout yyg->yyout_r
134 #define yyextra yyg->yyextra_r
135 #define yyleng yyg->yyleng_r
136 #define yytext yyg->yytext_r
137 #define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)
138 #define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
139 #define yy_flex_debug yyg->yy_flex_debug_r
141 /* Enter a start condition. This macro really ought to take a parameter,
142 * but we do it the disgusting crufty way forced on us by the ()-less
143 * definition of BEGIN.
145 #define BEGIN yyg->yy_start = 1 + 2 *
147 /* Translate the current start state into a value that can be later handed
148 * to BEGIN to return to the state. The YYSTATE alias is for lex
151 #define YY_START ((yyg->yy_start - 1) / 2)
152 #define YYSTATE YY_START
154 /* Action number for EOF rule of a given start state. */
155 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
157 /* Special action meaning "start processing a new file". */
158 #define YY_NEW_FILE ael_yyrestart(yyin ,yyscanner )
160 #define YY_END_OF_BUFFER_CHAR 0
162 /* Size of default input buffer. */
165 /* On IA-64, the buffer size is 16k, not 8k.
166 * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
167 * Ditto for the __ia64__ case accordingly.
169 #define YY_BUF_SIZE 32768
171 #define YY_BUF_SIZE 16384
172 #endif /* __ia64__ */
175 /* The state buf must be large enough to hold one state per character in the main buffer.
177 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
179 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
180 #define YY_TYPEDEF_YY_BUFFER_STATE
181 typedef struct yy_buffer_state *YY_BUFFER_STATE;
184 #define EOB_ACT_CONTINUE_SCAN 0
185 #define EOB_ACT_END_OF_FILE 1
186 #define EOB_ACT_LAST_MATCH 2
188 #define YY_LESS_LINENO(n)
190 /* Return all but the first "n" matched characters back to the input stream. */
194 /* Undo effects of setting up yytext. */ \
195 int yyless_macro_arg = (n); \
196 YY_LESS_LINENO(yyless_macro_arg);\
197 *yy_cp = yyg->yy_hold_char; \
198 YY_RESTORE_YY_MORE_OFFSET \
199 yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
200 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
204 #define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
206 #ifndef YY_TYPEDEF_YY_SIZE_T
207 #define YY_TYPEDEF_YY_SIZE_T
208 typedef size_t yy_size_t;
211 #ifndef YY_STRUCT_YY_BUFFER_STATE
212 #define YY_STRUCT_YY_BUFFER_STATE
213 struct yy_buffer_state
217 char *yy_ch_buf; /* input buffer */
218 char *yy_buf_pos; /* current position in input buffer */
220 /* Size of input buffer in bytes, not including room for EOB
223 yy_size_t yy_buf_size;
225 /* Number of characters read into yy_ch_buf, not including EOB
230 /* Whether we "own" the buffer - i.e., we know we created it,
231 * and can realloc() it to grow it, and should free() it to
234 int yy_is_our_buffer;
236 /* Whether this is an "interactive" input source; if so, and
237 * if we're using stdio for input, then we want to use getc()
238 * instead of fread(), to make sure we stop fetching input after
241 int yy_is_interactive;
243 /* Whether we're considered to be at the beginning of a line.
244 * If so, '^' rules will be active on the next match, otherwise
249 int yy_bs_lineno; /**< The line count. */
250 int yy_bs_column; /**< The column count. */
252 /* Whether to try to fill the input buffer when we reach the
257 int yy_buffer_status;
259 #define YY_BUFFER_NEW 0
260 #define YY_BUFFER_NORMAL 1
261 /* When an EOF's been seen but there's still some text to process
262 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
263 * shouldn't try reading from the input source any more. We might
264 * still have a bunch of tokens to match, though, because of
265 * possible backing-up.
267 * When we actually see the EOF, we change the status to "new"
268 * (via ael_yyrestart()), so that the user can continue scanning by
269 * just pointing yyin at a new input file.
271 #define YY_BUFFER_EOF_PENDING 2
274 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
276 /* We provide macros for accessing buffer states in case in the
277 * future we want to put the buffer states in a more general
280 * Returns the top of the stack, or NULL.
282 #define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \
283 ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \
286 /* Same as previous macro, but useful when we know that the buffer stack is not
287 * NULL or when we need an lvalue. For internal use only.
289 #define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]
291 void ael_yyrestart (FILE *input_file ,yyscan_t yyscanner );
292 void ael_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
293 YY_BUFFER_STATE ael_yy_create_buffer (FILE *file,int size ,yyscan_t yyscanner );
294 void ael_yy_delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
295 void ael_yy_flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
296 void ael_yypush_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
297 void ael_yypop_buffer_state (yyscan_t yyscanner );
299 static void ael_yyensure_buffer_stack (yyscan_t yyscanner );
300 static void ael_yy_load_buffer_state (yyscan_t yyscanner );
301 static void ael_yy_init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner );
303 #define YY_FLUSH_BUFFER ael_yy_flush_buffer(YY_CURRENT_BUFFER ,yyscanner)
305 YY_BUFFER_STATE ael_yy_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner );
306 YY_BUFFER_STATE ael_yy_scan_string (yyconst char *yy_str ,yyscan_t yyscanner );
307 YY_BUFFER_STATE ael_yy_scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner );
309 void *ael_yyalloc (yy_size_t ,yyscan_t yyscanner );
310 void *ael_yyrealloc (void *,yy_size_t ,yyscan_t yyscanner );
311 void ael_yyfree (void * ,yyscan_t yyscanner );
313 #define yy_new_buffer ael_yy_create_buffer
315 #define yy_set_interactive(is_interactive) \
317 if ( ! YY_CURRENT_BUFFER ){ \
318 ael_yyensure_buffer_stack (yyscanner); \
319 YY_CURRENT_BUFFER_LVALUE = \
320 ael_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
322 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
325 #define yy_set_bol(at_bol) \
327 if ( ! YY_CURRENT_BUFFER ){\
328 ael_yyensure_buffer_stack (yyscanner); \
329 YY_CURRENT_BUFFER_LVALUE = \
330 ael_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
332 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
335 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
337 /* Begin user sect3 */
339 #define ael_yywrap(n) 1
340 #define YY_SKIP_YYWRAP
342 typedef unsigned char YY_CHAR;
344 typedef int yy_state_type;
346 #define yytext_ptr yytext_r
348 static yy_state_type yy_get_previous_state (yyscan_t yyscanner );
349 static yy_state_type yy_try_NUL_trans (yy_state_type current_state ,yyscan_t yyscanner);
350 static int yy_get_next_buffer (yyscan_t yyscanner );
351 static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner );
353 /* Done after the current pattern has been matched and before the
354 * corresponding action - sets up yytext.
356 #define YY_DO_BEFORE_ACTION \
357 yyg->yytext_ptr = yy_bp; \
358 yyg->yytext_ptr -= yyg->yy_more_len; \
359 yyleng = (size_t) (yy_cp - yyg->yytext_ptr); \
360 yyg->yy_hold_char = *yy_cp; \
362 yyg->yy_c_buf_p = yy_cp;
364 #define YY_NUM_RULES 76
365 #define YY_END_OF_BUFFER 77
366 /* This struct is not used in this scanner,
367 but its presence is necessary. */
370 flex_int32_t yy_verify;
373 static yyconst flex_int16_t yy_accept[285] =
375 0, 0, 0, 0, 0, 0, 0, 0, 43, 43,
376 0, 0, 0, 0, 0, 0, 77, 75, 50, 48,
377 49, 51, 51, 51, 9, 3, 4, 7, 51, 8,
378 5, 6, 12, 75, 51, 51, 51, 51, 51, 51,
379 51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
380 1, 10, 2, 75, 65, 64, 75, 66, 75, 71,
381 72, 73, 75, 75, 67, 68, 69, 75, 70, 43,
382 44, 45, 75, 59, 60, 75, 58, 57, 52, 52,
383 57, 53, 75, 62, 63, 75, 61, 50, 49, 0,
384 51, 42, 13, 11, 0, 0, 0, 0, 0, 0,
386 0, 0, 0, 0, 0, 0, 22, 0, 0, 0,
387 0, 0, 0, 0, 0, 0, 0, 0, 65, 64,
388 0, 66, 65, 64, 66, 0, 71, 72, 73, 0,
389 71, 72, 73, 0, 67, 68, 69, 0, 70, 67,
390 68, 69, 70, 43, 44, 45, 46, 45, 47, 0,
391 59, 60, 0, 58, 59, 60, 58, 56, 55, 54,
392 0, 62, 63, 0, 61, 62, 63, 61, 0, 13,
393 0, 0, 0, 0, 0, 0, 0, 0, 0, 33,
394 0, 0, 0, 51, 0, 0, 0, 0, 0, 0,
395 0, 0, 0, 0, 0, 0, 0, 0, 35, 0,
397 0, 0, 27, 0, 0, 0, 28, 26, 0, 0,
398 0, 29, 0, 0, 0, 0, 0, 0, 0, 0,
399 0, 0, 31, 38, 0, 0, 0, 0, 0, 0,
400 0, 0, 0, 19, 17, 0, 0, 0, 0, 0,
401 34, 0, 0, 0, 0, 0, 0, 16, 0, 23,
402 0, 0, 0, 24, 0, 30, 21, 0, 0, 14,
403 0, 36, 0, 18, 0, 0, 37, 0, 51, 0,
404 15, 32, 0, 0, 41, 25, 39, 0, 40, 20,
408 static yyconst flex_int32_t yy_ec[256] =
410 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
411 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
412 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
413 1, 4, 5, 6, 7, 8, 1, 9, 5, 10,
414 11, 12, 5, 13, 5, 5, 14, 5, 5, 5,
415 5, 5, 5, 5, 5, 5, 5, 15, 16, 5,
416 17, 18, 1, 19, 5, 5, 5, 5, 5, 5,
417 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
418 5, 5, 5, 20, 5, 5, 5, 5, 5, 5,
419 21, 22, 23, 1, 5, 1, 24, 25, 26, 27,
421 28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
422 38, 39, 5, 40, 41, 42, 43, 5, 44, 45,
423 5, 5, 46, 47, 48, 1, 1, 49, 49, 49,
424 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
425 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
426 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
427 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
428 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
429 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
430 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
432 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
433 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
434 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
435 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
436 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
440 static yyconst flex_int32_t yy_meta[50] =
442 1, 1, 2, 1, 3, 4, 3, 3, 1, 1,
443 1, 5, 1, 3, 1, 1, 1, 3, 1, 3,
444 3, 1, 3, 3, 3, 3, 3, 3, 3, 3,
445 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
446 3, 3, 3, 3, 3, 1, 1, 1, 1
449 static yyconst flex_int16_t yy_base[304] =
451 0, 0, 40, 43, 82, 121, 160, 199, 55, 56,
452 60, 74, 247, 296, 90, 104, 432, 1023, 429, 1023,
453 426, 1023, 397, 31, 1023, 1023, 1023, 1023, 43, 1023,
454 1023, 410, 1023, 0, 401, 382, 36, 389, 34, 378,
455 38, 380, 80, 368, 372, 385, 381, 66, 357, 369,
456 1023, 1023, 1023, 138, 1023, 1023, 143, 1023, 336, 1023,
457 1023, 1023, 375, 414, 1023, 1023, 1023, 453, 1023, 396,
458 1023, 104, 177, 1023, 1023, 182, 1023, 1023, 1023, 78,
459 0, 1023, 231, 1023, 1023, 262, 1023, 393, 390, 356,
460 1023, 1023, 0, 1023, 348, 360, 92, 350, 354, 337,
462 333, 333, 333, 334, 329, 333, 344, 326, 335, 320,
463 327, 322, 299, 303, 93, 302, 301, 280, 1023, 1023,
464 314, 1023, 328, 344, 358, 492, 1023, 1023, 1023, 531,
465 570, 609, 648, 687, 1023, 1023, 1023, 726, 1023, 765,
466 804, 843, 882, 329, 1023, 143, 1023, 144, 1023, 392,
467 1023, 1023, 397, 1023, 431, 436, 470, 1023, 1023, 1023,
468 475, 1023, 1023, 484, 1023, 514, 523, 553, 305, 0,
469 288, 305, 299, 297, 280, 297, 292, 287, 289, 0,
470 291, 276, 250, 257, 250, 252, 247, 258, 241, 238,
471 251, 248, 232, 232, 236, 235, 228, 233, 0, 234,
473 113, 218, 0, 217, 209, 220, 0, 0, 207, 200,
474 196, 0, 203, 199, 208, 197, 189, 193, 206, 203,
475 186, 203, 0, 0, 181, 187, 184, 192, 190, 181,
476 187, 186, 186, 0, 0, 171, 171, 160, 164, 166,
477 0, 169, 169, 152, 147, 143, 149, 0, 138, 0,
478 139, 149, 138, 0, 140, 0, 135, 134, 109, 0,
479 112, 0, 111, 0, 105, 80, 0, 82, 61, 76,
480 0, 0, 46, 30, 0, 0, 0, 170, 0, 0,
481 0, 50, 1023, 1023, 930, 935, 940, 945, 950, 955,
482 960, 965, 970, 975, 980, 985, 989, 994, 999, 1004,
487 static yyconst flex_int16_t yy_def[304] =
489 284, 1, 285, 285, 286, 286, 287, 287, 288, 288,
490 289, 289, 290, 290, 291, 291, 284, 284, 284, 284,
491 284, 284, 284, 284, 284, 284, 284, 284, 284, 284,
492 284, 284, 284, 292, 284, 284, 284, 284, 284, 284,
493 284, 284, 284, 284, 284, 284, 284, 284, 284, 284,
494 284, 284, 284, 293, 284, 284, 293, 284, 294, 284,
495 284, 284, 294, 295, 284, 284, 284, 295, 284, 296,
496 284, 297, 298, 284, 284, 298, 284, 284, 284, 284,
497 299, 284, 300, 284, 284, 300, 284, 284, 284, 284,
498 284, 284, 301, 284, 284, 284, 284, 284, 284, 284,
500 284, 284, 284, 284, 284, 284, 302, 284, 284, 284,
501 284, 284, 284, 284, 284, 284, 284, 293, 284, 284,
502 293, 284, 293, 293, 293, 294, 284, 284, 284, 294,
503 294, 294, 294, 295, 284, 284, 284, 295, 284, 295,
504 295, 295, 295, 296, 284, 297, 284, 297, 284, 298,
505 284, 284, 298, 284, 298, 298, 298, 284, 284, 284,
506 300, 284, 284, 300, 284, 300, 300, 300, 284, 301,
507 284, 284, 284, 284, 284, 284, 284, 284, 284, 302,
508 284, 284, 284, 284, 284, 284, 284, 284, 284, 284,
509 284, 284, 284, 284, 284, 284, 284, 284, 302, 284,
511 284, 284, 302, 284, 284, 284, 302, 302, 284, 284,
512 284, 302, 284, 284, 284, 284, 284, 284, 284, 284,
513 284, 284, 302, 302, 284, 284, 284, 284, 284, 284,
514 284, 284, 284, 302, 302, 284, 284, 284, 284, 284,
515 302, 284, 284, 284, 284, 284, 284, 302, 284, 302,
516 284, 284, 284, 302, 284, 302, 302, 284, 284, 302,
517 284, 302, 284, 302, 284, 284, 302, 284, 284, 284,
518 302, 302, 284, 284, 302, 302, 302, 284, 302, 302,
519 303, 303, 284, 0, 284, 284, 284, 284, 284, 284,
520 284, 284, 284, 284, 284, 284, 284, 284, 284, 284,
525 static yyconst flex_int16_t yy_nxt[1073] =
527 18, 19, 20, 21, 22, 22, 23, 24, 25, 26,
528 27, 22, 28, 29, 30, 31, 32, 22, 33, 22,
529 22, 34, 22, 35, 36, 37, 38, 39, 40, 41,
530 42, 43, 44, 22, 45, 46, 22, 22, 47, 48,
531 49, 22, 22, 50, 22, 51, 52, 53, 22, 55,
532 56, 91, 55, 56, 92, 283, 93, 71, 71, 97,
533 55, 57, 58, 55, 57, 58, 72, 72, 100, 74,
534 75, 280, 104, 98, 101, 105, 91, 278, 102, 278,
535 74, 76, 75, 74, 75, 55, 279, 58, 55, 114,
536 58, 60, 61, 115, 74, 76, 75, 62, 158, 84,
538 85, 277, 60, 63, 61, 74, 147, 77, 107, 108,
539 84, 86, 87, 84, 85, 148, 109, 149, 276, 74,
540 275, 77, 192, 159, 84, 86, 87, 60, 274, 61,
541 60, 61, 173, 174, 193, 84, 62, 85, 273, 272,
542 225, 60, 63, 61, 226, 147, 147, 119, 120, 84,
543 271, 85, 123, 124, 284, 148, 284, 284, 119, 121,
544 122, 270, 269, 123, 121, 125, 60, 268, 61, 65,
545 66, 278, 67, 278, 267, 281, 266, 265, 264, 263,
546 65, 68, 69, 119, 262, 122, 151, 152, 123, 261,
547 125, 155, 156, 260, 259, 258, 257, 151, 153, 152,
549 256, 255, 155, 153, 156, 65, 254, 69, 65, 66,
550 253, 67, 252, 251, 250, 249, 248, 247, 246, 65,
551 68, 69, 151, 245, 154, 244, 243, 155, 242, 157,
552 241, 240, 239, 238, 237, 236, 235, 234, 233, 232,
553 162, 163, 231, 230, 65, 229, 69, 78, 78, 78,
554 78, 162, 164, 165, 80, 78, 78, 78, 228, 78,
555 227, 78, 78, 78, 224, 78, 223, 222, 81, 221,
556 220, 166, 167, 219, 218, 217, 162, 216, 163, 215,
557 214, 213, 166, 164, 168, 212, 211, 210, 209, 119,
558 120, 208, 78, 78, 78, 82, 78, 78, 78, 78,
560 119, 121, 122, 80, 78, 78, 78, 166, 78, 167,
561 78, 78, 78, 207, 78, 206, 205, 81, 204, 203,
562 202, 201, 200, 123, 124, 119, 199, 122, 198, 197,
563 196, 145, 195, 194, 123, 121, 125, 119, 120, 191,
564 190, 78, 78, 78, 82, 127, 128, 189, 119, 121,
565 122, 129, 188, 119, 120, 187, 127, 130, 128, 123,
566 186, 125, 185, 184, 119, 121, 122, 119, 120, 183,
567 182, 181, 180, 119, 179, 122, 178, 177, 119, 121,
568 122, 127, 176, 128, 131, 132, 175, 172, 171, 119,
569 133, 122, 169, 89, 88, 131, 130, 132, 145, 117,
571 116, 151, 152, 119, 113, 122, 155, 156, 112, 111,
572 110, 106, 151, 153, 152, 103, 99, 155, 153, 156,
573 131, 96, 132, 135, 136, 95, 137, 94, 90, 89,
574 88, 284, 284, 284, 135, 138, 139, 151, 284, 154,
575 151, 152, 155, 284, 157, 151, 152, 284, 284, 284,
576 284, 151, 153, 152, 284, 284, 151, 153, 152, 135,
577 284, 139, 140, 141, 284, 142, 284, 284, 284, 284,
578 284, 284, 284, 140, 138, 143, 151, 284, 154, 151,
579 152, 151, 284, 154, 162, 163, 284, 284, 284, 284,
580 151, 153, 152, 166, 167, 162, 164, 165, 140, 284,
582 143, 127, 128, 284, 166, 164, 168, 129, 284, 284,
583 284, 284, 127, 130, 128, 151, 284, 154, 284, 284,
584 162, 284, 163, 162, 163, 284, 284, 284, 284, 166,
585 284, 167, 162, 163, 162, 164, 165, 127, 284, 128,
586 131, 132, 284, 162, 164, 165, 133, 284, 284, 284,
587 284, 131, 130, 132, 284, 284, 284, 284, 284, 162,
588 284, 163, 162, 163, 284, 284, 284, 284, 162, 284,
589 163, 284, 284, 162, 164, 165, 131, 284, 132, 127,
590 128, 284, 284, 284, 284, 129, 284, 284, 284, 284,
591 127, 130, 128, 284, 284, 284, 284, 284, 162, 284,
593 163, 284, 284, 284, 284, 284, 284, 284, 284, 284,
594 284, 284, 284, 284, 284, 127, 284, 128, 127, 128,
595 284, 284, 284, 284, 129, 284, 284, 284, 284, 127,
596 130, 128, 284, 284, 284, 284, 284, 284, 284, 284,
597 284, 284, 284, 284, 284, 284, 284, 284, 284, 284,
598 284, 284, 284, 284, 127, 284, 128, 127, 128, 284,
599 284, 284, 284, 129, 284, 284, 284, 284, 127, 130,
600 128, 284, 284, 284, 284, 284, 284, 284, 284, 284,
601 284, 284, 284, 284, 284, 284, 284, 284, 284, 284,
602 284, 284, 284, 127, 284, 128, 135, 136, 284, 137,
604 284, 284, 284, 284, 284, 284, 284, 135, 138, 139,
605 284, 284, 284, 284, 284, 284, 284, 284, 284, 284,
606 284, 284, 284, 284, 284, 284, 284, 284, 284, 284,
607 284, 284, 135, 284, 139, 140, 141, 284, 142, 284,
608 284, 284, 284, 284, 284, 284, 140, 138, 143, 284,
609 284, 284, 284, 284, 284, 284, 284, 284, 284, 284,
610 284, 284, 284, 284, 284, 284, 284, 284, 284, 284,
611 284, 140, 284, 143, 135, 136, 284, 137, 284, 284,
612 284, 284, 284, 284, 284, 135, 138, 139, 284, 284,
613 284, 284, 284, 284, 284, 284, 284, 284, 284, 284,
615 284, 284, 284, 284, 284, 284, 284, 284, 284, 284,
616 135, 284, 139, 135, 136, 284, 137, 284, 284, 284,
617 284, 284, 284, 284, 135, 138, 139, 284, 284, 284,
618 284, 284, 284, 284, 284, 284, 284, 284, 284, 284,
619 284, 284, 284, 284, 284, 284, 284, 284, 284, 135,
620 284, 139, 135, 136, 284, 137, 284, 284, 284, 284,
621 284, 284, 284, 135, 138, 139, 284, 284, 284, 284,
622 284, 284, 284, 284, 284, 284, 284, 284, 284, 284,
623 284, 284, 284, 284, 284, 284, 284, 284, 135, 284,
624 139, 135, 136, 284, 137, 284, 284, 284, 284, 284,
626 284, 284, 135, 138, 139, 284, 284, 284, 284, 284,
627 284, 284, 284, 284, 284, 284, 284, 284, 284, 284,
628 284, 284, 284, 284, 284, 284, 284, 135, 284, 139,
629 54, 54, 54, 54, 54, 59, 59, 59, 59, 59,
630 64, 64, 64, 64, 64, 70, 70, 70, 70, 70,
631 73, 73, 73, 73, 73, 79, 79, 79, 79, 79,
632 83, 83, 83, 83, 83, 91, 284, 91, 91, 91,
633 118, 118, 118, 118, 118, 126, 126, 126, 126, 126,
634 134, 134, 134, 134, 134, 144, 144, 144, 144, 146,
635 146, 146, 146, 146, 150, 150, 150, 150, 150, 160,
637 284, 160, 160, 160, 161, 161, 161, 161, 161, 170,
638 284, 170, 170, 170, 91, 91, 91, 282, 282, 282,
639 284, 282, 17, 284, 284, 284, 284, 284, 284, 284,
640 284, 284, 284, 284, 284, 284, 284, 284, 284, 284,
641 284, 284, 284, 284, 284, 284, 284, 284, 284, 284,
642 284, 284, 284, 284, 284, 284, 284, 284, 284, 284,
643 284, 284, 284, 284, 284, 284, 284, 284, 284, 284,
647 static yyconst flex_int16_t yy_chk[1073] =
649 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
650 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
651 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
652 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
653 1, 1, 1, 1, 1, 1, 1, 1, 1, 3,
654 3, 24, 4, 4, 29, 282, 29, 9, 10, 37,
655 3, 3, 3, 4, 4, 4, 9, 10, 39, 11,
656 11, 274, 41, 37, 39, 41, 24, 270, 39, 270,
657 11, 11, 11, 12, 12, 3, 273, 3, 4, 48,
658 4, 5, 5, 48, 12, 12, 12, 5, 80, 15,
660 15, 269, 5, 5, 5, 11, 72, 11, 43, 43,
661 15, 15, 15, 16, 16, 72, 43, 72, 268, 12,
662 266, 12, 115, 80, 16, 16, 16, 5, 265, 5,
663 6, 6, 97, 97, 115, 15, 6, 15, 263, 261,
664 201, 6, 6, 6, 201, 146, 148, 54, 54, 16,
665 259, 16, 57, 57, 146, 148, 146, 148, 54, 54,
666 54, 258, 257, 57, 57, 57, 6, 255, 6, 7,
667 7, 278, 7, 278, 253, 278, 252, 251, 249, 247,
668 7, 7, 7, 54, 246, 54, 73, 73, 57, 245,
669 57, 76, 76, 244, 243, 242, 240, 73, 73, 73,
671 239, 238, 76, 76, 76, 7, 237, 7, 8, 8,
672 236, 8, 233, 232, 231, 230, 229, 228, 227, 8,
673 8, 8, 73, 226, 73, 225, 222, 76, 221, 76,
674 220, 219, 218, 217, 216, 215, 214, 213, 211, 210,
675 83, 83, 209, 206, 8, 205, 8, 13, 13, 13,
676 13, 83, 83, 83, 13, 13, 13, 13, 204, 13,
677 202, 13, 13, 13, 200, 13, 198, 197, 13, 196,
678 195, 86, 86, 194, 193, 192, 83, 191, 83, 190,
679 189, 188, 86, 86, 86, 187, 186, 185, 184, 118,
680 118, 183, 13, 13, 13, 13, 14, 14, 14, 14,
682 118, 118, 118, 14, 14, 14, 14, 86, 14, 86,
683 14, 14, 14, 182, 14, 181, 179, 14, 178, 177,
684 176, 175, 174, 121, 121, 118, 173, 118, 172, 171,
685 169, 144, 117, 116, 121, 121, 121, 123, 123, 114,
686 113, 14, 14, 14, 14, 59, 59, 112, 123, 123,
687 123, 59, 111, 124, 124, 110, 59, 59, 59, 121,
688 109, 121, 108, 107, 124, 124, 124, 125, 125, 106,
689 105, 104, 103, 123, 102, 123, 101, 100, 125, 125,
690 125, 59, 99, 59, 63, 63, 98, 96, 95, 124,
691 63, 124, 90, 89, 88, 63, 63, 63, 70, 50,
693 49, 150, 150, 125, 47, 125, 153, 153, 46, 45,
694 44, 42, 150, 150, 150, 40, 38, 153, 153, 153,
695 63, 36, 63, 64, 64, 35, 64, 32, 23, 21,
696 19, 17, 0, 0, 64, 64, 64, 150, 0, 150,
697 155, 155, 153, 0, 153, 156, 156, 0, 0, 0,
698 0, 155, 155, 155, 0, 0, 156, 156, 156, 64,
699 0, 64, 68, 68, 0, 68, 0, 0, 0, 0,
700 0, 0, 0, 68, 68, 68, 155, 0, 155, 157,
701 157, 156, 0, 156, 161, 161, 0, 0, 0, 0,
702 157, 157, 157, 164, 164, 161, 161, 161, 68, 0,
704 68, 126, 126, 0, 164, 164, 164, 126, 0, 0,
705 0, 0, 126, 126, 126, 157, 0, 157, 0, 0,
706 161, 0, 161, 166, 166, 0, 0, 0, 0, 164,
707 0, 164, 167, 167, 166, 166, 166, 126, 0, 126,
708 130, 130, 0, 167, 167, 167, 130, 0, 0, 0,
709 0, 130, 130, 130, 0, 0, 0, 0, 0, 166,
710 0, 166, 168, 168, 0, 0, 0, 0, 167, 0,
711 167, 0, 0, 168, 168, 168, 130, 0, 130, 131,
712 131, 0, 0, 0, 0, 131, 0, 0, 0, 0,
713 131, 131, 131, 0, 0, 0, 0, 0, 168, 0,
715 168, 0, 0, 0, 0, 0, 0, 0, 0, 0,
716 0, 0, 0, 0, 0, 131, 0, 131, 132, 132,
717 0, 0, 0, 0, 132, 0, 0, 0, 0, 132,
718 132, 132, 0, 0, 0, 0, 0, 0, 0, 0,
719 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
720 0, 0, 0, 0, 132, 0, 132, 133, 133, 0,
721 0, 0, 0, 133, 0, 0, 0, 0, 133, 133,
722 133, 0, 0, 0, 0, 0, 0, 0, 0, 0,
723 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
724 0, 0, 0, 133, 0, 133, 134, 134, 0, 134,
726 0, 0, 0, 0, 0, 0, 0, 134, 134, 134,
727 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
728 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
729 0, 0, 134, 0, 134, 138, 138, 0, 138, 0,
730 0, 0, 0, 0, 0, 0, 138, 138, 138, 0,
731 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
732 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
733 0, 138, 0, 138, 140, 140, 0, 140, 0, 0,
734 0, 0, 0, 0, 0, 140, 140, 140, 0, 0,
735 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
737 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
738 140, 0, 140, 141, 141, 0, 141, 0, 0, 0,
739 0, 0, 0, 0, 141, 141, 141, 0, 0, 0,
740 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
741 0, 0, 0, 0, 0, 0, 0, 0, 0, 141,
742 0, 141, 142, 142, 0, 142, 0, 0, 0, 0,
743 0, 0, 0, 142, 142, 142, 0, 0, 0, 0,
744 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
745 0, 0, 0, 0, 0, 0, 0, 0, 142, 0,
746 142, 143, 143, 0, 143, 0, 0, 0, 0, 0,
748 0, 0, 143, 143, 143, 0, 0, 0, 0, 0,
749 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
750 0, 0, 0, 0, 0, 0, 0, 143, 0, 143,
751 285, 285, 285, 285, 285, 286, 286, 286, 286, 286,
752 287, 287, 287, 287, 287, 288, 288, 288, 288, 288,
753 289, 289, 289, 289, 289, 290, 290, 290, 290, 290,
754 291, 291, 291, 291, 291, 292, 0, 292, 292, 292,
755 293, 293, 293, 293, 293, 294, 294, 294, 294, 294,
756 295, 295, 295, 295, 295, 296, 296, 296, 296, 297,
757 297, 297, 297, 297, 298, 298, 298, 298, 298, 299,
759 0, 299, 299, 299, 300, 300, 300, 300, 300, 301,
760 0, 301, 301, 301, 302, 302, 302, 303, 303, 303,
761 0, 303, 284, 284, 284, 284, 284, 284, 284, 284,
762 284, 284, 284, 284, 284, 284, 284, 284, 284, 284,
763 284, 284, 284, 284, 284, 284, 284, 284, 284, 284,
764 284, 284, 284, 284, 284, 284, 284, 284, 284, 284,
765 284, 284, 284, 284, 284, 284, 284, 284, 284, 284,
769 /* The intent behind this definition is that it'll catch
770 * any uses of REJECT which flex missed.
772 #define REJECT reject_used_but_not_detected
773 #define yymore() (yyg->yy_more_flag = 1)
774 #define YY_MORE_ADJ yyg->yy_more_len
775 #define YY_RESTORE_YY_MORE_OFFSET
778 * Asterisk -- An open source telephony toolkit.
780 * Copyright (C) 2006, Digium, Inc.
782 * Steve Murphy <murf@parsetree.com>
784 * See http://www.asterisk.org for more information about
785 * the Asterisk project. Please do not directly contact
786 * any of the maintainers of this project for assistance;
787 * the project provides a web site, mailing lists and IRC
788 * channels for your use.
790 * This program is free software, distributed under the terms of
791 * the GNU General Public License Version 2. See the LICENSE file
792 * at the top of the source tree.
796 * \brief Flex scanner description of tokens used in AEL2 .
800 * Start with flex options:
802 * %x describes the contexts we have: paren, semic and argg, plus INITIAL
805 /* prefix used for various globally-visible functions and variables.
806 * This renames also ael_yywrap, but since we do not use it, we just
807 * add option noyywrap to remove it.
809 /* I specify this option to suppress flex generating code with ECHO
810 in it. This generates compiler warnings in some systems; We've
811 seen the fwrite generate Unused variable warnings with 4.1.2 gcc.
812 Some systems have tweaked flex ECHO macro to keep the compiler
813 happy. To keep the warning message from getting output, I added
814 a default rule at the end of the patterns section */
815 /* ael_yyfree normally just frees its arg. It can be null sometimes,
816 which some systems will complain about, so, we'll define our own version */
817 /* batch gives a bit more performance if we are using it in
818 * a non-interactive mode. We probably don't care much.
820 /* outfile is the filename to be used instead of lex.yy.c */
822 * These are not supported in flex 2.5.4, but we need them
824 * reentrant produces a thread-safe parser. Not 100% sure that
825 * we require it, though.
826 * bison-bridge passes an additional yylval argument to ael_yylex().
827 * bison-locations is probably not needed.
830 #include "asterisk.h"
831 ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
833 #include <sys/types.h>
834 #include <sys/stat.h>
838 #if !defined(GLOB_ABORTED)
839 #define GLOB_ABORTED GLOB_ABEND
842 #include "asterisk/logger.h"
843 #include "asterisk/utils.h"
844 #include "asterisk/lock.h"
845 #include "asterisk/hashtab.h"
846 #include "ael/ael.tab.h"
847 #include "asterisk/ael_structs.h"
850 * A stack to keep track of matching brackets ( [ { } ] )
852 static char pbcstack[400]; /* XXX missing size checks */
853 static int pbcpos = 0;
854 static void pbcpush(char x);
855 static int pbcpop(char x);
856 static int parencount = 0;
859 * A similar stack to keep track of matching brackets ( [ { } ] ) in word tokens surrounded by ${ ... }
861 static char pbcstack2[400]; /* XXX missing size checks */
862 static int pbcpos2 = 0;
863 static void pbcpush2(char x);
864 static int pbcpop2(char x);
865 static int parencount2 = 0;
868 * A similar stack to keep track of matching brackets ( [ { } ] ) in word tokens surrounded by $[ ... ]
870 static char pbcstack3[400]; /* XXX missing size checks */
871 static int pbcpos3 = 0;
872 static void pbcpush3(char x);
873 static int pbcpop3(char x);
874 static int parencount3 = 0;
878 * current line, column and filename, updated as we read the input.
880 static int my_lineno = 1; /* current line in the source */
881 static int my_col = 1; /* current column in the source */
882 char *my_file = 0; /* used also in the bison code */
883 char *prev_word; /* XXX document it */
885 #define MAX_INCLUDE_DEPTH 50
888 * flex is not too smart, and generates global functions
889 * without prototypes so the compiler may complain.
890 * To avoid that, we declare the prototypes here,
891 * even though these functions are not used.
893 int ael_yyget_column (yyscan_t yyscanner);
894 void ael_yyset_column (int column_no , yyscan_t yyscanner);
896 int ael_yyparse (struct parse_io *);
899 * A stack to process include files.
900 * As we switch into the new file we need to store the previous
901 * state to restore it later.
903 struct stackelement {
907 glob_t globbuf; /* the current globbuf */
908 int globbuf_pos; /* where we are in the current globbuf */
909 YY_BUFFER_STATE bufstate;
912 static struct stackelement include_stack[MAX_INCLUDE_DEPTH];
913 static int include_stack_index = 0;
914 static void setup_filestack(char *fnamebuf, int fnamebuf_siz, glob_t *globbuf, int globpos, yyscan_t xscan, int create);
917 * if we use the @n feature of bison, we must supply the start/end
918 * location of tokens in the structure pointed by yylloc.
919 * Simple tokens are just assumed to be on the same line, so
920 * the line number is constant, and the column is incremented
921 * by the length of the token.
923 #ifdef FLEX_BETA /* set for 2.5.33 */
925 /* compute the total number of lines and columns in the text
926 * passed as argument.
928 static void pbcwhere(const char *text, int *line, int *col )
930 int loc_line = *line;
933 while ( (c = *text++) ) {
935 loc_col += 8 - (loc_col % 8);
936 } else if ( c == '\n' ) {
946 #define STORE_POS do { \
947 yylloc->first_line = yylloc->last_line = my_lineno; \
948 yylloc->first_column=my_col; \
949 yylloc->last_column=my_col+yyleng-1; \
953 #define STORE_LOC do { \
954 yylloc->first_line = my_lineno; \
955 yylloc->first_column=my_col; \
956 pbcwhere(yytext, &my_lineno, &my_col); \
957 yylloc->last_line = my_lineno; \
958 yylloc->last_column = my_col - 1; \
964 #line 963 "ael_lex.c"
975 #ifndef YY_NO_UNISTD_H
976 /* Special case for "unistd.h", since it is non-ANSI. We include it way
977 * down here because we want the user's section 1 to have been scanned first.
978 * The user has a chance to override it with an option.
983 #ifndef YY_EXTRA_TYPE
984 #define YY_EXTRA_TYPE void *
987 /* Holds the entire state of the reentrant scanner. */
991 /* User-defined. Not touched by flex. */
992 YY_EXTRA_TYPE yyextra_r;
994 /* The rest are the same as the globals declared in the non-reentrant scanner. */
995 FILE *yyin_r, *yyout_r;
996 size_t yy_buffer_stack_top; /**< index of top of stack. */
997 size_t yy_buffer_stack_max; /**< capacity of stack. */
998 YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */
1005 int yy_did_buffer_switch_on_eof;
1006 int yy_start_stack_ptr;
1007 int yy_start_stack_depth;
1008 int *yy_start_stack;
1009 yy_state_type yy_last_accepting_state;
1010 char* yy_last_accepting_cpos;
1013 int yy_flex_debug_r;
1023 }; /* end struct yyguts_t */
1025 static int yy_init_globals (yyscan_t yyscanner );
1027 /* This must go here because YYSTYPE and YYLTYPE are included
1028 * from bison output in section 1.*/
1029 # define yylval yyg->yylval_r
1031 # define yylloc yyg->yylloc_r
1033 int ael_yylex_init (yyscan_t* scanner);
1035 int ael_yylex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner);
1037 /* Accessor methods to globals.
1038 These are made visible to non-reentrant scanners for convenience. */
1040 int ael_yylex_destroy (yyscan_t yyscanner );
1042 int ael_yyget_debug (yyscan_t yyscanner );
1044 void ael_yyset_debug (int debug_flag ,yyscan_t yyscanner );
1046 YY_EXTRA_TYPE ael_yyget_extra (yyscan_t yyscanner );
1048 void ael_yyset_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner );
1050 FILE *ael_yyget_in (yyscan_t yyscanner );
1052 void ael_yyset_in (FILE * in_str ,yyscan_t yyscanner );
1054 FILE *ael_yyget_out (yyscan_t yyscanner );
1056 void ael_yyset_out (FILE * out_str ,yyscan_t yyscanner );
1058 int ael_yyget_leng (yyscan_t yyscanner );
1060 char *ael_yyget_text (yyscan_t yyscanner );
1062 int ael_yyget_lineno (yyscan_t yyscanner );
1064 void ael_yyset_lineno (int line_number ,yyscan_t yyscanner );
1066 YYSTYPE * ael_yyget_lval (yyscan_t yyscanner );
1068 void ael_yyset_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner );
1070 YYLTYPE *ael_yyget_lloc (yyscan_t yyscanner );
1072 void ael_yyset_lloc (YYLTYPE * yylloc_param ,yyscan_t yyscanner );
1074 /* Macros after this point can all be overridden by user definitions in
1078 #ifndef YY_SKIP_YYWRAP
1080 extern "C" int ael_yywrap (yyscan_t yyscanner );
1082 extern int ael_yywrap (yyscan_t yyscanner );
1086 static void yyunput (int c,char *buf_ptr ,yyscan_t yyscanner);
1089 static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner);
1092 #ifdef YY_NEED_STRLEN
1093 static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner);
1099 static int yyinput (yyscan_t yyscanner );
1101 static int input (yyscan_t yyscanner );
1106 /* Amount of stuff to slurp up with each read. */
1107 #ifndef YY_READ_BUF_SIZE
1109 /* On IA-64, the buffer size is 16k, not 8k */
1110 #define YY_READ_BUF_SIZE 16384
1112 #define YY_READ_BUF_SIZE 8192
1113 #endif /* __ia64__ */
1116 /* Copy whatever the last rule matched to the standard output. */
1118 /* This used to be an fputs(), but since the string might contain NUL's,
1119 * we now use fwrite().
1121 #define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
1124 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
1125 * is returned in "result".
1128 #define YY_INPUT(buf,result,max_size) \
1129 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
1133 for ( n = 0; n < max_size && \
1134 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
1135 buf[n] = (char) c; \
1137 buf[n++] = (char) c; \
1138 if ( c == EOF && ferror( yyin ) ) \
1139 YY_FATAL_ERROR( "input in flex scanner failed" ); \
1145 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
1147 if( errno != EINTR) \
1149 YY_FATAL_ERROR( "input in flex scanner failed" ); \
1160 /* No semi-colon after return; correct usage is to write "yyterminate();" -
1161 * we don't want an extra ';' after the "return" because that will cause
1162 * some compilers to complain about unreachable statements.
1165 #define yyterminate() return YY_NULL
1168 /* Number of entries by which start-condition stack grows. */
1169 #ifndef YY_START_STACK_INCR
1170 #define YY_START_STACK_INCR 25
1173 /* Report a fatal error. */
1174 #ifndef YY_FATAL_ERROR
1175 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner)
1178 /* end tables serialization structures and prototypes */
1180 /* Default declaration of generated scanner - a define so the user can
1181 * easily add parameters.
1184 #define YY_DECL_IS_OURS 1
1186 extern int ael_yylex \
1187 (YYSTYPE * yylval_param,YYLTYPE * yylloc_param ,yyscan_t yyscanner);
1189 #define YY_DECL int ael_yylex \
1190 (YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner)
1191 #endif /* !YY_DECL */
1193 /* Code executed at the beginning of each rule, after yytext and yyleng
1196 #ifndef YY_USER_ACTION
1197 #define YY_USER_ACTION
1200 /* Code executed at the end of each rule. */
1202 #define YY_BREAK break;
1205 #define YY_RULE_SETUP \
1208 /** The main scanner function which does all the work.
1212 register yy_state_type yy_current_state;
1213 register char *yy_cp, *yy_bp;
1214 register int yy_act;
1215 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1217 #line 217 "ael.flex"
1220 #line 1219 "ael_lex.c"
1222 yylval = yylval_param;
1224 yylloc = yylloc_param;
1226 if ( !yyg->yy_init )
1234 if ( ! yyg->yy_start )
1235 yyg->yy_start = 1; /* first start state */
1243 if ( ! YY_CURRENT_BUFFER ) {
1244 ael_yyensure_buffer_stack (yyscanner);
1245 YY_CURRENT_BUFFER_LVALUE =
1246 ael_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
1249 ael_yy_load_buffer_state(yyscanner );
1252 while ( 1 ) /* loops until end-of-file is reached */
1254 yyg->yy_more_len = 0;
1255 if ( yyg->yy_more_flag )
1257 yyg->yy_more_len = yyg->yy_c_buf_p - yyg->yytext_ptr;
1258 yyg->yy_more_flag = 0;
1260 yy_cp = yyg->yy_c_buf_p;
1262 /* Support of yytext. */
1263 *yy_cp = yyg->yy_hold_char;
1265 /* yy_bp points to the position in yy_ch_buf of the start of
1270 yy_current_state = yyg->yy_start;
1274 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
1275 if ( yy_accept[yy_current_state] )
1277 yyg->yy_last_accepting_state = yy_current_state;
1278 yyg->yy_last_accepting_cpos = yy_cp;
1280 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1282 yy_current_state = (int) yy_def[yy_current_state];
1283 if ( yy_current_state >= 285 )
1284 yy_c = yy_meta[(unsigned int) yy_c];
1286 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1289 while ( yy_current_state != 284 );
1290 yy_cp = yyg->yy_last_accepting_cpos;
1291 yy_current_state = yyg->yy_last_accepting_state;
1294 yy_act = yy_accept[yy_current_state];
1296 YY_DO_BEFORE_ACTION;
1298 do_action: /* This label is used only to access EOF actions. */
1301 { /* beginning of action switch */
1302 case 0: /* must back up */
1303 /* undo the effects of YY_DO_BEFORE_ACTION */
1304 *yy_cp = yyg->yy_hold_char;
1305 yy_cp = yyg->yy_last_accepting_cpos;
1306 yy_current_state = yyg->yy_last_accepting_state;
1307 goto yy_find_action;
1311 #line 219 "ael.flex"
1312 { STORE_POS; return LC;}
1316 #line 220 "ael.flex"
1317 { STORE_POS; return RC;}
1321 #line 221 "ael.flex"
1322 { STORE_POS; return LP;}
1326 #line 222 "ael.flex"
1327 { STORE_POS; return RP;}
1331 #line 223 "ael.flex"
1332 { STORE_POS; return SEMI;}
1336 #line 224 "ael.flex"
1337 { STORE_POS; return EQ;}
1341 #line 225 "ael.flex"
1342 { STORE_POS; return COMMA;}
1346 #line 226 "ael.flex"
1347 { STORE_POS; return COLON;}
1351 #line 227 "ael.flex"
1352 { STORE_POS; return AMPER;}
1356 #line 228 "ael.flex"
1357 { STORE_POS; return BAR;}
1361 #line 229 "ael.flex"
1362 { STORE_POS; return EXTENMARK;}
1366 #line 230 "ael.flex"
1367 { STORE_POS; return AT;}
1371 #line 231 "ael.flex"
1376 #line 232 "ael.flex"
1377 { STORE_POS; return KW_CONTEXT;}
1381 #line 233 "ael.flex"
1382 { STORE_POS; return KW_ABSTRACT;}
1386 #line 234 "ael.flex"
1387 { STORE_POS; return KW_EXTEND;}
1391 #line 235 "ael.flex"
1392 { STORE_POS; return KW_MACRO;};
1396 #line 236 "ael.flex"
1397 { STORE_POS; return KW_GLOBALS;}
1401 #line 237 "ael.flex"
1402 { STORE_POS; return KW_LOCAL;}
1406 #line 238 "ael.flex"
1407 { STORE_POS; return KW_IGNOREPAT;}
1411 #line 239 "ael.flex"
1412 { STORE_POS; return KW_SWITCH;}
1416 #line 240 "ael.flex"
1417 { STORE_POS; return KW_IF;}
1421 #line 241 "ael.flex"
1422 { STORE_POS; return KW_IFTIME;}
1426 #line 242 "ael.flex"
1427 { STORE_POS; return KW_RANDOM;}
1431 #line 243 "ael.flex"
1432 { STORE_POS; return KW_REGEXTEN;}
1436 #line 244 "ael.flex"
1437 { STORE_POS; return KW_HINT;}
1441 #line 245 "ael.flex"
1442 { STORE_POS; return KW_ELSE;}
1446 #line 246 "ael.flex"
1447 { STORE_POS; return KW_GOTO;}
1451 #line 247 "ael.flex"
1452 { STORE_POS; return KW_JUMP;}
1456 #line 248 "ael.flex"
1457 { STORE_POS; return KW_RETURN;}
1461 #line 249 "ael.flex"
1462 { STORE_POS; return KW_BREAK;}
1466 #line 250 "ael.flex"
1467 { STORE_POS; return KW_CONTINUE;}
1471 #line 251 "ael.flex"
1472 { STORE_POS; return KW_FOR;}
1476 #line 252 "ael.flex"
1477 { STORE_POS; return KW_WHILE;}
1481 #line 253 "ael.flex"
1482 { STORE_POS; return KW_CASE;}
1486 #line 254 "ael.flex"
1487 { STORE_POS; return KW_DEFAULT;}
1491 #line 255 "ael.flex"
1492 { STORE_POS; return KW_PATTERN;}
1496 #line 256 "ael.flex"
1497 { STORE_POS; return KW_CATCH;}
1501 #line 257 "ael.flex"
1502 { STORE_POS; return KW_SWITCHES;}
1506 #line 258 "ael.flex"
1507 { STORE_POS; return KW_ESWITCHES;}
1511 #line 259 "ael.flex"
1512 { STORE_POS; return KW_INCLUDES;}
1516 #line 260 "ael.flex"
1517 { BEGIN(comment); my_col += 2; }
1521 #line 262 "ael.flex"
1522 { my_col += yyleng; }
1525 /* rule 44 can match eol */
1527 #line 263 "ael.flex"
1528 { ++my_lineno; my_col=1;}
1532 #line 264 "ael.flex"
1533 { my_col += yyleng; }
1536 /* rule 46 can match eol */
1538 #line 265 "ael.flex"
1539 { ++my_lineno; my_col=1;}
1543 #line 266 "ael.flex"
1544 { my_col += 2; BEGIN(INITIAL); } /* the nice thing about comments is that you know exactly what ends them */
1547 /* rule 48 can match eol */
1549 #line 268 "ael.flex"
1550 { my_lineno++; my_col = 1; }
1554 #line 269 "ael.flex"
1555 { my_col += yyleng; }
1559 #line 270 "ael.flex"
1560 { my_col += (yyleng*8)-(my_col%8); }
1564 #line 272 "ael.flex"
1566 /* boy did I open a can of worms when I changed the lexical token "word".
1567 all the above keywords can be used as a beginning to a "word".-
1568 before, a "word" would match a longer sequence than the above
1569 keywords, and all would be well. But now "word" is a single char
1570 and feeds into a statemachine sort of sequence from there on. So...
1571 I added the {KEYWORD}? to the beginning of the word match sequence */
1573 if (!strcmp(yytext,"${")) {
1576 pbcpush2('{'); /* push '{' so the last pcbpop (parencount2 = -1) will succeed */
1579 } else if (!strcmp(yytext,"$[")) {
1582 pbcpush3('['); /* push '[' so the last pcbpop (parencount3 = -1) will succeed */
1593 #line 298 "ael.flex"
1594 { yymore(); /* Keep going */ }
1598 #line 299 "ael.flex"
1599 { yymore(); /* Keep going */ }
1603 #line 300 "ael.flex"
1604 { yymore(); /* Keep Going */ }
1608 #line 301 "ael.flex"
1609 { /* the beginning of a ${} construct. prepare and pop into curlystate */
1612 pbcpush2('{'); /* push '{' so the last pcbpop (parencount2 = -1) will succeed */
1619 #line 308 "ael.flex"
1620 { /* the beginning of a $[] construct. prepare and pop into brackstate */
1623 pbcpush3('['); /* push '[' so the last pcbpop (parencount3 = -1) will succeed */
1629 /* rule 57 can match eol */
1631 #line 315 "ael.flex"
1633 /* a non-word constituent char, like a space, tab, curly, paren, etc */
1634 char c = yytext[yyleng-1];
1636 yylval->str = malloc(yyleng);
1637 strncpy(yylval->str, yytext, yyleng);
1638 yylval->str[yyleng-1] = 0;
1639 unput(c); /* put this ending char back in the stream */
1645 /* rule 58 can match eol */
1647 #line 328 "ael.flex"
1649 if ( pbcpop2('}') ) { /* error */
1651 ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched ')' in expression: %s !\n", my_file, my_lineno, my_col, yytext);
1653 yylval->str = malloc(yyleng+1);
1654 strncpy(yylval->str, yytext, yyleng);
1655 yylval->str[yyleng] = 0;
1659 if ( parencount2 >= 0) {
1662 BEGIN(wordstate); /* Finished with the current ${} construct. Return to word gathering state */
1668 /* rule 59 can match eol */
1670 #line 347 "ael.flex"
1672 char c = yytext[yyleng-1];
1680 /* rule 60 can match eol */
1682 #line 355 "ael.flex"
1684 char c = yytext[yyleng-1];
1685 if ( pbcpop2(c)) { /* error */
1687 ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched '%c' in expression!\n",
1688 my_file, my_lineno, my_col, c);
1690 yylval->str = malloc(yyleng+1);
1691 strncpy(yylval->str, yytext, yyleng);
1692 yylval->str[yyleng] = 0;
1699 /* rule 61 can match eol */
1701 #line 371 "ael.flex"
1703 if ( pbcpop3(']') ) { /* error */
1705 ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched ')' in expression: %s !\n", my_file, my_lineno, my_col, yytext);
1707 yylval->str = malloc(yyleng+1);
1708 strncpy(yylval->str, yytext, yyleng);
1709 yylval->str[yyleng] = 0;
1713 if ( parencount3 >= 0) {
1716 BEGIN(wordstate); /* Finished with the current ${} construct. Return to word gathering state */
1722 /* rule 62 can match eol */
1724 #line 390 "ael.flex"
1726 char c = yytext[yyleng-1];
1734 /* rule 63 can match eol */
1736 #line 398 "ael.flex"
1738 char c = yytext[yyleng-1];
1739 if ( pbcpop3(c)) { /* error */
1741 ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched '%c' in expression!\n",
1742 my_file, my_lineno, my_col, c);
1744 yylval->str = malloc(yyleng+1);
1745 strncpy(yylval->str, yytext, yyleng);
1746 yylval->str[yyleng] = 0;
1753 * context used for arguments of if_head, random_head, switch_head,
1754 * for (last statement), while (XXX why not iftime_head ?).
1755 * End with the matching parentheses.
1756 * A comma at the top level is valid here, unlike in argg where it
1757 * is an argument separator so it must be returned as a token.
1760 /* rule 64 can match eol */
1762 #line 421 "ael.flex"
1764 if ( pbcpop(')') ) { /* error */
1766 ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched ')' in expression: %s !\n", my_file, my_lineno, my_col, yytext);
1768 yylval->str = malloc(yyleng+1);
1769 strncpy(yylval->str, yytext, yyleng);
1770 yylval->str[yyleng] = 0;
1775 if ( parencount >= 0) {
1779 yylval->str = malloc(yyleng);
1780 strncpy(yylval->str, yytext, yyleng);
1781 yylval->str[yyleng-1] = 0;
1789 /* rule 65 can match eol */
1791 #line 446 "ael.flex"
1793 char c = yytext[yyleng-1];
1801 /* rule 66 can match eol */
1803 #line 454 "ael.flex"
1805 char c = yytext[yyleng-1];
1806 if ( pbcpop(c)) { /* error */
1808 ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched '%c' in expression!\n",
1809 my_file, my_lineno, my_col, c);
1811 yylval->str = malloc(yyleng+1);
1812 strncpy(yylval->str, yytext, yyleng);
1813 yylval->str[yyleng] = 0;
1820 * handlers for arguments to a macro or application calls.
1821 * We enter this context when we find the initial '(' and
1822 * stay here until we close all matching parentheses,
1823 * and find the comma (argument separator) or the closing ')'
1824 * of the (external) call, which happens when parencount == 0
1825 * before the decrement.
1828 /* rule 67 can match eol */
1830 #line 478 "ael.flex"
1832 char c = yytext[yyleng-1];
1840 /* rule 68 can match eol */
1842 #line 486 "ael.flex"
1844 if ( pbcpop(')') ) { /* error */
1846 ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched ')' in expression!\n", my_file, my_lineno, my_col);
1848 yylval->str = malloc(yyleng+1);
1849 strncpy(yylval->str, yytext, yyleng);
1850 yylval->str[yyleng] = 0;
1855 if( parencount >= 0){
1860 if ( !strcmp(yytext, ")") )
1862 yylval->str = malloc(yyleng);
1863 strncpy(yylval->str, yytext, yyleng);
1864 yylval->str[yyleng-1] = '\0'; /* trim trailing ')' */
1871 /* rule 69 can match eol */
1873 #line 513 "ael.flex"
1875 if( parencount != 0) { /* ast_log(LOG_NOTICE,"Folding in a comma!\n"); */
1879 if( !strcmp(yytext,"," ) )
1881 yylval->str = malloc(yyleng);
1882 strncpy(yylval->str, yytext, yyleng);
1883 yylval->str[yyleng-1] = '\0'; /* trim trailing ',' */
1890 /* rule 70 can match eol */
1892 #line 528 "ael.flex"
1894 char c = yytext[yyleng-1];
1895 if ( pbcpop(c) ) { /* error */
1897 ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched '%c' in expression!\n", my_file, my_lineno, my_col, c);
1899 yylval->str = malloc(yyleng+1);
1900 strncpy(yylval->str, yytext, yyleng);
1901 yylval->str[yyleng] = '\0';
1908 * context used to find tokens in the right hand side of assignments,
1909 * or in the first and second operand of a 'for'. As above, match
1910 * commas and use ';' as a separator (hence return it as a separate token).
1913 /* rule 71 can match eol */
1915 #line 547 "ael.flex"
1917 char c = yytext[yyleng-1];
1923 /* rule 72 can match eol */
1925 #line 553 "ael.flex"
1927 char c = yytext[yyleng-1];
1928 if ( pbcpop(c) ) { /* error */
1930 ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched '%c' in expression!\n", my_file, my_lineno, my_col, c);
1932 yylval->str = malloc(yyleng+1);
1933 strncpy(yylval->str, yytext, yyleng);
1934 yylval->str[yyleng] = '\0';
1941 /* rule 73 can match eol */
1943 #line 567 "ael.flex"
1946 yylval->str = malloc(yyleng);
1947 strncpy(yylval->str, yytext, yyleng);
1948 yylval->str[yyleng-1] = '\0'; /* trim trailing ';' */
1955 /* rule 74 can match eol */
1957 #line 577 "ael.flex"
1959 char fnamebuf[1024],*p1,*p2;
1961 glob_t globbuf; /* the current globbuf */
1962 int globbuf_pos = -1; /* where we are in the current globbuf */
1963 globbuf.gl_offs = 0; /* initialize it to silence gcc */
1965 p1 = strchr(yytext,'"');
1966 p2 = strrchr(yytext,'"');
1967 if ( include_stack_index >= MAX_INCLUDE_DEPTH ) {
1968 ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Includes nested too deeply! Wow!!! How did you do that?\n", my_file, my_lineno, my_col);
1969 } else if ( (int)(p2-p1) > sizeof(fnamebuf) - 1 ) {
1970 ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Filename is incredibly way too long (%d chars!). Inclusion ignored!\n", my_file, my_lineno, my_col, yyleng - 10);
1972 strncpy(fnamebuf, p1+1, p2-p1-1);
1973 fnamebuf[p2-p1-1] = 0;
1974 if (fnamebuf[0] != '/') {
1975 char fnamebuf2[1024];
1976 snprintf(fnamebuf2,sizeof(fnamebuf2), "%s/%s", (char *)ast_config_AST_CONFIG_DIR, fnamebuf);
1977 ast_copy_string(fnamebuf,fnamebuf2,sizeof(fnamebuf));
1980 glob_ret = glob(fnamebuf, GLOB_NOCHECK, NULL, &globbuf);
1982 glob_ret = glob(fnamebuf, GLOB_NOMAGIC|GLOB_BRACE, NULL, &globbuf);
1984 if (glob_ret == GLOB_NOSPACE) {
1985 ast_log(LOG_WARNING,
1986 "Glob Expansion of pattern '%s' failed: Not enough memory\n", fnamebuf);
1987 } else if (glob_ret == GLOB_ABORTED) {
1988 ast_log(LOG_WARNING,
1989 "Glob Expansion of pattern '%s' failed: Read error\n", fnamebuf);
1990 } else if (glob_ret == GLOB_NOMATCH) {
1991 ast_log(LOG_WARNING,
1992 "Glob Expansion of pattern '%s' failed: No matches!\n", fnamebuf);
1997 if (globbuf_pos > -1) {
1998 setup_filestack(fnamebuf, sizeof(fnamebuf), &globbuf, 0, yyscanner, 1);
2002 case YY_STATE_EOF(INITIAL):
2003 case YY_STATE_EOF(paren):
2004 case YY_STATE_EOF(semic):
2005 case YY_STATE_EOF(argg):
2006 case YY_STATE_EOF(comment):
2007 case YY_STATE_EOF(curlystate):
2008 case YY_STATE_EOF(wordstate):
2009 case YY_STATE_EOF(brackstate):
2010 #line 622 "ael.flex"
2012 char fnamebuf[2048];
2013 if (include_stack_index > 0 && include_stack[include_stack_index-1].globbuf_pos < include_stack[include_stack_index-1].globbuf.gl_pathc-1) {
2014 ael_yy_delete_buffer(YY_CURRENT_BUFFER,yyscanner );
2015 include_stack[include_stack_index-1].globbuf_pos++;
2016 setup_filestack(fnamebuf, sizeof(fnamebuf), &include_stack[include_stack_index-1].globbuf, include_stack[include_stack_index-1].globbuf_pos, yyscanner, 0);
2020 if (include_stack[include_stack_index].fname) {
2021 free(include_stack[include_stack_index].fname);
2022 include_stack[include_stack_index].fname = 0;
2028 if ( --include_stack_index < 0 ) {
2031 globfree(&include_stack[include_stack_index].globbuf);
2032 include_stack[include_stack_index].globbuf_pos = -1;
2034 ael_yy_delete_buffer(YY_CURRENT_BUFFER,yyscanner );
2035 ael_yy_switch_to_buffer(include_stack[include_stack_index].bufstate,yyscanner );
2036 my_lineno = include_stack[include_stack_index].lineno;
2037 my_col = include_stack[include_stack_index].colno;
2038 my_file = strdup(include_stack[include_stack_index].fname);
2044 /* rule 75 can match eol */
2046 #line 654 "ael.flex"
2047 { /* default rule */ ast_log(LOG_ERROR,"Unhandled char(s): %s\n", yytext); }
2051 #line 656 "ael.flex"
2052 YY_FATAL_ERROR( "flex scanner jammed" );
2054 #line 2053 "ael_lex.c"
2056 case YY_END_OF_BUFFER:
2058 /* Amount of text matched not including the EOB char. */
2059 int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1;
2061 /* Undo the effects of YY_DO_BEFORE_ACTION. */
2062 *yy_cp = yyg->yy_hold_char;
2063 YY_RESTORE_YY_MORE_OFFSET
2065 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
2067 /* We're scanning a new file or input source. It's
2068 * possible that this happened because the user
2069 * just pointed yyin at a new source and called
2070 * ael_yylex(). If so, then we have to assure
2071 * consistency between YY_CURRENT_BUFFER and our
2072 * globals. Here is the right place to do so, because
2073 * this is the first action (other than possibly a
2074 * back-up) that will match for the new input source.
2076 yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
2077 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
2078 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
2081 /* Note that here we test for yy_c_buf_p "<=" to the position
2082 * of the first EOB in the buffer, since yy_c_buf_p will
2083 * already have been incremented past the NUL character
2084 * (since all states make transitions on EOB to the
2085 * end-of-buffer state). Contrast this with the test
2088 if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
2089 { /* This was really a NUL. */
2090 yy_state_type yy_next_state;
2092 yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text;
2094 yy_current_state = yy_get_previous_state( yyscanner );
2096 /* Okay, we're now positioned to make the NUL
2097 * transition. We couldn't have
2098 * yy_get_previous_state() go ahead and do it
2099 * for us because it doesn't know how to deal
2100 * with the possibility of jamming (and we don't
2101 * want to build jamming into it because then it
2102 * will run more slowly).
2105 yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner);
2107 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
2109 if ( yy_next_state )
2111 /* Consume the NUL. */
2112 yy_cp = ++yyg->yy_c_buf_p;
2113 yy_current_state = yy_next_state;
2119 yy_cp = yyg->yy_last_accepting_cpos;
2120 yy_current_state = yyg->yy_last_accepting_state;
2121 goto yy_find_action;
2125 else switch ( yy_get_next_buffer( yyscanner ) )
2127 case EOB_ACT_END_OF_FILE:
2129 yyg->yy_did_buffer_switch_on_eof = 0;
2131 if ( ael_yywrap(yyscanner ) )
2133 /* Note: because we've taken care in
2134 * yy_get_next_buffer() to have set up
2135 * yytext, we can now set up
2136 * yy_c_buf_p so that if some total
2137 * hoser (like flex itself) wants to
2138 * call the scanner after we return the
2139 * YY_NULL, it'll still work - another
2140 * YY_NULL will get returned.
2142 yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ;
2144 yy_act = YY_STATE_EOF(YY_START);
2150 if ( ! yyg->yy_did_buffer_switch_on_eof )
2156 case EOB_ACT_CONTINUE_SCAN:
2158 yyg->yytext_ptr + yy_amount_of_matched_text;
2160 yy_current_state = yy_get_previous_state( yyscanner );
2162 yy_cp = yyg->yy_c_buf_p;
2163 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
2166 case EOB_ACT_LAST_MATCH:
2168 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars];
2170 yy_current_state = yy_get_previous_state( yyscanner );
2172 yy_cp = yyg->yy_c_buf_p;
2173 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
2174 goto yy_find_action;
2181 "fatal flex scanner internal error--no action found" );
2182 } /* end of action switch */
2183 } /* end of scanning one token */
2184 } /* end of ael_yylex */
2186 /* yy_get_next_buffer - try to read in a new buffer
2188 * Returns a code representing an action:
2189 * EOB_ACT_LAST_MATCH -
2190 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
2191 * EOB_ACT_END_OF_FILE - end of file
2193 static int yy_get_next_buffer (yyscan_t yyscanner)
2195 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2196 register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
2197 register char *source = yyg->yytext_ptr;
2198 register int number_to_move, i;
2201 if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] )
2203 "fatal flex scanner internal error--end of buffer missed" );
2205 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
2206 { /* Don't try to fill the buffer, so this is an EOF. */
2207 if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 )
2209 /* We matched a single character, the EOB, so
2210 * treat this as a final EOF.
2212 return EOB_ACT_END_OF_FILE;
2217 /* We matched some text prior to the EOB, first
2220 return EOB_ACT_LAST_MATCH;
2224 /* Try to read more data. */
2226 /* First move last chars to start of buffer. */
2227 number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1;
2229 for ( i = 0; i < number_to_move; ++i )
2230 *(dest++) = *(source++);
2232 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
2233 /* don't do the read, it's not guaranteed to return an EOF,
2236 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0;
2241 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
2243 while ( num_to_read <= 0 )
2244 { /* Not enough room in the buffer - grow it. */
2246 /* just a shorter name for the current buffer */
2247 YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
2249 int yy_c_buf_p_offset =
2250 (int) (yyg->yy_c_buf_p - b->yy_ch_buf);
2252 if ( b->yy_is_our_buffer )
2254 int new_size = b->yy_buf_size * 2;
2256 if ( new_size <= 0 )
2257 b->yy_buf_size += b->yy_buf_size / 8;
2259 b->yy_buf_size *= 2;
2261 b->yy_ch_buf = (char *)
2262 /* Include room in for 2 EOB chars. */
2263 ael_yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ,yyscanner );
2266 /* Can't grow it, we don't own it. */
2269 if ( ! b->yy_ch_buf )
2271 "fatal error - scanner input buffer overflow" );
2273 yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
2275 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
2280 if ( num_to_read > YY_READ_BUF_SIZE )
2281 num_to_read = YY_READ_BUF_SIZE;
2283 /* Read in more data. */
2284 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
2285 yyg->yy_n_chars, (size_t) num_to_read );
2287 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
2290 if ( yyg->yy_n_chars == 0 )
2292 if ( number_to_move == YY_MORE_ADJ )
2294 ret_val = EOB_ACT_END_OF_FILE;
2295 ael_yyrestart(yyin ,yyscanner);
2300 ret_val = EOB_ACT_LAST_MATCH;
2301 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
2302 YY_BUFFER_EOF_PENDING;
2307 ret_val = EOB_ACT_CONTINUE_SCAN;
2309 if ((yy_size_t) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
2310 /* Extend the array by 50%, plus the number we really need. */
2311 yy_size_t new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
2312 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) ael_yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner );
2313 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
2314 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
2317 yyg->yy_n_chars += number_to_move;
2318 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR;
2319 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
2321 yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
2326 /* yy_get_previous_state - get the state just before the EOB char was reached */
2328 static yy_state_type yy_get_previous_state (yyscan_t yyscanner)
2330 register yy_state_type yy_current_state;
2331 register char *yy_cp;
2332 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2334 yy_current_state = yyg->yy_start;
2336 for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp )
2338 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
2339 if ( yy_accept[yy_current_state] )
2341 yyg->yy_last_accepting_state = yy_current_state;
2342 yyg->yy_last_accepting_cpos = yy_cp;
2344 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
2346 yy_current_state = (int) yy_def[yy_current_state];
2347 if ( yy_current_state >= 285 )
2348 yy_c = yy_meta[(unsigned int) yy_c];
2350 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
2353 return yy_current_state;
2356 /* yy_try_NUL_trans - try to make a transition on the NUL character
2359 * next_state = yy_try_NUL_trans( current_state );
2361 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner)
2363 register int yy_is_jam;
2364 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */
2365 register char *yy_cp = yyg->yy_c_buf_p;
2367 register YY_CHAR yy_c = 1;
2368 if ( yy_accept[yy_current_state] )
2370 yyg->yy_last_accepting_state = yy_current_state;
2371 yyg->yy_last_accepting_cpos = yy_cp;
2373 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
2375 yy_current_state = (int) yy_def[yy_current_state];
2376 if ( yy_current_state >= 285 )
2377 yy_c = yy_meta[(unsigned int) yy_c];
2379 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
2380 yy_is_jam = (yy_current_state == 284);
2382 return yy_is_jam ? 0 : yy_current_state;
2385 static void yyunput (int c, register char * yy_bp , yyscan_t yyscanner)
2387 register char *yy_cp;
2388 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2390 yy_cp = yyg->yy_c_buf_p;
2392 /* undo effects of setting up yytext */
2393 *yy_cp = yyg->yy_hold_char;
2395 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
2396 { /* need to shift things up to make room */
2397 /* +2 for EOB chars. */
2398 register int number_to_move = yyg->yy_n_chars + 2;
2399 register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
2400 YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
2401 register char *source =
2402 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
2404 while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
2405 *--dest = *--source;
2407 yy_cp += (int) (dest - source);
2408 yy_bp += (int) (dest - source);
2409 YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
2410 yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
2412 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
2413 YY_FATAL_ERROR( "flex scanner push-back overflow" );
2416 *--yy_cp = (char) c;
2418 yyg->yytext_ptr = yy_bp;
2419 yyg->yy_hold_char = *yy_cp;
2420 yyg->yy_c_buf_p = yy_cp;
2425 static int yyinput (yyscan_t yyscanner)
2427 static int input (yyscan_t yyscanner)
2432 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2434 *yyg->yy_c_buf_p = yyg->yy_hold_char;
2436 if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
2438 /* yy_c_buf_p now points to the character we want to return.
2439 * If this occurs *before* the EOB characters, then it's a
2440 * valid NUL; if not, then we've hit the end of the buffer.
2442 if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
2443 /* This was really a NUL. */
2444 *yyg->yy_c_buf_p = '\0';
2447 { /* need more input */
2448 int offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
2451 switch ( yy_get_next_buffer( yyscanner ) )
2453 case EOB_ACT_LAST_MATCH:
2454 /* This happens because yy_g_n_b()
2455 * sees that we've accumulated a
2456 * token and flags that we need to
2457 * try matching the token before
2458 * proceeding. But for input(),
2459 * there's no matching to consider.
2460 * So convert the EOB_ACT_LAST_MATCH
2461 * to EOB_ACT_END_OF_FILE.
2464 /* Reset buffer status. */
2465 ael_yyrestart(yyin ,yyscanner);
2469 case EOB_ACT_END_OF_FILE:
2471 if ( ael_yywrap(yyscanner ) )
2474 if ( ! yyg->yy_did_buffer_switch_on_eof )
2477 return yyinput(yyscanner);
2479 return input(yyscanner);
2483 case EOB_ACT_CONTINUE_SCAN:
2484 yyg->yy_c_buf_p = yyg->yytext_ptr + offset;
2490 c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */
2491 *yyg->yy_c_buf_p = '\0'; /* preserve yytext */
2492 yyg->yy_hold_char = *++yyg->yy_c_buf_p;
2496 #endif /* ifndef YY_NO_INPUT */
2498 /** Immediately switch to a different input stream.
2499 * @param input_file A readable stream.
2500 * @param yyscanner The scanner object.
2501 * @note This function does not reset the start condition to @c INITIAL .
2503 void ael_yyrestart (FILE * input_file , yyscan_t yyscanner)
2505 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2507 if ( ! YY_CURRENT_BUFFER ){
2508 ael_yyensure_buffer_stack (yyscanner);
2509 YY_CURRENT_BUFFER_LVALUE =
2510 ael_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
2513 ael_yy_init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner);
2514 ael_yy_load_buffer_state(yyscanner );
2517 /** Switch to a different input buffer.
2518 * @param new_buffer The new input buffer.
2519 * @param yyscanner The scanner object.
2521 void ael_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
2523 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2525 /* TODO. We should be able to replace this entire function body
2527 * ael_yypop_buffer_state();
2528 * ael_yypush_buffer_state(new_buffer);
2530 ael_yyensure_buffer_stack (yyscanner);
2531 if ( YY_CURRENT_BUFFER == new_buffer )
2534 if ( YY_CURRENT_BUFFER )
2536 /* Flush out information for old buffer. */
2537 *yyg->yy_c_buf_p = yyg->yy_hold_char;
2538 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
2539 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
2542 YY_CURRENT_BUFFER_LVALUE = new_buffer;
2543 ael_yy_load_buffer_state(yyscanner );
2545 /* We don't actually know whether we did this switch during
2546 * EOF (ael_yywrap()) processing, but the only time this flag
2547 * is looked at is after ael_yywrap() is called, so it's safe
2548 * to go ahead and always set it.
2550 yyg->yy_did_buffer_switch_on_eof = 1;
2553 static void ael_yy_load_buffer_state (yyscan_t yyscanner)
2555 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2556 yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
2557 yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
2558 yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
2559 yyg->yy_hold_char = *yyg->yy_c_buf_p;
2562 /** Allocate and initialize an input buffer state.
2563 * @param file A readable stream.
2564 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
2565 * @param yyscanner The scanner object.
2566 * @return the allocated buffer state.
2568 YY_BUFFER_STATE ael_yy_create_buffer (FILE * file, int size , yyscan_t yyscanner)
2572 b = (YY_BUFFER_STATE) ael_yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner );
2574 YY_FATAL_ERROR( "out of dynamic memory in ael_yy_create_buffer()" );
2576 b->yy_buf_size = size;
2578 /* yy_ch_buf has to be 2 characters longer than the size given because
2579 * we need to put in 2 end-of-buffer characters.
2581 b->yy_ch_buf = (char *) ael_yyalloc(b->yy_buf_size + 2 ,yyscanner );
2582 if ( ! b->yy_ch_buf )
2583 YY_FATAL_ERROR( "out of dynamic memory in ael_yy_create_buffer()" );
2585 b->yy_is_our_buffer = 1;
2587 ael_yy_init_buffer(b,file ,yyscanner);
2592 /** Destroy the buffer.
2593 * @param b a buffer created with ael_yy_create_buffer()
2594 * @param yyscanner The scanner object.
2596 void ael_yy_delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
2598 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2603 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
2604 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
2606 if ( b->yy_is_our_buffer )
2607 ael_yyfree((void *) b->yy_ch_buf ,yyscanner );
2609 ael_yyfree((void *) b ,yyscanner );
2613 extern int isatty (int );
2614 #endif /* __cplusplus */
2616 /* Initializes or reinitializes a buffer.
2617 * This function is sometimes called more than once on the same buffer,
2618 * such as during a ael_yyrestart() or at EOF.
2620 static void ael_yy_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner)
2624 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2626 ael_yy_flush_buffer(b ,yyscanner);
2628 b->yy_input_file = file;
2629 b->yy_fill_buffer = 1;
2631 /* If b is the current buffer, then ael_yy_init_buffer was _probably_
2632 * called from ael_yyrestart() or through yy_get_next_buffer.
2633 * In that case, we don't want to reset the lineno or column.
2635 if (b != YY_CURRENT_BUFFER){
2636 b->yy_bs_lineno = 1;
2637 b->yy_bs_column = 0;
2640 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
2645 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
2646 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
2647 * @param yyscanner The scanner object.
2649 void ael_yy_flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
2651 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2657 /* We always need two end-of-buffer characters. The first causes
2658 * a transition to the end-of-buffer state. The second causes
2659 * a jam in that state.
2661 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
2662 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
2664 b->yy_buf_pos = &b->yy_ch_buf[0];
2667 b->yy_buffer_status = YY_BUFFER_NEW;
2669 if ( b == YY_CURRENT_BUFFER )
2670 ael_yy_load_buffer_state(yyscanner );
2673 /** Pushes the new state onto the stack. The new state becomes
2674 * the current state. This function will allocate the stack
2676 * @param new_buffer The new state.
2677 * @param yyscanner The scanner object.
2679 void ael_yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
2681 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2682 if (new_buffer == NULL)
2685 ael_yyensure_buffer_stack(yyscanner);
2687 /* This block is copied from ael_yy_switch_to_buffer. */
2688 if ( YY_CURRENT_BUFFER )
2690 /* Flush out information for old buffer. */
2691 *yyg->yy_c_buf_p = yyg->yy_hold_char;
2692 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
2693 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
2696 /* Only push if top exists. Otherwise, replace top. */
2697 if (YY_CURRENT_BUFFER)
2698 yyg->yy_buffer_stack_top++;
2699 YY_CURRENT_BUFFER_LVALUE = new_buffer;
2701 /* copied from ael_yy_switch_to_buffer. */
2702 ael_yy_load_buffer_state(yyscanner );
2703 yyg->yy_did_buffer_switch_on_eof = 1;
2706 /** Removes and deletes the top of the stack, if present.
2707 * The next element becomes the new top.
2708 * @param yyscanner The scanner object.
2710 void ael_yypop_buffer_state (yyscan_t yyscanner)
2712 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2713 if (!YY_CURRENT_BUFFER)
2716 ael_yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner);
2717 YY_CURRENT_BUFFER_LVALUE = NULL;
2718 if (yyg->yy_buffer_stack_top > 0)
2719 --yyg->yy_buffer_stack_top;
2721 if (YY_CURRENT_BUFFER) {
2722 ael_yy_load_buffer_state(yyscanner );
2723 yyg->yy_did_buffer_switch_on_eof = 1;
2727 /* Allocates the stack if it does not exist.
2728 * Guarantees space for at least one push.
2730 static void ael_yyensure_buffer_stack (yyscan_t yyscanner)
2733 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2735 if (!yyg->yy_buffer_stack) {
2737 /* First allocation is just for 2 elements, since we don't know if this
2738 * scanner will even need a stack. We use 2 instead of 1 to avoid an
2739 * immediate realloc on the next call.
2742 yyg->yy_buffer_stack = (struct yy_buffer_state**)ael_yyalloc
2743 (num_to_alloc * sizeof(struct yy_buffer_state*)
2745 if ( ! yyg->yy_buffer_stack )
2746 YY_FATAL_ERROR( "out of dynamic memory in ael_yyensure_buffer_stack()" );
2748 memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
2750 yyg->yy_buffer_stack_max = num_to_alloc;
2751 yyg->yy_buffer_stack_top = 0;
2755 if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){
2757 /* Increase the buffer to prepare for a possible push. */
2758 int grow_size = 8 /* arbitrary grow size */;
2760 num_to_alloc = yyg->yy_buffer_stack_max + grow_size;
2761 yyg->yy_buffer_stack = (struct yy_buffer_state**)ael_yyrealloc
2762 (yyg->yy_buffer_stack,
2763 num_to_alloc * sizeof(struct yy_buffer_state*)
2765 if ( ! yyg->yy_buffer_stack )
2766 YY_FATAL_ERROR( "out of dynamic memory in ael_yyensure_buffer_stack()" );
2768 /* zero only the new slots.*/
2769 memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*));
2770 yyg->yy_buffer_stack_max = num_to_alloc;
2774 /** Setup the input buffer state to scan directly from a user-specified character buffer.
2775 * @param base the character buffer
2776 * @param size the size in bytes of the character buffer
2777 * @param yyscanner The scanner object.
2778 * @return the newly allocated buffer state object.
2780 YY_BUFFER_STATE ael_yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner)
2785 base[size-2] != YY_END_OF_BUFFER_CHAR ||
2786 base[size-1] != YY_END_OF_BUFFER_CHAR )
2787 /* They forgot to leave room for the EOB's. */
2790 b = (YY_BUFFER_STATE) ael_yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner );
2792 YY_FATAL_ERROR( "out of dynamic memory in ael_yy_scan_buffer()" );
2794 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
2795 b->yy_buf_pos = b->yy_ch_buf = base;
2796 b->yy_is_our_buffer = 0;
2797 b->yy_input_file = 0;
2798 b->yy_n_chars = b->yy_buf_size;
2799 b->yy_is_interactive = 0;
2801 b->yy_fill_buffer = 0;
2802 b->yy_buffer_status = YY_BUFFER_NEW;
2804 ael_yy_switch_to_buffer(b ,yyscanner );
2809 /** Setup the input buffer state to scan a string. The next call to ael_yylex() will
2810 * scan from a @e copy of @a str.
2811 * @param yystr a NUL-terminated string to scan
2812 * @param yyscanner The scanner object.
2813 * @return the newly allocated buffer state object.
2814 * @note If you want to scan bytes that may contain NUL values, then use
2815 * ael_yy_scan_bytes() instead.
2817 YY_BUFFER_STATE ael_yy_scan_string (yyconst char * yystr , yyscan_t yyscanner)
2820 return ael_yy_scan_bytes(yystr,strlen(yystr) ,yyscanner);
2823 /** Setup the input buffer state to scan the given bytes. The next call to ael_yylex() will
2824 * scan from a @e copy of @a bytes.
2825 * @param yybytes the byte buffer to scan
2826 * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
2827 * @param yyscanner The scanner object.
2828 * @return the newly allocated buffer state object.
2830 YY_BUFFER_STATE ael_yy_scan_bytes (yyconst char * yybytes, int _yybytes_len , yyscan_t yyscanner)
2837 /* Get memory for full buffer, including space for trailing EOB's. */
2838 n = _yybytes_len + 2;
2839 buf = (char *) ael_yyalloc(n ,yyscanner );
2841 YY_FATAL_ERROR( "out of dynamic memory in ael_yy_scan_bytes()" );
2843 for ( i = 0; i < _yybytes_len; ++i )
2844 buf[i] = yybytes[i];
2846 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
2848 b = ael_yy_scan_buffer(buf,n ,yyscanner);
2850 YY_FATAL_ERROR( "bad buffer in ael_yy_scan_bytes()" );
2852 /* It's okay to grow etc. this buffer, and we should throw it
2853 * away when we're done.
2855 b->yy_is_our_buffer = 1;
2860 #ifndef YY_EXIT_FAILURE
2861 #define YY_EXIT_FAILURE 2
2864 static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner)
2866 (void) fprintf( stderr, "%s\n", msg );
2867 exit( YY_EXIT_FAILURE );
2870 /* Redefine yyless() so it works in section 3 code. */
2876 /* Undo effects of setting up yytext. */ \
2877 int yyless_macro_arg = (n); \
2878 YY_LESS_LINENO(yyless_macro_arg);\
2879 yytext[yyleng] = yyg->yy_hold_char; \
2880 yyg->yy_c_buf_p = yytext + yyless_macro_arg; \
2881 yyg->yy_hold_char = *yyg->yy_c_buf_p; \
2882 *yyg->yy_c_buf_p = '\0'; \
2883 yyleng = yyless_macro_arg; \
2887 /* Accessor methods (get/set functions) to struct members. */
2889 /** Get the user-defined data for this scanner.
2890 * @param yyscanner The scanner object.
2892 YY_EXTRA_TYPE ael_yyget_extra (yyscan_t yyscanner)
2894 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2898 /** Get the current line number.
2899 * @param yyscanner The scanner object.
2901 int ael_yyget_lineno (yyscan_t yyscanner)
2903 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2905 if (! YY_CURRENT_BUFFER)
2911 /** Get the current column number.
2912 * @param yyscanner The scanner object.
2914 int ael_yyget_column (yyscan_t yyscanner)
2916 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2918 if (! YY_CURRENT_BUFFER)
2924 /** Get the input stream.
2925 * @param yyscanner The scanner object.
2927 FILE *ael_yyget_in (yyscan_t yyscanner)
2929 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2933 /** Get the output stream.
2934 * @param yyscanner The scanner object.
2936 FILE *ael_yyget_out (yyscan_t yyscanner)
2938 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2942 /** Get the length of the current token.
2943 * @param yyscanner The scanner object.
2945 int ael_yyget_leng (yyscan_t yyscanner)
2947 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2951 /** Get the current token.
2952 * @param yyscanner The scanner object.
2955 char *ael_yyget_text (yyscan_t yyscanner)
2957 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2961 /** Set the user-defined data. This data is never touched by the scanner.
2962 * @param user_defined The data to be associated with this scanner.
2963 * @param yyscanner The scanner object.
2965 void ael_yyset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner)
2967 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2968 yyextra = user_defined ;
2971 /** Set the current line number.
2972 * @param line_number
2973 * @param yyscanner The scanner object.
2975 void ael_yyset_lineno (int line_number , yyscan_t yyscanner)
2977 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2979 /* lineno is only valid if an input buffer exists. */
2980 if (! YY_CURRENT_BUFFER )
2981 yy_fatal_error( "ael_yyset_lineno called with no buffer" , yyscanner);
2983 yylineno = line_number;
2986 /** Set the current column.
2987 * @param line_number
2988 * @param yyscanner The scanner object.
2990 void ael_yyset_column (int column_no , yyscan_t yyscanner)
2992 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2994 /* column is only valid if an input buffer exists. */
2995 if (! YY_CURRENT_BUFFER )
2996 yy_fatal_error( "ael_yyset_column called with no buffer" , yyscanner);
2998 yycolumn = column_no;
3001 /** Set the input stream. This does not discard the current
3003 * @param in_str A readable stream.
3004 * @param yyscanner The scanner object.
3005 * @see ael_yy_switch_to_buffer
3007 void ael_yyset_in (FILE * in_str , yyscan_t yyscanner)
3009 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3013 void ael_yyset_out (FILE * out_str , yyscan_t yyscanner)
3015 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3019 int ael_yyget_debug (yyscan_t yyscanner)
3021 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3022 return yy_flex_debug;
3025 void ael_yyset_debug (int bdebug , yyscan_t yyscanner)
3027 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3028 yy_flex_debug = bdebug ;
3031 /* Accessor methods for yylval and yylloc */
3033 YYSTYPE * ael_yyget_lval (yyscan_t yyscanner)
3035 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3039 void ael_yyset_lval (YYSTYPE * yylval_param , yyscan_t yyscanner)
3041 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3042 yylval = yylval_param;
3045 YYLTYPE *ael_yyget_lloc (yyscan_t yyscanner)
3047 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3051 void ael_yyset_lloc (YYLTYPE * yylloc_param , yyscan_t yyscanner)
3053 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3054 yylloc = yylloc_param;
3057 /* User-visible API */
3059 /* ael_yylex_init is special because it creates the scanner itself, so it is
3060 * the ONLY reentrant function that doesn't take the scanner as the last argument.
3061 * That's why we explicitly handle the declaration, instead of using our macros.
3064 int ael_yylex_init(yyscan_t* ptr_yy_globals)
3067 if (ptr_yy_globals == NULL){
3072 *ptr_yy_globals = (yyscan_t) ael_yyalloc ( sizeof( struct yyguts_t ), NULL );
3074 if (*ptr_yy_globals == NULL){
3079 /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */
3080 memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
3082 return yy_init_globals ( *ptr_yy_globals );
3085 /* ael_yylex_init_extra has the same functionality as ael_yylex_init, but follows the
3086 * convention of taking the scanner as the last argument. Note however, that
3087 * this is a *pointer* to a scanner, as it will be allocated by this call (and
3088 * is the reason, too, why this function also must handle its own declaration).
3089 * The user defined value in the first argument will be available to ael_yyalloc in
3090 * the yyextra field.
3093 int ael_yylex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals )
3096 struct yyguts_t dummy_yyguts;
3098 ael_yyset_extra (yy_user_defined, &dummy_yyguts);
3100 if (ptr_yy_globals == NULL){
3105 *ptr_yy_globals = (yyscan_t) ael_yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
3107 if (*ptr_yy_globals == NULL){
3112 /* By setting to 0xAA, we expose bugs in
3113 yy_init_globals. Leave at 0x00 for releases. */
3114 memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
3116 ael_yyset_extra (yy_user_defined, *ptr_yy_globals);
3118 return yy_init_globals ( *ptr_yy_globals );
3121 static int yy_init_globals (yyscan_t yyscanner)
3123 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3124 /* Initialization is the same as for the non-reentrant scanner.
3125 * This function is called from ael_yylex_destroy(), so don't allocate here.
3128 yyg->yy_buffer_stack = 0;
3129 yyg->yy_buffer_stack_top = 0;
3130 yyg->yy_buffer_stack_max = 0;
3131 yyg->yy_c_buf_p = (char *) 0;
3135 yyg->yy_start_stack_ptr = 0;
3136 yyg->yy_start_stack_depth = 0;
3137 yyg->yy_start_stack = NULL;
3139 /* Defined in main.c */
3148 /* For future reference: Set errno on error, since we are called by
3154 /* ael_yylex_destroy is for both reentrant and non-reentrant scanners. */
3155 int ael_yylex_destroy (yyscan_t yyscanner)
3157 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3159 /* Pop the buffer stack, destroying each element. */
3160 while(YY_CURRENT_BUFFER){
3161 ael_yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner );
3162 YY_CURRENT_BUFFER_LVALUE = NULL;
3163 ael_yypop_buffer_state(yyscanner);
3166 /* Destroy the stack itself. */
3167 ael_yyfree(yyg->yy_buffer_stack ,yyscanner);
3168 yyg->yy_buffer_stack = NULL;
3170 /* Destroy the start condition stack. */
3171 ael_yyfree(yyg->yy_start_stack ,yyscanner );
3172 yyg->yy_start_stack = NULL;
3174 /* Reset the globals. This is important in a non-reentrant scanner so the next time
3175 * ael_yylex() is called, initialization will occur. */
3176 yy_init_globals( yyscanner);
3178 /* Destroy the main struct (reentrant only). */
3179 ael_yyfree ( yyscanner , yyscanner );
3185 * Internal utility routines.
3189 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner)
3192 for ( i = 0; i < n; ++i )
3197 #ifdef YY_NEED_STRLEN
3198 static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner)
3201 for ( n = 0; s[n]; ++n )
3208 void *ael_yyalloc (yy_size_t size , yyscan_t yyscanner)
3210 return (void *) malloc( size );
3213 void *ael_yyrealloc (void * ptr, yy_size_t size , yyscan_t yyscanner)
3215 /* The cast to (char *) in the following accommodates both
3216 * implementations that use char* generic pointers, and those
3217 * that use void* generic pointers. It works with the latter
3218 * because both ANSI C and C++ allow castless assignment from
3219 * any pointer type to void*, and deal with argument conversions
3220 * as though doing an assignment.
3222 return (void *) realloc( (char *) ptr, size );
3225 #define YYTABLES_NAME "yytables"
3227 #line 656 "ael.flex"
3231 static void pbcpush(char x)
3233 pbcstack[pbcpos++] = x;
3236 void ael_yyfree(void *ptr, yyscan_t yyscanner)
3239 free( (char*) ptr );
3242 static int pbcpop(char x)
3244 if ( ( x == ')' && pbcstack[pbcpos-1] == '(' )
3245 || ( x == ']' && pbcstack[pbcpos-1] == '[' )
3246 || ( x == '}' && pbcstack[pbcpos-1] == '{' )) {
3250 return 1; /* error */
3253 static void pbcpush2(char x)
3255 pbcstack2[pbcpos2++] = x;
3258 static int pbcpop2(char x)
3260 if ( ( x == ')' && pbcstack2[pbcpos2-1] == '(' )
3261 || ( x == ']' && pbcstack2[pbcpos2-1] == '[' )
3262 || ( x == '}' && pbcstack2[pbcpos2-1] == '{' )) {
3266 return 1; /* error */
3269 static void pbcpush3(char x)
3271 pbcstack3[pbcpos3++] = x;
3274 static int pbcpop3(char x)
3276 if ( ( x == ')' && pbcstack3[pbcpos3-1] == '(' )
3277 || ( x == ']' && pbcstack3[pbcpos3-1] == '[' )
3278 || ( x == '}' && pbcstack3[pbcpos3-1] == '{' )) {
3282 return 1; /* error */
3285 static int c_prevword(void)
3287 char *c = prev_word;
3311 * The following three functions, reset_*, are used in the bison
3312 * code to switch context. As a consequence, we need to
3313 * declare them global and add a prototype so that the
3314 * compiler does not complain.
3316 * NOTE: yyg is declared because it is used in the BEGIN macros,
3317 * though that should be hidden as the macro changes
3318 * depending on the flex options that we use - in particular,
3319 * %reentrant changes the way the macro is declared;
3320 * without %reentrant, BEGIN uses yystart instead of yyg
3323 void reset_parencount(yyscan_t yyscanner );
3324 void reset_parencount(yyscan_t yyscanner )
3326 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3329 pbcpush('('); /* push '(' so the last pcbpop (parencount= -1) will succeed */
3334 void reset_semicount(yyscan_t yyscanner );
3335 void reset_semicount(yyscan_t yyscanner )
3337 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3342 void reset_argcount(yyscan_t yyscanner );
3343 void reset_argcount(yyscan_t yyscanner )
3345 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3348 pbcpush('('); /* push '(' so the last pcbpop (parencount= -1) will succeed */
3353 /* used elsewhere, but some local vars */
3354 struct pval *ael2_parse(char *filename, int *errors)
3356 struct pval *pvalue;
3357 struct parse_io *io;
3362 /* extern int ael_yydebug; */
3364 io = calloc(sizeof(struct parse_io),1);
3365 /* reset the global counters */
3368 include_stack_index=0;
3370 /* ael_yydebug = 1; */
3371 ael_yylex_init(&io->scanner);
3372 fin = fopen(filename,"r");
3374 ast_log(LOG_ERROR,"File %s could not be opened\n", filename);
3380 my_file = strdup(filename);
3381 if (stat(filename, &stats)) {
3382 ast_log(LOG_WARNING, "failed to populate stats from file '%s'\n", filename);
3384 buffer = (char*)malloc(stats.st_size+2);
3385 if (fread(buffer, 1, stats.st_size, fin) != stats.st_size) {
3386 ast_log(LOG_ERROR, "fread() failed: %s\n", strerror(errno));
3388 buffer[stats.st_size]=0;
3391 ael_yy_scan_string (buffer ,io->scanner);
3392 ael_yyset_lineno(1 , io->scanner);
3394 /* ael_yyset_in (fin , io->scanner); OLD WAY */
3400 *errors = io->syntax_error_count;
3402 ael_yylex_destroy(io->scanner);
3409 static void setup_filestack(char *fnamebuf2, int fnamebuf_siz, glob_t *globbuf, int globpos, yyscan_t yyscanner, int create)
3411 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3414 char fnamebuf[2048];
3416 if (globbuf && globbuf->gl_pathv && globbuf->gl_pathc > 0)
3417 #if defined(STANDALONE) || defined(LOW_MEMORY) || defined(STANDALONE_AEL)
3418 strncpy(fnamebuf, globbuf->gl_pathv[globpos], fnamebuf_siz);
3420 ast_copy_string(fnamebuf, globbuf->gl_pathv[globpos], fnamebuf_siz);
3423 ast_log(LOG_ERROR,"Include file name not present!\n");
3426 for (i=0; i<include_stack_index; i++) {
3427 if ( !strcmp(fnamebuf,include_stack[i].fname )) {
3428 ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Nice Try!!! But %s has already been included (perhaps by another file), and would cause an infinite loop of file inclusions!!! Include directive ignored\n",
3429 my_file, my_lineno, my_col, fnamebuf);
3434 if (i == include_stack_index)
3435 error = 0; /* we can use this file */
3436 if ( !error ) { /* valid file name */
3437 /* relative vs. absolute */
3438 if (fnamebuf[0] != '/')
3439 snprintf(fnamebuf2, fnamebuf_siz, "%s/%s", ast_config_AST_CONFIG_DIR, fnamebuf);
3441 #if defined(STANDALONE) || defined(LOW_MEMORY) || defined(STANDALONE_AEL)
3442 strncpy(fnamebuf2, fnamebuf, fnamebuf_siz);
3444 ast_copy_string(fnamebuf2, fnamebuf, fnamebuf_siz);
3446 in1 = fopen( fnamebuf2, "r" );
3449 ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Couldn't find the include file: %s; ignoring the Include directive!\n", my_file, my_lineno, my_col, fnamebuf2);
3453 if (stat(fnamebuf2, &stats)) {
3454 ast_log(LOG_WARNING, "Failed to populate stats from file '%s'\n", fnamebuf2);
3456 buffer = (char*)malloc(stats.st_size+1);
3457 if (fread(buffer, 1, stats.st_size, in1) != stats.st_size) {
3458 ast_log(LOG_ERROR, "fread() failed: %s\n", strerror(errno));
3460 buffer[stats.st_size] = 0;
3461 ast_log(LOG_NOTICE," --Read in included file %s, %d chars\n",fnamebuf2, (int)stats.st_size);
3463 if (include_stack[include_stack_index].fname) {
3464 free(include_stack[include_stack_index].fname);
3465 include_stack[include_stack_index].fname = 0;
3467 include_stack[include_stack_index].fname = strdup(S_OR(my_file, "<none>"));
3468 include_stack[include_stack_index].lineno = my_lineno;
3469 include_stack[include_stack_index].colno = my_col+yyleng;
3472 my_file = strdup(fnamebuf2);
3474 include_stack[include_stack_index].globbuf = *globbuf;
3476 include_stack[include_stack_index].globbuf_pos = 0;
3478 include_stack[include_stack_index].bufstate = YY_CURRENT_BUFFER;
3480 include_stack_index++;
3481 ael_yy_switch_to_buffer(ael_yy_scan_string (buffer ,yyscanner),yyscanner);