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