dntpd: Fix typo.
[dragonfly.git] / contrib / flex / skel.c
blob45a4a11056784b6d3ecaaa3fbbc905e6015aecd7
1 /* File created from flex.skl via mkskel.sh */
3 #include "flexdef.h"
5 const char *skel[] = {
6 "%# -*-C-*- vi: set ft=c:",
7 "%# This file is processed in several stages.",
8 "%# Here are the stages, as best as I can describe:",
9 "%#",
10 "%# 1. flex.skl is processed through GNU m4 during the",
11 "%# pre-compilation stage of flex. Only macros starting",
12 "%# with `m4_' are processed, and quoting is normal.",
13 "%#",
14 "%# 2. The preprocessed skeleton is translated verbatim into a",
15 "%# C array, saved as \"skel.c\" and compiled into the flex binary.",
16 "%#",
17 "%# 3. At runtime, the skeleton is generated and filtered (again)",
18 "%# through m4. Macros beginning with `m4_' will be processed.",
19 "%# The quoting is \"[[\" and \"]]\" so we don't interfere with",
20 "%# user code.",
21 "%# ",
22 "%# All generate macros for the m4 stage contain the text \"m4\" or \"M4\"",
23 "%# in them. This is to distinguish them from CPP macros.",
24 "%# The exception to this rule is YY_G, which is an m4 macro, ",
25 "%# but it needs to be remain short because it is used everywhere.",
26 "%#",
27 "/* A lexical scanner generated by flex */",
28 "",
29 "%# Macros for preproc stage.",
30 "",
31 "",
32 "%# Macros for runtime processing stage.",
33 "m4_changecom",
34 "m4_changequote",
35 "m4_changequote([[, ]])",
36 "",
37 "%# ",
38 "%# Lines in this skeleton starting with a \"%\" character are \"control lines\"",
39 "%# and affect the generation of the scanner. The possible control codes are",
40 "%# listed and processed in misc.c.",
41 "%#",
42 "%# %# - A comment. The current line is omitted from the generated scanner.",
43 "%# %if-c++-only - The following lines are printed for C++ scanners ONLY.",
44 "%# %if-c-only - The following lines are NOT printed for C++ scanners.",
45 "%# %if-c-or-c++ - The following lines are printed in BOTH C and C++ scanners.",
46 "%# %if-reentrant - Print for reentrant scanners.(push)",
47 "%# %if-not-reentrant - Print for non-reentrant scanners. (push)",
48 "%# %if-bison-bridge - Print for bison-bridge. (push)",
49 "%# %if-not-bison-bridge - Print for non-bison-bridge. (push)",
50 "%# %endif - pop from the previous if code.",
51 "%# %% - A stop-point, where code is inserted by flex.",
52 "%# Each stop-point is numbered here and also in the code generator.",
53 "%# (See gen.c, etc. for details.)",
54 "%# %not-for-header - Begin code that should NOT appear in a \".h\" file.",
55 "%# %ok-for-header - %c and %e are used for building a header file.",
56 "%# %if-tables-serialization",
57 "%#",
58 "%# All control-lines EXCEPT comment lines (\"%#\") will be inserted into",
59 "%# the generated scanner as a C-style comment. This is to aid those who",
60 "%# edit the skeleton.",
61 "%#",
62 "",
63 "%not-for-header",
64 "%if-c-only",
65 "%if-not-reentrant",
66 "m4_ifelse(M4_YY_PREFIX,yy,,",
67 "#define yy_create_buffer M4_YY_PREFIX[[_create_buffer]]",
68 "#define yy_delete_buffer M4_YY_PREFIX[[_delete_buffer]]",
69 "#define yy_flex_debug M4_YY_PREFIX[[_flex_debug]]",
70 "#define yy_init_buffer M4_YY_PREFIX[[_init_buffer]]",
71 "#define yy_flush_buffer M4_YY_PREFIX[[_flush_buffer]]",
72 "#define yy_load_buffer_state M4_YY_PREFIX[[_load_buffer_state]]",
73 "#define yy_switch_to_buffer M4_YY_PREFIX[[_switch_to_buffer]]",
74 "#define yyin M4_YY_PREFIX[[in]]",
75 "#define yyleng M4_YY_PREFIX[[leng]]",
76 "#define yylex M4_YY_PREFIX[[lex]]",
77 "#define yylineno M4_YY_PREFIX[[lineno]]",
78 "#define yyout M4_YY_PREFIX[[out]]",
79 "#define yyrestart M4_YY_PREFIX[[restart]]",
80 "#define yytext M4_YY_PREFIX[[text]]",
81 "#define yywrap M4_YY_PREFIX[[wrap]]",
82 "#define yyalloc M4_YY_PREFIX[[alloc]]",
83 "#define yyrealloc M4_YY_PREFIX[[realloc]]",
84 "#define yyfree M4_YY_PREFIX[[free]]",
85 ")",
86 "%endif",
87 "%endif",
88 "%ok-for-header",
89 "",
90 "#define FLEX_SCANNER",
91 "#define YY_FLEX_MAJOR_VERSION 2",
92 "#define YY_FLEX_MINOR_VERSION 5",
93 "#define YY_FLEX_SUBMINOR_VERSION 37",
94 "#if YY_FLEX_SUBMINOR_VERSION > 0",
95 "#define FLEX_BETA",
96 "#endif",
97 "",
98 "%# Some negated symbols",
99 "m4_ifdef( [[M4_YY_IN_HEADER]], , [[m4_define([[M4_YY_NOT_IN_HEADER]], [[]])]])",
100 "m4_ifdef( [[M4_YY_REENTRANT]], , [[m4_define([[M4_YY_NOT_REENTRANT]], [[]])]])",
102 "%# This is the m4 way to say \"(stack_used || is_reentrant)",
103 "m4_ifdef( [[M4_YY_STACK_USED]], [[m4_define([[M4_YY_HAS_START_STACK_VARS]])]])",
104 "m4_ifdef( [[M4_YY_REENTRANT]], [[m4_define([[M4_YY_HAS_START_STACK_VARS]])]])",
106 "%# Prefixes.",
107 "%# The complexity here is necessary so that m4 preserves",
108 "%# the argument lists to each C function.",
111 "m4_ifdef( [[M4_YY_PREFIX]],, [[m4_define([[M4_YY_PREFIX]], [[yy]])]])",
115 "%if-c++-only",
116 " /* The c++ scanner is a mess. The FlexLexer.h header file relies on the",
117 " * following macro. This is required in order to pass the c++-multiple-scanners",
118 " * test in the regression suite. We get reports that it breaks inheritance.",
119 " * We will address this in a future release of flex, or omit the C++ scanner",
120 " * altogether.",
121 " */",
122 " #define yyFlexLexer M4_YY_PREFIX[[FlexLexer]]",
123 "%endif",
125 "%if-c-only",
126 " m4_define(yy[[_create_buffer]], [[M4_YY_PREFIX[[_create_buffer]]m4_ifelse($#,0,,[[($@)]])]])",
127 " m4_define(yy[[_delete_buffer]], [[M4_YY_PREFIX[[_delete_buffer]]m4_ifelse($#,0,,[[($@)]])]])",
128 " m4_define(yy[[_scan_buffer]], [[M4_YY_PREFIX[[_scan_buffer]]m4_ifelse($#,0,,[[($@)]])]])",
129 " m4_define(yy[[_scan_string]], [[M4_YY_PREFIX[[_scan_string]]m4_ifelse($#,0,,[[($@)]])]])",
130 " m4_define(yy[[_scan_bytes]], [[M4_YY_PREFIX[[_scan_bytes]]m4_ifelse($#,0,,[[($@)]])]])",
131 " m4_define(yy[[_init_buffer]], [[M4_YY_PREFIX[[_init_buffer]]m4_ifelse($#,0,,[[($@)]])]])",
132 " m4_define(yy[[_flush_buffer]], [[M4_YY_PREFIX[[_flush_buffer]]m4_ifelse($#,0,,[[($@)]])]])",
133 " m4_define(yy[[_load_buffer_state]], [[M4_YY_PREFIX[[_load_buffer_state]]m4_ifelse($#,0,,[[($@)]])]])",
134 " m4_define(yy[[_switch_to_buffer]], [[M4_YY_PREFIX[[_switch_to_buffer]]m4_ifelse($#,0,,[[($@)]])]])",
135 " m4_define(yy[[push_buffer_state]], [[M4_YY_PREFIX[[push_buffer_state]]m4_ifelse($#,0,,[[($@)]])]])",
136 " m4_define(yy[[pop_buffer_state]], [[M4_YY_PREFIX[[pop_buffer_state]]m4_ifelse($#,0,,[[($@)]])]])",
137 " m4_define(yy[[ensure_buffer_stack]], [[M4_YY_PREFIX[[ensure_buffer_stack]]m4_ifelse($#,0,,[[($@)]])]])",
138 " m4_define(yy[[lex]], [[M4_YY_PREFIX[[lex]]m4_ifelse($#,0,,[[($@)]])]])",
139 " m4_define(yy[[restart]], [[M4_YY_PREFIX[[restart]]m4_ifelse($#,0,,[[($@)]])]])",
140 " m4_define(yy[[lex_init]], [[M4_YY_PREFIX[[lex_init]]m4_ifelse($#,0,,[[($@)]])]])",
141 " m4_define(yy[[lex_init_extra]], [[M4_YY_PREFIX[[lex_init_extra]]m4_ifelse($#,0,,[[($@)]])]])",
142 " m4_define(yy[[lex_destroy]], [[M4_YY_PREFIX[[lex_destroy]]m4_ifelse($#,0,,[[($@)]])]])",
143 " m4_define(yy[[get_debug]], [[M4_YY_PREFIX[[get_debug]]m4_ifelse($#,0,,[[($@)]])]])",
144 " m4_define(yy[[set_debug]], [[M4_YY_PREFIX[[set_debug]]m4_ifelse($#,0,,[[($@)]])]])",
145 " m4_define(yy[[get_extra]], [[M4_YY_PREFIX[[get_extra]]m4_ifelse($#,0,,[[($@)]])]])",
146 " m4_define(yy[[set_extra]], [[M4_YY_PREFIX[[set_extra]]m4_ifelse($#,0,,[[($@)]])]])",
147 " m4_define(yy[[get_in]], [[M4_YY_PREFIX[[get_in]]m4_ifelse($#,0,,[[($@)]])]])",
148 " m4_define(yy[[set_in]], [[M4_YY_PREFIX[[set_in]]m4_ifelse($#,0,,[[($@)]])]])",
149 " m4_define(yy[[get_out]], [[M4_YY_PREFIX[[get_out]]m4_ifelse($#,0,,[[($@)]])]])",
150 " m4_define(yy[[set_out]], [[M4_YY_PREFIX[[set_out]]m4_ifelse($#,0,,[[($@)]])]])",
151 " m4_define(yy[[get_leng]], [[M4_YY_PREFIX[[get_leng]]m4_ifelse($#,0,,[[($@)]])]])",
152 " m4_define(yy[[get_text]], [[M4_YY_PREFIX[[get_text]]m4_ifelse($#,0,,[[($@)]])]])",
153 " m4_define(yy[[get_lineno]], [[M4_YY_PREFIX[[get_lineno]]m4_ifelse($#,0,,[[($@)]])]])",
154 " m4_define(yy[[set_lineno]], [[M4_YY_PREFIX[[set_lineno]]m4_ifelse($#,0,,[[($@)]])]])",
155 " m4_ifdef( [[M4_YY_REENTRANT]],",
156 " [[",
157 " m4_define(yy[[get_column]], [[M4_YY_PREFIX[[get_column]]m4_ifelse($#,0,,[[($@)]])]])",
158 " m4_define(yy[[set_column]], [[M4_YY_PREFIX[[set_column]]m4_ifelse($#,0,,[[($@)]])]])",
159 " ]])",
160 " m4_define(yy[[wrap]], [[M4_YY_PREFIX[[wrap]]m4_ifelse($#,0,,[[($@)]])]])",
161 "%endif",
163 "m4_ifdef( [[M4_YY_BISON_LVAL]],",
164 "[[",
165 " m4_define(yy[[get_lval]], [[M4_YY_PREFIX[[get_lval]]m4_ifelse($#,0,,[[($@)]])]])",
166 " m4_define(yy[[set_lval]], [[M4_YY_PREFIX[[set_lval]]m4_ifelse($#,0,,[[($@)]])]])",
167 "]])",
169 "m4_ifdef( [[<M4_YY_BISON_LLOC>]],",
170 "[[",
171 " m4_define(yy[[get_lloc]], [[M4_YY_PREFIX[[get_lloc]]m4_ifelse($#,0,,[[($@)]])]])",
172 " m4_define(yy[[set_lloc]], [[M4_YY_PREFIX[[set_lloc]]m4_ifelse($#,0,,[[($@)]])]])",
173 "]])",
176 " m4_define(yy[[alloc]], [[M4_YY_PREFIX[[alloc]]m4_ifelse($#,0,,[[($@)]])]])",
177 " m4_define(yy[[realloc]], [[M4_YY_PREFIX[[realloc]]m4_ifelse($#,0,,[[($@)]])]])",
178 " m4_define(yy[[free]], [[M4_YY_PREFIX[[free]]m4_ifelse($#,0,,[[($@)]])]])",
180 "%if-c-only",
181 "m4_ifdef( [[M4_YY_NOT_REENTRANT]],",
182 "[[",
183 " m4_define(yy[[text]], [[M4_YY_PREFIX[[text]]m4_ifelse($#,0,,[[($@)]])]])",
184 " m4_define(yy[[leng]], [[M4_YY_PREFIX[[leng]]m4_ifelse($#,0,,[[($@)]])]])",
185 " m4_define(yy[[in]], [[M4_YY_PREFIX[[in]]m4_ifelse($#,0,,[[($@)]])]])",
186 " m4_define(yy[[out]], [[M4_YY_PREFIX[[out]]m4_ifelse($#,0,,[[($@)]])]])",
187 " m4_define(yy[[_flex_debug]], [[M4_YY_PREFIX[[_flex_debug]]m4_ifelse($#,0,,[[($@)]])]])",
188 " m4_define(yy[[lineno]], [[M4_YY_PREFIX[[lineno]]m4_ifelse($#,0,,[[($@)]])]])",
189 "]])",
190 "%endif",
193 "m4_ifdef( [[M4_YY_TABLES_EXTERNAL]],",
194 "[[",
195 " m4_define(yy[[tables_fload]], [[M4_YY_PREFIX[[tables_fload]]m4_ifelse($#,0,,[[($@)]])]])",
196 " m4_define(yy[[tables_destroy]], [[M4_YY_PREFIX[[tables_destroy]]m4_ifelse($#,0,,[[($@)]])]])",
197 " m4_define(yy[[TABLES_NAME]], [[M4_YY_PREFIX[[TABLES_NAME]]m4_ifelse($#,0,,[[($@)]])]])",
198 "]])",
200 "/* First, we deal with platform-specific or compiler-specific issues. */",
202 "/* begin standard C headers. */",
203 "%if-c-only",
204 "#include <stdio.h>",
205 "#include <string.h>",
206 "#include <errno.h>",
207 "#include <stdlib.h>",
208 "%endif",
210 "%if-tables-serialization",
211 "#include <sys/types.h>",
212 "#include <netinet/in.h>",
213 "%endif",
214 "/* end standard C headers. */",
216 "%if-c-or-c++",
217 "/* flex integer type definitions */",
219 "#ifndef FLEXINT_H",
220 "#define FLEXINT_H",
222 "/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */",
224 "#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L",
226 "/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,",
227 " * if you want the limit (max/min) macros for int types. ",
228 " */",
229 "#ifndef __STDC_LIMIT_MACROS",
230 "#define __STDC_LIMIT_MACROS 1",
231 "#endif",
233 "#include <inttypes.h>",
234 "typedef int8_t flex_int8_t;",
235 "typedef uint8_t flex_uint8_t;",
236 "typedef int16_t flex_int16_t;",
237 "typedef uint16_t flex_uint16_t;",
238 "typedef int32_t flex_int32_t;",
239 "typedef uint32_t flex_uint32_t;",
240 "#else",
241 "typedef signed char flex_int8_t;",
242 "typedef short int flex_int16_t;",
243 "typedef int flex_int32_t;",
244 "typedef unsigned char flex_uint8_t; ",
245 "typedef unsigned short int flex_uint16_t;",
246 "typedef unsigned int flex_uint32_t;",
248 "/* Limits of integral types. */",
249 "#ifndef INT8_MIN",
250 "#define INT8_MIN (-128)",
251 "#endif",
252 "#ifndef INT16_MIN",
253 "#define INT16_MIN (-32767-1)",
254 "#endif",
255 "#ifndef INT32_MIN",
256 "#define INT32_MIN (-2147483647-1)",
257 "#endif",
258 "#ifndef INT8_MAX",
259 "#define INT8_MAX (127)",
260 "#endif",
261 "#ifndef INT16_MAX",
262 "#define INT16_MAX (32767)",
263 "#endif",
264 "#ifndef INT32_MAX",
265 "#define INT32_MAX (2147483647)",
266 "#endif",
267 "#ifndef UINT8_MAX",
268 "#define UINT8_MAX (255U)",
269 "#endif",
270 "#ifndef UINT16_MAX",
271 "#define UINT16_MAX (65535U)",
272 "#endif",
273 "#ifndef UINT32_MAX",
274 "#define UINT32_MAX (4294967295U)",
275 "#endif",
277 "#endif /* ! C99 */",
279 "#endif /* ! FLEXINT_H */",
281 "%endif",
283 "%if-c++-only",
284 "/* begin standard C++ headers. */",
285 "#include <iostream> ",
286 "#include <errno.h>",
287 "#include <cstdlib>",
288 "#include <cstdio>",
289 "#include <cstring>",
290 "/* end standard C++ headers. */",
291 "%endif",
293 "#ifdef __cplusplus",
295 "/* The \"const\" storage-class-modifier is valid. */",
296 "#define YY_USE_CONST",
298 "#else /* ! __cplusplus */",
300 "/* C99 requires __STDC__ to be defined as 1. */",
301 "#if defined (__STDC__)",
303 "#define YY_USE_CONST",
305 "#endif /* defined (__STDC__) */",
306 "#endif /* ! __cplusplus */",
308 "#ifdef YY_USE_CONST",
309 "#define yyconst const",
310 "#else",
311 "#define yyconst",
312 "#endif",
314 "%# For compilers that can not handle prototypes.",
315 "%# e.g.,",
316 "%# The function prototype",
317 "%# int foo(int x, char* y);",
318 "%# ",
319 "%# ...should be written as",
320 "%# int foo M4_YY_PARAMS(int x, char* y);",
321 "%# ",
322 "%# ...which could possibly generate",
323 "%# int foo ();",
324 "%# ",
325 "m4_ifdef( [[M4_YY_NO_ANSI_FUNC_PROTOS]],",
326 "[[",
327 " m4_define( [[M4_YY_PARAMS]], [[()]])",
328 "]],",
329 "[[",
330 " m4_define( [[M4_YY_PARAMS]], [[($*)]])",
331 "]])",
333 "%not-for-header",
334 "/* Returned upon end-of-file. */",
335 "#define YY_NULL 0",
336 "%ok-for-header",
338 "%not-for-header",
339 "/* Promotes a possibly negative, possibly signed char to an unsigned",
340 " * integer for use as an array index. If the signed char is negative,",
341 " * we want to instead treat it as an 8-bit unsigned char, hence the",
342 " * double cast.",
343 " */",
344 "#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)",
345 "%ok-for-header",
349 "%if-reentrant",
351 "/* An opaque pointer. */",
352 "#ifndef YY_TYPEDEF_YY_SCANNER_T",
353 "#define YY_TYPEDEF_YY_SCANNER_T",
354 "typedef void* yyscan_t;",
355 "#endif",
357 "%# Declare yyguts variable",
358 "m4_define( [[M4_YY_DECL_GUTS_VAR]], [[struct yyguts_t * yyg = (struct yyguts_t*)yyscanner]])",
359 "%# Perform a noop access on yyguts to prevent unused variable complains",
360 "m4_define( [[M4_YY_NOOP_GUTS_VAR]], [[(void)yyg]])",
361 "%# For use wherever a Global is accessed or assigned.",
362 "m4_define( [[YY_G]], [[yyg->$1]])",
364 "%# For use in function prototypes to append the additional argument.",
365 "m4_define( [[M4_YY_PROTO_LAST_ARG]], [[, yyscan_t yyscanner]])",
366 "m4_define( [[M4_YY_PROTO_ONLY_ARG]], [[yyscan_t yyscanner]])",
368 "%# For use in function definitions to append the additional argument.",
369 "m4_ifdef( [[M4_YY_NO_ANSI_FUNC_DEFS]],",
370 "[[",
371 " m4_define( [[M4_YY_DEF_LAST_ARG]], [[, yyscanner]])",
372 " m4_define( [[M4_YY_DEF_ONLY_ARG]], [[yyscanner]])",
373 "]],",
374 "[[",
375 " m4_define( [[M4_YY_DEF_LAST_ARG]], [[, yyscan_t yyscanner]])",
376 " m4_define( [[M4_YY_DEF_ONLY_ARG]], [[yyscan_t yyscanner]])",
377 "]])",
378 "m4_define( [[M4_YY_DECL_LAST_ARG]], [[yyscan_t yyscanner;]])",
380 "%# For use in function calls to pass the additional argument.",
381 "m4_define( [[M4_YY_CALL_LAST_ARG]], [[, yyscanner]])",
382 "m4_define( [[M4_YY_CALL_ONLY_ARG]], [[yyscanner]])",
384 "%# For use in function documentation to adjust for additional argument.",
385 "m4_define( [[M4_YY_DOC_PARAM]], [[@param yyscanner The scanner object.]])",
387 "/* For convenience, these vars (plus the bison vars far below)",
388 " are macros in the reentrant scanner. */",
389 "#define yyin YY_G(yyin_r)",
390 "#define yyout YY_G(yyout_r)",
391 "#define yyextra YY_G(yyextra_r)",
392 "#define yyleng YY_G(yyleng_r)",
393 "#define yytext YY_G(yytext_r)",
394 "#define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)",
395 "#define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)",
396 "#define yy_flex_debug YY_G(yy_flex_debug_r)",
398 "m4_define( [[M4_YY_INCR_LINENO]],",
399 "[[ ",
400 " do{ yylineno++;",
401 " yycolumn=0;",
402 " }while(0)",
403 "]])",
405 "%endif",
409 "%if-not-reentrant",
411 "m4_define( [[M4_YY_INCR_LINENO]],",
412 "[[ ",
413 " yylineno++;",
414 "]])",
416 "%# Define these macros to be no-ops.",
417 "m4_define( [[M4_YY_DECL_GUTS_VAR]], [[m4_dnl]])",
418 "m4_define( [[M4_YY_NOOP_GUTS_VAR]], [[m4_dnl]])",
419 "m4_define( [[YY_G]], [[($1)]])",
420 "m4_define( [[M4_YY_PROTO_LAST_ARG]])",
421 "m4_define( [[M4_YY_PROTO_ONLY_ARG]], [[void]])",
422 "m4_define( [[M4_YY_DEF_LAST_ARG]])",
424 "m4_ifdef( [[M4_YY_NO_ANSI_FUNC_DEFS]],",
425 "[[",
426 " m4_define( [[M4_YY_DEF_ONLY_ARG]])",
427 "]],",
428 "[[",
429 " m4_define( [[M4_YY_DEF_ONLY_ARG]], [[void]])",
430 "]])",
431 "m4_define([[M4_YY_DECL_LAST_ARG]])",
432 "m4_define([[M4_YY_CALL_LAST_ARG]])",
433 "m4_define([[M4_YY_CALL_ONLY_ARG]])",
434 "m4_define( [[M4_YY_DOC_PARAM]], [[]])",
436 "%endif",
439 "m4_ifdef( [[M4_YY_NO_ANSI_FUNC_DEFS]],",
440 "[[",
441 "%# For compilers that need traditional function definitions.",
442 "%# e.g.,",
443 "%# The function prototype taking 2 arguments",
444 "%# int foo (int x, char* y)",
445 "%#",
446 "%# ...should be written as",
447 "%# int foo YYFARGS2(int,x, char*,y)",
448 "%#",
449 "%# ...which could possibly generate",
450 "%# int foo (x,y,yyscanner)",
451 "%# int x;",
452 "%# char * y;",
453 "%# yyscan_t yyscanner;",
454 "%#",
455 "%# Generate traditional function defs",
456 " m4_define( [[YYFARGS0]], [[(M4_YY_DEF_ONLY_ARG) [[\\]]",
457 " M4_YY_DECL_LAST_ARG]])",
458 " m4_define( [[YYFARGS1]], [[($2 M4_YY_DEF_LAST_ARG) [[\\]]",
459 " $1 $2; [[\\]]",
460 " M4_YY_DECL_LAST_ARG]])",
461 " m4_define( [[YYFARGS2]], [[($2,$4 M4_YY_DEF_LAST_ARG) [[\\]]",
462 " $1 $2; [[\\]]",
463 " $3 $4; [[\\]]",
464 " M4_YY_DECL_LAST_ARG]])",
465 " m4_define( [[YYFARGS3]], [[($2,$4,$6 M4_YY_DEF_LAST_ARG) [[\\]]",
466 " $1 $2; [[\\]]",
467 " $3 $4; [[\\]]",
468 " $5 $6; [[\\]]",
469 " M4_YY_DECL_LAST_ARG]])",
470 "]],",
471 "[[",
472 "%# Generate C99 function defs.",
473 " m4_define( [[YYFARGS0]], [[(M4_YY_DEF_ONLY_ARG)]])",
474 " m4_define( [[YYFARGS1]], [[($1 $2 M4_YY_DEF_LAST_ARG)]])",
475 " m4_define( [[YYFARGS2]], [[($1 $2, $3 $4 M4_YY_DEF_LAST_ARG)]])",
476 " m4_define( [[YYFARGS3]], [[($1 $2, $3 $4, $5 $6 M4_YY_DEF_LAST_ARG)]])",
477 "]])",
479 "m4_ifdef( [[M4_YY_NOT_IN_HEADER]],",
480 "[[",
481 "/* Enter a start condition. This macro really ought to take a parameter,",
482 " * but we do it the disgusting crufty way forced on us by the ()-less",
483 " * definition of BEGIN.",
484 " */",
485 "#define BEGIN YY_G(yy_start) = 1 + 2 *",
486 "]])",
488 "m4_ifdef( [[M4_YY_NOT_IN_HEADER]],",
489 "[[",
490 "/* Translate the current start state into a value that can be later handed",
491 " * to BEGIN to return to the state. The YYSTATE alias is for lex",
492 " * compatibility.",
493 " */",
494 "#define YY_START ((YY_G(yy_start) - 1) / 2)",
495 "#define YYSTATE YY_START",
496 "]])",
498 "m4_ifdef( [[M4_YY_NOT_IN_HEADER]],",
499 "[[",
500 "/* Action number for EOF rule of a given start state. */",
501 "#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)",
502 "]])",
504 "m4_ifdef( [[M4_YY_NOT_IN_HEADER]],",
505 "[[",
506 "/* Special action meaning \"start processing a new file\". */",
507 "#define YY_NEW_FILE yyrestart( yyin M4_YY_CALL_LAST_ARG )",
508 "]])",
510 "m4_ifdef( [[M4_YY_NOT_IN_HEADER]],",
511 "[[",
512 "#define YY_END_OF_BUFFER_CHAR 0",
513 "]])",
515 "/* Size of default input buffer. */",
516 "#ifndef YY_BUF_SIZE",
517 "#define YY_BUF_SIZE 16384",
518 "#endif",
520 "m4_ifdef( [[M4_YY_NOT_IN_HEADER]],",
521 "[[",
522 "/* The state buf must be large enough to hold one state per character in the main buffer.",
523 " */",
524 "#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))",
525 "]])",
528 "#ifndef YY_TYPEDEF_YY_BUFFER_STATE",
529 "#define YY_TYPEDEF_YY_BUFFER_STATE",
530 "typedef struct yy_buffer_state *YY_BUFFER_STATE;",
531 "#endif",
533 "#ifndef YY_TYPEDEF_YY_SIZE_T",
534 "#define YY_TYPEDEF_YY_SIZE_T",
535 "typedef size_t yy_size_t;",
536 "#endif",
538 "%if-not-reentrant",
539 "extern yy_size_t yyleng;",
540 "%endif",
542 "%if-c-only",
543 "%if-not-reentrant",
544 "extern FILE *yyin, *yyout;",
545 "%endif",
546 "%endif",
548 "m4_ifdef( [[M4_YY_NOT_IN_HEADER]],",
549 "[[",
550 "#define EOB_ACT_CONTINUE_SCAN 0",
551 "#define EOB_ACT_END_OF_FILE 1",
552 "#define EOB_ACT_LAST_MATCH 2",
553 "]])",
555 "m4_ifdef( [[M4_YY_NOT_IN_HEADER]],",
556 "[[",
557 " m4_ifdef( [[M4_YY_USE_LINENO]],",
558 " [[",
559 " /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires",
560 " * access to the local variable yy_act. Since yyless() is a macro, it would break",
561 " * existing scanners that call yyless() from OUTSIDE yylex. ",
562 " * One obvious solution it to make yy_act a global. I tried that, and saw",
563 " * a 5% performance hit in a non-yylineno scanner, because yy_act is",
564 " * normally declared as a register variable-- so it is not worth it.",
565 " */",
566 " #define YY_LESS_LINENO(n) \\",
567 " do { \\",
568 " int yyl;\\",
569 " for ( yyl = n; yyl < yyleng; ++yyl )\\",
570 " if ( yytext[yyl] == '\\n' )\\",
571 " --yylineno;\\",
572 " }while(0)",
573 " ]],",
574 " [[",
575 " #define YY_LESS_LINENO(n)",
576 " ]])",
577 "]])",
579 "m4_ifdef( [[M4_YY_NOT_IN_HEADER]],",
580 "[[",
581 "/* Return all but the first \"n\" matched characters back to the input stream. */",
582 "#define yyless(n) \\",
583 " do \\",
584 " { \\",
585 " /* Undo effects of setting up yytext. */ \\",
586 " int yyless_macro_arg = (n); \\",
587 " YY_LESS_LINENO(yyless_macro_arg);\\",
588 " *yy_cp = YY_G(yy_hold_char); \\",
589 " YY_RESTORE_YY_MORE_OFFSET \\",
590 " YY_G(yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \\",
591 " YY_DO_BEFORE_ACTION; /* set up yytext again */ \\",
592 " } \\",
593 " while ( 0 )",
594 "]])",
596 "m4_ifdef( [[M4_YY_NOT_IN_HEADER]],",
597 "[[",
598 "#define unput(c) yyunput( c, YY_G(yytext_ptr) M4_YY_CALL_LAST_ARG )",
599 "]])",
601 "#ifndef YY_STRUCT_YY_BUFFER_STATE",
602 "#define YY_STRUCT_YY_BUFFER_STATE",
603 "struct yy_buffer_state",
604 " {",
605 "%if-c-only",
606 " FILE *yy_input_file;",
607 "%endif",
609 "%if-c++-only",
610 " std::istream* yy_input_file;",
611 "%endif",
614 " char *yy_ch_buf; /* input buffer */",
615 " char *yy_buf_pos; /* current position in input buffer */",
617 " /* Size of input buffer in bytes, not including room for EOB",
618 " * characters.",
619 " */",
620 " yy_size_t yy_buf_size;",
622 " /* Number of characters read into yy_ch_buf, not including EOB",
623 " * characters.",
624 " */",
625 " yy_size_t yy_n_chars;",
627 " /* Whether we \"own\" the buffer - i.e., we know we created it,",
628 " * and can realloc() it to grow it, and should free() it to",
629 " * delete it.",
630 " */",
631 " int yy_is_our_buffer;",
633 " /* Whether this is an \"interactive\" input source; if so, and",
634 " * if we're using stdio for input, then we want to use getc()",
635 " * instead of fread(), to make sure we stop fetching input after",
636 " * each newline.",
637 " */",
638 " int yy_is_interactive;",
640 " /* Whether we're considered to be at the beginning of a line.",
641 " * If so, '^' rules will be active on the next match, otherwise",
642 " * not.",
643 " */",
644 " int yy_at_bol;",
646 " int yy_bs_lineno; /**< The line count. */",
647 " int yy_bs_column; /**< The column count. */",
648 " ",
650 " /* Whether to try to fill the input buffer when we reach the",
651 " * end of it.",
652 " */",
653 " int yy_fill_buffer;",
655 " int yy_buffer_status;",
656 "m4_ifdef( [[M4_YY_NOT_IN_HEADER]],",
657 "[[",
658 "#define YY_BUFFER_NEW 0",
659 "#define YY_BUFFER_NORMAL 1",
660 " /* When an EOF's been seen but there's still some text to process",
661 " * then we mark the buffer as YY_EOF_PENDING, to indicate that we",
662 " * shouldn't try reading from the input source any more. We might",
663 " * still have a bunch of tokens to match, though, because of",
664 " * possible backing-up.",
665 " *",
666 " * When we actually see the EOF, we change the status to \"new\"",
667 " * (via yyrestart()), so that the user can continue scanning by",
668 " * just pointing yyin at a new input file.",
669 " */",
670 "#define YY_BUFFER_EOF_PENDING 2",
671 "]])",
672 " };",
673 "#endif /* !YY_STRUCT_YY_BUFFER_STATE */",
675 "%if-c-only Standard (non-C++) definition",
676 "%not-for-header",
677 "%if-not-reentrant",
679 "/* Stack of input buffers. */",
680 "static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */",
681 "static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */",
682 "static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */",
683 "%endif",
684 "%ok-for-header",
685 "%endif",
687 "m4_ifdef( [[M4_YY_NOT_IN_HEADER]],",
688 "[[",
689 "/* We provide macros for accessing buffer states in case in the",
690 " * future we want to put the buffer states in a more general",
691 " * \"scanner state\".",
692 " *",
693 " * Returns the top of the stack, or NULL.",
694 " */",
695 "#define YY_CURRENT_BUFFER ( YY_G(yy_buffer_stack) \\",
696 " ? YY_G(yy_buffer_stack)[YY_G(yy_buffer_stack_top)] \\",
697 " : NULL)",
698 "]])",
700 "m4_ifdef( [[M4_YY_NOT_IN_HEADER]],",
701 "[[",
702 "/* Same as previous macro, but useful when we know that the buffer stack is not",
703 " * NULL or when we need an lvalue. For internal use only.",
704 " */",
705 "#define YY_CURRENT_BUFFER_LVALUE YY_G(yy_buffer_stack)[YY_G(yy_buffer_stack_top)]",
706 "]])",
708 "%if-c-only Standard (non-C++) definition",
710 "%if-not-reentrant",
711 "%not-for-header",
712 "/* yy_hold_char holds the character lost when yytext is formed. */",
713 "static char yy_hold_char;",
714 "static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */",
715 "yy_size_t yyleng;",
717 "/* Points to current character in buffer. */",
718 "static char *yy_c_buf_p = (char *) 0;",
719 "static int yy_init = 0; /* whether we need to initialize */",
720 "static int yy_start = 0; /* start state number */",
722 "/* Flag which is used to allow yywrap()'s to do buffer switches",
723 " * instead of setting up a fresh yyin. A bit of a hack ...",
724 " */",
725 "static int yy_did_buffer_switch_on_eof;",
726 "%ok-for-header",
727 "%endif",
729 "void yyrestart M4_YY_PARAMS( FILE *input_file M4_YY_PROTO_LAST_ARG );",
730 "void yy_switch_to_buffer M4_YY_PARAMS( YY_BUFFER_STATE new_buffer M4_YY_PROTO_LAST_ARG );",
731 "YY_BUFFER_STATE yy_create_buffer M4_YY_PARAMS( FILE *file, int size M4_YY_PROTO_LAST_ARG );",
732 "void yy_delete_buffer M4_YY_PARAMS( YY_BUFFER_STATE b M4_YY_PROTO_LAST_ARG );",
733 "void yy_flush_buffer M4_YY_PARAMS( YY_BUFFER_STATE b M4_YY_PROTO_LAST_ARG );",
734 "void yypush_buffer_state M4_YY_PARAMS( YY_BUFFER_STATE new_buffer M4_YY_PROTO_LAST_ARG );",
735 "void yypop_buffer_state M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG );",
737 "m4_ifdef( [[M4_YY_NOT_IN_HEADER]],",
738 "[[",
739 "static void yyensure_buffer_stack M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG );",
740 "static void yy_load_buffer_state M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG );",
741 "static void yy_init_buffer M4_YY_PARAMS( YY_BUFFER_STATE b, FILE *file M4_YY_PROTO_LAST_ARG );",
742 "]])",
744 "m4_ifdef( [[M4_YY_NOT_IN_HEADER]],",
745 "[[",
746 "#define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER M4_YY_CALL_LAST_ARG)",
747 "]])",
749 "YY_BUFFER_STATE yy_scan_buffer M4_YY_PARAMS( char *base, yy_size_t size M4_YY_PROTO_LAST_ARG );",
750 "YY_BUFFER_STATE yy_scan_string M4_YY_PARAMS( yyconst char *yy_str M4_YY_PROTO_LAST_ARG );",
751 "YY_BUFFER_STATE yy_scan_bytes M4_YY_PARAMS( yyconst char *bytes, yy_size_t len M4_YY_PROTO_LAST_ARG );",
753 "%endif",
755 "void *yyalloc M4_YY_PARAMS( yy_size_t M4_YY_PROTO_LAST_ARG );",
756 "void *yyrealloc M4_YY_PARAMS( void *, yy_size_t M4_YY_PROTO_LAST_ARG );",
757 "void yyfree M4_YY_PARAMS( void * M4_YY_PROTO_LAST_ARG );",
759 "m4_ifdef( [[M4_YY_NOT_IN_HEADER]],",
760 "[[",
761 "#define yy_new_buffer yy_create_buffer",
762 "]])",
764 "m4_ifdef( [[M4_YY_NOT_IN_HEADER]],",
765 "[[",
766 "#define yy_set_interactive(is_interactive) \\",
767 " { \\",
768 " if ( ! YY_CURRENT_BUFFER ){ \\",
769 " yyensure_buffer_stack (M4_YY_CALL_ONLY_ARG); \\",
770 " YY_CURRENT_BUFFER_LVALUE = \\",
771 " yy_create_buffer( yyin, YY_BUF_SIZE M4_YY_CALL_LAST_ARG); \\",
772 " } \\",
773 " YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \\",
774 " }",
775 "]])",
777 "m4_ifdef( [[M4_YY_NOT_IN_HEADER]],",
778 "[[",
779 "#define yy_set_bol(at_bol) \\",
780 " { \\",
781 " if ( ! YY_CURRENT_BUFFER ){\\",
782 " yyensure_buffer_stack (M4_YY_CALL_ONLY_ARG); \\",
783 " YY_CURRENT_BUFFER_LVALUE = \\",
784 " yy_create_buffer( yyin, YY_BUF_SIZE M4_YY_CALL_LAST_ARG); \\",
785 " } \\",
786 " YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \\",
787 " }",
788 "]])",
790 "m4_ifdef( [[M4_YY_NOT_IN_HEADER]],",
791 "[[",
792 "#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)",
793 "]])",
795 "%% [1.0] yytext/yyin/yyout/yy_state_type/yylineno etc. def's & init go here",
797 "%if-c-only Standard (non-C++) definition",
799 "m4_ifdef( [[M4_YY_NOT_IN_HEADER]],",
800 "[[",
801 "static yy_state_type yy_get_previous_state M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG );",
802 "static yy_state_type yy_try_NUL_trans M4_YY_PARAMS( yy_state_type current_state M4_YY_PROTO_LAST_ARG);",
803 "static int yy_get_next_buffer M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG );",
804 "static void yy_fatal_error M4_YY_PARAMS( yyconst char msg[] M4_YY_PROTO_LAST_ARG );",
805 "]])",
807 "%endif",
809 "m4_ifdef( [[M4_YY_NOT_IN_HEADER]],",
810 "[[",
811 "/* Done after the current pattern has been matched and before the",
812 " * corresponding action - sets up yytext.",
813 " */",
814 "#define YY_DO_BEFORE_ACTION \\",
815 " YY_G(yytext_ptr) = yy_bp; \\",
816 "%% [2.0] code to fiddle yytext and yyleng for yymore() goes here \\",
817 " YY_G(yy_hold_char) = *yy_cp; \\",
818 " *yy_cp = '\\0'; \\",
819 "%% [3.0] code to copy yytext_ptr to yytext[] goes here, if %array \\",
820 " YY_G(yy_c_buf_p) = yy_cp;",
821 "]])",
823 "m4_ifdef( [[M4_YY_NOT_IN_HEADER]],",
824 "[[",
825 "%% [4.0] data tables for the DFA and the user's section 1 definitions go here",
826 "]])",
828 "m4_ifdef( [[M4_YY_IN_HEADER]], [[#ifdef YY_HEADER_EXPORT_START_CONDITIONS]])",
829 "M4_YY_SC_DEFS",
830 "m4_ifdef( [[M4_YY_IN_HEADER]], [[#endif]])",
832 "m4_ifdef( [[M4_YY_NO_UNISTD_H]],,",
833 "[[",
834 "#ifndef YY_NO_UNISTD_H",
835 "/* Special case for \"unistd.h\", since it is non-ANSI. We include it way",
836 " * down here because we want the user's section 1 to have been scanned first.",
837 " * The user has a chance to override it with an option.",
838 " */",
839 "%if-c-only",
840 "#include <unistd.h>",
841 "%endif",
842 "%if-c++-only",
843 "#include <unistd.h>",
844 "%endif",
845 "#endif",
846 "]])",
848 "m4_ifdef( [[M4_EXTRA_TYPE_DEFS]],",
849 "[[",
850 "#define YY_EXTRA_TYPE M4_EXTRA_TYPE_DEFS",
851 "]],",
852 "[[",
853 "#ifndef YY_EXTRA_TYPE",
854 "#define YY_EXTRA_TYPE void *",
855 "#endif",
856 "]]",
857 ")",
859 "%if-c-only Reentrant structure and macros (non-C++).",
860 "%if-reentrant",
862 "m4_ifdef( [[M4_YY_NOT_IN_HEADER]],",
863 "[[",
864 "/* Holds the entire state of the reentrant scanner. */",
865 "struct yyguts_t",
866 " {",
868 " /* User-defined. Not touched by flex. */",
869 " YY_EXTRA_TYPE yyextra_r;",
871 " /* The rest are the same as the globals declared in the non-reentrant scanner. */",
872 " FILE *yyin_r, *yyout_r;",
873 " size_t yy_buffer_stack_top; /**< index of top of stack. */",
874 " size_t yy_buffer_stack_max; /**< capacity of stack. */",
875 " YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */",
876 " char yy_hold_char;",
877 " yy_size_t yy_n_chars;",
878 " yy_size_t yyleng_r;",
879 " char *yy_c_buf_p;",
880 " int yy_init;",
881 " int yy_start;",
882 " int yy_did_buffer_switch_on_eof;",
883 " int yy_start_stack_ptr;",
884 " int yy_start_stack_depth;",
885 " int *yy_start_stack;",
886 " yy_state_type yy_last_accepting_state;",
887 " char* yy_last_accepting_cpos;",
889 " int yylineno_r;",
890 " int yy_flex_debug_r;",
892 "m4_ifdef( [[M4_YY_USES_REJECT]],",
893 "[[",
894 " yy_state_type *yy_state_buf;",
895 " yy_state_type *yy_state_ptr;",
896 " char *yy_full_match;",
897 " int yy_lp;",
899 " /* These are only needed for trailing context rules,",
900 " * but there's no conditional variable for that yet. */",
901 " int yy_looking_for_trail_begin;",
902 " int yy_full_lp;",
903 " int *yy_full_state;",
904 "]])",
906 "m4_ifdef( [[M4_YY_TEXT_IS_ARRAY]],",
907 "[[",
908 " char yytext_r[YYLMAX];",
909 " char *yytext_ptr;",
910 " int yy_more_offset;",
911 " int yy_prev_more_offset;",
912 "]],",
913 "[[",
914 " char *yytext_r;",
915 " int yy_more_flag;",
916 " int yy_more_len;",
917 "]])",
919 "m4_ifdef( [[M4_YY_BISON_LVAL]],",
920 "[[",
921 " YYSTYPE * yylval_r;",
922 "]])",
924 "m4_ifdef( [[<M4_YY_BISON_LLOC>]],",
925 "[[",
926 " YYLTYPE * yylloc_r;",
927 "]])",
929 " }; /* end struct yyguts_t */",
930 "]])",
933 "%if-c-only",
934 "m4_ifdef( [[M4_YY_NOT_IN_HEADER]],",
935 "[[",
936 "static int yy_init_globals M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG );",
937 "]])",
938 "%endif",
940 "%if-reentrant",
942 "m4_ifdef( [[M4_YY_NOT_IN_HEADER]],",
943 "[[",
944 " m4_ifdef( [[M4_YY_BISON_LVAL]],",
945 " [[",
946 " /* This must go here because YYSTYPE and YYLTYPE are included",
947 " * from bison output in section 1.*/",
948 " # define yylval YY_G(yylval_r)",
949 " ]])",
951 " m4_ifdef( [[<M4_YY_BISON_LLOC>]],",
952 " [[",
953 " # define yylloc YY_G(yylloc_r)",
954 " ]])",
955 "]])",
957 "int yylex_init M4_YY_PARAMS(yyscan_t* scanner);",
959 "int yylex_init_extra M4_YY_PARAMS( YY_EXTRA_TYPE user_defined, yyscan_t* scanner);",
961 "%endif",
963 "%endif End reentrant structures and macros.",
965 "/* Accessor methods to globals.",
966 " These are made visible to non-reentrant scanners for convenience. */",
968 "m4_ifdef( [[M4_YY_NO_DESTROY]],,",
969 "[[",
970 "int yylex_destroy M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG );",
971 "]])",
973 "m4_ifdef( [[M4_YY_NO_GET_DEBUG]],,",
974 "[[",
975 "int yyget_debug M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG );",
976 "]])",
978 "m4_ifdef( [[M4_YY_NO_SET_DEBUG]],,",
979 "[[",
980 "void yyset_debug M4_YY_PARAMS( int debug_flag M4_YY_PROTO_LAST_ARG );",
981 "]])",
983 "m4_ifdef( [[M4_YY_NO_GET_EXTRA]],,",
984 "[[",
985 "YY_EXTRA_TYPE yyget_extra M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG );",
986 "]])",
988 "m4_ifdef( [[M4_YY_NO_SET_EXTRA]],,",
989 "[[",
990 "void yyset_extra M4_YY_PARAMS( YY_EXTRA_TYPE user_defined M4_YY_PROTO_LAST_ARG );",
991 "]])",
993 "m4_ifdef( [[M4_YY_NO_GET_IN]],,",
994 "[[",
995 "FILE *yyget_in M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG );",
996 "]])",
998 "m4_ifdef( [[M4_YY_NO_SET_IN]],,",
999 "[[",
1000 "void yyset_in M4_YY_PARAMS( FILE * in_str M4_YY_PROTO_LAST_ARG );",
1001 "]])",
1003 "m4_ifdef( [[M4_YY_NO_GET_OUT]],,",
1004 "[[",
1005 "FILE *yyget_out M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG );",
1006 "]])",
1008 "m4_ifdef( [[M4_YY_NO_SET_OUT]],,",
1009 "[[",
1010 "void yyset_out M4_YY_PARAMS( FILE * out_str M4_YY_PROTO_LAST_ARG );",
1011 "]])",
1013 "m4_ifdef( [[M4_YY_NO_GET_LENG]],,",
1014 "[[",
1015 "yy_size_t yyget_leng M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG );",
1016 "]])",
1018 "m4_ifdef( [[M4_YY_NO_GET_TEXT]],,",
1019 "[[",
1020 "char *yyget_text M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG );",
1021 "]])",
1023 "m4_ifdef( [[M4_YY_NO_GET_LINENO]],,",
1024 "[[",
1025 "int yyget_lineno M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG );",
1026 "]])",
1028 "m4_ifdef( [[M4_YY_NO_SET_LINENO]],,",
1029 "[[",
1030 "void yyset_lineno M4_YY_PARAMS( int line_number M4_YY_PROTO_LAST_ARG );",
1031 "]])",
1033 "m4_ifdef( [[M4_YY_REENTRANT]],",
1034 "[[",
1035 "m4_ifdef( [[M4_YY_NO_GET_COLUMN]],,",
1036 "[[",
1037 "int yyget_column M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG );",
1038 "]])",
1039 "]])",
1041 "m4_ifdef( [[M4_YY_REENTRANT]],",
1042 "[[",
1043 "m4_ifdef( [[M4_YY_NO_SET_COLUMN]],,",
1044 "[[",
1045 "void yyset_column M4_YY_PARAMS( int column_no M4_YY_PROTO_LAST_ARG );",
1046 "]])",
1047 "]])",
1049 "%if-bison-bridge",
1050 "m4_ifdef( [[M4_YY_NO_GET_LVAL]],,",
1051 "[[",
1052 "YYSTYPE * yyget_lval M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG );",
1053 "]])",
1055 "void yyset_lval M4_YY_PARAMS( YYSTYPE * yylval_param M4_YY_PROTO_LAST_ARG );",
1057 "m4_ifdef( [[<M4_YY_BISON_LLOC>]],",
1058 "[[",
1059 " m4_ifdef( [[M4_YY_NO_GET_LLOC]],,",
1060 " [[",
1061 " YYLTYPE *yyget_lloc M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG );",
1062 " ]])",
1064 " m4_ifdef( [[M4_YY_NO_SET_LLOC]],,",
1065 " [[",
1066 " void yyset_lloc M4_YY_PARAMS( YYLTYPE * yylloc_param M4_YY_PROTO_LAST_ARG );",
1067 " ]])",
1068 "]])",
1069 "%endif",
1071 "/* Macros after this point can all be overridden by user definitions in",
1072 " * section 1.",
1073 " */",
1075 "#ifndef YY_SKIP_YYWRAP",
1076 "#ifdef __cplusplus",
1077 "extern \"C\" int yywrap M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG );",
1078 "#else",
1079 "extern int yywrap M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG );",
1080 "#endif",
1081 "#endif",
1083 "%not-for-header",
1084 " m4_ifdef( [[M4_YY_NO_UNPUT]],,",
1085 " [[",
1086 " static void yyunput M4_YY_PARAMS( int c, char *buf_ptr M4_YY_PROTO_LAST_ARG);",
1087 " ]])",
1088 "%ok-for-header",
1089 "%endif",
1091 "#ifndef yytext_ptr",
1092 "static void yy_flex_strncpy M4_YY_PARAMS( char *, yyconst char *, int M4_YY_PROTO_LAST_ARG);",
1093 "#endif",
1095 "#ifdef YY_NEED_STRLEN",
1096 "static int yy_flex_strlen M4_YY_PARAMS( yyconst char * M4_YY_PROTO_LAST_ARG);",
1097 "#endif",
1099 "#ifndef YY_NO_INPUT",
1100 "%if-c-only Standard (non-C++) definition",
1101 "%not-for-header",
1102 "#ifdef __cplusplus",
1103 "static int yyinput M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG );",
1104 "#else",
1105 "static int input M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG );",
1106 "#endif",
1107 "%ok-for-header",
1108 "%endif",
1109 "#endif",
1112 "%if-c-only",
1113 "%# TODO: This is messy.",
1114 "m4_ifdef( [[M4_YY_STACK_USED]],",
1115 "[[",
1117 "m4_ifdef( [[M4_YY_NOT_REENTRANT]],",
1118 "[[",
1119 " m4_ifdef( [[M4_YY_NOT_IN_HEADER]],",
1120 " [[",
1121 " static int yy_start_stack_ptr = 0;",
1122 " static int yy_start_stack_depth = 0;",
1123 " static int *yy_start_stack = NULL;",
1124 " ]])",
1125 "]])",
1127 "m4_ifdef( [[M4_YY_NOT_IN_HEADER]],",
1128 "[[",
1129 " m4_ifdef( [[M4_YY_NO_PUSH_STATE]],,",
1130 " [[",
1131 " static void yy_push_state M4_YY_PARAMS( int new_state M4_YY_PROTO_LAST_ARG);",
1132 " ]])",
1133 " m4_ifdef( [[M4_YY_NO_POP_STATE]],,",
1134 " [[",
1135 " static void yy_pop_state M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG );",
1136 " ]])",
1137 " m4_ifdef( [[M4_YY_NO_TOP_STATE]],,",
1138 " [[",
1139 " static int yy_top_state M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG );",
1140 " ]])",
1141 "]])",
1143 "]],",
1144 "[[",
1145 "m4_define( [[M4_YY_NO_PUSH_STATE]])",
1146 "m4_define( [[M4_YY_NO_POP_STATE]])",
1147 "m4_define( [[M4_YY_NO_TOP_STATE]])",
1148 "]])",
1149 "%endif",
1151 "/* Amount of stuff to slurp up with each read. */",
1152 "#ifndef YY_READ_BUF_SIZE",
1153 "#define YY_READ_BUF_SIZE 8192",
1154 "#endif",
1156 "m4_ifdef( [[M4_YY_NOT_IN_HEADER]],",
1157 "[[",
1158 "/* Copy whatever the last rule matched to the standard output. */",
1159 "#ifndef ECHO",
1160 "%if-c-only Standard (non-C++) definition",
1161 "/* This used to be an fputs(), but since the string might contain NUL's,",
1162 " * we now use fwrite().",
1163 " */",
1164 "#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)",
1165 "%endif",
1166 "%if-c++-only C++ definition",
1167 "#define ECHO LexerOutput( yytext, yyleng )",
1168 "%endif",
1169 "#endif",
1170 "]])",
1172 "m4_ifdef( [[M4_YY_NOT_IN_HEADER]],",
1173 "[[",
1174 "/* Gets input and stuffs it into \"buf\". number of characters read, or YY_NULL,",
1175 " * is returned in \"result\".",
1176 " */",
1177 "#ifndef YY_INPUT",
1178 "#define YY_INPUT(buf,result,max_size) \\",
1179 "%% [5.0] fread()/read() definition of YY_INPUT goes here unless we're doing C++ \\",
1180 "\\",
1181 "%if-c++-only C++ definition \\",
1182 " if ( (result = LexerInput( (char *) buf, max_size )) < 0 ) \\",
1183 " YY_FATAL_ERROR( \"input in flex scanner failed\" );",
1184 "%endif",
1186 "#endif",
1187 "]])",
1189 "m4_ifdef( [[M4_YY_NOT_IN_HEADER]],",
1190 "[[",
1191 "/* No semi-colon after return; correct usage is to write \"yyterminate();\" -",
1192 " * we don't want an extra ';' after the \"return\" because that will cause",
1193 " * some compilers to complain about unreachable statements.",
1194 " */",
1195 "#ifndef yyterminate",
1196 "#define yyterminate() return YY_NULL",
1197 "#endif",
1198 "]])",
1200 "/* Number of entries by which start-condition stack grows. */",
1201 "#ifndef YY_START_STACK_INCR",
1202 "#define YY_START_STACK_INCR 25",
1203 "#endif",
1205 "m4_ifdef( [[M4_YY_NOT_IN_HEADER]],",
1206 "[[",
1207 "/* Report a fatal error. */",
1208 "#ifndef YY_FATAL_ERROR",
1209 "%if-c-only",
1210 "#define YY_FATAL_ERROR(msg) yy_fatal_error( msg M4_YY_CALL_LAST_ARG)",
1211 "%endif",
1212 "%if-c++-only",
1213 "#define YY_FATAL_ERROR(msg) LexerError( msg )",
1214 "%endif",
1215 "#endif",
1216 "]])",
1218 "%if-tables-serialization structures and prototypes",
1219 "#ifdef FLEX_SCANNER",
1220 "/*",
1221 "dnl tables_shared.h - tables serialization header",
1222 "dnl",
1223 "dnl Copyright (c) 1990 The Regents of the University of California.",
1224 "dnl All rights reserved.",
1225 "dnl",
1226 "dnl This code is derived from software contributed to Berkeley by",
1227 "dnl Vern Paxson.",
1228 "dnl",
1229 "dnl The United States Government has rights in this work pursuant",
1230 "dnl to contract no. DE-AC03-76SF00098 between the United States",
1231 "dnl Department of Energy and the University of California.",
1232 "dnl",
1233 "dnl This file is part of flex.",
1234 "dnl",
1235 "dnl Redistribution and use in source and binary forms, with or without",
1236 "dnl modification, are permitted provided that the following conditions",
1237 "dnl are met:",
1238 "dnl",
1239 "dnl 1. Redistributions of source code must retain the above copyright",
1240 "dnl notice, this list of conditions and the following disclaimer.",
1241 "dnl 2. Redistributions in binary form must reproduce the above copyright",
1242 "dnl notice, this list of conditions and the following disclaimer in the",
1243 "dnl documentation and/or other materials provided with the distribution.",
1244 "dnl",
1245 "dnl Neither the name of the University nor the names of its contributors",
1246 "dnl may be used to endorse or promote products derived from this software",
1247 "dnl without specific prior written permission.",
1248 "dnl",
1249 "dnl THIS SOFTWARE IS PROVIDED `AS IS' AND WITHOUT ANY EXPRESS OR",
1250 "dnl IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED",
1251 "dnl WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR",
1252 "dnl PURPOSE.",
1253 "\f",
1254 "dnl",
1255 "dnl This file is meant to be included in both the skeleton and the actual",
1256 "dnl flex code (hence the name \"_shared\").",
1257 "*/",
1258 "#ifndef yyskel_static",
1259 "#define yyskel_static static",
1260 "#endif",
1261 "#else",
1262 "#ifndef yyskel_static",
1263 "#define yyskel_static",
1264 "#endif",
1265 "#endif",
1267 "/* Structures and prototypes for serializing flex tables. The",
1268 " * binary format is documented in the manual.",
1269 " *",
1270 " * Design considerations:",
1271 " *",
1272 " * - The format allows many tables per file.",
1273 " * - The tables can be streamed.",
1274 " * - All data is stored in network byte order.",
1275 " * - We do not hinder future unicode support.",
1276 " * - We can lookup tables by name.",
1277 " */",
1279 "/** Magic number for serialized format. */",
1280 "#ifndef YYTBL_MAGIC",
1281 "#define YYTBL_MAGIC 0xF13C57B1",
1282 "#endif",
1284 "/** Calculate (0-7) = number bytes needed to pad n to next 64-bit boundary. */",
1285 "#ifndef yypad64",
1286 "#define yypad64(n) ((8-((n)%8))%8)",
1287 "#endif",
1290 "#ifndef YYTABLES_TYPES",
1291 "#define YYTABLES_TYPES",
1292 "/** Possible values for td_id field. Each one corresponds to a",
1293 " * scanner table of the same name.",
1294 " */",
1295 "enum yytbl_id {",
1296 " YYTD_ID_ACCEPT = 0x01, /**< 1-dim ints */",
1297 " YYTD_ID_BASE = 0x02, /**< 1-dim ints */",
1298 " YYTD_ID_CHK = 0x03, /**< 1-dim ints */",
1299 " YYTD_ID_DEF = 0x04, /**< 1-dim ints */",
1300 " YYTD_ID_EC = 0x05, /**< 1-dim ints */",
1301 " YYTD_ID_META = 0x06, /**< 1-dim ints */",
1302 " YYTD_ID_NUL_TRANS = 0x07, /**< 1-dim ints, maybe indices */",
1303 " YYTD_ID_NXT = 0x08, /**< may be 2 dimensional ints */",
1304 " YYTD_ID_RULE_CAN_MATCH_EOL = 0x09, /**< 1-dim ints */",
1305 " YYTD_ID_START_STATE_LIST = 0x0A, /**< 1-dim indices into trans tbl */",
1306 " YYTD_ID_TRANSITION = 0x0B, /**< structs */",
1307 " YYTD_ID_ACCLIST = 0x0C /**< 1-dim ints */",
1308 "};",
1310 "/** bit flags for t_flags field of struct yytbl_data */",
1311 "enum yytbl_flags {",
1312 " /* These first three are mutually exclusive */",
1313 " YYTD_DATA8 = 0x01, /**< data is an array of type flex_int8_t */",
1314 " YYTD_DATA16 = 0x02, /**< data is an array of type flex_int16_t */",
1315 " YYTD_DATA32 = 0x04, /**< data is an array of type flex_int32_t */",
1317 " /* These two are mutually exclusive. */",
1318 " YYTD_PTRANS = 0x08, /**< data is a list of indexes of entries",
1319 " into the expanded yy_transition",
1320 " array. See notes in manual. */",
1321 " YYTD_STRUCT = 0x10 /**< data consists of yy_trans_info structs */",
1322 "};",
1324 "/* The serialized tables header. */",
1325 "struct yytbl_hdr {",
1326 " flex_uint32_t th_magic; /**< Must be 0xF13C57B1 (comes from \"Flex Table\") */",
1327 " flex_uint32_t th_hsize; /**< Size of this header in bytes. */",
1328 " flex_uint32_t th_ssize; /**< Size of this dataset, in bytes, including header. */",
1329 " flex_uint16_t th_flags; /**< Currently unused, must be 0 */",
1330 " char *th_version; /**< Flex version string. NUL terminated. */",
1331 " char *th_name; /**< The name of this table set. NUL terminated. */",
1332 "};",
1334 "/** A single serialized table */",
1335 "struct yytbl_data {",
1336 " flex_uint16_t td_id; /**< enum yytbl_id table identifier */",
1337 " flex_uint16_t td_flags; /**< how to interpret this data */",
1338 " flex_uint32_t td_hilen; /**< num elements in highest dimension array */",
1339 " flex_uint32_t td_lolen; /**< num elements in lowest dimension array */",
1340 " void *td_data; /**< table data */",
1341 "};",
1342 "#endif",
1344 "/** Extract corresponding data size_t from td_flags */",
1345 "#ifndef YYTDFLAGS2BYTES",
1346 "#define YYTDFLAGS2BYTES(td_flags)\\",
1347 " (((td_flags) & YYTD_DATA8)\\",
1348 " ? sizeof(flex_int8_t)\\",
1349 " :(((td_flags) & YYTD_DATA16)\\",
1350 " ? sizeof(flex_int16_t)\\",
1351 " :sizeof(flex_int32_t)))",
1352 "#endif",
1354 "#ifdef FLEX_SCANNER",
1355 "%not-for-header",
1356 "#endif",
1357 "yyskel_static flex_int32_t yytbl_calc_total_len (const struct yytbl_data *tbl);",
1358 "#ifdef FLEX_SCANNER",
1359 "%ok-for-header",
1360 "#endif",
1362 "/* vim:set noexpandtab cindent tabstop=8 softtabstop=0 shiftwidth=8 textwidth=0: */",
1365 "/* Load the DFA tables from the given stream. */",
1366 "int yytables_fload M4_YY_PARAMS(FILE * fp M4_YY_PROTO_LAST_ARG);",
1368 "/* Unload the tables from memory. */",
1369 "int yytables_destroy M4_YY_PARAMS(M4_YY_PROTO_ONLY_ARG);",
1370 "%not-for-header",
1372 "/** Describes a mapping from a serialized table id to its deserialized state in",
1373 " * this scanner. This is the bridge between our \"generic\" deserialization code",
1374 " * and the specifics of this scanner. ",
1375 " */",
1376 "struct yytbl_dmap {",
1377 " enum yytbl_id dm_id;/**< table identifier */",
1378 " void **dm_arr; /**< address of pointer to store the deserialized table. */",
1379 " size_t dm_sz; /**< local sizeof() each element in table. */",
1380 "};",
1382 "/** A {0,0,0}-terminated list of structs, forming the map */",
1383 "static struct yytbl_dmap yydmap[] =",
1384 "{",
1385 "%tables-yydmap generated elements",
1386 " {0,0,0}",
1387 "};",
1389 "/** A tables-reader object to maintain some state in the read. */",
1390 "struct yytbl_reader {",
1391 " FILE * fp; /**< input stream */",
1392 " flex_uint32_t bread; /**< bytes read since beginning of current tableset */",
1393 "};",
1395 "%endif",
1396 "/* end tables serialization structures and prototypes */",
1398 "%ok-for-header",
1400 "/* Default declaration of generated scanner - a define so the user can",
1401 " * easily add parameters.",
1402 " */",
1403 "#ifndef YY_DECL",
1404 "#define YY_DECL_IS_OURS 1",
1405 "%if-c-only Standard (non-C++) definition",
1408 "m4_define( [[M4_YY_LEX_PROTO]], [[M4_YY_PARAMS(M4_YY_PROTO_ONLY_ARG)]])",
1409 "m4_define( [[M4_YY_LEX_DECLARATION]], [[YYFARGS0(void)]])",
1411 "m4_ifdef( [[M4_YY_BISON_LVAL]],",
1412 "[[",
1413 " m4_dnl The bison pure parser is used. Redefine yylex to",
1414 " m4_dnl accept the lval parameter.",
1416 " m4_define( [[M4_YY_LEX_PROTO]], [[\\]]",
1417 " [[M4_YY_PARAMS(YYSTYPE * yylval_param M4_YY_PROTO_LAST_ARG)]])",
1418 " m4_define( [[M4_YY_LEX_DECLARATION]], [[\\]]",
1419 " [[YYFARGS1(YYSTYPE *,yylval_param)]])",
1420 "]])",
1422 "m4_ifdef( [[<M4_YY_BISON_LLOC>]],",
1423 "[[",
1424 " m4_dnl Locations are used. yylex should also accept the ylloc parameter.",
1426 " m4_define( [[M4_YY_LEX_PROTO]], [[\\]]",
1427 " [[M4_YY_PARAMS(YYSTYPE * yylval_param, YYLTYPE * yylloc_param M4_YY_PROTO_LAST_ARG)]])",
1428 " m4_define( [[M4_YY_LEX_DECLARATION]], [[\\]]",
1429 " [[YYFARGS2(YYSTYPE *,yylval_param, YYLTYPE *,yylloc_param)]])",
1430 "]])",
1432 "extern int yylex M4_YY_LEX_PROTO;",
1434 "#define YY_DECL int yylex M4_YY_LEX_DECLARATION",
1435 "%endif",
1436 "%if-c++-only C++ definition",
1437 "#define YY_DECL int yyFlexLexer::yylex()",
1438 "%endif",
1439 "#endif /* !YY_DECL */",
1441 "m4_ifdef( [[M4_YY_NOT_IN_HEADER]],",
1442 "[[",
1443 "/* Code executed at the beginning of each rule, after yytext and yyleng",
1444 " * have been set up.",
1445 " */",
1446 "#ifndef YY_USER_ACTION",
1447 "#define YY_USER_ACTION",
1448 "#endif",
1449 "]])",
1451 "m4_ifdef( [[M4_YY_NOT_IN_HEADER]],",
1452 "[[",
1453 "/* Code executed at the end of each rule. */",
1454 "#ifndef YY_BREAK",
1455 "#define YY_BREAK break;",
1456 "#endif",
1457 "]])",
1459 "m4_ifdef( [[M4_YY_NOT_IN_HEADER]],",
1460 "[[",
1461 "%% [6.0] YY_RULE_SETUP definition goes here",
1462 "]])",
1464 "%not-for-header",
1465 "/** The main scanner function which does all the work.",
1466 " */",
1467 "YY_DECL",
1468 "{",
1469 " register yy_state_type yy_current_state;",
1470 " register char *yy_cp, *yy_bp;",
1471 " register int yy_act;",
1472 " M4_YY_DECL_GUTS_VAR();",
1474 "m4_ifdef( [[M4_YY_NOT_REENTRANT]],",
1475 "[[",
1476 " m4_ifdef( [[M4_YY_BISON_LVAL]],",
1477 " [[",
1478 " YYSTYPE * yylval;",
1479 " ]])",
1480 " m4_ifdef( [[<M4_YY_BISON_LLOC>]],",
1481 " [[",
1482 " YYLTYPE * yylloc;",
1483 " ]])",
1484 "]])",
1486 "%% [7.0] user's declarations go here",
1488 "m4_ifdef( [[M4_YY_BISON_LVAL]],",
1489 "[[",
1490 " yylval = yylval_param;",
1491 "]])",
1493 "m4_ifdef( [[<M4_YY_BISON_LLOC>]],",
1494 "[[",
1495 " yylloc = yylloc_param;",
1496 "]])",
1498 " if ( !YY_G(yy_init) )",
1499 " {",
1500 " YY_G(yy_init) = 1;",
1502 "#ifdef YY_USER_INIT",
1503 " YY_USER_INIT;",
1504 "#endif",
1506 "m4_ifdef( [[M4_YY_USES_REJECT]],",
1507 "[[",
1508 " /* Create the reject buffer large enough to save one state per allowed character. */",
1509 " if ( ! YY_G(yy_state_buf) )",
1510 " YY_G(yy_state_buf) = (yy_state_type *)yyalloc(YY_STATE_BUF_SIZE M4_YY_CALL_LAST_ARG);",
1511 " if ( ! YY_G(yy_state_buf) )",
1512 " YY_FATAL_ERROR( \"out of dynamic memory in yylex()\" );",
1513 "]])",
1515 " if ( ! YY_G(yy_start) )",
1516 " YY_G(yy_start) = 1; /* first start state */",
1518 " if ( ! yyin )",
1519 "%if-c-only",
1520 " yyin = stdin;",
1521 "%endif",
1522 "%if-c++-only",
1523 " yyin = & std::cin;",
1524 "%endif",
1526 " if ( ! yyout )",
1527 "%if-c-only",
1528 " yyout = stdout;",
1529 "%endif",
1530 "%if-c++-only",
1531 " yyout = & std::cout;",
1532 "%endif",
1534 " if ( ! YY_CURRENT_BUFFER ) {",
1535 " yyensure_buffer_stack (M4_YY_CALL_ONLY_ARG);",
1536 " YY_CURRENT_BUFFER_LVALUE =",
1537 " yy_create_buffer( yyin, YY_BUF_SIZE M4_YY_CALL_LAST_ARG);",
1538 " }",
1540 " yy_load_buffer_state( M4_YY_CALL_ONLY_ARG );",
1541 " }",
1543 " while ( 1 ) /* loops until end-of-file is reached */",
1544 " {",
1545 "%% [8.0] yymore()-related code goes here",
1546 " yy_cp = YY_G(yy_c_buf_p);",
1548 " /* Support of yytext. */",
1549 " *yy_cp = YY_G(yy_hold_char);",
1551 " /* yy_bp points to the position in yy_ch_buf of the start of",
1552 " * the current run.",
1553 " */",
1554 " yy_bp = yy_cp;",
1556 "%% [9.0] code to set up and find next match goes here",
1558 "yy_find_action:",
1559 "%% [10.0] code to find the action number goes here",
1561 " YY_DO_BEFORE_ACTION;",
1563 "%% [11.0] code for yylineno update goes here",
1565 "do_action: /* This label is used only to access EOF actions. */",
1567 "%% [12.0] debug code goes here",
1569 " switch ( yy_act )",
1570 " { /* beginning of action switch */",
1571 "%% [13.0] actions go here",
1573 " case YY_END_OF_BUFFER:",
1574 " {",
1575 " /* Amount of text matched not including the EOB char. */",
1576 " int yy_amount_of_matched_text = (int) (yy_cp - YY_G(yytext_ptr)) - 1;",
1578 " /* Undo the effects of YY_DO_BEFORE_ACTION. */",
1579 " *yy_cp = YY_G(yy_hold_char);",
1580 " YY_RESTORE_YY_MORE_OFFSET",
1582 " if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )",
1583 " {",
1584 " /* We're scanning a new file or input source. It's",
1585 " * possible that this happened because the user",
1586 " * just pointed yyin at a new source and called",
1587 " * yylex(). If so, then we have to assure",
1588 " * consistency between YY_CURRENT_BUFFER and our",
1589 " * globals. Here is the right place to do so, because",
1590 " * this is the first action (other than possibly a",
1591 " * back-up) that will match for the new input source.",
1592 " */",
1593 " YY_G(yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;",
1594 " YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;",
1595 " YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;",
1596 " }",
1598 " /* Note that here we test for yy_c_buf_p \"<=\" to the position",
1599 " * of the first EOB in the buffer, since yy_c_buf_p will",
1600 " * already have been incremented past the NUL character",
1601 " * (since all states make transitions on EOB to the",
1602 " * end-of-buffer state). Contrast this with the test",
1603 " * in input().",
1604 " */",
1605 " if ( YY_G(yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[YY_G(yy_n_chars)] )",
1606 " { /* This was really a NUL. */",
1607 " yy_state_type yy_next_state;",
1609 " YY_G(yy_c_buf_p) = YY_G(yytext_ptr) + yy_amount_of_matched_text;",
1611 " yy_current_state = yy_get_previous_state( M4_YY_CALL_ONLY_ARG );",
1613 " /* Okay, we're now positioned to make the NUL",
1614 " * transition. We couldn't have",
1615 " * yy_get_previous_state() go ahead and do it",
1616 " * for us because it doesn't know how to deal",
1617 " * with the possibility of jamming (and we don't",
1618 " * want to build jamming into it because then it",
1619 " * will run more slowly).",
1620 " */",
1622 " yy_next_state = yy_try_NUL_trans( yy_current_state M4_YY_CALL_LAST_ARG);",
1624 " yy_bp = YY_G(yytext_ptr) + YY_MORE_ADJ;",
1626 " if ( yy_next_state )",
1627 " {",
1628 " /* Consume the NUL. */",
1629 " yy_cp = ++YY_G(yy_c_buf_p);",
1630 " yy_current_state = yy_next_state;",
1631 " goto yy_match;",
1632 " }",
1634 " else",
1635 " {",
1636 "%% [14.0] code to do back-up for compressed tables and set up yy_cp goes here",
1637 " goto yy_find_action;",
1638 " }",
1639 " }",
1641 " else switch ( yy_get_next_buffer( M4_YY_CALL_ONLY_ARG ) )",
1642 " {",
1643 " case EOB_ACT_END_OF_FILE:",
1644 " {",
1645 " YY_G(yy_did_buffer_switch_on_eof) = 0;",
1647 " if ( yywrap( M4_YY_CALL_ONLY_ARG ) )",
1648 " {",
1649 " /* Note: because we've taken care in",
1650 " * yy_get_next_buffer() to have set up",
1651 " * yytext, we can now set up",
1652 " * yy_c_buf_p so that if some total",
1653 " * hoser (like flex itself) wants to",
1654 " * call the scanner after we return the",
1655 " * YY_NULL, it'll still work - another",
1656 " * YY_NULL will get returned.",
1657 " */",
1658 " YY_G(yy_c_buf_p) = YY_G(yytext_ptr) + YY_MORE_ADJ;",
1660 " yy_act = YY_STATE_EOF(YY_START);",
1661 " goto do_action;",
1662 " }",
1664 " else",
1665 " {",
1666 " if ( ! YY_G(yy_did_buffer_switch_on_eof) )",
1667 " YY_NEW_FILE;",
1668 " }",
1669 " break;",
1670 " }",
1672 " case EOB_ACT_CONTINUE_SCAN:",
1673 " YY_G(yy_c_buf_p) =",
1674 " YY_G(yytext_ptr) + yy_amount_of_matched_text;",
1676 " yy_current_state = yy_get_previous_state( M4_YY_CALL_ONLY_ARG );",
1678 " yy_cp = YY_G(yy_c_buf_p);",
1679 " yy_bp = YY_G(yytext_ptr) + YY_MORE_ADJ;",
1680 " goto yy_match;",
1682 " case EOB_ACT_LAST_MATCH:",
1683 " YY_G(yy_c_buf_p) =",
1684 " &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[YY_G(yy_n_chars)];",
1686 " yy_current_state = yy_get_previous_state( M4_YY_CALL_ONLY_ARG );",
1688 " yy_cp = YY_G(yy_c_buf_p);",
1689 " yy_bp = YY_G(yytext_ptr) + YY_MORE_ADJ;",
1690 " goto yy_find_action;",
1691 " }",
1692 " break;",
1693 " }",
1695 " default:",
1696 " YY_FATAL_ERROR(",
1697 " \"fatal flex scanner internal error--no action found\" );",
1698 " } /* end of action switch */",
1699 " } /* end of scanning one token */",
1700 "} /* end of yylex */",
1701 "%ok-for-header",
1703 "%if-c++-only",
1704 "%not-for-header",
1705 "/* The contents of this function are C++ specific, so the YY_G macro is not used.",
1706 " */",
1707 "yyFlexLexer::yyFlexLexer( std::istream* arg_yyin, std::ostream* arg_yyout )",
1708 "{",
1709 " yyin = arg_yyin;",
1710 " yyout = arg_yyout;",
1711 " yy_c_buf_p = 0;",
1712 " yy_init = 0;",
1713 " yy_start = 0;",
1714 " yy_flex_debug = 0;",
1715 " yylineno = 1; // this will only get updated if %option yylineno",
1717 " yy_did_buffer_switch_on_eof = 0;",
1719 " yy_looking_for_trail_begin = 0;",
1720 " yy_more_flag = 0;",
1721 " yy_more_len = 0;",
1722 " yy_more_offset = yy_prev_more_offset = 0;",
1724 " yy_start_stack_ptr = yy_start_stack_depth = 0;",
1725 " yy_start_stack = NULL;",
1727 " yy_buffer_stack = 0;",
1728 " yy_buffer_stack_top = 0;",
1729 " yy_buffer_stack_max = 0;",
1732 "m4_ifdef( [[M4_YY_USES_REJECT]],",
1733 "[[",
1734 " yy_state_buf = new yy_state_type[YY_STATE_BUF_SIZE];",
1735 "]],",
1736 "[[",
1737 " yy_state_buf = 0;",
1738 "]])",
1739 "}",
1741 "/* The contents of this function are C++ specific, so the YY_G macro is not used.",
1742 " */",
1743 "yyFlexLexer::~yyFlexLexer()",
1744 "{",
1745 " delete [] yy_state_buf;",
1746 " yyfree( yy_start_stack M4_YY_CALL_LAST_ARG );",
1747 " yy_delete_buffer( YY_CURRENT_BUFFER M4_YY_CALL_LAST_ARG);",
1748 " yyfree( yy_buffer_stack M4_YY_CALL_LAST_ARG );",
1749 "}",
1751 "/* The contents of this function are C++ specific, so the YY_G macro is not used.",
1752 " */",
1753 "void yyFlexLexer::switch_streams( std::istream* new_in, std::ostream* new_out )",
1754 "{",
1755 " if ( new_in )",
1756 " {",
1757 " yy_delete_buffer( YY_CURRENT_BUFFER M4_YY_CALL_LAST_ARG);",
1758 " yy_switch_to_buffer( yy_create_buffer( new_in, YY_BUF_SIZE M4_YY_CALL_LAST_ARG) M4_YY_CALL_LAST_ARG);",
1759 " }",
1761 " if ( new_out )",
1762 " yyout = new_out;",
1763 "}",
1765 "#ifdef YY_INTERACTIVE",
1766 "int yyFlexLexer::LexerInput( char* buf, int /* max_size */ )",
1767 "#else",
1768 "int yyFlexLexer::LexerInput( char* buf, int max_size )",
1769 "#endif",
1770 "{",
1771 " if ( yyin->eof() || yyin->fail() )",
1772 " return 0;",
1774 "#ifdef YY_INTERACTIVE",
1775 " yyin->get( buf[0] );",
1777 " if ( yyin->eof() )",
1778 " return 0;",
1780 " if ( yyin->bad() )",
1781 " return -1;",
1783 " return 1;",
1785 "#else",
1786 " (void) yyin->read( buf, max_size );",
1788 " if ( yyin->bad() )",
1789 " return -1;",
1790 " else",
1791 " return yyin->gcount();",
1792 "#endif",
1793 "}",
1795 "void yyFlexLexer::LexerOutput( const char* buf, int size )",
1796 "{",
1797 " (void) yyout->write( buf, size );",
1798 "}",
1799 "%ok-for-header",
1800 "%endif",
1802 "m4_ifdef( [[M4_YY_NOT_IN_HEADER]],",
1803 "[[",
1804 "/* yy_get_next_buffer - try to read in a new buffer",
1805 " *",
1806 " * Returns a code representing an action:",
1807 " * EOB_ACT_LAST_MATCH -",
1808 " * EOB_ACT_CONTINUE_SCAN - continue scanning from current position",
1809 " * EOB_ACT_END_OF_FILE - end of file",
1810 " */",
1811 "%if-c-only",
1812 "static int yy_get_next_buffer YYFARGS0(void)",
1813 "%endif",
1814 "%if-c++-only",
1815 "int yyFlexLexer::yy_get_next_buffer()",
1816 "%endif",
1817 "{",
1818 " M4_YY_DECL_GUTS_VAR();",
1819 " register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;",
1820 " register char *source = YY_G(yytext_ptr);",
1821 " register int number_to_move, i;",
1822 " int ret_val;",
1824 " if ( YY_G(yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[YY_G(yy_n_chars) + 1] )",
1825 " YY_FATAL_ERROR(",
1826 " \"fatal flex scanner internal error--end of buffer missed\" );",
1828 " if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )",
1829 " { /* Don't try to fill the buffer, so this is an EOF. */",
1830 " if ( YY_G(yy_c_buf_p) - YY_G(yytext_ptr) - YY_MORE_ADJ == 1 )",
1831 " {",
1832 " /* We matched a single character, the EOB, so",
1833 " * treat this as a final EOF.",
1834 " */",
1835 " return EOB_ACT_END_OF_FILE;",
1836 " }",
1838 " else",
1839 " {",
1840 " /* We matched some text prior to the EOB, first",
1841 " * process it.",
1842 " */",
1843 " return EOB_ACT_LAST_MATCH;",
1844 " }",
1845 " }",
1847 " /* Try to read more data. */",
1849 " /* First move last chars to start of buffer. */",
1850 " number_to_move = (int) (YY_G(yy_c_buf_p) - YY_G(yytext_ptr)) - 1;",
1852 " for ( i = 0; i < number_to_move; ++i )",
1853 " *(dest++) = *(source++);",
1855 " if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )",
1856 " /* don't do the read, it's not guaranteed to return an EOF,",
1857 " * just force an EOF",
1858 " */",
1859 " YY_CURRENT_BUFFER_LVALUE->yy_n_chars = YY_G(yy_n_chars) = 0;",
1861 " else",
1862 " {",
1863 " yy_size_t num_to_read =",
1864 " YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;",
1866 " while ( num_to_read <= 0 )",
1867 " { /* Not enough room in the buffer - grow it. */",
1868 "m4_ifdef( [[M4_YY_USES_REJECT]],",
1869 "[[",
1870 " YY_FATAL_ERROR(",
1871 "\"input buffer overflow, can't enlarge buffer because scanner uses REJECT\" );",
1872 "]],",
1873 "[[",
1874 " /* just a shorter name for the current buffer */",
1875 " YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;",
1877 " int yy_c_buf_p_offset =",
1878 " (int) (YY_G(yy_c_buf_p) - b->yy_ch_buf);",
1880 " if ( b->yy_is_our_buffer )",
1881 " {",
1882 " yy_size_t new_size = b->yy_buf_size * 2;",
1884 " if ( new_size <= 0 )",
1885 " b->yy_buf_size += b->yy_buf_size / 8;",
1886 " else",
1887 " b->yy_buf_size *= 2;",
1889 " b->yy_ch_buf = (char *)",
1890 " /* Include room in for 2 EOB chars. */",
1891 " yyrealloc( (void *) b->yy_ch_buf,",
1892 " b->yy_buf_size + 2 M4_YY_CALL_LAST_ARG );",
1893 " }",
1894 " else",
1895 " /* Can't grow it, we don't own it. */",
1896 " b->yy_ch_buf = 0;",
1898 " if ( ! b->yy_ch_buf )",
1899 " YY_FATAL_ERROR(",
1900 " \"fatal error - scanner input buffer overflow\" );",
1902 " YY_G(yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];",
1904 " num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -",
1905 " number_to_move - 1;",
1906 "]])",
1907 " }",
1909 " if ( num_to_read > YY_READ_BUF_SIZE )",
1910 " num_to_read = YY_READ_BUF_SIZE;",
1912 " /* Read in more data. */",
1913 " YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),",
1914 " YY_G(yy_n_chars), num_to_read );",
1916 " YY_CURRENT_BUFFER_LVALUE->yy_n_chars = YY_G(yy_n_chars);",
1917 " }",
1919 " if ( YY_G(yy_n_chars) == 0 )",
1920 " {",
1921 " if ( number_to_move == YY_MORE_ADJ )",
1922 " {",
1923 " ret_val = EOB_ACT_END_OF_FILE;",
1924 " yyrestart( yyin M4_YY_CALL_LAST_ARG);",
1925 " }",
1927 " else",
1928 " {",
1929 " ret_val = EOB_ACT_LAST_MATCH;",
1930 " YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =",
1931 " YY_BUFFER_EOF_PENDING;",
1932 " }",
1933 " }",
1935 " else",
1936 " ret_val = EOB_ACT_CONTINUE_SCAN;",
1938 " if ((yy_size_t) (YY_G(yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {",
1939 " /* Extend the array by 50%, plus the number we really need. */",
1940 " yy_size_t new_size = YY_G(yy_n_chars) + number_to_move + (YY_G(yy_n_chars) >> 1);",
1941 " YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc(",
1942 " (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, new_size M4_YY_CALL_LAST_ARG );",
1943 " if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )",
1944 " YY_FATAL_ERROR( \"out of dynamic memory in yy_get_next_buffer()\" );",
1945 " }",
1947 " YY_G(yy_n_chars) += number_to_move;",
1948 " YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[YY_G(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;",
1949 " YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[YY_G(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;",
1951 " YY_G(yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];",
1953 " return ret_val;",
1954 "}",
1955 "]])",
1957 "/* yy_get_previous_state - get the state just before the EOB char was reached */",
1959 "%if-c-only",
1960 "%not-for-header",
1961 " static yy_state_type yy_get_previous_state YYFARGS0(void)",
1962 "%endif",
1963 "%if-c++-only",
1964 " yy_state_type yyFlexLexer::yy_get_previous_state()",
1965 "%endif",
1966 "{",
1967 " register yy_state_type yy_current_state;",
1968 " register char *yy_cp;",
1969 " M4_YY_DECL_GUTS_VAR();",
1971 "%% [15.0] code to get the start state into yy_current_state goes here",
1973 " for ( yy_cp = YY_G(yytext_ptr) + YY_MORE_ADJ; yy_cp < YY_G(yy_c_buf_p); ++yy_cp )",
1974 " {",
1975 "%% [16.0] code to find the next state goes here",
1976 " }",
1978 " return yy_current_state;",
1979 "}",
1982 "/* yy_try_NUL_trans - try to make a transition on the NUL character",
1983 " *",
1984 " * synopsis",
1985 " * next_state = yy_try_NUL_trans( current_state );",
1986 " */",
1987 "%if-c-only",
1988 " static yy_state_type yy_try_NUL_trans YYFARGS1( yy_state_type, yy_current_state)",
1989 "%endif",
1990 "%if-c++-only",
1991 " yy_state_type yyFlexLexer::yy_try_NUL_trans( yy_state_type yy_current_state )",
1992 "%endif",
1993 "{",
1994 " register int yy_is_jam;",
1995 " M4_YY_DECL_GUTS_VAR(); /* This var may be unused depending upon options. */",
1996 "%% [17.0] code to find the next state, and perhaps do backing up, goes here",
1998 " M4_YY_NOOP_GUTS_VAR();",
1999 " return yy_is_jam ? 0 : yy_current_state;",
2000 "}",
2003 "%if-c-only",
2004 "m4_ifdef( [[M4_YY_NO_UNPUT]],,",
2005 "[[",
2006 " static void yyunput YYFARGS2( int,c, register char *,yy_bp)",
2007 "%endif",
2008 "%if-c++-only",
2009 " void yyFlexLexer::yyunput( int c, register char* yy_bp)",
2010 "%endif",
2011 "{",
2012 " register char *yy_cp;",
2013 " M4_YY_DECL_GUTS_VAR();",
2015 " yy_cp = YY_G(yy_c_buf_p);",
2017 " /* undo effects of setting up yytext */",
2018 " *yy_cp = YY_G(yy_hold_char);",
2020 " if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )",
2021 " { /* need to shift things up to make room */",
2022 " /* +2 for EOB chars. */",
2023 " register yy_size_t number_to_move = YY_G(yy_n_chars) + 2;",
2024 " register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[",
2025 " YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];",
2026 " register char *source =",
2027 " &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];",
2029 " while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )",
2030 " *--dest = *--source;",
2032 " yy_cp += (int) (dest - source);",
2033 " yy_bp += (int) (dest - source);",
2034 " YY_CURRENT_BUFFER_LVALUE->yy_n_chars =",
2035 " YY_G(yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;",
2037 " if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )",
2038 " YY_FATAL_ERROR( \"flex scanner push-back overflow\" );",
2039 " }",
2041 " *--yy_cp = (char) c;",
2043 "%% [18.0] update yylineno here",
2044 "m4_ifdef( [[M4_YY_USE_LINENO]],",
2045 "[[",
2046 " if ( c == '\\n' ){",
2047 " --yylineno;",
2048 " }",
2049 "]])",
2051 " YY_G(yytext_ptr) = yy_bp;",
2052 " YY_G(yy_hold_char) = *yy_cp;",
2053 " YY_G(yy_c_buf_p) = yy_cp;",
2054 "}",
2055 "%if-c-only",
2056 "]])",
2057 "%endif",
2059 "%if-c-only",
2060 "#ifndef YY_NO_INPUT",
2061 "#ifdef __cplusplus",
2062 " static int yyinput YYFARGS0(void)",
2063 "#else",
2064 " static int input YYFARGS0(void)",
2065 "#endif",
2067 "%endif",
2068 "%if-c++-only",
2069 " int yyFlexLexer::yyinput()",
2070 "%endif",
2071 "{",
2072 " int c;",
2073 " M4_YY_DECL_GUTS_VAR();",
2075 " *YY_G(yy_c_buf_p) = YY_G(yy_hold_char);",
2077 " if ( *YY_G(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )",
2078 " {",
2079 " /* yy_c_buf_p now points to the character we want to return.",
2080 " * If this occurs *before* the EOB characters, then it's a",
2081 " * valid NUL; if not, then we've hit the end of the buffer.",
2082 " */",
2083 " if ( YY_G(yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[YY_G(yy_n_chars)] )",
2084 " /* This was really a NUL. */",
2085 " *YY_G(yy_c_buf_p) = '\\0';",
2087 " else",
2088 " { /* need more input */",
2089 " yy_size_t offset = YY_G(yy_c_buf_p) - YY_G(yytext_ptr);",
2090 " ++YY_G(yy_c_buf_p);",
2092 " switch ( yy_get_next_buffer( M4_YY_CALL_ONLY_ARG ) )",
2093 " {",
2094 " case EOB_ACT_LAST_MATCH:",
2095 " /* This happens because yy_g_n_b()",
2096 " * sees that we've accumulated a",
2097 " * token and flags that we need to",
2098 " * try matching the token before",
2099 " * proceeding. But for input(),",
2100 " * there's no matching to consider.",
2101 " * So convert the EOB_ACT_LAST_MATCH",
2102 " * to EOB_ACT_END_OF_FILE.",
2103 " */",
2105 " /* Reset buffer status. */",
2106 " yyrestart( yyin M4_YY_CALL_LAST_ARG);",
2108 " /*FALLTHROUGH*/",
2110 " case EOB_ACT_END_OF_FILE:",
2111 " {",
2112 " if ( yywrap( M4_YY_CALL_ONLY_ARG ) )",
2113 " return EOF;",
2115 " if ( ! YY_G(yy_did_buffer_switch_on_eof) )",
2116 " YY_NEW_FILE;",
2117 "#ifdef __cplusplus",
2118 " return yyinput(M4_YY_CALL_ONLY_ARG);",
2119 "#else",
2120 " return input(M4_YY_CALL_ONLY_ARG);",
2121 "#endif",
2122 " }",
2124 " case EOB_ACT_CONTINUE_SCAN:",
2125 " YY_G(yy_c_buf_p) = YY_G(yytext_ptr) + offset;",
2126 " break;",
2127 " }",
2128 " }",
2129 " }",
2131 " c = *(unsigned char *) YY_G(yy_c_buf_p); /* cast for 8-bit char's */",
2132 " *YY_G(yy_c_buf_p) = '\\0'; /* preserve yytext */",
2133 " YY_G(yy_hold_char) = *++YY_G(yy_c_buf_p);",
2135 "%% [19.0] update BOL and yylineno",
2137 " return c;",
2138 "}",
2139 "%if-c-only",
2140 "#endif /* ifndef YY_NO_INPUT */",
2141 "%endif",
2143 "/** Immediately switch to a different input stream.",
2144 " * @param input_file A readable stream.",
2145 " * M4_YY_DOC_PARAM",
2146 " * @note This function does not reset the start condition to @c INITIAL .",
2147 " */",
2148 "%if-c-only",
2149 " void yyrestart YYFARGS1( FILE *,input_file)",
2150 "%endif",
2151 "%if-c++-only",
2152 " void yyFlexLexer::yyrestart( std::istream* input_file )",
2153 "%endif",
2154 "{",
2155 " M4_YY_DECL_GUTS_VAR();",
2157 " if ( ! YY_CURRENT_BUFFER ){",
2158 " yyensure_buffer_stack (M4_YY_CALL_ONLY_ARG);",
2159 " YY_CURRENT_BUFFER_LVALUE =",
2160 " yy_create_buffer( yyin, YY_BUF_SIZE M4_YY_CALL_LAST_ARG);",
2161 " }",
2163 " yy_init_buffer( YY_CURRENT_BUFFER, input_file M4_YY_CALL_LAST_ARG);",
2164 " yy_load_buffer_state( M4_YY_CALL_ONLY_ARG );",
2165 "}",
2167 "/** Switch to a different input buffer.",
2168 " * @param new_buffer The new input buffer.",
2169 " * M4_YY_DOC_PARAM",
2170 " */",
2171 "%if-c-only",
2172 " void yy_switch_to_buffer YYFARGS1( YY_BUFFER_STATE ,new_buffer)",
2173 "%endif",
2174 "%if-c++-only",
2175 " void yyFlexLexer::yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )",
2176 "%endif",
2177 "{",
2178 " M4_YY_DECL_GUTS_VAR();",
2180 " /* TODO. We should be able to replace this entire function body",
2181 " * with",
2182 " * yypop_buffer_state();",
2183 " * yypush_buffer_state(new_buffer);",
2184 " */",
2185 " yyensure_buffer_stack (M4_YY_CALL_ONLY_ARG);",
2186 " if ( YY_CURRENT_BUFFER == new_buffer )",
2187 " return;",
2189 " if ( YY_CURRENT_BUFFER )",
2190 " {",
2191 " /* Flush out information for old buffer. */",
2192 " *YY_G(yy_c_buf_p) = YY_G(yy_hold_char);",
2193 " YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = YY_G(yy_c_buf_p);",
2194 " YY_CURRENT_BUFFER_LVALUE->yy_n_chars = YY_G(yy_n_chars);",
2195 " }",
2197 " YY_CURRENT_BUFFER_LVALUE = new_buffer;",
2198 " yy_load_buffer_state( M4_YY_CALL_ONLY_ARG );",
2200 " /* We don't actually know whether we did this switch during",
2201 " * EOF (yywrap()) processing, but the only time this flag",
2202 " * is looked at is after yywrap() is called, so it's safe",
2203 " * to go ahead and always set it.",
2204 " */",
2205 " YY_G(yy_did_buffer_switch_on_eof) = 1;",
2206 "}",
2209 "%if-c-only",
2210 "static void yy_load_buffer_state YYFARGS0(void)",
2211 "%endif",
2212 "%if-c++-only",
2213 " void yyFlexLexer::yy_load_buffer_state()",
2214 "%endif",
2215 "{",
2216 " M4_YY_DECL_GUTS_VAR();",
2217 " YY_G(yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;",
2218 " YY_G(yytext_ptr) = YY_G(yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;",
2219 " yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;",
2220 " YY_G(yy_hold_char) = *YY_G(yy_c_buf_p);",
2221 "}",
2223 "/** Allocate and initialize an input buffer state.",
2224 " * @param file A readable stream.",
2225 " * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.",
2226 " * M4_YY_DOC_PARAM",
2227 " * @return the allocated buffer state.",
2228 " */",
2229 "%if-c-only",
2230 " YY_BUFFER_STATE yy_create_buffer YYFARGS2( FILE *,file, int ,size)",
2231 "%endif",
2232 "%if-c++-only",
2233 " YY_BUFFER_STATE yyFlexLexer::yy_create_buffer( std::istream* file, int size )",
2234 "%endif",
2235 "{",
2236 " YY_BUFFER_STATE b;",
2237 " m4_dnl M4_YY_DECL_GUTS_VAR();",
2239 " b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) M4_YY_CALL_LAST_ARG );",
2240 " if ( ! b )",
2241 " YY_FATAL_ERROR( \"out of dynamic memory in yy_create_buffer()\" );",
2243 " b->yy_buf_size = size;",
2245 " /* yy_ch_buf has to be 2 characters longer than the size given because",
2246 " * we need to put in 2 end-of-buffer characters.",
2247 " */",
2248 " b->yy_ch_buf = (char *) yyalloc( b->yy_buf_size + 2 M4_YY_CALL_LAST_ARG );",
2249 " if ( ! b->yy_ch_buf )",
2250 " YY_FATAL_ERROR( \"out of dynamic memory in yy_create_buffer()\" );",
2252 " b->yy_is_our_buffer = 1;",
2254 " yy_init_buffer( b, file M4_YY_CALL_LAST_ARG);",
2256 " return b;",
2257 "}",
2259 "/** Destroy the buffer.",
2260 " * @param b a buffer created with yy_create_buffer()",
2261 " * M4_YY_DOC_PARAM",
2262 " */",
2263 "%if-c-only",
2264 " void yy_delete_buffer YYFARGS1( YY_BUFFER_STATE ,b)",
2265 "%endif",
2266 "%if-c++-only",
2267 " void yyFlexLexer::yy_delete_buffer( YY_BUFFER_STATE b )",
2268 "%endif",
2269 "{",
2270 " M4_YY_DECL_GUTS_VAR();",
2272 " if ( ! b )",
2273 " return;",
2275 " if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */",
2276 " YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;",
2278 " if ( b->yy_is_our_buffer )",
2279 " yyfree( (void *) b->yy_ch_buf M4_YY_CALL_LAST_ARG );",
2281 " yyfree( (void *) b M4_YY_CALL_LAST_ARG );",
2282 "}",
2285 "/* Initializes or reinitializes a buffer.",
2286 " * This function is sometimes called more than once on the same buffer,",
2287 " * such as during a yyrestart() or at EOF.",
2288 " */",
2289 "%if-c-only",
2290 " static void yy_init_buffer YYFARGS2( YY_BUFFER_STATE ,b, FILE *,file)",
2291 "%endif",
2292 "%if-c++-only",
2293 " void yyFlexLexer::yy_init_buffer( YY_BUFFER_STATE b, std::istream* file )",
2294 "%endif",
2296 "{",
2297 " int oerrno = errno;",
2298 " M4_YY_DECL_GUTS_VAR();",
2300 " yy_flush_buffer( b M4_YY_CALL_LAST_ARG);",
2302 " b->yy_input_file = file;",
2303 " b->yy_fill_buffer = 1;",
2305 " /* If b is the current buffer, then yy_init_buffer was _probably_",
2306 " * called from yyrestart() or through yy_get_next_buffer.",
2307 " * In that case, we don't want to reset the lineno or column.",
2308 " */",
2309 " if (b != YY_CURRENT_BUFFER){",
2310 " b->yy_bs_lineno = 1;",
2311 " b->yy_bs_column = 0;",
2312 " }",
2314 "%if-c-only",
2315 "m4_ifdef( [[M4_YY_ALWAYS_INTERACTIVE]],",
2316 "[[",
2317 " b->yy_is_interactive = 1;",
2318 "]],",
2319 "[[",
2320 " m4_ifdef( [[M4_YY_NEVER_INTERACTIVE]],",
2321 " [[",
2322 " b->yy_is_interactive = 0;",
2323 " ]],",
2324 " [[",
2325 " b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;",
2326 " ]])",
2327 "]])",
2328 "%endif",
2329 "%if-c++-only",
2330 " b->yy_is_interactive = 0;",
2331 "%endif",
2332 " errno = oerrno;",
2333 "}",
2335 "/** Discard all buffered characters. On the next scan, YY_INPUT will be called.",
2336 " * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.",
2337 " * M4_YY_DOC_PARAM",
2338 " */",
2339 "%if-c-only",
2340 " void yy_flush_buffer YYFARGS1( YY_BUFFER_STATE ,b)",
2341 "%endif",
2342 "%if-c++-only",
2343 " void yyFlexLexer::yy_flush_buffer( YY_BUFFER_STATE b )",
2344 "%endif",
2345 "{",
2346 " M4_YY_DECL_GUTS_VAR();",
2347 " if ( ! b )",
2348 " return;",
2350 " b->yy_n_chars = 0;",
2352 " /* We always need two end-of-buffer characters. The first causes",
2353 " * a transition to the end-of-buffer state. The second causes",
2354 " * a jam in that state.",
2355 " */",
2356 " b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;",
2357 " b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;",
2359 " b->yy_buf_pos = &b->yy_ch_buf[0];",
2361 " b->yy_at_bol = 1;",
2362 " b->yy_buffer_status = YY_BUFFER_NEW;",
2364 " if ( b == YY_CURRENT_BUFFER )",
2365 " yy_load_buffer_state( M4_YY_CALL_ONLY_ARG );",
2366 "}",
2368 "%if-c-or-c++",
2369 "/** Pushes the new state onto the stack. The new state becomes",
2370 " * the current state. This function will allocate the stack",
2371 " * if necessary.",
2372 " * @param new_buffer The new state.",
2373 " * M4_YY_DOC_PARAM",
2374 " */",
2375 "%if-c-only",
2376 "void yypush_buffer_state YYFARGS1(YY_BUFFER_STATE,new_buffer)",
2377 "%endif",
2378 "%if-c++-only",
2379 "void yyFlexLexer::yypush_buffer_state (YY_BUFFER_STATE new_buffer)",
2380 "%endif",
2381 "{",
2382 " M4_YY_DECL_GUTS_VAR();",
2383 " if (new_buffer == NULL)",
2384 " return;",
2386 " yyensure_buffer_stack(M4_YY_CALL_ONLY_ARG);",
2388 " /* This block is copied from yy_switch_to_buffer. */",
2389 " if ( YY_CURRENT_BUFFER )",
2390 " {",
2391 " /* Flush out information for old buffer. */",
2392 " *YY_G(yy_c_buf_p) = YY_G(yy_hold_char);",
2393 " YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = YY_G(yy_c_buf_p);",
2394 " YY_CURRENT_BUFFER_LVALUE->yy_n_chars = YY_G(yy_n_chars);",
2395 " }",
2397 " /* Only push if top exists. Otherwise, replace top. */",
2398 " if (YY_CURRENT_BUFFER)",
2399 " YY_G(yy_buffer_stack_top)++;",
2400 " YY_CURRENT_BUFFER_LVALUE = new_buffer;",
2402 " /* copied from yy_switch_to_buffer. */",
2403 " yy_load_buffer_state( M4_YY_CALL_ONLY_ARG );",
2404 " YY_G(yy_did_buffer_switch_on_eof) = 1;",
2405 "}",
2406 "%endif",
2409 "%if-c-or-c++",
2410 "/** Removes and deletes the top of the stack, if present.",
2411 " * The next element becomes the new top.",
2412 " * M4_YY_DOC_PARAM",
2413 " */",
2414 "%if-c-only",
2415 "void yypop_buffer_state YYFARGS0(void)",
2416 "%endif",
2417 "%if-c++-only",
2418 "void yyFlexLexer::yypop_buffer_state (void)",
2419 "%endif",
2420 "{",
2421 " M4_YY_DECL_GUTS_VAR();",
2422 " if (!YY_CURRENT_BUFFER)",
2423 " return;",
2425 " yy_delete_buffer(YY_CURRENT_BUFFER M4_YY_CALL_LAST_ARG);",
2426 " YY_CURRENT_BUFFER_LVALUE = NULL;",
2427 " if (YY_G(yy_buffer_stack_top) > 0)",
2428 " --YY_G(yy_buffer_stack_top);",
2430 " if (YY_CURRENT_BUFFER) {",
2431 " yy_load_buffer_state( M4_YY_CALL_ONLY_ARG );",
2432 " YY_G(yy_did_buffer_switch_on_eof) = 1;",
2433 " }",
2434 "}",
2435 "%endif",
2438 "%if-c-or-c++",
2439 "/* Allocates the stack if it does not exist.",
2440 " * Guarantees space for at least one push.",
2441 " */",
2442 "%if-c-only",
2443 "static void yyensure_buffer_stack YYFARGS0(void)",
2444 "%endif",
2445 "%if-c++-only",
2446 "void yyFlexLexer::yyensure_buffer_stack(void)",
2447 "%endif",
2448 "{",
2449 " yy_size_t num_to_alloc;",
2450 " M4_YY_DECL_GUTS_VAR();",
2452 " if (!YY_G(yy_buffer_stack)) {",
2454 " /* First allocation is just for 2 elements, since we don't know if this",
2455 " * scanner will even need a stack. We use 2 instead of 1 to avoid an",
2456 " * immediate realloc on the next call.",
2457 " */",
2458 " num_to_alloc = 1;",
2459 " YY_G(yy_buffer_stack) = (struct yy_buffer_state**)yyalloc",
2460 " (num_to_alloc * sizeof(struct yy_buffer_state*)",
2461 " M4_YY_CALL_LAST_ARG);",
2462 " if ( ! YY_G(yy_buffer_stack) )",
2463 " YY_FATAL_ERROR( \"out of dynamic memory in yyensure_buffer_stack()\" );",
2464 " ",
2465 " ",
2466 " memset(YY_G(yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));",
2467 " ",
2468 " YY_G(yy_buffer_stack_max) = num_to_alloc;",
2469 " YY_G(yy_buffer_stack_top) = 0;",
2470 " return;",
2471 " }",
2473 " if (YY_G(yy_buffer_stack_top) >= (YY_G(yy_buffer_stack_max)) - 1){",
2475 " /* Increase the buffer to prepare for a possible push. */",
2476 " int grow_size = 8 /* arbitrary grow size */;",
2478 " num_to_alloc = YY_G(yy_buffer_stack_max) + grow_size;",
2479 " YY_G(yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc",
2480 " (YY_G(yy_buffer_stack),",
2481 " num_to_alloc * sizeof(struct yy_buffer_state*)",
2482 " M4_YY_CALL_LAST_ARG);",
2483 " if ( ! YY_G(yy_buffer_stack) )",
2484 " YY_FATAL_ERROR( \"out of dynamic memory in yyensure_buffer_stack()\" );",
2486 " /* zero only the new slots.*/",
2487 " memset(YY_G(yy_buffer_stack) + YY_G(yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));",
2488 " YY_G(yy_buffer_stack_max) = num_to_alloc;",
2489 " }",
2490 "}",
2491 "%endif",
2496 "m4_ifdef( [[M4_YY_NO_SCAN_BUFFER]],,",
2497 "[[",
2498 "%if-c-only",
2499 "/** Setup the input buffer state to scan directly from a user-specified character buffer.",
2500 " * @param base the character buffer",
2501 " * @param size the size in bytes of the character buffer",
2502 " * M4_YY_DOC_PARAM",
2503 " * @return the newly allocated buffer state object. ",
2504 " */",
2505 "YY_BUFFER_STATE yy_scan_buffer YYFARGS2( char *,base, yy_size_t ,size)",
2506 "{",
2507 " YY_BUFFER_STATE b;",
2508 " m4_dnl M4_YY_DECL_GUTS_VAR();",
2510 " if ( size < 2 ||",
2511 " base[size-2] != YY_END_OF_BUFFER_CHAR ||",
2512 " base[size-1] != YY_END_OF_BUFFER_CHAR )",
2513 " /* They forgot to leave room for the EOB's. */",
2514 " return 0;",
2516 " b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) M4_YY_CALL_LAST_ARG );",
2517 " if ( ! b )",
2518 " YY_FATAL_ERROR( \"out of dynamic memory in yy_scan_buffer()\" );",
2520 " b->yy_buf_size = size - 2; /* \"- 2\" to take care of EOB's */",
2521 " b->yy_buf_pos = b->yy_ch_buf = base;",
2522 " b->yy_is_our_buffer = 0;",
2523 " b->yy_input_file = 0;",
2524 " b->yy_n_chars = b->yy_buf_size;",
2525 " b->yy_is_interactive = 0;",
2526 " b->yy_at_bol = 1;",
2527 " b->yy_fill_buffer = 0;",
2528 " b->yy_buffer_status = YY_BUFFER_NEW;",
2530 " yy_switch_to_buffer( b M4_YY_CALL_LAST_ARG );",
2532 " return b;",
2533 "}",
2534 "%endif",
2535 "]])",
2538 "m4_ifdef( [[M4_YY_NO_SCAN_STRING]],,",
2539 "[[",
2540 "%if-c-only",
2541 "/** Setup the input buffer state to scan a string. The next call to yylex() will",
2542 " * scan from a @e copy of @a str.",
2543 " * @param yystr a NUL-terminated string to scan",
2544 " * M4_YY_DOC_PARAM",
2545 " * @return the newly allocated buffer state object.",
2546 " * @note If you want to scan bytes that may contain NUL values, then use",
2547 " * yy_scan_bytes() instead.",
2548 " */",
2549 "YY_BUFFER_STATE yy_scan_string YYFARGS1( yyconst char *, yystr)",
2550 "{",
2551 " m4_dnl M4_YY_DECL_GUTS_VAR();",
2553 " return yy_scan_bytes( yystr, strlen(yystr) M4_YY_CALL_LAST_ARG);",
2554 "}",
2555 "%endif",
2556 "]])",
2559 "m4_ifdef( [[M4_YY_NO_SCAN_BYTES]],,",
2560 "[[",
2561 "%if-c-only",
2562 "/** Setup the input buffer state to scan the given bytes. The next call to yylex() will",
2563 " * scan from a @e copy of @a bytes.",
2564 " * @param yybytes the byte buffer to scan",
2565 " * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.",
2566 " * M4_YY_DOC_PARAM",
2567 " * @return the newly allocated buffer state object.",
2568 " */",
2569 "YY_BUFFER_STATE yy_scan_bytes YYFARGS2( yyconst char *,yybytes, yy_size_t ,_yybytes_len)",
2570 "{",
2571 " YY_BUFFER_STATE b;",
2572 " char *buf;",
2573 " yy_size_t n;",
2574 " int i;",
2575 " m4_dnl M4_YY_DECL_GUTS_VAR();",
2577 " /* Get memory for full buffer, including space for trailing EOB's. */",
2578 " n = _yybytes_len + 2;",
2579 " buf = (char *) yyalloc( n M4_YY_CALL_LAST_ARG );",
2580 " if ( ! buf )",
2581 " YY_FATAL_ERROR( \"out of dynamic memory in yy_scan_bytes()\" );",
2583 " for ( i = 0; i < _yybytes_len; ++i )",
2584 " buf[i] = yybytes[i];",
2586 " buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;",
2588 " b = yy_scan_buffer( buf, n M4_YY_CALL_LAST_ARG);",
2589 " if ( ! b )",
2590 " YY_FATAL_ERROR( \"bad buffer in yy_scan_bytes()\" );",
2592 " /* It's okay to grow etc. this buffer, and we should throw it",
2593 " * away when we're done.",
2594 " */",
2595 " b->yy_is_our_buffer = 1;",
2597 " return b;",
2598 "}",
2599 "%endif",
2600 "]])",
2603 "m4_ifdef( [[M4_YY_NO_PUSH_STATE]],,",
2604 "[[",
2605 "%if-c-only",
2606 " static void yy_push_state YYFARGS1( int ,new_state)",
2607 "%endif",
2608 "%if-c++-only",
2609 " void yyFlexLexer::yy_push_state( int new_state )",
2610 "%endif",
2611 "{",
2612 " M4_YY_DECL_GUTS_VAR();",
2613 " if ( YY_G(yy_start_stack_ptr) >= YY_G(yy_start_stack_depth) )",
2614 " {",
2615 " yy_size_t new_size;",
2617 " YY_G(yy_start_stack_depth) += YY_START_STACK_INCR;",
2618 " new_size = YY_G(yy_start_stack_depth) * sizeof( int );",
2620 " if ( ! YY_G(yy_start_stack) )",
2621 " YY_G(yy_start_stack) = (int *) yyalloc( new_size M4_YY_CALL_LAST_ARG );",
2623 " else",
2624 " YY_G(yy_start_stack) = (int *) yyrealloc(",
2625 " (void *) YY_G(yy_start_stack), new_size M4_YY_CALL_LAST_ARG );",
2627 " if ( ! YY_G(yy_start_stack) )",
2628 " YY_FATAL_ERROR( \"out of memory expanding start-condition stack\" );",
2629 " }",
2631 " YY_G(yy_start_stack)[YY_G(yy_start_stack_ptr)++] = YY_START;",
2633 " BEGIN(new_state);",
2634 "}",
2635 "]])",
2638 "m4_ifdef( [[M4_YY_NO_POP_STATE]],,",
2639 "[[",
2640 "%if-c-only",
2641 " static void yy_pop_state YYFARGS0(void)",
2642 "%endif",
2643 "%if-c++-only",
2644 " void yyFlexLexer::yy_pop_state()",
2645 "%endif",
2646 "{",
2647 " M4_YY_DECL_GUTS_VAR();",
2648 " if ( --YY_G(yy_start_stack_ptr) < 0 )",
2649 " YY_FATAL_ERROR( \"start-condition stack underflow\" );",
2651 " BEGIN(YY_G(yy_start_stack)[YY_G(yy_start_stack_ptr)]);",
2652 "}",
2653 "]])",
2656 "m4_ifdef( [[M4_YY_NO_TOP_STATE]],,",
2657 "[[",
2658 "%if-c-only",
2659 " static int yy_top_state YYFARGS0(void)",
2660 "%endif",
2661 "%if-c++-only",
2662 " int yyFlexLexer::yy_top_state()",
2663 "%endif",
2664 "{",
2665 " M4_YY_DECL_GUTS_VAR();",
2666 " return YY_G(yy_start_stack)[YY_G(yy_start_stack_ptr) - 1];",
2667 "}",
2668 "]])",
2670 "#ifndef YY_EXIT_FAILURE",
2671 "#define YY_EXIT_FAILURE 2",
2672 "#endif",
2674 "%if-c-only",
2675 "static void yy_fatal_error YYFARGS1(yyconst char*, msg)",
2676 "{",
2677 " m4_dnl M4_YY_DECL_GUTS_VAR();",
2678 " (void) fprintf( stderr, \"%s\\n\", msg );",
2679 " exit( YY_EXIT_FAILURE );",
2680 "}",
2681 "%endif",
2682 "%if-c++-only",
2683 "void yyFlexLexer::LexerError( yyconst char msg[] )",
2684 "{",
2685 " M4_YY_DECL_GUTS_VAR();",
2686 " std::cerr << msg << std::endl;",
2687 " exit( YY_EXIT_FAILURE );",
2688 "}",
2689 "%endif",
2691 "/* Redefine yyless() so it works in section 3 code. */",
2693 "#undef yyless",
2694 "#define yyless(n) \\",
2695 " do \\",
2696 " { \\",
2697 " /* Undo effects of setting up yytext. */ \\",
2698 " int yyless_macro_arg = (n); \\",
2699 " YY_LESS_LINENO(yyless_macro_arg);\\",
2700 " yytext[yyleng] = YY_G(yy_hold_char); \\",
2701 " YY_G(yy_c_buf_p) = yytext + yyless_macro_arg; \\",
2702 " YY_G(yy_hold_char) = *YY_G(yy_c_buf_p); \\",
2703 " *YY_G(yy_c_buf_p) = '\\0'; \\",
2704 " yyleng = yyless_macro_arg; \\",
2705 " } \\",
2706 " while ( 0 )",
2710 "/* Accessor methods (get/set functions) to struct members. */",
2712 "%if-c-only",
2713 "%if-reentrant",
2714 "m4_ifdef( [[M4_YY_NO_GET_EXTRA]],,",
2715 "[[",
2716 "/** Get the user-defined data for this scanner.",
2717 " * M4_YY_DOC_PARAM",
2718 " */",
2719 "YY_EXTRA_TYPE yyget_extra YYFARGS0(void)",
2720 "{",
2721 " M4_YY_DECL_GUTS_VAR();",
2722 " return yyextra;",
2723 "}",
2724 "]])",
2725 "%endif",
2727 "m4_ifdef( [[M4_YY_NO_GET_LINENO]],,",
2728 "[[",
2729 "/** Get the current line number.",
2730 " * M4_YY_DOC_PARAM",
2731 " */",
2732 "int yyget_lineno YYFARGS0(void)",
2733 "{",
2734 " M4_YY_DECL_GUTS_VAR();",
2735 " ",
2736 " m4_ifdef( [[M4_YY_REENTRANT]],",
2737 " [[",
2738 " if (! YY_CURRENT_BUFFER)",
2739 " return 0;",
2740 " ]])",
2741 " return yylineno;",
2742 "}",
2743 "]])",
2745 "m4_ifdef( [[M4_YY_REENTRANT]],",
2746 "[[",
2747 "m4_ifdef( [[M4_YY_NO_GET_COLUMN]],,",
2748 "[[",
2749 "/** Get the current column number.",
2750 " * M4_YY_DOC_PARAM",
2751 " */",
2752 "int yyget_column YYFARGS0(void)",
2753 "{",
2754 " M4_YY_DECL_GUTS_VAR();",
2755 " ",
2756 " m4_ifdef( [[M4_YY_REENTRANT]],",
2757 " [[",
2758 " if (! YY_CURRENT_BUFFER)",
2759 " return 0;",
2760 " ]])",
2761 " return yycolumn;",
2762 "}",
2763 "]])",
2764 "]])",
2766 "m4_ifdef( [[M4_YY_NO_GET_IN]],,",
2767 "[[",
2768 "/** Get the input stream.",
2769 " * M4_YY_DOC_PARAM",
2770 " */",
2771 "FILE *yyget_in YYFARGS0(void)",
2772 "{",
2773 " M4_YY_DECL_GUTS_VAR();",
2774 " return yyin;",
2775 "}",
2776 "]])",
2778 "m4_ifdef( [[M4_YY_NO_GET_OUT]],,",
2779 "[[",
2780 "/** Get the output stream.",
2781 " * M4_YY_DOC_PARAM",
2782 " */",
2783 "FILE *yyget_out YYFARGS0(void)",
2784 "{",
2785 " M4_YY_DECL_GUTS_VAR();",
2786 " return yyout;",
2787 "}",
2788 "]])",
2790 "m4_ifdef( [[M4_YY_NO_GET_LENG]],,",
2791 "[[",
2792 "/** Get the length of the current token.",
2793 " * M4_YY_DOC_PARAM",
2794 " */",
2795 "yy_size_t yyget_leng YYFARGS0(void)",
2796 "{",
2797 " M4_YY_DECL_GUTS_VAR();",
2798 " return yyleng;",
2799 "}",
2800 "]])",
2802 "/** Get the current token.",
2803 " * M4_YY_DOC_PARAM",
2804 " */",
2805 "m4_ifdef( [[M4_YY_NO_GET_TEXT]],,",
2806 "[[",
2807 "char *yyget_text YYFARGS0(void)",
2808 "{",
2809 " M4_YY_DECL_GUTS_VAR();",
2810 " return yytext;",
2811 "}",
2812 "]])",
2814 "%if-reentrant",
2815 "m4_ifdef( [[M4_YY_NO_SET_EXTRA]],,",
2816 "[[",
2817 "/** Set the user-defined data. This data is never touched by the scanner.",
2818 " * @param user_defined The data to be associated with this scanner.",
2819 " * M4_YY_DOC_PARAM",
2820 " */",
2821 "void yyset_extra YYFARGS1( YY_EXTRA_TYPE ,user_defined)",
2822 "{",
2823 " M4_YY_DECL_GUTS_VAR();",
2824 " yyextra = user_defined ;",
2825 "}",
2826 "]])",
2827 "%endif",
2829 "m4_ifdef( [[M4_YY_NO_SET_LINENO]],,",
2830 "[[",
2831 "/** Set the current line number.",
2832 " * @param line_number",
2833 " * M4_YY_DOC_PARAM",
2834 " */",
2835 "void yyset_lineno YYFARGS1( int ,line_number)",
2836 "{",
2837 " M4_YY_DECL_GUTS_VAR();",
2839 " m4_ifdef( [[M4_YY_REENTRANT]],",
2840 " [[",
2841 " /* lineno is only valid if an input buffer exists. */",
2842 " if (! YY_CURRENT_BUFFER )",
2843 " YY_FATAL_ERROR( \"yyset_lineno called with no buffer\" );",
2844 " ]])",
2845 " yylineno = line_number;",
2846 "}",
2847 "]])",
2849 "m4_ifdef( [[M4_YY_REENTRANT]],",
2850 "[[",
2851 "m4_ifdef( [[M4_YY_NO_SET_COLUMN]],,",
2852 "[[",
2853 "/** Set the current column.",
2854 " * @param line_number",
2855 " * M4_YY_DOC_PARAM",
2856 " */",
2857 "void yyset_column YYFARGS1( int , column_no)",
2858 "{",
2859 " M4_YY_DECL_GUTS_VAR();",
2861 " m4_ifdef( [[M4_YY_REENTRANT]],",
2862 " [[",
2863 " /* column is only valid if an input buffer exists. */",
2864 " if (! YY_CURRENT_BUFFER )",
2865 " YY_FATAL_ERROR( \"yyset_column called with no buffer\" );",
2866 " ]])",
2867 " yycolumn = column_no;",
2868 "}",
2869 "]])",
2870 "]])",
2873 "m4_ifdef( [[M4_YY_NO_SET_IN]],,",
2874 "[[",
2875 "/** Set the input stream. This does not discard the current",
2876 " * input buffer.",
2877 " * @param in_str A readable stream.",
2878 " * M4_YY_DOC_PARAM",
2879 " * @see yy_switch_to_buffer",
2880 " */",
2881 "void yyset_in YYFARGS1( FILE * ,in_str)",
2882 "{",
2883 " M4_YY_DECL_GUTS_VAR();",
2884 " yyin = in_str ;",
2885 "}",
2886 "]])",
2888 "m4_ifdef( [[M4_YY_NO_SET_OUT]],,",
2889 "[[",
2890 "void yyset_out YYFARGS1( FILE * ,out_str)",
2891 "{",
2892 " M4_YY_DECL_GUTS_VAR();",
2893 " yyout = out_str ;",
2894 "}",
2895 "]])",
2898 "m4_ifdef( [[M4_YY_NO_GET_DEBUG]],,",
2899 "[[",
2900 "int yyget_debug YYFARGS0(void)",
2901 "{",
2902 " M4_YY_DECL_GUTS_VAR();",
2903 " return yy_flex_debug;",
2904 "}",
2905 "]])",
2907 "m4_ifdef( [[M4_YY_NO_SET_DEBUG]],,",
2908 "[[",
2909 "void yyset_debug YYFARGS1( int ,bdebug)",
2910 "{",
2911 " M4_YY_DECL_GUTS_VAR();",
2912 " yy_flex_debug = bdebug ;",
2913 "}",
2914 "]])",
2915 "%endif",
2917 "%if-reentrant",
2918 "/* Accessor methods for yylval and yylloc */",
2920 "%if-bison-bridge",
2921 "m4_ifdef( [[M4_YY_NO_GET_LVAL]],,",
2922 "[[",
2923 "YYSTYPE * yyget_lval YYFARGS0(void)",
2924 "{",
2925 " M4_YY_DECL_GUTS_VAR();",
2926 " return yylval;",
2927 "}",
2928 "]])",
2930 "m4_ifdef( [[M4_YY_NO_SET_LVAL]],,",
2931 "[[",
2932 "void yyset_lval YYFARGS1( YYSTYPE * ,yylval_param)",
2933 "{",
2934 " M4_YY_DECL_GUTS_VAR();",
2935 " yylval = yylval_param;",
2936 "}",
2937 "]])",
2939 "m4_ifdef( [[<M4_YY_BISON_LLOC>]],",
2940 "[[",
2941 " m4_ifdef( [[M4_YY_NO_GET_LLOC]],,",
2942 " [[",
2943 "YYLTYPE *yyget_lloc YYFARGS0(void)",
2944 "{",
2945 " M4_YY_DECL_GUTS_VAR();",
2946 " return yylloc;",
2947 "}",
2948 " ]])",
2950 " m4_ifdef( [[M4_YY_NO_SET_LLOC]],,",
2951 " [[",
2952 "void yyset_lloc YYFARGS1( YYLTYPE * ,yylloc_param)",
2953 "{",
2954 " M4_YY_DECL_GUTS_VAR();",
2955 " yylloc = yylloc_param;",
2956 "}",
2957 " ]])",
2958 "]])",
2960 "%endif",
2963 "/* User-visible API */",
2965 "/* yylex_init is special because it creates the scanner itself, so it is",
2966 " * the ONLY reentrant function that doesn't take the scanner as the last argument.",
2967 " * That's why we explicitly handle the declaration, instead of using our macros.",
2968 " */",
2969 "m4_ifdef( [[M4_YY_NO_ANSI_FUNC_DEFS]],",
2970 "[[",
2971 "int yylex_init( ptr_yy_globals )",
2972 " yyscan_t* ptr_yy_globals;",
2973 "]],",
2974 "[[",
2975 "int yylex_init(yyscan_t* ptr_yy_globals)",
2976 "]])",
2977 "{",
2978 " if (ptr_yy_globals == NULL){",
2979 " errno = EINVAL;",
2980 " return 1;",
2981 " }",
2983 " *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), NULL );",
2985 " if (*ptr_yy_globals == NULL){",
2986 " errno = ENOMEM;",
2987 " return 1;",
2988 " }",
2990 " /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */",
2991 " memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));",
2993 " return yy_init_globals ( *ptr_yy_globals );",
2994 "}",
2997 "/* yylex_init_extra has the same functionality as yylex_init, but follows the",
2998 " * convention of taking the scanner as the last argument. Note however, that",
2999 " * this is a *pointer* to a scanner, as it will be allocated by this call (and",
3000 " * is the reason, too, why this function also must handle its own declaration).",
3001 " * The user defined value in the first argument will be available to yyalloc in",
3002 " * the yyextra field.",
3003 " */",
3004 "m4_ifdef( [[M4_YY_NO_ANSI_FUNC_DEFS]],",
3005 "[[",
3006 "int yylex_init_extra( yy_user_defined, ptr_yy_globals )",
3007 " YY_EXTRA_TYPE yy_user_defined;",
3008 " yyscan_t* ptr_yy_globals;",
3009 "]],",
3010 "[[",
3011 "int yylex_init_extra( YY_EXTRA_TYPE yy_user_defined, yyscan_t* ptr_yy_globals )",
3012 "]])",
3013 "{",
3014 " struct yyguts_t dummy_yyguts;",
3016 " yyset_extra (yy_user_defined, &dummy_yyguts);",
3018 " if (ptr_yy_globals == NULL){",
3019 " errno = EINVAL;",
3020 " return 1;",
3021 " }",
3022 " ",
3023 " *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts );",
3024 " ",
3025 " if (*ptr_yy_globals == NULL){",
3026 " errno = ENOMEM;",
3027 " return 1;",
3028 " }",
3029 " ",
3030 " /* By setting to 0xAA, we expose bugs in",
3031 " yy_init_globals. Leave at 0x00 for releases. */",
3032 " memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));",
3033 " ",
3034 " yyset_extra (yy_user_defined, *ptr_yy_globals);",
3035 " ",
3036 " return yy_init_globals ( *ptr_yy_globals );",
3037 "}",
3039 "%endif if-c-only",
3042 "%if-c-only",
3043 "static int yy_init_globals YYFARGS0(void)",
3044 "{",
3045 " M4_YY_DECL_GUTS_VAR();",
3046 " /* Initialization is the same as for the non-reentrant scanner.",
3047 " * This function is called from yylex_destroy(), so don't allocate here.",
3048 " */",
3050 "m4_ifdef( [[M4_YY_USE_LINENO]],",
3051 "[[",
3052 " m4_ifdef( [[M4_YY_NOT_REENTRANT]],",
3053 " [[",
3054 " /* We do not touch yylineno unless the option is enabled. */",
3055 " yylineno = 1;",
3056 " ]])",
3057 "]])",
3058 " YY_G(yy_buffer_stack) = 0;",
3059 " YY_G(yy_buffer_stack_top) = 0;",
3060 " YY_G(yy_buffer_stack_max) = 0;",
3061 " YY_G(yy_c_buf_p) = (char *) 0;",
3062 " YY_G(yy_init) = 0;",
3063 " YY_G(yy_start) = 0;",
3065 "m4_ifdef( [[M4_YY_HAS_START_STACK_VARS]],",
3066 "[[",
3067 " YY_G(yy_start_stack_ptr) = 0;",
3068 " YY_G(yy_start_stack_depth) = 0;",
3069 " YY_G(yy_start_stack) = NULL;",
3070 "]])",
3072 "m4_ifdef( [[M4_YY_USES_REJECT]],",
3073 "[[",
3074 " YY_G(yy_state_buf) = 0;",
3075 " YY_G(yy_state_ptr) = 0;",
3076 " YY_G(yy_full_match) = 0;",
3077 " YY_G(yy_lp) = 0;",
3078 "]])",
3080 "m4_ifdef( [[M4_YY_TEXT_IS_ARRAY]],",
3081 "[[",
3082 " YY_G(yytext_ptr) = 0;",
3083 " YY_G(yy_more_offset) = 0;",
3084 " YY_G(yy_prev_more_offset) = 0;",
3085 "]])",
3087 "/* Defined in main.c */",
3088 "#ifdef YY_STDINIT",
3089 " yyin = stdin;",
3090 " yyout = stdout;",
3091 "#else",
3092 " yyin = (FILE *) 0;",
3093 " yyout = (FILE *) 0;",
3094 "#endif",
3096 " /* For future reference: Set errno on error, since we are called by",
3097 " * yylex_init()",
3098 " */",
3099 " return 0;",
3100 "}",
3101 "%endif",
3104 "%if-c-only SNIP! this currently causes conflicts with the c++ scanner",
3105 "/* yylex_destroy is for both reentrant and non-reentrant scanners. */",
3106 "int yylex_destroy YYFARGS0(void)",
3107 "{",
3108 " M4_YY_DECL_GUTS_VAR();",
3110 " /* Pop the buffer stack, destroying each element. */",
3111 " while(YY_CURRENT_BUFFER){",
3112 " yy_delete_buffer( YY_CURRENT_BUFFER M4_YY_CALL_LAST_ARG );",
3113 " YY_CURRENT_BUFFER_LVALUE = NULL;",
3114 " yypop_buffer_state(M4_YY_CALL_ONLY_ARG);",
3115 " }",
3117 " /* Destroy the stack itself. */",
3118 " yyfree(YY_G(yy_buffer_stack) M4_YY_CALL_LAST_ARG);",
3119 " YY_G(yy_buffer_stack) = NULL;",
3121 "m4_ifdef( [[M4_YY_HAS_START_STACK_VARS]],",
3122 "[[",
3123 " /* Destroy the start condition stack. */",
3124 " yyfree( YY_G(yy_start_stack) M4_YY_CALL_LAST_ARG );",
3125 " YY_G(yy_start_stack) = NULL;",
3126 "]])",
3128 "m4_ifdef( [[M4_YY_USES_REJECT]],",
3129 "[[",
3130 " yyfree ( YY_G(yy_state_buf) M4_YY_CALL_LAST_ARG);",
3131 " YY_G(yy_state_buf) = NULL;",
3132 "]])",
3134 " /* Reset the globals. This is important in a non-reentrant scanner so the next time",
3135 " * yylex() is called, initialization will occur. */",
3136 " yy_init_globals( M4_YY_CALL_ONLY_ARG);",
3138 "%if-reentrant",
3139 " /* Destroy the main struct (reentrant only). */",
3140 " yyfree ( yyscanner M4_YY_CALL_LAST_ARG );",
3141 " yyscanner = NULL;",
3142 "%endif",
3143 " return 0;",
3144 "}",
3145 "%endif",
3148 "m4_ifdef( [[M4_YY_NOT_IN_HEADER]],",
3149 "[[",
3150 "/*",
3151 " * Internal utility routines.",
3152 " */",
3153 "]])",
3155 "m4_ifdef( [[M4_YY_NOT_IN_HEADER]],",
3156 "[[",
3157 "#ifndef yytext_ptr",
3158 "static void yy_flex_strncpy YYFARGS3( char*,s1, yyconst char *,s2, int,n)",
3159 "{",
3160 " register int i;",
3161 " for ( i = 0; i < n; ++i )",
3162 " s1[i] = s2[i];",
3163 "}",
3164 "#endif",
3165 "]])",
3167 "m4_ifdef( [[M4_YY_NOT_IN_HEADER]],",
3168 "[[",
3169 "#ifdef YY_NEED_STRLEN",
3170 "static int yy_flex_strlen YYFARGS1( yyconst char *,s)",
3171 "{",
3172 " register int n;",
3173 " for ( n = 0; s[n]; ++n )",
3174 " ;",
3176 " return n;",
3177 "}",
3178 "#endif",
3179 "]])",
3181 "m4_ifdef( [[M4_YY_NO_FLEX_ALLOC]],,",
3182 "[[",
3183 "void *yyalloc YYFARGS1( yy_size_t ,size)",
3184 "{",
3185 " return (void *) malloc( size );",
3186 "}",
3187 "]])",
3189 "m4_ifdef( [[M4_YY_NO_FLEX_REALLOC]],,",
3190 "[[",
3191 "void *yyrealloc YYFARGS2( void *,ptr, yy_size_t ,size)",
3192 "{",
3193 " /* The cast to (char *) in the following accommodates both",
3194 " * implementations that use char* generic pointers, and those",
3195 " * that use void* generic pointers. It works with the latter",
3196 " * because both ANSI C and C++ allow castless assignment from",
3197 " * any pointer type to void*, and deal with argument conversions",
3198 " * as though doing an assignment.",
3199 " */",
3200 " return (void *) realloc( (char *) ptr, size );",
3201 "}",
3202 "]])",
3204 "m4_ifdef( [[M4_YY_NO_FLEX_FREE]],,",
3205 "[[",
3206 "void yyfree YYFARGS1( void *,ptr)",
3207 "{",
3208 " free( (char *) ptr ); /* see yyrealloc() for (char *) cast */",
3209 "}",
3210 "]])",
3212 "%if-tables-serialization definitions",
3213 "#ifdef FLEX_SCANNER",
3214 "/*",
3215 "dnl tables_shared.c - tables serialization code",
3216 "dnl ",
3217 "dnl Copyright (c) 1990 The Regents of the University of California.",
3218 "dnl All rights reserved.",
3219 "dnl ",
3220 "dnl This code is derived from software contributed to Berkeley by",
3221 "dnl Vern Paxson.",
3222 "dnl ",
3223 "dnl The United States Government has rights in this work pursuant",
3224 "dnl to contract no. DE-AC03-76SF00098 between the United States",
3225 "dnl Department of Energy and the University of California.",
3226 "dnl ",
3227 "dnl This file is part of flex.",
3228 "dnl ",
3229 "dnl Redistribution and use in source and binary forms, with or without",
3230 "dnl modification, are permitted provided that the following conditions",
3231 "dnl are met:",
3232 "dnl ",
3233 "dnl 1. Redistributions of source code must retain the above copyright",
3234 "dnl notice, this list of conditions and the following disclaimer.",
3235 "dnl 2. Redistributions in binary form must reproduce the above copyright",
3236 "dnl notice, this list of conditions and the following disclaimer in the",
3237 "dnl documentation and/or other materials provided with the distribution.",
3238 "dnl ",
3239 "dnl Neither the name of the University nor the names of its contributors",
3240 "dnl may be used to endorse or promote products derived from this software",
3241 "dnl without specific prior written permission.",
3242 "dnl ",
3243 "dnl THIS SOFTWARE IS PROVIDED `AS IS' AND WITHOUT ANY EXPRESS OR",
3244 "dnl IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED",
3245 "dnl WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR",
3246 "dnl PURPOSE.",
3247 "dnl ",
3248 "*/",
3249 "\f",
3250 "/* This file is meant to be included in both the skeleton and the actual",
3251 " * flex code (hence the name \"_shared\"). ",
3252 " */",
3253 "#ifndef yyskel_static",
3254 "#define yyskel_static static",
3255 "#endif",
3256 "#else",
3257 "#include \"flexdef.h\"",
3258 "#include \"tables.h\"",
3259 "#ifndef yyskel_static",
3260 "#define yyskel_static",
3261 "#endif",
3262 "#endif",
3265 "/** Get the number of integers in this table. This is NOT the",
3266 " * same thing as the number of elements.",
3267 " * @param td the table ",
3268 " * @return the number of integers in the table",
3269 " */",
3270 "yyskel_static flex_int32_t yytbl_calc_total_len (const struct yytbl_data *tbl)",
3271 "{",
3272 " flex_int32_t n;",
3274 " /* total number of ints */",
3275 " n = tbl->td_lolen;",
3276 " if (tbl->td_hilen > 0)",
3277 " n *= tbl->td_hilen;",
3279 " if (tbl->td_id == YYTD_ID_TRANSITION)",
3280 " n *= 2;",
3281 " return n;",
3282 "}",
3285 "static int yytbl_read8 (void *v, struct yytbl_reader * rd)",
3286 "{",
3287 " errno = 0;",
3288 " if (fread (v, sizeof (flex_uint8_t), 1, rd->fp) != 1){",
3289 " errno = EIO;",
3290 " return -1;",
3291 " }",
3292 " rd->bread += sizeof(flex_uint8_t);",
3293 " return 0;",
3294 "}",
3296 "static int yytbl_read16 (void *v, struct yytbl_reader * rd)",
3297 "{",
3298 " errno = 0;",
3299 " if (fread (v, sizeof (flex_uint16_t), 1, rd->fp) != 1){",
3300 " errno = EIO;",
3301 " return -1;",
3302 " }",
3303 " *((flex_uint16_t *) v) = ntohs (*((flex_uint16_t *) v));",
3304 " rd->bread += sizeof(flex_uint16_t);",
3305 " return 0;",
3306 "}",
3308 "static int yytbl_read32 (void *v, struct yytbl_reader * rd)",
3309 "{",
3310 " errno = 0;",
3311 " if (fread (v, sizeof (flex_uint32_t), 1, rd->fp) != 1){",
3312 " errno = EIO;",
3313 " return -1;",
3314 " }",
3315 " *((flex_uint32_t *) v) = ntohl (*((flex_uint32_t *) v));",
3316 " rd->bread += sizeof(flex_uint32_t);",
3317 " return 0;",
3318 "}",
3320 "/** Read the header */",
3321 "static int yytbl_hdr_read YYFARGS2(struct yytbl_hdr *, th, struct yytbl_reader *, rd)",
3322 "{",
3323 " int bytes;",
3324 " memset (th, 0, sizeof (struct yytbl_hdr));",
3326 " if (yytbl_read32 (&(th->th_magic), rd) != 0)",
3327 " return -1;",
3329 " if (th->th_magic != YYTBL_MAGIC){",
3330 " YY_FATAL_ERROR( \"bad magic number\" ); /* TODO: not fatal. */",
3331 " return -1;",
3332 " }",
3334 " if (yytbl_read32 (&(th->th_hsize), rd) != 0",
3335 " || yytbl_read32 (&(th->th_ssize), rd) != 0",
3336 " || yytbl_read16 (&(th->th_flags), rd) != 0)",
3337 " return -1;",
3339 " /* Sanity check on header size. Greater than 1k suggests some funny business. */",
3340 " if (th->th_hsize < 16 || th->th_hsize > 1024){",
3341 " YY_FATAL_ERROR( \"insane header size detected\" ); /* TODO: not fatal. */",
3342 " return -1;",
3343 " }",
3345 " /* Allocate enough space for the version and name fields */",
3346 " bytes = th->th_hsize - 14;",
3347 " th->th_version = (char *) yyalloc (bytes M4_YY_CALL_LAST_ARG);",
3348 " if ( ! th->th_version )",
3349 " YY_FATAL_ERROR( \"out of dynamic memory in yytbl_hdr_read()\" );",
3351 " /* we read it all into th_version, and point th_name into that data */",
3352 " if (fread (th->th_version, 1, bytes, rd->fp) != bytes){",
3353 " errno = EIO;",
3354 " yyfree(th->th_version M4_YY_CALL_LAST_ARG);",
3355 " th->th_version = NULL;",
3356 " return -1;",
3357 " }",
3358 " else",
3359 " rd->bread += bytes;",
3361 " th->th_name = th->th_version + strlen (th->th_version) + 1;",
3362 " return 0;",
3363 "}",
3365 "/** lookup id in the dmap list.",
3366 " * @param dmap pointer to first element in list",
3367 " * @return NULL if not found.",
3368 " */",
3369 "static struct yytbl_dmap *yytbl_dmap_lookup YYFARGS2(struct yytbl_dmap *, dmap,",
3370 " int, id)",
3371 "{",
3372 " while (dmap->dm_id)",
3373 " if (dmap->dm_id == id)",
3374 " return dmap;",
3375 " else",
3376 " dmap++;",
3377 " return NULL;",
3378 "}",
3380 "/** Read a table while mapping its contents to the local array. ",
3381 " * @param dmap used to performing mapping",
3382 " * @return 0 on success",
3383 " */",
3384 "static int yytbl_data_load YYFARGS2(struct yytbl_dmap *, dmap, struct yytbl_reader*, rd)",
3385 "{",
3386 " struct yytbl_data td;",
3387 " struct yytbl_dmap *transdmap=0;",
3388 " int len, i, rv, inner_loop_count;",
3389 " void *p=0;",
3391 " memset (&td, 0, sizeof (struct yytbl_data));",
3393 " if (yytbl_read16 (&td.td_id, rd) != 0",
3394 " || yytbl_read16 (&td.td_flags, rd) != 0",
3395 " || yytbl_read32 (&td.td_hilen, rd) != 0",
3396 " || yytbl_read32 (&td.td_lolen, rd) != 0)",
3397 " return -1;",
3399 " /* Lookup the map for the transition table so we have it in case we need it",
3400 " * inside the loop below. This scanner might not even have a transition",
3401 " * table, which is ok.",
3402 " */",
3403 " transdmap = yytbl_dmap_lookup (dmap, YYTD_ID_TRANSITION M4_YY_CALL_LAST_ARG);",
3405 " if ((dmap = yytbl_dmap_lookup (dmap, td.td_id M4_YY_CALL_LAST_ARG)) == NULL){",
3406 " YY_FATAL_ERROR( \"table id not found in map.\" ); /* TODO: not fatal. */",
3407 " return -1;",
3408 " }",
3410 " /* Allocate space for table.",
3411 " * The --full yy_transition table is a special case, since we",
3412 " * need the dmap.dm_sz entry to tell us the sizeof the individual",
3413 " * struct members.",
3414 " */",
3415 " {",
3416 " size_t bytes;",
3418 " if ((td.td_flags & YYTD_STRUCT))",
3419 " bytes = sizeof(struct yy_trans_info) * td.td_lolen * (td.td_hilen ? td.td_hilen : 1);",
3420 " else",
3421 " bytes = td.td_lolen * (td.td_hilen ? td.td_hilen : 1) * dmap->dm_sz;",
3423 " if(M4_YY_TABLES_VERIFY)",
3424 " /* We point to the array itself */",
3425 " p = dmap->dm_arr; ",
3426 " else",
3427 " /* We point to the address of a pointer. */",
3428 " *dmap->dm_arr = p = (void *) yyalloc (bytes M4_YY_CALL_LAST_ARG);",
3429 " if ( ! p )",
3430 " YY_FATAL_ERROR( \"out of dynamic memory in yytbl_data_load()\" );",
3431 " }",
3433 " /* If it's a struct, we read 2 integers to get one element */",
3434 " if ((td.td_flags & YYTD_STRUCT) != 0)",
3435 " inner_loop_count = 2;",
3436 " else",
3437 " inner_loop_count = 1;",
3439 " /* read and map each element.",
3440 " * This loop iterates once for each element of the td_data array.",
3441 " * Notice that we increment 'i' in the inner loop.",
3442 " */",
3443 " len = yytbl_calc_total_len (&td);",
3444 " for (i = 0; i < len; ){",
3445 " int j;",
3448 " /* This loop really executes exactly 1 or 2 times.",
3449 " * The second time is to handle the second member of the",
3450 " * YYTD_STRUCT for the yy_transition array.",
3451 " */",
3452 " for (j = 0; j < inner_loop_count; j++, i++) {",
3453 " flex_int32_t t32;",
3455 " /* read into t32 no matter what the real size is. */",
3456 " {",
3457 " flex_int16_t t16;",
3458 " flex_int8_t t8;",
3460 " switch (YYTDFLAGS2BYTES (td.td_flags)) {",
3461 " case sizeof (flex_int32_t):",
3462 " rv = yytbl_read32 (&t32, rd);",
3463 " break;",
3464 " case sizeof (flex_int16_t):",
3465 " rv = yytbl_read16 (&t16, rd);",
3466 " t32 = t16;",
3467 " break;",
3468 " case sizeof (flex_int8_t):",
3469 " rv = yytbl_read8 (&t8, rd);",
3470 " t32 = t8;",
3471 " break;",
3472 " default: ",
3473 " YY_FATAL_ERROR( \"invalid td_flags\" ); /* TODO: not fatal. */",
3474 " return -1;",
3475 " }",
3476 " }",
3477 " if (rv != 0)",
3478 " return -1;",
3480 " /* copy into the deserialized array... */",
3482 " if ((td.td_flags & YYTD_STRUCT)) {",
3483 " /* t32 is the j'th member of a two-element struct. */",
3484 " void *v;",
3486 " v = j == 0 ? &(((struct yy_trans_info *) p)->yy_verify)",
3487 " : &(((struct yy_trans_info *) p)->yy_nxt);",
3489 " switch (dmap->dm_sz) {",
3490 " case sizeof (flex_int32_t):",
3491 " if (M4_YY_TABLES_VERIFY){",
3492 " if( ((flex_int32_t *) v)[0] != (flex_int32_t) t32)",
3493 " YY_FATAL_ERROR( \"tables verification failed at YYTD_STRUCT flex_int32_t\" );",
3494 " }else",
3495 " ((flex_int32_t *) v)[0] = (flex_int32_t) t32;",
3496 " break;",
3497 " case sizeof (flex_int16_t):",
3498 " if (M4_YY_TABLES_VERIFY ){",
3499 " if(((flex_int16_t *) v)[0] != (flex_int16_t) t32)",
3500 " YY_FATAL_ERROR( \"tables verification failed at YYTD_STRUCT flex_int16_t\" );",
3501 " }else",
3502 " ((flex_int16_t *) v)[0] = (flex_int16_t) t32;",
3503 " break;",
3504 " case sizeof(flex_int8_t):",
3505 " if (M4_YY_TABLES_VERIFY ){",
3506 " if( ((flex_int8_t *) v)[0] != (flex_int8_t) t32)",
3507 " YY_FATAL_ERROR( \"tables verification failed at YYTD_STRUCT flex_int8_t\" );",
3508 " }else",
3509 " ((flex_int8_t *) v)[0] = (flex_int8_t) t32;",
3510 " break;",
3511 " default:",
3512 " YY_FATAL_ERROR( \"invalid dmap->dm_sz for struct\" ); /* TODO: not fatal. */",
3513 " return -1;",
3514 " }",
3516 " /* if we're done with j, increment p */",
3517 " if (j == 1)",
3518 " p = (struct yy_trans_info *) p + 1;",
3519 " }",
3520 " else if ((td.td_flags & YYTD_PTRANS)) {",
3521 " /* t32 is an index into the transition array. */",
3522 " struct yy_trans_info *v;",
3525 " if (!transdmap){",
3526 " YY_FATAL_ERROR( \"transition table not found\" ); /* TODO: not fatal. */",
3527 " return -1;",
3528 " }",
3529 " ",
3530 " if( M4_YY_TABLES_VERIFY)",
3531 " v = &(((struct yy_trans_info *) (transdmap->dm_arr))[t32]);",
3532 " else",
3533 " v = &((*((struct yy_trans_info **) (transdmap->dm_arr)))[t32]);",
3535 " if(M4_YY_TABLES_VERIFY ){",
3536 " if( ((struct yy_trans_info **) p)[0] != v)",
3537 " YY_FATAL_ERROR( \"tables verification failed at YYTD_PTRANS\" );",
3538 " }else",
3539 " ((struct yy_trans_info **) p)[0] = v;",
3540 " ",
3541 " /* increment p */",
3542 " p = (struct yy_trans_info **) p + 1;",
3543 " }",
3544 " else {",
3545 " /* t32 is a plain int. copy data, then incrememnt p. */",
3546 " switch (dmap->dm_sz) {",
3547 " case sizeof (flex_int32_t):",
3548 " if(M4_YY_TABLES_VERIFY ){",
3549 " if( ((flex_int32_t *) p)[0] != (flex_int32_t) t32)",
3550 " YY_FATAL_ERROR( \"tables verification failed at flex_int32_t\" );",
3551 " }else",
3552 " ((flex_int32_t *) p)[0] = (flex_int32_t) t32;",
3553 " p = ((flex_int32_t *) p) + 1;",
3554 " break;",
3555 " case sizeof (flex_int16_t):",
3556 " if(M4_YY_TABLES_VERIFY ){",
3557 " if( ((flex_int16_t *) p)[0] != (flex_int16_t) t32)",
3558 " YY_FATAL_ERROR( \"tables verification failed at flex_int16_t\" );",
3559 " }else",
3560 " ((flex_int16_t *) p)[0] = (flex_int16_t) t32;",
3561 " p = ((flex_int16_t *) p) + 1;",
3562 " break;",
3563 " case sizeof (flex_int8_t):",
3564 " if(M4_YY_TABLES_VERIFY ){",
3565 " if( ((flex_int8_t *) p)[0] != (flex_int8_t) t32)",
3566 " YY_FATAL_ERROR( \"tables verification failed at flex_int8_t\" );",
3567 " }else",
3568 " ((flex_int8_t *) p)[0] = (flex_int8_t) t32;",
3569 " p = ((flex_int8_t *) p) + 1;",
3570 " break;",
3571 " default:",
3572 " YY_FATAL_ERROR( \"invalid dmap->dm_sz for plain int\" ); /* TODO: not fatal. */",
3573 " return -1;",
3574 " }",
3575 " }",
3576 " }",
3578 " }",
3580 " /* Now eat padding. */",
3581 " {",
3582 " int pad;",
3583 " pad = yypad64(rd->bread);",
3584 " while(--pad >= 0){",
3585 " flex_int8_t t8;",
3586 " if(yytbl_read8(&t8,rd) != 0)",
3587 " return -1;",
3588 " }",
3589 " }",
3591 " return 0;",
3592 "}",
3594 "%define-yytables The name for this specific scanner's tables.",
3596 "/* Find the key and load the DFA tables from the given stream. */",
3597 "static int yytbl_fload YYFARGS2(FILE *, fp, const char *, key)",
3598 "{",
3599 " int rv=0;",
3600 " struct yytbl_hdr th;",
3601 " struct yytbl_reader rd;",
3603 " rd.fp = fp;",
3604 " th.th_version = NULL;",
3606 " /* Keep trying until we find the right set of tables or end of file. */",
3607 " while (!feof(rd.fp)) {",
3608 " rd.bread = 0;",
3609 " if (yytbl_hdr_read (&th, &rd M4_YY_CALL_LAST_ARG) != 0){",
3610 " rv = -1;",
3611 " goto return_rv;",
3612 " }",
3614 " /* A NULL key means choose the first set of tables. */",
3615 " if (key == NULL)",
3616 " break;",
3618 " if (strcmp(th.th_name,key) != 0){",
3619 " /* Skip ahead to next set */",
3620 " fseek(rd.fp, th.th_ssize - th.th_hsize, SEEK_CUR);",
3621 " yyfree(th.th_version M4_YY_CALL_LAST_ARG);",
3622 " th.th_version = NULL;",
3623 " }",
3624 " else",
3625 " break;",
3626 " }",
3628 " while (rd.bread < th.th_ssize){",
3629 " /* Load the data tables */",
3630 " if(yytbl_data_load (yydmap,&rd M4_YY_CALL_LAST_ARG) != 0){",
3631 " rv = -1;",
3632 " goto return_rv;",
3633 " }",
3634 " }",
3636 "return_rv:",
3637 " if(th.th_version){",
3638 " yyfree(th.th_version M4_YY_CALL_LAST_ARG);",
3639 " th.th_version = NULL;",
3640 " }",
3642 " return rv;",
3643 "}",
3645 "/** Load the DFA tables for this scanner from the given stream. */",
3646 "int yytables_fload YYFARGS1(FILE *, fp)",
3647 "{",
3649 " if( yytbl_fload(fp, YYTABLES_NAME M4_YY_CALL_LAST_ARG) != 0)",
3650 " return -1;",
3651 " return 0;",
3652 "}",
3654 "/** Destroy the loaded tables, freeing memory, etc.. */",
3655 "int yytables_destroy YYFARGS0(void)",
3656 "{ ",
3657 " struct yytbl_dmap *dmap=0;",
3659 " if(!M4_YY_TABLES_VERIFY){",
3660 " /* Walk the dmap, freeing the pointers */",
3661 " for(dmap=yydmap; dmap->dm_id; dmap++) {",
3662 " void * v;",
3663 " v = dmap->dm_arr;",
3664 " if(v && *(char**)v){",
3665 " yyfree(*(char**)v M4_YY_CALL_LAST_ARG);",
3666 " *(char**)v = NULL;",
3667 " }",
3668 " }",
3669 " }",
3671 " return 0;",
3672 "}",
3674 "/* end table serialization code definitions */",
3675 "%endif",
3678 "m4_ifdef([[M4_YY_MAIN]], [[",
3679 "int main M4_YY_PARAMS(void);",
3681 "int main ()",
3682 "{",
3684 "%if-reentrant",
3685 " yyscan_t lexer;",
3686 " yylex_init(&lexer);",
3687 " yylex( lexer );",
3688 " yylex_destroy( lexer);",
3690 "%endif",
3691 "%if-not-reentrant",
3692 " yylex();",
3693 "%endif",
3695 " return 0;",
3696 "}",
3697 "]])",
3699 "%ok-for-header",
3700 "m4_ifdef( [[M4_YY_IN_HEADER]],",
3701 "[[",
3702 "#undef YY_NEW_FILE",
3703 "#undef YY_FLUSH_BUFFER",
3704 "#undef yy_set_bol",
3705 "#undef yy_new_buffer",
3706 "#undef yy_set_interactive",
3707 "#undef YY_DO_BEFORE_ACTION",
3709 "#ifdef YY_DECL_IS_OURS",
3710 "#undef YY_DECL_IS_OURS",
3711 "#undef YY_DECL",
3712 "#endif",
3713 "]])",