Bug Summary

File:lex.c
Location:line 1571, column 27
Description:Array access (from variable 'yy_buffer_stack') results in a null pointer dereference

Annotated Source Code

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