FYI: Reply from HP-UX
[git/dscho.git] / flex-2.5.33 / flex.skl
blob683ead6eb9e6edd8696fab9c00cb40514665fd6f
1 %# -*-C-*- vi: set ft=c:
2 %# This file is processed in several stages.
3 %# Here are the stages, as best as I can describe:
4 %#
5 %#   1. flex.skl is processed through GNU m4 during the
6 %#      pre-compilation stage of flex. Only macros starting
7 %#      with `m4preproc_' are processed, and quoting is normal.
8 %#
9 %#   2. The preprocessed skeleton is translated verbatim into a
10 %#      C array, saved as "skel.c" and compiled into the flex binary.
12 %#   3. At runtime, the skeleton is generated and filtered (again)
13 %#      through m4. Macros beginning with `m4_' will be processed.
14 %#      The quoting is "[[" and "]]" so we don't interfere with
15 %#      user code.
16 %# 
17 %# All generate macros for the m4 stage contain the text "m4" or "M4"
18 %# in them. This is to distinguish them from CPP macros.
19 %# The exception to this rule is YY_G, which is an m4 macro, 
20 %# but it needs to be remain short because it is used everywhere.
22 /* A lexical scanner generated by flex */
24 %#  Macros for preproc stage.
25 m4preproc_changecom
27 %# Macros for runtime processing stage.
28 m4_changecom
29 m4_changequote
30 m4_changequote([[, ]])
32 %# 
33 %# Lines in this skeleton starting with a "%" character are "control lines"
34 %# and affect the generation of the scanner. The possible control codes are
35 %# listed and processed in misc.c.
37 %#   %#  -  A comment. The current line is omitted from the generated scanner.
38 %#   %if-c++-only  -  The following lines are printed for C++ scanners ONLY.
39 %#   %if-c-only    -  The following lines are NOT printed for C++ scanners.
40 %#   %if-c-or-c++  -  The following lines are printed in BOTH C and C++ scanners.
41 %#   %if-reentrant     - Print for reentrant scanners.(push)
42 %#   %if-not-reentrant - Print for non-reentrant scanners. (push)
43 %#   %if-bison-bridge  - Print for bison-bridge. (push)
44 %#   %if-not-bison-bridge  - Print for non-bison-bridge. (push)
45 %#   %endif        - pop from the previous if code.
46 %#   %%  -  A stop-point, where code is inserted by flex.
47 %#          Each stop-point is numbered here and also in the code generator.
48 %#          (See gen.c, etc. for details.)
49 %#   %not-for-header  -  Begin code that should NOT appear in a ".h" file.
50 %#   %ok-for-header   -  %c and %e are used for building a header file.
51 %#   %if-tables-serialization
53 %#   All control-lines EXCEPT comment lines ("%#") will be inserted into
54 %#   the generated scanner as a C-style comment. This is to aid those who
55 %#   edit the skeleton.
57 #define FLEX_SCANNER
58 #define YY_FLEX_MAJOR_VERSION FLEX_MAJOR_VERSION
59 #define YY_FLEX_MINOR_VERSION FLEX_MINOR_VERSION
60 #define YY_FLEX_SUBMINOR_VERSION FLEX_SUBMINOR_VERSION
61 #if YY_FLEX_SUBMINOR_VERSION > 0
62 #define FLEX_BETA
63 #endif
65 %# Some negated symbols
66 m4_ifdef( [[M4_YY_IN_HEADER]], , [[m4_define([[M4_YY_NOT_IN_HEADER]], [[]])]])
67 m4_ifdef( [[M4_YY_REENTRANT]], , [[m4_define([[M4_YY_NOT_REENTRANT]], [[]])]])
69 %# This is the m4 way to say "(stack_used || is_reentrant)
70 m4_ifdef( [[M4_YY_STACK_USED]], [[m4_define([[M4_YY_HAS_START_STACK_VARS]])]])
71 m4_ifdef( [[M4_YY_REENTRANT]],  [[m4_define([[M4_YY_HAS_START_STACK_VARS]])]])
73 %# Prefixes.
74 %# The complexity here is necessary so that m4 preserves
75 %# the argument lists to each C function.
78 m4_ifdef( [[M4_YY_PREFIX]],, [[m4_define([[M4_YY_PREFIX]], [[yy]])]])
80 m4preproc_define(`M4_GEN_PREFIX',
81     ``m4_define(yy[[$1]], [[M4_YY_PREFIX[[$1]]m4_ifelse($'`#,0,,[[($'`@)]])]])'')
83 %if-c++-only
84     /* The c++ scanner is a mess. The FlexLexer.h header file relies on the
85      * following macro. This is required in order to pass the c++-multiple-scanners
86      * test in the regression suite. We get reports that it breaks inheritance.
87      * We will address this in a future release of flex, or omit the C++ scanner
88      * altogether.
89      */
90     #define yyFlexLexer M4_YY_PREFIX[[FlexLexer]]
91 %endif
93 %if-c-only
94     M4_GEN_PREFIX(`_create_buffer')
95     M4_GEN_PREFIX(`_delete_buffer')
96     M4_GEN_PREFIX(`_scan_buffer')
97     M4_GEN_PREFIX(`_scan_string')
98     M4_GEN_PREFIX(`_scan_bytes')
99     M4_GEN_PREFIX(`_init_buffer')
100     M4_GEN_PREFIX(`_flush_buffer')
101     M4_GEN_PREFIX(`_load_buffer_state')
102     M4_GEN_PREFIX(`_switch_to_buffer')
103     M4_GEN_PREFIX(`push_buffer_state')
104     M4_GEN_PREFIX(`pop_buffer_state')
105     M4_GEN_PREFIX(`ensure_buffer_stack')
106     M4_GEN_PREFIX(`lex')
107     M4_GEN_PREFIX(`restart')
108     M4_GEN_PREFIX(`lex_init')
109     M4_GEN_PREFIX(`lex_destroy')
110     M4_GEN_PREFIX(`get_debug')
111     M4_GEN_PREFIX(`set_debug')
112     M4_GEN_PREFIX(`get_extra')
113     M4_GEN_PREFIX(`set_extra')
114     M4_GEN_PREFIX(`get_in')
115     M4_GEN_PREFIX(`set_in')
116     M4_GEN_PREFIX(`get_out')
117     M4_GEN_PREFIX(`set_out')
118     M4_GEN_PREFIX(`get_leng')
119     M4_GEN_PREFIX(`get_text')
120     M4_GEN_PREFIX(`get_lineno')
121     M4_GEN_PREFIX(`set_lineno')
122     m4_ifdef( [[M4_YY_REENTRANT]],
123     [[
124         M4_GEN_PREFIX(`get_column')
125         M4_GEN_PREFIX(`set_column')
126     ]])
127     M4_GEN_PREFIX(`wrap')
128 %endif
130 m4_ifdef( [[M4_YY_BISON_LVAL]],
132     M4_GEN_PREFIX(`get_lval')
133     M4_GEN_PREFIX(`set_lval')
136 m4_ifdef( [[<M4_YY_BISON_LLOC>]],
138     M4_GEN_PREFIX(`get_lloc')
139     M4_GEN_PREFIX(`set_lloc')
143     M4_GEN_PREFIX(`alloc')
144     M4_GEN_PREFIX(`realloc')
145     M4_GEN_PREFIX(`free')
147 %if-c-only
148 m4_ifdef( [[M4_YY_NOT_REENTRANT]],
150     M4_GEN_PREFIX(`text')
151     M4_GEN_PREFIX(`leng')
152     M4_GEN_PREFIX(`in')
153     M4_GEN_PREFIX(`out')
154     M4_GEN_PREFIX(`_flex_debug')
155     M4_GEN_PREFIX(`lineno')
157 %endif
160 m4_ifdef( [[M4_YY_TABLES_EXTERNAL]],
162     M4_GEN_PREFIX(`tables_fload')
163     M4_GEN_PREFIX(`tables_destroy')
164     M4_GEN_PREFIX(`TABLES_NAME')
167 /* First, we deal with  platform-specific or compiler-specific issues. */
169 /* begin standard C headers. */
170 %if-c-only
171 #include <stdio.h>
172 #include <string.h>
173 #include <errno.h>
174 #include <stdlib.h>
175 %endif
177 %if-tables-serialization
178 #include <sys/types.h>
179 #include <netinet/in.h>
180 %endif
181 /* end standard C headers. */
183 %if-c-or-c++
184 m4preproc_include(`flexint.h')
185 %endif
187 %if-c++-only
188 /* begin standard C++ headers. */
189 #include <iostream> 
190 #include <errno.h>
191 #include <cstdlib>
192 #include <cstring>
193 /* end standard C++ headers. */
194 %endif
196 #ifdef __cplusplus
198 /* The "const" storage-class-modifier is valid. */
199 #define YY_USE_CONST
201 #else   /* ! __cplusplus */
203 #if __STDC__
205 #define YY_USE_CONST
207 #endif  /* __STDC__ */
208 #endif  /* ! __cplusplus */
210 #ifdef YY_USE_CONST
211 #define yyconst const
212 #else
213 #define yyconst
214 #endif
216 %# For compilers that can not handle prototypes.
217 %# e.g.,
218 %# The function prototype
219 %#    int foo(int x, char* y);
220 %# 
221 %# ...should be written as
222 %#    int foo M4_YY_PARAMS(int x, char* y);
223 %# 
224 %# ...which could possibly generate
225 %#    int foo ();
226 %# 
227 m4_ifdef( [[M4_YY_NO_ANSI_FUNC_PROTOS]],
229     m4_define( [[M4_YY_PARAMS]], [[()]])
232     m4_define( [[M4_YY_PARAMS]], [[($*)]])
235 %not-for-header
236 /* Returned upon end-of-file. */
237 #define YY_NULL 0
238 %ok-for-header
240 %not-for-header
241 /* Promotes a possibly negative, possibly signed char to an unsigned
242  * integer for use as an array index.  If the signed char is negative,
243  * we want to instead treat it as an 8-bit unsigned char, hence the
244  * double cast.
245  */
246 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
247 %ok-for-header
251 %if-reentrant
253 /* An opaque pointer. */
254 #ifndef YY_TYPEDEF_YY_SCANNER_T
255 #define YY_TYPEDEF_YY_SCANNER_T
256 typedef void* yyscan_t;
257 #endif
259 %# Declare yyguts variable
260 m4_define( [[M4_YY_DECL_GUTS_VAR]], [[struct yyguts_t * yyg = (struct yyguts_t*)yyscanner]])
261 %# For use wherever a Global is accessed or assigned.
262 m4_define( [[YY_G]], [[yyg->$1]])
264 %# For use in function prototypes to append the additional argument.
265 m4_define( [[M4_YY_PROTO_LAST_ARG]],  [[, yyscan_t yyscanner]])
266 m4_define( [[M4_YY_PROTO_ONLY_ARG]],  [[yyscan_t yyscanner]])
268 %# For use in function definitions to append the additional argument.
269 m4_ifdef( [[M4_YY_NO_ANSI_FUNC_DEFS]],
271     m4_define( [[M4_YY_DEF_LAST_ARG]], [[, yyscanner]])
272     m4_define( [[M4_YY_DEF_ONLY_ARG]], [[yyscanner]])
275     m4_define( [[M4_YY_DEF_LAST_ARG]],  [[, yyscan_t yyscanner]])
276     m4_define( [[M4_YY_DEF_ONLY_ARG]],  [[yyscan_t yyscanner]])
278 m4_define( [[M4_YY_DECL_LAST_ARG]],  [[yyscan_t yyscanner;]])
280 %# For use in function calls to pass the additional argument.
281 m4_define( [[M4_YY_CALL_LAST_ARG]], [[, yyscanner]])
282 m4_define( [[M4_YY_CALL_ONLY_ARG]], [[yyscanner]])
284 %# For use in function documentation to adjust for additional argument.
285 m4_define( [[M4_YY_DOC_PARAM]], [[@param yyscanner The scanner object.]])
287 /* For convenience, these vars (plus the bison vars far below)
288    are macros in the reentrant scanner. */
289 #define yyin YY_G(yyin_r)
290 #define yyout YY_G(yyout_r)
291 #define yyextra YY_G(yyextra_r)
292 #define yyleng YY_G(yyleng_r)
293 #define yytext YY_G(yytext_r)
294 #define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)
295 #define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
296 #define yy_flex_debug YY_G(yy_flex_debug_r)
298 m4_define( [[M4_YY_INCR_LINENO]],
299 [[   
300     do{ yylineno++;
301         yycolumn=0;
302     }while(0)
305 int yylex_init M4_YY_PARAMS(yyscan_t* scanner);
306 %endif
310 %if-not-reentrant
312 m4_define( [[M4_YY_INCR_LINENO]],
313 [[   
314     yylineno++;
317 %# Define these macros to be no-ops.
318 m4_define( [[M4_YY_DECL_GUTS_VAR]], [[m4_dnl]])
319 m4_define( [[YY_G]], [[($1)]])
320 m4_define( [[M4_YY_PROTO_LAST_ARG]])
321 m4_define( [[M4_YY_PROTO_ONLY_ARG]],  [[void]])
322 m4_define( [[M4_YY_DEF_LAST_ARG]])
324 m4_ifdef( [[M4_YY_NO_ANSI_FUNC_DEFS]],
326     m4_define( [[M4_YY_DEF_ONLY_ARG]])
329     m4_define( [[M4_YY_DEF_ONLY_ARG]],  [[void]])
331 m4_define([[M4_YY_DECL_LAST_ARG]])
332 m4_define([[M4_YY_CALL_LAST_ARG]])
333 m4_define([[M4_YY_CALL_ONLY_ARG]])
334 m4_define( [[M4_YY_DOC_PARAM]], [[]])
336 %endif
339 m4_ifdef( [[M4_YY_NO_ANSI_FUNC_DEFS]],
341 %# For compilers that need traditional function definitions.
342 %# e.g.,
343 %# The function prototype taking 2 arguments
344 %#    int foo (int x, char* y)
346 %# ...should be written as
347 %#    int foo YYFARGS2(int,x, char*,y)
349 %# ...which could possibly generate
350 %#    int foo (x,y,yyscanner)
351 %#        int x;
352 %#        char * y;
353 %#        yyscan_t yyscanner;
355 %# Generate traditional function defs
356     m4_define( [[YYFARGS0]], [[(M4_YY_DEF_ONLY_ARG) [[\]]
357         M4_YY_DECL_LAST_ARG]])
358     m4_define( [[YYFARGS1]], [[($2 M4_YY_DEF_LAST_ARG) [[\]]
359         $1 $2; [[\]]
360         M4_YY_DECL_LAST_ARG]])
361     m4_define( [[YYFARGS2]], [[($2,$4 M4_YY_DEF_LAST_ARG) [[\]]
362         $1 $2; [[\]]
363         $3 $4; [[\]]
364         M4_YY_DECL_LAST_ARG]])
365     m4_define( [[YYFARGS3]], [[($2,$4,$6 M4_YY_DEF_LAST_ARG) [[\]]
366         $1 $2; [[\]]
367         $3 $4; [[\]]
368         $5 $6; [[\]]
369         M4_YY_DECL_LAST_ARG]])
372 %# Generate C99 function defs.
373     m4_define( [[YYFARGS0]], [[(M4_YY_DEF_ONLY_ARG)]])
374     m4_define( [[YYFARGS1]], [[($1 $2 M4_YY_DEF_LAST_ARG)]])
375     m4_define( [[YYFARGS2]], [[($1 $2, $3 $4 M4_YY_DEF_LAST_ARG)]])
376     m4_define( [[YYFARGS3]], [[($1 $2, $3 $4, $5 $6 M4_YY_DEF_LAST_ARG)]])
379 m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
381 /* Enter a start condition.  This macro really ought to take a parameter,
382  * but we do it the disgusting crufty way forced on us by the ()-less
383  * definition of BEGIN.
384  */
385 #define BEGIN YY_G(yy_start) = 1 + 2 *
388 m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
390 /* Translate the current start state into a value that can be later handed
391  * to BEGIN to return to the state.  The YYSTATE alias is for lex
392  * compatibility.
393  */
394 #define YY_START ((YY_G(yy_start) - 1) / 2)
395 #define YYSTATE YY_START
398 m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
400 /* Action number for EOF rule of a given start state. */
401 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
404 m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
406 /* Special action meaning "start processing a new file". */
407 #define YY_NEW_FILE yyrestart( yyin M4_YY_CALL_LAST_ARG )
410 m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
412 #define YY_END_OF_BUFFER_CHAR 0
415 m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
417 /* Size of default input buffer. */
418 #ifndef YY_BUF_SIZE
419 #define YY_BUF_SIZE 16384
420 #endif
422 /* The state buf must be large enough to hold one state per character in the main buffer.
423  */
424 #define YY_STATE_BUF_SIZE   ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
428 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
429 #define YY_TYPEDEF_YY_BUFFER_STATE
430 typedef struct yy_buffer_state *YY_BUFFER_STATE;
431 #endif
433 %if-not-reentrant
434 extern int yyleng;
435 %endif
437 %if-c-only
438 %if-not-reentrant
439 extern FILE *yyin, *yyout;
440 %endif
441 %endif
443 m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
445 #define EOB_ACT_CONTINUE_SCAN 0
446 #define EOB_ACT_END_OF_FILE 1
447 #define EOB_ACT_LAST_MATCH 2
450 m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
452     m4_ifdef( [[M4_YY_USE_LINENO]],
453     [[
454     /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires
455      *       access to the local variable yy_act. Since yyless() is a macro, it would break
456      *       existing scanners that call yyless() from OUTSIDE yylex. 
457      *       One obvious solution it to make yy_act a global. I tried that, and saw
458      *       a 5% performance hit in a non-yylineno scanner, because yy_act is
459      *       normally declared as a register variable-- so it is not worth it.
460      */
461     #define  YY_LESS_LINENO(n) \
462             do { \
463                 int yyl;\
464                 for ( yyl = n; yyl < yyleng; ++yyl )\
465                     if ( yytext[yyl] == '\n' )\
466                         --yylineno;\
467             }while(0)
468     ]],
469     [[
470     #define YY_LESS_LINENO(n)
471     ]])
474 m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
476 /* Return all but the first "n" matched characters back to the input stream. */
477 #define yyless(n) \
478         do \
479                 { \
480                 /* Undo effects of setting up yytext. */ \
481         int yyless_macro_arg = (n); \
482         YY_LESS_LINENO(yyless_macro_arg);\
483                 *yy_cp = YY_G(yy_hold_char); \
484                 YY_RESTORE_YY_MORE_OFFSET \
485                 YY_G(yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
486                 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
487                 } \
488         while ( 0 )
491 m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
493 #define unput(c) yyunput( c, YY_G(yytext_ptr) M4_YY_CALL_LAST_ARG )
496 /* The following is because we cannot portably get our hands on size_t
497  * (without autoconf's help, which isn't available because we want
498  * flex-generated scanners to compile on their own).
499  */
501 #ifndef YY_TYPEDEF_YY_SIZE_T
502 #define YY_TYPEDEF_YY_SIZE_T
503 typedef unsigned int yy_size_t;
504 #endif
506 #ifndef YY_STRUCT_YY_BUFFER_STATE
507 #define YY_STRUCT_YY_BUFFER_STATE
508 struct yy_buffer_state
509         {
510 %if-c-only
511         FILE *yy_input_file;
512 %endif
514 %if-c++-only
515         std::istream* yy_input_file;
516 %endif
519         char *yy_ch_buf;                /* input buffer */
520         char *yy_buf_pos;               /* current position in input buffer */
522         /* Size of input buffer in bytes, not including room for EOB
523          * characters.
524          */
525         yy_size_t yy_buf_size;
527         /* Number of characters read into yy_ch_buf, not including EOB
528          * characters.
529          */
530         int yy_n_chars;
532         /* Whether we "own" the buffer - i.e., we know we created it,
533          * and can realloc() it to grow it, and should free() it to
534          * delete it.
535          */
536         int yy_is_our_buffer;
538         /* Whether this is an "interactive" input source; if so, and
539          * if we're using stdio for input, then we want to use getc()
540          * instead of fread(), to make sure we stop fetching input after
541          * each newline.
542          */
543         int yy_is_interactive;
545         /* Whether we're considered to be at the beginning of a line.
546          * If so, '^' rules will be active on the next match, otherwise
547          * not.
548          */
549         int yy_at_bol;
551     int yy_bs_lineno; /**< The line count. */
552     int yy_bs_column; /**< The column count. */
553     
555         /* Whether to try to fill the input buffer when we reach the
556          * end of it.
557          */
558         int yy_fill_buffer;
560         int yy_buffer_status;
561 m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
563 #define YY_BUFFER_NEW 0
564 #define YY_BUFFER_NORMAL 1
565         /* When an EOF's been seen but there's still some text to process
566          * then we mark the buffer as YY_EOF_PENDING, to indicate that we
567          * shouldn't try reading from the input source any more.  We might
568          * still have a bunch of tokens to match, though, because of
569          * possible backing-up.
570          *
571          * When we actually see the EOF, we change the status to "new"
572          * (via yyrestart()), so that the user can continue scanning by
573          * just pointing yyin at a new input file.
574          */
575 #define YY_BUFFER_EOF_PENDING 2
577         };
578 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
580 %if-c-only Standard (non-C++) definition
581 %not-for-header
582 %if-not-reentrant
584 /* Stack of input buffers. */
585 static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
586 static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
587 static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
588 %endif
589 %ok-for-header
590 %endif
592 m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
594 /* We provide macros for accessing buffer states in case in the
595  * future we want to put the buffer states in a more general
596  * "scanner state".
598  * Returns the top of the stack, or NULL.
599  */
600 #define YY_CURRENT_BUFFER ( YY_G(yy_buffer_stack) \
601                           ? YY_G(yy_buffer_stack)[YY_G(yy_buffer_stack_top)] \
602                           : NULL)
605 m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
607 /* Same as previous macro, but useful when we know that the buffer stack is not
608  * NULL or when we need an lvalue. For internal use only.
609  */
610 #define YY_CURRENT_BUFFER_LVALUE YY_G(yy_buffer_stack)[YY_G(yy_buffer_stack_top)]
613 %if-c-only Standard (non-C++) definition
615 %if-not-reentrant
616 %not-for-header
617 /* yy_hold_char holds the character lost when yytext is formed. */
618 static char yy_hold_char;
619 static int yy_n_chars;          /* number of characters read into yy_ch_buf */
620 int yyleng;
622 /* Points to current character in buffer. */
623 static char *yy_c_buf_p = (char *) 0;
624 static int yy_init = 0;         /* whether we need to initialize */
625 static int yy_start = 0;        /* start state number */
627 /* Flag which is used to allow yywrap()'s to do buffer switches
628  * instead of setting up a fresh yyin.  A bit of a hack ...
629  */
630 static int yy_did_buffer_switch_on_eof;
631 %ok-for-header
632 %endif
634 void yyrestart M4_YY_PARAMS( FILE *input_file M4_YY_PROTO_LAST_ARG );
635 void yy_switch_to_buffer M4_YY_PARAMS( YY_BUFFER_STATE new_buffer M4_YY_PROTO_LAST_ARG );
636 YY_BUFFER_STATE yy_create_buffer M4_YY_PARAMS( FILE *file, int size M4_YY_PROTO_LAST_ARG );
637 void yy_delete_buffer M4_YY_PARAMS( YY_BUFFER_STATE b M4_YY_PROTO_LAST_ARG );
638 void yy_flush_buffer M4_YY_PARAMS( YY_BUFFER_STATE b M4_YY_PROTO_LAST_ARG );
639 void yypush_buffer_state M4_YY_PARAMS( YY_BUFFER_STATE new_buffer M4_YY_PROTO_LAST_ARG );
640 void yypop_buffer_state M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG );
642 m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
644 static void yyensure_buffer_stack M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG );
645 static void yy_load_buffer_state M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG );
646 static void yy_init_buffer M4_YY_PARAMS( YY_BUFFER_STATE b, FILE *file M4_YY_PROTO_LAST_ARG );
649 m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
651 #define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER M4_YY_CALL_LAST_ARG)
654 YY_BUFFER_STATE yy_scan_buffer M4_YY_PARAMS( char *base, yy_size_t size M4_YY_PROTO_LAST_ARG );
655 YY_BUFFER_STATE yy_scan_string M4_YY_PARAMS( yyconst char *yy_str M4_YY_PROTO_LAST_ARG );
656 YY_BUFFER_STATE yy_scan_bytes M4_YY_PARAMS( yyconst char *bytes, int len M4_YY_PROTO_LAST_ARG );
658 %endif
660 void *yyalloc M4_YY_PARAMS( yy_size_t M4_YY_PROTO_LAST_ARG );
661 void *yyrealloc M4_YY_PARAMS( void *, yy_size_t M4_YY_PROTO_LAST_ARG );
662 void yyfree M4_YY_PARAMS( void * M4_YY_PROTO_LAST_ARG );
664 m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
666 #define yy_new_buffer yy_create_buffer
669 m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
671 #define yy_set_interactive(is_interactive) \
672         { \
673         if ( ! YY_CURRENT_BUFFER ){ \
674         yyensure_buffer_stack (M4_YY_CALL_ONLY_ARG); \
675                 YY_CURRENT_BUFFER_LVALUE =    \
676             yy_create_buffer( yyin, YY_BUF_SIZE M4_YY_CALL_LAST_ARG); \
677         } \
678         YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
679         }
682 m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
684 #define yy_set_bol(at_bol) \
685         { \
686         if ( ! YY_CURRENT_BUFFER ){\
687         yyensure_buffer_stack (M4_YY_CALL_ONLY_ARG); \
688                 YY_CURRENT_BUFFER_LVALUE =    \
689             yy_create_buffer( yyin, YY_BUF_SIZE M4_YY_CALL_LAST_ARG); \
690         } \
691         YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
692         }
695 m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
697 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
700 %% [1.0] yytext/yyin/yyout/yy_state_type/yylineno etc. def's & init go here
702 %if-c-only Standard (non-C++) definition
704 m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
706 static yy_state_type yy_get_previous_state M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG );
707 static yy_state_type yy_try_NUL_trans M4_YY_PARAMS( yy_state_type current_state  M4_YY_PROTO_LAST_ARG);
708 static int yy_get_next_buffer M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG );
709 static void yy_fatal_error M4_YY_PARAMS( yyconst char msg[] M4_YY_PROTO_LAST_ARG );
712 %endif
714 m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
716 /* Done after the current pattern has been matched and before the
717  * corresponding action - sets up yytext.
718  */
719 #define YY_DO_BEFORE_ACTION \
720         YY_G(yytext_ptr) = yy_bp; \
721 %% [2.0] code to fiddle yytext and yyleng for yymore() goes here \
722         YY_G(yy_hold_char) = *yy_cp; \
723         *yy_cp = '\0'; \
724 %% [3.0] code to copy yytext_ptr to yytext[] goes here, if %array \
725         YY_G(yy_c_buf_p) = yy_cp;
728 m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
730 %% [4.0] data tables for the DFA and the user's section 1 definitions go here
733 m4_ifdef( [[M4_YY_IN_HEADER]], [[#ifdef YY_HEADER_EXPORT_START_CONDITIONS]])
734 M4_YY_SC_DEFS
735 m4_ifdef( [[M4_YY_IN_HEADER]], [[#endif]])
737 m4_ifdef( [[M4_YY_NO_UNISTD_H]],,
739 #ifndef YY_NO_UNISTD_H
740 /* Special case for "unistd.h", since it is non-ANSI. We include it way
741  * down here because we want the user's section 1 to have been scanned first.
742  * The user has a chance to override it with an option.
743  */
744 %if-c-only
745 #include <unistd.h>
746 %endif
747 %if-c++-only
748 #include <unistd.h>
749 %endif
750 #endif
753 #ifndef YY_EXTRA_TYPE
754 #define YY_EXTRA_TYPE void *
755 #endif
757 %if-c-only Reentrant structure and macros (non-C++).
758 %if-reentrant
760 m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
762 /* Holds the entire state of the reentrant scanner. */
763 struct yyguts_t
764     {
766     /* User-defined. Not touched by flex. */
767     YY_EXTRA_TYPE yyextra_r;
769     /* The rest are the same as the globals declared in the non-reentrant scanner. */
770     FILE *yyin_r, *yyout_r;
771     size_t yy_buffer_stack_top; /**< index of top of stack. */
772     size_t yy_buffer_stack_max; /**< capacity of stack. */
773     YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */
774     char yy_hold_char;
775     int yy_n_chars;
776     int yyleng_r;
777     char *yy_c_buf_p;
778     int yy_init;
779     int yy_start;
780     int yy_did_buffer_switch_on_eof;
781     int yy_start_stack_ptr;
782     int yy_start_stack_depth;
783     int *yy_start_stack;
784     yy_state_type yy_last_accepting_state;
785     char* yy_last_accepting_cpos;
787     int yylineno_r;
788     int yy_flex_debug_r;
790 m4_ifdef( [[M4_YY_USES_REJECT]],
792     yy_state_type *yy_state_buf;
793     yy_state_type *yy_state_ptr;
794     char *yy_full_match;
795     int yy_lp;
798 m4_ifdef( [[M4_YY_TEXT_IS_ARRAY]],
800     char yytext_r[YYLMAX];
801     char *yytext_ptr;
802     int yy_more_offset;
803     int yy_prev_more_offset;
806     char *yytext_r;
807     int yy_more_flag;
808     int yy_more_len;
811 m4_ifdef( [[M4_YY_BISON_LVAL]],
813     YYSTYPE * yylval_r;
816 m4_ifdef( [[<M4_YY_BISON_LLOC>]],
818     YYLTYPE * yylloc_r;
821     }; /* end struct yyguts_t */
825 %if-c-only
826 m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
828 static int yy_init_globals M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG );
830 %endif
832 %if-reentrant
834 m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
836     m4_ifdef( [[M4_YY_BISON_LVAL]],
837     [[
838     /* This must go here because YYSTYPE and YYLTYPE are included
839      * from bison output in section 1.*/
840     #    define yylval YY_G(yylval_r)
841     ]])
843     m4_ifdef( [[<M4_YY_BISON_LLOC>]],
844     [[
845     #    define yylloc YY_G(yylloc_r)
846     ]])
849 %endif
851 /* Accessor methods to globals.
852    These are made visible to non-reentrant scanners for convenience. */
854 m4_ifdef( [[M4_YY_NO_DESTROY]],,
856 int yylex_destroy M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG );
859 m4_ifdef( [[M4_YY_NO_GET_DEBUG]],,
861 int yyget_debug M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG );
864 m4_ifdef( [[M4_YY_NO_SET_DEBUG]],,
866 void yyset_debug M4_YY_PARAMS( int debug_flag M4_YY_PROTO_LAST_ARG );
869 m4_ifdef( [[M4_YY_NO_GET_EXTRA]],,
871 YY_EXTRA_TYPE yyget_extra M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG );
874 m4_ifdef( [[M4_YY_NO_SET_EXTRA]],,
876 void yyset_extra M4_YY_PARAMS( YY_EXTRA_TYPE user_defined M4_YY_PROTO_LAST_ARG );
879 m4_ifdef( [[M4_YY_NO_GET_IN]],,
881 FILE *yyget_in M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG );
884 m4_ifdef( [[M4_YY_NO_SET_IN]],,
886 void yyset_in  M4_YY_PARAMS( FILE * in_str M4_YY_PROTO_LAST_ARG );
889 m4_ifdef( [[M4_YY_NO_GET_OUT]],,
891 FILE *yyget_out M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG );
894 m4_ifdef( [[M4_YY_NO_SET_OUT]],,
896 void yyset_out  M4_YY_PARAMS( FILE * out_str M4_YY_PROTO_LAST_ARG );
899 m4_ifdef( [[M4_YY_NO_GET_LENG]],,
901 int yyget_leng M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG );
904 m4_ifdef( [[M4_YY_NO_GET_TEXT]],,
906 char *yyget_text M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG );
909 m4_ifdef( [[M4_YY_NO_GET_LINENO]],,
911 int yyget_lineno M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG );
914 m4_ifdef( [[M4_YY_NO_SET_LINENO]],,
916 void yyset_lineno M4_YY_PARAMS( int line_number M4_YY_PROTO_LAST_ARG );
919 %if-bison-bridge
920 m4_ifdef( [[M4_YY_NO_GET_LVAL]],,
922 YYSTYPE * yyget_lval M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG );
925 void yyset_lval M4_YY_PARAMS( YYSTYPE * yylval_param M4_YY_PROTO_LAST_ARG );
927 m4_ifdef( [[<M4_YY_BISON_LLOC>]],
929     m4_ifdef( [[M4_YY_NO_GET_LLOC]],,
930     [[
931        YYLTYPE *yyget_lloc M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG );
932     ]])
934     m4_ifdef( [[M4_YY_NO_SET_LLOC]],,
935     [[
936         void yyset_lloc M4_YY_PARAMS( YYLTYPE * yylloc_param M4_YY_PROTO_LAST_ARG );
937     ]])
939 %endif
940 %endif End reentrant structures and macros.
942 /* Macros after this point can all be overridden by user definitions in
943  * section 1.
944  */
946 #ifndef YY_SKIP_YYWRAP
947 #ifdef __cplusplus
948 extern "C" int yywrap M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG );
949 #else
950 extern int yywrap M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG );
951 #endif
952 #endif
954 %not-for-header
955     m4_ifdef( [[M4_YY_NO_UNPUT]],,
956     [[
957     static void yyunput M4_YY_PARAMS( int c, char *buf_ptr  M4_YY_PROTO_LAST_ARG);
958     ]])
959 %ok-for-header
960 %endif
962 #ifndef yytext_ptr
963 static void yy_flex_strncpy M4_YY_PARAMS( char *, yyconst char *, int M4_YY_PROTO_LAST_ARG);
964 #endif
966 #ifdef YY_NEED_STRLEN
967 static int yy_flex_strlen M4_YY_PARAMS( yyconst char * M4_YY_PROTO_LAST_ARG);
968 #endif
970 #ifndef YY_NO_INPUT
971 %if-c-only Standard (non-C++) definition
972 %not-for-header
973 #ifdef __cplusplus
974 static int yyinput M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG );
975 #else
976 static int input M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG );
977 #endif
978 %ok-for-header
979 %endif
980 #endif
983 %if-c-only
984 %# TODO: This is messy.
985 m4_ifdef( [[M4_YY_STACK_USED]],
988 m4_ifdef( [[M4_YY_NOT_REENTRANT]],
990     m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
991     [[
992         static int yy_start_stack_ptr = 0;
993         static int yy_start_stack_depth = 0;
994         static int *yy_start_stack = NULL;
995     ]])
998 m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
1000     m4_ifdef( [[M4_YY_NO_PUSH_STATE]],,
1001     [[
1002     static void yy_push_state M4_YY_PARAMS( int new_state M4_YY_PROTO_LAST_ARG);
1003     ]])
1004     m4_ifdef( [[M4_YY_NO_POP_STATE]],,
1005     [[
1006     static void yy_pop_state M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG );
1007     ]])
1008     m4_ifdef( [[M4_YY_NO_TOP_STATE]],,
1009     [[
1010     static int yy_top_state M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG );
1011     ]])
1016 m4_define( [[M4_YY_NO_PUSH_STATE]])
1017 m4_define( [[M4_YY_NO_POP_STATE]])
1018 m4_define( [[M4_YY_NO_TOP_STATE]])
1020 %endif
1022 /* Amount of stuff to slurp up with each read. */
1023 #ifndef YY_READ_BUF_SIZE
1024 #define YY_READ_BUF_SIZE 8192
1025 #endif
1027 m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
1029 /* Copy whatever the last rule matched to the standard output. */
1030 #ifndef ECHO
1031 %if-c-only Standard (non-C++) definition
1032 /* This used to be an fputs(), but since the string might contain NUL's,
1033  * we now use fwrite().
1034  */
1035 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
1036 %endif
1037 %if-c++-only C++ definition
1038 #define ECHO LexerOutput( yytext, yyleng )
1039 %endif
1040 #endif
1043 m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
1045 /* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
1046  * is returned in "result".
1047  */
1048 #ifndef YY_INPUT
1049 #define YY_INPUT(buf,result,max_size) \
1050 %% [5.0] fread()/read() definition of YY_INPUT goes here unless we're doing C++ \
1052 %if-c++-only C++ definition \
1053         if ( (result = LexerInput( (char *) buf, max_size )) < 0 ) \
1054                 YY_FATAL_ERROR( "input in flex scanner failed" );
1055 %endif
1057 #endif
1060 m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
1062 /* No semi-colon after return; correct usage is to write "yyterminate();" -
1063  * we don't want an extra ';' after the "return" because that will cause
1064  * some compilers to complain about unreachable statements.
1065  */
1066 #ifndef yyterminate
1067 #define yyterminate() return YY_NULL
1068 #endif
1071 /* Number of entries by which start-condition stack grows. */
1072 #ifndef YY_START_STACK_INCR
1073 #define YY_START_STACK_INCR 25
1074 #endif
1076 m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
1078 /* Report a fatal error. */
1079 #ifndef YY_FATAL_ERROR
1080 %if-c-only
1081 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg M4_YY_CALL_LAST_ARG)
1082 %endif
1083 %if-c++-only
1084 #define YY_FATAL_ERROR(msg) LexerError( msg )
1085 %endif
1086 #endif
1089 %if-tables-serialization structures and prototypes
1090 m4preproc_include(`tables_shared.h')
1092 /* Load the DFA tables from the given stream.  */
1093 int yytables_fload M4_YY_PARAMS(FILE * fp M4_YY_PROTO_LAST_ARG);
1095 /* Unload the tables from memory. */
1096 int yytables_destroy M4_YY_PARAMS(M4_YY_PROTO_ONLY_ARG);
1097 %not-for-header
1099 /** Describes a mapping from a serialized table id to its deserialized state in
1100  * this scanner.  This is the bridge between our "generic" deserialization code
1101  * and the specifics of this scanner. 
1102  */
1103 struct yytbl_dmap {
1104         enum yytbl_id dm_id;/**< table identifier */
1105         void  **dm_arr;         /**< address of pointer to store the deserialized table. */
1106         size_t  dm_sz;          /**< local sizeof() each element in table. */
1109 /** A {0,0,0}-terminated list of structs, forming the map */
1110 static struct yytbl_dmap yydmap[] =
1112 %tables-yydmap generated elements
1113     {0,0,0}
1116 /** A tables-reader object to maintain some state in the read. */
1117 struct yytbl_reader {
1118     FILE * fp; /**< input stream */
1119     flex_uint32_t bread; /**< bytes read since beginning of current tableset */
1122 %endif
1123 /* end tables serialization structures and prototypes */
1125 %ok-for-header
1127 /* Default declaration of generated scanner - a define so the user can
1128  * easily add parameters.
1129  */
1130 #ifndef YY_DECL
1131 #define YY_DECL_IS_OURS 1
1132 %if-c-only Standard (non-C++) definition
1135 m4_define( [[M4_YY_LEX_PROTO]], [[M4_YY_PARAMS(M4_YY_PROTO_ONLY_ARG)]])
1136 m4_define( [[M4_YY_LEX_DECLARATION]], [[YYFARGS0(void)]])
1138 m4_ifdef( [[M4_YY_BISON_LVAL]],
1140     m4_dnl  The bison pure parser is used. Redefine yylex to
1141     m4_dnl  accept the lval parameter.
1143     m4_define( [[M4_YY_LEX_PROTO]],
1144                [[M4_YY_PARAMS(YYSTYPE * yylval_param M4_YY_PROTO_LAST_ARG)]])
1145     m4_define( [[M4_YY_LEX_DECLARATION]],
1146                [[YYFARGS1(YYSTYPE *,yylval_param)]])
1149 m4_ifdef( [[<M4_YY_BISON_LLOC>]],
1151     m4_dnl  Locations are used. yylex should also accept the ylloc parameter.
1153     m4_define( [[M4_YY_LEX_PROTO]],
1154                [[M4_YY_PARAMS(YYSTYPE * yylval_param, YYLTYPE * yylloc_param M4_YY_PROTO_LAST_ARG)]])
1155     m4_define( [[M4_YY_LEX_DECLARATION]],
1156                [[YYFARGS2(YYSTYPE *,yylval_param, YYLTYPE *,yylloc_param)]])
1159 extern int yylex M4_YY_LEX_PROTO;
1161 #define YY_DECL int yylex M4_YY_LEX_DECLARATION
1162 %endif
1163 %if-c++-only C++ definition
1164 #define YY_DECL int yyFlexLexer::yylex()
1165 %endif
1166 #endif /* !YY_DECL */
1168 m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
1170 /* Code executed at the beginning of each rule, after yytext and yyleng
1171  * have been set up.
1172  */
1173 #ifndef YY_USER_ACTION
1174 #define YY_USER_ACTION
1175 #endif
1178 m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
1180 /* Code executed at the end of each rule. */
1181 #ifndef YY_BREAK
1182 #define YY_BREAK break;
1183 #endif
1186 m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
1188 %% [6.0] YY_RULE_SETUP definition goes here
1191 %not-for-header
1192 /** The main scanner function which does all the work.
1193  */
1194 YY_DECL
1196         register yy_state_type yy_current_state;
1197         register char *yy_cp, *yy_bp;
1198         register int yy_act;
1199     M4_YY_DECL_GUTS_VAR();
1201 m4_ifdef( [[M4_YY_NOT_REENTRANT]],
1203     m4_ifdef( [[M4_YY_BISON_LVAL]],
1204     [[
1205         YYSTYPE * yylval;
1206     ]])
1207     m4_ifdef( [[<M4_YY_BISON_LLOC>]],
1208     [[
1209         YYLTYPE * yylloc;
1210     ]])
1213 %% [7.0] user's declarations go here
1215 m4_ifdef( [[M4_YY_BISON_LVAL]],
1217     yylval = yylval_param;
1220 m4_ifdef( [[<M4_YY_BISON_LLOC>]],
1222     yylloc = yylloc_param;
1225         if ( !YY_G(yy_init) )
1226                 {
1227                 YY_G(yy_init) = 1;
1229 #ifdef YY_USER_INIT
1230                 YY_USER_INIT;
1231 #endif
1233 m4_ifdef( [[M4_YY_USES_REJECT]],
1235         /* Create the reject buffer large enough to save one state per allowed character. */
1236         if ( ! YY_G(yy_state_buf) )
1237             YY_G(yy_state_buf) = (yy_state_type *)yyalloc(YY_STATE_BUF_SIZE  M4_YY_CALL_LAST_ARG);
1240                 if ( ! YY_G(yy_start) )
1241                         YY_G(yy_start) = 1;     /* first start state */
1243                 if ( ! yyin )
1244 %if-c-only
1245                         yyin = stdin;
1246 %endif
1247 %if-c++-only
1248                         yyin = & std::cin;
1249 %endif
1251                 if ( ! yyout )
1252 %if-c-only
1253                         yyout = stdout;
1254 %endif
1255 %if-c++-only
1256                         yyout = & std::cout;
1257 %endif
1259                 if ( ! YY_CURRENT_BUFFER ) {
1260                         yyensure_buffer_stack (M4_YY_CALL_ONLY_ARG);
1261                         YY_CURRENT_BUFFER_LVALUE =
1262                                 yy_create_buffer( yyin, YY_BUF_SIZE M4_YY_CALL_LAST_ARG);
1263                 }
1265                 yy_load_buffer_state( M4_YY_CALL_ONLY_ARG );
1266                 }
1268         while ( 1 )             /* loops until end-of-file is reached */
1269                 {
1270 %% [8.0] yymore()-related code goes here
1271                 yy_cp = YY_G(yy_c_buf_p);
1273                 /* Support of yytext. */
1274                 *yy_cp = YY_G(yy_hold_char);
1276                 /* yy_bp points to the position in yy_ch_buf of the start of
1277                  * the current run.
1278                  */
1279                 yy_bp = yy_cp;
1281 %% [9.0] code to set up and find next match goes here
1283 yy_find_action:
1284 %% [10.0] code to find the action number goes here
1286                 YY_DO_BEFORE_ACTION;
1288 %% [11.0] code for yylineno update goes here
1290 do_action:      /* This label is used only to access EOF actions. */
1292 %% [12.0] debug code goes here
1294                 switch ( yy_act )
1295         { /* beginning of action switch */
1296 %% [13.0] actions go here
1298         case YY_END_OF_BUFFER:
1299                 {
1300                 /* Amount of text matched not including the EOB char. */
1301                 int yy_amount_of_matched_text = (int) (yy_cp - YY_G(yytext_ptr)) - 1;
1303                 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1304                 *yy_cp = YY_G(yy_hold_char);
1305                 YY_RESTORE_YY_MORE_OFFSET
1307                 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1308                         {
1309                         /* We're scanning a new file or input source.  It's
1310                          * possible that this happened because the user
1311                          * just pointed yyin at a new source and called
1312                          * yylex().  If so, then we have to assure
1313                          * consistency between YY_CURRENT_BUFFER and our
1314                          * globals.  Here is the right place to do so, because
1315                          * this is the first action (other than possibly a
1316                          * back-up) that will match for the new input source.
1317                          */
1318                         YY_G(yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1319                         YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
1320                         YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1321                         }
1323                 /* Note that here we test for yy_c_buf_p "<=" to the position
1324                  * of the first EOB in the buffer, since yy_c_buf_p will
1325                  * already have been incremented past the NUL character
1326                  * (since all states make transitions on EOB to the
1327                  * end-of-buffer state).  Contrast this with the test
1328                  * in input().
1329                  */
1330                 if ( YY_G(yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[YY_G(yy_n_chars)] )
1331                         { /* This was really a NUL. */
1332                         yy_state_type yy_next_state;
1334                         YY_G(yy_c_buf_p) = YY_G(yytext_ptr) + yy_amount_of_matched_text;
1336                         yy_current_state = yy_get_previous_state( M4_YY_CALL_ONLY_ARG );
1338                         /* Okay, we're now positioned to make the NUL
1339                          * transition.  We couldn't have
1340                          * yy_get_previous_state() go ahead and do it
1341                          * for us because it doesn't know how to deal
1342                          * with the possibility of jamming (and we don't
1343                          * want to build jamming into it because then it
1344                          * will run more slowly).
1345                          */
1347                         yy_next_state = yy_try_NUL_trans( yy_current_state M4_YY_CALL_LAST_ARG);
1349                         yy_bp = YY_G(yytext_ptr) + YY_MORE_ADJ;
1351                         if ( yy_next_state )
1352                                 {
1353                                 /* Consume the NUL. */
1354                                 yy_cp = ++YY_G(yy_c_buf_p);
1355                                 yy_current_state = yy_next_state;
1356                                 goto yy_match;
1357                                 }
1359                         else
1360                                 {
1361 %% [14.0] code to do back-up for compressed tables and set up yy_cp goes here
1362                                 goto yy_find_action;
1363                                 }
1364                         }
1366                 else switch ( yy_get_next_buffer( M4_YY_CALL_ONLY_ARG ) )
1367                         {
1368                         case EOB_ACT_END_OF_FILE:
1369                                 {
1370                                 YY_G(yy_did_buffer_switch_on_eof) = 0;
1372                                 if ( yywrap( M4_YY_CALL_ONLY_ARG ) )
1373                                         {
1374                                         /* Note: because we've taken care in
1375                                          * yy_get_next_buffer() to have set up
1376                                          * yytext, we can now set up
1377                                          * yy_c_buf_p so that if some total
1378                                          * hoser (like flex itself) wants to
1379                                          * call the scanner after we return the
1380                                          * YY_NULL, it'll still work - another
1381                                          * YY_NULL will get returned.
1382                                          */
1383                                         YY_G(yy_c_buf_p) = YY_G(yytext_ptr) + YY_MORE_ADJ;
1385                                         yy_act = YY_STATE_EOF(YY_START);
1386                                         goto do_action;
1387                                         }
1389                                 else
1390                                         {
1391                                         if ( ! YY_G(yy_did_buffer_switch_on_eof) )
1392                                                 YY_NEW_FILE;
1393                                         }
1394                                 break;
1395                                 }
1397                         case EOB_ACT_CONTINUE_SCAN:
1398                                 YY_G(yy_c_buf_p) =
1399                                         YY_G(yytext_ptr) + yy_amount_of_matched_text;
1401                                 yy_current_state = yy_get_previous_state( M4_YY_CALL_ONLY_ARG );
1403                                 yy_cp = YY_G(yy_c_buf_p);
1404                                 yy_bp = YY_G(yytext_ptr) + YY_MORE_ADJ;
1405                                 goto yy_match;
1407                         case EOB_ACT_LAST_MATCH:
1408                                 YY_G(yy_c_buf_p) =
1409                                 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[YY_G(yy_n_chars)];
1411                                 yy_current_state = yy_get_previous_state( M4_YY_CALL_ONLY_ARG );
1413                                 yy_cp = YY_G(yy_c_buf_p);
1414                                 yy_bp = YY_G(yytext_ptr) + YY_MORE_ADJ;
1415                                 goto yy_find_action;
1416                         }
1417                 break;
1418                 }
1420         default:
1421                 YY_FATAL_ERROR(
1422                         "fatal flex scanner internal error--no action found" );
1423         } /* end of action switch */
1424                 } /* end of scanning one token */
1425 } /* end of yylex */
1426 %ok-for-header
1428 %if-c++-only
1429 %not-for-header
1430 yyFlexLexer::yyFlexLexer( std::istream* arg_yyin, std::ostream* arg_yyout )
1432         yyin = arg_yyin;
1433         yyout = arg_yyout;
1434         yy_c_buf_p = 0;
1435         yy_init = 0;
1436         yy_start = 0;
1437         yy_flex_debug = 0;
1438         yylineno = 1;   // this will only get updated if %option yylineno
1440         yy_did_buffer_switch_on_eof = 0;
1442         yy_looking_for_trail_begin = 0;
1443         yy_more_flag = 0;
1444         yy_more_len = 0;
1445         yy_more_offset = yy_prev_more_offset = 0;
1447         yy_start_stack_ptr = yy_start_stack_depth = 0;
1448         yy_start_stack = NULL;
1450     YY_G(yy_buffer_stack) = 0;
1451     YY_G(yy_buffer_stack_top) = 0;
1452     YY_G(yy_buffer_stack_max) = 0;
1455 m4_ifdef( [[M4_YY_USES_REJECT]],
1457         yy_state_buf = new yy_state_type[YY_STATE_BUF_SIZE];
1460         yy_state_buf = 0;
1464 yyFlexLexer::~yyFlexLexer()
1466         delete [] yy_state_buf;
1467         yyfree( yy_start_stack M4_YY_CALL_LAST_ARG );
1468         yy_delete_buffer( YY_CURRENT_BUFFER M4_YY_CALL_LAST_ARG);
1471 void yyFlexLexer::switch_streams( std::istream* new_in, std::ostream* new_out )
1473         if ( new_in )
1474                 {
1475                 yy_delete_buffer( YY_CURRENT_BUFFER M4_YY_CALL_LAST_ARG);
1476                 yy_switch_to_buffer( yy_create_buffer( new_in, YY_BUF_SIZE  M4_YY_CALL_LAST_ARG) M4_YY_CALL_LAST_ARG);
1477                 }
1479         if ( new_out )
1480                 yyout = new_out;
1483 #ifdef YY_INTERACTIVE
1484 int yyFlexLexer::LexerInput( char* buf, int /* max_size */ )
1485 #else
1486 int yyFlexLexer::LexerInput( char* buf, int max_size )
1487 #endif
1489         if ( yyin->eof() || yyin->fail() )
1490                 return 0;
1492 #ifdef YY_INTERACTIVE
1493         yyin->get( buf[0] );
1495         if ( yyin->eof() )
1496                 return 0;
1498         if ( yyin->bad() )
1499                 return -1;
1501         return 1;
1503 #else
1504         (void) yyin->read( buf, max_size );
1506         if ( yyin->bad() )
1507                 return -1;
1508         else
1509                 return yyin->gcount();
1510 #endif
1513 void yyFlexLexer::LexerOutput( const char* buf, int size )
1515         (void) yyout->write( buf, size );
1517 %ok-for-header
1518 %endif
1520 m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
1522 /* yy_get_next_buffer - try to read in a new buffer
1524  * Returns a code representing an action:
1525  *      EOB_ACT_LAST_MATCH -
1526  *      EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1527  *      EOB_ACT_END_OF_FILE - end of file
1528  */
1529 %if-c-only
1530 static int yy_get_next_buffer YYFARGS0(void)
1531 %endif
1532 %if-c++-only
1533 int yyFlexLexer::yy_get_next_buffer()
1534 %endif
1536     M4_YY_DECL_GUTS_VAR();
1537         register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1538         register char *source = YY_G(yytext_ptr);
1539         register int number_to_move, i;
1540         int ret_val;
1542         if ( YY_G(yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[YY_G(yy_n_chars) + 1] )
1543                 YY_FATAL_ERROR(
1544                 "fatal flex scanner internal error--end of buffer missed" );
1546         if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1547                 { /* Don't try to fill the buffer, so this is an EOF. */
1548                 if ( YY_G(yy_c_buf_p) - YY_G(yytext_ptr) - YY_MORE_ADJ == 1 )
1549                         {
1550                         /* We matched a single character, the EOB, so
1551                          * treat this as a final EOF.
1552                          */
1553                         return EOB_ACT_END_OF_FILE;
1554                         }
1556                 else
1557                         {
1558                         /* We matched some text prior to the EOB, first
1559                          * process it.
1560                          */
1561                         return EOB_ACT_LAST_MATCH;
1562                         }
1563                 }
1565         /* Try to read more data. */
1567         /* First move last chars to start of buffer. */
1568         number_to_move = (int) (YY_G(yy_c_buf_p) - YY_G(yytext_ptr)) - 1;
1570         for ( i = 0; i < number_to_move; ++i )
1571                 *(dest++) = *(source++);
1573         if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1574                 /* don't do the read, it's not guaranteed to return an EOF,
1575                  * just force an EOF
1576                  */
1577                 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = YY_G(yy_n_chars) = 0;
1579         else
1580                 {
1581                         int num_to_read =
1582                         YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1584                 while ( num_to_read <= 0 )
1585                         { /* Not enough room in the buffer - grow it. */
1586 m4_ifdef( [[M4_YY_USES_REJECT]],
1588                         YY_FATAL_ERROR(
1589 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
1592                         /* just a shorter name for the current buffer */
1593                         YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
1595                         int yy_c_buf_p_offset =
1596                                 (int) (YY_G(yy_c_buf_p) - b->yy_ch_buf);
1598                         if ( b->yy_is_our_buffer )
1599                                 {
1600                                 int new_size = b->yy_buf_size * 2;
1602                                 if ( new_size <= 0 )
1603                                         b->yy_buf_size += b->yy_buf_size / 8;
1604                                 else
1605                                         b->yy_buf_size *= 2;
1607                                 b->yy_ch_buf = (char *)
1608                                         /* Include room in for 2 EOB chars. */
1609                                         yyrealloc( (void *) b->yy_ch_buf,
1610                                                          b->yy_buf_size + 2 M4_YY_CALL_LAST_ARG );
1611                                 }
1612                         else
1613                                 /* Can't grow it, we don't own it. */
1614                                 b->yy_ch_buf = 0;
1616                         if ( ! b->yy_ch_buf )
1617                                 YY_FATAL_ERROR(
1618                                 "fatal error - scanner input buffer overflow" );
1620                         YY_G(yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1622                         num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1623                                                 number_to_move - 1;
1625                         }
1627                 if ( num_to_read > YY_READ_BUF_SIZE )
1628                         num_to_read = YY_READ_BUF_SIZE;
1630                 /* Read in more data. */
1631                 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1632                         YY_G(yy_n_chars), num_to_read );
1634                 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = YY_G(yy_n_chars);
1635                 }
1637         if ( YY_G(yy_n_chars) == 0 )
1638                 {
1639                 if ( number_to_move == YY_MORE_ADJ )
1640                         {
1641                         ret_val = EOB_ACT_END_OF_FILE;
1642                         yyrestart( yyin  M4_YY_CALL_LAST_ARG);
1643                         }
1645                 else
1646                         {
1647                         ret_val = EOB_ACT_LAST_MATCH;
1648                         YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1649                                 YY_BUFFER_EOF_PENDING;
1650                         }
1651                 }
1653         else
1654                 ret_val = EOB_ACT_CONTINUE_SCAN;
1656         YY_G(yy_n_chars) += number_to_move;
1657         YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[YY_G(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1658         YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[YY_G(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
1660         YY_G(yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1662         return ret_val;
1666 /* yy_get_previous_state - get the state just before the EOB char was reached */
1668 %if-c-only
1669 %not-for-header
1670     static yy_state_type yy_get_previous_state YYFARGS0(void)
1671 %endif
1672 %if-c++-only
1673     yy_state_type yyFlexLexer::yy_get_previous_state()
1674 %endif
1676         register yy_state_type yy_current_state;
1677         register char *yy_cp;
1678     M4_YY_DECL_GUTS_VAR();
1680 %% [15.0] code to get the start state into yy_current_state goes here
1682         for ( yy_cp = YY_G(yytext_ptr) + YY_MORE_ADJ; yy_cp < YY_G(yy_c_buf_p); ++yy_cp )
1683                 {
1684 %% [16.0] code to find the next state goes here
1685                 }
1687         return yy_current_state;
1691 /* yy_try_NUL_trans - try to make a transition on the NUL character
1693  * synopsis
1694  *      next_state = yy_try_NUL_trans( current_state );
1695  */
1696 %if-c-only
1697     static yy_state_type yy_try_NUL_trans  YYFARGS1( yy_state_type, yy_current_state)
1698 %endif
1699 %if-c++-only
1700     yy_state_type yyFlexLexer::yy_try_NUL_trans( yy_state_type yy_current_state )
1701 %endif
1703         register int yy_is_jam;
1704     M4_YY_DECL_GUTS_VAR(); /* This var may be unused depending upon options. */
1705 %% [17.0] code to find the next state, and perhaps do backing up, goes here
1707         return yy_is_jam ? 0 : yy_current_state;
1711 %if-c-only
1712 m4_ifdef( [[M4_YY_NO_UNPUT]],,
1714     static void yyunput YYFARGS2( int,c, register char *,yy_bp)
1715 %endif
1716 %if-c++-only
1717     void yyFlexLexer::yyunput( int c, register char* yy_bp)
1718 %endif
1720         register char *yy_cp;
1721     M4_YY_DECL_GUTS_VAR();
1723     yy_cp = YY_G(yy_c_buf_p);
1725         /* undo effects of setting up yytext */
1726         *yy_cp = YY_G(yy_hold_char);
1728         if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1729                 { /* need to shift things up to make room */
1730                 /* +2 for EOB chars. */
1731                 register int number_to_move = YY_G(yy_n_chars) + 2;
1732                 register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
1733                                         YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
1734                 register char *source =
1735                                 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
1737                 while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1738                         *--dest = *--source;
1740                 yy_cp += (int) (dest - source);
1741                 yy_bp += (int) (dest - source);
1742                 YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
1743                         YY_G(yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
1745                 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1746                         YY_FATAL_ERROR( "flex scanner push-back overflow" );
1747                 }
1749         *--yy_cp = (char) c;
1751 %% [18.0] update yylineno here
1752 m4_ifdef( [[M4_YY_USE_LINENO]],
1754     if ( c == '\n' ){
1755         --yylineno;
1756     }
1759         YY_G(yytext_ptr) = yy_bp;
1760         YY_G(yy_hold_char) = *yy_cp;
1761         YY_G(yy_c_buf_p) = yy_cp;
1763 %if-c-only
1765 %endif
1767 %if-c-only
1768 #ifndef YY_NO_INPUT
1769 #ifdef __cplusplus
1770     static int yyinput YYFARGS0(void)
1771 #else
1772     static int input  YYFARGS0(void)
1773 #endif
1775 %endif
1776 %if-c++-only
1777     int yyFlexLexer::yyinput()
1778 %endif
1780         int c;
1781     M4_YY_DECL_GUTS_VAR();
1783         *YY_G(yy_c_buf_p) = YY_G(yy_hold_char);
1785         if ( *YY_G(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
1786                 {
1787                 /* yy_c_buf_p now points to the character we want to return.
1788                  * If this occurs *before* the EOB characters, then it's a
1789                  * valid NUL; if not, then we've hit the end of the buffer.
1790                  */
1791                 if ( YY_G(yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[YY_G(yy_n_chars)] )
1792                         /* This was really a NUL. */
1793                         *YY_G(yy_c_buf_p) = '\0';
1795                 else
1796                         { /* need more input */
1797                         int offset = YY_G(yy_c_buf_p) - YY_G(yytext_ptr);
1798                         ++YY_G(yy_c_buf_p);
1800                         switch ( yy_get_next_buffer( M4_YY_CALL_ONLY_ARG ) )
1801                                 {
1802                                 case EOB_ACT_LAST_MATCH:
1803                                         /* This happens because yy_g_n_b()
1804                                          * sees that we've accumulated a
1805                                          * token and flags that we need to
1806                                          * try matching the token before
1807                                          * proceeding.  But for input(),
1808                                          * there's no matching to consider.
1809                                          * So convert the EOB_ACT_LAST_MATCH
1810                                          * to EOB_ACT_END_OF_FILE.
1811                                          */
1813                                         /* Reset buffer status. */
1814                                         yyrestart( yyin M4_YY_CALL_LAST_ARG);
1816                                         /*FALLTHROUGH*/
1818                                 case EOB_ACT_END_OF_FILE:
1819                                         {
1820                                         if ( yywrap( M4_YY_CALL_ONLY_ARG ) )
1821                                                 return EOF;
1823                                         if ( ! YY_G(yy_did_buffer_switch_on_eof) )
1824                                                 YY_NEW_FILE;
1825 #ifdef __cplusplus
1826                                         return yyinput(M4_YY_CALL_ONLY_ARG);
1827 #else
1828                                         return input(M4_YY_CALL_ONLY_ARG);
1829 #endif
1830                                         }
1832                                 case EOB_ACT_CONTINUE_SCAN:
1833                                         YY_G(yy_c_buf_p) = YY_G(yytext_ptr) + offset;
1834                                         break;
1835                                 }
1836                         }
1837                 }
1839         c = *(unsigned char *) YY_G(yy_c_buf_p);        /* cast for 8-bit char's */
1840         *YY_G(yy_c_buf_p) = '\0';       /* preserve yytext */
1841         YY_G(yy_hold_char) = *++YY_G(yy_c_buf_p);
1843 %% [19.0] update BOL and yylineno
1845         return c;
1847 %if-c-only
1848 #endif  /* ifndef YY_NO_INPUT */
1849 %endif
1851 /** Immediately switch to a different input stream.
1852  * @param input_file A readable stream.
1853  * M4_YY_DOC_PARAM
1854  * @note This function does not reset the start condition to @c INITIAL .
1855  */
1856 %if-c-only
1857     void yyrestart  YYFARGS1( FILE *,input_file)
1858 %endif
1859 %if-c++-only
1860     void yyFlexLexer::yyrestart( std::istream* input_file )
1861 %endif
1863     M4_YY_DECL_GUTS_VAR();
1865         if ( ! YY_CURRENT_BUFFER ){
1866         yyensure_buffer_stack (M4_YY_CALL_ONLY_ARG);
1867                 YY_CURRENT_BUFFER_LVALUE =
1868             yy_create_buffer( yyin, YY_BUF_SIZE M4_YY_CALL_LAST_ARG);
1869         }
1871         yy_init_buffer( YY_CURRENT_BUFFER, input_file M4_YY_CALL_LAST_ARG);
1872         yy_load_buffer_state( M4_YY_CALL_ONLY_ARG );
1875 /** Switch to a different input buffer.
1876  * @param new_buffer The new input buffer.
1877  * M4_YY_DOC_PARAM
1878  */
1879 %if-c-only
1880     void yy_switch_to_buffer  YYFARGS1( YY_BUFFER_STATE ,new_buffer)
1881 %endif
1882 %if-c++-only
1883     void yyFlexLexer::yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
1884 %endif
1886     M4_YY_DECL_GUTS_VAR();
1888         /* TODO. We should be able to replace this entire function body
1889          * with
1890          *              yypop_buffer_state();
1891          *              yypush_buffer_state(new_buffer);
1892      */
1893         yyensure_buffer_stack (M4_YY_CALL_ONLY_ARG);
1894         if ( YY_CURRENT_BUFFER == new_buffer )
1895                 return;
1897         if ( YY_CURRENT_BUFFER )
1898                 {
1899                 /* Flush out information for old buffer. */
1900                 *YY_G(yy_c_buf_p) = YY_G(yy_hold_char);
1901                 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = YY_G(yy_c_buf_p);
1902                 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = YY_G(yy_n_chars);
1903                 }
1905         YY_CURRENT_BUFFER_LVALUE = new_buffer;
1906         yy_load_buffer_state( M4_YY_CALL_ONLY_ARG );
1908         /* We don't actually know whether we did this switch during
1909          * EOF (yywrap()) processing, but the only time this flag
1910          * is looked at is after yywrap() is called, so it's safe
1911          * to go ahead and always set it.
1912          */
1913         YY_G(yy_did_buffer_switch_on_eof) = 1;
1917 %if-c-only
1918 static void yy_load_buffer_state  YYFARGS0(void)
1919 %endif
1920 %if-c++-only
1921     void yyFlexLexer::yy_load_buffer_state()
1922 %endif
1924     M4_YY_DECL_GUTS_VAR();
1925         YY_G(yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1926         YY_G(yytext_ptr) = YY_G(yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1927         yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1928         YY_G(yy_hold_char) = *YY_G(yy_c_buf_p);
1931 /** Allocate and initialize an input buffer state.
1932  * @param file A readable stream.
1933  * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1934  * M4_YY_DOC_PARAM
1935  * @return the allocated buffer state.
1936  */
1937 %if-c-only
1938     YY_BUFFER_STATE yy_create_buffer  YYFARGS2( FILE *,file, int ,size)
1939 %endif
1940 %if-c++-only
1941     YY_BUFFER_STATE yyFlexLexer::yy_create_buffer( std::istream* file, int size )
1942 %endif
1944         YY_BUFFER_STATE b;
1945     m4_dnl M4_YY_DECL_GUTS_VAR();
1947         b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) M4_YY_CALL_LAST_ARG );
1948         if ( ! b )
1949                 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1951         b->yy_buf_size = size;
1953         /* yy_ch_buf has to be 2 characters longer than the size given because
1954          * we need to put in 2 end-of-buffer characters.
1955          */
1956         b->yy_ch_buf = (char *) yyalloc( b->yy_buf_size + 2 M4_YY_CALL_LAST_ARG );
1957         if ( ! b->yy_ch_buf )
1958                 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1960         b->yy_is_our_buffer = 1;
1962         yy_init_buffer( b, file M4_YY_CALL_LAST_ARG);
1964         return b;
1967 /** Destroy the buffer.
1968  * @param b a buffer created with yy_create_buffer()
1969  * M4_YY_DOC_PARAM
1970  */
1971 %if-c-only
1972     void yy_delete_buffer YYFARGS1( YY_BUFFER_STATE ,b)
1973 %endif
1974 %if-c++-only
1975     void yyFlexLexer::yy_delete_buffer( YY_BUFFER_STATE b )
1976 %endif
1978     M4_YY_DECL_GUTS_VAR();
1980         if ( ! b )
1981                 return;
1983         if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1984                 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
1986         if ( b->yy_is_our_buffer )
1987                 yyfree( (void *) b->yy_ch_buf M4_YY_CALL_LAST_ARG );
1989         yyfree( (void *) b M4_YY_CALL_LAST_ARG );
1993 %if-c-only
1994 m4_ifdef( [[M4_YY_ALWAYS_INTERACTIVE]],,
1996     m4_ifdef( [[M4_YY_NEVER_INTERACTIVE]],,
1997     [[
1998 #ifndef __cplusplus
1999 extern int isatty M4_YY_PARAMS( int );
2000 #endif /* __cplusplus */
2001     ]])
2003 %endif
2005 %if-c++-only
2006 m4_ifdef( [[M4_YY_NEVER_INTERACTIVE]],,
2008 extern "C" int isatty M4_YY_PARAMS( int );
2010 %endif
2012 /* Initializes or reinitializes a buffer.
2013  * This function is sometimes called more than once on the same buffer,
2014  * such as during a yyrestart() or at EOF.
2015  */
2016 %if-c-only
2017     static void yy_init_buffer  YYFARGS2( YY_BUFFER_STATE ,b, FILE *,file)
2018 %endif
2019 %if-c++-only
2020     void yyFlexLexer::yy_init_buffer( YY_BUFFER_STATE b, std::istream* file )
2021 %endif
2024         int oerrno = errno;
2025     M4_YY_DECL_GUTS_VAR();
2027         yy_flush_buffer( b M4_YY_CALL_LAST_ARG);
2029         b->yy_input_file = file;
2030         b->yy_fill_buffer = 1;
2032     /* If b is the current buffer, then yy_init_buffer was _probably_
2033      * called from yyrestart() or through yy_get_next_buffer.
2034      * In that case, we don't want to reset the lineno or column.
2035      */
2036     if (b != YY_CURRENT_BUFFER){
2037         b->yy_bs_lineno = 1;
2038         b->yy_bs_column = 0;
2039     }
2041 %if-c-only
2042 m4_ifdef( [[M4_YY_ALWAYS_INTERACTIVE]],
2044         b->yy_is_interactive = 1;
2047     m4_ifdef( [[M4_YY_NEVER_INTERACTIVE]],
2048     [[
2049         b->yy_is_interactive = 0;
2050     ]],
2051     [[
2052         b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
2053     ]])
2055 %endif
2056 %if-c++-only
2057         b->yy_is_interactive = 0;
2058 %endif
2059         errno = oerrno;
2062 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
2063  * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
2064  * M4_YY_DOC_PARAM
2065  */
2066 %if-c-only
2067     void yy_flush_buffer YYFARGS1( YY_BUFFER_STATE ,b)
2068 %endif
2069 %if-c++-only
2070     void yyFlexLexer::yy_flush_buffer( YY_BUFFER_STATE b )
2071 %endif
2073     M4_YY_DECL_GUTS_VAR();
2074         if ( ! b )
2075                 return;
2077         b->yy_n_chars = 0;
2079         /* We always need two end-of-buffer characters.  The first causes
2080          * a transition to the end-of-buffer state.  The second causes
2081          * a jam in that state.
2082          */
2083         b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
2084         b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
2086         b->yy_buf_pos = &b->yy_ch_buf[0];
2088         b->yy_at_bol = 1;
2089         b->yy_buffer_status = YY_BUFFER_NEW;
2091         if ( b == YY_CURRENT_BUFFER )
2092                 yy_load_buffer_state( M4_YY_CALL_ONLY_ARG );
2095 %if-c-or-c++
2096 /** Pushes the new state onto the stack. The new state becomes
2097  *  the current state. This function will allocate the stack
2098  *  if necessary.
2099  *  @param new_buffer The new state.
2100  *  M4_YY_DOC_PARAM
2101  */
2102 %if-c-only
2103 void yypush_buffer_state YYFARGS1(YY_BUFFER_STATE,new_buffer)
2104 %endif
2105 %if-c++-only
2106 void yyFlexLexer::yypush_buffer_state (YY_BUFFER_STATE new_buffer)
2107 %endif
2109     M4_YY_DECL_GUTS_VAR();
2110         if (new_buffer == NULL)
2111                 return;
2113         yyensure_buffer_stack(M4_YY_CALL_ONLY_ARG);
2115         /* This block is copied from yy_switch_to_buffer. */
2116         if ( YY_CURRENT_BUFFER )
2117                 {
2118                 /* Flush out information for old buffer. */
2119                 *YY_G(yy_c_buf_p) = YY_G(yy_hold_char);
2120                 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = YY_G(yy_c_buf_p);
2121                 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = YY_G(yy_n_chars);
2122                 }
2124         /* Only push if top exists. Otherwise, replace top. */
2125         if (YY_CURRENT_BUFFER)
2126                 YY_G(yy_buffer_stack_top)++;
2127         YY_CURRENT_BUFFER_LVALUE = new_buffer;
2129         /* copied from yy_switch_to_buffer. */
2130         yy_load_buffer_state( M4_YY_CALL_ONLY_ARG );
2131         YY_G(yy_did_buffer_switch_on_eof) = 1;
2133 %endif
2136 %if-c-or-c++
2137 /** Removes and deletes the top of the stack, if present.
2138  *  The next element becomes the new top.
2139  *  M4_YY_DOC_PARAM
2140  */
2141 %if-c-only
2142 void yypop_buffer_state YYFARGS0(void)
2143 %endif
2144 %if-c++-only
2145 void yyFlexLexer::yypop_buffer_state (void)
2146 %endif
2148     M4_YY_DECL_GUTS_VAR();
2149         if (!YY_CURRENT_BUFFER)
2150                 return;
2152         yy_delete_buffer(YY_CURRENT_BUFFER M4_YY_CALL_LAST_ARG);
2153         YY_CURRENT_BUFFER_LVALUE = NULL;
2154         if (YY_G(yy_buffer_stack_top) > 0)
2155                 --YY_G(yy_buffer_stack_top);
2157         if (YY_CURRENT_BUFFER) {
2158                 yy_load_buffer_state( M4_YY_CALL_ONLY_ARG );
2159                 YY_G(yy_did_buffer_switch_on_eof) = 1;
2160         }
2162 %endif
2165 %if-c-or-c++
2166 /* Allocates the stack if it does not exist.
2167  *  Guarantees space for at least one push.
2168  */
2169 %if-c-only
2170 static void yyensure_buffer_stack YYFARGS0(void)
2171 %endif
2172 %if-c++-only
2173 void yyFlexLexer::yyensure_buffer_stack(void)
2174 %endif
2176         int num_to_alloc;
2177     M4_YY_DECL_GUTS_VAR();
2179         if (!YY_G(yy_buffer_stack)) {
2181                 /* First allocation is just for 2 elements, since we don't know if this
2182                  * scanner will even need a stack. We use 2 instead of 1 to avoid an
2183                  * immediate realloc on the next call.
2184          */
2185                 num_to_alloc = 1;
2186                 YY_G(yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
2187                                                                 (num_to_alloc * sizeof(struct yy_buffer_state*)
2188                                                                 M4_YY_CALL_LAST_ARG);
2189                 
2190                 memset(YY_G(yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
2191                                 
2192                 YY_G(yy_buffer_stack_max) = num_to_alloc;
2193                 YY_G(yy_buffer_stack_top) = 0;
2194                 return;
2195         }
2197         if (YY_G(yy_buffer_stack_top) >= (YY_G(yy_buffer_stack_max)) - 1){
2199                 /* Increase the buffer to prepare for a possible push. */
2200                 int grow_size = 8 /* arbitrary grow size */;
2202                 num_to_alloc = YY_G(yy_buffer_stack_max) + grow_size;
2203                 YY_G(yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
2204                                                                 (YY_G(yy_buffer_stack),
2205                                                                 num_to_alloc * sizeof(struct yy_buffer_state*)
2206                                                                 M4_YY_CALL_LAST_ARG);
2208                 /* zero only the new slots.*/
2209                 memset(YY_G(yy_buffer_stack) + YY_G(yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
2210                 YY_G(yy_buffer_stack_max) = num_to_alloc;
2211         }
2213 %endif
2218 m4_ifdef( [[M4_YY_NO_SCAN_BUFFER]],,
2220 %if-c-only
2221 /** Setup the input buffer state to scan directly from a user-specified character buffer.
2222  * @param base the character buffer
2223  * @param size the size in bytes of the character buffer
2224  * M4_YY_DOC_PARAM
2225  * @return the newly allocated buffer state object. 
2226  */
2227 YY_BUFFER_STATE yy_scan_buffer  YYFARGS2( char *,base, yy_size_t ,size)
2229         YY_BUFFER_STATE b;
2230     m4_dnl M4_YY_DECL_GUTS_VAR();
2232         if ( size < 2 ||
2233              base[size-2] != YY_END_OF_BUFFER_CHAR ||
2234              base[size-1] != YY_END_OF_BUFFER_CHAR )
2235                 /* They forgot to leave room for the EOB's. */
2236                 return 0;
2238         b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) M4_YY_CALL_LAST_ARG );
2239         if ( ! b )
2240                 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
2242         b->yy_buf_size = size - 2;      /* "- 2" to take care of EOB's */
2243         b->yy_buf_pos = b->yy_ch_buf = base;
2244         b->yy_is_our_buffer = 0;
2245         b->yy_input_file = 0;
2246         b->yy_n_chars = b->yy_buf_size;
2247         b->yy_is_interactive = 0;
2248         b->yy_at_bol = 1;
2249         b->yy_fill_buffer = 0;
2250         b->yy_buffer_status = YY_BUFFER_NEW;
2252         yy_switch_to_buffer( b M4_YY_CALL_LAST_ARG );
2254         return b;
2256 %endif
2260 m4_ifdef( [[M4_YY_NO_SCAN_STRING]],,
2262 %if-c-only
2263 /** Setup the input buffer state to scan a string. The next call to yylex() will
2264  * scan from a @e copy of @a str.
2265  * @param str a NUL-terminated string to scan
2266  * M4_YY_DOC_PARAM
2267  * @return the newly allocated buffer state object.
2268  * @note If you want to scan bytes that may contain NUL values, then use
2269  *       yy_scan_bytes() instead.
2270  */
2271 YY_BUFFER_STATE yy_scan_string YYFARGS1( yyconst char *, yystr)
2273     m4_dnl M4_YY_DECL_GUTS_VAR();
2275         return yy_scan_bytes( yystr, strlen(yystr) M4_YY_CALL_LAST_ARG);
2277 %endif
2281 m4_ifdef( [[M4_YY_NO_SCAN_BYTES]],,
2283 %if-c-only
2284 /** Setup the input buffer state to scan the given bytes. The next call to yylex() will
2285  * scan from a @e copy of @a bytes.
2286  * @param bytes the byte buffer to scan
2287  * @param len the number of bytes in the buffer pointed to by @a bytes.
2288  * M4_YY_DOC_PARAM
2289  * @return the newly allocated buffer state object.
2290  */
2291 YY_BUFFER_STATE yy_scan_bytes  YYFARGS2( yyconst char *,yybytes, int ,_yybytes_len)
2293         YY_BUFFER_STATE b;
2294         char *buf;
2295         yy_size_t n;
2296         int i;
2297     m4_dnl M4_YY_DECL_GUTS_VAR();
2299         /* Get memory for full buffer, including space for trailing EOB's. */
2300         n = _yybytes_len + 2;
2301         buf = (char *) yyalloc( n M4_YY_CALL_LAST_ARG );
2302         if ( ! buf )
2303                 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
2305         for ( i = 0; i < _yybytes_len; ++i )
2306                 buf[i] = yybytes[i];
2308         buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
2310         b = yy_scan_buffer( buf, n M4_YY_CALL_LAST_ARG);
2311         if ( ! b )
2312                 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
2314         /* It's okay to grow etc. this buffer, and we should throw it
2315          * away when we're done.
2316          */
2317         b->yy_is_our_buffer = 1;
2319         return b;
2321 %endif
2325 m4_ifdef( [[M4_YY_NO_PUSH_STATE]],,
2327 %if-c-only
2328     static void yy_push_state YYFARGS1( int ,new_state)
2329 %endif
2330 %if-c++-only
2331     void yyFlexLexer::yy_push_state( int new_state )
2332 %endif
2334     M4_YY_DECL_GUTS_VAR();
2335         if ( YY_G(yy_start_stack_ptr) >= YY_G(yy_start_stack_depth) )
2336                 {
2337                 yy_size_t new_size;
2339                 YY_G(yy_start_stack_depth) += YY_START_STACK_INCR;
2340                 new_size = YY_G(yy_start_stack_depth) * sizeof( int );
2342                 if ( ! YY_G(yy_start_stack) )
2343                         YY_G(yy_start_stack) = (int *) yyalloc( new_size M4_YY_CALL_LAST_ARG );
2345                 else
2346                         YY_G(yy_start_stack) = (int *) yyrealloc(
2347                                         (void *) YY_G(yy_start_stack), new_size M4_YY_CALL_LAST_ARG );
2349                 if ( ! YY_G(yy_start_stack) )
2350                         YY_FATAL_ERROR(
2351                         "out of memory expanding start-condition stack" );
2352                 }
2354         YY_G(yy_start_stack)[YY_G(yy_start_stack_ptr)++] = YY_START;
2356         BEGIN(new_state);
2361 m4_ifdef( [[M4_YY_NO_POP_STATE]],,
2363 %if-c-only
2364     static void yy_pop_state  YYFARGS0(void)
2365 %endif
2366 %if-c++-only
2367     void yyFlexLexer::yy_pop_state()
2368 %endif
2370     M4_YY_DECL_GUTS_VAR();
2371         if ( --YY_G(yy_start_stack_ptr) < 0 )
2372                 YY_FATAL_ERROR( "start-condition stack underflow" );
2374         BEGIN(YY_G(yy_start_stack)[YY_G(yy_start_stack_ptr)]);
2379 m4_ifdef( [[M4_YY_NO_TOP_STATE]],,
2381 %if-c-only
2382     static int yy_top_state  YYFARGS0(void)
2383 %endif
2384 %if-c++-only
2385     int yyFlexLexer::yy_top_state()
2386 %endif
2388     M4_YY_DECL_GUTS_VAR();
2389         return YY_G(yy_start_stack)[YY_G(yy_start_stack_ptr) - 1];
2393 #ifndef YY_EXIT_FAILURE
2394 #define YY_EXIT_FAILURE 2
2395 #endif
2397 %if-c-only
2398 static void yy_fatal_error YYFARGS1(yyconst char*, msg)
2400     m4_dnl M4_YY_DECL_GUTS_VAR();
2401         (void) fprintf( stderr, "%s\n", msg );
2402         exit( YY_EXIT_FAILURE );
2404 %endif
2405 %if-c++-only
2406 void yyFlexLexer::LexerError( yyconst char msg[] )
2408     M4_YY_DECL_GUTS_VAR();
2409         std::cerr << msg << std::endl;
2410         exit( YY_EXIT_FAILURE );
2412 %endif
2414 /* Redefine yyless() so it works in section 3 code. */
2416 #undef yyless
2417 #define yyless(n) \
2418         do \
2419                 { \
2420                 /* Undo effects of setting up yytext. */ \
2421         int yyless_macro_arg = (n); \
2422         YY_LESS_LINENO(yyless_macro_arg);\
2423                 yytext[yyleng] = YY_G(yy_hold_char); \
2424                 YY_G(yy_c_buf_p) = yytext + yyless_macro_arg; \
2425                 YY_G(yy_hold_char) = *YY_G(yy_c_buf_p); \
2426                 *YY_G(yy_c_buf_p) = '\0'; \
2427                 yyleng = yyless_macro_arg; \
2428                 } \
2429         while ( 0 )
2433 /* Accessor  methods (get/set functions) to struct members. */
2435 %if-c-only
2436 %if-reentrant
2437 m4_ifdef( [[M4_YY_NO_GET_EXTRA]],,
2439 /** Get the user-defined data for this scanner.
2440  * M4_YY_DOC_PARAM
2441  */
2442 YY_EXTRA_TYPE yyget_extra  YYFARGS0(void)
2444     M4_YY_DECL_GUTS_VAR();
2445     return yyextra;
2448 %endif
2450 m4_ifdef( [[M4_YY_NO_GET_LINENO]],,
2452 /** Get the current line number.
2453  * M4_YY_DOC_PARAM
2454  */
2455 int yyget_lineno  YYFARGS0(void)
2457     M4_YY_DECL_GUTS_VAR();
2458     
2459     m4_ifdef( [[M4_YY_REENTRANT]],
2460     [[
2461         if (! YY_CURRENT_BUFFER)
2462             return 0;
2463     ]])
2464     return yylineno;
2468 m4_ifdef( [[M4_YY_REENTRANT]],
2470 m4_ifdef( [[M4_YY_NO_GET_COLUMN]],,
2472 /** Get the current column number.
2473  * M4_YY_DOC_PARAM
2474  */
2475 int yyget_column  YYFARGS0(void)
2477     M4_YY_DECL_GUTS_VAR();
2478     
2479     m4_ifdef( [[M4_YY_REENTRANT]],
2480     [[
2481         if (! YY_CURRENT_BUFFER)
2482             return 0;
2483     ]])
2484     return yycolumn;
2489 m4_ifdef( [[M4_YY_NO_GET_IN]],,
2491 /** Get the input stream.
2492  * M4_YY_DOC_PARAM
2493  */
2494 FILE *yyget_in  YYFARGS0(void)
2496     M4_YY_DECL_GUTS_VAR();
2497     return yyin;
2501 m4_ifdef( [[M4_YY_NO_GET_OUT]],,
2503 /** Get the output stream.
2504  * M4_YY_DOC_PARAM
2505  */
2506 FILE *yyget_out  YYFARGS0(void)
2508     M4_YY_DECL_GUTS_VAR();
2509     return yyout;
2513 m4_ifdef( [[M4_YY_NO_GET_LENG]],,
2515 /** Get the length of the current token.
2516  * M4_YY_DOC_PARAM
2517  */
2518 int yyget_leng  YYFARGS0(void)
2520     M4_YY_DECL_GUTS_VAR();
2521     return yyleng;
2525 /** Get the current token.
2526  * M4_YY_DOC_PARAM
2527  */
2528 m4_ifdef( [[M4_YY_NO_GET_TEXT]],,
2530 char *yyget_text  YYFARGS0(void)
2532     M4_YY_DECL_GUTS_VAR();
2533     return yytext;
2537 %if-reentrant
2538 m4_ifdef( [[M4_YY_NO_SET_EXTRA]],,
2540 /** Set the user-defined data. This data is never touched by the scanner.
2541  * @param user_defined The data to be associated with this scanner.
2542  * M4_YY_DOC_PARAM
2543  */
2544 void yyset_extra YYFARGS1( YY_EXTRA_TYPE ,user_defined)
2546     M4_YY_DECL_GUTS_VAR();
2547     yyextra = user_defined ;
2550 %endif
2552 m4_ifdef( [[M4_YY_NO_SET_LINENO]],,
2554 /** Set the current line number.
2555  * @param line_number
2556  * M4_YY_DOC_PARAM
2557  */
2558 void yyset_lineno YYFARGS1( int ,line_number)
2560     M4_YY_DECL_GUTS_VAR();
2562     m4_ifdef( [[M4_YY_REENTRANT]],
2563     [[
2564         /* lineno is only valid if an input buffer exists. */
2565         if (! YY_CURRENT_BUFFER )
2566            yy_fatal_error( "yyset_lineno called with no buffer" M4_YY_CALL_LAST_ARG); 
2567     ]])
2568     yylineno = line_number;
2572 m4_ifdef( [[M4_YY_REENTRANT]],
2574 m4_ifdef( [[M4_YY_NO_SET_COLUMN]],,
2576 /** Set the current column.
2577  * @param line_number
2578  * M4_YY_DOC_PARAM
2579  */
2580 void yyset_column YYFARGS1( int , column_no)
2582     M4_YY_DECL_GUTS_VAR();
2584     m4_ifdef( [[M4_YY_REENTRANT]],
2585     [[
2586         /* column is only valid if an input buffer exists. */
2587         if (! YY_CURRENT_BUFFER )
2588            yy_fatal_error( "yyset_column called with no buffer" M4_YY_CALL_LAST_ARG); 
2589     ]])
2590     yycolumn = column_no;
2596 m4_ifdef( [[M4_YY_NO_SET_IN]],,
2598 /** Set the input stream. This does not discard the current
2599  * input buffer.
2600  * @param in_str A readable stream.
2601  * M4_YY_DOC_PARAM
2602  * @see yy_switch_to_buffer
2603  */
2604 void yyset_in YYFARGS1( FILE * ,in_str)
2606     M4_YY_DECL_GUTS_VAR();
2607     yyin = in_str ;
2611 m4_ifdef( [[M4_YY_NO_SET_OUT]],,
2613 void yyset_out YYFARGS1( FILE * ,out_str)
2615     M4_YY_DECL_GUTS_VAR();
2616     yyout = out_str ;
2621 m4_ifdef( [[M4_YY_NO_GET_DEBUG]],,
2623 int yyget_debug  YYFARGS0(void)
2625     M4_YY_DECL_GUTS_VAR();
2626     return yy_flex_debug;
2630 m4_ifdef( [[M4_YY_NO_SET_DEBUG]],,
2632 void yyset_debug YYFARGS1( int ,bdebug)
2634     M4_YY_DECL_GUTS_VAR();
2635     yy_flex_debug = bdebug ;
2638 %endif
2640 %if-reentrant
2641 /* Accessor methods for yylval and yylloc */
2643 %if-bison-bridge
2644 m4_ifdef( [[M4_YY_NO_GET_LVAL]],,
2646 YYSTYPE * yyget_lval  YYFARGS0(void)
2648     M4_YY_DECL_GUTS_VAR();
2649     return yylval;
2653 m4_ifdef( [[M4_YY_NO_SET_LVAL]],,
2655 void yyset_lval YYFARGS1( YYSTYPE * ,yylval_param)
2657     M4_YY_DECL_GUTS_VAR();
2658     yylval = yylval_param;
2662 m4_ifdef( [[<M4_YY_BISON_LLOC>]],
2664     m4_ifdef( [[M4_YY_NO_GET_LLOC]],,
2665     [[
2666 YYLTYPE *yyget_lloc  YYFARGS0(void)
2668     M4_YY_DECL_GUTS_VAR();
2669     return yylloc;
2671     ]])
2673     m4_ifdef( [[M4_YY_NO_SET_LLOC]],,
2674     [[
2675 void yyset_lloc YYFARGS1( YYLTYPE * ,yylloc_param)
2677     M4_YY_DECL_GUTS_VAR();
2678     yylloc = yylloc_param;
2680     ]])
2683 %endif
2686 /* User-visible API */
2688 /* yylex_init is special because it creates the scanner itself, so it is
2689  * the ONLY reentrant function that doesn't take the scanner as the last argument.
2690  * That's why we explicitly handle the declaration, instead of using our macros.
2691  */
2692 m4_ifdef( [[M4_YY_NO_ANSI_FUNC_DEFS]],
2694 int yylex_init( ptr_yy_globals )
2695     yyscan_t* ptr_yy_globals;
2698 int yylex_init(yyscan_t* ptr_yy_globals)
2701     if (ptr_yy_globals == NULL){
2702         errno = EINVAL;
2703         return 1;
2704     }
2706     *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), NULL );
2708     if (*ptr_yy_globals == NULL){
2709         errno = ENOMEM;
2710         return 1;
2711     }
2713     /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */
2714     memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
2716     return yy_init_globals ( *ptr_yy_globals );
2719 %endif
2721 %if-c-only
2722 static int yy_init_globals YYFARGS0(void)
2724     M4_YY_DECL_GUTS_VAR();
2725     /* Initialization is the same as for the non-reentrant scanner.
2726      * This function is called from yylex_destroy(), so don't allocate here.
2727      */
2729 m4_ifdef( [[M4_YY_USE_LINENO]],
2731     m4_ifdef( [[M4_YY_NOT_REENTRANT]],
2732     [[
2733     /* We do not touch yylineno unless the option is enabled. */
2734     yylineno =  1;
2735     ]])
2737     YY_G(yy_buffer_stack) = 0;
2738     YY_G(yy_buffer_stack_top) = 0;
2739     YY_G(yy_buffer_stack_max) = 0;
2740     YY_G(yy_c_buf_p) = (char *) 0;
2741     YY_G(yy_init) = 0;
2742     YY_G(yy_start) = 0;
2744 m4_ifdef( [[M4_YY_HAS_START_STACK_VARS]],
2746     YY_G(yy_start_stack_ptr) = 0;
2747     YY_G(yy_start_stack_depth) = 0;
2748     YY_G(yy_start_stack) =  NULL;
2751 m4_ifdef( [[M4_YY_USES_REJECT]],
2753     YY_G(yy_state_buf) = 0;
2754     YY_G(yy_state_ptr) = 0;
2755     YY_G(yy_full_match) = 0;
2756     YY_G(yy_lp) = 0;
2759 m4_ifdef( [[M4_YY_TEXT_IS_ARRAY]],
2761     YY_G(yytext_ptr) = 0;
2762     YY_G(yy_more_offset) = 0;
2763     YY_G(yy_prev_more_offset) = 0;
2766 /* Defined in main.c */
2767 #ifdef YY_STDINIT
2768     yyin = stdin;
2769     yyout = stdout;
2770 #else
2771     yyin = (FILE *) 0;
2772     yyout = (FILE *) 0;
2773 #endif
2775     /* For future reference: Set errno on error, since we are called by
2776      * yylex_init()
2777      */
2778     return 0;
2780 %endif
2783 %if-c-only SNIP! this currently causes conflicts with the c++ scanner
2784 /* yylex_destroy is for both reentrant and non-reentrant scanners. */
2785 int yylex_destroy  YYFARGS0(void)
2787     M4_YY_DECL_GUTS_VAR();
2789     /* Pop the buffer stack, destroying each element. */
2790         while(YY_CURRENT_BUFFER){
2791                 yy_delete_buffer( YY_CURRENT_BUFFER M4_YY_CALL_LAST_ARG );
2792                 YY_CURRENT_BUFFER_LVALUE = NULL;
2793                 yypop_buffer_state(M4_YY_CALL_ONLY_ARG);
2794         }
2796         /* Destroy the stack itself. */
2797         yyfree(YY_G(yy_buffer_stack) M4_YY_CALL_LAST_ARG);
2798         YY_G(yy_buffer_stack) = NULL;
2800 m4_ifdef( [[M4_YY_HAS_START_STACK_VARS]],
2802     /* Destroy the start condition stack. */
2803         yyfree( YY_G(yy_start_stack) M4_YY_CALL_LAST_ARG );
2804         YY_G(yy_start_stack) = NULL;
2807 m4_ifdef( [[M4_YY_USES_REJECT]],
2809     yyfree ( YY_G(yy_state_buf) M4_YY_CALL_LAST_ARG);
2810     YY_G(yy_state_buf)  = NULL;
2813     /* Reset the globals. This is important in a non-reentrant scanner so the next time
2814      * yylex() is called, initialization will occur. */
2815     yy_init_globals( M4_YY_CALL_ONLY_ARG);
2817 %if-reentrant
2818     /* Destroy the main struct (reentrant only). */
2819     yyfree ( yyscanner M4_YY_CALL_LAST_ARG );
2820     yyscanner = NULL;
2821 %endif
2822     return 0;
2824 %endif
2827 m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
2830  * Internal utility routines.
2831  */
2834 m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
2836 #ifndef yytext_ptr
2837 static void yy_flex_strncpy YYFARGS3( char*,s1, yyconst char *,s2, int,n)
2839         register int i;
2840         for ( i = 0; i < n; ++i )
2841                 s1[i] = s2[i];
2843 #endif
2846 m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
2848 #ifdef YY_NEED_STRLEN
2849 static int yy_flex_strlen YYFARGS1( yyconst char *,s)
2851         register int n;
2852         for ( n = 0; s[n]; ++n )
2853                 ;
2855         return n;
2857 #endif
2860 m4_ifdef( [[M4_YY_NO_FLEX_ALLOC]],,
2862 void *yyalloc YYFARGS1( yy_size_t ,size)
2864         return (void *) malloc( size );
2868 m4_ifdef( [[M4_YY_NO_FLEX_REALLOC]],,
2870 void *yyrealloc  YYFARGS2( void *,ptr, yy_size_t ,size)
2872         /* The cast to (char *) in the following accommodates both
2873          * implementations that use char* generic pointers, and those
2874          * that use void* generic pointers.  It works with the latter
2875          * because both ANSI C and C++ allow castless assignment from
2876          * any pointer type to void*, and deal with argument conversions
2877          * as though doing an assignment.
2878          */
2879         return (void *) realloc( (char *) ptr, size );
2883 m4_ifdef( [[M4_YY_NO_FLEX_FREE]],,
2885 void yyfree YYFARGS1( void *,ptr)
2887         free( (char *) ptr );   /* see yyrealloc() for (char *) cast */
2891 %if-tables-serialization definitions
2892 m4preproc_include(`tables_shared.c')
2894 static int yytbl_read8 (void *v, struct yytbl_reader * rd)
2896     errno = 0;
2897     if (fread (v, sizeof (flex_uint8_t), 1, rd->fp) != 1){
2898         errno = EIO;
2899         return -1;
2900     }
2901     rd->bread += sizeof(flex_uint8_t);
2902     return 0;
2905 static int yytbl_read16 (void *v, struct yytbl_reader * rd)
2907     errno = 0;
2908     if (fread (v, sizeof (flex_uint16_t), 1, rd->fp) != 1){
2909         errno = EIO;
2910         return -1;
2911     }
2912     *((flex_uint16_t *) v) = ntohs (*((flex_uint16_t *) v));
2913     rd->bread += sizeof(flex_uint16_t);
2914     return 0;
2917 static int yytbl_read32 (void *v, struct yytbl_reader * rd)
2919     errno = 0;
2920     if (fread (v, sizeof (flex_uint32_t), 1, rd->fp) != 1){
2921         errno = EIO;
2922         return -1;
2923     }
2924     *((flex_uint32_t *) v) = ntohl (*((flex_uint32_t *) v));
2925     rd->bread += sizeof(flex_uint32_t);
2926     return 0;
2929 /** Read the header */
2930 static int yytbl_hdr_read YYFARGS2(struct yytbl_hdr *, th, struct yytbl_reader *, rd)
2932     int     bytes;
2933     memset (th, 0, sizeof (struct yytbl_hdr));
2935     if (yytbl_read32 (&(th->th_magic), rd) != 0)
2936         return -1;
2938     if (th->th_magic != YYTBL_MAGIC){
2939         yy_fatal_error("bad magic number" /*TODO: not fatal.*/ M4_YY_CALL_LAST_ARG);
2940         return -1;
2941     }
2943     if (yytbl_read32 (&(th->th_hsize), rd) != 0
2944         || yytbl_read32 (&(th->th_ssize), rd) != 0
2945         || yytbl_read16 (&(th->th_flags), rd) != 0)
2946         return -1;
2948     /* Sanity check on header size. Greater than 1k suggests some funny business. */
2949     if (th->th_hsize < 16 || th->th_hsize > 1024){
2950         yy_fatal_error("insane header size detected" /*TODO: not fatal.*/ M4_YY_CALL_LAST_ARG);
2951         return -1;
2952     }
2954     /* Allocate enough space for the version and name fields */
2955     bytes = th->th_hsize - 14;
2956     th->th_version = (char *) yyalloc (bytes M4_YY_CALL_LAST_ARG);
2958     /* we read it all into th_version, and point th_name into that data */
2959     if (fread (th->th_version, 1, bytes, rd->fp) != bytes){
2960         errno = EIO;
2961         yyfree(th->th_version M4_YY_CALL_LAST_ARG);
2962         th->th_version = NULL;
2963         return -1;
2964     }
2965     else
2966         rd->bread += bytes;
2968     th->th_name = th->th_version + strlen (th->th_version) + 1;
2969     return 0;
2972 /** lookup id in the dmap list.
2973  *  @param dmap pointer to first element in list
2974  *  @return NULL if not found.
2975  */
2976 static struct yytbl_dmap *yytbl_dmap_lookup YYFARGS2(struct yytbl_dmap *, dmap,
2977                                                       int, id)
2979     while (dmap->dm_id)
2980         if (dmap->dm_id == id)
2981             return dmap;
2982         else
2983             dmap++;
2984     return NULL;
2987 /** Read a table while mapping its contents to the local array. 
2988  *  @param dmap used to performing mapping
2989  *  @return 0 on success
2990  */
2991 static int yytbl_data_load YYFARGS2(struct yytbl_dmap *, dmap, struct yytbl_reader*, rd)
2993     struct yytbl_data td;
2994     struct yytbl_dmap *transdmap=0;
2995     int     len, i, rv, inner_loop_count;
2996     void   *p=0;
2998     memset (&td, 0, sizeof (struct yytbl_data));
3000     if (yytbl_read16 (&td.td_id, rd) != 0
3001         || yytbl_read16 (&td.td_flags, rd) != 0
3002         || yytbl_read32 (&td.td_hilen, rd) != 0
3003         || yytbl_read32 (&td.td_lolen, rd) != 0)
3004         return -1;
3006     /* Lookup the map for the transition table so we have it in case we need it
3007      * inside the loop below. This scanner might not even have a transition
3008      * table, which is ok.
3009      */
3010     transdmap = yytbl_dmap_lookup (dmap, YYTD_ID_TRANSITION M4_YY_CALL_LAST_ARG);
3012     if ((dmap = yytbl_dmap_lookup (dmap, td.td_id M4_YY_CALL_LAST_ARG)) == NULL){
3013         yy_fatal_error("table id not found in map." /*TODO: not fatal.*/ M4_YY_CALL_LAST_ARG);
3014         return -1;
3015     }
3017     /* Allocate space for table.
3018      * The --full yy_transition table is a special case, since we
3019      * need the dmap.dm_sz entry to tell us the sizeof the individual
3020      * struct members.
3021      */
3022     {
3023     size_t  bytes;
3025     if ((td.td_flags & YYTD_STRUCT))
3026         bytes = sizeof(struct yy_trans_info) * td.td_lolen * (td.td_hilen ? td.td_hilen : 1);
3027     else
3028         bytes = td.td_lolen * (td.td_hilen ? td.td_hilen : 1) * dmap->dm_sz;
3030     if(M4_YY_TABLES_VERIFY)
3031         /* We point to the array itself */
3032         p = dmap->dm_arr; 
3033     else
3034         /* We point to the address of a pointer. */
3035         *dmap->dm_arr = p = (void *) yyalloc (bytes M4_YY_CALL_LAST_ARG);
3036     }
3038     /* If it's a struct, we read 2 integers to get one element */
3039     if ((td.td_flags & YYTD_STRUCT) != 0)
3040         inner_loop_count = 2;
3041     else
3042         inner_loop_count = 1;
3044     /* read and map each element.
3045      * This loop iterates once for each element of the td_data array.
3046      * Notice that we increment 'i' in the inner loop.
3047      */
3048     len = yytbl_calc_total_len (&td);
3049     for (i = 0; i < len; ){
3050         int    j;
3053         /* This loop really executes exactly 1 or 2 times.
3054          * The second time is to handle the second member of the
3055          * YYTD_STRUCT for the yy_transition array.
3056          */
3057         for (j = 0; j < inner_loop_count; j++, i++) {
3058             flex_int32_t t32;
3060             /* read into t32 no matter what the real size is. */
3061             {
3062             flex_int16_t t16;
3063             flex_int8_t  t8;
3065             switch (YYTDFLAGS2BYTES (td.td_flags)) {
3066             case sizeof (flex_int32_t):
3067                 rv = yytbl_read32 (&t32, rd);
3068                 break;
3069             case sizeof (flex_int16_t):
3070                 rv = yytbl_read16 (&t16, rd);
3071                 t32 = t16;
3072                 break;
3073             case sizeof (flex_int8_t):
3074                 rv = yytbl_read8 (&t8, rd);
3075                 t32 = t8;
3076                 break;
3077             default: 
3078                 yy_fatal_error("invalid td_flags" /*TODO: not fatal.*/ M4_YY_CALL_LAST_ARG);
3079                 return -1;
3080             }
3081             }
3082             if (rv != 0)
3083                 return -1;
3085             /* copy into the deserialized array... */
3087             if ((td.td_flags & YYTD_STRUCT)) {
3088                 /* t32 is the j'th member of a two-element struct. */
3089                 void   *v;
3091                 v = j == 0 ? &(((struct yy_trans_info *) p)->yy_verify)
3092                     : &(((struct yy_trans_info *) p)->yy_nxt);
3094                 switch (dmap->dm_sz) {
3095                 case sizeof (flex_int32_t):
3096                     if (M4_YY_TABLES_VERIFY){
3097                         if( ((flex_int32_t *) v)[0] != (flex_int32_t) t32)
3098                            yy_fatal_error("tables verification failed at YYTD_STRUCT flex_int32_t" M4_YY_CALL_LAST_ARG);
3099                     }else
3100                         ((flex_int32_t *) v)[0] = (flex_int32_t) t32;
3101                     break;
3102                 case sizeof (flex_int16_t):
3103                     if (M4_YY_TABLES_VERIFY ){
3104                         if(((flex_int16_t *) v)[0] != (flex_int16_t) t32)
3105                         yy_fatal_error("tables verification failed at YYTD_STRUCT flex_int16_t" M4_YY_CALL_LAST_ARG);
3106                     }else
3107                         ((flex_int16_t *) v)[0] = (flex_int16_t) t32;
3108                     break;
3109                 case sizeof(flex_int8_t):
3110                     if (M4_YY_TABLES_VERIFY ){
3111                          if( ((flex_int8_t *) v)[0] != (flex_int8_t) t32)
3112                         yy_fatal_error("tables verification failed at YYTD_STRUCT flex_int8_t" M4_YY_CALL_LAST_ARG);
3113                     }else
3114                         ((flex_int8_t *) v)[0] = (flex_int8_t) t32;
3115                     break;
3116                 default:
3117                     yy_fatal_error("invalid dmap->dm_sz for struct" /*TODO: not fatal.*/ M4_YY_CALL_LAST_ARG);
3118                     return -1;
3119                 }
3121                 /* if we're done with j, increment p */
3122                 if (j == 1)
3123                     p = (struct yy_trans_info *) p + 1;
3124             }
3125             else if ((td.td_flags & YYTD_PTRANS)) {
3126                 /* t32 is an index into the transition array. */
3127                 struct yy_trans_info *v;
3130                 if (!transdmap){
3131                     yy_fatal_error("transition table not found" /*TODO: not fatal.*/ M4_YY_CALL_LAST_ARG);
3132                     return -1;
3133                 }
3134                 
3135                 if( M4_YY_TABLES_VERIFY)
3136                     v = &(((struct yy_trans_info *) (transdmap->dm_arr))[t32]);
3137                 else
3138                     v = &((*((struct yy_trans_info **) (transdmap->dm_arr)))[t32]);
3140                 if(M4_YY_TABLES_VERIFY ){
3141                     if( ((struct yy_trans_info **) p)[0] != v)
3142                         yy_fatal_error("tables verification failed at YYTD_PTRANS" M4_YY_CALL_LAST_ARG);
3143                 }else
3144                     ((struct yy_trans_info **) p)[0] = v;
3145                 
3146                 /* increment p */
3147                 p = (struct yy_trans_info **) p + 1;
3148             }
3149             else {
3150                 /* t32 is a plain int. copy data, then incrememnt p. */
3151                 switch (dmap->dm_sz) {
3152                 case sizeof (flex_int32_t):
3153                     if(M4_YY_TABLES_VERIFY ){
3154                         if( ((flex_int32_t *) p)[0] != (flex_int32_t) t32)
3155                         yy_fatal_error("tables verification failed at flex_int32_t" M4_YY_CALL_LAST_ARG);
3156                     }else
3157                         ((flex_int32_t *) p)[0] = (flex_int32_t) t32;
3158                     p = ((flex_int32_t *) p) + 1;
3159                     break;
3160                 case sizeof (flex_int16_t):
3161                     if(M4_YY_TABLES_VERIFY ){
3162                         if( ((flex_int16_t *) p)[0] != (flex_int16_t) t32)
3163                         yy_fatal_error("tables verification failed at flex_int16_t" M4_YY_CALL_LAST_ARG);
3164                     }else
3165                         ((flex_int16_t *) p)[0] = (flex_int16_t) t32;
3166                     p = ((flex_int16_t *) p) + 1;
3167                     break;
3168                 case sizeof (flex_int8_t):
3169                     if(M4_YY_TABLES_VERIFY ){
3170                         if( ((flex_int8_t *) p)[0] != (flex_int8_t) t32)
3171                         yy_fatal_error("tables verification failed at flex_int8_t" M4_YY_CALL_LAST_ARG);
3172                     }else
3173                         ((flex_int8_t *) p)[0] = (flex_int8_t) t32;
3174                     p = ((flex_int8_t *) p) + 1;
3175                     break;
3176                 default:
3177                     yy_fatal_error("invalid dmap->dm_sz for plain int" /*TODO: not fatal.*/ M4_YY_CALL_LAST_ARG);
3178                     return -1;
3179                 }
3180             }
3181         }
3183     }
3185     /* Now eat padding. */
3186     {
3187         int pad;
3188         pad = yypad64(rd->bread);
3189         while(--pad >= 0){
3190             flex_int8_t t8;
3191             if(yytbl_read8(&t8,rd) != 0)
3192                 return -1;
3193         }
3194     }
3196     return 0;
3199 %define-yytables   The name for this specific scanner's tables.
3201 /* Find the key and load the DFA tables from the given stream.  */
3202 static int yytbl_fload YYFARGS2(FILE *, fp, const char *, key)
3204     int rv=0;
3205     struct yytbl_hdr th;
3206     struct yytbl_reader rd;
3208     rd.fp = fp;
3209     th.th_version = NULL;
3211     /* Keep trying until we find the right set of tables or end of file. */
3212     while (!feof(rd.fp)) {
3213         rd.bread = 0;
3214         if (yytbl_hdr_read (&th, &rd M4_YY_CALL_LAST_ARG) != 0){
3215             rv = -1;
3216             goto return_rv;
3217         }
3219         /* A NULL key means choose the first set of tables. */
3220         if (key == NULL)
3221             break;
3223         if (strcmp(th.th_name,key) != 0){
3224             /* Skip ahead to next set */
3225             fseek(rd.fp, th.th_ssize - th.th_hsize, SEEK_CUR);
3226             yyfree(th.th_version M4_YY_CALL_LAST_ARG);
3227             th.th_version = NULL;
3228         }
3229         else
3230             break;
3231     }
3233     while (rd.bread < th.th_ssize){
3234         /* Load the data tables */
3235         if(yytbl_data_load (yydmap,&rd M4_YY_CALL_LAST_ARG) != 0){
3236             rv = -1;
3237             goto return_rv;
3238         }
3239     }
3241 return_rv:
3242     if(th.th_version){
3243         yyfree(th.th_version M4_YY_CALL_LAST_ARG);
3244         th.th_version = NULL;
3245     }
3247     return rv;
3250 /** Load the DFA tables for this scanner from the given stream.  */
3251 int yytables_fload YYFARGS1(FILE *, fp)
3254     if( yytbl_fload(fp, YYTABLES_NAME M4_YY_CALL_LAST_ARG) != 0)
3255         return -1;
3256     return 0;
3259 /** Destroy the loaded tables, freeing memory, etc.. */
3260 int yytables_destroy YYFARGS0(void)
3261 {   
3262     struct yytbl_dmap *dmap=0;
3264     if(!M4_YY_TABLES_VERIFY){
3265         /* Walk the dmap, freeing the pointers */
3266         for(dmap=yydmap; dmap->dm_id; dmap++) {
3267             void * v;
3268             v = dmap->dm_arr;
3269             if(v && *(char**)v){
3270                     yyfree(*(char**)v M4_YY_CALL_LAST_ARG);
3271                     *(char**)v = NULL;
3272             }
3273         }
3274     }
3276     return 0;
3279 /* end table serialization code definitions */
3280 %endif
3283 m4_ifdef([[M4_YY_MAIN]], [[
3284 int main M4_YY_PARAMS(void);
3286 int main ()
3289 %if-reentrant
3290     yyscan_t lexer;
3291     yylex_init(&lexer);
3292     yylex( lexer );
3293     yylex_destroy( lexer);
3295 %endif
3296 %if-not-reentrant
3297         yylex();
3298 %endif
3300         return 0;
3304 %ok-for-header
3305 m4_ifdef( [[M4_YY_IN_HEADER]],
3307 #undef YY_NEW_FILE
3308 #undef YY_FLUSH_BUFFER
3309 #undef yy_set_bol
3310 #undef yy_new_buffer
3311 #undef yy_set_interactive
3312 #undef YY_DO_BEFORE_ACTION
3314 #ifdef YY_DECL_IS_OURS
3315 #undef YY_DECL_IS_OURS
3316 #undef YY_DECL
3317 #endif