Bug Summary

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

Annotated Source Code

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