Debian Codegraph @

src/tools/dlgedit/lex.loadlg.cc

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