1 #line 1 "am-scanner.c"
2 
3 #line 3 "am-scanner.c"
4 
5 #define  YY_INT_ALIGNED short int
6 
7 /* A lexical scanner generated by flex */
8 
9 /* %not-for-header */
10 /* %if-c-only */
11 /* %if-not-reentrant */
12 /* %endif */
13 /* %endif */
14 /* %ok-for-header */
15 
16 #define FLEX_SCANNER
17 #define YY_FLEX_MAJOR_VERSION 2
18 #define YY_FLEX_MINOR_VERSION 6
19 #define YY_FLEX_SUBMINOR_VERSION 4
20 #if YY_FLEX_SUBMINOR_VERSION > 0
21 #define FLEX_BETA
22 #endif
23 
24 /* %if-c++-only */
25 /* %endif */
26 
27 /* %if-c-only */
28 #ifdef yy_create_buffer
29 #define amp_am_yy_create_buffer_ALREADY_DEFINED
30 #else
31 #define yy_create_buffer amp_am_yy_create_buffer
32 #endif
33 
34 #ifdef yy_delete_buffer
35 #define amp_am_yy_delete_buffer_ALREADY_DEFINED
36 #else
37 #define yy_delete_buffer amp_am_yy_delete_buffer
38 #endif
39 
40 #ifdef yy_scan_buffer
41 #define amp_am_yy_scan_buffer_ALREADY_DEFINED
42 #else
43 #define yy_scan_buffer amp_am_yy_scan_buffer
44 #endif
45 
46 #ifdef yy_scan_string
47 #define amp_am_yy_scan_string_ALREADY_DEFINED
48 #else
49 #define yy_scan_string amp_am_yy_scan_string
50 #endif
51 
52 #ifdef yy_scan_bytes
53 #define amp_am_yy_scan_bytes_ALREADY_DEFINED
54 #else
55 #define yy_scan_bytes amp_am_yy_scan_bytes
56 #endif
57 
58 #ifdef yy_init_buffer
59 #define amp_am_yy_init_buffer_ALREADY_DEFINED
60 #else
61 #define yy_init_buffer amp_am_yy_init_buffer
62 #endif
63 
64 #ifdef yy_flush_buffer
65 #define amp_am_yy_flush_buffer_ALREADY_DEFINED
66 #else
67 #define yy_flush_buffer amp_am_yy_flush_buffer
68 #endif
69 
70 #ifdef yy_load_buffer_state
71 #define amp_am_yy_load_buffer_state_ALREADY_DEFINED
72 #else
73 #define yy_load_buffer_state amp_am_yy_load_buffer_state
74 #endif
75 
76 #ifdef yy_switch_to_buffer
77 #define amp_am_yy_switch_to_buffer_ALREADY_DEFINED
78 #else
79 #define yy_switch_to_buffer amp_am_yy_switch_to_buffer
80 #endif
81 
82 #ifdef yypush_buffer_state
83 #define amp_am_yypush_buffer_state_ALREADY_DEFINED
84 #else
85 #define yypush_buffer_state amp_am_yypush_buffer_state
86 #endif
87 
88 #ifdef yypop_buffer_state
89 #define amp_am_yypop_buffer_state_ALREADY_DEFINED
90 #else
91 #define yypop_buffer_state amp_am_yypop_buffer_state
92 #endif
93 
94 #ifdef yyensure_buffer_stack
95 #define amp_am_yyensure_buffer_stack_ALREADY_DEFINED
96 #else
97 #define yyensure_buffer_stack amp_am_yyensure_buffer_stack
98 #endif
99 
100 #ifdef yylex
101 #define amp_am_yylex_ALREADY_DEFINED
102 #else
103 #define yylex amp_am_yylex
104 #endif
105 
106 #ifdef yyrestart
107 #define amp_am_yyrestart_ALREADY_DEFINED
108 #else
109 #define yyrestart amp_am_yyrestart
110 #endif
111 
112 #ifdef yylex_init
113 #define amp_am_yylex_init_ALREADY_DEFINED
114 #else
115 #define yylex_init amp_am_yylex_init
116 #endif
117 
118 #ifdef yylex_init_extra
119 #define amp_am_yylex_init_extra_ALREADY_DEFINED
120 #else
121 #define yylex_init_extra amp_am_yylex_init_extra
122 #endif
123 
124 #ifdef yylex_destroy
125 #define amp_am_yylex_destroy_ALREADY_DEFINED
126 #else
127 #define yylex_destroy amp_am_yylex_destroy
128 #endif
129 
130 #ifdef yyget_debug
131 #define amp_am_yyget_debug_ALREADY_DEFINED
132 #else
133 #define yyget_debug amp_am_yyget_debug
134 #endif
135 
136 #ifdef yyset_debug
137 #define amp_am_yyset_debug_ALREADY_DEFINED
138 #else
139 #define yyset_debug amp_am_yyset_debug
140 #endif
141 
142 #ifdef yyget_extra
143 #define amp_am_yyget_extra_ALREADY_DEFINED
144 #else
145 #define yyget_extra amp_am_yyget_extra
146 #endif
147 
148 #ifdef yyset_extra
149 #define amp_am_yyset_extra_ALREADY_DEFINED
150 #else
151 #define yyset_extra amp_am_yyset_extra
152 #endif
153 
154 #ifdef yyget_in
155 #define amp_am_yyget_in_ALREADY_DEFINED
156 #else
157 #define yyget_in amp_am_yyget_in
158 #endif
159 
160 #ifdef yyset_in
161 #define amp_am_yyset_in_ALREADY_DEFINED
162 #else
163 #define yyset_in amp_am_yyset_in
164 #endif
165 
166 #ifdef yyget_out
167 #define amp_am_yyget_out_ALREADY_DEFINED
168 #else
169 #define yyget_out amp_am_yyget_out
170 #endif
171 
172 #ifdef yyset_out
173 #define amp_am_yyset_out_ALREADY_DEFINED
174 #else
175 #define yyset_out amp_am_yyset_out
176 #endif
177 
178 #ifdef yyget_leng
179 #define amp_am_yyget_leng_ALREADY_DEFINED
180 #else
181 #define yyget_leng amp_am_yyget_leng
182 #endif
183 
184 #ifdef yyget_text
185 #define amp_am_yyget_text_ALREADY_DEFINED
186 #else
187 #define yyget_text amp_am_yyget_text
188 #endif
189 
190 #ifdef yyget_lineno
191 #define amp_am_yyget_lineno_ALREADY_DEFINED
192 #else
193 #define yyget_lineno amp_am_yyget_lineno
194 #endif
195 
196 #ifdef yyset_lineno
197 #define amp_am_yyset_lineno_ALREADY_DEFINED
198 #else
199 #define yyset_lineno amp_am_yyset_lineno
200 #endif
201 
202 #ifdef yyget_column
203 #define amp_am_yyget_column_ALREADY_DEFINED
204 #else
205 #define yyget_column amp_am_yyget_column
206 #endif
207 
208 #ifdef yyset_column
209 #define amp_am_yyset_column_ALREADY_DEFINED
210 #else
211 #define yyset_column amp_am_yyset_column
212 #endif
213 
214 #ifdef yywrap
215 #define amp_am_yywrap_ALREADY_DEFINED
216 #else
217 #define yywrap amp_am_yywrap
218 #endif
219 
220 /* %endif */
221 
222 #ifdef yyget_lval
223 #define amp_am_yyget_lval_ALREADY_DEFINED
224 #else
225 #define yyget_lval amp_am_yyget_lval
226 #endif
227 
228 #ifdef yyset_lval
229 #define amp_am_yyset_lval_ALREADY_DEFINED
230 #else
231 #define yyset_lval amp_am_yyset_lval
232 #endif
233 
234 #ifdef yyget_lloc
235 #define amp_am_yyget_lloc_ALREADY_DEFINED
236 #else
237 #define yyget_lloc amp_am_yyget_lloc
238 #endif
239 
240 #ifdef yyset_lloc
241 #define amp_am_yyset_lloc_ALREADY_DEFINED
242 #else
243 #define yyset_lloc amp_am_yyset_lloc
244 #endif
245 
246 #ifdef yyalloc
247 #define amp_am_yyalloc_ALREADY_DEFINED
248 #else
249 #define yyalloc amp_am_yyalloc
250 #endif
251 
252 #ifdef yyrealloc
253 #define amp_am_yyrealloc_ALREADY_DEFINED
254 #else
255 #define yyrealloc amp_am_yyrealloc
256 #endif
257 
258 #ifdef yyfree
259 #define amp_am_yyfree_ALREADY_DEFINED
260 #else
261 #define yyfree amp_am_yyfree
262 #endif
263 
264 /* %if-c-only */
265 
266 /* %endif */
267 
268 /* First, we deal with  platform-specific or compiler-specific issues. */
269 
270 /* begin standard C headers. */
271 /* %if-c-only */
272 #include <stdio.h>
273 #include <string.h>
274 #include <errno.h>
275 #include <stdlib.h>
276 /* %endif */
277 
278 /* %if-tables-serialization */
279 /* %endif */
280 /* end standard C headers. */
281 
282 /* %if-c-or-c++ */
283 /* flex integer type definitions */
284 
285 #ifndef FLEXINT_H
286 #define FLEXINT_H
287 
288 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
289 
290 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
291 
292 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
293  * if you want the limit (max/min) macros for int types.
294  */
295 #ifndef __STDC_LIMIT_MACROS
296 #define __STDC_LIMIT_MACROS 1
297 #endif
298 
299 #include <inttypes.h>
300 typedef int8_t flex_int8_t;
301 typedef uint8_t flex_uint8_t;
302 typedef int16_t flex_int16_t;
303 typedef uint16_t flex_uint16_t;
304 typedef int32_t flex_int32_t;
305 typedef uint32_t flex_uint32_t;
306 #else
307 typedef signed char flex_int8_t;
308 typedef short int flex_int16_t;
309 typedef int flex_int32_t;
310 typedef unsigned char flex_uint8_t;
311 typedef unsigned short int flex_uint16_t;
312 typedef unsigned int flex_uint32_t;
313 
314 /* Limits of integral types. */
315 #ifndef INT8_MIN
316 #define INT8_MIN               (-128)
317 #endif
318 #ifndef INT16_MIN
319 #define INT16_MIN              (-32767-1)
320 #endif
321 #ifndef INT32_MIN
322 #define INT32_MIN              (-2147483647-1)
323 #endif
324 #ifndef INT8_MAX
325 #define INT8_MAX               (127)
326 #endif
327 #ifndef INT16_MAX
328 #define INT16_MAX              (32767)
329 #endif
330 #ifndef INT32_MAX
331 #define INT32_MAX              (2147483647)
332 #endif
333 #ifndef UINT8_MAX
334 #define UINT8_MAX              (255U)
335 #endif
336 #ifndef UINT16_MAX
337 #define UINT16_MAX             (65535U)
338 #endif
339 #ifndef UINT32_MAX
340 #define UINT32_MAX             (4294967295U)
341 #endif
342 
343 #ifndef SIZE_MAX
344 #define SIZE_MAX               (~(size_t)0)
345 #endif
346 
347 #endif /* ! C99 */
348 
349 #endif /* ! FLEXINT_H */
350 
351 /* %endif */
352 
353 /* begin standard C++ headers. */
354 /* %if-c++-only */
355 /* %endif */
356 
357 /* TODO: this is always defined, so inline it */
358 #define yyconst const
359 
360 #if defined(__GNUC__) && __GNUC__ >= 3
361 #define yynoreturn __attribute__((__noreturn__))
362 #else
363 #define yynoreturn
364 #endif
365 
366 /* %not-for-header */
367 /* Returned upon end-of-file. */
368 #define YY_NULL 0
369 /* %ok-for-header */
370 
371 /* %not-for-header */
372 /* Promotes a possibly negative, possibly signed char to an
373  *   integer in range [0..255] for use as an array index.
374  */
375 #define YY_SC_TO_UI(c) ((YY_CHAR) (c))
376 /* %ok-for-header */
377 
378 /* %if-reentrant */
379 
380 /* An opaque pointer. */
381 #ifndef YY_TYPEDEF_YY_SCANNER_T
382 #define YY_TYPEDEF_YY_SCANNER_T
383 typedef void* yyscan_t;
384 #endif
385 
386 /* For convenience, these vars (plus the bison vars far below)
387    are macros in the reentrant scanner. */
388 #define yyin yyg->yyin_r
389 #define yyout yyg->yyout_r
390 #define yyextra yyg->yyextra_r
391 #define yyleng yyg->yyleng_r
392 #define yytext yyg->yytext_r
393 #define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)
394 #define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
395 #define yy_flex_debug yyg->yy_flex_debug_r
396 
397 /* %endif */
398 
399 /* %if-not-reentrant */
400 /* %endif */
401 
402 /* Enter a start condition.  This macro really ought to take a parameter,
403  * but we do it the disgusting crufty way forced on us by the ()-less
404  * definition of BEGIN.
405  */
406 #define BEGIN yyg->yy_start = 1 + 2 *
407 /* Translate the current start state into a value that can be later handed
408  * to BEGIN to return to the state.  The YYSTATE alias is for lex
409  * compatibility.
410  */
411 #define YY_START ((yyg->yy_start - 1) / 2)
412 #define YYSTATE YY_START
413 /* Action number for EOF rule of a given start state. */
414 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
415 /* Special action meaning "start processing a new file". */
416 #define YY_NEW_FILE yyrestart( yyin , yyscanner )
417 #define YY_END_OF_BUFFER_CHAR 0
418 
419 /* Size of default input buffer. */
420 #ifndef YY_BUF_SIZE
421 #ifdef __ia64__
422 /* On IA-64, the buffer size is 16k, not 8k.
423  * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
424  * Ditto for the __ia64__ case accordingly.
425  */
426 #define YY_BUF_SIZE 32768
427 #else
428 #define YY_BUF_SIZE 16384
429 #endif /* __ia64__ */
430 #endif
431 
432 /* The state buf must be large enough to hold one state per character in the main buffer.
433  */
434 #define YY_STATE_BUF_SIZE   ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
435 
436 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
437 #define YY_TYPEDEF_YY_BUFFER_STATE
438 typedef struct yy_buffer_state *YY_BUFFER_STATE;
439 #endif
440 
441 #ifndef YY_TYPEDEF_YY_SIZE_T
442 #define YY_TYPEDEF_YY_SIZE_T
443 typedef size_t yy_size_t;
444 #endif
445 
446 /* %if-not-reentrant */
447 /* %endif */
448 
449 /* %if-c-only */
450 /* %if-not-reentrant */
451 /* %endif */
452 /* %endif */
453 
454 #define EOB_ACT_CONTINUE_SCAN 0
455 #define EOB_ACT_END_OF_FILE 1
456 #define EOB_ACT_LAST_MATCH 2
457 
458     /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires
459      *       access to the local variable yy_act. Since yyless() is a macro, it would break
460      *       existing scanners that call yyless() from OUTSIDE yylex.
461      *       One obvious solution it to make yy_act a global. I tried that, and saw
462      *       a 5% performance hit in a non-yylineno scanner, because yy_act is
463      *       normally declared as a register variable-- so it is not worth it.
464      */
465     #define  YY_LESS_LINENO(n) \
466             do { \
467                 int yyl;\
468                 for ( yyl = n; yyl < yyleng; ++yyl )\
469                     if ( yytext[yyl] == '\n' )\
470                         --yylineno;\
471             }while(0)
472     #define YY_LINENO_REWIND_TO(dst) \
473             do {\
474                 const char *p;\
475                 for ( p = yy_cp-1; p >= (dst); --p)\
476                     if ( *p == '\n' )\
477                         --yylineno;\
478             }while(0)
479 
480 /* Return all but the first "n" matched characters back to the input stream. */
481 #define yyless(n) \
482 	do \
483 		{ \
484 		/* Undo effects of setting up yytext. */ \
485         int yyless_macro_arg = (n); \
486         YY_LESS_LINENO(yyless_macro_arg);\
487 		*yy_cp = yyg->yy_hold_char; \
488 		YY_RESTORE_YY_MORE_OFFSET \
489 		yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
490 		YY_DO_BEFORE_ACTION; /* set up yytext again */ \
491 		} \
492 	while ( 0 )
493 #define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
494 
495 #ifndef YY_STRUCT_YY_BUFFER_STATE
496 #define YY_STRUCT_YY_BUFFER_STATE
497 struct yy_buffer_state
498 	{
499 /* %if-c-only */
500 	FILE *yy_input_file;
501 /* %endif */
502 
503 /* %if-c++-only */
504 /* %endif */
505 
506 	char *yy_ch_buf;		/* input buffer */
507 	char *yy_buf_pos;		/* current position in input buffer */
508 
509 	/* Size of input buffer in bytes, not including room for EOB
510 	 * characters.
511 	 */
512 	int yy_buf_size;
513 
514 	/* Number of characters read into yy_ch_buf, not including EOB
515 	 * characters.
516 	 */
517 	int yy_n_chars;
518 
519 	/* Whether we "own" the buffer - i.e., we know we created it,
520 	 * and can realloc() it to grow it, and should free() it to
521 	 * delete it.
522 	 */
523 	int yy_is_our_buffer;
524 
525 	/* Whether this is an "interactive" input source; if so, and
526 	 * if we're using stdio for input, then we want to use getc()
527 	 * instead of fread(), to make sure we stop fetching input after
528 	 * each newline.
529 	 */
530 	int yy_is_interactive;
531 
532 	/* Whether we're considered to be at the beginning of a line.
533 	 * If so, '^' rules will be active on the next match, otherwise
534 	 * not.
535 	 */
536 	int yy_at_bol;
537 
538     int yy_bs_lineno; /**< The line count. */
539     int yy_bs_column; /**< The column count. */
540 
541 	/* Whether to try to fill the input buffer when we reach the
542 	 * end of it.
543 	 */
544 	int yy_fill_buffer;
545 
546 	int yy_buffer_status;
547 
548 #define YY_BUFFER_NEW 0
549 #define YY_BUFFER_NORMAL 1
550 	/* When an EOF's been seen but there's still some text to process
551 	 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
552 	 * shouldn't try reading from the input source any more.  We might
553 	 * still have a bunch of tokens to match, though, because of
554 	 * possible backing-up.
555 	 *
556 	 * When we actually see the EOF, we change the status to "new"
557 	 * (via yyrestart()), so that the user can continue scanning by
558 	 * just pointing yyin at a new input file.
559 	 */
560 #define YY_BUFFER_EOF_PENDING 2
561 
562 	};
563 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
564 
565 /* %if-c-only Standard (non-C++) definition */
566 /* %not-for-header */
567 /* %if-not-reentrant */
568 /* %endif */
569 /* %ok-for-header */
570 
571 /* %endif */
572 
573 /* We provide macros for accessing buffer states in case in the
574  * future we want to put the buffer states in a more general
575  * "scanner state".
576  *
577  * Returns the top of the stack, or NULL.
578  */
579 #define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \
580                           ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \
581                           : NULL)
582 /* Same as previous macro, but useful when we know that the buffer stack is not
583  * NULL or when we need an lvalue. For internal use only.
584  */
585 #define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]
586 
587 /* %if-c-only Standard (non-C++) definition */
588 
589 /* %if-not-reentrant */
590 /* %not-for-header */
591 /* %ok-for-header */
592 
593 /* %endif */
594 
595 void yyrestart ( FILE *input_file , yyscan_t yyscanner );
596 void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner );
597 YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size , yyscan_t yyscanner );
598 void yy_delete_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner );
599 void yy_flush_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner );
600 void yypush_buffer_state ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner );
601 void yypop_buffer_state ( yyscan_t yyscanner );
602 
603 static void yyensure_buffer_stack ( yyscan_t yyscanner );
604 static void yy_load_buffer_state ( yyscan_t yyscanner );
605 static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file , yyscan_t yyscanner );
606 #define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER , yyscanner)
607 
608 YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size , yyscan_t yyscanner );
609 YY_BUFFER_STATE yy_scan_string ( const char *yy_str , yyscan_t yyscanner );
610 YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len , yyscan_t yyscanner );
611 
612 /* %endif */
613 
614 void *yyalloc ( yy_size_t , yyscan_t yyscanner );
615 void *yyrealloc ( void *, yy_size_t , yyscan_t yyscanner );
616 void yyfree ( void * , yyscan_t yyscanner );
617 
618 #define yy_new_buffer yy_create_buffer
619 #define yy_set_interactive(is_interactive) \
620 	{ \
621 	if ( ! YY_CURRENT_BUFFER ){ \
622         yyensure_buffer_stack (yyscanner); \
623 		YY_CURRENT_BUFFER_LVALUE =    \
624             yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \
625 	} \
626 	YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
627 	}
628 #define yy_set_bol(at_bol) \
629 	{ \
630 	if ( ! YY_CURRENT_BUFFER ){\
631         yyensure_buffer_stack (yyscanner); \
632 		YY_CURRENT_BUFFER_LVALUE =    \
633             yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \
634 	} \
635 	YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
636 	}
637 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
638 
639 /* %% [1.0] yytext/yyin/yyout/yy_state_type/yylineno etc. def's & init go here */
640 /* Begin user sect3 */
641 
642 #define amp_am_yywrap(yyscanner) (/*CONSTCOND*/1)
643 #define YY_SKIP_YYWRAP
644 
645 #define FLEX_DEBUG
646 typedef flex_uint8_t YY_CHAR;
647 
648 typedef int yy_state_type;
649 
650 #define yytext_ptr yytext_r
651 
652 /* %% [1.5] DFA */
653 
654 /* %if-c-only Standard (non-C++) definition */
655 
656 static yy_state_type yy_get_previous_state ( yyscan_t yyscanner );
657 static yy_state_type yy_try_NUL_trans ( yy_state_type current_state  , yyscan_t yyscanner);
658 static int yy_get_next_buffer ( yyscan_t yyscanner );
659 static void yynoreturn yy_fatal_error ( const char* msg , yyscan_t yyscanner );
660 
661 /* %endif */
662 
663 /* Done after the current pattern has been matched and before the
664  * corresponding action - sets up yytext.
665  */
666 #define YY_DO_BEFORE_ACTION \
667 	yyg->yytext_ptr = yy_bp; \
668 /* %% [2.0] code to fiddle yytext and yyleng for yymore() goes here \ */\
669 	yyleng = (int) (yy_cp - yy_bp); \
670 	yyg->yy_hold_char = *yy_cp; \
671 	*yy_cp = '\0'; \
672 /* %% [3.0] code to copy yytext_ptr to yytext[] goes here, if %array \ */\
673 	yyg->yy_c_buf_p = yy_cp;
674 /* %% [4.0] data tables for the DFA and the user's section 1 definitions go here */
675 #define YY_NUM_RULES 63
676 #define YY_END_OF_BUFFER 64
677 /* This struct is not used in this scanner,
678    but its presence is necessary. */
679 struct yy_trans_info
680 	{
681 	flex_int32_t yy_verify;
682 	flex_int32_t yy_nxt;
683 	};
684 static const flex_int16_t yy_accept[321] =
685     {   0,
686        61,   61,   64,   61,    4,    1,   62,    2,   62,   62,
687        61,   61,    9,   11,   13,   61,   62,   61,   61,   61,
688        62,   61,   61,   61,   12,   61,   61,   61,    0,    0,
689         2,    0,    0,    3,    8,    0,    0,   16,   61,   10,
690        14,   15,    0,    5,   61,   61,   61,    2,   17,   20,
691        18,   19,   61,   61,   61,   61,   61,   61,   61,   61,
692        61,   61,   61,   61,   61,   61,   61,    2,    0,    0,
693        61,   61,   61,   61,   61,   61,   61,   61,   61,   61,
694        61,   61,   61,   61,   61,   61,   61,   61,   61,   61,
695        61,   61,   61,   61,   61,   37,   61,    6,    7,   61,
696 
697        61,   61,   61,   61,   61,   61,   61,   61,   61,   61,
698        61,   61,   61,   61,   61,   61,   61,   61,   61,   61,
699        61,   61,   61,   61,   61,   61,   61,   61,   61,   61,
700        61,   61,   61,   61,   61,   61,   61,   61,   61,   61,
701        61,   61,   61,   61,   61,   61,   61,   61,   61,   25,
702        61,   61,   61,   33,   61,   61,   61,   61,   61,   28,
703        61,   30,   61,   61,   61,   61,   61,   61,   61,   61,
704        61,   61,   61,   61,   61,   61,   61,   61,   61,   61,
705        61,   61,   61,   61,   61,   61,   61,   61,   61,   61,
706        61,   59,   61,   61,   61,   61,   61,   61,   61,   61,
707 
708        61,   61,   61,   61,   61,   61,   61,   61,   61,   61,
709        61,   33,   61,   61,   61,   61,   61,   61,   23,   50,
710        61,   61,   61,   61,   61,   61,   61,   56,   60,   61,
711        61,   61,   61,   32,   61,   61,   61,   61,   57,   21,
712        22,   61,   61,   61,   61,   61,   61,   61,   61,   61,
713        61,   61,   61,   61,   61,   54,   26,   61,   48,   61,
714        61,   61,   61,   34,   35,   61,   61,   40,   61,   61,
715        61,   61,   61,   46,   61,   61,   47,   61,   49,   51,
716        61,   61,   61,   61,   61,   31,   36,   61,   61,   61,
717        44,   61,   38,   61,   61,   61,   61,   61,   27,   61,
718 
719        55,   53,   39,   41,   61,   61,   61,   61,   61,   52,
720        61,   61,   45,   43,   24,   61,   29,   42,   58,    0
721     } ;
722 
723 static const YY_CHAR yy_ec[256] =
724     {   0,
725         1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
726         1,    1,    4,    1,    1,    1,    1,    1,    1,    1,
727         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
728         1,    5,    1,    6,    7,    8,    1,    6,    6,    9,
729        10,    1,   11,    1,   12,    1,    1,    1,    1,    1,
730         1,    1,    1,    1,    1,    1,    1,   13,   14,    1,
731        15,    1,   16,   17,   18,   19,   20,   21,   22,   23,
732        24,   25,   26,   27,    1,   28,   29,   30,   31,   32,
733         1,   33,   34,   35,   36,   37,    1,   38,   39,    1,
734         1,   40,    1,    1,   41,    6,    1,    1,   42,   43,
735 
736        44,    1,    1,    1,   45,    1,    1,   46,    1,   47,
737         1,    1,    1,   48,    1,    1,   49,    1,    1,    1,
738         1,    1,   50,   51,   52,    1,    1,    1,    1,    1,
739         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
740         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
741         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
742         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
743         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
744         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
745         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
746 
747         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
748         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
749         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
750         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
751         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
752         1,    1,    1,    1,    1
753     } ;
754 
755 static const YY_CHAR yy_meta[53] =
756     {   0,
757         1,    2,    2,    2,    2,    3,    3,    3,    1,    4,
758         1,    1,    3,    1,    3,    1,    5,    1,    1,    1,
759         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
760         1,    1,    1,    1,    1,    1,    1,    1,    1,    3,
761         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
762         1,    6
763     } ;
764 
765 static const flex_int16_t yy_base[327] =
766     {   0,
767         0,    0,  202,   12,   52,  985,  985,   56,  190,   47,
768        45,   21,   52,   27,  985,   57,  154,   40,   48,   35,
769        72,   81,   39,   52,   49,   62,    0,   76,  121,  153,
770       125,  141,  111,  985,  985,    0,    0,  985,   88,  985,
771       985,  985,   94,  985,   93,   99,  106,  136,  985,  985,
772       985,  985,  114,  121,  125,  126,  132,  137,  136,  140,
773       149,  154,  148,  143,  164,  153,  157,  201,   97,   42,
774       167,  191,  180,  183,  184,  188,  194,  199,  204,  210,
775       220,  207,  231,  215,  236,  224,  216,  235,  240,  225,
776       247,  246,  253,  256,  257,  110,  260,  985,  985,  261,
777 
778       282,  272,  268,  295,  276,  290,  299,  232,  286,  306,
779       303,  309,  310,  313,  317,  316,  321,  320,  327,  330,
780       347,  334,  341,  335,  352,  355,  356,  348,  359,  360,
781       365,  369,  364,  368,  386,  383,  378,  395,  391,  402,
782       394,  403,  411,  412,   39,  390,  417,  420,  421,  416,
783       426,  429,  443,  430,  447,  433,  442,  454,  459,  437,
784       460,  446,  468,  463,  451,  467,  473,  477,  482,  474,
785       478,  481,  494,  490,  503,  499,  510,  502,  511,  514,
786       518,  521,  527,  507,  526,  531,  538,  544,  547,  543,
787       550,  534,  554,  555,  559,  566,  570,  573,  565,  574,
788 
789       577,  583,  587,  591,  588,  592,  597,  603,  611,  615,
790       607,  625,  629,  633,  626,  630,  636,  640,  551,  580,
791       637,  641,  653,  621,  652,  657,  656,  646,  660,  665,
792       670,  674,  673,  664,  678,  684,  679,  691,  683,  687,
793       688,  699,  705,  717,  712,  716,  713,  704,  721,  722,
794       727,  730,  733,  738,  739,  700,  734,  748,  742,  756,
795       751,  762,  759,  747,  755,  767,  763,  766,  771,  787,
796       779,  788,  783,  778,  797,  800,  782,  801,  791,  792,
797       816,  813,  805,  819,  824,  806,  809,  827,  830,  835,
798       810,  845,  831,  842,  851,  846,  854,  850,  855,  859,
799 
800       858,  862,  863,  866,  884,  876,  877,  880,  890,  872,
801       894,  895,  881,  889,  898,  906,  901,  902,  905,  985,
802       949,  955,  961,  967,  973,  979
803     } ;
804 
805 static const flex_int16_t yy_def[327] =
806     {   0,
807       320,    1,  320,  321,  320,  320,  320,  320,  322,  323,
808       321,  321,  320,  321,  320,  321,  324,  321,  321,  321,
809       320,  321,  321,  321,  321,  321,   22,  321,  320,  322,
810       320,  320,  322,  320,  320,  325,  326,  320,  321,  320,
811       320,  320,  324,  320,  321,  321,  321,  320,  320,  320,
812       320,  320,  321,  321,  321,  321,  321,  321,  321,  321,
813       321,  321,  321,  321,  321,  321,  321,  320,  325,  326,
814       321,   22,  321,  321,  321,  321,  321,  321,  321,  321,
815       321,  321,  321,  321,  321,  321,  321,  321,  321,  321,
816       321,  321,  321,  321,  321,  321,  321,  320,  320,  321,
817 
818       321,  321,  321,  321,  321,  321,  321,  321,  321,  321,
819       321,  321,  321,  321,  321,  321,  321,  321,  321,  321,
820       321,  321,  321,  321,  321,  321,  321,  321,  321,  321,
821       321,  321,  321,  321,  321,  321,  321,  321,  321,  321,
822       321,  321,  321,  321,   22,  321,  321,  321,  321,  321,
823       321,  321,  321,  321,  321,  321,  321,  321,  321,  321,
824       321,  321,  321,  321,  321,  321,  321,  321,  321,  321,
825       321,  321,  321,  321,  321,  321,  321,  321,  321,  321,
826       321,  321,  321,  321,  321,  321,  321,  321,  321,  321,
827       321,  321,  321,  321,  321,  321,  321,  321,  321,  321,
828 
829       321,  321,  321,  321,  321,  321,  321,  321,  321,  321,
830       321,  321,  321,  321,  321,  321,  321,  321,  321,  321,
831       321,  321,  321,  321,  321,  321,  321,  321,  321,  321,
832       321,  321,  321,  321,  321,  321,  321,  321,  321,  321,
833       321,  321,  321,  321,  321,  321,  321,  321,  321,  321,
834       321,  321,  321,  321,  321,  321,  321,  321,  321,  321,
835       321,  321,  321,  321,  321,  321,  321,  321,  321,  321,
836       321,  321,  321,  321,  321,  321,  321,  321,  321,  321,
837       321,  321,  321,  321,  321,  321,  321,  321,  321,  321,
838       321,  321,  321,  321,  321,  321,  321,  321,  321,  321,
839 
840       321,  321,  321,  321,  321,  321,  321,  321,  321,  321,
841       321,  321,  321,  321,  321,  321,  321,  321,  321,    0,
842       320,  320,  320,  320,  320,  320
843     } ;
844 
845 static const flex_int16_t yy_nxt[1038] =
846     {   0,
847         4,    5,    6,    7,    8,    7,    9,   10,    4,    4,
848        11,   12,   13,   14,   15,   16,   17,   18,    4,    4,
849        19,    4,    4,    4,    4,    4,    4,    4,    4,    4,
850         4,    4,    4,   20,    4,    4,    4,    4,    4,   21,
851        22,    4,   23,    4,   24,    4,    4,    4,    4,    4,
852        25,    4,   27,   29,   28,   36,   29,   31,   30,   38,
853        31,   27,   30,   28,   40,   39,   41,   27,   45,   28,
854        47,   42,  183,   46,   48,   27,   49,   28,   50,   27,
855        27,   28,   28,   66,   51,   27,   52,   28,   27,   27,
856        28,   28,   27,   99,   28,   32,   37,   27,   67,   28,
857 
858        53,   54,   27,   55,   28,   56,   98,   57,   58,   59,
859        44,   60,   61,   34,   62,   63,   27,   64,   28,   65,
860        66,   27,   29,   28,   74,   29,   31,   30,   27,   31,
861        28,   30,   73,   72,   71,   28,   75,   68,   78,   27,
862        68,   28,   79,   68,   80,   76,   27,   81,   28,   82,
863        27,   77,   28,   87,   27,   34,   28,   83,   88,   84,
864        94,   27,   85,   28,   32,   27,   27,   28,   28,   93,
865        44,   86,   27,   91,   28,   32,   27,   27,   28,   28,
866        27,   89,   28,   27,   92,   28,   95,   90,   27,   27,
867        28,   28,   34,   27,   27,   28,   28,   27,   97,   28,
868 
869        96,  320,   68,  109,   27,   68,   28,   27,  100,   28,
870       101,  110,  320,  102,  108,  320,  320,  103,  104,  111,
871        27,  105,   28,   27,   27,   28,   28,  106,   27,  107,
872        28,  112,  115,  113,   27,  114,   28,  116,  320,   27,
873        32,   28,  120,  117,   27,  124,   28,   27,  118,   28,
874        27,  123,   28,  119,  121,   27,   27,   28,   28,  127,
875        27,  125,   28,  320,   27,   27,   28,   28,  320,  122,
876       126,   27,  145,   28,   28,   27,   27,   28,   28,  128,
877        27,  129,   28,  131,  132,  139,   27,   27,   28,   28,
878       130,  138,  320,   27,  142,   28,   27,   27,   28,   28,
879 
880        27,   27,   28,   28,  135,  133,  134,  143,   27,  320,
881        28,  146,   27,  136,   28,  140,   27,  141,   28,  137,
882        85,  144,   27,  147,   28,  148,   27,  150,   28,   86,
883        27,  149,   28,  320,  151,   27,  153,   28,  154,   27,
884       155,   28,  320,   27,  152,   28,   27,  157,   28,   27,
885        27,   28,   28,   27,  156,   28,   27,   27,   28,   28,
886        27,   27,   28,   28,  158,  160,  161,   27,  162,   28,
887        27,  163,   28,  166,   27,   27,   28,   28,  164,  159,
888       165,   27,  169,   28,  320,  168,  170,   27,   27,   28,
889        28,  167,   27,  320,   28,   27,   27,   28,   28,   27,
890 
891        27,   28,   28,  320,   27,   27,   28,   28,   27,   27,
892        28,   28,  171,  173,  174,  175,  172,  176,   27,  118,
893        28,  179,  184,   27,  178,   28,   27,  177,   28,  180,
894        27,   27,   28,   28,   27,   27,   28,   28,  181,  182,
895       185,  320,   27,   27,   28,   28,  189,  186,  187,  191,
896       193,   27,   27,   28,   28,  188,   27,   27,   28,   28,
897        27,   27,   28,   28,  190,  194,   27,  192,   28,   27,
898        27,   28,   28,   27,  195,   28,  196,   27,  197,   28,
899       320,  200,   27,   27,   28,   28,   27,   27,   28,   28,
900       198,   27,  202,   28,   27,  199,   28,  205,  201,   27,
901 
902        27,   28,   28,   27,  204,   28,  203,   27,   27,   28,
903        28,  208,  209,   27,   27,   28,   28,   27,   27,   28,
904       206,   27,   27,  207,   28,  210,  211,  212,  214,  213,
905        27,  320,   28,  215,   27,  216,   28,  320,  217,   27,
906       219,   28,   27,   27,   28,   28,   91,   27,  221,   28,
907        27,   27,   28,   28,   27,  222,   28,   92,   27,  220,
908        28,   27,  218,   28,  223,  320,   27,   27,   28,   28,
909       224,   27,  226,   28,   27,  225,   28,  227,   27,  229,
910        28,  320,  233,   27,   27,   28,   28,   27,  228,   28,
911        27,   27,   28,   28,   27,   27,   28,   28,  230,   27,
912 
913       232,   28,  231,  234,  236,   27,   27,   28,   28,  237,
914        27,  235,   28,   27,   27,   28,   28,   27,  238,   28,
915        27,  239,   28,   27,  245,   28,  242,   27,   27,   28,
916        28,   27,   27,   28,   28,  240,   66,   27,  243,   28,
917       241,   66,  244,   27,  246,   28,  247,   27,  249,   28,
918       320,   27,  250,   28,  256,   27,  248,   28,  252,  251,
919       253,   27,  320,   28,  254,   27,   27,   28,   28,   27,
920        27,   28,   28,   27,  255,   28,   27,   27,   28,   28,
921        27,   27,   28,   28,  258,  257,   27,  261,   28,  259,
922       260,  262,   27,   27,   28,   28,   27,   27,   28,   28,
923 
924        27,  263,   28,  320,   27,   27,   28,   28,  267,  266,
925        27,  264,   28,   27,   27,   28,   28,  265,   27,   27,
926        28,   28,  269,   27,   27,   28,   28,   27,   27,   28,
927        28,   27,  268,   28,  270,  271,  273,  274,  272,   27,
928        27,   28,   28,  320,   27,   27,   28,   28,  275,  276,
929       278,  320,   27,   27,   28,   28,   27,   27,   28,   28,
930       277,   27,   27,   28,   28,  282,  279,   27,  281,   28,
931        27,  280,   28,   27,   27,   28,   28,  283,   27,   27,
932        28,   28,   27,  284,   28,  285,  288,   27,   27,   28,
933        28,   27,  286,   28,  289,   27,   27,   28,   28,   27,
934 
935       287,   28,   27,   27,   28,   28,   27,   27,   28,   28,
936       290,   27,  291,   28,  294,  292,  293,  295,   27,   27,
937        28,   28,   27,   27,   28,   28,  296,   27,   27,   28,
938        28,   27,   27,   28,   28,  297,  298,   27,  299,   28,
939        27,   27,   28,   28,  300,   27,   27,   28,   28,   27,
940        27,   28,   28,   27,  320,   28,   27,  301,   28,   27,
941       302,   28,  305,  303,   27,  306,   28,   27,  304,   28,
942        27,   27,   28,   28,  307,   27,  320,   28,  308,  309,
943       311,  320,   27,  310,   28,   27,   27,   28,   28,  320,
944        27,   27,   28,   28,   27,   27,   28,   28,   27,   27,
945 
946        28,   28,   27,   27,   28,   28,   27,  312,   28,  313,
947       314,  316,   27,  315,   28,  320,   27,   27,   28,   28,
948        27,   27,   28,   28,   27,  320,   28,  317,  318,   27,
949        27,   28,   28,  320,   27,   27,   28,   28,   27,  319,
950        28,   27,   27,   28,   28,   27,   27,   28,   28,   26,
951       320,  320,   26,  320,   26,   33,   33,   33,   33,   33,
952        33,   35,  320,   35,   35,   35,   35,   43,  320,  320,
953        43,   43,   43,   69,   69,   69,  320,   69,   69,   70,
954        70,   70,   70,   70,    3,  320,  320,  320,  320,  320,
955       320,  320,  320,  320,  320,  320,  320,  320,  320,  320,
956 
957       320,  320,  320,  320,  320,  320,  320,  320,  320,  320,
958       320,  320,  320,  320,  320,  320,  320,  320,  320,  320,
959       320,  320,  320,  320,  320,  320,  320,  320,  320,  320,
960       320,  320,  320,  320,  320,  320,  320
961     } ;
962 
963 static const flex_int16_t yy_chk[1038] =
964     {   0,
965         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
966         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
967         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
968         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
969         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
970         1,    1,    4,    5,    4,   10,    5,    8,    5,   11,
971         8,   12,    8,   12,   13,   12,   13,   14,   18,   14,
972        20,   16,  145,   19,   21,   20,   21,   20,   21,   23,
973        18,   23,   18,   23,   21,   11,   21,   11,   19,   25,
974        19,   25,   24,   70,   24,    8,   10,   16,   24,   16,
975 
976        22,   22,   26,   22,   26,   22,   69,   22,   22,   22,
977        43,   22,   22,   33,   22,   22,   28,   22,   28,   22,
978        28,   22,   29,   22,   47,   29,   31,   29,   39,   31,
979        39,   31,   46,   45,   39,   45,   53,   48,   54,   46,
980        48,   46,   54,   32,   55,   53,   47,   56,   47,   57,
981        96,   53,   96,   59,   53,   30,   53,   58,   60,   58,
982        64,   54,   58,   54,   31,   55,   56,   55,   56,   63,
983        17,   58,   57,   62,   57,   48,   59,   58,   59,   58,
984        60,   61,   60,   64,   62,   64,   65,   61,   63,   61,
985        63,   61,    9,   66,   62,   66,   62,   67,   67,   67,
986 
987        66,    3,   68,   74,   65,   68,   65,   71,   71,   71,
988        72,   75,    0,   72,   73,    0,    0,   72,   72,   76,
989        73,   72,   73,   74,   75,   74,   75,   72,   76,   72,
990        76,   77,   80,   78,   77,   79,   77,   81,    0,   78,
991        68,   78,   84,   82,   79,   87,   79,   82,   83,   82,
992        80,   86,   80,   83,   85,   84,   87,   84,   87,   90,
993        81,   88,   81,    0,   86,   90,   86,   90,    0,   85,
994        89,   83,  108,   83,  108,   88,   85,   88,   85,   91,
995        89,   92,   89,   94,   95,  103,   92,   91,   92,   91,
996        93,  102,    0,   93,  105,   93,   94,   95,   94,   95,
997 
998        97,  100,   97,  100,  101,   97,  100,  106,  103,    0,
999       103,  109,  102,  101,  102,  104,  105,  104,  105,  101,
1000       104,  107,  101,  110,  101,  111,  109,  113,  109,  104,
1001       106,  112,  106,    0,  114,  104,  116,  104,  117,  107,
1002       118,  107,    0,  111,  115,  111,  110,  120,  110,  112,
1003       113,  112,  113,  114,  119,  114,  116,  115,  116,  115,
1004       118,  117,  118,  117,  121,  122,  123,  119,  124,  119,
1005       120,  125,  120,  128,  122,  124,  122,  124,  126,  121,
1006       127,  123,  131,  123,    0,  130,  132,  121,  128,  121,
1007       128,  129,  125,    0,  125,  126,  127,  126,  127,  129,
1008 
1009       130,  129,  130,    0,  133,  131,  133,  131,  134,  132,
1010       134,  132,  133,  135,  136,  137,  134,  138,  137,  140,
1011       137,  141,  146,  136,  140,  136,  135,  139,  135,  142,
1012       146,  139,  146,  139,  141,  138,  141,  138,  143,  144,
1013       147,    0,  140,  142,  140,  142,  152,  148,  149,  154,
1014       156,  143,  144,  143,  144,  151,  150,  147,  150,  147,
1015       148,  149,  148,  149,  153,  157,  151,  155,  151,  152,
1016       154,  152,  154,  156,  158,  156,  159,  160,  161,  160,
1017         0,  165,  157,  153,  157,  153,  162,  155,  162,  155,
1018       163,  165,  167,  165,  158,  164,  158,  170,  166,  159,
1019 
1020       161,  159,  161,  164,  169,  164,  168,  166,  163,  166,
1021       163,  173,  174,  167,  170,  167,  170,  168,  171,  168,
1022       171,  172,  169,  172,  169,  175,  176,  177,  179,  178,
1023       174,    0,  174,  180,  173,  181,  173,    0,  182,  176,
1024       184,  176,  178,  175,  178,  175,  183,  184,  186,  184,
1025       177,  179,  177,  179,  180,  187,  180,  183,  181,  185,
1026       181,  182,  183,  182,  188,    0,  185,  183,  185,  183,
1027       189,  186,  191,  186,  192,  190,  192,  193,  187,  195,
1028       187,    0,  199,  190,  188,  190,  188,  189,  194,  189,
1029       191,  219,  191,  219,  193,  194,  193,  194,  196,  195,
1030 
1031       198,  195,  197,  200,  202,  199,  196,  199,  196,  203,
1032       197,  201,  197,  198,  200,  198,  200,  201,  204,  201,
1033       220,  205,  220,  202,  211,  202,  208,  203,  205,  203,
1034       205,  204,  206,  204,  206,  206,  206,  207,  209,  207,
1035       207,  207,  210,  208,  212,  208,  213,  211,  215,  211,
1036         0,  209,  216,  209,  224,  210,  214,  210,  218,  217,
1037       221,  224,    0,  224,  222,  212,  215,  212,  215,  213,
1038       216,  213,  216,  214,  223,  214,  217,  221,  217,  221,
1039       218,  222,  218,  222,  226,  225,  228,  231,  228,  227,
1040       230,  232,  225,  223,  225,  223,  227,  226,  227,  226,
1041 
1042       229,  233,  229,    0,  234,  230,  234,  230,  238,  237,
1043       231,  235,  231,  233,  232,  233,  232,  236,  235,  237,
1044       235,  237,  243,  239,  236,  239,  236,  240,  241,  240,
1045       241,  238,  242,  238,  244,  245,  247,  248,  246,  242,
1046       256,  242,  256,    0,  248,  243,  248,  243,  249,  250,
1047       252,    0,  245,  247,  245,  247,  246,  244,  246,  244,
1048       251,  249,  250,  249,  250,  258,  253,  251,  255,  251,
1049       252,  254,  252,  253,  257,  253,  257,  260,  254,  255,
1050       254,  255,  259,  261,  259,  262,  267,  264,  258,  264,
1051       258,  261,  263,  261,  269,  265,  260,  265,  260,  263,
1052 
1053       266,  263,  262,  267,  262,  267,  268,  266,  268,  266,
1054       270,  269,  271,  269,  275,  272,  273,  276,  274,  271,
1055       274,  271,  277,  273,  277,  273,  278,  270,  272,  270,
1056       272,  279,  280,  279,  280,  281,  282,  275,  283,  275,
1057       276,  278,  276,  278,  284,  283,  286,  283,  286,  287,
1058       291,  287,  291,  282,    0,  282,  281,  285,  281,  284,
1059       288,  284,  292,  289,  285,  294,  285,  288,  290,  288,
1060       289,  293,  289,  293,  295,  290,    0,  290,  296,  297,
1061       300,    0,  294,  298,  294,  292,  296,  292,  296,    0,
1062       298,  295,  298,  295,  297,  299,  297,  299,  301,  300,
1063 
1064       301,  300,  302,  303,  302,  303,  304,  305,  304,  306,
1065       307,  309,  310,  308,  310,    0,  306,  307,  306,  307,
1066       308,  313,  308,  313,  305,    0,  305,  311,  312,  314,
1067       309,  314,  309,    0,  311,  312,  311,  312,  315,  316,
1068       315,  317,  318,  317,  318,  319,  316,  319,  316,  321,
1069         0,    0,  321,    0,  321,  322,  322,  322,  322,  322,
1070       322,  323,    0,  323,  323,  323,  323,  324,    0,    0,
1071       324,  324,  324,  325,  325,  325,    0,  325,  325,  326,
1072       326,  326,  326,  326,  320,  320,  320,  320,  320,  320,
1073       320,  320,  320,  320,  320,  320,  320,  320,  320,  320,
1074 
1075       320,  320,  320,  320,  320,  320,  320,  320,  320,  320,
1076       320,  320,  320,  320,  320,  320,  320,  320,  320,  320,
1077       320,  320,  320,  320,  320,  320,  320,  320,  320,  320,
1078       320,  320,  320,  320,  320,  320,  320
1079     } ;
1080 
1081 /* Table of booleans, true if rule could match eol. */
1082 static const flex_int32_t yy_rule_can_match_eol[64] =
1083     {   0,
1084 1, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1085     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1086     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1087     0, 0, 0, 0,     };
1088 
1089 static const flex_int16_t yy_rule_linenum[63] =
1090     {   0,
1091        99,  101,  103,  105,  107,  109,  111,  113,  115,  117,
1092       119,  121,  123,  125,  127,  129,  131,  133,  135,  137,
1093       139,  141,  143,  145,  147,  149,  151,  153,  155,  157,
1094       159,  161,  163,  165,  167,  169,  171,  173,  175,  177,
1095       179,  181,  183,  185,  187,  189,  191,  193,  195,  197,
1096       199,  201,  203,  205,  207,  209,  211,  213,  215,  217,
1097       219,  221
1098     } ;
1099 
1100 /* The intent behind this definition is that it'll catch
1101  * any uses of REJECT which flex missed.
1102  */
1103 #define REJECT reject_used_but_not_detected
1104 #define yymore() yymore_used_but_not_detected
1105 #define YY_MORE_ADJ 0
1106 #define YY_RESTORE_YY_MORE_OFFSET
1107 #line 1 "am-scanner.l"
1108 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
1109 /*
1110  * am-scanner.l
1111  * Copyright (C) Sébastien Granjoux 2009 <seb.sfo@free.fr>
1112  *
1113  * main.c is free software: you can redistribute it and/or modify it
1114  * under the terms of the GNU General Public License as published by the
1115  * Free Software Foundation, either version 3 of the License, or
1116  * (at your option) any later version.
1117  *
1118  * main.c is distributed in the hope that it will be useful, but
1119  * WITHOUT ANY WARRANTY; without even the implied warranty of
1120  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
1121  * See the GNU General Public License for more details.
1122  *
1123  * You should have received a copy of the GNU General Public License along
1124  * with this program.  If not, see <http://www.gnu.org/licenses/>.
1125  */
1126 #line 21 "am-scanner.l"
1127 
1128 #include "am-scanner.h"
1129 #include "amp-group.h"
1130 #include "am-parser.h"
1131 #include "amp-node.h"
1132 #include "amp-target.h"
1133 #include "amp-source.h"
1134 
1135 #include "libanjuta/anjuta-debug.h"
1136 #include "libanjuta/anjuta-token-stream.h"
1137 
1138 #include <stdlib.h>
1139 #include <string.h>
1140 
1141 
1142 #define YY_INPUT(buffer, result, max_size) result = anjuta_token_stream_read (yyextra->stream, buffer, max_size)
1143 
1144 #define YY_EXTRA_TYPE  AmpAmScanner*
1145 
1146 #define YY_DECL static int am_yylex (YYSTYPE * yylval_param,YYLTYPE * yylloc_param ,yyscan_t yyscanner)
1147 
1148 //#define YY_USER_INIT {yy_flex_debug = 1;}
1149 
1150 static int amp_am_scanner_parse_end (AmpAmScanner *scanner);
1151 
1152 #define RETURN(tok) *yylval = anjuta_token_stream_tokenize (yyextra->stream, tok, yyleng); \
1153                     return tok
1154 
1155 struct _AmpAmScanner
1156 {
1157 	yyscan_t scanner;
1158 
1159 	AnjutaTokenStream *stream;
1160 
1161 	AmpProject *project;
1162 	AmpGroupNode *group;
1163 	GHashTable *orphan_properties;
1164 	GHashTable *ac_variables;
1165 	GList *am_variables;
1166 	GList *variables;
1167 	gboolean eof;		/* TRUE to emit EOF at the end */
1168 	gboolean expansion;		/* Expand variables */
1169 };
1170 
1171 struct _AmpVariableDepend
1172 {
1173 	GList *token;
1174 	GList *depend;
1175 	const gchar *name;
1176 	gboolean evaluated;
1177 };
1178 
1179 typedef struct _AmpVariableDepend AmpVariableDepend;
1180 
1181 
1182 #line 1182 "am-scanner.c"
1183 /* Remove some warnings */
1184 #define YY_NO_INPUT 1
1185 #line 1185 "am-scanner.c"
1186 
1187 #define INITIAL 0
1188 
1189 #ifndef YY_NO_UNISTD_H
1190 /* Special case for "unistd.h", since it is non-ANSI. We include it way
1191  * down here because we want the user's section 1 to have been scanned first.
1192  * The user has a chance to override it with an option.
1193  */
1194 /* %if-c-only */
1195 #include <unistd.h>
1196 /* %endif */
1197 /* %if-c++-only */
1198 /* %endif */
1199 #endif
1200 
1201 #ifndef YY_EXTRA_TYPE
1202 #define YY_EXTRA_TYPE void *
1203 #endif
1204 
1205 /* %if-c-only Reentrant structure and macros (non-C++). */
1206 /* %if-reentrant */
1207 
1208 /* Holds the entire state of the reentrant scanner. */
1209 struct yyguts_t
1210     {
1211 
1212     /* User-defined. Not touched by flex. */
1213     YY_EXTRA_TYPE yyextra_r;
1214 
1215     /* The rest are the same as the globals declared in the non-reentrant scanner. */
1216     FILE *yyin_r, *yyout_r;
1217     size_t yy_buffer_stack_top; /**< index of top of stack. */
1218     size_t yy_buffer_stack_max; /**< capacity of stack. */
1219     YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */
1220     char yy_hold_char;
1221     int yy_n_chars;
1222     int yyleng_r;
1223     char *yy_c_buf_p;
1224     int yy_init;
1225     int yy_start;
1226     int yy_did_buffer_switch_on_eof;
1227     int yy_start_stack_ptr;
1228     int yy_start_stack_depth;
1229     int *yy_start_stack;
1230     yy_state_type yy_last_accepting_state;
1231     char* yy_last_accepting_cpos;
1232 
1233     int yylineno_r;
1234     int yy_flex_debug_r;
1235 
1236     char *yytext_r;
1237     int yy_more_flag;
1238     int yy_more_len;
1239 
1240     YYSTYPE * yylval_r;
1241 
1242     YYLTYPE * yylloc_r;
1243 
1244     }; /* end struct yyguts_t */
1245 
1246 /* %if-c-only */
1247 
1248 static int yy_init_globals ( yyscan_t yyscanner );
1249 
1250 /* %endif */
1251 
1252 /* %if-reentrant */
1253 
1254     /* This must go here because YYSTYPE and YYLTYPE are included
1255      * from bison output in section 1.*/
1256     #    define yylval yyg->yylval_r
1257 
1258     #    define yylloc yyg->yylloc_r
1259 
1260 int yylex_init (yyscan_t* scanner);
1261 
1262 int yylex_init_extra ( YY_EXTRA_TYPE user_defined, yyscan_t* scanner);
1263 
1264 /* %endif */
1265 
1266 /* %endif End reentrant structures and macros. */
1267 
1268 /* Accessor methods to globals.
1269    These are made visible to non-reentrant scanners for convenience. */
1270 
1271 int yylex_destroy ( yyscan_t yyscanner );
1272 
1273 int yyget_debug ( yyscan_t yyscanner );
1274 
1275 void yyset_debug ( int debug_flag , yyscan_t yyscanner );
1276 
1277 YY_EXTRA_TYPE yyget_extra ( yyscan_t yyscanner );
1278 
1279 void yyset_extra ( YY_EXTRA_TYPE user_defined , yyscan_t yyscanner );
1280 
1281 FILE *yyget_in ( yyscan_t yyscanner );
1282 
1283 void yyset_in  ( FILE * _in_str , yyscan_t yyscanner );
1284 
1285 FILE *yyget_out ( yyscan_t yyscanner );
1286 
1287 void yyset_out  ( FILE * _out_str , yyscan_t yyscanner );
1288 
1289 			int yyget_leng ( yyscan_t yyscanner );
1290 
1291 char *yyget_text ( yyscan_t yyscanner );
1292 
1293 int yyget_lineno ( yyscan_t yyscanner );
1294 
1295 void yyset_lineno ( int _line_number , yyscan_t yyscanner );
1296 
1297 int yyget_column  ( yyscan_t yyscanner );
1298 
1299 void yyset_column ( int _column_no , yyscan_t yyscanner );
1300 
1301 /* %if-bison-bridge */
1302 
1303 YYSTYPE * yyget_lval ( yyscan_t yyscanner );
1304 
1305 void yyset_lval ( YYSTYPE * yylval_param , yyscan_t yyscanner );
1306 
1307        YYLTYPE *yyget_lloc ( yyscan_t yyscanner );
1308 
1309         void yyset_lloc ( YYLTYPE * yylloc_param , yyscan_t yyscanner );
1310 
1311 /* %endif */
1312 
1313 /* Macros after this point can all be overridden by user definitions in
1314  * section 1.
1315  */
1316 
1317 #ifndef YY_SKIP_YYWRAP
1318 #ifdef __cplusplus
1319 extern "C" int yywrap ( yyscan_t yyscanner );
1320 #else
1321 extern int yywrap ( yyscan_t yyscanner );
1322 #endif
1323 #endif
1324 
1325 /* %not-for-header */
1326 #ifndef YY_NO_UNPUT
1327 
1328 #endif
1329 /* %ok-for-header */
1330 
1331 /* %endif */
1332 
1333 #ifndef yytext_ptr
1334 static void yy_flex_strncpy ( char *, const char *, int , yyscan_t yyscanner);
1335 #endif
1336 
1337 #ifdef YY_NEED_STRLEN
1338 static int yy_flex_strlen ( const char * , yyscan_t yyscanner);
1339 #endif
1340 
1341 #ifndef YY_NO_INPUT
1342 /* %if-c-only Standard (non-C++) definition */
1343 /* %not-for-header */
1344 #ifdef __cplusplus
1345 static int yyinput ( yyscan_t yyscanner );
1346 #else
1347 static int input ( yyscan_t yyscanner );
1348 #endif
1349 /* %ok-for-header */
1350 
1351 /* %endif */
1352 #endif
1353 
1354 /* %if-c-only */
1355 
1356 /* %endif */
1357 
1358 /* Amount of stuff to slurp up with each read. */
1359 #ifndef YY_READ_BUF_SIZE
1360 #ifdef __ia64__
1361 /* On IA-64, the buffer size is 16k, not 8k */
1362 #define YY_READ_BUF_SIZE 16384
1363 #else
1364 #define YY_READ_BUF_SIZE 8192
1365 #endif /* __ia64__ */
1366 #endif
1367 
1368 /* Copy whatever the last rule matched to the standard output. */
1369 #ifndef ECHO
1370 /* %if-c-only Standard (non-C++) definition */
1371 /* This used to be an fputs(), but since the string might contain NUL's,
1372  * we now use fwrite().
1373  */
1374 #define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0)
1375 /* %endif */
1376 /* %if-c++-only C++ definition */
1377 /* %endif */
1378 #endif
1379 
1380 /* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
1381  * is returned in "result".
1382  */
1383 #ifndef YY_INPUT
1384 #define YY_INPUT(buf,result,max_size) \
1385 /* %% [5.0] fread()/read() definition of YY_INPUT goes here unless we're doing C++ \ */\
1386 	if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
1387 		{ \
1388 		int c = '*'; \
1389 		int n; \
1390 		for ( n = 0; n < max_size && \
1391 			     (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
1392 			buf[n] = (char) c; \
1393 		if ( c == '\n' ) \
1394 			buf[n++] = (char) c; \
1395 		if ( c == EOF && ferror( yyin ) ) \
1396 			YY_FATAL_ERROR( "input in flex scanner failed" ); \
1397 		result = n; \
1398 		} \
1399 	else \
1400 		{ \
1401 		errno=0; \
1402 		while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \
1403 			{ \
1404 			if( errno != EINTR) \
1405 				{ \
1406 				YY_FATAL_ERROR( "input in flex scanner failed" ); \
1407 				break; \
1408 				} \
1409 			errno=0; \
1410 			clearerr(yyin); \
1411 			} \
1412 		}\
1413 \
1414 /* %if-c++-only C++ definition \ */\
1415 /* %endif */
1416 
1417 #endif
1418 
1419 /* No semi-colon after return; correct usage is to write "yyterminate();" -
1420  * we don't want an extra ';' after the "return" because that will cause
1421  * some compilers to complain about unreachable statements.
1422  */
1423 #ifndef yyterminate
1424 #define yyterminate() return YY_NULL
1425 #endif
1426 
1427 /* Number of entries by which start-condition stack grows. */
1428 #ifndef YY_START_STACK_INCR
1429 #define YY_START_STACK_INCR 25
1430 #endif
1431 
1432 /* Report a fatal error. */
1433 #ifndef YY_FATAL_ERROR
1434 /* %if-c-only */
1435 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner)
1436 /* %endif */
1437 /* %if-c++-only */
1438 /* %endif */
1439 #endif
1440 
1441 /* %if-tables-serialization structures and prototypes */
1442 /* %not-for-header */
1443 /* %ok-for-header */
1444 
1445 /* %not-for-header */
1446 /* %tables-yydmap generated elements */
1447 /* %endif */
1448 /* end tables serialization structures and prototypes */
1449 
1450 /* %ok-for-header */
1451 
1452 /* Default declaration of generated scanner - a define so the user can
1453  * easily add parameters.
1454  */
1455 #ifndef YY_DECL
1456 #define YY_DECL_IS_OURS 1
1457 /* %if-c-only Standard (non-C++) definition */
1458 
1459 extern int yylex \
1460                (YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner);
1461 
1462 #define YY_DECL int yylex \
1463                (YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner)
1464 /* %endif */
1465 /* %if-c++-only C++ definition */
1466 /* %endif */
1467 #endif /* !YY_DECL */
1468 
1469 /* Code executed at the beginning of each rule, after yytext and yyleng
1470  * have been set up.
1471  */
1472 #ifndef YY_USER_ACTION
1473 #define YY_USER_ACTION
1474 #endif
1475 
1476 /* Code executed at the end of each rule. */
1477 #ifndef YY_BREAK
1478 #define YY_BREAK /*LINTED*/break;
1479 #endif
1480 
1481 /* %% [6.0] YY_RULE_SETUP definition goes here */
1482 #define YY_RULE_SETUP \
1483 	YY_USER_ACTION
1484 
1485 /* %not-for-header */
1486 /** The main scanner function which does all the work.
1487  */
1488 YY_DECL
1489 {
1490 	yy_state_type yy_current_state;
1491 	char *yy_cp, *yy_bp;
1492 	int yy_act;
1493     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1494 
1495     yylval = yylval_param;
1496 
1497     yylloc = yylloc_param;
1498 
1499 	if ( !yyg->yy_init )
1500 		{
1501 		yyg->yy_init = 1;
1502 
1503 #ifdef YY_USER_INIT
1504 		YY_USER_INIT;
1505 #endif
1506 
1507 		if ( ! yyg->yy_start )
1508 			yyg->yy_start = 1;	/* first start state */
1509 
1510 		if ( ! yyin )
1511 /* %if-c-only */
1512 			yyin = stdin;
1513 /* %endif */
1514 /* %if-c++-only */
1515 /* %endif */
1516 
1517 		if ( ! yyout )
1518 /* %if-c-only */
1519 			yyout = stdout;
1520 /* %endif */
1521 /* %if-c++-only */
1522 /* %endif */
1523 
1524 		if ( ! YY_CURRENT_BUFFER ) {
1525 			yyensure_buffer_stack (yyscanner);
1526 			YY_CURRENT_BUFFER_LVALUE =
1527 				yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner);
1528 		}
1529 
1530 		yy_load_buffer_state( yyscanner );
1531 		}
1532 
1533 	{
1534 /* %% [7.0] user's declarations go here */
1535 #line 95 "am-scanner.l"
1536 
1537 
1538 #line 1538 "am-scanner.c"
1539 
1540 	while ( /*CONSTCOND*/1 )		/* loops until end-of-file is reached */
1541 		{
1542 /* %% [8.0] yymore()-related code goes here */
1543 		yy_cp = yyg->yy_c_buf_p;
1544 
1545 		/* Support of yytext. */
1546 		*yy_cp = yyg->yy_hold_char;
1547 
1548 		/* yy_bp points to the position in yy_ch_buf of the start of
1549 		 * the current run.
1550 		 */
1551 		yy_bp = yy_cp;
1552 
1553 /* %% [9.0] code to set up and find next match goes here */
1554 		yy_current_state = yyg->yy_start;
1555 yy_match:
1556 		do
1557 			{
1558 			YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
1559 			if ( yy_accept[yy_current_state] )
1560 				{
1561 				yyg->yy_last_accepting_state = yy_current_state;
1562 				yyg->yy_last_accepting_cpos = yy_cp;
1563 				}
1564 			while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1565 				{
1566 				yy_current_state = (int) yy_def[yy_current_state];
1567 				if ( yy_current_state >= 321 )
1568 					yy_c = yy_meta[yy_c];
1569 				}
1570 			yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1571 			++yy_cp;
1572 			}
1573 		while ( yy_current_state != 320 );
1574 		yy_cp = yyg->yy_last_accepting_cpos;
1575 		yy_current_state = yyg->yy_last_accepting_state;
1576 
1577 yy_find_action:
1578 /* %% [10.0] code to find the action number goes here */
1579 		yy_act = yy_accept[yy_current_state];
1580 
1581 		YY_DO_BEFORE_ACTION;
1582 
1583 /* %% [11.0] code for yylineno update goes here */
1584 
1585 		if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] )
1586 			{
1587 			int yyl;
1588 			for ( yyl = 0; yyl < yyleng; ++yyl )
1589 				if ( yytext[yyl] == '\n' )
1590 
1591     do{ yylineno++;
1592         yycolumn=0;
1593     }while(0)
1594 ;
1595 			}
1596 
1597 do_action:	/* This label is used only to access EOF actions. */
1598 
1599 /* %% [12.0] debug code goes here */
1600 		if ( yy_flex_debug )
1601 			{
1602 			if ( yy_act == 0 )
1603 				fprintf( stderr, "--scanner backing up\n" );
1604 			else if ( yy_act < 63 )
1605 				fprintf( stderr, "--accepting rule at line %ld (\"%s\")\n",
1606 				         (long)yy_rule_linenum[yy_act], yytext );
1607 			else if ( yy_act == 63 )
1608 				fprintf( stderr, "--accepting default rule (\"%s\")\n",
1609 				         yytext );
1610 			else if ( yy_act == 64 )
1611 				fprintf( stderr, "--(end of buffer or a NUL)\n" );
1612 			else
1613 				fprintf( stderr, "--EOF (start condition %d)\n", YY_START );
1614 			}
1615 
1616 		switch ( yy_act )
1617 	{ /* beginning of action switch */
1618 /* %% [13.0] actions go here */
1619 			case 0: /* must back up */
1620 			/* undo the effects of YY_DO_BEFORE_ACTION */
1621 			*yy_cp = yyg->yy_hold_char;
1622 			yy_cp = yyg->yy_last_accepting_cpos;
1623 			yy_current_state = yyg->yy_last_accepting_state;
1624 			goto yy_find_action;
1625 
1626 case YY_STATE_EOF(INITIAL):
1627 #line 97 "am-scanner.l"
1628 { gint ret = amp_am_scanner_parse_end (yyextra); if (ret !=1) return ret; }
1629 	YY_BREAK
1630 case 1:
1631 /* rule 1 can match eol */
1632 YY_RULE_SETUP
1633 #line 99 "am-scanner.l"
1634 { RETURN (END_OF_LINE); }
1635 	YY_BREAK
1636 case 2:
1637 /* rule 2 can match eol */
1638 YY_RULE_SETUP
1639 #line 101 "am-scanner.l"
1640 { RETURN (SPACE); }
1641 	YY_BREAK
1642 case 3:
1643 /* rule 3 can match eol */
1644 YY_RULE_SETUP
1645 #line 103 "am-scanner.l"
1646 { RETURN (COMMENT); }
1647 	YY_BREAK
1648 case 4:
1649 YY_RULE_SETUP
1650 #line 105 "am-scanner.l"
1651 { RETURN (TAB); }
1652 	YY_BREAK
1653 case 5:
1654 YY_RULE_SETUP
1655 #line 107 "am-scanner.l"
1656 { RETURN (MACRO); }
1657 	YY_BREAK
1658 case 6:
1659 /* rule 6 can match eol */
1660 YY_RULE_SETUP
1661 #line 109 "am-scanner.l"
1662 { RETURN (VARIABLE); }
1663 	YY_BREAK
1664 case 7:
1665 /* rule 7 can match eol */
1666 YY_RULE_SETUP
1667 #line 111 "am-scanner.l"
1668 { RETURN (VARIABLE); }
1669 	YY_BREAK
1670 case 8:
1671 YY_RULE_SETUP
1672 #line 113 "am-scanner.l"
1673 { RETURN (VARIABLE); }
1674 	YY_BREAK
1675 case 9:
1676 YY_RULE_SETUP
1677 #line 115 "am-scanner.l"
1678 { RETURN (COLON); }
1679 	YY_BREAK
1680 case 10:
1681 YY_RULE_SETUP
1682 #line 117 "am-scanner.l"
1683 { RETURN (DOUBLE_COLON); }
1684 	YY_BREAK
1685 case 11:
1686 YY_RULE_SETUP
1687 #line 119 "am-scanner.l"
1688 { RETURN (SEMI_COLON); }
1689 	YY_BREAK
1690 case 12:
1691 YY_RULE_SETUP
1692 #line 121 "am-scanner.l"
1693 { RETURN (ORDER); }
1694 	YY_BREAK
1695 case 13:
1696 YY_RULE_SETUP
1697 #line 123 "am-scanner.l"
1698 { RETURN (EQUAL); }
1699 	YY_BREAK
1700 case 14:
1701 YY_RULE_SETUP
1702 #line 125 "am-scanner.l"
1703 { RETURN (IMMEDIATE_EQUAL); }
1704 	YY_BREAK
1705 case 15:
1706 YY_RULE_SETUP
1707 #line 127 "am-scanner.l"
1708 { RETURN (CONDITIONAL_EQUAL); }
1709 	YY_BREAK
1710 case 16:
1711 YY_RULE_SETUP
1712 #line 129 "am-scanner.l"
1713 { RETURN (APPEND); }
1714 	YY_BREAK
1715 case 17:
1716 YY_RULE_SETUP
1717 #line 131 "am-scanner.l"
1718 { RETURN (CHARACTER); }
1719 	YY_BREAK
1720 case 18:
1721 YY_RULE_SETUP
1722 #line 133 "am-scanner.l"
1723 { RETURN (CHARACTER); }
1724 	YY_BREAK
1725 case 19:
1726 YY_RULE_SETUP
1727 #line 135 "am-scanner.l"
1728 { RETURN (CHARACTER); }
1729 	YY_BREAK
1730 case 20:
1731 YY_RULE_SETUP
1732 #line 137 "am-scanner.l"
1733 { RETURN (CHARACTER); }
1734 	YY_BREAK
1735 case 21:
1736 YY_RULE_SETUP
1737 #line 139 "am-scanner.l"
1738 { RETURN (INCLUDE); }
1739 	YY_BREAK
1740 case 22:
1741 YY_RULE_SETUP
1742 #line 141 "am-scanner.l"
1743 { RETURN (INCLUDE); }
1744 	YY_BREAK
1745 case 23:
1746 YY_RULE_SETUP
1747 #line 143 "am-scanner.l"
1748 { RETURN (SUBDIRS); }
1749 	YY_BREAK
1750 case 24:
1751 YY_RULE_SETUP
1752 #line 145 "am-scanner.l"
1753 { RETURN (DIST_SUBDIRS); }
1754 	YY_BREAK
1755 case 25:
1756 YY_RULE_SETUP
1757 #line 147 "am-scanner.l"
1758 { RETURN (_DATA); }
1759 	YY_BREAK
1760 case 26:
1761 YY_RULE_SETUP
1762 #line 149 "am-scanner.l"
1763 { RETURN (_HEADERS); }
1764 	YY_BREAK
1765 case 27:
1766 YY_RULE_SETUP
1767 #line 151 "am-scanner.l"
1768 { RETURN (_LIBRARIES); }
1769 	YY_BREAK
1770 case 28:
1771 YY_RULE_SETUP
1772 #line 153 "am-scanner.l"
1773 { RETURN (_LISP); }
1774 	YY_BREAK
1775 case 29:
1776 YY_RULE_SETUP
1777 #line 155 "am-scanner.l"
1778 { RETURN (_LTLIBRARIES); }
1779 	YY_BREAK
1780 case 30:
1781 YY_RULE_SETUP
1782 #line 157 "am-scanner.l"
1783 { RETURN (_MANS); }
1784 	YY_BREAK
1785 case 31:
1786 YY_RULE_SETUP
1787 #line 159 "am-scanner.l"
1788 { RETURN (_PROGRAMS); }
1789 	YY_BREAK
1790 case 32:
1791 YY_RULE_SETUP
1792 #line 161 "am-scanner.l"
1793 { RETURN (_PYTHON); }
1794 	YY_BREAK
1795 case 33:
1796 YY_RULE_SETUP
1797 #line 163 "am-scanner.l"
1798 { RETURN (_JAVA); }
1799 	YY_BREAK
1800 case 34:
1801 YY_RULE_SETUP
1802 #line 165 "am-scanner.l"
1803 { RETURN (_SCRIPTS); }
1804 	YY_BREAK
1805 case 35:
1806 YY_RULE_SETUP
1807 #line 167 "am-scanner.l"
1808 { RETURN (_SOURCES); }
1809 	YY_BREAK
1810 case 36:
1811 YY_RULE_SETUP
1812 #line 169 "am-scanner.l"
1813 { RETURN (_TEXINFOS); }
1814 	YY_BREAK
1815 case 37:
1816 YY_RULE_SETUP
1817 #line 171 "am-scanner.l"
1818 { RETURN (_DIR); }
1819 	YY_BREAK
1820 case 38:
1821 YY_RULE_SETUP
1822 #line 173 "am-scanner.l"
1823 { RETURN (_LDFLAGS);}
1824 	YY_BREAK
1825 case 39:
1826 YY_RULE_SETUP
1827 #line 175 "am-scanner.l"
1828 { RETURN (_CPPFLAGS);}
1829 	YY_BREAK
1830 case 40:
1831 YY_RULE_SETUP
1832 #line 177 "am-scanner.l"
1833 { RETURN (_CFLAGS);}
1834 	YY_BREAK
1835 case 41:
1836 YY_RULE_SETUP
1837 #line 179 "am-scanner.l"
1838 { RETURN (_CXXFLAGS);}
1839 	YY_BREAK
1840 case 42:
1841 YY_RULE_SETUP
1842 #line 181 "am-scanner.l"
1843 { RETURN (_JAVACFLAGS);}
1844 	YY_BREAK
1845 case 43:
1846 YY_RULE_SETUP
1847 #line 183 "am-scanner.l"
1848 { RETURN (_VALAFLAGS);}
1849 	YY_BREAK
1850 case 44:
1851 YY_RULE_SETUP
1852 #line 185 "am-scanner.l"
1853 { RETURN (_FCFLAGS);}
1854 	YY_BREAK
1855 case 45:
1856 YY_RULE_SETUP
1857 #line 187 "am-scanner.l"
1858 { RETURN (_OBJCFLAGS);}
1859 	YY_BREAK
1860 case 46:
1861 YY_RULE_SETUP
1862 #line 189 "am-scanner.l"
1863 { RETURN (_LFLAGS);}
1864 	YY_BREAK
1865 case 47:
1866 YY_RULE_SETUP
1867 #line 191 "am-scanner.l"
1868 { RETURN (_YFLAGS);}
1869 	YY_BREAK
1870 case 48:
1871 YY_RULE_SETUP
1872 #line 193 "am-scanner.l"
1873 { RETURN (TARGET_LDFLAGS);}
1874 	YY_BREAK
1875 case 49:
1876 YY_RULE_SETUP
1877 #line 195 "am-scanner.l"
1878 { RETURN (TARGET_CPPFLAGS);}
1879 	YY_BREAK
1880 case 50:
1881 YY_RULE_SETUP
1882 #line 197 "am-scanner.l"
1883 { RETURN (TARGET_CFLAGS);}
1884 	YY_BREAK
1885 case 51:
1886 YY_RULE_SETUP
1887 #line 199 "am-scanner.l"
1888 { RETURN (TARGET_CXXFLAGS);}
1889 	YY_BREAK
1890 case 52:
1891 YY_RULE_SETUP
1892 #line 201 "am-scanner.l"
1893 { RETURN (TARGET_JAVACFLAGS);}
1894 	YY_BREAK
1895 case 53:
1896 YY_RULE_SETUP
1897 #line 203 "am-scanner.l"
1898 { RETURN (TARGET_VALAFLAGS);}
1899 	YY_BREAK
1900 case 54:
1901 YY_RULE_SETUP
1902 #line 205 "am-scanner.l"
1903 { RETURN (TARGET_FCFLAGS);}
1904 	YY_BREAK
1905 case 55:
1906 YY_RULE_SETUP
1907 #line 207 "am-scanner.l"
1908 { RETURN (TARGET_OBJCFLAGS);}
1909 	YY_BREAK
1910 case 56:
1911 YY_RULE_SETUP
1912 #line 209 "am-scanner.l"
1913 { RETURN (TARGET_LFLAGS);}
1914 	YY_BREAK
1915 case 57:
1916 YY_RULE_SETUP
1917 #line 211 "am-scanner.l"
1918 { RETURN (TARGET_YFLAGS);}
1919 	YY_BREAK
1920 case 58:
1921 YY_RULE_SETUP
1922 #line 213 "am-scanner.l"
1923 { RETURN (TARGET_DEPENDENCIES);}
1924 	YY_BREAK
1925 case 59:
1926 YY_RULE_SETUP
1927 #line 215 "am-scanner.l"
1928 { RETURN (TARGET_LDADD);}
1929 	YY_BREAK
1930 case 60:
1931 YY_RULE_SETUP
1932 #line 217 "am-scanner.l"
1933 { RETURN (TARGET_LIBADD);}
1934 	YY_BREAK
1935 case 61:
1936 YY_RULE_SETUP
1937 #line 219 "am-scanner.l"
1938 { RETURN (NAME); }
1939 	YY_BREAK
1940 case 62:
1941 YY_RULE_SETUP
1942 #line 221 "am-scanner.l"
1943 { RETURN (CHARACTER); }
1944 	YY_BREAK
1945 case 63:
1946 YY_RULE_SETUP
1947 #line 223 "am-scanner.l"
1948 ECHO;
1949 	YY_BREAK
1950 #line 1950 "am-scanner.c"
1951 
1952 	case YY_END_OF_BUFFER:
1953 		{
1954 		/* Amount of text matched not including the EOB char. */
1955 		int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1;
1956 
1957 		/* Undo the effects of YY_DO_BEFORE_ACTION. */
1958 		*yy_cp = yyg->yy_hold_char;
1959 		YY_RESTORE_YY_MORE_OFFSET
1960 
1961 		if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1962 			{
1963 			/* We're scanning a new file or input source.  It's
1964 			 * possible that this happened because the user
1965 			 * just pointed yyin at a new source and called
1966 			 * yylex().  If so, then we have to assure
1967 			 * consistency between YY_CURRENT_BUFFER and our
1968 			 * globals.  Here is the right place to do so, because
1969 			 * this is the first action (other than possibly a
1970 			 * back-up) that will match for the new input source.
1971 			 */
1972 			yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1973 /* %if-c-only */
1974 			YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
1975 /* %endif */
1976 /* %if-c++-only */
1977 /* %endif */
1978 			YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1979 			}
1980 
1981 		/* Note that here we test for yy_c_buf_p "<=" to the position
1982 		 * of the first EOB in the buffer, since yy_c_buf_p will
1983 		 * already have been incremented past the NUL character
1984 		 * (since all states make transitions on EOB to the
1985 		 * end-of-buffer state).  Contrast this with the test
1986 		 * in input().
1987 		 */
1988 		if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
1989 			{ /* This was really a NUL. */
1990 			yy_state_type yy_next_state;
1991 
1992 			yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text;
1993 
1994 			yy_current_state = yy_get_previous_state( yyscanner );
1995 
1996 			/* Okay, we're now positioned to make the NUL
1997 			 * transition.  We couldn't have
1998 			 * yy_get_previous_state() go ahead and do it
1999 			 * for us because it doesn't know how to deal
2000 			 * with the possibility of jamming (and we don't
2001 			 * want to build jamming into it because then it
2002 			 * will run more slowly).
2003 			 */
2004 
2005 			yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner);
2006 
2007 			yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
2008 
2009 			if ( yy_next_state )
2010 				{
2011 				/* Consume the NUL. */
2012 				yy_cp = ++yyg->yy_c_buf_p;
2013 				yy_current_state = yy_next_state;
2014 				goto yy_match;
2015 				}
2016 
2017 			else
2018 				{
2019 /* %% [14.0] code to do back-up for compressed tables and set up yy_cp goes here */
2020 				yy_cp = yyg->yy_last_accepting_cpos;
2021 				yy_current_state = yyg->yy_last_accepting_state;
2022 				goto yy_find_action;
2023 				}
2024 			}
2025 
2026 		else switch ( yy_get_next_buffer( yyscanner ) )
2027 			{
2028 			case EOB_ACT_END_OF_FILE:
2029 				{
2030 				yyg->yy_did_buffer_switch_on_eof = 0;
2031 
2032 				if ( yywrap( yyscanner ) )
2033 					{
2034 					/* Note: because we've taken care in
2035 					 * yy_get_next_buffer() to have set up
2036 					 * yytext, we can now set up
2037 					 * yy_c_buf_p so that if some total
2038 					 * hoser (like flex itself) wants to
2039 					 * call the scanner after we return the
2040 					 * YY_NULL, it'll still work - another
2041 					 * YY_NULL will get returned.
2042 					 */
2043 					yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ;
2044 
2045 					yy_act = YY_STATE_EOF(YY_START);
2046 					goto do_action;
2047 					}
2048 
2049 				else
2050 					{
2051 					if ( ! yyg->yy_did_buffer_switch_on_eof )
2052 						YY_NEW_FILE;
2053 					}
2054 				break;
2055 				}
2056 
2057 			case EOB_ACT_CONTINUE_SCAN:
2058 				yyg->yy_c_buf_p =
2059 					yyg->yytext_ptr + yy_amount_of_matched_text;
2060 
2061 				yy_current_state = yy_get_previous_state( yyscanner );
2062 
2063 				yy_cp = yyg->yy_c_buf_p;
2064 				yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
2065 				goto yy_match;
2066 
2067 			case EOB_ACT_LAST_MATCH:
2068 				yyg->yy_c_buf_p =
2069 				&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars];
2070 
2071 				yy_current_state = yy_get_previous_state( yyscanner );
2072 
2073 				yy_cp = yyg->yy_c_buf_p;
2074 				yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
2075 				goto yy_find_action;
2076 			}
2077 		break;
2078 		}
2079 
2080 	default:
2081 		YY_FATAL_ERROR(
2082 			"fatal flex scanner internal error--no action found" );
2083 	} /* end of action switch */
2084 		} /* end of scanning one token */
2085 	} /* end of user's declarations */
2086 } /* end of yylex */
2087 /* %ok-for-header */
2088 
2089 /* %if-c++-only */
2090 /* %not-for-header */
2091 /* %ok-for-header */
2092 
2093 /* %endif */
2094 
2095 /* yy_get_next_buffer - try to read in a new buffer
2096  *
2097  * Returns a code representing an action:
2098  *	EOB_ACT_LAST_MATCH -
2099  *	EOB_ACT_CONTINUE_SCAN - continue scanning from current position
2100  *	EOB_ACT_END_OF_FILE - end of file
2101  */
2102 /* %if-c-only */
yy_get_next_buffer(yyscan_t yyscanner)2103 static int yy_get_next_buffer (yyscan_t yyscanner)
2104 /* %endif */
2105 /* %if-c++-only */
2106 /* %endif */
2107 {
2108     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2109 	char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
2110 	char *source = yyg->yytext_ptr;
2111 	int number_to_move, i;
2112 	int ret_val;
2113 
2114 	if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] )
2115 		YY_FATAL_ERROR(
2116 		"fatal flex scanner internal error--end of buffer missed" );
2117 
2118 	if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
2119 		{ /* Don't try to fill the buffer, so this is an EOF. */
2120 		if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 )
2121 			{
2122 			/* We matched a single character, the EOB, so
2123 			 * treat this as a final EOF.
2124 			 */
2125 			return EOB_ACT_END_OF_FILE;
2126 			}
2127 
2128 		else
2129 			{
2130 			/* We matched some text prior to the EOB, first
2131 			 * process it.
2132 			 */
2133 			return EOB_ACT_LAST_MATCH;
2134 			}
2135 		}
2136 
2137 	/* Try to read more data. */
2138 
2139 	/* First move last chars to start of buffer. */
2140 	number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr - 1);
2141 
2142 	for ( i = 0; i < number_to_move; ++i )
2143 		*(dest++) = *(source++);
2144 
2145 	if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
2146 		/* don't do the read, it's not guaranteed to return an EOF,
2147 		 * just force an EOF
2148 		 */
2149 		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0;
2150 
2151 	else
2152 		{
2153 			int num_to_read =
2154 			YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
2155 
2156 		while ( num_to_read <= 0 )
2157 			{ /* Not enough room in the buffer - grow it. */
2158 
2159 			/* just a shorter name for the current buffer */
2160 			YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
2161 
2162 			int yy_c_buf_p_offset =
2163 				(int) (yyg->yy_c_buf_p - b->yy_ch_buf);
2164 
2165 			if ( b->yy_is_our_buffer )
2166 				{
2167 				int new_size = b->yy_buf_size * 2;
2168 
2169 				if ( new_size <= 0 )
2170 					b->yy_buf_size += b->yy_buf_size / 8;
2171 				else
2172 					b->yy_buf_size *= 2;
2173 
2174 				b->yy_ch_buf = (char *)
2175 					/* Include room in for 2 EOB chars. */
2176 					yyrealloc( (void *) b->yy_ch_buf,
2177 							 (yy_size_t) (b->yy_buf_size + 2) , yyscanner );
2178 				}
2179 			else
2180 				/* Can't grow it, we don't own it. */
2181 				b->yy_ch_buf = NULL;
2182 
2183 			if ( ! b->yy_ch_buf )
2184 				YY_FATAL_ERROR(
2185 				"fatal error - scanner input buffer overflow" );
2186 
2187 			yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
2188 
2189 			num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
2190 						number_to_move - 1;
2191 
2192 			}
2193 
2194 		if ( num_to_read > YY_READ_BUF_SIZE )
2195 			num_to_read = YY_READ_BUF_SIZE;
2196 
2197 		/* Read in more data. */
2198 		YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
2199 			yyg->yy_n_chars, num_to_read );
2200 
2201 		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
2202 		}
2203 
2204 	if ( yyg->yy_n_chars == 0 )
2205 		{
2206 		if ( number_to_move == YY_MORE_ADJ )
2207 			{
2208 			ret_val = EOB_ACT_END_OF_FILE;
2209 			yyrestart( yyin  , yyscanner);
2210 			}
2211 
2212 		else
2213 			{
2214 			ret_val = EOB_ACT_LAST_MATCH;
2215 			YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
2216 				YY_BUFFER_EOF_PENDING;
2217 			}
2218 		}
2219 
2220 	else
2221 		ret_val = EOB_ACT_CONTINUE_SCAN;
2222 
2223 	if ((yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
2224 		/* Extend the array by 50%, plus the number we really need. */
2225 		int new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
2226 		YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc(
2227 			(void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size , yyscanner );
2228 		if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
2229 			YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
2230 		/* "- 2" to take care of EOB's */
2231 		YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2);
2232 	}
2233 
2234 	yyg->yy_n_chars += number_to_move;
2235 	YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR;
2236 	YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
2237 
2238 	yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
2239 
2240 	return ret_val;
2241 }
2242 
2243 /* yy_get_previous_state - get the state just before the EOB char was reached */
2244 
2245 /* %if-c-only */
2246 /* %not-for-header */
yy_get_previous_state(yyscan_t yyscanner)2247     static yy_state_type yy_get_previous_state (yyscan_t yyscanner)
2248 /* %endif */
2249 /* %if-c++-only */
2250 /* %endif */
2251 {
2252 	yy_state_type yy_current_state;
2253 	char *yy_cp;
2254     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2255 
2256 /* %% [15.0] code to get the start state into yy_current_state goes here */
2257 	yy_current_state = yyg->yy_start;
2258 
2259 	for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp )
2260 		{
2261 /* %% [16.0] code to find the next state goes here */
2262 		YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
2263 		if ( yy_accept[yy_current_state] )
2264 			{
2265 			yyg->yy_last_accepting_state = yy_current_state;
2266 			yyg->yy_last_accepting_cpos = yy_cp;
2267 			}
2268 		while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
2269 			{
2270 			yy_current_state = (int) yy_def[yy_current_state];
2271 			if ( yy_current_state >= 321 )
2272 				yy_c = yy_meta[yy_c];
2273 			}
2274 		yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
2275 		}
2276 
2277 	return yy_current_state;
2278 }
2279 
2280 /* yy_try_NUL_trans - try to make a transition on the NUL character
2281  *
2282  * synopsis
2283  *	next_state = yy_try_NUL_trans( current_state );
2284  */
2285 /* %if-c-only */
yy_try_NUL_trans(yy_state_type yy_current_state,yyscan_t yyscanner)2286     static yy_state_type yy_try_NUL_trans  (yy_state_type yy_current_state , yyscan_t yyscanner)
2287 /* %endif */
2288 /* %if-c++-only */
2289 /* %endif */
2290 {
2291 	int yy_is_jam;
2292     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */
2293 /* %% [17.0] code to find the next state, and perhaps do backing up, goes here */
2294 	char *yy_cp = yyg->yy_c_buf_p;
2295 
2296 	YY_CHAR yy_c = 1;
2297 	if ( yy_accept[yy_current_state] )
2298 		{
2299 		yyg->yy_last_accepting_state = yy_current_state;
2300 		yyg->yy_last_accepting_cpos = yy_cp;
2301 		}
2302 	while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
2303 		{
2304 		yy_current_state = (int) yy_def[yy_current_state];
2305 		if ( yy_current_state >= 321 )
2306 			yy_c = yy_meta[yy_c];
2307 		}
2308 	yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
2309 	yy_is_jam = (yy_current_state == 320);
2310 
2311 	(void)yyg;
2312 	return yy_is_jam ? 0 : yy_current_state;
2313 }
2314 
2315 #ifndef YY_NO_UNPUT
2316 /* %if-c-only */
2317 
2318 /* %endif */
2319 #endif
2320 
2321 /* %if-c-only */
2322 #ifndef YY_NO_INPUT
2323 #ifdef __cplusplus
yyinput(yyscan_t yyscanner)2324     static int yyinput (yyscan_t yyscanner)
2325 #else
2326     static int input  (yyscan_t yyscanner)
2327 #endif
2328 
2329 /* %endif */
2330 /* %if-c++-only */
2331 /* %endif */
2332 {
2333 	int c;
2334     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2335 
2336 	*yyg->yy_c_buf_p = yyg->yy_hold_char;
2337 
2338 	if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
2339 		{
2340 		/* yy_c_buf_p now points to the character we want to return.
2341 		 * If this occurs *before* the EOB characters, then it's a
2342 		 * valid NUL; if not, then we've hit the end of the buffer.
2343 		 */
2344 		if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
2345 			/* This was really a NUL. */
2346 			*yyg->yy_c_buf_p = '\0';
2347 
2348 		else
2349 			{ /* need more input */
2350 			int offset = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr);
2351 			++yyg->yy_c_buf_p;
2352 
2353 			switch ( yy_get_next_buffer( yyscanner ) )
2354 				{
2355 				case EOB_ACT_LAST_MATCH:
2356 					/* This happens because yy_g_n_b()
2357 					 * sees that we've accumulated a
2358 					 * token and flags that we need to
2359 					 * try matching the token before
2360 					 * proceeding.  But for input(),
2361 					 * there's no matching to consider.
2362 					 * So convert the EOB_ACT_LAST_MATCH
2363 					 * to EOB_ACT_END_OF_FILE.
2364 					 */
2365 
2366 					/* Reset buffer status. */
2367 					yyrestart( yyin , yyscanner);
2368 
2369 					/*FALLTHROUGH*/
2370 
2371 				case EOB_ACT_END_OF_FILE:
2372 					{
2373 					if ( yywrap( yyscanner ) )
2374 						return 0;
2375 
2376 					if ( ! yyg->yy_did_buffer_switch_on_eof )
2377 						YY_NEW_FILE;
2378 #ifdef __cplusplus
2379 					return yyinput(yyscanner);
2380 #else
2381 					return input(yyscanner);
2382 #endif
2383 					}
2384 
2385 				case EOB_ACT_CONTINUE_SCAN:
2386 					yyg->yy_c_buf_p = yyg->yytext_ptr + offset;
2387 					break;
2388 				}
2389 			}
2390 		}
2391 
2392 	c = *(unsigned char *) yyg->yy_c_buf_p;	/* cast for 8-bit char's */
2393 	*yyg->yy_c_buf_p = '\0';	/* preserve yytext */
2394 	yyg->yy_hold_char = *++yyg->yy_c_buf_p;
2395 
2396 /* %% [19.0] update BOL and yylineno */
2397 	if ( c == '\n' )
2398 
2399     do{ yylineno++;
2400         yycolumn=0;
2401     }while(0)
2402 ;
2403 
2404 	return c;
2405 }
2406 /* %if-c-only */
2407 #endif	/* ifndef YY_NO_INPUT */
2408 /* %endif */
2409 
2410 /** Immediately switch to a different input stream.
2411  * @param input_file A readable stream.
2412  * @param yyscanner The scanner object.
2413  * @note This function does not reset the start condition to @c INITIAL .
2414  */
2415 /* %if-c-only */
yyrestart(FILE * input_file,yyscan_t yyscanner)2416     void yyrestart  (FILE * input_file , yyscan_t yyscanner)
2417 /* %endif */
2418 /* %if-c++-only */
2419 /* %endif */
2420 {
2421     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2422 
2423 	if ( ! YY_CURRENT_BUFFER ){
2424         yyensure_buffer_stack (yyscanner);
2425 		YY_CURRENT_BUFFER_LVALUE =
2426             yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner);
2427 	}
2428 
2429 	yy_init_buffer( YY_CURRENT_BUFFER, input_file , yyscanner);
2430 	yy_load_buffer_state( yyscanner );
2431 }
2432 
2433 /* %if-c++-only */
2434 /* %endif */
2435 
2436 /** Switch to a different input buffer.
2437  * @param new_buffer The new input buffer.
2438  * @param yyscanner The scanner object.
2439  */
2440 /* %if-c-only */
yy_switch_to_buffer(YY_BUFFER_STATE new_buffer,yyscan_t yyscanner)2441     void yy_switch_to_buffer  (YY_BUFFER_STATE  new_buffer , yyscan_t yyscanner)
2442 /* %endif */
2443 /* %if-c++-only */
2444 /* %endif */
2445 {
2446     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2447 
2448 	/* TODO. We should be able to replace this entire function body
2449 	 * with
2450 	 *		yypop_buffer_state();
2451 	 *		yypush_buffer_state(new_buffer);
2452      */
2453 	yyensure_buffer_stack (yyscanner);
2454 	if ( YY_CURRENT_BUFFER == new_buffer )
2455 		return;
2456 
2457 	if ( YY_CURRENT_BUFFER )
2458 		{
2459 		/* Flush out information for old buffer. */
2460 		*yyg->yy_c_buf_p = yyg->yy_hold_char;
2461 		YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
2462 		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
2463 		}
2464 
2465 	YY_CURRENT_BUFFER_LVALUE = new_buffer;
2466 	yy_load_buffer_state( yyscanner );
2467 
2468 	/* We don't actually know whether we did this switch during
2469 	 * EOF (yywrap()) processing, but the only time this flag
2470 	 * is looked at is after yywrap() is called, so it's safe
2471 	 * to go ahead and always set it.
2472 	 */
2473 	yyg->yy_did_buffer_switch_on_eof = 1;
2474 }
2475 
2476 /* %if-c-only */
yy_load_buffer_state(yyscan_t yyscanner)2477 static void yy_load_buffer_state  (yyscan_t yyscanner)
2478 /* %endif */
2479 /* %if-c++-only */
2480 /* %endif */
2481 {
2482     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2483 	yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
2484 	yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
2485 /* %if-c-only */
2486 	yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
2487 /* %endif */
2488 /* %if-c++-only */
2489 /* %endif */
2490 	yyg->yy_hold_char = *yyg->yy_c_buf_p;
2491 }
2492 
2493 /** Allocate and initialize an input buffer state.
2494  * @param file A readable stream.
2495  * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
2496  * @param yyscanner The scanner object.
2497  * @return the allocated buffer state.
2498  */
2499 /* %if-c-only */
yy_create_buffer(FILE * file,int size,yyscan_t yyscanner)2500     YY_BUFFER_STATE yy_create_buffer  (FILE * file, int  size , yyscan_t yyscanner)
2501 /* %endif */
2502 /* %if-c++-only */
2503 /* %endif */
2504 {
2505 	YY_BUFFER_STATE b;
2506 
2507 	b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner );
2508 	if ( ! b )
2509 		YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
2510 
2511 	b->yy_buf_size = size;
2512 
2513 	/* yy_ch_buf has to be 2 characters longer than the size given because
2514 	 * we need to put in 2 end-of-buffer characters.
2515 	 */
2516 	b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) , yyscanner );
2517 	if ( ! b->yy_ch_buf )
2518 		YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
2519 
2520 	b->yy_is_our_buffer = 1;
2521 
2522 	yy_init_buffer( b, file , yyscanner);
2523 
2524 	return b;
2525 }
2526 
2527 /* %if-c++-only */
2528 /* %endif */
2529 
2530 /** Destroy the buffer.
2531  * @param b a buffer created with yy_create_buffer()
2532  * @param yyscanner The scanner object.
2533  */
2534 /* %if-c-only */
yy_delete_buffer(YY_BUFFER_STATE b,yyscan_t yyscanner)2535     void yy_delete_buffer (YY_BUFFER_STATE  b , yyscan_t yyscanner)
2536 /* %endif */
2537 /* %if-c++-only */
2538 /* %endif */
2539 {
2540     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2541 
2542 	if ( ! b )
2543 		return;
2544 
2545 	if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
2546 		YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
2547 
2548 	if ( b->yy_is_our_buffer )
2549 		yyfree( (void *) b->yy_ch_buf , yyscanner );
2550 
2551 	yyfree( (void *) b , yyscanner );
2552 }
2553 
2554 /* Initializes or reinitializes a buffer.
2555  * This function is sometimes called more than once on the same buffer,
2556  * such as during a yyrestart() or at EOF.
2557  */
2558 /* %if-c-only */
yy_init_buffer(YY_BUFFER_STATE b,FILE * file,yyscan_t yyscanner)2559     static void yy_init_buffer  (YY_BUFFER_STATE  b, FILE * file , yyscan_t yyscanner)
2560 /* %endif */
2561 /* %if-c++-only */
2562 /* %endif */
2563 
2564 {
2565 	int oerrno = errno;
2566     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2567 
2568 	yy_flush_buffer( b , yyscanner);
2569 
2570 /* %if-c-only */
2571 	b->yy_input_file = file;
2572 /* %endif */
2573 /* %if-c++-only */
2574 /* %endif */
2575 	b->yy_fill_buffer = 1;
2576 
2577     /* If b is the current buffer, then yy_init_buffer was _probably_
2578      * called from yyrestart() or through yy_get_next_buffer.
2579      * In that case, we don't want to reset the lineno or column.
2580      */
2581     if (b != YY_CURRENT_BUFFER){
2582         b->yy_bs_lineno = 1;
2583         b->yy_bs_column = 0;
2584     }
2585 
2586 /* %if-c-only */
2587 
2588         b->yy_is_interactive = 0;
2589 
2590 /* %endif */
2591 /* %if-c++-only */
2592 /* %endif */
2593 	errno = oerrno;
2594 }
2595 
2596 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
2597  * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
2598  * @param yyscanner The scanner object.
2599  */
2600 /* %if-c-only */
yy_flush_buffer(YY_BUFFER_STATE b,yyscan_t yyscanner)2601     void yy_flush_buffer (YY_BUFFER_STATE  b , yyscan_t yyscanner)
2602 /* %endif */
2603 /* %if-c++-only */
2604 /* %endif */
2605 {
2606     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2607 	if ( ! b )
2608 		return;
2609 
2610 	b->yy_n_chars = 0;
2611 
2612 	/* We always need two end-of-buffer characters.  The first causes
2613 	 * a transition to the end-of-buffer state.  The second causes
2614 	 * a jam in that state.
2615 	 */
2616 	b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
2617 	b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
2618 
2619 	b->yy_buf_pos = &b->yy_ch_buf[0];
2620 
2621 	b->yy_at_bol = 1;
2622 	b->yy_buffer_status = YY_BUFFER_NEW;
2623 
2624 	if ( b == YY_CURRENT_BUFFER )
2625 		yy_load_buffer_state( yyscanner );
2626 }
2627 
2628 /* %if-c-or-c++ */
2629 /** Pushes the new state onto the stack. The new state becomes
2630  *  the current state. This function will allocate the stack
2631  *  if necessary.
2632  *  @param new_buffer The new state.
2633  *  @param yyscanner The scanner object.
2634  */
2635 /* %if-c-only */
yypush_buffer_state(YY_BUFFER_STATE new_buffer,yyscan_t yyscanner)2636 void yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
2637 /* %endif */
2638 /* %if-c++-only */
2639 /* %endif */
2640 {
2641     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2642 	if (new_buffer == NULL)
2643 		return;
2644 
2645 	yyensure_buffer_stack(yyscanner);
2646 
2647 	/* This block is copied from yy_switch_to_buffer. */
2648 	if ( YY_CURRENT_BUFFER )
2649 		{
2650 		/* Flush out information for old buffer. */
2651 		*yyg->yy_c_buf_p = yyg->yy_hold_char;
2652 		YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
2653 		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
2654 		}
2655 
2656 	/* Only push if top exists. Otherwise, replace top. */
2657 	if (YY_CURRENT_BUFFER)
2658 		yyg->yy_buffer_stack_top++;
2659 	YY_CURRENT_BUFFER_LVALUE = new_buffer;
2660 
2661 	/* copied from yy_switch_to_buffer. */
2662 	yy_load_buffer_state( yyscanner );
2663 	yyg->yy_did_buffer_switch_on_eof = 1;
2664 }
2665 /* %endif */
2666 
2667 /* %if-c-or-c++ */
2668 /** Removes and deletes the top of the stack, if present.
2669  *  The next element becomes the new top.
2670  *  @param yyscanner The scanner object.
2671  */
2672 /* %if-c-only */
yypop_buffer_state(yyscan_t yyscanner)2673 void yypop_buffer_state (yyscan_t yyscanner)
2674 /* %endif */
2675 /* %if-c++-only */
2676 /* %endif */
2677 {
2678     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2679 	if (!YY_CURRENT_BUFFER)
2680 		return;
2681 
2682 	yy_delete_buffer(YY_CURRENT_BUFFER , yyscanner);
2683 	YY_CURRENT_BUFFER_LVALUE = NULL;
2684 	if (yyg->yy_buffer_stack_top > 0)
2685 		--yyg->yy_buffer_stack_top;
2686 
2687 	if (YY_CURRENT_BUFFER) {
2688 		yy_load_buffer_state( yyscanner );
2689 		yyg->yy_did_buffer_switch_on_eof = 1;
2690 	}
2691 }
2692 /* %endif */
2693 
2694 /* %if-c-or-c++ */
2695 /* Allocates the stack if it does not exist.
2696  *  Guarantees space for at least one push.
2697  */
2698 /* %if-c-only */
yyensure_buffer_stack(yyscan_t yyscanner)2699 static void yyensure_buffer_stack (yyscan_t yyscanner)
2700 /* %endif */
2701 /* %if-c++-only */
2702 /* %endif */
2703 {
2704 	yy_size_t num_to_alloc;
2705     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2706 
2707 	if (!yyg->yy_buffer_stack) {
2708 
2709 		/* First allocation is just for 2 elements, since we don't know if this
2710 		 * scanner will even need a stack. We use 2 instead of 1 to avoid an
2711 		 * immediate realloc on the next call.
2712          */
2713       num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
2714 		yyg->yy_buffer_stack = (struct yy_buffer_state**)yyalloc
2715 								(num_to_alloc * sizeof(struct yy_buffer_state*)
2716 								, yyscanner);
2717 		if ( ! yyg->yy_buffer_stack )
2718 			YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
2719 
2720 		memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
2721 
2722 		yyg->yy_buffer_stack_max = num_to_alloc;
2723 		yyg->yy_buffer_stack_top = 0;
2724 		return;
2725 	}
2726 
2727 	if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){
2728 
2729 		/* Increase the buffer to prepare for a possible push. */
2730 		yy_size_t grow_size = 8 /* arbitrary grow size */;
2731 
2732 		num_to_alloc = yyg->yy_buffer_stack_max + grow_size;
2733 		yyg->yy_buffer_stack = (struct yy_buffer_state**)yyrealloc
2734 								(yyg->yy_buffer_stack,
2735 								num_to_alloc * sizeof(struct yy_buffer_state*)
2736 								, yyscanner);
2737 		if ( ! yyg->yy_buffer_stack )
2738 			YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
2739 
2740 		/* zero only the new slots.*/
2741 		memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*));
2742 		yyg->yy_buffer_stack_max = num_to_alloc;
2743 	}
2744 }
2745 /* %endif */
2746 
2747 /* %if-c-only */
2748 /** Setup the input buffer state to scan directly from a user-specified character buffer.
2749  * @param base the character buffer
2750  * @param size the size in bytes of the character buffer
2751  * @param yyscanner The scanner object.
2752  * @return the newly allocated buffer state object.
2753  */
yy_scan_buffer(char * base,yy_size_t size,yyscan_t yyscanner)2754 YY_BUFFER_STATE yy_scan_buffer  (char * base, yy_size_t  size , yyscan_t yyscanner)
2755 {
2756 	YY_BUFFER_STATE b;
2757 
2758 	if ( size < 2 ||
2759 	     base[size-2] != YY_END_OF_BUFFER_CHAR ||
2760 	     base[size-1] != YY_END_OF_BUFFER_CHAR )
2761 		/* They forgot to leave room for the EOB's. */
2762 		return NULL;
2763 
2764 	b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner );
2765 	if ( ! b )
2766 		YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
2767 
2768 	b->yy_buf_size = (int) (size - 2);	/* "- 2" to take care of EOB's */
2769 	b->yy_buf_pos = b->yy_ch_buf = base;
2770 	b->yy_is_our_buffer = 0;
2771 	b->yy_input_file = NULL;
2772 	b->yy_n_chars = b->yy_buf_size;
2773 	b->yy_is_interactive = 0;
2774 	b->yy_at_bol = 1;
2775 	b->yy_fill_buffer = 0;
2776 	b->yy_buffer_status = YY_BUFFER_NEW;
2777 
2778 	yy_switch_to_buffer( b , yyscanner );
2779 
2780 	return b;
2781 }
2782 /* %endif */
2783 
2784 /* %if-c-only */
2785 /** Setup the input buffer state to scan a string. The next call to yylex() will
2786  * scan from a @e copy of @a str.
2787  * @param yystr a NUL-terminated string to scan
2788  * @param yyscanner The scanner object.
2789  * @return the newly allocated buffer state object.
2790  * @note If you want to scan bytes that may contain NUL values, then use
2791  *       yy_scan_bytes() instead.
2792  */
yy_scan_string(const char * yystr,yyscan_t yyscanner)2793 YY_BUFFER_STATE yy_scan_string (const char * yystr , yyscan_t yyscanner)
2794 {
2795 
2796 	return yy_scan_bytes( yystr, (int) strlen(yystr) , yyscanner);
2797 }
2798 /* %endif */
2799 
2800 /* %if-c-only */
2801 /** Setup the input buffer state to scan the given bytes. The next call to yylex() will
2802  * scan from a @e copy of @a bytes.
2803  * @param yybytes the byte buffer to scan
2804  * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
2805  * @param yyscanner The scanner object.
2806  * @return the newly allocated buffer state object.
2807  */
yy_scan_bytes(const char * yybytes,int _yybytes_len,yyscan_t yyscanner)2808 YY_BUFFER_STATE yy_scan_bytes  (const char * yybytes, int  _yybytes_len , yyscan_t yyscanner)
2809 {
2810 	YY_BUFFER_STATE b;
2811 	char *buf;
2812 	yy_size_t n;
2813 	int i;
2814 
2815 	/* Get memory for full buffer, including space for trailing EOB's. */
2816 	n = (yy_size_t) (_yybytes_len + 2);
2817 	buf = (char *) yyalloc( n , yyscanner );
2818 	if ( ! buf )
2819 		YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
2820 
2821 	for ( i = 0; i < _yybytes_len; ++i )
2822 		buf[i] = yybytes[i];
2823 
2824 	buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
2825 
2826 	b = yy_scan_buffer( buf, n , yyscanner);
2827 	if ( ! b )
2828 		YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
2829 
2830 	/* It's okay to grow etc. this buffer, and we should throw it
2831 	 * away when we're done.
2832 	 */
2833 	b->yy_is_our_buffer = 1;
2834 
2835 	return b;
2836 }
2837 /* %endif */
2838 
2839 #ifndef YY_EXIT_FAILURE
2840 #define YY_EXIT_FAILURE 2
2841 #endif
2842 
2843 /* %if-c-only */
yy_fatal_error(const char * msg,yyscan_t yyscanner)2844 static void yynoreturn yy_fatal_error (const char* msg , yyscan_t yyscanner)
2845 {
2846 	struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2847 	(void)yyg;
2848 	fprintf( stderr, "%s\n", msg );
2849 	exit( YY_EXIT_FAILURE );
2850 }
2851 /* %endif */
2852 /* %if-c++-only */
2853 /* %endif */
2854 
2855 /* Redefine yyless() so it works in section 3 code. */
2856 
2857 #undef yyless
2858 #define yyless(n) \
2859 	do \
2860 		{ \
2861 		/* Undo effects of setting up yytext. */ \
2862         int yyless_macro_arg = (n); \
2863         YY_LESS_LINENO(yyless_macro_arg);\
2864 		yytext[yyleng] = yyg->yy_hold_char; \
2865 		yyg->yy_c_buf_p = yytext + yyless_macro_arg; \
2866 		yyg->yy_hold_char = *yyg->yy_c_buf_p; \
2867 		*yyg->yy_c_buf_p = '\0'; \
2868 		yyleng = yyless_macro_arg; \
2869 		} \
2870 	while ( 0 )
2871 
2872 /* Accessor  methods (get/set functions) to struct members. */
2873 
2874 /* %if-c-only */
2875 /* %if-reentrant */
2876 
2877 /** Get the user-defined data for this scanner.
2878  * @param yyscanner The scanner object.
2879  */
yyget_extra(yyscan_t yyscanner)2880 YY_EXTRA_TYPE yyget_extra  (yyscan_t yyscanner)
2881 {
2882     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2883     return yyextra;
2884 }
2885 
2886 /* %endif */
2887 
2888 /** Get the current line number.
2889  * @param yyscanner The scanner object.
2890  */
yyget_lineno(yyscan_t yyscanner)2891 int yyget_lineno  (yyscan_t yyscanner)
2892 {
2893     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2894 
2895         if (! YY_CURRENT_BUFFER)
2896             return 0;
2897 
2898     return yylineno;
2899 }
2900 
2901 /** Get the current column number.
2902  * @param yyscanner The scanner object.
2903  */
yyget_column(yyscan_t yyscanner)2904 int yyget_column  (yyscan_t yyscanner)
2905 {
2906     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2907 
2908         if (! YY_CURRENT_BUFFER)
2909             return 0;
2910 
2911     return yycolumn;
2912 }
2913 
2914 /** Get the input stream.
2915  * @param yyscanner The scanner object.
2916  */
yyget_in(yyscan_t yyscanner)2917 FILE *yyget_in  (yyscan_t yyscanner)
2918 {
2919     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2920     return yyin;
2921 }
2922 
2923 /** Get the output stream.
2924  * @param yyscanner The scanner object.
2925  */
yyget_out(yyscan_t yyscanner)2926 FILE *yyget_out  (yyscan_t yyscanner)
2927 {
2928     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2929     return yyout;
2930 }
2931 
2932 /** Get the length of the current token.
2933  * @param yyscanner The scanner object.
2934  */
yyget_leng(yyscan_t yyscanner)2935 int yyget_leng  (yyscan_t yyscanner)
2936 {
2937     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2938     return yyleng;
2939 }
2940 
2941 /** Get the current token.
2942  * @param yyscanner The scanner object.
2943  */
2944 
yyget_text(yyscan_t yyscanner)2945 char *yyget_text  (yyscan_t yyscanner)
2946 {
2947     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2948     return yytext;
2949 }
2950 
2951 /* %if-reentrant */
2952 
2953 /** Set the user-defined data. This data is never touched by the scanner.
2954  * @param user_defined The data to be associated with this scanner.
2955  * @param yyscanner The scanner object.
2956  */
yyset_extra(YY_EXTRA_TYPE user_defined,yyscan_t yyscanner)2957 void yyset_extra (YY_EXTRA_TYPE  user_defined , yyscan_t yyscanner)
2958 {
2959     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2960     yyextra = user_defined ;
2961 }
2962 
2963 /* %endif */
2964 
2965 /** Set the current line number.
2966  * @param _line_number line number
2967  * @param yyscanner The scanner object.
2968  */
yyset_lineno(int _line_number,yyscan_t yyscanner)2969 void yyset_lineno (int  _line_number , yyscan_t yyscanner)
2970 {
2971     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2972 
2973         /* lineno is only valid if an input buffer exists. */
2974         if (! YY_CURRENT_BUFFER )
2975            YY_FATAL_ERROR( "yyset_lineno called with no buffer" );
2976 
2977     yylineno = _line_number;
2978 }
2979 
2980 /** Set the current column.
2981  * @param _column_no column number
2982  * @param yyscanner The scanner object.
2983  */
yyset_column(int _column_no,yyscan_t yyscanner)2984 void yyset_column (int  _column_no , yyscan_t yyscanner)
2985 {
2986     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2987 
2988         /* column is only valid if an input buffer exists. */
2989         if (! YY_CURRENT_BUFFER )
2990            YY_FATAL_ERROR( "yyset_column called with no buffer" );
2991 
2992     yycolumn = _column_no;
2993 }
2994 
2995 /** Set the input stream. This does not discard the current
2996  * input buffer.
2997  * @param _in_str A readable stream.
2998  * @param yyscanner The scanner object.
2999  * @see yy_switch_to_buffer
3000  */
yyset_in(FILE * _in_str,yyscan_t yyscanner)3001 void yyset_in (FILE *  _in_str , yyscan_t yyscanner)
3002 {
3003     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3004     yyin = _in_str ;
3005 }
3006 
yyset_out(FILE * _out_str,yyscan_t yyscanner)3007 void yyset_out (FILE *  _out_str , yyscan_t yyscanner)
3008 {
3009     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3010     yyout = _out_str ;
3011 }
3012 
yyget_debug(yyscan_t yyscanner)3013 int yyget_debug  (yyscan_t yyscanner)
3014 {
3015     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3016     return yy_flex_debug;
3017 }
3018 
yyset_debug(int _bdebug,yyscan_t yyscanner)3019 void yyset_debug (int  _bdebug , yyscan_t yyscanner)
3020 {
3021     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3022     yy_flex_debug = _bdebug ;
3023 }
3024 
3025 /* %endif */
3026 
3027 /* %if-reentrant */
3028 /* Accessor methods for yylval and yylloc */
3029 
3030 /* %if-bison-bridge */
3031 
yyget_lval(yyscan_t yyscanner)3032 YYSTYPE * yyget_lval  (yyscan_t yyscanner)
3033 {
3034     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3035     return yylval;
3036 }
3037 
yyset_lval(YYSTYPE * yylval_param,yyscan_t yyscanner)3038 void yyset_lval (YYSTYPE *  yylval_param , yyscan_t yyscanner)
3039 {
3040     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3041     yylval = yylval_param;
3042 }
3043 
yyget_lloc(yyscan_t yyscanner)3044 YYLTYPE *yyget_lloc  (yyscan_t yyscanner)
3045 {
3046     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3047     return yylloc;
3048 }
3049 
yyset_lloc(YYLTYPE * yylloc_param,yyscan_t yyscanner)3050 void yyset_lloc (YYLTYPE *  yylloc_param , yyscan_t yyscanner)
3051 {
3052     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3053     yylloc = yylloc_param;
3054 }
3055 
3056 /* %endif */
3057 
3058 /* User-visible API */
3059 
3060 /* yylex_init is special because it creates the scanner itself, so it is
3061  * the ONLY reentrant function that doesn't take the scanner as the last argument.
3062  * That's why we explicitly handle the declaration, instead of using our macros.
3063  */
yylex_init(yyscan_t * ptr_yy_globals)3064 int yylex_init(yyscan_t* ptr_yy_globals)
3065 {
3066     if (ptr_yy_globals == NULL){
3067         errno = EINVAL;
3068         return 1;
3069     }
3070 
3071     *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), NULL );
3072 
3073     if (*ptr_yy_globals == NULL){
3074         errno = ENOMEM;
3075         return 1;
3076     }
3077 
3078     /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */
3079     memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
3080 
3081     return yy_init_globals ( *ptr_yy_globals );
3082 }
3083 
3084 /* yylex_init_extra has the same functionality as yylex_init, but follows the
3085  * convention of taking the scanner as the last argument. Note however, that
3086  * this is a *pointer* to a scanner, as it will be allocated by this call (and
3087  * is the reason, too, why this function also must handle its own declaration).
3088  * The user defined value in the first argument will be available to yyalloc in
3089  * the yyextra field.
3090  */
yylex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t * ptr_yy_globals)3091 int yylex_init_extra( YY_EXTRA_TYPE yy_user_defined, yyscan_t* ptr_yy_globals )
3092 {
3093     struct yyguts_t dummy_yyguts;
3094 
3095     yyset_extra (yy_user_defined, &dummy_yyguts);
3096 
3097     if (ptr_yy_globals == NULL){
3098         errno = EINVAL;
3099         return 1;
3100     }
3101 
3102     *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
3103 
3104     if (*ptr_yy_globals == NULL){
3105         errno = ENOMEM;
3106         return 1;
3107     }
3108 
3109     /* By setting to 0xAA, we expose bugs in
3110     yy_init_globals. Leave at 0x00 for releases. */
3111     memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
3112 
3113     yyset_extra (yy_user_defined, *ptr_yy_globals);
3114 
3115     return yy_init_globals ( *ptr_yy_globals );
3116 }
3117 
3118 /* %endif if-c-only */
3119 
3120 /* %if-c-only */
yy_init_globals(yyscan_t yyscanner)3121 static int yy_init_globals (yyscan_t yyscanner)
3122 {
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 yylex_destroy(), so don't allocate here.
3126      */
3127 
3128     yyg->yy_buffer_stack = NULL;
3129     yyg->yy_buffer_stack_top = 0;
3130     yyg->yy_buffer_stack_max = 0;
3131     yyg->yy_c_buf_p = NULL;
3132     yyg->yy_init = 0;
3133     yyg->yy_start = 0;
3134 
3135     yyg->yy_start_stack_ptr = 0;
3136     yyg->yy_start_stack_depth = 0;
3137     yyg->yy_start_stack =  NULL;
3138 
3139 /* Defined in main.c */
3140 #ifdef YY_STDINIT
3141     yyin = stdin;
3142     yyout = stdout;
3143 #else
3144     yyin = NULL;
3145     yyout = NULL;
3146 #endif
3147 
3148     /* For future reference: Set errno on error, since we are called by
3149      * yylex_init()
3150      */
3151     return 0;
3152 }
3153 /* %endif */
3154 
3155 /* %if-c-only SNIP! this currently causes conflicts with the c++ scanner */
3156 /* yylex_destroy is for both reentrant and non-reentrant scanners. */
yylex_destroy(yyscan_t yyscanner)3157 int yylex_destroy  (yyscan_t yyscanner)
3158 {
3159     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3160 
3161     /* Pop the buffer stack, destroying each element. */
3162 	while(YY_CURRENT_BUFFER){
3163 		yy_delete_buffer( YY_CURRENT_BUFFER , yyscanner );
3164 		YY_CURRENT_BUFFER_LVALUE = NULL;
3165 		yypop_buffer_state(yyscanner);
3166 	}
3167 
3168 	/* Destroy the stack itself. */
3169 	yyfree(yyg->yy_buffer_stack , yyscanner);
3170 	yyg->yy_buffer_stack = NULL;
3171 
3172     /* Destroy the start condition stack. */
3173         yyfree( yyg->yy_start_stack , yyscanner );
3174         yyg->yy_start_stack = NULL;
3175 
3176     /* Reset the globals. This is important in a non-reentrant scanner so the next time
3177      * yylex() is called, initialization will occur. */
3178     yy_init_globals( yyscanner);
3179 
3180 /* %if-reentrant */
3181     /* Destroy the main struct (reentrant only). */
3182     yyfree ( yyscanner , yyscanner );
3183     yyscanner = NULL;
3184 /* %endif */
3185     return 0;
3186 }
3187 /* %endif */
3188 
3189 /*
3190  * Internal utility routines.
3191  */
3192 
3193 #ifndef yytext_ptr
yy_flex_strncpy(char * s1,const char * s2,int n,yyscan_t yyscanner)3194 static void yy_flex_strncpy (char* s1, const char * s2, int n , yyscan_t yyscanner)
3195 {
3196 	struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3197 	(void)yyg;
3198 
3199 	int i;
3200 	for ( i = 0; i < n; ++i )
3201 		s1[i] = s2[i];
3202 }
3203 #endif
3204 
3205 #ifdef YY_NEED_STRLEN
yy_flex_strlen(const char * s,yyscan_t yyscanner)3206 static int yy_flex_strlen (const char * s , yyscan_t yyscanner)
3207 {
3208 	int n;
3209 	for ( n = 0; s[n]; ++n )
3210 		;
3211 
3212 	return n;
3213 }
3214 #endif
3215 
yyalloc(yy_size_t size,yyscan_t yyscanner)3216 void *yyalloc (yy_size_t  size , yyscan_t yyscanner)
3217 {
3218 	struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3219 	(void)yyg;
3220 	return malloc(size);
3221 }
3222 
yyrealloc(void * ptr,yy_size_t size,yyscan_t yyscanner)3223 void *yyrealloc  (void * ptr, yy_size_t  size , yyscan_t yyscanner)
3224 {
3225 	struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3226 	(void)yyg;
3227 
3228 	/* The cast to (char *) in the following accommodates both
3229 	 * implementations that use char* generic pointers, and those
3230 	 * that use void* generic pointers.  It works with the latter
3231 	 * because both ANSI C and C++ allow castless assignment from
3232 	 * any pointer type to void*, and deal with argument conversions
3233 	 * as though doing an assignment.
3234 	 */
3235 	return realloc(ptr, size);
3236 }
3237 
yyfree(void * ptr,yyscan_t yyscanner)3238 void yyfree (void * ptr , yyscan_t yyscanner)
3239 {
3240 	struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3241 	(void)yyg;
3242 	free( (char *) ptr );	/* see yyrealloc() for (char *) cast */
3243 }
3244 
3245 /* %if-tables-serialization definitions */
3246 /* %define-yytables   The name for this specific scanner's tables. */
3247 #define YYTABLES_NAME "yytables"
3248 /* %endif */
3249 
3250 /* %ok-for-header */
3251 
3252 #line 223 "am-scanner.l"
3253 
3254 
3255 /* Private functions
3256  *---------------------------------------------------------------------------*/
3257 
3258 static void
amp_am_scanner_reparse_token(AmpAmScanner * scanner,AnjutaToken * token,GFile * filename)3259 amp_am_scanner_reparse_token (AmpAmScanner *scanner, AnjutaToken *token, GFile *filename)
3260 {
3261 	AnjutaToken *root;
3262 	AnjutaToken *list;
3263 
3264 	if (token == NULL) return;
3265 
3266 	token = anjuta_token_concat (token);
3267 
3268 	yylex_init(&scanner->scanner);
3269 	yyset_extra (scanner, scanner->scanner);
3270 
3271 	root = anjuta_token_new_static (ANJUTA_TOKEN_FILE, NULL);
3272 	list = amp_am_scanner_parse_token (scanner, root, token, filename, NULL);
3273 	list = anjuta_token_delete_parent (list);
3274 	if (list != NULL) anjuta_token_insert_before (token, list);
3275 	anjuta_token_free (token);
3276 }
3277 
3278 /* Private functions, variable dependencies
3279  *---------------------------------------------------------------------------*/
3280 
3281 static AmpVariableDepend *
amp_variable_depend_new(void)3282 amp_variable_depend_new (void)
3283 {
3284 	AmpVariableDepend *dep;
3285 
3286 	dep = g_new0 (AmpVariableDepend, 1);
3287 
3288 	return dep;
3289 }
3290 
3291 static void
amp_variable_depend_free(AmpVariableDepend * depend)3292 amp_variable_depend_free (AmpVariableDepend *depend)
3293 {
3294 	g_list_free (depend->token);
3295 	g_list_free (depend->depend);
3296 }
3297 
3298 static void
list_depend(AnjutaToken * token,gpointer user_data)3299 list_depend (AnjutaToken *token, gpointer user_data)
3300 {
3301 	GList **depend = (GList **)user_data;
3302 
3303 	if (anjuta_token_get_type (token) == ANJUTA_TOKEN_VARIABLE)
3304 	{
3305 		gchar *string;
3306 		gchar *name;
3307 		guint length;
3308 
3309 		string = anjuta_token_evaluate_name(token);
3310 		length = strlen (string);
3311 		if (length > 1)
3312 		{
3313 			if (string[1] == '(')
3314 			{
3315 				string[length - 1] = '\0';
3316 				name = string + 2;
3317 			}
3318 			else
3319 			{
3320 				string[2] = '\0';
3321 				name = string + 1;
3322 			}
3323 			name = g_strdup (name);
3324 			*depend = g_list_prepend (*depend, name);
3325 		}
3326 	}
3327 }
3328 
3329 static void
convert_dependencies(gchar * variable_name,AmpVariableDepend * variable,gpointer user_data)3330 convert_dependencies (gchar *variable_name, AmpVariableDepend *variable, gpointer user_data)
3331 {
3332 	GList *list;
3333 	GHashTable *dependencies = (GHashTable *)user_data;
3334 
3335 	variable->token = g_list_reverse (variable->token);
3336 
3337 	list = g_list_first (variable->depend);
3338 	if (list == NULL) variable->evaluated = TRUE;
3339 	for (; list != NULL;)
3340 	{
3341 		gchar *name = (gchar *)list->data;
3342 		AmpVariableDepend *depend;
3343 		GList *next;
3344 
3345 		depend =g_hash_table_lookup (dependencies, name);
3346 		g_free (name);
3347 		next = g_list_next (list);
3348 
3349 		if (depend == NULL)
3350 		{
3351 			/* Unexisting variable, remove it from dependencies */
3352 			variable->depend = g_list_delete_link (variable->depend, list);
3353 		}
3354 		else
3355 		{
3356 			GList *dup;
3357 
3358 			/* Look for duplicate */
3359 			for (dup = g_list_first (variable->depend); dup != list; dup = g_list_next (dup))
3360 			{
3361 				if (dup->data == depend) break;
3362 			}
3363 
3364 			if (dup == list)
3365 			{
3366 				dup->data = depend;
3367 			}
3368 			else
3369 			{
3370 				/* Find a duplicate */
3371 				variable->depend = g_list_delete_link (variable->depend, list);
3372 			}
3373 		}
3374 		list = next;
3375 	}
3376 
3377 }
3378 
3379 static GHashTable *
amp_am_scanner_compute_dependencies(AmpAmScanner * scanner)3380 amp_am_scanner_compute_dependencies (AmpAmScanner *scanner)
3381 {
3382 	GHashTable *variable_dependencies;
3383 	GList *variable;
3384 
3385 	/* Compute variables dependencies */
3386 	variable_dependencies = g_hash_table_new_full (g_str_hash, g_str_equal, (GDestroyNotify)g_free, (GDestroyNotify)amp_variable_depend_free);
3387 	for (variable = g_list_first (scanner->variables); variable != NULL; variable = g_list_next (variable))
3388 	{
3389 		AnjutaToken *arg;
3390 		AnjutaToken *value;
3391 		gchar *name;
3392 		GList *list = NULL;
3393 		AmpVariableDepend *depend;
3394 
3395 		arg = anjuta_token_first_item ((AnjutaToken *)variable->data);
3396 		name = g_strstrip (anjuta_token_evaluate (arg));
3397 
3398 		/* Find variable dependencies data */
3399 		depend =(AmpVariableDepend *)g_hash_table_lookup (variable_dependencies, name);
3400 		if (depend == NULL)
3401 		{
3402 			depend = amp_variable_depend_new ();
3403 			depend->name = name;
3404 			g_hash_table_insert (variable_dependencies, name, depend);
3405 		}
3406 
3407 		depend->token = g_list_prepend (depend->token, variable->data);
3408 
3409 		/* Find dependencies */
3410 		value = anjuta_token_last_item ((AnjutaToken *)variable->data);
3411 		anjuta_token_foreach_token (value, list_depend, &list);
3412 		depend->depend = g_list_concat (list, depend->depend);
3413 	}
3414 
3415 	/* Replace name in dependencies by pointer */
3416 	g_hash_table_foreach (variable_dependencies, (GHFunc)convert_dependencies, variable_dependencies);
3417 
3418 	return variable_dependencies;
3419 }
3420 
3421 static gint
amp_am_scanner_parse_end(AmpAmScanner * scanner)3422 amp_am_scanner_parse_end (AmpAmScanner *scanner)
3423 {
3424 
3425    	if (scanner->stream == NULL)
3426    	{
3427 		yyterminate();
3428 	}
3429    	else
3430    	{
3431 		if (scanner->eof)
3432 		{
3433 			scanner->eof = FALSE;
3434 			return END_OF_FILE;
3435 		}
3436 
3437 		yypop_buffer_state(scanner->scanner);
3438     	scanner->stream = anjuta_token_stream_pop (scanner->stream);
3439 
3440 		if (scanner->stream == NULL)
3441 		{
3442 			yyterminate();
3443 		}
3444 		else
3445 		{
3446 			scanner->eof = anjuta_token_stream_get_current_file (scanner->stream) != NULL;
3447 
3448 			/* Continue parsing the parent file */
3449 			return 1;
3450 		}
3451 	}
3452 }
3453 
3454 
3455 /* Parser functions
3456  *---------------------------------------------------------------------------*/
3457 
3458 void
amp_am_yyerror(YYLTYPE * loc,AmpAmScanner * scanner,char const * s)3459 amp_am_yyerror (YYLTYPE *loc, AmpAmScanner *scanner, char const *s)
3460 {
3461     AnjutaTokenFileLocation location;
3462 
3463     if (amp_project_get_token_location (scanner->project, &location, *loc))
3464     {
3465         g_message ("%s:%d.%d %s\n", location.filename, location.line, location.column, s);
3466         g_free (location.filename);
3467     }
3468     else
3469     {
3470         g_message ("%s \n", s);
3471     }
3472 }
3473 
3474 void
amp_am_scanner_set_am_variable(AmpAmScanner * scanner,AnjutaToken * variable)3475 amp_am_scanner_set_am_variable (AmpAmScanner *scanner, AnjutaToken *variable)
3476 {
3477 	if (!scanner->expansion)
3478 	{
3479 		/* Keep variable token to expand them at the end */
3480 		scanner->am_variables = g_list_prepend (scanner->am_variables, variable);
3481 	}
3482 	else
3483 	{
3484 	    amp_project_set_am_variable (scanner->project, scanner->group, variable, scanner->orphan_properties);
3485 	}
3486 }
3487 
3488 void
amp_am_scanner_include(AmpAmScanner * scanner,AnjutaToken * list)3489 amp_am_scanner_include (AmpAmScanner *scanner, AnjutaToken *list)
3490 {
3491 	GFile *file;
3492 	AnjutaTokenFile *include;
3493 	AnjutaToken *token;
3494 	AnjutaToken *name;
3495 	gchar *filename;
3496 	AnjutaProjectNode *source;
3497 
3498 	name = anjuta_token_first_item (list);
3499 	name = anjuta_token_next_item (name);
3500 	filename = g_strstrip (anjuta_token_evaluate (name));
3501 	//g_message ("read include =%s=", filename);
3502 	file = g_file_resolve_relative_path (anjuta_token_stream_get_current_directory (scanner->stream), filename);
3503 	g_free (filename);
3504 	source = amp_source_node_new (file, ANJUTA_PROJECT_PROJECT | ANJUTA_PROJECT_FRAME | ANJUTA_PROJECT_READ_ONLY);
3505 	anjuta_project_node_append (ANJUTA_PROJECT_NODE (scanner->group), source);
3506 	include = anjuta_token_file_new (file);
3507 	token = anjuta_token_file_load (include, NULL);
3508 	amp_am_scanner_parse_token (scanner, list, token, file, NULL);
3509 	g_object_unref (file);
3510 }
3511 
3512 void
amp_am_scanner_update_variable(AmpAmScanner * scanner,AnjutaToken * variable)3513 amp_am_scanner_update_variable (AmpAmScanner *scanner, AnjutaToken *variable)
3514 {
3515 	if (scanner->expansion == FALSE) scanner->variables = g_list_prepend (scanner->variables, variable);
3516     amp_group_node_update_variable (scanner->group, variable);
3517 }
3518 
3519 
3520 void
amp_am_scanner_parse_variable(AmpAmScanner * scanner,AnjutaToken * variable)3521 amp_am_scanner_parse_variable (AmpAmScanner *scanner, AnjutaToken *variable)
3522 {
3523 	guint length;
3524 	gchar *string;
3525 	const gchar *name;
3526 	AnjutaToken *value;
3527 
3528 	anjuta_token_set_type (variable, ANJUTA_TOKEN_VARIABLE);
3529 
3530 	string = anjuta_token_evaluate(variable);
3531 	length = strlen (string);
3532 	if (string[1] == '(')
3533 	{
3534 		string[length - 1] = '\0';
3535 		name = string + 2;
3536 	}
3537 	else
3538 	{
3539 		string[2] = '\0';
3540 		name = string + 1;
3541 	}
3542 	value = amp_group_node_get_variable_token (scanner->group, name);
3543 	if (value == NULL)
3544 	{
3545 		value = amp_project_get_subst_variable_token (scanner->project, name);
3546 	}
3547 
3548 	if (amp_am_scanner_parse_token (scanner, variable, value, NULL, NULL) == NULL)
3549 	{
3550 		/* Recursive variable, display a warning */
3551 		g_warning ("Recursive variable %s. Discard value", name);
3552 	}
3553 	g_free (string);
3554 }
3555 
3556 void
amp_am_scanner_parse_ac_variable(AmpAmScanner * scanner,AnjutaToken * variable)3557 amp_am_scanner_parse_ac_variable (AmpAmScanner *scanner, AnjutaToken *variable)
3558 {
3559 	guint length;
3560 	gchar *string;
3561 	const gchar *name;
3562 	AnjutaToken *value;
3563 
3564 	anjuta_token_set_type (variable, ANJUTA_TOKEN_VARIABLE);
3565 
3566 	string = anjuta_token_evaluate(variable);
3567 	length = strlen (string);
3568 	/* Remove @ surrounding the variable name */
3569 	name = string + 1;
3570 	string[length - 1] = '\0';
3571 	value = amp_project_get_subst_variable_token (scanner->project, name);
3572 	g_free (string);
3573 
3574 	if (value != NULL)
3575 	{
3576 		amp_am_scanner_parse_token (scanner, variable, value, NULL, NULL);
3577 	}
3578 }
3579 
3580 
3581 /* Public functions
3582  *---------------------------------------------------------------------------*/
3583 
3584 AnjutaToken *
amp_am_scanner_parse_token(AmpAmScanner * scanner,AnjutaToken * root,AnjutaToken * content,GFile * filename,GError ** error)3585 amp_am_scanner_parse_token (AmpAmScanner *scanner, AnjutaToken *root, AnjutaToken *content, GFile *filename, GError **error)
3586 {
3587     AnjutaToken *first;
3588     AnjutaTokenStream *stream;
3589 
3590     stream = anjuta_token_stream_push (scanner->stream, root, content, filename);
3591 	if (stream == NULL) return NULL;
3592 
3593     first = anjuta_token_stream_get_root (stream);
3594 
3595 	scanner->eof = filename != NULL;
3596 
3597     if (scanner->stream != NULL)
3598     {
3599         /* Parse an included file or a expanded variable */
3600 
3601         scanner->stream = stream;
3602         yypush_buffer_state(yy_create_buffer(NULL, YY_BUF_SIZE, scanner->scanner), scanner->scanner);
3603     }
3604     else
3605     {
3606         amp_am_yypstate *ps;
3607         gint status;
3608 
3609         scanner->stream = stream;
3610         ps = amp_am_yypstate_new ();
3611         do
3612         {
3613             YYSTYPE yylval_param;
3614             YYLTYPE yylloc_param;
3615             gint yychar = am_yylex (&yylval_param, &yylloc_param, scanner->scanner);
3616 
3617 			yylloc_param = yylval_param;
3618             status = amp_am_yypush_parse (ps, yychar, &yylval_param, &yylloc_param, scanner);
3619 
3620         } while (status == YYPUSH_MORE);
3621         amp_am_yypstate_delete (ps);
3622 
3623 		/* Evaluate autotools variable and needed variables at the end */
3624 		if (scanner->expansion == FALSE)
3625 		{
3626 			GHashTable *variable_dependencies;
3627 			GList *variables;
3628 			GList *var;
3629 			guint evaluated;
3630 
3631 			variable_dependencies =amp_am_scanner_compute_dependencies (scanner);
3632 			variables = g_hash_table_get_values (variable_dependencies);
3633 
3634 			/* Reevaluate variable having dependencies */
3635 			scanner->expansion = TRUE;
3636 			do
3637 			{
3638 				evaluated = 0;
3639 				for (var =variables; var != NULL;)
3640 				{
3641 					AmpVariableDepend *depend = (AmpVariableDepend *)var->data;
3642 					GList *next;
3643 
3644 					next = g_list_next (var);
3645 					if (depend->depend == NULL)
3646 					{
3647 						/* No need to reevaluate */
3648 						variables = g_list_delete_link (variables, var);
3649 					}
3650 					else
3651 					{
3652 						/* Check that all dependencies are evaluated */
3653 						GList*list;
3654 						gboolean missing = FALSE;
3655 
3656 						for (list = g_list_first (depend->depend); list != NULL; list = g_list_next (list))
3657 						{
3658 							if (((AmpVariableDepend *)list->data)->evaluated == FALSE)
3659 							{
3660 								missing = TRUE;
3661 								break;
3662 							}
3663 						}
3664 						if (missing == FALSE)
3665 						{
3666 							for (list = g_list_first (depend->token); list != NULL; list = g_list_next (list))
3667 							{
3668 								amp_am_scanner_reparse_token (scanner, (AnjutaToken *)list->data, filename);
3669 							}
3670 							variables = g_list_delete_link (variables, var);
3671 							depend->evaluated = TRUE;
3672 							evaluated++;
3673 						}
3674 					}
3675 					var = next;
3676 				}
3677 			}
3678 			while (evaluated);
3679 
3680 			/* The remaining variables have dependencies loop, evaluate them in order */
3681 			if (variables != NULL) DEBUG_PRINT ("Dependencies loop in variables");
3682 			for (var =variables; var != NULL; var = g_list_next (var))
3683 			{
3684 				AmpVariableDepend *depend = (AmpVariableDepend *)var->data;
3685 				GList *list;
3686 
3687 				for (list = g_list_first (depend->token); list != NULL; list = g_list_next (list))
3688 				{
3689 					amp_am_scanner_reparse_token (scanner, (AnjutaToken *)list->data, filename);
3690 				}
3691 			}
3692 			g_list_free (variables);
3693 			g_hash_table_destroy (variable_dependencies);
3694 
3695 			/* Evaluate autotools variables */
3696 			scanner->am_variables = g_list_reverse (scanner->am_variables);
3697 			for (var = g_list_first (scanner->am_variables); var != NULL; var = g_list_next (var))
3698 			{
3699 				AnjutaToken *token = (AnjutaToken *)var->data;
3700 
3701 				amp_am_scanner_reparse_token (scanner, token, filename);
3702 			}
3703 		}
3704     }
3705 
3706     return first;
3707 }
3708 
3709 /* Constructor & Destructor
3710  *---------------------------------------------------------------------------*/
3711 
3712 AmpAmScanner *
amp_am_scanner_new(AmpProject * project,AmpGroupNode * group)3713 amp_am_scanner_new (AmpProject *project, AmpGroupNode *group)
3714 {
3715 	AmpAmScanner *scanner;
3716 
3717 	scanner = g_new0 (AmpAmScanner, 1);
3718 
3719 	scanner->project = project;
3720 	scanner->group = group;
3721 	scanner->eof = FALSE;
3722 
3723 	/* Create hash table for sources list */
3724 	scanner->orphan_properties = g_hash_table_new_full (g_str_hash, g_str_equal, (GDestroyNotify)g_free, (GDestroyNotify)amp_target_node_free);
3725 
3726 	/* Create hash table for variable */
3727 	scanner->am_variables = NULL;
3728 	scanner->expansion = FALSE;
3729 
3730 	/* Create list of variable */
3731 	scanner->variables = NULL;
3732 
3733     yylex_init(&scanner->scanner);
3734     yyset_extra (scanner, scanner->scanner);
3735 
3736 	return scanner;
3737 }
3738 
3739 void
amp_am_scanner_free(AmpAmScanner * scanner)3740 amp_am_scanner_free (AmpAmScanner *scanner)
3741 {
3742 	g_return_if_fail (scanner != NULL);
3743 
3744     yylex_destroy(scanner->scanner);
3745 
3746 	/* Free unused sources files */
3747 	g_hash_table_destroy (scanner->orphan_properties);
3748 
3749 	g_list_free (scanner->am_variables);
3750 
3751 	g_list_free (scanner->variables);
3752 
3753 	g_free (scanner);
3754 }
3755 
3756