1 #define yyFlexLexer funxml_data_nodeFlexLexer
2 #define yywrap funxml_data_nodewrap
3 
4 /* A lexical scanner generated by flex */
5 
6 /* Scanner skeleton version:
7  * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern Exp $
8  */
9 
10 #define FLEX_SCANNER
11 #define YY_FLEX_MAJOR_VERSION 2
12 #define YY_FLEX_MINOR_VERSION 5
13 
14 
15 
16 /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
17 #ifdef c_plusplus
18 #ifndef __cplusplus
19 #define __cplusplus
20 #endif
21 #endif
22 
23 
24 #ifdef __cplusplus
25 
26 #include <stdlib.h>
27 #include <iostream>
28 
29 /* Use prototypes in function declarations. */
30 #define YY_USE_PROTOS
31 
32 /* The "const" storage-class-modifier is valid. */
33 #define YY_USE_CONST
34 
35 #else	/* ! __cplusplus */
36 
37 #if __STDC__
38 
39 #define YY_USE_PROTOS
40 #define YY_USE_CONST
41 
42 #endif	/* __STDC__ */
43 #endif	/* ! __cplusplus */
44 
45 #ifdef __TURBOC__
46  #pragma warn -rch
47  #pragma warn -use
48 #include <io.h>
49 #include <stdlib.h>
50 #define YY_USE_CONST
51 #define YY_USE_PROTOS
52 #endif
53 
54 #ifdef YY_USE_CONST
55 #define yyconst const
56 #else
57 #define yyconst
58 #endif
59 
60 
61 #ifdef YY_USE_PROTOS
62 #define YY_PROTO(proto) proto
63 #else
64 #define YY_PROTO(proto) ()
65 #endif
66 
67 /* Returned upon end-of-file. */
68 #define YY_NULL 0
69 
70 /* Promotes a possibly negative, possibly signed char to an unsigned
71  * integer for use as an array index.  If the signed char is negative,
72  * we want to instead treat it as an 8-bit unsigned char, hence the
73  * double cast.
74  */
75 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
76 
77 /* Enter a start condition.  This macro really ought to take a parameter,
78  * but we do it the disgusting crufty way forced on us by the ()-less
79  * definition of BEGIN.
80  */
81 #define BEGIN yy_start = 1 + 2 *
82 
83 /* Translate the current start state into a value that can be later handed
84  * to BEGIN to return to the state.  The YYSTATE alias is for lex
85  * compatibility.
86  */
87 #define YY_START ((yy_start - 1) / 2)
88 #define YYSTATE YY_START
89 
90 /* Action number for EOF rule of a given start state. */
91 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
92 
93 /* Special action meaning "start processing a new file". */
94 #define YY_NEW_FILE yyrestart( yyin )
95 
96 #define YY_END_OF_BUFFER_CHAR 0
97 
98 /* Size of default input buffer. */
99 #define YY_BUF_SIZE 16384
100 
101 typedef struct yy_buffer_state *YY_BUFFER_STATE;
102 
103 extern int yyleng;
104 
105 #define EOB_ACT_CONTINUE_SCAN 0
106 #define EOB_ACT_END_OF_FILE 1
107 #define EOB_ACT_LAST_MATCH 2
108 
109 /* The funky do-while in the following #define is used to turn the definition
110  * int a single C statement (which needs a semi-colon terminator).  This
111  * avoids problems with code like:
112  *
113  * 	if ( condition_holds )
114  *		yyless( 5 );
115  *	else
116  *		do_something_else();
117  *
118  * Prior to using the do-while the compiler would get upset at the
119  * "else" because it interpreted the "if" statement as being all
120  * done when it reached the ';' after the yyless() call.
121  */
122 
123 /* Return all but the first 'n' matched characters back to the input stream. */
124 
125 #define yyless(n) \
126 	do \
127 		{ \
128 		/* Undo effects of setting up yytext. */ \
129 		*yy_cp = yy_hold_char; \
130 		YY_RESTORE_YY_MORE_OFFSET \
131 		yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
132 		YY_DO_BEFORE_ACTION; /* set up yytext again */ \
133 		} \
134 	while ( 0 )
135 
136 #define unput(c) yyunput( c, yytext_ptr )
137 
138 /* The following is because we cannot portably get our hands on size_t
139  * (without autoconf's help, which isn't available because we want
140  * flex-generated scanners to compile on their own).
141  */
142 typedef unsigned int yy_size_t;
143 
144 
145 struct yy_buffer_state
146 	{
147 	std::istream* yy_input_file;
148 
149 	char *yy_ch_buf;		/* input buffer */
150 	char *yy_buf_pos;		/* current position in input buffer */
151 
152 	/* Size of input buffer in bytes, not including room for EOB
153 	 * characters.
154 	 */
155 	yy_size_t yy_buf_size;
156 
157 	/* Number of characters read into yy_ch_buf, not including EOB
158 	 * characters.
159 	 */
160 	int yy_n_chars;
161 
162 	/* Whether we "own" the buffer - i.e., we know we created it,
163 	 * and can realloc() it to grow it, and should free() it to
164 	 * delete it.
165 	 */
166 	int yy_is_our_buffer;
167 
168 	/* Whether this is an "interactive" input source; if so, and
169 	 * if we're using stdio for input, then we want to use getc()
170 	 * instead of fread(), to make sure we stop fetching input after
171 	 * each newline.
172 	 */
173 	int yy_is_interactive;
174 
175 	/* Whether we're considered to be at the beginning of a line.
176 	 * If so, '^' rules will be active on the next match, otherwise
177 	 * not.
178 	 */
179 	int yy_at_bol;
180 
181 	/* Whether to try to fill the input buffer when we reach the
182 	 * end of it.
183 	 */
184 	int yy_fill_buffer;
185 
186 	int yy_buffer_status;
187 #define YY_BUFFER_NEW 0
188 #define YY_BUFFER_NORMAL 1
189 	/* When an EOF's been seen but there's still some text to process
190 	 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
191 	 * shouldn't try reading from the input source any more.  We might
192 	 * still have a bunch of tokens to match, though, because of
193 	 * possible backing-up.
194 	 *
195 	 * When we actually see the EOF, we change the status to "new"
196 	 * (via yyrestart()), so that the user can continue scanning by
197 	 * just pointing yyin at a new input file.
198 	 */
199 #define YY_BUFFER_EOF_PENDING 2
200 	};
201 
202 
203 /* We provide macros for accessing buffer states in case in the
204  * future we want to put the buffer states in a more general
205  * "scanner state".
206  */
207 #define YY_CURRENT_BUFFER yy_current_buffer
208 
209 
210 
211 static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
212 static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
213 static void yy_flex_free YY_PROTO(( void * ));
214 
215 #define yy_new_buffer yy_create_buffer
216 
217 #define yy_set_interactive(is_interactive) \
218 	{ \
219 	if ( ! yy_current_buffer ) \
220 		yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
221 	yy_current_buffer->yy_is_interactive = is_interactive; \
222 	}
223 
224 #define yy_set_bol(at_bol) \
225 	{ \
226 	if ( ! yy_current_buffer ) \
227 		yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
228 	yy_current_buffer->yy_at_bol = at_bol; \
229 	}
230 
231 #define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
232 
233 typedef unsigned char YY_CHAR;
234 #define yytext_ptr yytext
235 
236 #include <s11n.net/s11n/io/FlexLexer.hpp>
237 
238 
239 /* Done after the current pattern has been matched and before the
240  * corresponding action - sets up yytext.
241  */
242 #define YY_DO_BEFORE_ACTION \
243 	yytext_ptr = yy_bp; \
244 	yyleng = (int) (yy_cp - yy_bp); \
245 	yy_hold_char = *yy_cp; \
246 	*yy_cp = '\0'; \
247 	yy_c_buf_p = yy_cp;
248 
249 #define YY_NUM_RULES 5
250 #define YY_END_OF_BUFFER 6
251 static yyconst short int yy_accept[59] =
252     {   0,
253         0,    0,    6,    4,    4,    4,    0,    0,    0,    0,
254         0,    0,    0,    0,    0,    0,    0,    0,    0,    2,
255         0,    0,    0,    0,    0,    0,    3,    0,    0,    0,
256         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
257         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
258         0,    0,    0,    0,    1,    0,    1,    0
259     } ;
260 
261 static yyconst int yy_ec[256] =
262     {   0,
263         1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
264         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
265         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
266         1,    2,    1,    4,    1,    1,    1,    1,    5,    1,
267         1,    1,    6,    1,    6,    7,    8,    9,    9,    9,
268         9,    9,    9,    9,    9,    9,    9,    1,    1,   10,
269        11,   12,    1,    1,   13,   13,   13,   13,   14,   13,
270        13,   13,   13,   13,   13,   13,   13,   13,   13,   13,
271        13,   13,   13,   13,   13,   13,   13,   13,   13,   13,
272         1,   15,    1,    1,   13,    1,   16,   13,   17,   13,
273 
274        14,   13,   13,   13,   13,   13,   13,   18,   13,   13,
275        13,   13,   13,   13,   19,   13,   13,   13,   13,   13,
276        13,   13,    1,    1,    1,    1,    1,    1,    1,    1,
277         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
278         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
279         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
280         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
281         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
282         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
283         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
284 
285         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
286         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
287         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
288         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
289         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
290         1,    1,    1,    1,    1
291     } ;
292 
293 static yyconst int yy_meta[20] =
294     {   0,
295         1,    2,    1,    3,    1,    4,    4,    5,    6,    1,
296         1,    2,    6,    6,    1,    6,    6,    6,    6
297     } ;
298 
299 static yyconst short int yy_base[65] =
300     {   0,
301         0,    1,  106,  164,  164,    6,    0,   96,   10,   18,
302         6,   36,   49,   14,   93,   57,   70,   22,   86,  164,
303        83,   20,   35,   89,   95,   85,  164,   40,   79,   85,
304        87,  108,   79,   78,   46,   47,   77,   74,   52,   45,
305        56,   50,   41,   28,   31,    0,   25,   23,   18,   63,
306         1,   70,  119,   78,  164,    0,   79,  164,  134,  137,
307       140,  145,  151,  157
308     } ;
309 
310 static yyconst short int yy_def[65] =
311     {   0,
312        59,   59,   58,   58,   58,   60,   58,   58,   61,   58,
313        62,   58,   58,   58,   58,   58,   16,   58,   13,   58,
314        62,   58,   58,   58,   58,   25,   58,   17,   58,   58,
315        21,   58,   58,   32,   58,   58,   58,   17,   58,   58,
316        58,   58,   58,   58,   58,   58,   63,   64,   63,   63,
317        64,   58,   63,   58,   58,   53,   53,    0,   58,   58,
318        58,   58,   58,   58
319     } ;
320 
321 static yyconst short int yy_nxt[184] =
322     {   0,
323        58,    5,    5,   47,   48,   52,    8,   18,   12,    6,
324         6,    7,    8,    9,   10,   14,   15,   20,   16,   18,
325        15,   52,   24,   18,   19,   30,   10,   52,   32,   20,
326        11,   21,   50,   11,   11,   11,   11,   18,   29,   50,
327        33,   46,   19,   34,   12,   37,   45,   20,   38,   22,
328        18,   37,   41,   40,   40,   42,   27,   13,   42,   44,
329        20,   27,   23,   26,   42,   16,   53,   43,   27,   17,
330        28,   54,   17,   17,   17,   17,   58,   50,   17,   54,
331        49,   55,   38,   17,   18,   40,   34,   34,   30,   55,
332        49,   31,   58,   32,   20,   26,   39,   24,   35,   22,
333 
334        27,   25,   35,   25,   13,   58,   27,   58,   36,   18,
335        58,   58,   58,   58,   58,   58,   32,   58,   58,   20,
336        56,   58,   52,   58,   58,   58,   58,   58,   58,   58,
337        57,   58,   58,   50,    4,    4,    4,    4,    4,    4,
338        11,   11,   11,   17,   58,   17,   11,   58,   58,   58,
339        11,   49,   49,   58,   49,   49,   49,   51,   51,   51,
340        51,   51,   51,    3,   58,   58,   58,   58,   58,   58,
341        58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
342        58,   58,   58
343     } ;
344 
345 static yyconst short int yy_chk[184] =
346     {   0,
347         0,    1,    2,   46,   46,   51,    7,   11,    7,    1,
348         2,    6,    6,    6,    6,    9,    9,   11,    9,   10,
349        14,   49,   14,   18,   10,   22,   10,   48,   22,   10,
350        10,   10,   49,   10,   10,   10,   10,   12,   18,   47,
351        23,   45,   12,   23,   12,   28,   44,   12,   28,   12,
352        13,   35,   36,   40,   35,   36,   40,   13,   42,   43,
353        13,   42,   13,   16,   41,   16,   50,   39,   16,   16,
354        16,   52,   16,   16,   16,   16,   17,   50,   17,   54,
355        57,   52,   38,   17,   21,   37,   34,   33,   21,   54,
356        57,   21,   31,   30,   21,   24,   29,   24,   26,   19,
357 
358        24,   15,   24,   25,    8,    3,   25,    0,   25,   32,
359         0,    0,    0,    0,    0,    0,   32,    0,    0,   32,
360        53,    0,   53,    0,    0,    0,    0,    0,    0,    0,
361        53,    0,    0,   53,   59,   59,   59,   59,   59,   59,
362        60,   60,   60,   61,    0,   61,   62,    0,    0,    0,
363        62,   63,   63,    0,   63,   63,   63,   64,   64,   64,
364        64,   64,   64,   58,   58,   58,   58,   58,   58,   58,
365        58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
366        58,   58,   58
367     } ;
368 
369 /* The intent behind this definition is that it'll catch
370  * any uses of REJECT which flex missed.
371  */
372 #define REJECT reject_used_but_not_detected
373 #define yymore() yymore_used_but_not_detected
374 #define YY_MORE_ADJ 0
375 #define YY_RESTORE_YY_MORE_OFFSET
376 #line 1 "funxml.flex"
377 #define INITIAL 0
378 #line 3 "funxml.flex"
379 #define YY_SKIP_YYWRAP 1
yywrap()380 int yywrap() { return 1; }
381 
382 #include <stdio.h> // only for EOF definition
383 #include <cassert>
384 #include <iostream>
385 #include <string>
386 #include <deque>
387 
388 #include <s11n.net/s11n/s11n_debuggering_macros.hpp> // CERR
389 #define PCERR if( 0 ) CERR
390 
391 #include <s11n.net/s11n/io/strtool.hpp> // translate_entities()
392 #include <s11n.net/s11n/io/data_node_format.hpp> // node_tree_builder, tree_builder_context
393 #include <s11n.net/s11n/io/funxml_serializer.hpp> // funxml_sharing_context
394 
395 
396 #include <s11n.net/s11n/io/funxml_data_nodeFlexLexer.hpp>
397 
398 #define S11N_FACREG_TYPE funxml_data_nodeFlexLexer
399 #define S11N_FACREG_TYPE_NAME "funxml_data_nodeFlexLexer"
400 #define S11N_FACREG_INTERFACE_TYPE FlexLexer
401 #include <s11n.net/s11n/factory_reg.hpp>
402 
403 
404 
405 //////////////////////////////////////////////////////////////////////
406 // workarounds for the (very outdated) flex output:
407 using std::cin;
408 using std::cout;
409 using std::cerr;
410 using std::endl;
411 //////////////////////////////////////////////////////////////////////
412 
413 
414 namespace // funxml internal
415 {
416         // a communication context to talk to s11n with.
417         typedef s11n::io::tree_builder_context<
418                 s11n::io::sharing::funxml_sharing_context
419         > BuilderContext;
420 
421 }
422 
423 ////////////////////////////////////////////////////////////////////////////////
424 // Get instance-specific vars, stored externally because
425 // we can't change the FlexLexer-gen'd class to add them
426 // as members.
427 #define METADATA(PROP) BuilderContext::metadata(this).PROP
428 ////////////////////////////////////////////////////////////////////////////////
429 
430 // QUOTED_STRING: doesn't yet handle escaped quotes-in-quotes. Need to use
431 //# separate states for that, i think.
432 // CLASSNAME_CPP_NORMAL	((({WORD}\:\:)+)?({WORD}))
433 // CLASSNAME_CPP_TEMPLATE	(([a-zA-Z_])([a-zA-Z0-9_\.\:<>,])*)
434 // ESCAPED_MULTILINE	((.*\$)/[^(\\\n)]*)
435 // ESCAPED_MULTILINE	([.]+([^\\]\n$))
436 // {ESCAPED_MULTILINE}|
437 // PROPERTY_TYPES		({ESCAPED_MULTILINE})
438 //UNTIL_SEMICOLON		.+\;{SPACE}*$
439 //PROPERTY_VALUE		({NUMBER}|{ALMOST_A_WORD}|{QUOTED_STRING}|{WORD_WITH_PUNCTUATION}|{RGB_COLOR})
440 // WORD_WITH_PUNCTUATION	[#.\!\?\-_a-zA-Z0-9]+
441 //UNTIL_EOL		([.\n]+[^\\]$)
442 //ESCAPED_LINES		((.+([\\]\n))+[^\\]\n)
443 // COMMON_DEFINITIONS: See common_flex_definitions.at
444 // NUMBER support is to help out s11n_node::deserialize_list/Map()
445 
446 /* Macros after this point can all be overridden by user definitions in
447  * section 1.
448  */
449 
450 #ifndef YY_SKIP_YYWRAP
451 #ifdef __cplusplus
452 extern "C" int yywrap YY_PROTO(( void ));
453 #else
454 extern int yywrap YY_PROTO(( void ));
455 #endif
456 #endif
457 
458 
459 #ifndef yytext_ptr
460 static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
461 #endif
462 
463 #ifdef YY_NEED_STRLEN
464 static int yy_flex_strlen YY_PROTO(( yyconst char * ));
465 #endif
466 
467 #ifndef YY_NO_INPUT
468 #endif
469 
470 #if YY_STACK_USED
471 static int yy_start_stack_ptr = 0;
472 static int yy_start_stack_depth = 0;
473 static int *yy_start_stack = 0;
474 #ifndef YY_NO_PUSH_STATE
475 static void yy_push_state YY_PROTO(( int new_state ));
476 #endif
477 #ifndef YY_NO_POP_STATE
478 static void yy_pop_state YY_PROTO(( void ));
479 #endif
480 #ifndef YY_NO_TOP_STATE
481 static int yy_top_state YY_PROTO(( void ));
482 #endif
483 
484 #else
485 #define YY_NO_PUSH_STATE 1
486 #define YY_NO_POP_STATE 1
487 #define YY_NO_TOP_STATE 1
488 #endif
489 
490 #ifdef YY_MALLOC_DECL
491 YY_MALLOC_DECL
492 #else
493 #if __STDC__
494 #ifndef __cplusplus
495 #include <stdlib.h>
496 #endif
497 #else
498 /* Just try to get by without declaring the routines.  This will fail
499  * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
500  * or sizeof(void*) != sizeof(int).
501  */
502 #endif
503 #endif
504 
505 /* Amount of stuff to slurp up with each read. */
506 #ifndef YY_READ_BUF_SIZE
507 #define YY_READ_BUF_SIZE 8192
508 #endif
509 
510 /* Copy whatever the last rule matched to the standard output. */
511 
512 #ifndef ECHO
513 #define ECHO LexerOutput( yytext, yyleng )
514 #endif
515 
516 /* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
517  * is returned in "result".
518  */
519 #ifndef YY_INPUT
520 #define YY_INPUT(buf,result,max_size) \
521 	if ( (result = LexerInput( (char *) buf, max_size )) < 0 ) \
522 		YY_FATAL_ERROR( "input in flex scanner failed" );
523 #endif
524 
525 /* No semi-colon after return; correct usage is to write "yyterminate();" -
526  * we don't want an extra ';' after the "return" because that will cause
527  * some compilers to complain about unreachable statements.
528  */
529 #ifndef yyterminate
530 #define yyterminate() return YY_NULL
531 #endif
532 
533 /* Number of entries by which start-condition stack grows. */
534 #ifndef YY_START_STACK_INCR
535 #define YY_START_STACK_INCR 25
536 #endif
537 
538 /* Report a fatal error. */
539 #ifndef YY_FATAL_ERROR
540 #define YY_FATAL_ERROR(msg) LexerError( msg )
541 #endif
542 
543 /* Default declaration of generated scanner - a define so the user can
544  * easily add parameters.
545  */
546 #ifndef YY_DECL
547 #define YY_DECL int yyFlexLexer::yylex()
548 #endif
549 
550 /* Code executed at the beginning of each rule, after yytext and yyleng
551  * have been set up.
552  */
553 #ifndef YY_USER_ACTION
554 #define YY_USER_ACTION
555 #endif
556 
557 /* Code executed at the end of each rule. */
558 #ifndef YY_BREAK
559 #define YY_BREAK break;
560 #endif
561 
562 #define YY_RULE_SETUP \
563 	YY_USER_ACTION
564 
565 YY_DECL
566 	{
567 	register yy_state_type yy_current_state;
568 	register char *yy_cp, *yy_bp;
569 	register int yy_act;
570 
571 #line 114 "funxml.flex"
572 
573 
574 
575 
576 
577 	if ( yy_init )
578 		{
579 		yy_init = 0;
580 
581 #ifdef YY_USER_INIT
582 		YY_USER_INIT;
583 #endif
584 
585 		if ( ! yy_start )
586 			yy_start = 1;	/* first start state */
587 
588 		if ( ! yyin )
589 			yyin = &cin;
590 
591 		if ( ! yyout )
592 			yyout = &cout;
593 
594 		if ( ! yy_current_buffer )
595 			yy_current_buffer =
596 				yy_create_buffer( yyin, YY_BUF_SIZE );
597 
598 		yy_load_buffer_state();
599 		}
600 
601 	while ( 1 )		/* loops until end-of-file is reached */
602 		{
603 		yy_cp = yy_c_buf_p;
604 
605 		/* Support of yytext. */
606 		*yy_cp = yy_hold_char;
607 
608 		/* yy_bp points to the position in yy_ch_buf of the start of
609 		 * the current run.
610 		 */
611 		yy_bp = yy_cp;
612 
613 		yy_current_state = yy_start;
614 yy_match:
615 		do
616 			{
617 			register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
618 			if ( yy_accept[yy_current_state] )
619 				{
620 				yy_last_accepting_state = yy_current_state;
621 				yy_last_accepting_cpos = yy_cp;
622 				}
623 			while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
624 				{
625 				yy_current_state = (int) yy_def[yy_current_state];
626 				if ( yy_current_state >= 59 )
627 					yy_c = yy_meta[(unsigned int) yy_c];
628 				}
629 			yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
630 			++yy_cp;
631 			}
632 		while ( yy_current_state != 58 );
633 		yy_cp = yy_last_accepting_cpos;
634 		yy_current_state = yy_last_accepting_state;
635 
636 yy_find_action:
637 		yy_act = yy_accept[yy_current_state];
638 
639 		YY_DO_BEFORE_ACTION;
640 
641 
642 do_action:	/* This label is used only to access EOF actions. */
643 
644 
645 		switch ( yy_act )
646 	{ /* beginning of action switch */
647 			case 0: /* must back up */
648 			/* undo the effects of YY_DO_BEFORE_ACTION */
649 			*yy_cp = yy_hold_char;
650 			yy_cp = yy_last_accepting_cpos;
651 			yy_current_state = yy_last_accepting_state;
652 			goto yy_find_action;
653 
654 case 1:
655 YY_RULE_SETUP
656 #line 118 "funxml.flex"
657 {  // QUOTED_STRING is to support class templates, which have translated entities.
658 	// opening a node
659         ++METADATA(internaldepth);
660         std::string & yy = METADATA(bufferyy);
661         yy = YYText();
662         PCERR << "? opening class node ? ["<<yy<<"]" << std::endl;
663 
664         std::string::size_type opos = yy.find( "class=\"" ) + 7;
665         std::string::size_type cpos = yy.find( "\"", opos );
666 
667         std::string & nodename = METADATA(nodename);
668         std::string & nodeclass = METADATA(nodeclass);
669         nodeclass = yy.substr( opos, cpos - opos );
670         nodename = yy.substr( 1, yy.find_first_of( " \t\n" ) - 1 );
671         ::s11n::io::strtool::translate_entities( nodeclass, s11n::io::funxml_serializer_translations(), true ); // handle class templates
672         BuilderContext::open_node(this, nodeclass, nodename);
673         PCERR << "opening node ["<<nodeclass<<"] impl_class=["<<nodename<<"]\n";
674         continue;
675 	}
676 	YY_BREAK
677 case 2:
678 YY_RULE_SETUP
679 #line 138 "funxml.flex"
680 {
681         // opening a property
682         METADATA(property) = "";
683         ++METADATA(internaldepth);
684 	}
685 	YY_BREAK
686 case 3:
687 YY_RULE_SETUP
688 #line 144 "funxml.flex"
689 {
690         // closing something
691         std::string & yy = METADATA(bufferyy);
692         std::string & cdata = METADATA(property);
693 	yy = YYText();
694         size_t & depth = METADATA(internaldepth);
695         if( depth != BuilderContext::node_depth(this) )
696         { // closing a property.
697                 std::string prop = yy.substr( 2, yy.size() - 3 );
698                 ::s11n::io::strtool::translate_entities( cdata, s11n::io::funxml_serializer_translations(), true );
699                 PCERR << "adding property ["<<prop<<"]=["<<cdata<<"]\n";
700                 BuilderContext::add_property( this, prop, cdata );
701         }
702         else
703         { // closing an object node.
704                 PCERR << "closing node. ["<<METADATA(nodename)<<"]\n";
705                 BuilderContext::close_node(this);
706         }
707         --depth;
708         cdata = "";
709         if( 0 == depth )
710         {
711                 PCERR << "closing root node.\n";
712                 // return once we close the first top-level node.
713                 return 0;
714         }
715 
716 
717    }
718 	YY_BREAK
719 case 4:
720 YY_RULE_SETUP
721 #line 176 "funxml.flex"
722 { METADATA(property) += YYText();}
723 	YY_BREAK
724 case 5:
725 YY_RULE_SETUP
726 #line 178 "funxml.flex"
727 ECHO;
728 	YY_BREAK
729 case YY_STATE_EOF(INITIAL):
730 	yyterminate();
731 
732 	case YY_END_OF_BUFFER:
733 		{
734 		/* Amount of text matched not including the EOB char. */
735 		int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
736 
737 		/* Undo the effects of YY_DO_BEFORE_ACTION. */
738 		*yy_cp = yy_hold_char;
739 		YY_RESTORE_YY_MORE_OFFSET
740 
741 		if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
742 			{
743 			/* We're scanning a new file or input source.  It's
744 			 * possible that this happened because the user
745 			 * just pointed yyin at a new source and called
746 			 * yylex().  If so, then we have to assure
747 			 * consistency between yy_current_buffer and our
748 			 * globals.  Here is the right place to do so, because
749 			 * this is the first action (other than possibly a
750 			 * back-up) that will match for the new input source.
751 			 */
752 			yy_n_chars = yy_current_buffer->yy_n_chars;
753 			yy_current_buffer->yy_input_file = yyin;
754 			yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
755 			}
756 
757 		/* Note that here we test for yy_c_buf_p "<=" to the position
758 		 * of the first EOB in the buffer, since yy_c_buf_p will
759 		 * already have been incremented past the NUL character
760 		 * (since all states make transitions on EOB to the
761 		 * end-of-buffer state).  Contrast this with the test
762 		 * in input().
763 		 */
764 		if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
765 			{ /* This was really a NUL. */
766 			yy_state_type yy_next_state;
767 
768 			yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
769 
770 			yy_current_state = yy_get_previous_state();
771 
772 			/* Okay, we're now positioned to make the NUL
773 			 * transition.  We couldn't have
774 			 * yy_get_previous_state() go ahead and do it
775 			 * for us because it doesn't know how to deal
776 			 * with the possibility of jamming (and we don't
777 			 * want to build jamming into it because then it
778 			 * will run more slowly).
779 			 */
780 
781 			yy_next_state = yy_try_NUL_trans( yy_current_state );
782 
783 			yy_bp = yytext_ptr + YY_MORE_ADJ;
784 
785 			if ( yy_next_state )
786 				{
787 				/* Consume the NUL. */
788 				yy_cp = ++yy_c_buf_p;
789 				yy_current_state = yy_next_state;
790 				goto yy_match;
791 				}
792 
793 			else
794 				{
795 				yy_cp = yy_last_accepting_cpos;
796 				yy_current_state = yy_last_accepting_state;
797 				goto yy_find_action;
798 				}
799 			}
800 
801 		else switch ( yy_get_next_buffer() )
802 			{
803 			case EOB_ACT_END_OF_FILE:
804 				{
805 				yy_did_buffer_switch_on_eof = 0;
806 
807 				if ( yywrap() )
808 					{
809 					/* Note: because we've taken care in
810 					 * yy_get_next_buffer() to have set up
811 					 * yytext, we can now set up
812 					 * yy_c_buf_p so that if some total
813 					 * hoser (like flex itself) wants to
814 					 * call the scanner after we return the
815 					 * YY_NULL, it'll still work - another
816 					 * YY_NULL will get returned.
817 					 */
818 					yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
819 
820 					yy_act = YY_STATE_EOF(YY_START);
821 					goto do_action;
822 					}
823 
824 				else
825 					{
826 					if ( ! yy_did_buffer_switch_on_eof )
827 						YY_NEW_FILE;
828 					}
829 				break;
830 				}
831 
832 			case EOB_ACT_CONTINUE_SCAN:
833 				yy_c_buf_p =
834 					yytext_ptr + yy_amount_of_matched_text;
835 
836 				yy_current_state = yy_get_previous_state();
837 
838 				yy_cp = yy_c_buf_p;
839 				yy_bp = yytext_ptr + YY_MORE_ADJ;
840 				goto yy_match;
841 
842 			case EOB_ACT_LAST_MATCH:
843 				yy_c_buf_p =
844 				&yy_current_buffer->yy_ch_buf[yy_n_chars];
845 
846 				yy_current_state = yy_get_previous_state();
847 
848 				yy_cp = yy_c_buf_p;
849 				yy_bp = yytext_ptr + YY_MORE_ADJ;
850 				goto yy_find_action;
851 			}
852 		break;
853 		}
854 
855 	default:
856 		YY_FATAL_ERROR(
857 			"fatal flex scanner internal error--no action found" );
858 	} /* end of action switch */
859 		} /* end of scanning one token */
860 	} /* end of yylex */
861 
862 yyFlexLexer::yyFlexLexer( std::istream* arg_yyin, std::ostream* arg_yyout )
863 	{
864 	yyin = arg_yyin;
865 	yyout = arg_yyout;
866 	yy_c_buf_p = 0;
867 	yy_init = 1;
868 	yy_start = 0;
869 	yy_flex_debug = 0;
870 	yylineno = 1;	// this will only get updated if %option yylineno
871 
872 	yy_did_buffer_switch_on_eof = 0;
873 
874 	yy_looking_for_trail_begin = 0;
875 	yy_more_flag = 0;
876 	yy_more_len = 0;
877 	yy_more_offset = yy_prev_more_offset = 0;
878 
879 	yy_start_stack_ptr = yy_start_stack_depth = 0;
880 	yy_start_stack = 0;
881 
882 	yy_current_buffer = 0;
883 
884 #ifdef YY_USES_REJECT
885 	yy_state_buf = new yy_state_type[YY_BUF_SIZE + 2];
886 #else
887 	yy_state_buf = 0;
888 #endif
889 	}
890 
~yyFlexLexer()891 yyFlexLexer::~yyFlexLexer()
892 	{
893 	delete yy_state_buf;
894 	yy_delete_buffer( yy_current_buffer );
895 	}
896 
switch_streams(std::istream * new_in,std::ostream * new_out)897 void yyFlexLexer::switch_streams( std::istream* new_in, std::ostream* new_out )
898 	{
899 	if ( new_in )
900 		{
901 		yy_delete_buffer( yy_current_buffer );
902 		yy_switch_to_buffer( yy_create_buffer( new_in, YY_BUF_SIZE ) );
903 		}
904 
905 	if ( new_out )
906 		yyout = new_out;
907 	}
908 
909 #ifdef YY_INTERACTIVE
LexerInput(char * buf,int)910 int yyFlexLexer::LexerInput( char* buf, int /* max_size */ )
911 #else
912 int yyFlexLexer::LexerInput( char* buf, int max_size )
913 #endif
914 	{
915 	if ( yyin->eof() || yyin->fail() )
916 		return 0;
917 
918 #ifdef YY_INTERACTIVE
919 	yyin->get( buf[0] );
920 
921 	if ( yyin->eof() )
922 		return 0;
923 
924 	if ( yyin->bad() )
925 		return -1;
926 
927 	return 1;
928 
929 #else
930 	(void) yyin->read( buf, max_size );
931 
932 	if ( yyin->bad() )
933 		return -1;
934 	else
935 		return yyin->gcount();
936 #endif
937 	}
938 
LexerOutput(const char * buf,int size)939 void yyFlexLexer::LexerOutput( const char* buf, int size )
940 	{
941 	(void) yyout->write( buf, size );
942 	}
943 
944 /* yy_get_next_buffer - try to read in a new buffer
945  *
946  * Returns a code representing an action:
947  *	EOB_ACT_LAST_MATCH -
948  *	EOB_ACT_CONTINUE_SCAN - continue scanning from current position
949  *	EOB_ACT_END_OF_FILE - end of file
950  */
951 
yy_get_next_buffer()952 int yyFlexLexer::yy_get_next_buffer()
953 	{
954 	register char *dest = yy_current_buffer->yy_ch_buf;
955 	register char *source = yytext_ptr;
956 	register int number_to_move, i;
957 	int ret_val;
958 
959 	if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
960 		YY_FATAL_ERROR(
961 		"fatal flex scanner internal error--end of buffer missed" );
962 
963 	if ( yy_current_buffer->yy_fill_buffer == 0 )
964 		{ /* Don't try to fill the buffer, so this is an EOF. */
965 		if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
966 			{
967 			/* We matched a single character, the EOB, so
968 			 * treat this as a final EOF.
969 			 */
970 			return EOB_ACT_END_OF_FILE;
971 			}
972 
973 		else
974 			{
975 			/* We matched some text prior to the EOB, first
976 			 * process it.
977 			 */
978 			return EOB_ACT_LAST_MATCH;
979 			}
980 		}
981 
982 	/* Try to read more data. */
983 
984 	/* First move last chars to start of buffer. */
985 	number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
986 
987 	for ( i = 0; i < number_to_move; ++i )
988 		*(dest++) = *(source++);
989 
990 	if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
991 		/* don't do the read, it's not guaranteed to return an EOF,
992 		 * just force an EOF
993 		 */
994 		yy_current_buffer->yy_n_chars = yy_n_chars = 0;
995 
996 	else
997 		{
998 		int num_to_read =
999 			yy_current_buffer->yy_buf_size - number_to_move - 1;
1000 
1001 		while ( num_to_read <= 0 )
1002 			{ /* Not enough room in the buffer - grow it. */
1003 #ifdef YY_USES_REJECT
1004 			YY_FATAL_ERROR(
1005 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
1006 #else
1007 
1008 			/* just a shorter name for the current buffer */
1009 			YY_BUFFER_STATE b = yy_current_buffer;
1010 
1011 			int yy_c_buf_p_offset =
1012 				(int) (yy_c_buf_p - b->yy_ch_buf);
1013 
1014 			if ( b->yy_is_our_buffer )
1015 				{
1016 				int new_size = b->yy_buf_size * 2;
1017 
1018 				if ( new_size <= 0 )
1019 					b->yy_buf_size += b->yy_buf_size / 8;
1020 				else
1021 					b->yy_buf_size *= 2;
1022 
1023 				b->yy_ch_buf = (char *)
1024 					/* Include room in for 2 EOB chars. */
1025 					yy_flex_realloc( (void *) b->yy_ch_buf,
1026 							 b->yy_buf_size + 2 );
1027 				}
1028 			else
1029 				/* Can't grow it, we don't own it. */
1030 				b->yy_ch_buf = 0;
1031 
1032 			if ( ! b->yy_ch_buf )
1033 				YY_FATAL_ERROR(
1034 				"fatal error - scanner input buffer overflow" );
1035 
1036 			yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1037 
1038 			num_to_read = yy_current_buffer->yy_buf_size -
1039 						number_to_move - 1;
1040 #endif
1041 			}
1042 
1043 		if ( num_to_read > YY_READ_BUF_SIZE )
1044 			num_to_read = YY_READ_BUF_SIZE;
1045 
1046 		/* Read in more data. */
1047 		YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
1048 			yy_n_chars, num_to_read );
1049 
1050 		yy_current_buffer->yy_n_chars = yy_n_chars;
1051 		}
1052 
1053 	if ( yy_n_chars == 0 )
1054 		{
1055 		if ( number_to_move == YY_MORE_ADJ )
1056 			{
1057 			ret_val = EOB_ACT_END_OF_FILE;
1058 			yyrestart( yyin );
1059 			}
1060 
1061 		else
1062 			{
1063 			ret_val = EOB_ACT_LAST_MATCH;
1064 			yy_current_buffer->yy_buffer_status =
1065 				YY_BUFFER_EOF_PENDING;
1066 			}
1067 		}
1068 
1069 	else
1070 		ret_val = EOB_ACT_CONTINUE_SCAN;
1071 
1072 	yy_n_chars += number_to_move;
1073 	yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
1074 	yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
1075 
1076 	yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
1077 
1078 	return ret_val;
1079 	}
1080 
1081 
1082 /* yy_get_previous_state - get the state just before the EOB char was reached */
1083 
yy_get_previous_state()1084 yy_state_type yyFlexLexer::yy_get_previous_state()
1085 	{
1086 	register yy_state_type yy_current_state;
1087 	register char *yy_cp;
1088 
1089 	yy_current_state = yy_start;
1090 
1091 	for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
1092 		{
1093 		register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1094 		if ( yy_accept[yy_current_state] )
1095 			{
1096 			yy_last_accepting_state = yy_current_state;
1097 			yy_last_accepting_cpos = yy_cp;
1098 			}
1099 		while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1100 			{
1101 			yy_current_state = (int) yy_def[yy_current_state];
1102 			if ( yy_current_state >= 59 )
1103 				yy_c = yy_meta[(unsigned int) yy_c];
1104 			}
1105 		yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1106 		}
1107 
1108 	return yy_current_state;
1109 	}
1110 
1111 
1112 /* yy_try_NUL_trans - try to make a transition on the NUL character
1113  *
1114  * synopsis
1115  *	next_state = yy_try_NUL_trans( current_state );
1116  */
1117 
yy_try_NUL_trans(yy_state_type yy_current_state)1118 yy_state_type yyFlexLexer::yy_try_NUL_trans( yy_state_type yy_current_state )
1119 	{
1120 	register int yy_is_jam;
1121 	register char *yy_cp = yy_c_buf_p;
1122 
1123 	register YY_CHAR yy_c = 1;
1124 	if ( yy_accept[yy_current_state] )
1125 		{
1126 		yy_last_accepting_state = yy_current_state;
1127 		yy_last_accepting_cpos = yy_cp;
1128 		}
1129 	while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1130 		{
1131 		yy_current_state = (int) yy_def[yy_current_state];
1132 		if ( yy_current_state >= 59 )
1133 			yy_c = yy_meta[(unsigned int) yy_c];
1134 		}
1135 	yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1136 	yy_is_jam = (yy_current_state == 58);
1137 
1138 	return yy_is_jam ? 0 : yy_current_state;
1139 	}
1140 
1141 
yyunput(int c,register char * yy_bp)1142 void yyFlexLexer::yyunput( int c, register char* yy_bp )
1143 	{
1144 	register char *yy_cp = yy_c_buf_p;
1145 
1146 	/* undo effects of setting up yytext */
1147 	*yy_cp = yy_hold_char;
1148 
1149 	if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1150 		{ /* need to shift things up to make room */
1151 		/* +2 for EOB chars. */
1152 		register int number_to_move = yy_n_chars + 2;
1153 		register char *dest = &yy_current_buffer->yy_ch_buf[
1154 					yy_current_buffer->yy_buf_size + 2];
1155 		register char *source =
1156 				&yy_current_buffer->yy_ch_buf[number_to_move];
1157 
1158 		while ( source > yy_current_buffer->yy_ch_buf )
1159 			*--dest = *--source;
1160 
1161 		yy_cp += (int) (dest - source);
1162 		yy_bp += (int) (dest - source);
1163 		yy_current_buffer->yy_n_chars =
1164 			yy_n_chars = yy_current_buffer->yy_buf_size;
1165 
1166 		if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1167 			YY_FATAL_ERROR( "flex scanner push-back overflow" );
1168 		}
1169 
1170 	*--yy_cp = (char) c;
1171 
1172 
1173 	yytext_ptr = yy_bp;
1174 	yy_hold_char = *yy_cp;
1175 	yy_c_buf_p = yy_cp;
1176 	}
1177 
1178 
yyinput()1179 int yyFlexLexer::yyinput()
1180 	{
1181 	int c;
1182 
1183 	*yy_c_buf_p = yy_hold_char;
1184 
1185 	if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
1186 		{
1187 		/* yy_c_buf_p now points to the character we want to return.
1188 		 * If this occurs *before* the EOB characters, then it's a
1189 		 * valid NUL; if not, then we've hit the end of the buffer.
1190 		 */
1191 		if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1192 			/* This was really a NUL. */
1193 			*yy_c_buf_p = '\0';
1194 
1195 		else
1196 			{ /* need more input */
1197 			int offset = yy_c_buf_p - yytext_ptr;
1198 			++yy_c_buf_p;
1199 
1200 			switch ( yy_get_next_buffer() )
1201 				{
1202 				case EOB_ACT_LAST_MATCH:
1203 					/* This happens because yy_g_n_b()
1204 					 * sees that we've accumulated a
1205 					 * token and flags that we need to
1206 					 * try matching the token before
1207 					 * proceeding.  But for input(),
1208 					 * there's no matching to consider.
1209 					 * So convert the EOB_ACT_LAST_MATCH
1210 					 * to EOB_ACT_END_OF_FILE.
1211 					 */
1212 
1213 					/* Reset buffer status. */
1214 					yyrestart( yyin );
1215 
1216 					/* fall through */
1217 
1218 				case EOB_ACT_END_OF_FILE:
1219 					{
1220 					if ( yywrap() )
1221 						return EOF;
1222 
1223 					if ( ! yy_did_buffer_switch_on_eof )
1224 						YY_NEW_FILE;
1225 #ifdef __cplusplus
1226 					return yyinput();
1227 #else
1228 					return input();
1229 #endif
1230 					}
1231 
1232 				case EOB_ACT_CONTINUE_SCAN:
1233 					yy_c_buf_p = yytext_ptr + offset;
1234 					break;
1235 				}
1236 			}
1237 		}
1238 
1239 	c = *(unsigned char *) yy_c_buf_p;	/* cast for 8-bit char's */
1240 	*yy_c_buf_p = '\0';	/* preserve yytext */
1241 	yy_hold_char = *++yy_c_buf_p;
1242 
1243 
1244 	return c;
1245 	}
1246 
1247 
yyrestart(std::istream * input_file)1248 void yyFlexLexer::yyrestart( std::istream* input_file )
1249 	{
1250 	if ( ! yy_current_buffer )
1251 		yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
1252 
1253 	yy_init_buffer( yy_current_buffer, input_file );
1254 	yy_load_buffer_state();
1255 	}
1256 
1257 
yy_switch_to_buffer(YY_BUFFER_STATE new_buffer)1258 void yyFlexLexer::yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
1259 	{
1260 	if ( yy_current_buffer == new_buffer )
1261 		return;
1262 
1263 	if ( yy_current_buffer )
1264 		{
1265 		/* Flush out information for old buffer. */
1266 		*yy_c_buf_p = yy_hold_char;
1267 		yy_current_buffer->yy_buf_pos = yy_c_buf_p;
1268 		yy_current_buffer->yy_n_chars = yy_n_chars;
1269 		}
1270 
1271 	yy_current_buffer = new_buffer;
1272 	yy_load_buffer_state();
1273 
1274 	/* We don't actually know whether we did this switch during
1275 	 * EOF (yywrap()) processing, but the only time this flag
1276 	 * is looked at is after yywrap() is called, so it's safe
1277 	 * to go ahead and always set it.
1278 	 */
1279 	yy_did_buffer_switch_on_eof = 1;
1280 	}
1281 
1282 
yy_load_buffer_state()1283 void yyFlexLexer::yy_load_buffer_state()
1284 	{
1285 	yy_n_chars = yy_current_buffer->yy_n_chars;
1286 	yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
1287 	yyin = yy_current_buffer->yy_input_file;
1288 	yy_hold_char = *yy_c_buf_p;
1289 	}
1290 
1291 
yy_create_buffer(std::istream * file,int size)1292 YY_BUFFER_STATE yyFlexLexer::yy_create_buffer( std::istream* file, int size )
1293 	{
1294 	YY_BUFFER_STATE b;
1295 
1296 	b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1297 	if ( ! b )
1298 		YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1299 
1300 	b->yy_buf_size = size;
1301 
1302 	/* yy_ch_buf has to be 2 characters longer than the size given because
1303 	 * we need to put in 2 end-of-buffer characters.
1304 	 */
1305 	b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
1306 	if ( ! b->yy_ch_buf )
1307 		YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1308 
1309 	b->yy_is_our_buffer = 1;
1310 
1311 	yy_init_buffer( b, file );
1312 
1313 	return b;
1314 	}
1315 
1316 
yy_delete_buffer(YY_BUFFER_STATE b)1317 void yyFlexLexer::yy_delete_buffer( YY_BUFFER_STATE b )
1318 	{
1319 	if ( ! b )
1320 		return;
1321 
1322 	if ( b == yy_current_buffer )
1323 		yy_current_buffer = (YY_BUFFER_STATE) 0;
1324 
1325 	if ( b->yy_is_our_buffer )
1326 		yy_flex_free( (void *) b->yy_ch_buf );
1327 
1328 	yy_flex_free( (void *) b );
1329 	}
1330 
1331 
1332 extern "C" int isatty YY_PROTO(( int ));
yy_init_buffer(YY_BUFFER_STATE b,std::istream * file)1333 void yyFlexLexer::yy_init_buffer( YY_BUFFER_STATE b, std::istream* file )
1334 
1335 	{
1336 	yy_flush_buffer( b );
1337 
1338 	b->yy_input_file = file;
1339 	b->yy_fill_buffer = 1;
1340 
1341 	b->yy_is_interactive = 0;
1342 	}
1343 
1344 
yy_flush_buffer(YY_BUFFER_STATE b)1345 void yyFlexLexer::yy_flush_buffer( YY_BUFFER_STATE b )
1346 	{
1347 	if ( ! b )
1348 		return;
1349 
1350 	b->yy_n_chars = 0;
1351 
1352 	/* We always need two end-of-buffer characters.  The first causes
1353 	 * a transition to the end-of-buffer state.  The second causes
1354 	 * a jam in that state.
1355 	 */
1356 	b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1357 	b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1358 
1359 	b->yy_buf_pos = &b->yy_ch_buf[0];
1360 
1361 	b->yy_at_bol = 1;
1362 	b->yy_buffer_status = YY_BUFFER_NEW;
1363 
1364 	if ( b == yy_current_buffer )
1365 		yy_load_buffer_state();
1366 	}
1367 
1368 
1369 #ifndef YY_NO_SCAN_BUFFER
1370 #endif
1371 
1372 
1373 #ifndef YY_NO_SCAN_STRING
1374 #endif
1375 
1376 
1377 #ifndef YY_NO_SCAN_BYTES
1378 #endif
1379 
1380 
1381 #ifndef YY_NO_PUSH_STATE
yy_push_state(int new_state)1382 void yyFlexLexer::yy_push_state( int new_state )
1383 	{
1384 	if ( yy_start_stack_ptr >= yy_start_stack_depth )
1385 		{
1386 		yy_size_t new_size;
1387 
1388 		yy_start_stack_depth += YY_START_STACK_INCR;
1389 		new_size = yy_start_stack_depth * sizeof( int );
1390 
1391 		if ( ! yy_start_stack )
1392 			yy_start_stack = (int *) yy_flex_alloc( new_size );
1393 
1394 		else
1395 			yy_start_stack = (int *) yy_flex_realloc(
1396 					(void *) yy_start_stack, new_size );
1397 
1398 		if ( ! yy_start_stack )
1399 			YY_FATAL_ERROR(
1400 			"out of memory expanding start-condition stack" );
1401 		}
1402 
1403 	yy_start_stack[yy_start_stack_ptr++] = YY_START;
1404 
1405 	BEGIN(new_state);
1406 	}
1407 #endif
1408 
1409 
1410 #ifndef YY_NO_POP_STATE
yy_pop_state()1411 void yyFlexLexer::yy_pop_state()
1412 	{
1413 	if ( --yy_start_stack_ptr < 0 )
1414 		YY_FATAL_ERROR( "start-condition stack underflow" );
1415 
1416 	BEGIN(yy_start_stack[yy_start_stack_ptr]);
1417 	}
1418 #endif
1419 
1420 
1421 #ifndef YY_NO_TOP_STATE
yy_top_state()1422 int yyFlexLexer::yy_top_state()
1423 	{
1424 	return yy_start_stack[yy_start_stack_ptr - 1];
1425 	}
1426 #endif
1427 
1428 #ifndef YY_EXIT_FAILURE
1429 #define YY_EXIT_FAILURE 2
1430 #endif
1431 
1432 
LexerError(yyconst char msg[])1433 void yyFlexLexer::LexerError( yyconst char msg[] )
1434 	{
1435 	cerr << msg << '\n';
1436 	exit( YY_EXIT_FAILURE );
1437 	}
1438 
1439 
1440 /* Redefine yyless() so it works in section 3 code. */
1441 
1442 #undef yyless
1443 #define yyless(n) \
1444 	do \
1445 		{ \
1446 		/* Undo effects of setting up yytext. */ \
1447 		yytext[yyleng] = yy_hold_char; \
1448 		yy_c_buf_p = yytext + n; \
1449 		yy_hold_char = *yy_c_buf_p; \
1450 		*yy_c_buf_p = '\0'; \
1451 		yyleng = n; \
1452 		} \
1453 	while ( 0 )
1454 
1455 
1456 /* Internal utility routines. */
1457 
1458 #ifndef yytext_ptr
1459 #ifdef YY_USE_PROTOS
yy_flex_strncpy(char * s1,yyconst char * s2,int n)1460 static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
1461 #else
1462 static void yy_flex_strncpy( s1, s2, n )
1463 char *s1;
1464 yyconst char *s2;
1465 int n;
1466 #endif
1467 	{
1468 	register int i;
1469 	for ( i = 0; i < n; ++i )
1470 		s1[i] = s2[i];
1471 	}
1472 #endif
1473 
1474 #ifdef YY_NEED_STRLEN
1475 #ifdef YY_USE_PROTOS
yy_flex_strlen(yyconst char * s)1476 static int yy_flex_strlen( yyconst char *s )
1477 #else
1478 static int yy_flex_strlen( s )
1479 yyconst char *s;
1480 #endif
1481 	{
1482 	register int n;
1483 	for ( n = 0; s[n]; ++n )
1484 		;
1485 
1486 	return n;
1487 	}
1488 #endif
1489 
1490 
1491 #ifdef YY_USE_PROTOS
yy_flex_alloc(yy_size_t size)1492 static void *yy_flex_alloc( yy_size_t size )
1493 #else
1494 static void *yy_flex_alloc( size )
1495 yy_size_t size;
1496 #endif
1497 	{
1498 	return (void *) malloc( size );
1499 	}
1500 
1501 #ifdef YY_USE_PROTOS
yy_flex_realloc(void * ptr,yy_size_t size)1502 static void *yy_flex_realloc( void *ptr, yy_size_t size )
1503 #else
1504 static void *yy_flex_realloc( ptr, size )
1505 void *ptr;
1506 yy_size_t size;
1507 #endif
1508 	{
1509 	/* The cast to (char *) in the following accommodates both
1510 	 * implementations that use char* generic pointers, and those
1511 	 * that use void* generic pointers.  It works with the latter
1512 	 * because both ANSI C and C++ allow castless assignment from
1513 	 * any pointer type to void*, and deal with argument conversions
1514 	 * as though doing an assignment.
1515 	 */
1516 	return (void *) realloc( (char *) ptr, size );
1517 	}
1518 
1519 #ifdef YY_USE_PROTOS
yy_flex_free(void * ptr)1520 static void yy_flex_free( void *ptr )
1521 #else
1522 static void yy_flex_free( ptr )
1523 void *ptr;
1524 #endif
1525 	{
1526 	free( ptr );
1527 	}
1528 
1529 #if YY_MAIN
main()1530 int main()
1531 	{
1532 	yylex();
1533 	return 0;
1534 	}
1535 #endif
1536 #line 178 "funxml.flex"
1537 
1538 
1539 #undef METADATA
1540