1 /*
2 	This file is part of Warzone 2100.
3 	Copyright (C) 2005-2020  Warzone 2100 Project
4 
5 	Warzone 2100 is free software; you can redistribute it and/or modify
6 	it under the terms of the GNU General Public License as published by
7 	the Free Software Foundation; either version 2 of the License, or
8 	(at your option) any later version.
9 
10 	Warzone 2100 is distributed in the hope that it will be useful,
11 	but WITHOUT ANY WARRANTY; without even the implied warranty of
12 	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 	GNU General Public License for more details.
14 
15 	You should have received a copy of the GNU General Public License
16 	along with Warzone 2100; if not, write to the Free Software
17 	Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19 
20 #if defined( _MSC_VER )
21 	#pragma warning( disable : 4003 ) // warning C4003: not enough actual parameters for macro 'strres_wrap'
22 	#pragma warning( disable : 4244 ) // warning C4244: '=': conversion from '<type>' to 'YY_CHAR', possible loss of data
23 	#pragma warning( disable : 4267 )
24 #endif
25 #if defined(__clang__)
26 	#pragma clang diagnostic ignored "-Wunneeded-internal-declaration" // warning: function 'yyinput' is not needed and will not be emitted
27 #elif defined(__GNUC__)
28 	#if 7 <= __GNUC__
29 		#pragma GCC diagnostic ignored "-Wnull-dereference"
30 	#endif
31 #endif
32 
33 #line 2 "strres_lexer.cpp"
34 
35 #line 4 "strres_lexer.cpp"
36 
37 #define  YY_INT_ALIGNED short int
38 
39 /* A lexical scanner generated by flex */
40 
41 #define yy_create_buffer strres__create_buffer
42 #define yy_delete_buffer strres__delete_buffer
43 #define yy_flex_debug strres__flex_debug
44 #define yy_init_buffer strres__init_buffer
45 #define yy_flush_buffer strres__flush_buffer
46 #define yy_load_buffer_state strres__load_buffer_state
47 #define yy_switch_to_buffer strres__switch_to_buffer
48 #define yyin strres_in
49 #define yyleng strres_leng
50 #define yylex strres_lex
51 #define yylineno strres_lineno
52 #define yyout strres_out
53 #define yyrestart strres_restart
54 #define yytext strres_text
55 #define yywrap strres_wrap
56 #define yyalloc strres_alloc
57 #define yyrealloc strres_realloc
58 #define yyfree strres_free
59 
60 #define FLEX_SCANNER
61 #define YY_FLEX_MAJOR_VERSION 2
62 #define YY_FLEX_MINOR_VERSION 5
63 #define YY_FLEX_SUBMINOR_VERSION 35
64 #if YY_FLEX_SUBMINOR_VERSION > 0
65 #define FLEX_BETA
66 #endif
67 
68 /* First, we deal with  platform-specific or compiler-specific issues. */
69 #include "lib/framework/frame.h"
70 /* begin standard C headers. */
71 #include <stdio.h>
72 #include <string.h>
73 #include <errno.h>
74 #include <stdlib.h>
75 
76 /* end standard C headers. */
77 
78 /* flex integer type definitions */
79 
80 #ifndef FLEXINT_H
81 #define FLEXINT_H
82 
83 #include "lib/framework/wzglobal.h"
84 
85 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
86 
87 #if defined(HAVE_INTTYPES_H) || (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L)
88 
89 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
90  * if you want the limit (max/min) macros for int types.
91  */
92 #ifndef __STDC_LIMIT_MACROS
93 #define __STDC_LIMIT_MACROS 1
94 #endif
95 
96 #include <inttypes.h>
97 typedef int8_t flex_int8_t;
98 typedef uint8_t flex_uint8_t;
99 typedef int16_t flex_int16_t;
100 typedef uint16_t flex_uint16_t;
101 typedef int32_t flex_int32_t;
102 typedef uint32_t flex_uint32_t;
103 #else
104 typedef signed char flex_int8_t;
105 typedef short int flex_int16_t;
106 typedef int flex_int32_t;
107 typedef unsigned char flex_uint8_t;
108 typedef unsigned short int flex_uint16_t;
109 typedef unsigned int flex_uint32_t;
110 
111 /* Limits of integral types. */
112 #ifndef INT8_MIN
113 #define INT8_MIN               (-128)
114 #endif
115 #ifndef INT16_MIN
116 #define INT16_MIN              (-32767-1)
117 #endif
118 #ifndef INT32_MIN
119 #define INT32_MIN              (-2147483647-1)
120 #endif
121 #ifndef INT8_MAX
122 #define INT8_MAX               (127)
123 #endif
124 #ifndef INT16_MAX
125 #define INT16_MAX              (32767)
126 #endif
127 #ifndef INT32_MAX
128 #define INT32_MAX              (2147483647)
129 #endif
130 #ifndef UINT8_MAX
131 #define UINT8_MAX              (255U)
132 #endif
133 #ifndef UINT16_MAX
134 #define UINT16_MAX             (65535U)
135 #endif
136 #ifndef UINT32_MAX
137 #define UINT32_MAX             (4294967295U)
138 #endif
139 
140 #endif /* ! C99 */
141 
142 #endif /* ! FLEXINT_H */
143 
144 #ifdef __cplusplus
145 
146 /* The "const" storage-class-modifier is valid. */
147 #define YY_USE_CONST
148 
149 #else	/* ! __cplusplus */
150 
151 /* C99 requires __STDC__ to be defined as 1. */
152 #if defined (__STDC__)
153 
154 #define YY_USE_CONST
155 
156 #endif	/* defined (__STDC__) */
157 #endif	/* ! __cplusplus */
158 
159 #ifdef YY_USE_CONST
160 #define yyconst const
161 #else
162 #define yyconst
163 #endif
164 
165 /* Returned upon end-of-file. */
166 #define YY_NULL 0
167 
168 /* Promotes a possibly negative, possibly signed char to an unsigned
169  * integer for use as an array index.  If the signed char is negative,
170  * we want to instead treat it as an 8-bit unsigned char, hence the
171  * double cast.
172  */
173 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
174 
175 /* Enter a start condition.  This macro really ought to take a parameter,
176  * but we do it the disgusting crufty way forced on us by the ()-less
177  * definition of BEGIN.
178  */
179 #define BEGIN (yy_start) = 1 + 2 *
180 
181 /* Translate the current start state into a value that can be later handed
182  * to BEGIN to return to the state.  The YYSTATE alias is for lex
183  * compatibility.
184  */
185 #define YY_START (((yy_start) - 1) / 2)
186 #define YYSTATE YY_START
187 
188 /* Action number for EOF rule of a given start state. */
189 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
190 
191 /* Special action meaning "start processing a new file". */
192 #define YY_NEW_FILE strres_restart(strres_in  )
193 
194 #define YY_END_OF_BUFFER_CHAR 0
195 
196 /* Size of default input buffer. */
197 #ifndef YY_BUF_SIZE
198 #ifdef __ia64__
199 /* On IA-64, the buffer size is 16k, not 8k.
200  * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
201  * Ditto for the __ia64__ case accordingly.
202  */
203 #define YY_BUF_SIZE 32768
204 #else
205 #define YY_BUF_SIZE 16384
206 #endif /* __ia64__ */
207 #endif
208 
209 /* The state buf must be large enough to hold one state per character in the main buffer.
210  */
211 #define YY_STATE_BUF_SIZE   ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
212 
213 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
214 #define YY_TYPEDEF_YY_BUFFER_STATE
215 typedef struct yy_buffer_state *YY_BUFFER_STATE;
216 #endif
217 
218 extern int strres_leng;
219 
220 extern FILE *strres_in, *strres_out;
221 
222 #define EOB_ACT_CONTINUE_SCAN 0
223 #define EOB_ACT_END_OF_FILE 1
224 #define EOB_ACT_LAST_MATCH 2
225 
226     /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires
227      *       access to the local variable yy_act. Since yyless() is a macro, it would break
228      *       existing scanners that call yyless() from OUTSIDE strres_lex.
229      *       One obvious solution it to make yy_act a global. I tried that, and saw
230      *       a 5% performance hit in a non-strres_lineno scanner, because yy_act is
231      *       normally declared as a register variable-- so it is not worth it.
232      */
233     #define  YY_LESS_LINENO(n) \
234             do { \
235                 int yyl;\
236                 for ( yyl = n; yyl < strres_leng; ++yyl )\
237                     if ( strres_text[yyl] == '\n' )\
238                         --strres_lineno;\
239             }while(0)
240 
241 /* Return all but the first "n" matched characters back to the input stream. */
242 #define yyless(n) \
243 	do \
244 		{ \
245 		/* Undo effects of setting up strres_text. */ \
246         int yyless_macro_arg = (n); \
247         YY_LESS_LINENO(yyless_macro_arg);\
248 		*yy_cp = (yy_hold_char); \
249 		YY_RESTORE_YY_MORE_OFFSET \
250 		(yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
251 		YY_DO_BEFORE_ACTION; /* set up strres_text again */ \
252 		} \
253 	while ( 0 )
254 
255 #define unput(c) yyunput( c, (yytext_ptr)  )
256 
257 #ifndef YY_TYPEDEF_YY_SIZE_T
258 #define YY_TYPEDEF_YY_SIZE_T
259 typedef size_t yy_size_t;
260 #endif
261 
262 #ifndef YY_STRUCT_YY_BUFFER_STATE
263 #define YY_STRUCT_YY_BUFFER_STATE
264 struct yy_buffer_state
265 	{
266 	FILE *yy_input_file;
267 
268 	char *yy_ch_buf;		/* input buffer */
269 	char *yy_buf_pos;		/* current position in input buffer */
270 
271 	/* Size of input buffer in bytes, not including room for EOB
272 	 * characters.
273 	 */
274 	yy_size_t yy_buf_size;
275 
276 	/* Number of characters read into yy_ch_buf, not including EOB
277 	 * characters.
278 	 */
279 	int yy_n_chars;
280 
281 	/* Whether we "own" the buffer - i.e., we know we created it,
282 	 * and can realloc() it to grow it, and should free() it to
283 	 * delete it.
284 	 */
285 	int yy_is_our_buffer;
286 
287 	/* Whether this is an "interactive" input source; if so, and
288 	 * if we're using stdio for input, then we want to use getc()
289 	 * instead of fread(), to make sure we stop fetching input after
290 	 * each newline.
291 	 */
292 	int yy_is_interactive;
293 
294 	/* Whether we're considered to be at the beginning of a line.
295 	 * If so, '^' rules will be active on the next match, otherwise
296 	 * not.
297 	 */
298 	int yy_at_bol;
299 
300     int yy_bs_lineno; /**< The line count. */
301     int yy_bs_column; /**< The column count. */
302 
303 	/* Whether to try to fill the input buffer when we reach the
304 	 * end of it.
305 	 */
306 	int yy_fill_buffer;
307 
308 	int yy_buffer_status;
309 
310 #define YY_BUFFER_NEW 0
311 #define YY_BUFFER_NORMAL 1
312 	/* When an EOF's been seen but there's still some text to process
313 	 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
314 	 * shouldn't try reading from the input source any more.  We might
315 	 * still have a bunch of tokens to match, though, because of
316 	 * possible backing-up.
317 	 *
318 	 * When we actually see the EOF, we change the status to "new"
319 	 * (via strres_restart()), so that the user can continue scanning by
320 	 * just pointing strres_in at a new input file.
321 	 */
322 #define YY_BUFFER_EOF_PENDING 2
323 
324 	};
325 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
326 
327 /* Stack of input buffers. */
328 static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
329 static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
330 static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
331 
332 /* We provide macros for accessing buffer states in case in the
333  * future we want to put the buffer states in a more general
334  * "scanner state".
335  *
336  * Returns the top of the stack, or NULL.
337  */
338 #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
339                           ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
340                           : NULL)
341 
342 /* Same as previous macro, but useful when we know that the buffer stack is not
343  * NULL or when we need an lvalue. For internal use only.
344  */
345 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
346 
347 /* yy_hold_char holds the character lost when strres_text is formed. */
348 static char yy_hold_char;
349 static int yy_n_chars;		/* number of characters read into yy_ch_buf */
350 int strres_leng;
351 
352 /* Points to current character in buffer. */
353 static char *yy_c_buf_p = (char *) 0;
354 static int yy_init = 0;		/* whether we need to initialize */
355 static int yy_start = 0;	/* start state number */
356 
357 /* Flag which is used to allow strres_wrap()'s to do buffer switches
358  * instead of setting up a fresh strres_in.  A bit of a hack ...
359  */
360 static int yy_did_buffer_switch_on_eof;
361 
362 void strres_restart (FILE *input_file  );
363 void strres__switch_to_buffer (YY_BUFFER_STATE new_buffer  );
364 YY_BUFFER_STATE strres__create_buffer (FILE *file,int size  );
365 void strres__delete_buffer (YY_BUFFER_STATE b  );
366 void strres__flush_buffer (YY_BUFFER_STATE b  );
367 void strres_push_buffer_state (YY_BUFFER_STATE new_buffer  );
368 void strres_pop_buffer_state (void );
369 
370 static void strres_ensure_buffer_stack (void );
371 static void strres__load_buffer_state (void );
372 static void strres__init_buffer (YY_BUFFER_STATE b,FILE *file  );
373 
374 #define YY_FLUSH_BUFFER strres__flush_buffer(YY_CURRENT_BUFFER )
375 
376 YY_BUFFER_STATE strres__scan_buffer (char *base,yy_size_t size  );
377 YY_BUFFER_STATE strres__scan_string (yyconst char *yy_str  );
378 YY_BUFFER_STATE strres__scan_bytes (yyconst char *bytes,int len  );
379 
380 void *strres_alloc (yy_size_t  );
381 void *strres_realloc (void *,yy_size_t  );
382 void strres_free (void *  );
383 
384 #define yy_new_buffer strres__create_buffer
385 
386 #define yy_set_interactive(is_interactive) \
387 	{ \
388 	if ( ! YY_CURRENT_BUFFER ){ \
389         strres_ensure_buffer_stack (); \
390 		YY_CURRENT_BUFFER_LVALUE =    \
391             strres__create_buffer(strres_in,YY_BUF_SIZE ); \
392 	} \
393 	YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
394 	}
395 
396 #define yy_set_bol(at_bol) \
397 	{ \
398 	if ( ! YY_CURRENT_BUFFER ){\
399         strres_ensure_buffer_stack (); \
400 		YY_CURRENT_BUFFER_LVALUE =    \
401             strres__create_buffer(strres_in,YY_BUF_SIZE ); \
402 	} \
403 	YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
404 	}
405 
406 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
407 
408 /* Begin user sect3 */
409 
410 #define strres_wrap(n) 1
411 #define YY_SKIP_YYWRAP
412 
413 typedef unsigned char YY_CHAR;
414 
415 FILE *strres_in = (FILE *) 0, *strres_out = (FILE *) 0;
416 
417 typedef int yy_state_type;
418 
419 extern int strres_lineno;
420 
421 int strres_lineno = 1;
422 
423 extern char *strres_text;
424 #define yytext_ptr strres_text
425 
426 static yy_state_type yy_get_previous_state (void );
427 static yy_state_type yy_try_NUL_trans (yy_state_type current_state  );
428 static int yy_get_next_buffer (void );
429 [[ noreturn ]] static void yy_fatal_error (yyconst char msg[]  );
430 
431 /* Done after the current pattern has been matched and before the
432  * corresponding action - sets up strres_text.
433  */
434 #define YY_DO_BEFORE_ACTION \
435 	(yytext_ptr) = yy_bp; \
436 	strres_leng = (size_t) (yy_cp - yy_bp); \
437 	(yy_hold_char) = *yy_cp; \
438 	*yy_cp = '\0'; \
439 	(yy_c_buf_p) = yy_cp;
440 
441 #define YY_NUM_RULES 16
442 #define YY_END_OF_BUFFER 17
443 /* This struct is not used in this scanner,
444    but its presence is necessary. */
445 struct yy_trans_info
446 	{
447 	flex_int32_t yy_verify;
448 	flex_int32_t yy_nxt;
449 	};
450 static yyconst flex_int16_t yy_accept[32] =
451     {   0,
452         0,    0,    0,    0,    5,    5,   14,   14,   17,   15,
453         6,    6,    2,   15,    1,   10,   11,   10,    5,    4,
454         3,   14,   13,    7,   12,    1,    8,    5,   14,    9,
455         0
456     } ;
457 
458 static yyconst flex_int32_t yy_ec[256] =
459     {   0,
460         1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
461         1,    1,    2,    1,    1,    1,    1,    1,    1,    1,
462         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
463         1,    2,    1,    4,    1,    1,    1,    1,    1,    1,
464         1,    5,    1,    1,    6,    1,    7,    6,    6,    6,
465         6,    6,    6,    6,    6,    6,    6,    1,    1,    1,
466         1,    1,    1,    1,    8,    8,    8,    8,    8,    8,
467         8,    8,    8,    8,    8,    8,    8,    8,    8,    8,
468         8,    8,    8,    8,    8,    8,    8,    8,    8,    8,
469         1,    1,    1,    1,    6,    1,    8,    8,    8,    8,
470 
471         8,    8,    8,    8,    8,    8,    8,    8,    8,    8,
472         8,    8,    8,    8,    8,    8,    8,    8,    8,    8,
473         8,    8,    1,    1,    1,    1,    1,    1,    1,    1,
474         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
475         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
476         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
477         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
478         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
479         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
480         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
481 
482         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
483         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
484         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
485         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
486         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
487         1,    1,    1,    1,    1
488     } ;
489 
490 static yyconst flex_int32_t yy_meta[9] =
491     {   0,
492         1,    1,    2,    3,    1,    4,    1,    4
493     } ;
494 
495 static yyconst flex_int16_t yy_base[38] =
496     {   0,
497         0,    0,    6,    9,   12,   14,   36,   33,   35,   42,
498        42,   42,   42,   14,    0,   42,   42,   13,    0,   42,
499        42,    0,   42,   42,   42,    0,   10,    0,    0,   42,
500        42,   21,   25,   29,    6,   33,   37
501     } ;
502 
503 static yyconst flex_int16_t yy_def[38] =
504     {   0,
505        31,    1,   32,   32,   33,   33,   34,   34,   31,   31,
506        31,   31,   31,   31,   35,   31,   31,   31,   36,   31,
507        31,   37,   31,   31,   31,   35,   31,   36,   37,   31,
508         0,   31,   31,   31,   31,   31,   31
509     } ;
510 
511 static yyconst flex_int16_t yy_nxt[51] =
512     {   0,
513        10,   11,   12,   13,   10,   10,   14,   15,   17,   26,
514        18,   17,   30,   18,   20,   21,   20,   21,   24,   27,
515        25,   16,   16,   16,   16,   19,   19,   19,   19,   22,
516        22,   22,   22,   28,   31,   23,   28,   29,   23,   29,
517        29,    9,   31,   31,   31,   31,   31,   31,   31,   31
518     } ;
519 
520 static yyconst flex_int16_t yy_chk[51] =
521     {   0,
522         1,    1,    1,    1,    1,    1,    1,    1,    3,   35,
523         3,    4,   27,    4,    5,    5,    6,    6,   14,   18,
524        14,   32,   32,   32,   32,   33,   33,   33,   33,   34,
525        34,   34,   34,   36,    9,    8,   36,   37,    7,   37,
526        37,   31,   31,   31,   31,   31,   31,   31,   31,   31
527     } ;
528 
529 /* Table of booleans, true if rule could match eol. */
530 static yyconst flex_int32_t yy_rule_can_match_eol[17] =
531     {   0,
532 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0,     };
533 
534 static yy_state_type yy_last_accepting_state;
535 static char *yy_last_accepting_cpos;
536 
537 extern int strres__flex_debug;
538 int strres__flex_debug = 0;
539 
540 /* The intent behind this definition is that it'll catch
541  * any uses of REJECT which flex missed.
542  */
543 #define REJECT reject_used_but_not_detected
544 #define yymore() yymore_used_but_not_detected
545 #define YY_MORE_ADJ 0
546 #define YY_RESTORE_YY_MORE_OFFSET
547 char *strres_text;
548 #line 1 "strres_lexer.lpp"
549 /*
550 	This file is part of Warzone 2100.
551 	Copyright (C) 1999-2004  Eidos Interactive
552 	Copyright (C) 2005-2020  Warzone 2100 Project
553 
554 	Warzone 2100 is free software; you can redistribute it and/or modify
555 	it under the terms of the GNU General Public License as published by
556 	the Free Software Foundation; either version 2 of the License, or
557 	(at your option) any later version.
558 
559 	Warzone 2100 is distributed in the hope that it will be useful,
560 	but WITHOUT ANY WARRANTY; without even the implied warranty of
561 	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
562 	GNU General Public License for more details.
563 
564 	You should have received a copy of the GNU General Public License
565 	along with Warzone 2100; if not, write to the Free Software
566 	Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
567 */
568 #line 21 "strres_lexer.lpp"
569 /** @file
570  *
571  *  Lexical analyser resource files
572  */
573 
574 #include "lib/framework/frame.h"
575 
576 /* Allow frame header files to be singly included */
577 #define FRAME_LIB_INCLUDE
578 
579 #include "lib/framework/strres.h"
580 #include "lib/framework/strresly.h"
581 
582 #include <physfs.h>
583 
584 /* Get the Yacc definitions */
585 #include "strres_parser.h"
586 
587 #include "lib/framework/lexer_input.h"
588 
589 // fwrite declared with warn_unused_result, resulting in mysterious errors in "%%" on some distros.
no_warn_unused_result(int ignore)590 static inline bool no_warn_unused_result(int ignore) { if (ignore) {} return true; }
591 #define fwrite(a, b, c, d) no_warn_unused_result(fwrite(a, b, c, d))
592 
593 #ifndef yyextra
594 # define yyextra strres_get_extra()
595 #endif
596 
597 /* Older GNU Flex versions don't define strres_get_extra(), strres_set_extra(),
598  * strres_get_text() and strres_get_lineno().
599  * (and neither define a subminor version)
600  */
601 #if !defined(YY_FLEX_SUBMINOR_VERSION) || (YY_FLEX_SUBMINOR_VERSION < 9)
602 # define strres_get_extra  strres_get_extra
603 # define strres_set_extra  strres_set_extra
604 # define strres_get_lineno strres_get_lineno
605 # define strres_get_text   strres_get_text
606 extern void strres_set_extra(YY_EXTRA_TYPE user_defined);
607 extern YY_EXTRA_TYPE strres_get_extra(void);
608 extern int strres_get_lineno(void);
strres_get_lineno()609 int strres_get_lineno()
610 {
611 	return strres_lineno;
612 }
613 
614 extern char* strres_get_text(void);
strres_get_text()615 char* strres_get_text()
616 {
617 	return strres_text;
618 }
619 #elif defined(YY_FLEX_SUBMINOR_VERSION) && YY_FLEX_SUBMINOR_VERSION == 33
620 extern YY_EXTRA_TYPE strres_get_extra(void);
621 extern int strres_get_lineno(void);
622 extern FILE *strres_get_in(void);
623 extern FILE *strres_get_out(void);
624 extern int strres_get_leng(void);
625 extern char *strres_get_text(void);
626 extern void strres_set_lineno(int line_number);
627 extern void strres_set_in(FILE* in_str);
628 extern void strres_set_out(FILE* out_str);
629 extern int strres_get_debug(void);
630 extern void strres_set_debug(int bdebug);
631 #endif
632 
633 
634 
635 
636 #line 606 "strres_lexer.cpp"
637 
638 #define INITIAL 0
639 #define COMMENT 1
640 #define QUOTE 2
641 #define SLCOMMENT 3
642 
643 #ifndef YY_NO_UNISTD_H
644 /* Special case for "unistd.h", since it is non-ANSI. We include it way
645  * down here because we want the user's section 1 to have been scanned first.
646  * The user has a chance to override it with an option.
647  */
648 #include <unistd.h>
649 #endif
650 
651 #ifndef YY_EXTRA_TYPE
652 #define YY_EXTRA_TYPE void *
653 #endif
654 
655 static int yy_init_globals (void );
656 
657 /* Accessor methods to globals.
658    These are made visible to non-reentrant scanners for convenience. */
659 
660 int strres_lex_destroy (void );
661 
662 int strres_get_debug (void );
663 
664 void strres_set_debug (int debug_flag  );
665 
666 YY_EXTRA_TYPE strres_get_extra (void );
667 
668 void strres_set_extra (YY_EXTRA_TYPE user_defined  );
669 
670 FILE *strres_get_in (void );
671 
672 void strres_set_in  (FILE * in_str  );
673 
674 FILE *strres_get_out (void );
675 
676 void strres_set_out  (FILE * out_str  );
677 
678 int strres_get_leng (void );
679 
680 char *strres_get_text (void );
681 
682 int strres_get_lineno (void );
683 
684 void strres_set_lineno (int line_number  );
685 
686 /* Macros after this point can all be overridden by user definitions in
687  * section 1.
688  */
689 
690 #ifndef YY_SKIP_YYWRAP
691 #ifdef __cplusplus
692 extern "C" int strres_wrap (void );
693 #else
694 extern int strres_wrap (void );
695 #endif
696 #endif
697 
698 #ifndef yytext_ptr
699 static void yy_flex_strncpy (char *,yyconst char *,int );
700 #endif
701 
702 #ifdef YY_NEED_STRLEN
703 static int yy_flex_strlen (yyconst char * );
704 #endif
705 
706 #ifndef YY_NO_INPUT
707 
708 #ifdef __cplusplus
709 static int yyinput (void );
710 #else
711 static int input (void );
712 #endif
713 
714 #endif
715 
716 /* Amount of stuff to slurp up with each read. */
717 #ifndef YY_READ_BUF_SIZE
718 #ifdef __ia64__
719 /* On IA-64, the buffer size is 16k, not 8k */
720 #define YY_READ_BUF_SIZE 16384
721 #else
722 #define YY_READ_BUF_SIZE 8192
723 #endif /* __ia64__ */
724 #endif
725 
726 /* Copy whatever the last rule matched to the standard output. */
727 #ifndef ECHO
728 /* This used to be an fputs(), but since the string might contain NUL's,
729  * we now use fwrite().
730  */
731 #define ECHO do { if (fwrite( strres_text, strres_leng, 1, strres_out )) {} } while (0)
732 #endif
733 
734 /* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
735  * is returned in "result".
736  */
737 #ifndef YY_INPUT
738 #define YY_INPUT(buf,result,max_size) \
739 	if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
740 		{ \
741 		int c = '*'; \
742 		size_t n; \
743 		for ( n = 0; n < max_size && \
744 			     (c = getc( strres_in )) != EOF && c != '\n'; ++n ) \
745 			buf[n] = (char) c; \
746 		if ( c == '\n' ) \
747 			buf[n++] = (char) c; \
748 		if ( c == EOF && ferror( strres_in ) ) \
749 			YY_FATAL_ERROR( "input in flex scanner failed" ); \
750 		result = n; \
751 		} \
752 	else \
753 		{ \
754 		errno=0; \
755 		while ( (result = fread(buf, 1, max_size, strres_in))==0 && ferror(strres_in)) \
756 			{ \
757 			if( errno != EINTR) \
758 				{ \
759 				YY_FATAL_ERROR( "input in flex scanner failed" ); \
760 				break; \
761 				} \
762 			errno=0; \
763 			clearerr(strres_in); \
764 			} \
765 		}\
766 \
767 
768 #endif
769 
770 /* No semi-colon after return; correct usage is to write "yyterminate();" -
771  * we don't want an extra ';' after the "return" because that will cause
772  * some compilers to complain about unreachable statements.
773  */
774 #ifndef yyterminate
775 #define yyterminate() return YY_NULL
776 #endif
777 
778 /* Number of entries by which start-condition stack grows. */
779 #ifndef YY_START_STACK_INCR
780 #define YY_START_STACK_INCR 25
781 #endif
782 
783 /* Report a fatal error. */
784 #ifndef YY_FATAL_ERROR
785 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
786 #endif
787 
788 /* end tables serialization structures and prototypes */
789 
790 /* Default declaration of generated scanner - a define so the user can
791  * easily add parameters.
792  */
793 #ifndef YY_DECL
794 #define YY_DECL_IS_OURS 1
795 
796 extern int strres_lex (void);
797 
798 #define YY_DECL int strres_lex (void)
799 #endif /* !YY_DECL */
800 
801 /* Code executed at the beginning of each rule, after strres_text and strres_leng
802  * have been set up.
803  */
804 #ifndef YY_USER_ACTION
805 #define YY_USER_ACTION
806 #endif
807 
808 /* Code executed at the end of each rule. */
809 #ifndef YY_BREAK
810 #define YY_BREAK break;
811 #endif
812 
813 #define YY_RULE_SETUP \
814 	YY_USER_ACTION
815 
816 /** The main scanner function which does all the work.
817  */
818 YY_DECL
819 {
820 	yy_state_type yy_current_state;
821 	char *yy_cp, *yy_bp;
822 	int yy_act;
823 
824 #line 97 "strres_lexer.lpp"
825 
826 
827 	/* Match text values */
828 #line 798 "strres_lexer.cpp"
829 
830 	if ( !(yy_init) )
831 		{
832 		(yy_init) = 1;
833 
834 #ifdef YY_USER_INIT
835 		YY_USER_INIT;
836 #endif
837 
838 		if ( ! (yy_start) )
839 			(yy_start) = 1;	/* first start state */
840 
841 		if ( ! strres_in )
842 			strres_in = stdin;
843 
844 		if ( ! strres_out )
845 			strres_out = stdout;
846 
847 		if ( ! YY_CURRENT_BUFFER ) {
848 			strres_ensure_buffer_stack ();
849 			YY_CURRENT_BUFFER_LVALUE =
850 				strres__create_buffer(strres_in,YY_BUF_SIZE );
851 		}
852 
853 		strres__load_buffer_state( );
854 		}
855 
856 	while ( 1 )		/* loops until end-of-file is reached */
857 		{
858 		yy_cp = (yy_c_buf_p);
859 
860 		/* Support of strres_text. */
861 		*yy_cp = (yy_hold_char);
862 
863 		/* yy_bp points to the position in yy_ch_buf of the start of
864 		 * the current run.
865 		 */
866 		yy_bp = yy_cp;
867 
868 		yy_current_state = (yy_start);
869 yy_match:
870 		do
871 			{
872 			YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
873 			if ( yy_accept[yy_current_state] )
874 				{
875 				(yy_last_accepting_state) = yy_current_state;
876 				(yy_last_accepting_cpos) = yy_cp;
877 				}
878 			while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
879 				{
880 				yy_current_state = (int) yy_def[yy_current_state];
881 				if ( yy_current_state >= 32 )
882 					yy_c = yy_meta[(unsigned int) yy_c];
883 				}
884 			yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
885 			++yy_cp;
886 			}
887 		while ( yy_current_state != 31 );
888 		yy_cp = (yy_last_accepting_cpos);
889 		yy_current_state = (yy_last_accepting_state);
890 
891 yy_find_action:
892 		yy_act = yy_accept[yy_current_state];
893 
894 		YY_DO_BEFORE_ACTION;
895 
896 		if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] )
897 			{
898 			int yyl;
899 			for ( yyl = 0; yyl < strres_leng; ++yyl )
900 				if ( strres_text[yyl] == '\n' )
901 
902     strres_lineno++;
903 ;
904 			}
905 
906 do_action:	/* This label is used only to access EOF actions. */
907 
908 		switch ( yy_act )
909 	{ /* beginning of action switch */
910 			case 0: /* must back up */
911 			/* undo the effects of YY_DO_BEFORE_ACTION */
912 			*yy_cp = (yy_hold_char);
913 			yy_cp = (yy_last_accepting_cpos);
914 			yy_current_state = (yy_last_accepting_state);
915 			goto yy_find_action;
916 
917 case 1:
918 YY_RULE_SETUP
919 #line 100 "strres_lexer.lpp"
920 {
921 								strres_lval.sval = strdup(strres_text);
922 								return TEXT_T;
923 							}
924 	YY_BREAK
925 /* Match quoted text */
926 case 2:
927 YY_RULE_SETUP
928 #line 106 "strres_lexer.lpp"
929 { BEGIN QUOTE; }
930 	YY_BREAK
931 case 3:
932 YY_RULE_SETUP
933 #line 107 "strres_lexer.lpp"
934 { BEGIN 0; }
935 	YY_BREAK
936 case 4:
937 /* rule 4 can match eol */
938 YY_RULE_SETUP
939 #line 108 "strres_lexer.lpp"
940 { strres_error("Unexpected end of line in string"); }
941 	YY_BREAK
942 case 5:
943 YY_RULE_SETUP
944 #line 109 "strres_lexer.lpp"
945 {
946 								strres_lval.sval = strdup(strres_text);
947 								return QTEXT_T;
948 							}
949 	YY_BREAK
950 /* Skip white space */
951 case 6:
952 /* rule 6 can match eol */
953 YY_RULE_SETUP
954 #line 115 "strres_lexer.lpp"
955 ;
956 	YY_BREAK
957 /* Strip comments */
958 case 7:
959 YY_RULE_SETUP
960 #line 118 "strres_lexer.lpp"
961 { BEGIN COMMENT; }
962 	YY_BREAK
963 case 8:
964 #line 120 "strres_lexer.lpp"
965 case 9:
966 /* rule 9 can match eol */
967 YY_RULE_SETUP
968 #line 120 "strres_lexer.lpp"
969 { BEGIN 0; }
970 	YY_BREAK
971 case 10:
972 #line 122 "strres_lexer.lpp"
973 case 11:
974 /* rule 11 can match eol */
975 YY_RULE_SETUP
976 #line 122 "strres_lexer.lpp"
977 ;
978 	YY_BREAK
979 /* Strip single line comments */
980 case 12:
981 YY_RULE_SETUP
982 #line 125 "strres_lexer.lpp"
983 { BEGIN SLCOMMENT; }
984 	YY_BREAK
985 case 13:
986 /* rule 13 can match eol */
987 YY_RULE_SETUP
988 #line 126 "strres_lexer.lpp"
989 { BEGIN 0; }
990 	YY_BREAK
991 case 14:
992 YY_RULE_SETUP
993 #line 127 "strres_lexer.lpp"
994 ;
995 	YY_BREAK
996 /* Match anything that's been missed and pass it as a char */
997 case 15:
998 YY_RULE_SETUP
999 #line 130 "strres_lexer.lpp"
1000 return strres_text[0];
1001 	YY_BREAK
1002 case 16:
1003 YY_RULE_SETUP
1004 #line 132 "strres_lexer.lpp"
1005 ECHO;
1006 	YY_BREAK
1007 #line 977 "strres_lexer.cpp"
1008 case YY_STATE_EOF(INITIAL):
1009 case YY_STATE_EOF(COMMENT):
1010 case YY_STATE_EOF(QUOTE):
1011 case YY_STATE_EOF(SLCOMMENT):
1012 	yyterminate();
1013 
1014 	case YY_END_OF_BUFFER:
1015 		{
1016 		/* Amount of text matched not including the EOB char. */
1017 		int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
1018 
1019 		/* Undo the effects of YY_DO_BEFORE_ACTION. */
1020 		*yy_cp = (yy_hold_char);
1021 		YY_RESTORE_YY_MORE_OFFSET
1022 
1023 		if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1024 			{
1025 			/* We're scanning a new file or input source.  It's
1026 			 * possible that this happened because the user
1027 			 * just pointed strres_in at a new source and called
1028 			 * strres_lex().  If so, then we have to assure
1029 			 * consistency between YY_CURRENT_BUFFER and our
1030 			 * globals.  Here is the right place to do so, because
1031 			 * this is the first action (other than possibly a
1032 			 * back-up) that will match for the new input source.
1033 			 */
1034 			(yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1035 			YY_CURRENT_BUFFER_LVALUE->yy_input_file = strres_in;
1036 			YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1037 			}
1038 
1039 		/* Note that here we test for yy_c_buf_p "<=" to the position
1040 		 * of the first EOB in the buffer, since yy_c_buf_p will
1041 		 * already have been incremented past the NUL character
1042 		 * (since all states make transitions on EOB to the
1043 		 * end-of-buffer state).  Contrast this with the test
1044 		 * in input().
1045 		 */
1046 		if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1047 			{ /* This was really a NUL. */
1048 			yy_state_type yy_next_state;
1049 
1050 			(yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
1051 
1052 			yy_current_state = yy_get_previous_state(  );
1053 
1054 			/* Okay, we're now positioned to make the NUL
1055 			 * transition.  We couldn't have
1056 			 * yy_get_previous_state() go ahead and do it
1057 			 * for us because it doesn't know how to deal
1058 			 * with the possibility of jamming (and we don't
1059 			 * want to build jamming into it because then it
1060 			 * will run more slowly).
1061 			 */
1062 
1063 			yy_next_state = yy_try_NUL_trans( yy_current_state );
1064 
1065 			yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1066 
1067 			if ( yy_next_state )
1068 				{
1069 				/* Consume the NUL. */
1070 				yy_cp = ++(yy_c_buf_p);
1071 				yy_current_state = yy_next_state;
1072 				goto yy_match;
1073 				}
1074 
1075 			else
1076 				{
1077 				yy_cp = (yy_last_accepting_cpos);
1078 				yy_current_state = (yy_last_accepting_state);
1079 				goto yy_find_action;
1080 				}
1081 			}
1082 
1083 		else switch ( yy_get_next_buffer(  ) )
1084 			{
1085 			case EOB_ACT_END_OF_FILE:
1086 				{
1087 				(yy_did_buffer_switch_on_eof) = 0;
1088 
1089 				if ( strres_wrap( ) )
1090 					{
1091 					/* Note: because we've taken care in
1092 					 * yy_get_next_buffer() to have set up
1093 					 * strres_text, we can now set up
1094 					 * yy_c_buf_p so that if some total
1095 					 * hoser (like flex itself) wants to
1096 					 * call the scanner after we return the
1097 					 * YY_NULL, it'll still work - another
1098 					 * YY_NULL will get returned.
1099 					 */
1100 					(yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
1101 
1102 					yy_act = YY_STATE_EOF(YY_START);
1103 					goto do_action;
1104 					}
1105 
1106 				else
1107 					{
1108 					if ( ! (yy_did_buffer_switch_on_eof) )
1109 						YY_NEW_FILE;
1110 					}
1111 				break;
1112 				}
1113 
1114 			case EOB_ACT_CONTINUE_SCAN:
1115 				(yy_c_buf_p) =
1116 					(yytext_ptr) + yy_amount_of_matched_text;
1117 
1118 				yy_current_state = yy_get_previous_state(  );
1119 
1120 				yy_cp = (yy_c_buf_p);
1121 				yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1122 				goto yy_match;
1123 
1124 			case EOB_ACT_LAST_MATCH:
1125 				(yy_c_buf_p) =
1126 				&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
1127 
1128 				yy_current_state = yy_get_previous_state(  );
1129 
1130 				yy_cp = (yy_c_buf_p);
1131 				yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1132 				goto yy_find_action;
1133 			}
1134 		break;
1135 		}
1136 
1137 	default:
1138 		YY_FATAL_ERROR(
1139 			"fatal flex scanner internal error--no action found" );
1140 	} /* end of action switch */
1141 		} /* end of scanning one token */
1142 } /* end of strres_lex */
1143 
1144 /* yy_get_next_buffer - try to read in a new buffer
1145  *
1146  * Returns a code representing an action:
1147  *	EOB_ACT_LAST_MATCH -
1148  *	EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1149  *	EOB_ACT_END_OF_FILE - end of file
1150  */
1151 static int yy_get_next_buffer (void)
1152 {
1153 	char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1154 	char *source = (yytext_ptr);
1155 	int number_to_move, i;
1156 	int ret_val;
1157 
1158 	if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
1159 		YY_FATAL_ERROR(
1160 		"fatal flex scanner internal error--end of buffer missed" );
1161 
1162 	if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1163 		{ /* Don't try to fill the buffer, so this is an EOF. */
1164 		if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
1165 			{
1166 			/* We matched a single character, the EOB, so
1167 			 * treat this as a final EOF.
1168 			 */
1169 			return EOB_ACT_END_OF_FILE;
1170 			}
1171 
1172 		else
1173 			{
1174 			/* We matched some text prior to the EOB, first
1175 			 * process it.
1176 			 */
1177 			return EOB_ACT_LAST_MATCH;
1178 			}
1179 		}
1180 
1181 	/* Try to read more data. */
1182 
1183 	/* First move last chars to start of buffer. */
1184 	number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
1185 
1186 	for ( i = 0; i < number_to_move; ++i )
1187 		*(dest++) = *(source++);
1188 
1189 	if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1190 		/* don't do the read, it's not guaranteed to return an EOF,
1191 		 * just force an EOF
1192 		 */
1193 		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1194 
1195 	else
1196 		{
1197 			int num_to_read =
1198 			YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1199 
1200 		while ( num_to_read <= 0 )
1201 			{ /* Not enough room in the buffer - grow it. */
1202 
1203 			/* just a shorter name for the current buffer */
1204 			YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
1205 
1206 			int yy_c_buf_p_offset =
1207 				(int) ((yy_c_buf_p) - b->yy_ch_buf);
1208 
1209 			if ( b->yy_is_our_buffer )
1210 				{
1211 				int new_size = b->yy_buf_size * 2;
1212 
1213 				if ( new_size <= 0 )
1214 					b->yy_buf_size += b->yy_buf_size / 8;
1215 				else
1216 					b->yy_buf_size *= 2;
1217 
1218 				b->yy_ch_buf = (char *)
1219 					/* Include room in for 2 EOB chars. */
1220 					strres_realloc((void *) b->yy_ch_buf,b->yy_buf_size + 2  );
1221 				}
1222 			else
1223 				/* Can't grow it, we don't own it. */
1224 				b->yy_ch_buf = 0;
1225 
1226 			if ( ! b->yy_ch_buf )
1227 				YY_FATAL_ERROR(
1228 				"fatal error - scanner input buffer overflow" );
1229 
1230 			(yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1231 
1232 			num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1233 						number_to_move - 1;
1234 
1235 			}
1236 
1237 		if ( num_to_read > YY_READ_BUF_SIZE )
1238 			num_to_read = YY_READ_BUF_SIZE;
1239 
1240 		/* Read in more data. */
1241 		YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1242 			(yy_n_chars), (size_t) num_to_read );
1243 
1244 		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1245 		}
1246 
1247 	if ( (yy_n_chars) == 0 )
1248 		{
1249 		if ( number_to_move == YY_MORE_ADJ )
1250 			{
1251 			ret_val = EOB_ACT_END_OF_FILE;
1252 			strres_restart(strres_in  );
1253 			}
1254 
1255 		else
1256 			{
1257 			ret_val = EOB_ACT_LAST_MATCH;
1258 			YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1259 				YY_BUFFER_EOF_PENDING;
1260 			}
1261 		}
1262 
1263 	else
1264 		ret_val = EOB_ACT_CONTINUE_SCAN;
1265 
1266 	if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1267 		/* Extend the array by 50%, plus the number we really need. */
1268 		yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
1269 		YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) strres_realloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size  );
1270 		if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1271 			YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1272 	}
1273 
1274 	(yy_n_chars) += number_to_move;
1275 	YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1276 	YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
1277 
1278 	(yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1279 
1280 	return ret_val;
1281 }
1282 
1283 /* yy_get_previous_state - get the state just before the EOB char was reached */
1284 
yy_get_previous_state(void)1285     static yy_state_type yy_get_previous_state (void)
1286 {
1287 	yy_state_type yy_current_state;
1288 	char *yy_cp;
1289 
1290 	yy_current_state = (yy_start);
1291 
1292 	for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1293 		{
1294 		YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1295 		if ( yy_accept[yy_current_state] )
1296 			{
1297 			(yy_last_accepting_state) = yy_current_state;
1298 			(yy_last_accepting_cpos) = yy_cp;
1299 			}
1300 		while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1301 			{
1302 			yy_current_state = (int) yy_def[yy_current_state];
1303 			if ( yy_current_state >= 32 )
1304 				yy_c = yy_meta[(unsigned int) yy_c];
1305 			}
1306 		yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1307 		}
1308 
1309 	return yy_current_state;
1310 }
1311 
1312 /* yy_try_NUL_trans - try to make a transition on the NUL character
1313  *
1314  * synopsis
1315  *	next_state = yy_try_NUL_trans( current_state );
1316  */
yy_try_NUL_trans(yy_state_type yy_current_state)1317     static yy_state_type yy_try_NUL_trans  (yy_state_type yy_current_state )
1318 {
1319 	int yy_is_jam;
1320 	char *yy_cp = (yy_c_buf_p);
1321 
1322 	YY_CHAR yy_c = 1;
1323 	if ( yy_accept[yy_current_state] )
1324 		{
1325 		(yy_last_accepting_state) = yy_current_state;
1326 		(yy_last_accepting_cpos) = yy_cp;
1327 		}
1328 	while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1329 		{
1330 		yy_current_state = (int) yy_def[yy_current_state];
1331 		if ( yy_current_state >= 32 )
1332 			yy_c = yy_meta[(unsigned int) yy_c];
1333 		}
1334 	yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1335 	yy_is_jam = (yy_current_state == 31);
1336 
1337 	return yy_is_jam ? 0 : yy_current_state;
1338 }
1339 
1340 #ifndef YY_NO_INPUT
1341 #ifdef __cplusplus
yyinput(void)1342     static int yyinput (void)
1343 #else
1344     static int input  (void)
1345 #endif
1346 
1347 {
1348 	int c;
1349 
1350 	*(yy_c_buf_p) = (yy_hold_char);
1351 
1352 	if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
1353 		{
1354 		/* yy_c_buf_p now points to the character we want to return.
1355 		 * If this occurs *before* the EOB characters, then it's a
1356 		 * valid NUL; if not, then we've hit the end of the buffer.
1357 		 */
1358 		if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1359 			/* This was really a NUL. */
1360 			*(yy_c_buf_p) = '\0';
1361 
1362 		else
1363 			{ /* need more input */
1364 			int offset = (yy_c_buf_p) - (yytext_ptr);
1365 			++(yy_c_buf_p);
1366 
1367 			switch ( yy_get_next_buffer(  ) )
1368 				{
1369 				case EOB_ACT_LAST_MATCH:
1370 					/* This happens because yy_g_n_b()
1371 					 * sees that we've accumulated a
1372 					 * token and flags that we need to
1373 					 * try matching the token before
1374 					 * proceeding.  But for input(),
1375 					 * there's no matching to consider.
1376 					 * So convert the EOB_ACT_LAST_MATCH
1377 					 * to EOB_ACT_END_OF_FILE.
1378 					 */
1379 
1380 					/* Reset buffer status. */
1381 					strres_restart(strres_in );
1382 
1383 					/*FALLTHROUGH*/
1384 
1385 				case EOB_ACT_END_OF_FILE:
1386 					{
1387 					if ( strres_wrap( ) )
1388 						return EOF;
1389 
1390 					if ( ! (yy_did_buffer_switch_on_eof) )
1391 						YY_NEW_FILE;
1392 #ifdef __cplusplus
1393 					return yyinput();
1394 #else
1395 					return input();
1396 #endif
1397 					}
1398 
1399 				case EOB_ACT_CONTINUE_SCAN:
1400 					(yy_c_buf_p) = (yytext_ptr) + offset;
1401 					break;
1402 				}
1403 			}
1404 		}
1405 
1406 	c = *(unsigned char *) (yy_c_buf_p);	/* cast for 8-bit char's */
1407 	*(yy_c_buf_p) = '\0';	/* preserve strres_text */
1408 	(yy_hold_char) = *++(yy_c_buf_p);
1409 
1410 	if ( c == '\n' )
1411 
1412     strres_lineno++;
1413 ;
1414 
1415 	return c;
1416 }
1417 #endif	/* ifndef YY_NO_INPUT */
1418 
1419 /** Immediately switch to a different input stream.
1420  * @param input_file A readable stream.
1421  *
1422  * @note This function does not reset the start condition to @c INITIAL .
1423  */
strres_restart(FILE * input_file)1424     void strres_restart  (FILE * input_file )
1425 {
1426 
1427 	if ( ! YY_CURRENT_BUFFER ){
1428         strres_ensure_buffer_stack ();
1429 		YY_CURRENT_BUFFER_LVALUE =
1430             strres__create_buffer(strres_in,YY_BUF_SIZE );
1431 	}
1432 
1433 	strres__init_buffer(YY_CURRENT_BUFFER,input_file );
1434 	strres__load_buffer_state( );
1435 }
1436 
1437 /** Switch to a different input buffer.
1438  * @param new_buffer The new input buffer.
1439  *
1440  */
strres__switch_to_buffer(YY_BUFFER_STATE new_buffer)1441     void strres__switch_to_buffer  (YY_BUFFER_STATE  new_buffer )
1442 {
1443 
1444 	/* TODO. We should be able to replace this entire function body
1445 	 * with
1446 	 *		strres_pop_buffer_state();
1447 	 *		strres_push_buffer_state(new_buffer);
1448      */
1449 	strres_ensure_buffer_stack ();
1450 	if ( YY_CURRENT_BUFFER == new_buffer )
1451 		return;
1452 
1453 	if ( YY_CURRENT_BUFFER )
1454 		{
1455 		/* Flush out information for old buffer. */
1456 		*(yy_c_buf_p) = (yy_hold_char);
1457 		YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1458 		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1459 		}
1460 
1461 	YY_CURRENT_BUFFER_LVALUE = new_buffer;
1462 	strres__load_buffer_state( );
1463 
1464 	/* We don't actually know whether we did this switch during
1465 	 * EOF (strres_wrap()) processing, but the only time this flag
1466 	 * is looked at is after strres_wrap() is called, so it's safe
1467 	 * to go ahead and always set it.
1468 	 */
1469 	(yy_did_buffer_switch_on_eof) = 1;
1470 }
1471 
strres__load_buffer_state(void)1472 static void strres__load_buffer_state  (void)
1473 {
1474     	(yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1475 	(yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1476 	strres_in = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1477 	(yy_hold_char) = *(yy_c_buf_p);
1478 }
1479 
1480 /** Allocate and initialize an input buffer state.
1481  * @param file A readable stream.
1482  * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1483  *
1484  * @return the allocated buffer state.
1485  */
strres__create_buffer(FILE * file,int size)1486     YY_BUFFER_STATE strres__create_buffer  (FILE * file, int  size )
1487 {
1488 	YY_BUFFER_STATE b;
1489 
1490 	b = (YY_BUFFER_STATE) strres_alloc(sizeof( struct yy_buffer_state )  );
1491 	if ( ! b )
1492 		YY_FATAL_ERROR( "out of dynamic memory in strres__create_buffer()" );
1493 
1494 	b->yy_buf_size = size;
1495 
1496 	/* yy_ch_buf has to be 2 characters longer than the size given because
1497 	 * we need to put in 2 end-of-buffer characters.
1498 	 */
1499 	b->yy_ch_buf = (char *) strres_alloc(b->yy_buf_size + 2  );
1500 	if ( ! b->yy_ch_buf )
1501 		YY_FATAL_ERROR( "out of dynamic memory in strres__create_buffer()" );
1502 
1503 	b->yy_is_our_buffer = 1;
1504 
1505 	strres__init_buffer(b,file );
1506 
1507 	return b;
1508 }
1509 
1510 /** Destroy the buffer.
1511  * @param b a buffer created with strres__create_buffer()
1512  *
1513  */
strres__delete_buffer(YY_BUFFER_STATE b)1514     void strres__delete_buffer (YY_BUFFER_STATE  b )
1515 {
1516 
1517 	if ( ! b )
1518 		return;
1519 
1520 	if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1521 		YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
1522 
1523 	if ( b->yy_is_our_buffer )
1524 		strres_free((void *) b->yy_ch_buf  );
1525 
1526 	strres_free((void *) b  );
1527 }
1528 
1529 /* Initializes or reinitializes a buffer.
1530  * This function is sometimes called more than once on the same buffer,
1531  * such as during a strres_restart() or at EOF.
1532  */
strres__init_buffer(YY_BUFFER_STATE b,FILE * file)1533     static void strres__init_buffer  (YY_BUFFER_STATE  b, FILE * file )
1534 
1535 {
1536 	int oerrno = errno;
1537 
1538 	strres__flush_buffer(b );
1539 
1540 	b->yy_input_file = file;
1541 	b->yy_fill_buffer = 1;
1542 
1543     /* If b is the current buffer, then strres__init_buffer was _probably_
1544      * called from strres_restart() or through yy_get_next_buffer.
1545      * In that case, we don't want to reset the lineno or column.
1546      */
1547     if (b != YY_CURRENT_BUFFER){
1548         b->yy_bs_lineno = 1;
1549         b->yy_bs_column = 0;
1550     }
1551 
1552         b->yy_is_interactive = 0;
1553 
1554 	errno = oerrno;
1555 }
1556 
1557 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
1558  * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
1559  *
1560  */
strres__flush_buffer(YY_BUFFER_STATE b)1561     void strres__flush_buffer (YY_BUFFER_STATE  b )
1562 {
1563     	if ( ! b )
1564 		return;
1565 
1566 	b->yy_n_chars = 0;
1567 
1568 	/* We always need two end-of-buffer characters.  The first causes
1569 	 * a transition to the end-of-buffer state.  The second causes
1570 	 * a jam in that state.
1571 	 */
1572 	b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1573 	b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1574 
1575 	b->yy_buf_pos = &b->yy_ch_buf[0];
1576 
1577 	b->yy_at_bol = 1;
1578 	b->yy_buffer_status = YY_BUFFER_NEW;
1579 
1580 	if ( b == YY_CURRENT_BUFFER )
1581 		strres__load_buffer_state( );
1582 }
1583 
1584 /** Pushes the new state onto the stack. The new state becomes
1585  *  the current state. This function will allocate the stack
1586  *  if necessary.
1587  *  @param new_buffer The new state.
1588  *
1589  */
strres_push_buffer_state(YY_BUFFER_STATE new_buffer)1590 void strres_push_buffer_state (YY_BUFFER_STATE new_buffer )
1591 {
1592     	if (new_buffer == NULL)
1593 		return;
1594 
1595 	strres_ensure_buffer_stack();
1596 
1597 	/* This block is copied from strres__switch_to_buffer. */
1598 	if ( YY_CURRENT_BUFFER )
1599 		{
1600 		/* Flush out information for old buffer. */
1601 		*(yy_c_buf_p) = (yy_hold_char);
1602 		YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1603 		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1604 		}
1605 
1606 	/* Only push if top exists. Otherwise, replace top. */
1607 	if (YY_CURRENT_BUFFER)
1608 		(yy_buffer_stack_top)++;
1609 	YY_CURRENT_BUFFER_LVALUE = new_buffer;
1610 
1611 	/* copied from strres__switch_to_buffer. */
1612 	strres__load_buffer_state( );
1613 	(yy_did_buffer_switch_on_eof) = 1;
1614 }
1615 
1616 /** Removes and deletes the top of the stack, if present.
1617  *  The next element becomes the new top.
1618  *
1619  */
strres_pop_buffer_state(void)1620 void strres_pop_buffer_state (void)
1621 {
1622     	if (!YY_CURRENT_BUFFER)
1623 		return;
1624 
1625 	strres__delete_buffer(YY_CURRENT_BUFFER );
1626 	YY_CURRENT_BUFFER_LVALUE = NULL;
1627 	if ((yy_buffer_stack_top) > 0)
1628 		--(yy_buffer_stack_top);
1629 
1630 	if (YY_CURRENT_BUFFER) {
1631 		strres__load_buffer_state( );
1632 		(yy_did_buffer_switch_on_eof) = 1;
1633 	}
1634 }
1635 
1636 /* Allocates the stack if it does not exist.
1637  *  Guarantees space for at least one push.
1638  */
strres_ensure_buffer_stack(void)1639 static void strres_ensure_buffer_stack (void)
1640 {
1641 	int num_to_alloc;
1642 
1643 	if (!(yy_buffer_stack)) {
1644 
1645 		/* First allocation is just for 2 elements, since we don't know if this
1646 		 * scanner will even need a stack. We use 2 instead of 1 to avoid an
1647 		 * immediate realloc on the next call.
1648          */
1649 		num_to_alloc = 1;
1650 		(yy_buffer_stack) = (struct yy_buffer_state**)strres_alloc
1651 								(num_to_alloc * sizeof(struct yy_buffer_state*)
1652 								);
1653 		if ( ! (yy_buffer_stack) )
1654 			YY_FATAL_ERROR( "out of dynamic memory in strres_ensure_buffer_stack()" );
1655 
1656 		memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1657 
1658 		(yy_buffer_stack_max) = num_to_alloc;
1659 		(yy_buffer_stack_top) = 0;
1660 		return;
1661 	}
1662 
1663 	if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
1664 
1665 		/* Increase the buffer to prepare for a possible push. */
1666 		int grow_size = 8 /* arbitrary grow size */;
1667 
1668 		num_to_alloc = (yy_buffer_stack_max) + grow_size;
1669 		(yy_buffer_stack) = (struct yy_buffer_state**)strres_realloc
1670 								((yy_buffer_stack),
1671 								num_to_alloc * sizeof(struct yy_buffer_state*)
1672 								);
1673 		if ( ! (yy_buffer_stack) )
1674 			YY_FATAL_ERROR( "out of dynamic memory in strres_ensure_buffer_stack()" );
1675 
1676 		/* zero only the new slots.*/
1677 		memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
1678 		(yy_buffer_stack_max) = num_to_alloc;
1679 	}
1680 }
1681 
1682 /** Setup the input buffer state to scan directly from a user-specified character buffer.
1683  * @param base the character buffer
1684  * @param size the size in bytes of the character buffer
1685  *
1686  * @return the newly allocated buffer state object.
1687  */
strres__scan_buffer(char * base,yy_size_t size)1688 YY_BUFFER_STATE strres__scan_buffer  (char * base, yy_size_t  size )
1689 {
1690 	YY_BUFFER_STATE b;
1691 
1692 	if ( size < 2 ||
1693 	     base[size-2] != YY_END_OF_BUFFER_CHAR ||
1694 	     base[size-1] != YY_END_OF_BUFFER_CHAR )
1695 		/* They forgot to leave room for the EOB's. */
1696 		return 0;
1697 
1698 	b = (YY_BUFFER_STATE) strres_alloc(sizeof( struct yy_buffer_state )  );
1699 	if ( ! b )
1700 		YY_FATAL_ERROR( "out of dynamic memory in strres__scan_buffer()" );
1701 
1702 	b->yy_buf_size = size - 2;	/* "- 2" to take care of EOB's */
1703 	b->yy_buf_pos = b->yy_ch_buf = base;
1704 	b->yy_is_our_buffer = 0;
1705 	b->yy_input_file = 0;
1706 	b->yy_n_chars = b->yy_buf_size;
1707 	b->yy_is_interactive = 0;
1708 	b->yy_at_bol = 1;
1709 	b->yy_fill_buffer = 0;
1710 	b->yy_buffer_status = YY_BUFFER_NEW;
1711 
1712 	strres__switch_to_buffer(b  );
1713 
1714 	return b;
1715 }
1716 
1717 /** Setup the input buffer state to scan a string. The next call to strres_lex() will
1718  * scan from a @e copy of @a str.
1719  * @param yystr a NUL-terminated string to scan
1720  *
1721  * @return the newly allocated buffer state object.
1722  * @note If you want to scan bytes that may contain NUL values, then use
1723  *       strres__scan_bytes() instead.
1724  */
strres__scan_string(yyconst char * yystr)1725 YY_BUFFER_STATE strres__scan_string (yyconst char * yystr )
1726 {
1727 
1728 	return strres__scan_bytes(yystr,strlen(yystr) );
1729 }
1730 
1731 /** Setup the input buffer state to scan the given bytes. The next call to strres_lex() will
1732  * scan from a @e copy of @a bytes.
1733  * @param yybytes the byte buffer to scan
1734  * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
1735  *
1736  * @return the newly allocated buffer state object.
1737  */
strres__scan_bytes(yyconst char * yybytes,int _yybytes_len)1738 YY_BUFFER_STATE strres__scan_bytes  (yyconst char * yybytes, int  _yybytes_len )
1739 {
1740 	YY_BUFFER_STATE b;
1741 	char *buf;
1742 	yy_size_t n;
1743 	int i;
1744 
1745 	/* Get memory for full buffer, including space for trailing EOB's. */
1746 	n = _yybytes_len + 2;
1747 	buf = (char *) strres_alloc(n  );
1748 	if ( ! buf )
1749 		YY_FATAL_ERROR( "out of dynamic memory in strres__scan_bytes()" );
1750 
1751 	for ( i = 0; i < _yybytes_len; ++i )
1752 		buf[i] = yybytes[i];
1753 
1754 	buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
1755 
1756 	b = strres__scan_buffer(buf,n );
1757 	if ( ! b )
1758 		YY_FATAL_ERROR( "bad buffer in strres__scan_bytes()" );
1759 
1760 	/* It's okay to grow etc. this buffer, and we should throw it
1761 	 * away when we're done.
1762 	 */
1763 	b->yy_is_our_buffer = 1;
1764 
1765 	return b;
1766 }
1767 
1768 #ifndef YY_EXIT_FAILURE
1769 #define YY_EXIT_FAILURE 2
1770 #endif
1771 
yy_fatal_error(yyconst char * msg)1772 [[ noreturn ]] static void yy_fatal_error (yyconst char* msg )
1773 {
1774     	(void) fprintf( stderr, "%s\n", msg );
1775 	exit( YY_EXIT_FAILURE );
1776 }
1777 
1778 /* Redefine yyless() so it works in section 3 code. */
1779 
1780 #undef yyless
1781 #define yyless(n) \
1782 	do \
1783 		{ \
1784 		/* Undo effects of setting up strres_text. */ \
1785         int yyless_macro_arg = (n); \
1786         YY_LESS_LINENO(yyless_macro_arg);\
1787 		strres_text[strres_leng] = (yy_hold_char); \
1788 		(yy_c_buf_p) = strres_text + yyless_macro_arg; \
1789 		(yy_hold_char) = *(yy_c_buf_p); \
1790 		*(yy_c_buf_p) = '\0'; \
1791 		strres_leng = yyless_macro_arg; \
1792 		} \
1793 	while ( 0 )
1794 
1795 /* Accessor  methods (get/set functions) to struct members. */
1796 
1797 /** Get the current line number.
1798  *
1799  */
strres_get_lineno(void)1800 int strres_get_lineno  (void)
1801 {
1802 
1803     return strres_lineno;
1804 }
1805 
1806 /** Get the input stream.
1807  *
1808  */
strres_get_in(void)1809 FILE *strres_get_in  (void)
1810 {
1811         return strres_in;
1812 }
1813 
1814 /** Get the output stream.
1815  *
1816  */
strres_get_out(void)1817 FILE *strres_get_out  (void)
1818 {
1819         return strres_out;
1820 }
1821 
1822 /** Get the length of the current token.
1823  *
1824  */
strres_get_leng(void)1825 int strres_get_leng  (void)
1826 {
1827         return strres_leng;
1828 }
1829 
1830 /** Get the current token.
1831  *
1832  */
1833 
strres_get_text(void)1834 char *strres_get_text  (void)
1835 {
1836         return strres_text;
1837 }
1838 
1839 /** Set the current line number.
1840  * @param line_number
1841  *
1842  */
strres_set_lineno(int line_number)1843 void strres_set_lineno (int  line_number )
1844 {
1845 
1846     strres_lineno = line_number;
1847 }
1848 
1849 /** Set the input stream. This does not discard the current
1850  * input buffer.
1851  * @param in_str A readable stream.
1852  *
1853  * @see strres__switch_to_buffer
1854  */
strres_set_in(FILE * in_str)1855 void strres_set_in (FILE *  in_str )
1856 {
1857         strres_in = in_str ;
1858 }
1859 
strres_set_out(FILE * out_str)1860 void strres_set_out (FILE *  out_str )
1861 {
1862         strres_out = out_str ;
1863 }
1864 
strres_get_debug(void)1865 int strres_get_debug  (void)
1866 {
1867         return strres__flex_debug;
1868 }
1869 
strres_set_debug(int bdebug)1870 void strres_set_debug (int  bdebug )
1871 {
1872         strres__flex_debug = bdebug ;
1873 }
1874 
yy_init_globals(void)1875 static int yy_init_globals (void)
1876 {
1877         /* Initialization is the same as for the non-reentrant scanner.
1878      * This function is called from strres_lex_destroy(), so don't allocate here.
1879      */
1880 
1881     /* We do not touch strres_lineno unless the option is enabled. */
1882     strres_lineno =  1;
1883 
1884     (yy_buffer_stack) = 0;
1885     (yy_buffer_stack_top) = 0;
1886     (yy_buffer_stack_max) = 0;
1887     (yy_c_buf_p) = (char *) 0;
1888     (yy_init) = 0;
1889     (yy_start) = 0;
1890 
1891 /* Defined in main.c */
1892 #ifdef YY_STDINIT
1893     strres_in = stdin;
1894     strres_out = stdout;
1895 #else
1896     strres_in = (FILE *) 0;
1897     strres_out = (FILE *) 0;
1898 #endif
1899 
1900     /* For future reference: Set errno on error, since we are called by
1901      * strres_lex_init()
1902      */
1903     return 0;
1904 }
1905 
1906 /* strres_lex_destroy is for both reentrant and non-reentrant scanners. */
strres_lex_destroy(void)1907 int strres_lex_destroy  (void)
1908 {
1909 
1910     /* Pop the buffer stack, destroying each element. */
1911 	while(YY_CURRENT_BUFFER){
1912 		strres__delete_buffer(YY_CURRENT_BUFFER  );
1913 		YY_CURRENT_BUFFER_LVALUE = NULL;
1914 		strres_pop_buffer_state();
1915 	}
1916 
1917 	/* Destroy the stack itself. */
1918 	strres_free((yy_buffer_stack) );
1919 	(yy_buffer_stack) = NULL;
1920 
1921     /* Reset the globals. This is important in a non-reentrant scanner so the next time
1922      * strres_lex() is called, initialization will occur. */
1923     yy_init_globals( );
1924 
1925     return 0;
1926 }
1927 
1928 /*
1929  * Internal utility routines.
1930  */
1931 
1932 #ifndef yytext_ptr
yy_flex_strncpy(char * s1,yyconst char * s2,int n)1933 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
1934 {
1935 	int i;
1936 	for ( i = 0; i < n; ++i )
1937 		s1[i] = s2[i];
1938 }
1939 #endif
1940 
1941 #ifdef YY_NEED_STRLEN
yy_flex_strlen(yyconst char * s)1942 static int yy_flex_strlen (yyconst char * s )
1943 {
1944 	int n;
1945 	for ( n = 0; s[n]; ++n )
1946 		;
1947 
1948 	return n;
1949 }
1950 #endif
1951 
strres_alloc(yy_size_t size)1952 void *strres_alloc (yy_size_t  size )
1953 {
1954 	return (void *) malloc( size );
1955 }
1956 
strres_realloc(void * ptr,yy_size_t size)1957 void *strres_realloc  (void * ptr, yy_size_t  size )
1958 {
1959 	/* The cast to (char *) in the following accommodates both
1960 	 * implementations that use char* generic pointers, and those
1961 	 * that use void* generic pointers.  It works with the latter
1962 	 * because both ANSI C and C++ allow castless assignment from
1963 	 * any pointer type to void*, and deal with argument conversions
1964 	 * as though doing an assignment.
1965 	 */
1966 	return (void *) realloc( (char *) ptr, size );
1967 }
1968 
strres_free(void * ptr)1969 void strres_free (void * ptr )
1970 {
1971 	free( (char *) ptr );	/* see strres_realloc() for (char *) cast */
1972 }
1973 
1974 #define YYTABLES_NAME "yytables"
1975 
1976 #line 132 "strres_lexer.lpp"
1977 
1978 
1979 
1980 static YY_EXTRA_TYPE pBuffer = NULL;
1981 
strres_set_extra(YY_EXTRA_TYPE user_defined)1982 void strres_set_extra(YY_EXTRA_TYPE user_defined)
1983 {
1984 	pBuffer = user_defined;
1985 }
1986 
strres_get_extra()1987 YY_EXTRA_TYPE strres_get_extra()
1988 {
1989 	return pBuffer;
1990 }
1991 
1992 /* Older GNU Flex versions don't define strres_lex_destroy()
1993  * (and neither define a subminor version)
1994  */
1995 #if !defined(YY_FLEX_SUBMINOR_VERSION) || (YY_FLEX_SUBMINOR_VERSION < 9)
strres_lex_destroy(void)1996 int strres_lex_destroy(void)
1997 {
1998 	/* For non-reentrant C scanner only. */
1999 	strres__delete_buffer(YY_CURRENT_BUFFER);
2000 	yy_init = 1;
2001 	return 0;
2002 }
2003 #endif
2004 
2005