5 #define YY_INT_ALIGNED short int
7 /* A lexical scanner generated by flex */
10 #define YY_FLEX_MAJOR_VERSION 2
11 #define YY_FLEX_MINOR_VERSION 5
12 #define YY_FLEX_SUBMINOR_VERSION 33
13 #if YY_FLEX_SUBMINOR_VERSION > 0
17 /* First, we deal with platform-specific or compiler-specific issues. */
19 /* begin standard C headers. */
25 /* end standard C headers. */
27 /* flex integer type definitions */
32 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
34 #if __STDC_VERSION__ >= 199901L
36 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
37 * if you want the limit (max/min) macros for int types.
39 #ifndef __STDC_LIMIT_MACROS
40 #define __STDC_LIMIT_MACROS 1
44 typedef int8_t flex_int8_t;
45 typedef uint8_t flex_uint8_t;
46 typedef int16_t flex_int16_t;
47 typedef uint16_t flex_uint16_t;
48 typedef int32_t flex_int32_t;
49 typedef uint32_t flex_uint32_t;
51 typedef signed char flex_int8_t;
52 typedef short int flex_int16_t;
53 typedef int flex_int32_t;
54 typedef unsigned char flex_uint8_t;
55 typedef unsigned short int flex_uint16_t;
56 typedef unsigned int flex_uint32_t;
59 /* Limits of integral types. */
61 #define INT8_MIN (-128)
64 #define INT16_MIN (-32767-1)
67 #define INT32_MIN (-2147483647-1)
70 #define INT8_MAX (127)
73 #define INT16_MAX (32767)
76 #define INT32_MAX (2147483647)
79 #define UINT8_MAX (255U)
82 #define UINT16_MAX (65535U)
85 #define UINT32_MAX (4294967295U)
88 #endif /* ! FLEXINT_H */
92 /* The "const" storage-class-modifier is valid. */
95 #else /* ! __cplusplus */
101 #endif /* __STDC__ */
102 #endif /* ! __cplusplus */
105 #define yyconst const
110 /* Returned upon end-of-file. */
113 /* Promotes a possibly negative, possibly signed char to an unsigned
114 * integer for use as an array index. If the signed char is negative,
115 * we want to instead treat it as an 8-bit unsigned char, hence the
118 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
120 /* An opaque pointer. */
121 #ifndef YY_TYPEDEF_YY_SCANNER_T
122 #define YY_TYPEDEF_YY_SCANNER_T
123 typedef void* yyscan_t;
126 /* For convenience, these vars (plus the bison vars far below)
127 are macros in the reentrant scanner. */
128 #define yyin yyg->yyin_r
129 #define yyout yyg->yyout_r
130 #define yyextra yyg->yyextra_r
131 #define yyleng yyg->yyleng_r
132 #define yytext yyg->yytext_r
133 #define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)
134 #define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
135 #define yy_flex_debug yyg->yy_flex_debug_r
137 int ael_yylex_init (yyscan_t* scanner);
139 /* Enter a start condition. This macro really ought to take a parameter,
140 * but we do it the disgusting crufty way forced on us by the ()-less
141 * definition of BEGIN.
143 #define BEGIN yyg->yy_start = 1 + 2 *
145 /* Translate the current start state into a value that can be later handed
146 * to BEGIN to return to the state. The YYSTATE alias is for lex
149 #define YY_START ((yyg->yy_start - 1) / 2)
150 #define YYSTATE YY_START
152 /* Action number for EOF rule of a given start state. */
153 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
155 /* Special action meaning "start processing a new file". */
156 #define YY_NEW_FILE ael_yyrestart(yyin ,yyscanner )
158 #define YY_END_OF_BUFFER_CHAR 0
160 /* Size of default input buffer. */
162 #define YY_BUF_SIZE 16384
165 /* The state buf must be large enough to hold one state per character in the main buffer.
167 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
169 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
170 #define YY_TYPEDEF_YY_BUFFER_STATE
171 typedef struct yy_buffer_state *YY_BUFFER_STATE;
174 #define EOB_ACT_CONTINUE_SCAN 0
175 #define EOB_ACT_END_OF_FILE 1
176 #define EOB_ACT_LAST_MATCH 2
178 #define YY_LESS_LINENO(n)
180 /* Return all but the first "n" matched characters back to the input stream. */
184 /* Undo effects of setting up yytext. */ \
185 int yyless_macro_arg = (n); \
186 YY_LESS_LINENO(yyless_macro_arg);\
187 *yy_cp = yyg->yy_hold_char; \
188 YY_RESTORE_YY_MORE_OFFSET \
189 yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
190 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
194 #define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
196 /* The following is because we cannot portably get our hands on size_t
197 * (without autoconf's help, which isn't available because we want
198 * flex-generated scanners to compile on their own).
201 #ifndef YY_TYPEDEF_YY_SIZE_T
202 #define YY_TYPEDEF_YY_SIZE_T
203 typedef unsigned int yy_size_t;
206 #ifndef YY_STRUCT_YY_BUFFER_STATE
207 #define YY_STRUCT_YY_BUFFER_STATE
208 struct yy_buffer_state
212 char *yy_ch_buf; /* input buffer */
213 char *yy_buf_pos; /* current position in input buffer */
215 /* Size of input buffer in bytes, not including room for EOB
218 yy_size_t yy_buf_size;
220 /* Number of characters read into yy_ch_buf, not including EOB
225 /* Whether we "own" the buffer - i.e., we know we created it,
226 * and can realloc() it to grow it, and should free() it to
229 int yy_is_our_buffer;
231 /* Whether this is an "interactive" input source; if so, and
232 * if we're using stdio for input, then we want to use getc()
233 * instead of fread(), to make sure we stop fetching input after
236 int yy_is_interactive;
238 /* Whether we're considered to be at the beginning of a line.
239 * If so, '^' rules will be active on the next match, otherwise
244 int yy_bs_lineno; /**< The line count. */
245 int yy_bs_column; /**< The column count. */
247 /* Whether to try to fill the input buffer when we reach the
252 int yy_buffer_status;
254 #define YY_BUFFER_NEW 0
255 #define YY_BUFFER_NORMAL 1
256 /* When an EOF's been seen but there's still some text to process
257 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
258 * shouldn't try reading from the input source any more. We might
259 * still have a bunch of tokens to match, though, because of
260 * possible backing-up.
262 * When we actually see the EOF, we change the status to "new"
263 * (via ael_yyrestart()), so that the user can continue scanning by
264 * just pointing yyin at a new input file.
266 #define YY_BUFFER_EOF_PENDING 2
269 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
271 /* We provide macros for accessing buffer states in case in the
272 * future we want to put the buffer states in a more general
275 * Returns the top of the stack, or NULL.
277 #define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \
278 ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \
281 /* Same as previous macro, but useful when we know that the buffer stack is not
282 * NULL or when we need an lvalue. For internal use only.
284 #define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]
286 void ael_yyrestart (FILE *input_file ,yyscan_t yyscanner );
287 void ael_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
288 YY_BUFFER_STATE ael_yy_create_buffer (FILE *file,int size ,yyscan_t yyscanner );
289 void ael_yy_delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
290 void ael_yy_flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
291 void ael_yypush_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
292 void ael_yypop_buffer_state (yyscan_t yyscanner );
294 static void ael_yyensure_buffer_stack (yyscan_t yyscanner );
295 static void ael_yy_load_buffer_state (yyscan_t yyscanner );
296 static void ael_yy_init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner );
298 #define YY_FLUSH_BUFFER ael_yy_flush_buffer(YY_CURRENT_BUFFER ,yyscanner)
300 YY_BUFFER_STATE ael_yy_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner );
301 YY_BUFFER_STATE ael_yy_scan_string (yyconst char *yy_str ,yyscan_t yyscanner );
302 YY_BUFFER_STATE ael_yy_scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner );
304 void *ael_yyalloc (yy_size_t ,yyscan_t yyscanner );
305 void *ael_yyrealloc (void *,yy_size_t ,yyscan_t yyscanner );
306 void ael_yyfree (void * ,yyscan_t yyscanner );
308 #define yy_new_buffer ael_yy_create_buffer
310 #define yy_set_interactive(is_interactive) \
312 if ( ! YY_CURRENT_BUFFER ){ \
313 ael_yyensure_buffer_stack (yyscanner); \
314 YY_CURRENT_BUFFER_LVALUE = \
315 ael_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
317 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
320 #define yy_set_bol(at_bol) \
322 if ( ! YY_CURRENT_BUFFER ){\
323 ael_yyensure_buffer_stack (yyscanner); \
324 YY_CURRENT_BUFFER_LVALUE = \
325 ael_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
327 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
330 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
332 /* Begin user sect3 */
334 #define ael_yywrap(n) 1
335 #define YY_SKIP_YYWRAP
337 typedef unsigned char YY_CHAR;
339 typedef int yy_state_type;
341 #define yytext_ptr yytext_r
343 static yy_state_type yy_get_previous_state (yyscan_t yyscanner );
344 static yy_state_type yy_try_NUL_trans (yy_state_type current_state ,yyscan_t yyscanner);
345 static int yy_get_next_buffer (yyscan_t yyscanner );
346 static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner );
348 /* Done after the current pattern has been matched and before the
349 * corresponding action - sets up yytext.
351 #define YY_DO_BEFORE_ACTION \
352 yyg->yytext_ptr = yy_bp; \
353 yyg->yytext_ptr -= yyg->yy_more_len; \
354 yyleng = (size_t) (yy_cp - yyg->yytext_ptr); \
355 yyg->yy_hold_char = *yy_cp; \
357 yyg->yy_c_buf_p = yy_cp;
359 #define YY_NUM_RULES 55
360 #define YY_END_OF_BUFFER 56
361 /* This struct is not used in this scanner,
362 but its presence is necessary. */
365 flex_int32_t yy_verify;
368 static yyconst flex_int16_t yy_accept[206] =
370 0, 0, 0, 0, 0, 0, 0, 0, 56, 55,
371 42, 40, 41, 43, 43, 9, 3, 4, 7, 43,
372 8, 5, 6, 12, 43, 43, 43, 43, 43, 43,
373 43, 43, 43, 43, 43, 43, 43, 43, 43, 1,
374 10, 2, 55, 45, 44, 46, 55, 51, 52, 53,
375 55, 47, 48, 49, 50, 42, 41, 43, 43, 13,
376 11, 43, 43, 43, 43, 43, 43, 43, 43, 43,
377 43, 43, 20, 43, 43, 43, 43, 43, 43, 43,
378 43, 43, 0, 45, 44, 46, 0, 51, 52, 53,
379 0, 47, 48, 49, 50, 43, 13, 13, 43, 43,
381 43, 43, 43, 43, 43, 43, 31, 43, 43, 43,
382 43, 43, 43, 43, 43, 43, 43, 43, 43, 43,
383 43, 43, 43, 43, 33, 43, 43, 43, 25, 43,
384 43, 26, 24, 43, 43, 43, 27, 43, 43, 43,
385 43, 43, 43, 43, 43, 43, 29, 36, 43, 43,
386 43, 43, 43, 43, 43, 43, 16, 43, 43, 43,
387 43, 43, 32, 43, 43, 43, 43, 43, 43, 43,
388 21, 43, 43, 43, 22, 43, 28, 19, 43, 43,
389 14, 43, 34, 43, 17, 43, 43, 35, 43, 43,
390 43, 15, 30, 43, 43, 39, 23, 37, 0, 38,
395 static yyconst flex_int32_t yy_ec[256] =
397 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
398 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
399 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
400 1, 4, 5, 6, 7, 5, 1, 8, 5, 9,
401 10, 5, 5, 11, 5, 5, 12, 5, 5, 5,
402 5, 5, 5, 5, 5, 5, 5, 13, 14, 5,
403 15, 16, 1, 17, 5, 5, 5, 5, 5, 5,
404 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
405 5, 5, 5, 18, 5, 5, 5, 5, 5, 5,
406 19, 1, 20, 1, 5, 1, 21, 22, 23, 24,
408 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
409 35, 36, 5, 37, 38, 39, 40, 5, 41, 42,
410 5, 5, 43, 44, 45, 1, 1, 1, 1, 1,
411 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
412 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
413 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
414 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
415 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
416 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
417 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
419 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
420 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
421 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
422 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
423 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
427 static yyconst flex_int32_t yy_meta[46] =
429 1, 1, 2, 1, 3, 4, 3, 1, 1, 1,
430 1, 3, 1, 1, 1, 3, 1, 3, 3, 3,
431 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
432 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
436 static yyconst flex_int16_t yy_base[216] =
438 0, 0, 37, 40, 77, 114, 151, 188, 237, 507,
439 234, 507, 228, 0, 201, 507, 507, 507, 507, 217,
440 507, 507, 212, 507, 205, 189, 27, 200, 20, 189,
441 19, 194, 37, 182, 200, 199, 40, 178, 190, 507,
442 507, 507, 57, 507, 507, 507, 225, 507, 507, 507,
443 262, 507, 507, 507, 507, 215, 212, 0, 181, 307,
444 507, 176, 188, 30, 178, 185, 172, 168, 169, 170,
445 165, 169, 184, 167, 177, 162, 170, 153, 157, 45,
446 161, 160, 69, 507, 507, 507, 343, 507, 507, 507,
447 380, 507, 507, 507, 507, 165, 0, 425, 148, 165,
449 160, 161, 144, 161, 156, 151, 0, 157, 143, 138,
450 147, 140, 142, 137, 135, 130, 144, 142, 126, 126,
451 132, 131, 121, 125, 0, 127, 45, 114, 0, 114,
452 131, 0, 0, 118, 113, 109, 0, 113, 122, 111,
453 103, 107, 120, 117, 101, 119, 0, 0, 97, 104,
454 105, 113, 103, 107, 106, 106, 0, 92, 94, 87,
455 91, 93, 0, 95, 95, 78, 76, 76, 85, 73,
456 0, 74, 84, 74, 0, 82, 0, 81, 80, 65,
457 0, 78, 0, 76, 0, 78, 60, 0, 61, 55,
458 51, 0, 0, 43, 36, 0, 0, 0, 88, 0,
460 0, 0, 67, 507, 507, 469, 473, 477, 479, 483,
461 487, 491, 495, 499, 503
464 static yyconst flex_int16_t yy_def[216] =
466 205, 1, 206, 206, 207, 207, 208, 208, 205, 205,
467 205, 205, 205, 209, 209, 205, 205, 205, 205, 209,
468 205, 205, 205, 205, 209, 209, 209, 209, 209, 209,
469 209, 209, 209, 209, 209, 209, 209, 209, 209, 205,
470 205, 205, 210, 205, 205, 205, 211, 205, 205, 205,
471 212, 205, 205, 205, 205, 205, 205, 209, 209, 213,
472 205, 209, 209, 209, 209, 209, 209, 209, 209, 209,
473 209, 209, 209, 209, 209, 209, 209, 209, 209, 209,
474 209, 209, 210, 205, 205, 205, 211, 205, 205, 205,
475 212, 205, 205, 205, 205, 209, 214, 213, 209, 209,
477 209, 209, 209, 209, 209, 209, 209, 209, 209, 209,
478 209, 209, 209, 209, 209, 209, 209, 209, 209, 209,
479 209, 209, 209, 209, 209, 209, 209, 209, 209, 209,
480 209, 209, 209, 209, 209, 209, 209, 209, 209, 209,
481 209, 209, 209, 209, 209, 209, 209, 209, 209, 209,
482 209, 209, 209, 209, 209, 209, 209, 209, 209, 209,
483 209, 209, 209, 209, 209, 209, 209, 209, 209, 209,
484 209, 209, 209, 209, 209, 209, 209, 209, 209, 209,
485 209, 209, 209, 209, 209, 209, 209, 209, 209, 209,
486 209, 209, 209, 209, 209, 209, 209, 209, 205, 209,
488 209, 215, 215, 205, 0, 205, 205, 205, 205, 205,
489 205, 205, 205, 205, 205
492 static yyconst flex_int16_t yy_nxt[553] =
494 10, 11, 12, 13, 14, 14, 15, 16, 17, 18,
495 19, 20, 21, 22, 23, 14, 24, 14, 14, 14,
496 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
497 14, 14, 35, 14, 14, 36, 37, 38, 14, 14,
498 39, 14, 40, 41, 42, 44, 45, 64, 44, 45,
499 70, 67, 199, 71, 199, 44, 46, 68, 44, 46,
500 79, 65, 73, 74, 80, 84, 85, 101, 102, 149,
501 75, 118, 204, 150, 201, 84, 86, 84, 85, 44,
502 200, 46, 44, 119, 46, 48, 49, 84, 86, 199,
503 50, 199, 198, 202, 197, 48, 49, 196, 195, 84,
505 194, 86, 193, 192, 191, 190, 189, 188, 187, 186,
506 185, 84, 184, 86, 183, 182, 181, 180, 179, 48,
507 178, 49, 48, 49, 177, 176, 175, 50, 174, 173,
508 172, 171, 48, 49, 170, 169, 168, 167, 166, 165,
509 164, 163, 162, 161, 160, 159, 158, 157, 156, 155,
510 154, 153, 152, 151, 148, 147, 48, 146, 49, 52,
511 53, 54, 145, 144, 143, 142, 141, 140, 139, 52,
512 55, 138, 137, 136, 135, 134, 133, 132, 131, 130,
513 129, 128, 127, 126, 125, 124, 123, 122, 121, 120,
514 117, 116, 115, 52, 114, 55, 52, 53, 54, 113,
516 112, 111, 110, 109, 108, 107, 52, 55, 106, 105,
517 104, 103, 100, 99, 96, 57, 56, 82, 81, 78,
518 77, 76, 72, 69, 66, 63, 62, 61, 60, 59,
519 52, 57, 55, 88, 89, 56, 205, 205, 90, 205,
520 205, 205, 205, 88, 89, 205, 205, 205, 205, 205,
521 205, 205, 205, 205, 205, 205, 205, 205, 205, 205,
522 205, 205, 205, 205, 205, 205, 205, 88, 205, 89,
523 92, 93, 94, 205, 205, 205, 205, 205, 205, 205,
524 92, 95, 205, 205, 205, 205, 205, 205, 205, 205,
525 205, 205, 205, 205, 205, 205, 205, 205, 205, 205,
527 205, 205, 205, 205, 92, 205, 95, 97, 97, 205,
528 97, 205, 205, 205, 97, 97, 97, 97, 205, 97,
529 97, 97, 205, 97, 205, 205, 205, 205, 205, 205,
530 205, 205, 205, 205, 205, 205, 205, 205, 205, 205,
531 205, 205, 205, 205, 205, 205, 205, 205, 205, 205,
532 97, 88, 89, 205, 205, 205, 90, 205, 205, 205,
533 205, 88, 89, 205, 205, 205, 205, 205, 205, 205,
534 205, 205, 205, 205, 205, 205, 205, 205, 205, 205,
535 205, 205, 205, 205, 205, 88, 205, 89, 92, 93,
536 94, 205, 205, 205, 205, 205, 205, 205, 92, 95,
538 205, 205, 205, 205, 205, 205, 205, 205, 205, 205,
539 205, 205, 205, 205, 205, 205, 205, 205, 205, 205,
540 205, 205, 92, 205, 95, 97, 97, 205, 97, 205,
541 205, 205, 97, 97, 97, 97, 205, 97, 97, 97,
542 205, 97, 205, 205, 205, 205, 205, 205, 205, 205,
543 205, 205, 205, 205, 205, 205, 205, 205, 205, 205,
544 205, 205, 205, 205, 205, 205, 205, 205, 97, 43,
545 43, 43, 43, 47, 47, 47, 47, 51, 51, 51,
546 51, 58, 58, 83, 83, 83, 83, 87, 87, 87,
547 87, 91, 91, 91, 91, 98, 205, 98, 98, 97,
549 205, 97, 97, 203, 203, 203, 9, 205, 205, 205,
550 205, 205, 205, 205, 205, 205, 205, 205, 205, 205,
551 205, 205, 205, 205, 205, 205, 205, 205, 205, 205,
552 205, 205, 205, 205, 205, 205, 205, 205, 205, 205,
553 205, 205, 205, 205, 205, 205, 205, 205, 205, 205,
557 static yyconst flex_int16_t yy_chk[553] =
559 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
560 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
561 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
562 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
563 1, 1, 1, 1, 1, 3, 3, 27, 4, 4,
564 31, 29, 191, 31, 191, 3, 3, 29, 4, 4,
565 37, 27, 33, 33, 37, 43, 43, 64, 64, 127,
566 33, 80, 203, 127, 195, 43, 43, 83, 83, 3,
567 194, 3, 4, 80, 4, 5, 5, 83, 83, 199,
568 5, 199, 190, 199, 189, 5, 5, 187, 186, 43,
570 184, 43, 182, 180, 179, 178, 176, 174, 173, 172,
571 170, 83, 169, 83, 168, 167, 166, 165, 164, 5,
572 162, 5, 6, 6, 161, 160, 159, 6, 158, 156,
573 155, 154, 6, 6, 153, 152, 151, 150, 149, 146,
574 145, 144, 143, 142, 141, 140, 139, 138, 136, 135,
575 134, 131, 130, 128, 126, 124, 6, 123, 6, 7,
576 7, 7, 122, 121, 120, 119, 118, 117, 116, 7,
577 7, 115, 114, 113, 112, 111, 110, 109, 108, 106,
578 105, 104, 103, 102, 101, 100, 99, 96, 82, 81,
579 79, 78, 77, 7, 76, 7, 8, 8, 8, 75,
581 74, 73, 72, 71, 70, 69, 8, 8, 68, 67,
582 66, 65, 63, 62, 59, 57, 56, 39, 38, 36,
583 35, 34, 32, 30, 28, 26, 25, 23, 20, 15,
584 8, 13, 8, 47, 47, 11, 9, 0, 47, 0,
585 0, 0, 0, 47, 47, 0, 0, 0, 0, 0,
586 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
587 0, 0, 0, 0, 0, 0, 0, 47, 0, 47,
588 51, 51, 51, 0, 0, 0, 0, 0, 0, 0,
589 51, 51, 0, 0, 0, 0, 0, 0, 0, 0,
590 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
592 0, 0, 0, 0, 51, 0, 51, 60, 60, 0,
593 60, 0, 0, 0, 60, 60, 60, 60, 0, 60,
594 60, 60, 0, 60, 0, 0, 0, 0, 0, 0,
595 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
596 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
597 60, 87, 87, 0, 0, 0, 87, 0, 0, 0,
598 0, 87, 87, 0, 0, 0, 0, 0, 0, 0,
599 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
600 0, 0, 0, 0, 0, 87, 0, 87, 91, 91,
601 91, 0, 0, 0, 0, 0, 0, 0, 91, 91,
603 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
604 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
605 0, 0, 91, 0, 91, 98, 98, 0, 98, 0,
606 0, 0, 98, 98, 98, 98, 0, 98, 98, 98,
607 0, 98, 0, 0, 0, 0, 0, 0, 0, 0,
608 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
609 0, 0, 0, 0, 0, 0, 0, 0, 98, 206,
610 206, 206, 206, 207, 207, 207, 207, 208, 208, 208,
611 208, 209, 209, 210, 210, 210, 210, 211, 211, 211,
612 211, 212, 212, 212, 212, 213, 0, 213, 213, 214,
614 0, 214, 214, 215, 215, 215, 205, 205, 205, 205,
615 205, 205, 205, 205, 205, 205, 205, 205, 205, 205,
616 205, 205, 205, 205, 205, 205, 205, 205, 205, 205,
617 205, 205, 205, 205, 205, 205, 205, 205, 205, 205,
618 205, 205, 205, 205, 205, 205, 205, 205, 205, 205,
622 /* The intent behind this definition is that it'll catch
623 * any uses of REJECT which flex missed.
625 #define REJECT reject_used_but_not_detected
626 #define yymore() (yyg->yy_more_flag = 1)
627 #define YY_MORE_ADJ yyg->yy_more_len
628 #define YY_RESTORE_YY_MORE_OFFSET
631 * Asterisk -- An open source telephony toolkit.
633 * Copyright (C) 2006, Digium, Inc.
635 * Steve Murphy <murf@parsetree.com>
637 * See http://www.asterisk.org for more information about
638 * the Asterisk project. Please do not directly contact
639 * any of the maintainers of this project for assistance;
640 * the project provides a web site, mailing lists and IRC
641 * channels for your use.
643 * This program is free software, distributed under the terms of
644 * the GNU General Public License Version 2. See the LICENSE file
645 * at the top of the source tree.
649 * \brief Flex scanner description of tokens used in AEL2 .
653 * Start with flex options:
655 * %x describes the contexts we have: paren, semic and argg, plus INITIAL
658 /* prefix used for various globally-visible functions and variables.
659 * This renames also ael_yywrap, but since we do not use it, we just
660 * add option noyywrap to remove it.
662 /* batch gives a bit more performance if we are using it in
663 * a non-interactive mode. We probably don't care much.
665 /* outfile is the filename to be used instead of lex.yy.c */
667 * These are not supported in flex 2.5.4, but we need them
669 * reentrant produces a thread-safe parser. Not 100% sure that
670 * we require it, though.
671 * bison-bridge passes an additional yylval argument to ael_yylex().
672 * bison-locations is probably not needed.
675 #include <sys/types.h>
676 #include <sys/stat.h>
679 #include "asterisk.h"
680 #include "asterisk/logger.h"
681 #include "ael/ael.tab.h"
682 #include "asterisk/ael_structs.h"
685 * A stack to keep track of matching brackets ( [ { } ] )
687 static char pbcstack[400]; /* XXX missing size checks */
688 static int pbcpos = 0;
690 static int parencount = 0;
691 static int commaout = 0;
694 * current line, column and filename, updated as we read the input.
696 static int my_lineno = 1; /* current line in the source */
697 static int my_col = 1; /* current column in the source */
698 char *my_file = 0; /* used also in the bison code */
699 char *prev_word; /* XXX document it */
701 #define MAX_INCLUDE_DEPTH 50
704 * flex is not too smart, and generates global functions
705 * without prototypes so the compiler may complain.
706 * To avoid that, we declare the prototypes here,
707 * even though these functions are not used.
709 int ael_yyget_column (yyscan_t yyscanner);
710 void ael_yyset_column (int column_no , yyscan_t yyscanner);
712 int ael_yyparse (struct parse_io *);
713 static void pbcpush(char x);
714 static int pbcpop(char x);
717 * A stack to process include files.
718 * As we switch into the new file we need to store the previous
719 * state to restore it later.
721 struct stackelement {
725 YY_BUFFER_STATE bufstate;
728 static struct stackelement include_stack[MAX_INCLUDE_DEPTH];
729 static int include_stack_index = 0;
732 * if we use the @n feature of bison, we must supply the start/end
733 * location of tokens in the structure pointed by yylloc.
734 * Simple tokens are just assumed to be on the same line, so
735 * the line number is constant, and the column is incremented
736 * by the length of the token.
738 #ifdef FLEX_BETA /* set for 2.5.33 */
740 /* compute the total number of lines and columns in the text
741 * passed as argument.
743 static void pbcwhere(const char *text, int *line, int *col )
745 int loc_line = *line;
748 while ( (c = *text++) ) {
759 #define STORE_POS do { \
760 yylloc->first_line = yylloc->last_line = my_lineno; \
761 yylloc->first_column=my_col; \
762 yylloc->last_column=my_col+yyleng-1; \
766 #define STORE_START do { \
767 yylloc->first_line = my_lineno; \
768 yylloc->first_column=my_col; \
771 #define STORE_END do { \
772 pbcwhere(yytext, &my_lineno, &my_col); \
773 yylloc->last_line = my_lineno; \
774 yylloc->last_column = my_col - 1; \
781 #line 782 "ael_lex.c"
788 #ifndef YY_NO_UNISTD_H
789 /* Special case for "unistd.h", since it is non-ANSI. We include it way
790 * down here because we want the user's section 1 to have been scanned first.
791 * The user has a chance to override it with an option.
796 #ifndef YY_EXTRA_TYPE
797 #define YY_EXTRA_TYPE void *
800 /* Holds the entire state of the reentrant scanner. */
804 /* User-defined. Not touched by flex. */
805 YY_EXTRA_TYPE yyextra_r;
807 /* The rest are the same as the globals declared in the non-reentrant scanner. */
808 FILE *yyin_r, *yyout_r;
809 size_t yy_buffer_stack_top; /**< index of top of stack. */
810 size_t yy_buffer_stack_max; /**< capacity of stack. */
811 YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */
818 int yy_did_buffer_switch_on_eof;
819 int yy_start_stack_ptr;
820 int yy_start_stack_depth;
822 yy_state_type yy_last_accepting_state;
823 char* yy_last_accepting_cpos;
836 }; /* end struct yyguts_t */
838 static int yy_init_globals (yyscan_t yyscanner );
840 /* This must go here because YYSTYPE and YYLTYPE are included
841 * from bison output in section 1.*/
842 # define yylval yyg->yylval_r
844 # define yylloc yyg->yylloc_r
846 /* Accessor methods to globals.
847 These are made visible to non-reentrant scanners for convenience. */
849 int ael_yylex_destroy (yyscan_t yyscanner );
851 int ael_yyget_debug (yyscan_t yyscanner );
853 void ael_yyset_debug (int debug_flag ,yyscan_t yyscanner );
855 YY_EXTRA_TYPE ael_yyget_extra (yyscan_t yyscanner );
857 void ael_yyset_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner );
859 FILE *ael_yyget_in (yyscan_t yyscanner );
861 void ael_yyset_in (FILE * in_str ,yyscan_t yyscanner );
863 FILE *ael_yyget_out (yyscan_t yyscanner );
865 void ael_yyset_out (FILE * out_str ,yyscan_t yyscanner );
867 int ael_yyget_leng (yyscan_t yyscanner );
869 char *ael_yyget_text (yyscan_t yyscanner );
871 int ael_yyget_lineno (yyscan_t yyscanner );
873 void ael_yyset_lineno (int line_number ,yyscan_t yyscanner );
875 YYSTYPE * ael_yyget_lval (yyscan_t yyscanner );
877 void ael_yyset_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner );
879 YYLTYPE *ael_yyget_lloc (yyscan_t yyscanner );
881 void ael_yyset_lloc (YYLTYPE * yylloc_param ,yyscan_t yyscanner );
883 /* Macros after this point can all be overridden by user definitions in
887 #ifndef YY_SKIP_YYWRAP
889 extern "C" int ael_yywrap (yyscan_t yyscanner );
891 extern int ael_yywrap (yyscan_t yyscanner );
895 static void yyunput (int c,char *buf_ptr ,yyscan_t yyscanner);
898 static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner);
901 #ifdef YY_NEED_STRLEN
902 static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner);
908 static int yyinput (yyscan_t yyscanner );
910 static int input (yyscan_t yyscanner );
915 /* Amount of stuff to slurp up with each read. */
916 #ifndef YY_READ_BUF_SIZE
917 #define YY_READ_BUF_SIZE 8192
920 /* Copy whatever the last rule matched to the standard output. */
922 /* This used to be an fputs(), but since the string might contain NUL's,
923 * we now use fwrite().
925 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
928 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
929 * is returned in "result".
932 #define YY_INPUT(buf,result,max_size) \
933 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
937 for ( n = 0; n < max_size && \
938 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
941 buf[n++] = (char) c; \
942 if ( c == EOF && ferror( yyin ) ) \
943 YY_FATAL_ERROR( "input in flex scanner failed" ); \
949 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
951 if( errno != EINTR) \
953 YY_FATAL_ERROR( "input in flex scanner failed" ); \
964 /* No semi-colon after return; correct usage is to write "yyterminate();" -
965 * we don't want an extra ';' after the "return" because that will cause
966 * some compilers to complain about unreachable statements.
969 #define yyterminate() return YY_NULL
972 /* Number of entries by which start-condition stack grows. */
973 #ifndef YY_START_STACK_INCR
974 #define YY_START_STACK_INCR 25
977 /* Report a fatal error. */
978 #ifndef YY_FATAL_ERROR
979 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner)
982 /* end tables serialization structures and prototypes */
984 /* Default declaration of generated scanner - a define so the user can
985 * easily add parameters.
988 #define YY_DECL_IS_OURS 1
990 extern int ael_yylex \
991 (YYSTYPE * yylval_param,YYLTYPE * yylloc_param ,yyscan_t yyscanner);
993 #define YY_DECL int ael_yylex \
994 (YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner)
995 #endif /* !YY_DECL */
997 /* Code executed at the beginning of each rule, after yytext and yyleng
1000 #ifndef YY_USER_ACTION
1001 #define YY_USER_ACTION
1004 /* Code executed at the end of each rule. */
1006 #define YY_BREAK break;
1009 #define YY_RULE_SETUP \
1012 /** The main scanner function which does all the work.
1016 register yy_state_type yy_current_state;
1017 register char *yy_cp, *yy_bp;
1018 register int yy_act;
1019 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1021 #line 174 "ael.flex"
1024 #line 1025 "ael_lex.c"
1026 yylval = yylval_param;
1028 yylloc = yylloc_param;
1030 if ( !yyg->yy_init )
1038 if ( ! yyg->yy_start )
1039 yyg->yy_start = 1; /* first start state */
1047 if ( ! YY_CURRENT_BUFFER ) {
1048 ael_yyensure_buffer_stack (yyscanner);
1049 YY_CURRENT_BUFFER_LVALUE =
1050 ael_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
1053 ael_yy_load_buffer_state(yyscanner );
1056 while ( 1 ) /* loops until end-of-file is reached */
1058 yyg->yy_more_len = 0;
1059 if ( yyg->yy_more_flag )
1061 yyg->yy_more_len = yyg->yy_c_buf_p - yyg->yytext_ptr;
1062 yyg->yy_more_flag = 0;
1064 yy_cp = yyg->yy_c_buf_p;
1066 /* Support of yytext. */
1067 *yy_cp = yyg->yy_hold_char;
1069 /* yy_bp points to the position in yy_ch_buf of the start of
1074 yy_current_state = yyg->yy_start;
1078 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
1079 if ( yy_accept[yy_current_state] )
1081 yyg->yy_last_accepting_state = yy_current_state;
1082 yyg->yy_last_accepting_cpos = yy_cp;
1084 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1086 yy_current_state = (int) yy_def[yy_current_state];
1087 if ( yy_current_state >= 206 )
1088 yy_c = yy_meta[(unsigned int) yy_c];
1090 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1093 while ( yy_current_state != 205 );
1094 yy_cp = yyg->yy_last_accepting_cpos;
1095 yy_current_state = yyg->yy_last_accepting_state;
1098 yy_act = yy_accept[yy_current_state];
1100 YY_DO_BEFORE_ACTION;
1102 do_action: /* This label is used only to access EOF actions. */
1105 { /* beginning of action switch */
1106 case 0: /* must back up */
1107 /* undo the effects of YY_DO_BEFORE_ACTION */
1108 *yy_cp = yyg->yy_hold_char;
1109 yy_cp = yyg->yy_last_accepting_cpos;
1110 yy_current_state = yyg->yy_last_accepting_state;
1111 goto yy_find_action;
1115 #line 176 "ael.flex"
1116 { STORE_POS; return LC;}
1120 #line 177 "ael.flex"
1121 { STORE_POS; return RC;}
1125 #line 178 "ael.flex"
1126 { STORE_POS; return LP;}
1130 #line 179 "ael.flex"
1131 { STORE_POS; return RP;}
1135 #line 180 "ael.flex"
1136 { STORE_POS; return SEMI;}
1140 #line 181 "ael.flex"
1141 { STORE_POS; return EQ;}
1145 #line 182 "ael.flex"
1146 { STORE_POS; return COMMA;}
1150 #line 183 "ael.flex"
1151 { STORE_POS; return COLON;}
1155 #line 184 "ael.flex"
1156 { STORE_POS; return AMPER;}
1160 #line 185 "ael.flex"
1161 { STORE_POS; return BAR;}
1165 #line 186 "ael.flex"
1166 { STORE_POS; return EXTENMARK;}
1170 #line 187 "ael.flex"
1171 { STORE_POS; return AT;}
1175 #line 188 "ael.flex"
1180 #line 189 "ael.flex"
1181 { STORE_POS; return KW_CONTEXT;}
1185 #line 190 "ael.flex"
1186 { STORE_POS; return KW_ABSTRACT;}
1190 #line 191 "ael.flex"
1191 { STORE_POS; return KW_MACRO;};
1195 #line 192 "ael.flex"
1196 { STORE_POS; return KW_GLOBALS;}
1200 #line 193 "ael.flex"
1201 { STORE_POS; return KW_IGNOREPAT;}
1205 #line 194 "ael.flex"
1206 { STORE_POS; return KW_SWITCH;}
1210 #line 195 "ael.flex"
1211 { STORE_POS; return KW_IF;}
1215 #line 196 "ael.flex"
1216 { STORE_POS; return KW_IFTIME;}
1220 #line 197 "ael.flex"
1221 { STORE_POS; return KW_RANDOM;}
1225 #line 198 "ael.flex"
1226 { STORE_POS; return KW_REGEXTEN;}
1230 #line 199 "ael.flex"
1231 { STORE_POS; return KW_HINT;}
1235 #line 200 "ael.flex"
1236 { STORE_POS; return KW_ELSE;}
1240 #line 201 "ael.flex"
1241 { STORE_POS; return KW_GOTO;}
1245 #line 202 "ael.flex"
1246 { STORE_POS; return KW_JUMP;}
1250 #line 203 "ael.flex"
1251 { STORE_POS; return KW_RETURN;}
1255 #line 204 "ael.flex"
1256 { STORE_POS; return KW_BREAK;}
1260 #line 205 "ael.flex"
1261 { STORE_POS; return KW_CONTINUE;}
1265 #line 206 "ael.flex"
1266 { STORE_POS; return KW_FOR;}
1270 #line 207 "ael.flex"
1271 { STORE_POS; return KW_WHILE;}
1275 #line 208 "ael.flex"
1276 { STORE_POS; return KW_CASE;}
1280 #line 209 "ael.flex"
1281 { STORE_POS; return KW_DEFAULT;}
1285 #line 210 "ael.flex"
1286 { STORE_POS; return KW_PATTERN;}
1290 #line 211 "ael.flex"
1291 { STORE_POS; return KW_CATCH;}
1295 #line 212 "ael.flex"
1296 { STORE_POS; return KW_SWITCHES;}
1300 #line 213 "ael.flex"
1301 { STORE_POS; return KW_ESWITCHES;}
1305 #line 214 "ael.flex"
1306 { STORE_POS; return KW_INCLUDES;}
1309 /* rule 40 can match eol */
1311 #line 216 "ael.flex"
1312 { my_lineno++; my_col = 1; }
1316 #line 217 "ael.flex"
1317 { my_col += yyleng; }
1321 #line 218 "ael.flex"
1322 { my_col += (yyleng*8)-(my_col%8); }
1326 #line 220 "ael.flex"
1329 yylval->str = strdup(yytext);
1330 prev_word = yylval->str;
1335 /* rule 44 can match eol */
1337 #line 230 "ael.flex"
1340 if ( pbcpop(')') ) { /* error */
1342 ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched ')' in expression: %s !\n", my_file, my_lineno, my_col, yytext);
1344 yylval->str = strdup(yytext);
1349 if ( parencount >= 0) {
1353 yylval->str = strdup(yytext);
1354 *(yylval->str+strlen(yylval->str)-1)=0;
1355 /* printf("Got paren word %s\n", yylval->str); */
1363 /* rule 45 can match eol */
1365 #line 254 "ael.flex"
1367 char c = yytext[yyleng-1];
1376 /* rule 46 can match eol */
1378 #line 263 "ael.flex"
1380 char c = yytext[yyleng-1];
1382 if ( pbcpop(c)) { /* error */
1384 ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched '%c' in expression!\n",
1385 my_file, my_lineno, my_col, c);
1387 yylval->str = strdup(yytext);
1394 /* rule 47 can match eol */
1396 #line 277 "ael.flex"
1398 char c = yytext[yyleng-1];
1407 /* rule 48 can match eol */
1409 #line 286 "ael.flex"
1412 if ( pbcpop(')') ) { /* error */
1414 ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched ')' in expression!\n", my_file, my_lineno, my_col);
1416 yylval->str = strdup(yytext);
1421 if( parencount >= 0){
1425 yylval->str = strdup(yytext);
1427 *(yylval->str+yyleng-1)=0;
1429 if ( !strcmp(yylval->str,")") ) {
1432 my_col++; /* XXX why ? */
1442 /* rule 49 can match eol */
1444 #line 317 "ael.flex"
1446 if( parencount != 0) {
1447 /* printf("Folding in a comma!\n"); */
1453 if( !strcmp(yytext,"," ) ) {
1458 yylval->str = strdup(yytext);
1459 /* printf("Got argg2 word %s\n", yylval->str); */
1463 *(yylval->str+yyleng-1)=0;
1474 /* rule 50 can match eol */
1476 #line 345 "ael.flex"
1478 char c = yytext[yyleng-1];
1480 if ( pbcpop(c) ) { /* error */
1482 ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched '%c' in expression!\n", my_file, my_lineno, my_col, c);
1484 yylval->str = strdup(yytext);
1491 /* rule 51 can match eol */
1493 #line 360 "ael.flex"
1495 char c = yytext[yyleng-1];
1502 /* rule 52 can match eol */
1504 #line 367 "ael.flex"
1506 char c = yytext[yyleng-1];
1508 if ( pbcpop(c) ) { /* error */
1510 ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched '%c' in expression!\n", my_file, my_lineno, my_col, c);
1512 yylval->str = strdup(yytext);
1519 /* rule 53 can match eol */
1521 #line 380 "ael.flex"
1525 yylval->str = strdup(yytext);
1527 *(yylval->str+yyleng-1)=0;
1534 /* rule 54 can match eol */
1536 #line 391 "ael.flex"
1539 char fnamebuf[1024],*p1,*p2;
1540 int error = 1; /* don't use the file if set */
1541 p1 = strchr(yytext,'"');
1542 p2 = strrchr(yytext,'"');
1543 if ( include_stack_index >= MAX_INCLUDE_DEPTH ) {
1544 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);
1545 } else if ( (int)(p2-p1) > sizeof(fnamebuf) - 1 ) {
1546 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);
1549 strncpy(fnamebuf, p1, p2-p1);
1550 fnamebuf[p2-p1] = 0;
1551 for (i=0; i<include_stack_index; i++) {
1552 if ( !strcmp(fnamebuf,include_stack[i].fname )) {
1553 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",
1554 my_file, my_lineno, my_col, fnamebuf);
1558 if (i == include_stack_index)
1559 error = 0; /* we can use this file */
1561 if ( !error ) { /* valid file name */
1563 /* relative vs. absolute */
1564 if ( *(p1+1) != '/' ) {
1565 /* XXX must check overflows */
1566 strcpy(fnamebuf,ast_config_AST_CONFIG_DIR);
1567 strcat(fnamebuf,"/");
1568 strcat(fnamebuf,p1+1);
1570 strcpy(fnamebuf,p1+1);
1571 in1 = fopen( fnamebuf, "r" );
1573 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, fnamebuf);
1577 stat(fnamebuf, &stats);
1578 buffer = (char*)malloc(stats.st_size+1);
1579 fread(buffer, 1, stats.st_size, in1);
1580 buffer[stats.st_size] = 0;
1581 ast_log(LOG_NOTICE," --Read in included file %s, %d chars\n",fnamebuf, (int)stats.st_size);
1584 include_stack[include_stack_index].fname = my_file;
1585 my_file = strdup(fnamebuf);
1586 include_stack[include_stack_index].lineno = my_lineno;
1587 include_stack[include_stack_index].colno = my_col+yyleng;
1588 include_stack[include_stack_index++].bufstate = YY_CURRENT_BUFFER;
1590 ael_yy_switch_to_buffer(ael_yy_scan_string (buffer ,yyscanner),yyscanner);
1599 case YY_STATE_EOF(INITIAL):
1600 case YY_STATE_EOF(paren):
1601 case YY_STATE_EOF(semic):
1602 case YY_STATE_EOF(argg):
1603 #line 453 "ael.flex"
1605 if ( --include_stack_index < 0 ) {
1609 ael_yy_delete_buffer(YY_CURRENT_BUFFER,yyscanner );
1610 ael_yy_switch_to_buffer(include_stack[include_stack_index].bufstate,yyscanner );
1611 my_lineno = include_stack[include_stack_index].lineno;
1612 my_col = include_stack[include_stack_index].colno;
1613 my_file = include_stack[include_stack_index].fname;
1619 #line 466 "ael.flex"
1622 #line 1623 "ael_lex.c"
1624 case YY_END_OF_BUFFER:
1626 /* Amount of text matched not including the EOB char. */
1627 int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1;
1629 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1630 *yy_cp = yyg->yy_hold_char;
1631 YY_RESTORE_YY_MORE_OFFSET
1633 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1635 /* We're scanning a new file or input source. It's
1636 * possible that this happened because the user
1637 * just pointed yyin at a new source and called
1638 * ael_yylex(). If so, then we have to assure
1639 * consistency between YY_CURRENT_BUFFER and our
1640 * globals. Here is the right place to do so, because
1641 * this is the first action (other than possibly a
1642 * back-up) that will match for the new input source.
1644 yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1645 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
1646 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1649 /* Note that here we test for yy_c_buf_p "<=" to the position
1650 * of the first EOB in the buffer, since yy_c_buf_p will
1651 * already have been incremented past the NUL character
1652 * (since all states make transitions on EOB to the
1653 * end-of-buffer state). Contrast this with the test
1656 if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
1657 { /* This was really a NUL. */
1658 yy_state_type yy_next_state;
1660 yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text;
1662 yy_current_state = yy_get_previous_state( yyscanner );
1664 /* Okay, we're now positioned to make the NUL
1665 * transition. We couldn't have
1666 * yy_get_previous_state() go ahead and do it
1667 * for us because it doesn't know how to deal
1668 * with the possibility of jamming (and we don't
1669 * want to build jamming into it because then it
1670 * will run more slowly).
1673 yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner);
1675 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1677 if ( yy_next_state )
1679 /* Consume the NUL. */
1680 yy_cp = ++yyg->yy_c_buf_p;
1681 yy_current_state = yy_next_state;
1687 yy_cp = yyg->yy_last_accepting_cpos;
1688 yy_current_state = yyg->yy_last_accepting_state;
1689 goto yy_find_action;
1693 else switch ( yy_get_next_buffer( yyscanner ) )
1695 case EOB_ACT_END_OF_FILE:
1697 yyg->yy_did_buffer_switch_on_eof = 0;
1699 if ( ael_yywrap(yyscanner ) )
1701 /* Note: because we've taken care in
1702 * yy_get_next_buffer() to have set up
1703 * yytext, we can now set up
1704 * yy_c_buf_p so that if some total
1705 * hoser (like flex itself) wants to
1706 * call the scanner after we return the
1707 * YY_NULL, it'll still work - another
1708 * YY_NULL will get returned.
1710 yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ;
1712 yy_act = YY_STATE_EOF(YY_START);
1718 if ( ! yyg->yy_did_buffer_switch_on_eof )
1724 case EOB_ACT_CONTINUE_SCAN:
1726 yyg->yytext_ptr + yy_amount_of_matched_text;
1728 yy_current_state = yy_get_previous_state( yyscanner );
1730 yy_cp = yyg->yy_c_buf_p;
1731 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1734 case EOB_ACT_LAST_MATCH:
1736 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars];
1738 yy_current_state = yy_get_previous_state( yyscanner );
1740 yy_cp = yyg->yy_c_buf_p;
1741 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1742 goto yy_find_action;
1749 "fatal flex scanner internal error--no action found" );
1750 } /* end of action switch */
1751 } /* end of scanning one token */
1752 } /* end of ael_yylex */
1754 /* yy_get_next_buffer - try to read in a new buffer
1756 * Returns a code representing an action:
1757 * EOB_ACT_LAST_MATCH -
1758 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1759 * EOB_ACT_END_OF_FILE - end of file
1761 static int yy_get_next_buffer (yyscan_t yyscanner)
1763 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1764 register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1765 register char *source = yyg->yytext_ptr;
1766 register int number_to_move, i;
1769 if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] )
1771 "fatal flex scanner internal error--end of buffer missed" );
1773 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1774 { /* Don't try to fill the buffer, so this is an EOF. */
1775 if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 )
1777 /* We matched a single character, the EOB, so
1778 * treat this as a final EOF.
1780 return EOB_ACT_END_OF_FILE;
1785 /* We matched some text prior to the EOB, first
1788 return EOB_ACT_LAST_MATCH;
1792 /* Try to read more data. */
1794 /* First move last chars to start of buffer. */
1795 number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1;
1797 for ( i = 0; i < number_to_move; ++i )
1798 *(dest++) = *(source++);
1800 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1801 /* don't do the read, it's not guaranteed to return an EOF,
1804 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0;
1809 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1811 while ( num_to_read <= 0 )
1812 { /* Not enough room in the buffer - grow it. */
1814 /* just a shorter name for the current buffer */
1815 YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
1817 int yy_c_buf_p_offset =
1818 (int) (yyg->yy_c_buf_p - b->yy_ch_buf);
1820 if ( b->yy_is_our_buffer )
1822 int new_size = b->yy_buf_size * 2;
1824 if ( new_size <= 0 )
1825 b->yy_buf_size += b->yy_buf_size / 8;
1827 b->yy_buf_size *= 2;
1829 b->yy_ch_buf = (char *)
1830 /* Include room in for 2 EOB chars. */
1831 ael_yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ,yyscanner );
1834 /* Can't grow it, we don't own it. */
1837 if ( ! b->yy_ch_buf )
1839 "fatal error - scanner input buffer overflow" );
1841 yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1843 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1848 if ( num_to_read > YY_READ_BUF_SIZE )
1849 num_to_read = YY_READ_BUF_SIZE;
1851 /* Read in more data. */
1852 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1853 yyg->yy_n_chars, num_to_read );
1855 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
1858 if ( yyg->yy_n_chars == 0 )
1860 if ( number_to_move == YY_MORE_ADJ )
1862 ret_val = EOB_ACT_END_OF_FILE;
1863 ael_yyrestart(yyin ,yyscanner);
1868 ret_val = EOB_ACT_LAST_MATCH;
1869 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1870 YY_BUFFER_EOF_PENDING;
1875 ret_val = EOB_ACT_CONTINUE_SCAN;
1877 yyg->yy_n_chars += number_to_move;
1878 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR;
1879 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
1881 yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1886 /* yy_get_previous_state - get the state just before the EOB char was reached */
1888 static yy_state_type yy_get_previous_state (yyscan_t yyscanner)
1890 register yy_state_type yy_current_state;
1891 register char *yy_cp;
1892 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1894 yy_current_state = yyg->yy_start;
1896 for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp )
1898 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1899 if ( yy_accept[yy_current_state] )
1901 yyg->yy_last_accepting_state = yy_current_state;
1902 yyg->yy_last_accepting_cpos = yy_cp;
1904 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1906 yy_current_state = (int) yy_def[yy_current_state];
1907 if ( yy_current_state >= 206 )
1908 yy_c = yy_meta[(unsigned int) yy_c];
1910 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1913 return yy_current_state;
1916 /* yy_try_NUL_trans - try to make a transition on the NUL character
1919 * next_state = yy_try_NUL_trans( current_state );
1921 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner)
1923 register int yy_is_jam;
1924 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */
1925 register char *yy_cp = yyg->yy_c_buf_p;
1927 register YY_CHAR yy_c = 1;
1928 if ( yy_accept[yy_current_state] )
1930 yyg->yy_last_accepting_state = yy_current_state;
1931 yyg->yy_last_accepting_cpos = yy_cp;
1933 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1935 yy_current_state = (int) yy_def[yy_current_state];
1936 if ( yy_current_state >= 206 )
1937 yy_c = yy_meta[(unsigned int) yy_c];
1939 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1940 yy_is_jam = (yy_current_state == 205);
1942 return yy_is_jam ? 0 : yy_current_state;
1945 static void yyunput (int c, register char * yy_bp , yyscan_t yyscanner)
1947 register char *yy_cp;
1948 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1950 yy_cp = yyg->yy_c_buf_p;
1952 /* undo effects of setting up yytext */
1953 *yy_cp = yyg->yy_hold_char;
1955 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1956 { /* need to shift things up to make room */
1957 /* +2 for EOB chars. */
1958 register int number_to_move = yyg->yy_n_chars + 2;
1959 register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
1960 YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
1961 register char *source =
1962 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
1964 while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1965 *--dest = *--source;
1967 yy_cp += (int) (dest - source);
1968 yy_bp += (int) (dest - source);
1969 YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
1970 yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
1972 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1973 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1976 *--yy_cp = (char) c;
1978 yyg->yytext_ptr = yy_bp;
1979 yyg->yy_hold_char = *yy_cp;
1980 yyg->yy_c_buf_p = yy_cp;
1985 static int yyinput (yyscan_t yyscanner)
1987 static int input (yyscan_t yyscanner)
1992 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1994 *yyg->yy_c_buf_p = yyg->yy_hold_char;
1996 if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
1998 /* yy_c_buf_p now points to the character we want to return.
1999 * If this occurs *before* the EOB characters, then it's a
2000 * valid NUL; if not, then we've hit the end of the buffer.
2002 if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
2003 /* This was really a NUL. */
2004 *yyg->yy_c_buf_p = '\0';
2007 { /* need more input */
2008 int offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
2011 switch ( yy_get_next_buffer( yyscanner ) )
2013 case EOB_ACT_LAST_MATCH:
2014 /* This happens because yy_g_n_b()
2015 * sees that we've accumulated a
2016 * token and flags that we need to
2017 * try matching the token before
2018 * proceeding. But for input(),
2019 * there's no matching to consider.
2020 * So convert the EOB_ACT_LAST_MATCH
2021 * to EOB_ACT_END_OF_FILE.
2024 /* Reset buffer status. */
2025 ael_yyrestart(yyin ,yyscanner);
2029 case EOB_ACT_END_OF_FILE:
2031 if ( ael_yywrap(yyscanner ) )
2034 if ( ! yyg->yy_did_buffer_switch_on_eof )
2037 return yyinput(yyscanner);
2039 return input(yyscanner);
2043 case EOB_ACT_CONTINUE_SCAN:
2044 yyg->yy_c_buf_p = yyg->yytext_ptr + offset;
2050 c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */
2051 *yyg->yy_c_buf_p = '\0'; /* preserve yytext */
2052 yyg->yy_hold_char = *++yyg->yy_c_buf_p;
2056 #endif /* ifndef YY_NO_INPUT */
2058 /** Immediately switch to a different input stream.
2059 * @param input_file A readable stream.
2060 * @param yyscanner The scanner object.
2061 * @note This function does not reset the start condition to @c INITIAL .
2063 void ael_yyrestart (FILE * input_file , yyscan_t yyscanner)
2065 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2067 if ( ! YY_CURRENT_BUFFER ){
2068 ael_yyensure_buffer_stack (yyscanner);
2069 YY_CURRENT_BUFFER_LVALUE =
2070 ael_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
2073 ael_yy_init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner);
2074 ael_yy_load_buffer_state(yyscanner );
2077 /** Switch to a different input buffer.
2078 * @param new_buffer The new input buffer.
2079 * @param yyscanner The scanner object.
2081 void ael_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
2083 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2085 /* TODO. We should be able to replace this entire function body
2087 * ael_yypop_buffer_state();
2088 * ael_yypush_buffer_state(new_buffer);
2090 ael_yyensure_buffer_stack (yyscanner);
2091 if ( YY_CURRENT_BUFFER == new_buffer )
2094 if ( YY_CURRENT_BUFFER )
2096 /* Flush out information for old buffer. */
2097 *yyg->yy_c_buf_p = yyg->yy_hold_char;
2098 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
2099 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
2102 YY_CURRENT_BUFFER_LVALUE = new_buffer;
2103 ael_yy_load_buffer_state(yyscanner );
2105 /* We don't actually know whether we did this switch during
2106 * EOF (ael_yywrap()) processing, but the only time this flag
2107 * is looked at is after ael_yywrap() is called, so it's safe
2108 * to go ahead and always set it.
2110 yyg->yy_did_buffer_switch_on_eof = 1;
2113 static void ael_yy_load_buffer_state (yyscan_t yyscanner)
2115 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2116 yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
2117 yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
2118 yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
2119 yyg->yy_hold_char = *yyg->yy_c_buf_p;
2122 /** Allocate and initialize an input buffer state.
2123 * @param file A readable stream.
2124 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
2125 * @param yyscanner The scanner object.
2126 * @return the allocated buffer state.
2128 YY_BUFFER_STATE ael_yy_create_buffer (FILE * file, int size , yyscan_t yyscanner)
2132 b = (YY_BUFFER_STATE) ael_yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner );
2134 YY_FATAL_ERROR( "out of dynamic memory in ael_yy_create_buffer()" );
2136 b->yy_buf_size = size;
2138 /* yy_ch_buf has to be 2 characters longer than the size given because
2139 * we need to put in 2 end-of-buffer characters.
2141 b->yy_ch_buf = (char *) ael_yyalloc(b->yy_buf_size + 2 ,yyscanner );
2142 if ( ! b->yy_ch_buf )
2143 YY_FATAL_ERROR( "out of dynamic memory in ael_yy_create_buffer()" );
2145 b->yy_is_our_buffer = 1;
2147 ael_yy_init_buffer(b,file ,yyscanner);
2152 /** Destroy the buffer.
2153 * @param b a buffer created with ael_yy_create_buffer()
2154 * @param yyscanner The scanner object.
2156 void ael_yy_delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
2158 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2163 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
2164 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
2166 if ( b->yy_is_our_buffer )
2167 ael_yyfree((void *) b->yy_ch_buf ,yyscanner );
2169 ael_yyfree((void *) b ,yyscanner );
2173 extern int isatty (int );
2174 #endif /* __cplusplus */
2176 /* Initializes or reinitializes a buffer.
2177 * This function is sometimes called more than once on the same buffer,
2178 * such as during a ael_yyrestart() or at EOF.
2180 static void ael_yy_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner)
2184 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2186 ael_yy_flush_buffer(b ,yyscanner);
2188 b->yy_input_file = file;
2189 b->yy_fill_buffer = 1;
2191 /* If b is the current buffer, then ael_yy_init_buffer was _probably_
2192 * called from ael_yyrestart() or through yy_get_next_buffer.
2193 * In that case, we don't want to reset the lineno or column.
2195 if (b != YY_CURRENT_BUFFER){
2196 b->yy_bs_lineno = 1;
2197 b->yy_bs_column = 0;
2200 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
2205 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
2206 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
2207 * @param yyscanner The scanner object.
2209 void ael_yy_flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
2211 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2217 /* We always need two end-of-buffer characters. The first causes
2218 * a transition to the end-of-buffer state. The second causes
2219 * a jam in that state.
2221 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
2222 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
2224 b->yy_buf_pos = &b->yy_ch_buf[0];
2227 b->yy_buffer_status = YY_BUFFER_NEW;
2229 if ( b == YY_CURRENT_BUFFER )
2230 ael_yy_load_buffer_state(yyscanner );
2233 /** Pushes the new state onto the stack. The new state becomes
2234 * the current state. This function will allocate the stack
2236 * @param new_buffer The new state.
2237 * @param yyscanner The scanner object.
2239 void ael_yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
2241 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2242 if (new_buffer == NULL)
2245 ael_yyensure_buffer_stack(yyscanner);
2247 /* This block is copied from ael_yy_switch_to_buffer. */
2248 if ( YY_CURRENT_BUFFER )
2250 /* Flush out information for old buffer. */
2251 *yyg->yy_c_buf_p = yyg->yy_hold_char;
2252 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
2253 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
2256 /* Only push if top exists. Otherwise, replace top. */
2257 if (YY_CURRENT_BUFFER)
2258 yyg->yy_buffer_stack_top++;
2259 YY_CURRENT_BUFFER_LVALUE = new_buffer;
2261 /* copied from ael_yy_switch_to_buffer. */
2262 ael_yy_load_buffer_state(yyscanner );
2263 yyg->yy_did_buffer_switch_on_eof = 1;
2266 /** Removes and deletes the top of the stack, if present.
2267 * The next element becomes the new top.
2268 * @param yyscanner The scanner object.
2270 void ael_yypop_buffer_state (yyscan_t yyscanner)
2272 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2273 if (!YY_CURRENT_BUFFER)
2276 ael_yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner);
2277 YY_CURRENT_BUFFER_LVALUE = NULL;
2278 if (yyg->yy_buffer_stack_top > 0)
2279 --yyg->yy_buffer_stack_top;
2281 if (YY_CURRENT_BUFFER) {
2282 ael_yy_load_buffer_state(yyscanner );
2283 yyg->yy_did_buffer_switch_on_eof = 1;
2287 /* Allocates the stack if it does not exist.
2288 * Guarantees space for at least one push.
2290 static void ael_yyensure_buffer_stack (yyscan_t yyscanner)
2293 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2295 if (!yyg->yy_buffer_stack) {
2297 /* First allocation is just for 2 elements, since we don't know if this
2298 * scanner will even need a stack. We use 2 instead of 1 to avoid an
2299 * immediate realloc on the next call.
2302 yyg->yy_buffer_stack = (struct yy_buffer_state**)ael_yyalloc
2303 (num_to_alloc * sizeof(struct yy_buffer_state*)
2306 memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
2308 yyg->yy_buffer_stack_max = num_to_alloc;
2309 yyg->yy_buffer_stack_top = 0;
2313 if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){
2315 /* Increase the buffer to prepare for a possible push. */
2316 int grow_size = 8 /* arbitrary grow size */;
2318 num_to_alloc = yyg->yy_buffer_stack_max + grow_size;
2319 yyg->yy_buffer_stack = (struct yy_buffer_state**)ael_yyrealloc
2320 (yyg->yy_buffer_stack,
2321 num_to_alloc * sizeof(struct yy_buffer_state*)
2324 /* zero only the new slots.*/
2325 memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*));
2326 yyg->yy_buffer_stack_max = num_to_alloc;
2330 /** Setup the input buffer state to scan directly from a user-specified character buffer.
2331 * @param base the character buffer
2332 * @param size the size in bytes of the character buffer
2333 * @param yyscanner The scanner object.
2334 * @return the newly allocated buffer state object.
2336 YY_BUFFER_STATE ael_yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner)
2341 base[size-2] != YY_END_OF_BUFFER_CHAR ||
2342 base[size-1] != YY_END_OF_BUFFER_CHAR )
2343 /* They forgot to leave room for the EOB's. */
2346 b = (YY_BUFFER_STATE) ael_yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner );
2348 YY_FATAL_ERROR( "out of dynamic memory in ael_yy_scan_buffer()" );
2350 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
2351 b->yy_buf_pos = b->yy_ch_buf = base;
2352 b->yy_is_our_buffer = 0;
2353 b->yy_input_file = 0;
2354 b->yy_n_chars = b->yy_buf_size;
2355 b->yy_is_interactive = 0;
2357 b->yy_fill_buffer = 0;
2358 b->yy_buffer_status = YY_BUFFER_NEW;
2360 ael_yy_switch_to_buffer(b ,yyscanner );
2365 /** Setup the input buffer state to scan a string. The next call to ael_yylex() will
2366 * scan from a @e copy of @a str.
2367 * @param yystr a NUL-terminated string to scan
2368 * @param yyscanner The scanner object.
2369 * @return the newly allocated buffer state object.
2370 * @note If you want to scan bytes that may contain NUL values, then use
2371 * ael_yy_scan_bytes() instead.
2373 YY_BUFFER_STATE ael_yy_scan_string (yyconst char * yystr , yyscan_t yyscanner)
2376 return ael_yy_scan_bytes(yystr,strlen(yystr) ,yyscanner);
2379 /** Setup the input buffer state to scan the given bytes. The next call to ael_yylex() will
2380 * scan from a @e copy of @a bytes.
2381 * @param bytes the byte buffer to scan
2382 * @param len the number of bytes in the buffer pointed to by @a bytes.
2383 * @param yyscanner The scanner object.
2384 * @return the newly allocated buffer state object.
2386 YY_BUFFER_STATE ael_yy_scan_bytes (yyconst char * yybytes, int _yybytes_len , yyscan_t yyscanner)
2393 /* Get memory for full buffer, including space for trailing EOB's. */
2394 n = _yybytes_len + 2;
2395 buf = (char *) ael_yyalloc(n ,yyscanner );
2397 YY_FATAL_ERROR( "out of dynamic memory in ael_yy_scan_bytes()" );
2399 for ( i = 0; i < _yybytes_len; ++i )
2400 buf[i] = yybytes[i];
2402 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
2404 b = ael_yy_scan_buffer(buf,n ,yyscanner);
2406 YY_FATAL_ERROR( "bad buffer in ael_yy_scan_bytes()" );
2408 /* It's okay to grow etc. this buffer, and we should throw it
2409 * away when we're done.
2411 b->yy_is_our_buffer = 1;
2416 #ifndef YY_EXIT_FAILURE
2417 #define YY_EXIT_FAILURE 2
2420 static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner)
2422 (void) fprintf( stderr, "%s\n", msg );
2423 exit( YY_EXIT_FAILURE );
2426 /* Redefine yyless() so it works in section 3 code. */
2432 /* Undo effects of setting up yytext. */ \
2433 int yyless_macro_arg = (n); \
2434 YY_LESS_LINENO(yyless_macro_arg);\
2435 yytext[yyleng] = yyg->yy_hold_char; \
2436 yyg->yy_c_buf_p = yytext + yyless_macro_arg; \
2437 yyg->yy_hold_char = *yyg->yy_c_buf_p; \
2438 *yyg->yy_c_buf_p = '\0'; \
2439 yyleng = yyless_macro_arg; \
2443 /* Accessor methods (get/set functions) to struct members. */
2445 /** Get the user-defined data for this scanner.
2446 * @param yyscanner The scanner object.
2448 YY_EXTRA_TYPE ael_yyget_extra (yyscan_t yyscanner)
2450 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2454 /** Get the current line number.
2455 * @param yyscanner The scanner object.
2457 int ael_yyget_lineno (yyscan_t yyscanner)
2459 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2461 if (! YY_CURRENT_BUFFER)
2467 /** Get the current column number.
2468 * @param yyscanner The scanner object.
2470 int ael_yyget_column (yyscan_t yyscanner)
2472 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2474 if (! YY_CURRENT_BUFFER)
2480 /** Get the input stream.
2481 * @param yyscanner The scanner object.
2483 FILE *ael_yyget_in (yyscan_t yyscanner)
2485 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2489 /** Get the output stream.
2490 * @param yyscanner The scanner object.
2492 FILE *ael_yyget_out (yyscan_t yyscanner)
2494 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2498 /** Get the length of the current token.
2499 * @param yyscanner The scanner object.
2501 int ael_yyget_leng (yyscan_t yyscanner)
2503 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2507 /** Get the current token.
2508 * @param yyscanner The scanner object.
2511 char *ael_yyget_text (yyscan_t yyscanner)
2513 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2517 /** Set the user-defined data. This data is never touched by the scanner.
2518 * @param user_defined The data to be associated with this scanner.
2519 * @param yyscanner The scanner object.
2521 void ael_yyset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner)
2523 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2524 yyextra = user_defined ;
2527 /** Set the current line number.
2528 * @param line_number
2529 * @param yyscanner The scanner object.
2531 void ael_yyset_lineno (int line_number , yyscan_t yyscanner)
2533 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2535 /* lineno is only valid if an input buffer exists. */
2536 if (! YY_CURRENT_BUFFER )
2537 yy_fatal_error( "ael_yyset_lineno called with no buffer" , yyscanner);
2539 yylineno = line_number;
2542 /** Set the current column.
2543 * @param line_number
2544 * @param yyscanner The scanner object.
2546 void ael_yyset_column (int column_no , yyscan_t yyscanner)
2548 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2550 /* column is only valid if an input buffer exists. */
2551 if (! YY_CURRENT_BUFFER )
2552 yy_fatal_error( "ael_yyset_column called with no buffer" , yyscanner);
2554 yycolumn = column_no;
2557 /** Set the input stream. This does not discard the current
2559 * @param in_str A readable stream.
2560 * @param yyscanner The scanner object.
2561 * @see ael_yy_switch_to_buffer
2563 void ael_yyset_in (FILE * in_str , yyscan_t yyscanner)
2565 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2569 void ael_yyset_out (FILE * out_str , yyscan_t yyscanner)
2571 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2575 int ael_yyget_debug (yyscan_t yyscanner)
2577 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2578 return yy_flex_debug;
2581 void ael_yyset_debug (int bdebug , yyscan_t yyscanner)
2583 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2584 yy_flex_debug = bdebug ;
2587 /* Accessor methods for yylval and yylloc */
2589 YYSTYPE * ael_yyget_lval (yyscan_t yyscanner)
2591 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2595 void ael_yyset_lval (YYSTYPE * yylval_param , yyscan_t yyscanner)
2597 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2598 yylval = yylval_param;
2601 YYLTYPE *ael_yyget_lloc (yyscan_t yyscanner)
2603 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2607 void ael_yyset_lloc (YYLTYPE * yylloc_param , yyscan_t yyscanner)
2609 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2610 yylloc = yylloc_param;
2613 /* User-visible API */
2615 /* ael_yylex_init is special because it creates the scanner itself, so it is
2616 * the ONLY reentrant function that doesn't take the scanner as the last argument.
2617 * That's why we explicitly handle the declaration, instead of using our macros.
2620 int ael_yylex_init(yyscan_t* ptr_yy_globals)
2623 if (ptr_yy_globals == NULL){
2628 *ptr_yy_globals = (yyscan_t) ael_yyalloc ( sizeof( struct yyguts_t ), NULL );
2630 if (*ptr_yy_globals == NULL){
2635 /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */
2636 memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
2638 return yy_init_globals ( *ptr_yy_globals );
2641 static int yy_init_globals (yyscan_t yyscanner)
2643 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2644 /* Initialization is the same as for the non-reentrant scanner.
2645 * This function is called from ael_yylex_destroy(), so don't allocate here.
2648 yyg->yy_buffer_stack = 0;
2649 yyg->yy_buffer_stack_top = 0;
2650 yyg->yy_buffer_stack_max = 0;
2651 yyg->yy_c_buf_p = (char *) 0;
2655 yyg->yy_start_stack_ptr = 0;
2656 yyg->yy_start_stack_depth = 0;
2657 yyg->yy_start_stack = NULL;
2659 /* Defined in main.c */
2668 /* For future reference: Set errno on error, since we are called by
2674 /* ael_yylex_destroy is for both reentrant and non-reentrant scanners. */
2675 int ael_yylex_destroy (yyscan_t yyscanner)
2677 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2679 /* Pop the buffer stack, destroying each element. */
2680 while(YY_CURRENT_BUFFER){
2681 ael_yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner );
2682 YY_CURRENT_BUFFER_LVALUE = NULL;
2683 ael_yypop_buffer_state(yyscanner);
2686 /* Destroy the stack itself. */
2687 ael_yyfree(yyg->yy_buffer_stack ,yyscanner);
2688 yyg->yy_buffer_stack = NULL;
2690 /* Destroy the start condition stack. */
2691 ael_yyfree(yyg->yy_start_stack ,yyscanner );
2692 yyg->yy_start_stack = NULL;
2694 /* Reset the globals. This is important in a non-reentrant scanner so the next time
2695 * ael_yylex() is called, initialization will occur. */
2696 yy_init_globals( yyscanner);
2698 /* Destroy the main struct (reentrant only). */
2699 ael_yyfree ( yyscanner , yyscanner );
2705 * Internal utility routines.
2709 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner)
2712 for ( i = 0; i < n; ++i )
2717 #ifdef YY_NEED_STRLEN
2718 static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner)
2721 for ( n = 0; s[n]; ++n )
2728 void *ael_yyalloc (yy_size_t size , yyscan_t yyscanner)
2730 return (void *) malloc( size );
2733 void *ael_yyrealloc (void * ptr, yy_size_t size , yyscan_t yyscanner)
2735 /* The cast to (char *) in the following accommodates both
2736 * implementations that use char* generic pointers, and those
2737 * that use void* generic pointers. It works with the latter
2738 * because both ANSI C and C++ allow castless assignment from
2739 * any pointer type to void*, and deal with argument conversions
2740 * as though doing an assignment.
2742 return (void *) realloc( (char *) ptr, size );
2745 void ael_yyfree (void * ptr , yyscan_t yyscanner)
2747 free( (char *) ptr ); /* see ael_yyrealloc() for (char *) cast */
2750 #define YYTABLES_NAME "yytables"
2752 #line 466 "ael.flex"
2756 static void pbcpush(char x)
2758 pbcstack[pbcpos++] = x;
2761 static int pbcpop(char x)
2763 if ( ( x == ')' && pbcstack[pbcpos-1] == '(' )
2764 || ( x == ']' && pbcstack[pbcpos-1] == '[' )
2765 || ( x == '}' && pbcstack[pbcpos-1] == '{' )) {
2769 return 1; /* error */
2772 static int c_prevword(void)
2774 char *c = prev_word;
2797 /* used by the bison code */
2798 void reset_parencount(yyscan_t yyscanner );
2799 void reset_parencount(yyscan_t yyscanner )
2801 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2809 /* used by the bison code */
2810 void reset_semicount(yyscan_t yyscanner );
2811 void reset_semicount(yyscan_t yyscanner )
2813 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2818 /* used by the bison code */
2819 void reset_argcount(yyscan_t yyscanner );
2820 void reset_argcount(yyscan_t yyscanner )
2822 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2831 /* used elsewhere, but some local vars */
2832 struct pval *ael2_parse(char *filename, int *errors)
2835 struct parse_io *io;
2840 /* extern int ael_yydebug; */
2842 io = calloc(sizeof(struct parse_io),1);
2843 /* reset the global counters */
2846 include_stack_index=0;
2848 /* ael_yydebug = 1; */
2849 ael_yylex_init(&io->scanner);
2850 fin = fopen(filename,"r");
2852 ast_log(LOG_ERROR,"File %s could not be opened\n", filename);
2856 my_file = strdup(filename);
2857 stat(filename, &stats);
2858 buffer = (char*)malloc(stats.st_size+2);
2859 fread(buffer, 1, stats.st_size, fin);
2860 buffer[stats.st_size]=0;
2863 ael_yy_scan_string (buffer ,io->scanner);
2864 ael_yyset_lineno(1 , io->scanner);
2866 /* ael_yyset_in (fin , io->scanner); OLD WAY */
2872 *errors = io->syntax_error_count;
2874 ael_yylex_destroy(io->scanner);