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