1 | /* A lexical scanner generated by flex */ |
---|
2 | |
---|
3 | /* Scanner skeleton version: |
---|
4 | * $Header: /afs/dev.mit.edu/source/repository/third/bonobo-activation/server/activation-context-query-lexer.c,v 1.1.1.1 2003-01-04 19:42:03 ghudson Exp $ |
---|
5 | */ |
---|
6 | |
---|
7 | #define FLEX_SCANNER |
---|
8 | #define YY_FLEX_MAJOR_VERSION 2 |
---|
9 | #define YY_FLEX_MINOR_VERSION 5 |
---|
10 | |
---|
11 | #include <stdio.h> |
---|
12 | #include <unistd.h> |
---|
13 | |
---|
14 | |
---|
15 | /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ |
---|
16 | #ifdef c_plusplus |
---|
17 | #ifndef __cplusplus |
---|
18 | #define __cplusplus |
---|
19 | #endif |
---|
20 | #endif |
---|
21 | |
---|
22 | |
---|
23 | #ifdef __cplusplus |
---|
24 | |
---|
25 | #include <stdlib.h> |
---|
26 | |
---|
27 | /* Use prototypes in function declarations. */ |
---|
28 | #define YY_USE_PROTOS |
---|
29 | |
---|
30 | /* The "const" storage-class-modifier is valid. */ |
---|
31 | #define YY_USE_CONST |
---|
32 | |
---|
33 | #else /* ! __cplusplus */ |
---|
34 | |
---|
35 | #if __STDC__ |
---|
36 | |
---|
37 | #define YY_USE_PROTOS |
---|
38 | #define YY_USE_CONST |
---|
39 | |
---|
40 | #endif /* __STDC__ */ |
---|
41 | #endif /* ! __cplusplus */ |
---|
42 | |
---|
43 | #ifdef __TURBOC__ |
---|
44 | #pragma warn -rch |
---|
45 | #pragma warn -use |
---|
46 | #include <io.h> |
---|
47 | #include <stdlib.h> |
---|
48 | #define YY_USE_CONST |
---|
49 | #define YY_USE_PROTOS |
---|
50 | #endif |
---|
51 | |
---|
52 | #ifdef YY_USE_CONST |
---|
53 | #define yyconst const |
---|
54 | #else |
---|
55 | #define yyconst |
---|
56 | #endif |
---|
57 | |
---|
58 | |
---|
59 | #ifdef YY_USE_PROTOS |
---|
60 | #define YY_PROTO(proto) proto |
---|
61 | #else |
---|
62 | #define YY_PROTO(proto) () |
---|
63 | #endif |
---|
64 | |
---|
65 | /* Returned upon end-of-file. */ |
---|
66 | #define YY_NULL 0 |
---|
67 | |
---|
68 | /* Promotes a possibly negative, possibly signed char to an unsigned |
---|
69 | * integer for use as an array index. If the signed char is negative, |
---|
70 | * we want to instead treat it as an 8-bit unsigned char, hence the |
---|
71 | * double cast. |
---|
72 | */ |
---|
73 | #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) |
---|
74 | |
---|
75 | /* Enter a start condition. This macro really ought to take a parameter, |
---|
76 | * but we do it the disgusting crufty way forced on us by the ()-less |
---|
77 | * definition of BEGIN. |
---|
78 | */ |
---|
79 | #define BEGIN yy_start = 1 + 2 * |
---|
80 | |
---|
81 | /* Translate the current start state into a value that can be later handed |
---|
82 | * to BEGIN to return to the state. The YYSTATE alias is for lex |
---|
83 | * compatibility. |
---|
84 | */ |
---|
85 | #define YY_START ((yy_start - 1) / 2) |
---|
86 | #define YYSTATE YY_START |
---|
87 | |
---|
88 | /* Action number for EOF rule of a given start state. */ |
---|
89 | #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) |
---|
90 | |
---|
91 | /* Special action meaning "start processing a new file". */ |
---|
92 | #define YY_NEW_FILE yyrestart( yyin ) |
---|
93 | |
---|
94 | #define YY_END_OF_BUFFER_CHAR 0 |
---|
95 | |
---|
96 | /* Size of default input buffer. */ |
---|
97 | #define YY_BUF_SIZE 16384 |
---|
98 | |
---|
99 | typedef struct yy_buffer_state *YY_BUFFER_STATE; |
---|
100 | |
---|
101 | extern int yyleng; |
---|
102 | extern FILE *yyin, *yyout; |
---|
103 | |
---|
104 | #define EOB_ACT_CONTINUE_SCAN 0 |
---|
105 | #define EOB_ACT_END_OF_FILE 1 |
---|
106 | #define EOB_ACT_LAST_MATCH 2 |
---|
107 | |
---|
108 | /* The funky do-while in the following #define is used to turn the definition |
---|
109 | * int a single C statement (which needs a semi-colon terminator). This |
---|
110 | * avoids problems with code like: |
---|
111 | * |
---|
112 | * if ( condition_holds ) |
---|
113 | * yyless( 5 ); |
---|
114 | * else |
---|
115 | * do_something_else(); |
---|
116 | * |
---|
117 | * Prior to using the do-while the compiler would get upset at the |
---|
118 | * "else" because it interpreted the "if" statement as being all |
---|
119 | * done when it reached the ';' after the yyless() call. |
---|
120 | */ |
---|
121 | |
---|
122 | /* Return all but the first 'n' matched characters back to the input stream. */ |
---|
123 | |
---|
124 | #define yyless(n) \ |
---|
125 | do \ |
---|
126 | { \ |
---|
127 | /* Undo effects of setting up yytext. */ \ |
---|
128 | *yy_cp = yy_hold_char; \ |
---|
129 | YY_RESTORE_YY_MORE_OFFSET \ |
---|
130 | yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ |
---|
131 | YY_DO_BEFORE_ACTION; /* set up yytext again */ \ |
---|
132 | } \ |
---|
133 | while ( 0 ) |
---|
134 | |
---|
135 | #define unput(c) yyunput( c, yytext_ptr ) |
---|
136 | |
---|
137 | /* The following is because we cannot portably get our hands on size_t |
---|
138 | * (without autoconf's help, which isn't available because we want |
---|
139 | * flex-generated scanners to compile on their own). |
---|
140 | */ |
---|
141 | typedef unsigned int yy_size_t; |
---|
142 | |
---|
143 | |
---|
144 | struct yy_buffer_state |
---|
145 | { |
---|
146 | FILE *yy_input_file; |
---|
147 | |
---|
148 | char *yy_ch_buf; /* input buffer */ |
---|
149 | char *yy_buf_pos; /* current position in input buffer */ |
---|
150 | |
---|
151 | /* Size of input buffer in bytes, not including room for EOB |
---|
152 | * characters. |
---|
153 | */ |
---|
154 | yy_size_t yy_buf_size; |
---|
155 | |
---|
156 | /* Number of characters read into yy_ch_buf, not including EOB |
---|
157 | * characters. |
---|
158 | */ |
---|
159 | int yy_n_chars; |
---|
160 | |
---|
161 | /* Whether we "own" the buffer - i.e., we know we created it, |
---|
162 | * and can realloc() it to grow it, and should free() it to |
---|
163 | * delete it. |
---|
164 | */ |
---|
165 | int yy_is_our_buffer; |
---|
166 | |
---|
167 | /* Whether this is an "interactive" input source; if so, and |
---|
168 | * if we're using stdio for input, then we want to use getc() |
---|
169 | * instead of fread(), to make sure we stop fetching input after |
---|
170 | * each newline. |
---|
171 | */ |
---|
172 | int yy_is_interactive; |
---|
173 | |
---|
174 | /* Whether we're considered to be at the beginning of a line. |
---|
175 | * If so, '^' rules will be active on the next match, otherwise |
---|
176 | * not. |
---|
177 | */ |
---|
178 | int yy_at_bol; |
---|
179 | |
---|
180 | /* Whether to try to fill the input buffer when we reach the |
---|
181 | * end of it. |
---|
182 | */ |
---|
183 | int yy_fill_buffer; |
---|
184 | |
---|
185 | int yy_buffer_status; |
---|
186 | #define YY_BUFFER_NEW 0 |
---|
187 | #define YY_BUFFER_NORMAL 1 |
---|
188 | /* When an EOF's been seen but there's still some text to process |
---|
189 | * then we mark the buffer as YY_EOF_PENDING, to indicate that we |
---|
190 | * shouldn't try reading from the input source any more. We might |
---|
191 | * still have a bunch of tokens to match, though, because of |
---|
192 | * possible backing-up. |
---|
193 | * |
---|
194 | * When we actually see the EOF, we change the status to "new" |
---|
195 | * (via yyrestart()), so that the user can continue scanning by |
---|
196 | * just pointing yyin at a new input file. |
---|
197 | */ |
---|
198 | #define YY_BUFFER_EOF_PENDING 2 |
---|
199 | }; |
---|
200 | |
---|
201 | static YY_BUFFER_STATE yy_current_buffer = 0; |
---|
202 | |
---|
203 | /* We provide macros for accessing buffer states in case in the |
---|
204 | * future we want to put the buffer states in a more general |
---|
205 | * "scanner state". |
---|
206 | */ |
---|
207 | #define YY_CURRENT_BUFFER yy_current_buffer |
---|
208 | |
---|
209 | |
---|
210 | /* yy_hold_char holds the character lost when yytext is formed. */ |
---|
211 | static char yy_hold_char; |
---|
212 | |
---|
213 | static int yy_n_chars; /* number of characters read into yy_ch_buf */ |
---|
214 | |
---|
215 | |
---|
216 | int yyleng; |
---|
217 | |
---|
218 | /* Points to current character in buffer. */ |
---|
219 | static char *yy_c_buf_p = (char *) 0; |
---|
220 | static int yy_init = 1; /* whether we need to initialize */ |
---|
221 | static int yy_start = 0; /* start state number */ |
---|
222 | |
---|
223 | /* Flag which is used to allow yywrap()'s to do buffer switches |
---|
224 | * instead of setting up a fresh yyin. A bit of a hack ... |
---|
225 | */ |
---|
226 | static int yy_did_buffer_switch_on_eof; |
---|
227 | |
---|
228 | void yyrestart YY_PROTO(( FILE *input_file )); |
---|
229 | |
---|
230 | void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer )); |
---|
231 | void yy_load_buffer_state YY_PROTO(( void )); |
---|
232 | YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size )); |
---|
233 | void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b )); |
---|
234 | void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file )); |
---|
235 | void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b )); |
---|
236 | #define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer ) |
---|
237 | |
---|
238 | YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size )); |
---|
239 | YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str )); |
---|
240 | YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); |
---|
241 | |
---|
242 | static void *yy_flex_alloc YY_PROTO(( yy_size_t )); |
---|
243 | static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )); |
---|
244 | static void yy_flex_free YY_PROTO(( void * )); |
---|
245 | |
---|
246 | #define yy_new_buffer yy_create_buffer |
---|
247 | |
---|
248 | #define yy_set_interactive(is_interactive) \ |
---|
249 | { \ |
---|
250 | if ( ! yy_current_buffer ) \ |
---|
251 | yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ |
---|
252 | yy_current_buffer->yy_is_interactive = is_interactive; \ |
---|
253 | } |
---|
254 | |
---|
255 | #define yy_set_bol(at_bol) \ |
---|
256 | { \ |
---|
257 | if ( ! yy_current_buffer ) \ |
---|
258 | yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ |
---|
259 | yy_current_buffer->yy_at_bol = at_bol; \ |
---|
260 | } |
---|
261 | |
---|
262 | #define YY_AT_BOL() (yy_current_buffer->yy_at_bol) |
---|
263 | |
---|
264 | typedef unsigned char YY_CHAR; |
---|
265 | FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; |
---|
266 | typedef int yy_state_type; |
---|
267 | extern char *yytext; |
---|
268 | #define yytext_ptr yytext |
---|
269 | |
---|
270 | static yy_state_type yy_get_previous_state YY_PROTO(( void )); |
---|
271 | static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); |
---|
272 | static int yy_get_next_buffer YY_PROTO(( void )); |
---|
273 | static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); |
---|
274 | |
---|
275 | /* Done after the current pattern has been matched and before the |
---|
276 | * corresponding action - sets up yytext. |
---|
277 | */ |
---|
278 | #define YY_DO_BEFORE_ACTION \ |
---|
279 | yytext_ptr = yy_bp; \ |
---|
280 | yyleng = (int) (yy_cp - yy_bp); \ |
---|
281 | yy_hold_char = *yy_cp; \ |
---|
282 | *yy_cp = '\0'; \ |
---|
283 | yy_c_buf_p = yy_cp; |
---|
284 | |
---|
285 | #define YY_NUM_RULES 34 |
---|
286 | #define YY_END_OF_BUFFER 35 |
---|
287 | static yyconst short int yy_accept[84] = |
---|
288 | { 0, |
---|
289 | 0, 0, 35, 33, 32, 32, 33, 25, 33, 33, |
---|
290 | 21, 22, 18, 16, 19, 17, 20, 15, 30, 3, |
---|
291 | 33, 4, 31, 31, 31, 31, 31, 31, 31, 31, |
---|
292 | 23, 24, 33, 31, 31, 31, 31, 33, 11, 32, |
---|
293 | 2, 7, 0, 0, 0, 30, 5, 1, 6, 31, |
---|
294 | 31, 31, 31, 27, 27, 10, 31, 31, 31, 31, |
---|
295 | 31, 13, 31, 31, 31, 9, 28, 28, 29, 8, |
---|
296 | 31, 31, 12, 31, 31, 14, 26, 31, 31, 31, |
---|
297 | 31, 31, 0 |
---|
298 | } ; |
---|
299 | |
---|
300 | static yyconst int yy_ec[256] = |
---|
301 | { 0, |
---|
302 | 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, |
---|
303 | 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, |
---|
304 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
---|
305 | 1, 2, 4, 1, 1, 5, 1, 6, 7, 8, |
---|
306 | 9, 10, 11, 12, 13, 14, 15, 16, 16, 16, |
---|
307 | 16, 16, 16, 16, 16, 16, 16, 17, 1, 18, |
---|
308 | 19, 20, 1, 1, 21, 22, 22, 23, 24, 25, |
---|
309 | 22, 22, 22, 22, 22, 26, 22, 27, 28, 22, |
---|
310 | 22, 29, 30, 31, 32, 22, 22, 33, 34, 22, |
---|
311 | 35, 36, 37, 38, 22, 1, 39, 22, 22, 22, |
---|
312 | |
---|
313 | 40, 41, 22, 22, 22, 22, 22, 42, 22, 43, |
---|
314 | 44, 22, 22, 45, 46, 47, 48, 22, 22, 22, |
---|
315 | 49, 22, 1, 50, 1, 51, 1, 1, 1, 1, |
---|
316 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
---|
317 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
---|
318 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
---|
319 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
---|
320 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
---|
321 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
---|
322 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
---|
323 | |
---|
324 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
---|
325 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
---|
326 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
---|
327 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
---|
328 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
---|
329 | 1, 1, 1, 1, 1 |
---|
330 | } ; |
---|
331 | |
---|
332 | static yyconst int yy_meta[52] = |
---|
333 | { 0, |
---|
334 | 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, |
---|
335 | 1, 1, 1, 1, 1, 3, 3, 1, 1, 1, |
---|
336 | 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, |
---|
337 | 3, 3, 3, 3, 1, 1, 1, 1, 3, 3, |
---|
338 | 3, 3, 3, 3, 3, 3, 3, 3, 3, 1, |
---|
339 | 1 |
---|
340 | } ; |
---|
341 | |
---|
342 | static yyconst short int yy_base[86] = |
---|
343 | { 0, |
---|
344 | 0, 0, 117, 118, 50, 52, 97, 118, 109, 78, |
---|
345 | 118, 118, 118, 118, 118, 118, 118, 118, 42, 94, |
---|
346 | 93, 92, 83, 0, 36, 32, 80, 32, 80, 38, |
---|
347 | 118, 118, 69, 67, 61, 59, 63, 52, 118, 61, |
---|
348 | 118, 118, 52, 58, 85, 52, 118, 118, 118, 0, |
---|
349 | 77, 72, 53, 62, 0, 0, 60, 43, 61, 59, |
---|
350 | 41, 118, 44, 37, 38, 118, 118, 60, 67, 0, |
---|
351 | 52, 35, 0, 56, 39, 0, 0, 28, 33, 48, |
---|
352 | 31, 30, 118, 96, 66 |
---|
353 | } ; |
---|
354 | |
---|
355 | static yyconst short int yy_def[86] = |
---|
356 | { 0, |
---|
357 | 83, 1, 83, 83, 83, 83, 83, 83, 83, 84, |
---|
358 | 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, |
---|
359 | 83, 83, 85, 85, 85, 85, 85, 85, 85, 85, |
---|
360 | 83, 83, 83, 85, 85, 85, 85, 83, 83, 83, |
---|
361 | 83, 83, 84, 84, 83, 83, 83, 83, 83, 85, |
---|
362 | 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, |
---|
363 | 85, 83, 85, 85, 85, 83, 83, 84, 83, 85, |
---|
364 | 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, |
---|
365 | 85, 85, 0, 83, 83 |
---|
366 | } ; |
---|
367 | |
---|
368 | static yyconst short int yy_nxt[170] = |
---|
369 | { 0, |
---|
370 | 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, |
---|
371 | 14, 15, 16, 17, 18, 19, 4, 20, 21, 22, |
---|
372 | 23, 24, 24, 24, 25, 24, 26, 27, 24, 24, |
---|
373 | 28, 24, 29, 30, 31, 4, 32, 33, 24, 24, |
---|
374 | 34, 24, 35, 24, 24, 24, 36, 24, 37, 38, |
---|
375 | 39, 40, 40, 40, 40, 45, 52, 46, 67, 54, |
---|
376 | 57, 60, 40, 40, 68, 45, 67, 46, 50, 55, |
---|
377 | 55, 55, 77, 82, 53, 55, 58, 61, 77, 77, |
---|
378 | 81, 80, 69, 77, 79, 78, 77, 44, 77, 76, |
---|
379 | 75, 74, 73, 44, 72, 44, 43, 71, 43, 70, |
---|
380 | |
---|
381 | 69, 66, 65, 64, 55, 63, 62, 59, 56, 51, |
---|
382 | 49, 48, 47, 44, 42, 41, 83, 3, 83, 83, |
---|
383 | 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, |
---|
384 | 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, |
---|
385 | 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, |
---|
386 | 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, |
---|
387 | 83, 83, 83, 83, 83, 83, 83, 83, 83 |
---|
388 | } ; |
---|
389 | |
---|
390 | static yyconst short int yy_chk[170] = |
---|
391 | { 0, |
---|
392 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
---|
393 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
---|
394 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
---|
395 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
---|
396 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
---|
397 | 1, 5, 5, 6, 6, 19, 25, 19, 43, 26, |
---|
398 | 28, 30, 40, 40, 44, 46, 68, 46, 85, 82, |
---|
399 | 81, 80, 79, 78, 25, 26, 28, 30, 75, 74, |
---|
400 | 72, 71, 69, 65, 64, 63, 61, 43, 60, 59, |
---|
401 | 58, 57, 54, 44, 53, 68, 84, 52, 84, 51, |
---|
402 | |
---|
403 | 45, 38, 37, 36, 35, 34, 33, 29, 27, 23, |
---|
404 | 22, 21, 20, 10, 9, 7, 3, 83, 83, 83, |
---|
405 | 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, |
---|
406 | 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, |
---|
407 | 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, |
---|
408 | 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, |
---|
409 | 83, 83, 83, 83, 83, 83, 83, 83, 83 |
---|
410 | } ; |
---|
411 | |
---|
412 | static yy_state_type yy_last_accepting_state; |
---|
413 | static char *yy_last_accepting_cpos; |
---|
414 | |
---|
415 | /* The intent behind this definition is that it'll catch |
---|
416 | * any uses of REJECT which flex missed. |
---|
417 | */ |
---|
418 | #define REJECT reject_used_but_not_detected |
---|
419 | #define yymore() yymore_used_but_not_detected |
---|
420 | #define YY_MORE_ADJ 0 |
---|
421 | #define YY_RESTORE_YY_MORE_OFFSET |
---|
422 | char *yytext; |
---|
423 | #line 1 "./activation-context-query-lexer.l" |
---|
424 | #define INITIAL 0 |
---|
425 | #line 2 "./activation-context-query-lexer.l" |
---|
426 | /* |
---|
427 | |
---|
428 | A good bit of this file is taken from kdelibs/corba/kded/lex.l, which |
---|
429 | solved almost the same problem in a nice way. It was written by either |
---|
430 | David Faure or Steffan Hansen (unclear which). Don Comeau also |
---|
431 | deserves credit for teaching me how to use the whole lex/yacc thing in |
---|
432 | the beginning. |
---|
433 | |
---|
434 | - ECL |
---|
435 | */ |
---|
436 | |
---|
437 | #include "activation-context-query.h" |
---|
438 | #include "activation-context-query-parser.h" |
---|
439 | |
---|
440 | #include <string.h> |
---|
441 | #include <stdlib.h> |
---|
442 | #define YY_NO_UNPUT |
---|
443 | |
---|
444 | static char* putSymbol (char *_name); |
---|
445 | static char* putString (char *_name); |
---|
446 | static int yywrap (void); |
---|
447 | int yylex (void); |
---|
448 | void initFlex (const char *_code); |
---|
449 | |
---|
450 | |
---|
451 | /* Macros after this point can all be overridden by user definitions in |
---|
452 | * section 1. |
---|
453 | */ |
---|
454 | |
---|
455 | #ifndef YY_SKIP_YYWRAP |
---|
456 | #ifdef __cplusplus |
---|
457 | extern "C" int yywrap YY_PROTO(( void )); |
---|
458 | #else |
---|
459 | extern int yywrap YY_PROTO(( void )); |
---|
460 | #endif |
---|
461 | #endif |
---|
462 | |
---|
463 | #ifndef YY_NO_UNPUT |
---|
464 | static void yyunput YY_PROTO(( int c, char *buf_ptr )); |
---|
465 | #endif |
---|
466 | |
---|
467 | #ifndef yytext_ptr |
---|
468 | static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); |
---|
469 | #endif |
---|
470 | |
---|
471 | #ifdef YY_NEED_STRLEN |
---|
472 | static int yy_flex_strlen YY_PROTO(( yyconst char * )); |
---|
473 | #endif |
---|
474 | |
---|
475 | #ifndef YY_NO_INPUT |
---|
476 | #ifdef __cplusplus |
---|
477 | static int yyinput YY_PROTO(( void )); |
---|
478 | #else |
---|
479 | static int input YY_PROTO(( void )); |
---|
480 | #endif |
---|
481 | #endif |
---|
482 | |
---|
483 | #if YY_STACK_USED |
---|
484 | static int yy_start_stack_ptr = 0; |
---|
485 | static int yy_start_stack_depth = 0; |
---|
486 | static int *yy_start_stack = 0; |
---|
487 | #ifndef YY_NO_PUSH_STATE |
---|
488 | static void yy_push_state YY_PROTO(( int new_state )); |
---|
489 | #endif |
---|
490 | #ifndef YY_NO_POP_STATE |
---|
491 | static void yy_pop_state YY_PROTO(( void )); |
---|
492 | #endif |
---|
493 | #ifndef YY_NO_TOP_STATE |
---|
494 | static int yy_top_state YY_PROTO(( void )); |
---|
495 | #endif |
---|
496 | |
---|
497 | #else |
---|
498 | #define YY_NO_PUSH_STATE 1 |
---|
499 | #define YY_NO_POP_STATE 1 |
---|
500 | #define YY_NO_TOP_STATE 1 |
---|
501 | #endif |
---|
502 | |
---|
503 | #ifdef YY_MALLOC_DECL |
---|
504 | YY_MALLOC_DECL |
---|
505 | #else |
---|
506 | #if __STDC__ |
---|
507 | #ifndef __cplusplus |
---|
508 | #include <stdlib.h> |
---|
509 | #endif |
---|
510 | #else |
---|
511 | /* Just try to get by without declaring the routines. This will fail |
---|
512 | * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) |
---|
513 | * or sizeof(void*) != sizeof(int). |
---|
514 | */ |
---|
515 | #endif |
---|
516 | #endif |
---|
517 | |
---|
518 | /* Amount of stuff to slurp up with each read. */ |
---|
519 | #ifndef YY_READ_BUF_SIZE |
---|
520 | #define YY_READ_BUF_SIZE 8192 |
---|
521 | #endif |
---|
522 | |
---|
523 | /* Copy whatever the last rule matched to the standard output. */ |
---|
524 | |
---|
525 | #ifndef ECHO |
---|
526 | /* This used to be an fputs(), but since the string might contain NUL's, |
---|
527 | * we now use fwrite(). |
---|
528 | */ |
---|
529 | #define ECHO (void) fwrite( yytext, yyleng, 1, yyout ) |
---|
530 | #endif |
---|
531 | |
---|
532 | /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, |
---|
533 | * is returned in "result". |
---|
534 | */ |
---|
535 | #ifndef YY_INPUT |
---|
536 | #define YY_INPUT(buf,result,max_size) \ |
---|
537 | if ( yy_current_buffer->yy_is_interactive ) \ |
---|
538 | { \ |
---|
539 | int c = '*', n; \ |
---|
540 | for ( n = 0; n < max_size && \ |
---|
541 | (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ |
---|
542 | buf[n] = (char) c; \ |
---|
543 | if ( c == '\n' ) \ |
---|
544 | buf[n++] = (char) c; \ |
---|
545 | if ( c == EOF && ferror( yyin ) ) \ |
---|
546 | YY_FATAL_ERROR( "input in flex scanner failed" ); \ |
---|
547 | result = n; \ |
---|
548 | } \ |
---|
549 | else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \ |
---|
550 | && ferror( yyin ) ) \ |
---|
551 | YY_FATAL_ERROR( "input in flex scanner failed" ); |
---|
552 | #endif |
---|
553 | |
---|
554 | /* No semi-colon after return; correct usage is to write "yyterminate();" - |
---|
555 | * we don't want an extra ';' after the "return" because that will cause |
---|
556 | * some compilers to complain about unreachable statements. |
---|
557 | */ |
---|
558 | #ifndef yyterminate |
---|
559 | #define yyterminate() return YY_NULL |
---|
560 | #endif |
---|
561 | |
---|
562 | /* Number of entries by which start-condition stack grows. */ |
---|
563 | #ifndef YY_START_STACK_INCR |
---|
564 | #define YY_START_STACK_INCR 25 |
---|
565 | #endif |
---|
566 | |
---|
567 | /* Report a fatal error. */ |
---|
568 | #ifndef YY_FATAL_ERROR |
---|
569 | #define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) |
---|
570 | #endif |
---|
571 | |
---|
572 | /* Default declaration of generated scanner - a define so the user can |
---|
573 | * easily add parameters. |
---|
574 | */ |
---|
575 | #ifndef YY_DECL |
---|
576 | #define YY_DECL int yylex YY_PROTO(( void )) |
---|
577 | #endif |
---|
578 | |
---|
579 | /* Code executed at the beginning of each rule, after yytext and yyleng |
---|
580 | * have been set up. |
---|
581 | */ |
---|
582 | #ifndef YY_USER_ACTION |
---|
583 | #define YY_USER_ACTION |
---|
584 | #endif |
---|
585 | |
---|
586 | /* Code executed at the end of each rule. */ |
---|
587 | #ifndef YY_BREAK |
---|
588 | #define YY_BREAK break; |
---|
589 | #endif |
---|
590 | |
---|
591 | #define YY_RULE_SETUP \ |
---|
592 | YY_USER_ACTION |
---|
593 | |
---|
594 | YY_DECL |
---|
595 | { |
---|
596 | register yy_state_type yy_current_state; |
---|
597 | register char *yy_cp = NULL, *yy_bp = NULL; |
---|
598 | register int yy_act; |
---|
599 | |
---|
600 | #line 30 "./activation-context-query-lexer.l" |
---|
601 | |
---|
602 | |
---|
603 | |
---|
604 | if ( yy_init ) |
---|
605 | { |
---|
606 | yy_init = 0; |
---|
607 | |
---|
608 | #ifdef YY_USER_INIT |
---|
609 | YY_USER_INIT; |
---|
610 | #endif |
---|
611 | |
---|
612 | if ( ! yy_start ) |
---|
613 | yy_start = 1; /* first start state */ |
---|
614 | |
---|
615 | if ( ! yyin ) |
---|
616 | yyin = stdin; |
---|
617 | |
---|
618 | if ( ! yyout ) |
---|
619 | yyout = stdout; |
---|
620 | |
---|
621 | if ( ! yy_current_buffer ) |
---|
622 | yy_current_buffer = |
---|
623 | yy_create_buffer( yyin, YY_BUF_SIZE ); |
---|
624 | |
---|
625 | yy_load_buffer_state(); |
---|
626 | } |
---|
627 | |
---|
628 | while ( 1 ) /* loops until end-of-file is reached */ |
---|
629 | { |
---|
630 | yy_cp = yy_c_buf_p; |
---|
631 | |
---|
632 | /* Support of yytext. */ |
---|
633 | *yy_cp = yy_hold_char; |
---|
634 | |
---|
635 | /* yy_bp points to the position in yy_ch_buf of the start of |
---|
636 | * the current run. |
---|
637 | */ |
---|
638 | yy_bp = yy_cp; |
---|
639 | |
---|
640 | yy_current_state = yy_start; |
---|
641 | yy_match: |
---|
642 | do |
---|
643 | { |
---|
644 | register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; |
---|
645 | if ( yy_accept[yy_current_state] ) |
---|
646 | { |
---|
647 | yy_last_accepting_state = yy_current_state; |
---|
648 | yy_last_accepting_cpos = yy_cp; |
---|
649 | } |
---|
650 | while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) |
---|
651 | { |
---|
652 | yy_current_state = (int) yy_def[yy_current_state]; |
---|
653 | if ( yy_current_state >= 84 ) |
---|
654 | yy_c = yy_meta[(unsigned int) yy_c]; |
---|
655 | } |
---|
656 | yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; |
---|
657 | ++yy_cp; |
---|
658 | } |
---|
659 | while ( yy_base[yy_current_state] != 118 ); |
---|
660 | |
---|
661 | yy_find_action: |
---|
662 | yy_act = yy_accept[yy_current_state]; |
---|
663 | if ( yy_act == 0 ) |
---|
664 | { /* have to back up */ |
---|
665 | yy_cp = yy_last_accepting_cpos; |
---|
666 | yy_current_state = yy_last_accepting_state; |
---|
667 | yy_act = yy_accept[yy_current_state]; |
---|
668 | } |
---|
669 | |
---|
670 | YY_DO_BEFORE_ACTION; |
---|
671 | |
---|
672 | |
---|
673 | do_action: /* This label is used only to access EOF actions. */ |
---|
674 | |
---|
675 | |
---|
676 | switch ( yy_act ) |
---|
677 | { /* beginning of action switch */ |
---|
678 | case 0: /* must back up */ |
---|
679 | /* undo the effects of YY_DO_BEFORE_ACTION */ |
---|
680 | *yy_cp = yy_hold_char; |
---|
681 | yy_cp = yy_last_accepting_cpos; |
---|
682 | yy_current_state = yy_last_accepting_state; |
---|
683 | goto yy_find_action; |
---|
684 | |
---|
685 | case 1: |
---|
686 | YY_RULE_SETUP |
---|
687 | #line 32 "./activation-context-query-lexer.l" |
---|
688 | { return P_EQ; } |
---|
689 | YY_BREAK |
---|
690 | case 2: |
---|
691 | YY_RULE_SETUP |
---|
692 | #line 33 "./activation-context-query-lexer.l" |
---|
693 | { return P_NEQ; } |
---|
694 | YY_BREAK |
---|
695 | case 3: |
---|
696 | YY_RULE_SETUP |
---|
697 | #line 34 "./activation-context-query-lexer.l" |
---|
698 | { return P_LT; } |
---|
699 | YY_BREAK |
---|
700 | case 4: |
---|
701 | YY_RULE_SETUP |
---|
702 | #line 35 "./activation-context-query-lexer.l" |
---|
703 | { return P_GT; } |
---|
704 | YY_BREAK |
---|
705 | case 5: |
---|
706 | YY_RULE_SETUP |
---|
707 | #line 36 "./activation-context-query-lexer.l" |
---|
708 | { return P_LEQ; } |
---|
709 | YY_BREAK |
---|
710 | case 6: |
---|
711 | YY_RULE_SETUP |
---|
712 | #line 37 "./activation-context-query-lexer.l" |
---|
713 | { return P_GEQ; } |
---|
714 | YY_BREAK |
---|
715 | case 7: |
---|
716 | YY_RULE_SETUP |
---|
717 | #line 38 "./activation-context-query-lexer.l" |
---|
718 | { return P_AND; } |
---|
719 | YY_BREAK |
---|
720 | case 8: |
---|
721 | YY_RULE_SETUP |
---|
722 | #line 39 "./activation-context-query-lexer.l" |
---|
723 | { return P_AND; } |
---|
724 | YY_BREAK |
---|
725 | case 9: |
---|
726 | YY_RULE_SETUP |
---|
727 | #line 40 "./activation-context-query-lexer.l" |
---|
728 | { return P_OR; } |
---|
729 | YY_BREAK |
---|
730 | case 10: |
---|
731 | YY_RULE_SETUP |
---|
732 | #line 41 "./activation-context-query-lexer.l" |
---|
733 | { return P_OR; } |
---|
734 | YY_BREAK |
---|
735 | case 11: |
---|
736 | YY_RULE_SETUP |
---|
737 | #line 42 "./activation-context-query-lexer.l" |
---|
738 | { return P_NOT; } |
---|
739 | YY_BREAK |
---|
740 | case 12: |
---|
741 | YY_RULE_SETUP |
---|
742 | #line 43 "./activation-context-query-lexer.l" |
---|
743 | { return P_NOT; } |
---|
744 | YY_BREAK |
---|
745 | case 13: |
---|
746 | YY_RULE_SETUP |
---|
747 | #line 44 "./activation-context-query-lexer.l" |
---|
748 | { return P_XOR; } |
---|
749 | YY_BREAK |
---|
750 | case 14: |
---|
751 | YY_RULE_SETUP |
---|
752 | #line 45 "./activation-context-query-lexer.l" |
---|
753 | { return P_XOR; } |
---|
754 | YY_BREAK |
---|
755 | case 15: |
---|
756 | YY_RULE_SETUP |
---|
757 | #line 47 "./activation-context-query-lexer.l" |
---|
758 | { return P_DIVIDE; } |
---|
759 | YY_BREAK |
---|
760 | case 16: |
---|
761 | YY_RULE_SETUP |
---|
762 | #line 48 "./activation-context-query-lexer.l" |
---|
763 | { return P_ADD; } |
---|
764 | YY_BREAK |
---|
765 | case 17: |
---|
766 | YY_RULE_SETUP |
---|
767 | #line 49 "./activation-context-query-lexer.l" |
---|
768 | { return P_SUBTRACT; } |
---|
769 | YY_BREAK |
---|
770 | case 18: |
---|
771 | YY_RULE_SETUP |
---|
772 | #line 50 "./activation-context-query-lexer.l" |
---|
773 | { return P_MULTIPLY; } |
---|
774 | YY_BREAK |
---|
775 | case 19: |
---|
776 | YY_RULE_SETUP |
---|
777 | #line 51 "./activation-context-query-lexer.l" |
---|
778 | { return COMMA; } |
---|
779 | YY_BREAK |
---|
780 | case 20: |
---|
781 | YY_RULE_SETUP |
---|
782 | #line 52 "./activation-context-query-lexer.l" |
---|
783 | { return PERIOD; } |
---|
784 | YY_BREAK |
---|
785 | case 21: |
---|
786 | YY_RULE_SETUP |
---|
787 | #line 54 "./activation-context-query-lexer.l" |
---|
788 | { return LPAREN; } |
---|
789 | YY_BREAK |
---|
790 | case 22: |
---|
791 | YY_RULE_SETUP |
---|
792 | #line 55 "./activation-context-query-lexer.l" |
---|
793 | { return RPAREN; } |
---|
794 | YY_BREAK |
---|
795 | case 23: |
---|
796 | YY_RULE_SETUP |
---|
797 | #line 56 "./activation-context-query-lexer.l" |
---|
798 | { return LBRACKET; } |
---|
799 | YY_BREAK |
---|
800 | case 24: |
---|
801 | YY_RULE_SETUP |
---|
802 | #line 57 "./activation-context-query-lexer.l" |
---|
803 | { return RBRACKET; } |
---|
804 | YY_BREAK |
---|
805 | case 25: |
---|
806 | YY_RULE_SETUP |
---|
807 | #line 59 "./activation-context-query-lexer.l" |
---|
808 | { return P_DOLLAR; } |
---|
809 | YY_BREAK |
---|
810 | case 26: |
---|
811 | YY_RULE_SETUP |
---|
812 | #line 61 "./activation-context-query-lexer.l" |
---|
813 | { yylval.val_boolean = TRUE; return P_CONST_BOOLEAN; } |
---|
814 | YY_BREAK |
---|
815 | case 27: |
---|
816 | YY_RULE_SETUP |
---|
817 | #line 62 "./activation-context-query-lexer.l" |
---|
818 | { yylval.val_boolean = FALSE; return P_CONST_BOOLEAN; } |
---|
819 | YY_BREAK |
---|
820 | case 28: |
---|
821 | YY_RULE_SETUP |
---|
822 | #line 64 "./activation-context-query-lexer.l" |
---|
823 | { yylval.val_string = putString (yytext); return P_CONST_STRING; } |
---|
824 | YY_BREAK |
---|
825 | case 29: |
---|
826 | YY_RULE_SETUP |
---|
827 | #line 66 "./activation-context-query-lexer.l" |
---|
828 | { yylval.val_number = atof (yytext); return P_CONST_NUMBER; } |
---|
829 | YY_BREAK |
---|
830 | case 30: |
---|
831 | YY_RULE_SETUP |
---|
832 | #line 67 "./activation-context-query-lexer.l" |
---|
833 | { yylval.val_number = atof (yytext); return P_CONST_NUMBER; } |
---|
834 | YY_BREAK |
---|
835 | case 31: |
---|
836 | YY_RULE_SETUP |
---|
837 | #line 69 "./activation-context-query-lexer.l" |
---|
838 | { yylval.val_string = putSymbol (yytext); return P_CONST_ID; } |
---|
839 | YY_BREAK |
---|
840 | case 32: |
---|
841 | YY_RULE_SETUP |
---|
842 | #line 71 "./activation-context-query-lexer.l" |
---|
843 | /* eat up whitespace */ |
---|
844 | YY_BREAK |
---|
845 | case 33: |
---|
846 | YY_RULE_SETUP |
---|
847 | #line 73 "./activation-context-query-lexer.l" |
---|
848 | { return PARSE_ERROR; } |
---|
849 | YY_BREAK |
---|
850 | case 34: |
---|
851 | YY_RULE_SETUP |
---|
852 | #line 75 "./activation-context-query-lexer.l" |
---|
853 | ECHO; |
---|
854 | YY_BREAK |
---|
855 | case YY_STATE_EOF(INITIAL): |
---|
856 | yyterminate(); |
---|
857 | |
---|
858 | case YY_END_OF_BUFFER: |
---|
859 | { |
---|
860 | /* Amount of text matched not including the EOB char. */ |
---|
861 | int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1; |
---|
862 | |
---|
863 | /* Undo the effects of YY_DO_BEFORE_ACTION. */ |
---|
864 | *yy_cp = yy_hold_char; |
---|
865 | YY_RESTORE_YY_MORE_OFFSET |
---|
866 | |
---|
867 | if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) |
---|
868 | { |
---|
869 | /* We're scanning a new file or input source. It's |
---|
870 | * possible that this happened because the user |
---|
871 | * just pointed yyin at a new source and called |
---|
872 | * yylex(). If so, then we have to assure |
---|
873 | * consistency between yy_current_buffer and our |
---|
874 | * globals. Here is the right place to do so, because |
---|
875 | * this is the first action (other than possibly a |
---|
876 | * back-up) that will match for the new input source. |
---|
877 | */ |
---|
878 | yy_n_chars = yy_current_buffer->yy_n_chars; |
---|
879 | yy_current_buffer->yy_input_file = yyin; |
---|
880 | yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL; |
---|
881 | } |
---|
882 | |
---|
883 | /* Note that here we test for yy_c_buf_p "<=" to the position |
---|
884 | * of the first EOB in the buffer, since yy_c_buf_p will |
---|
885 | * already have been incremented past the NUL character |
---|
886 | * (since all states make transitions on EOB to the |
---|
887 | * end-of-buffer state). Contrast this with the test |
---|
888 | * in input(). |
---|
889 | */ |
---|
890 | if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] ) |
---|
891 | { /* This was really a NUL. */ |
---|
892 | yy_state_type yy_next_state; |
---|
893 | |
---|
894 | yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; |
---|
895 | |
---|
896 | yy_current_state = yy_get_previous_state(); |
---|
897 | |
---|
898 | /* Okay, we're now positioned to make the NUL |
---|
899 | * transition. We couldn't have |
---|
900 | * yy_get_previous_state() go ahead and do it |
---|
901 | * for us because it doesn't know how to deal |
---|
902 | * with the possibility of jamming (and we don't |
---|
903 | * want to build jamming into it because then it |
---|
904 | * will run more slowly). |
---|
905 | */ |
---|
906 | |
---|
907 | yy_next_state = yy_try_NUL_trans( yy_current_state ); |
---|
908 | |
---|
909 | yy_bp = yytext_ptr + YY_MORE_ADJ; |
---|
910 | |
---|
911 | if ( yy_next_state ) |
---|
912 | { |
---|
913 | /* Consume the NUL. */ |
---|
914 | yy_cp = ++yy_c_buf_p; |
---|
915 | yy_current_state = yy_next_state; |
---|
916 | goto yy_match; |
---|
917 | } |
---|
918 | |
---|
919 | else |
---|
920 | { |
---|
921 | yy_cp = yy_c_buf_p; |
---|
922 | goto yy_find_action; |
---|
923 | } |
---|
924 | } |
---|
925 | |
---|
926 | else switch ( yy_get_next_buffer() ) |
---|
927 | { |
---|
928 | case EOB_ACT_END_OF_FILE: |
---|
929 | { |
---|
930 | yy_did_buffer_switch_on_eof = 0; |
---|
931 | |
---|
932 | if ( yywrap() ) |
---|
933 | { |
---|
934 | /* Note: because we've taken care in |
---|
935 | * yy_get_next_buffer() to have set up |
---|
936 | * yytext, we can now set up |
---|
937 | * yy_c_buf_p so that if some total |
---|
938 | * hoser (like flex itself) wants to |
---|
939 | * call the scanner after we return the |
---|
940 | * YY_NULL, it'll still work - another |
---|
941 | * YY_NULL will get returned. |
---|
942 | */ |
---|
943 | yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; |
---|
944 | |
---|
945 | yy_act = YY_STATE_EOF(YY_START); |
---|
946 | goto do_action; |
---|
947 | } |
---|
948 | |
---|
949 | else |
---|
950 | { |
---|
951 | if ( ! yy_did_buffer_switch_on_eof ) |
---|
952 | YY_NEW_FILE; |
---|
953 | } |
---|
954 | break; |
---|
955 | } |
---|
956 | |
---|
957 | case EOB_ACT_CONTINUE_SCAN: |
---|
958 | yy_c_buf_p = |
---|
959 | yytext_ptr + yy_amount_of_matched_text; |
---|
960 | |
---|
961 | yy_current_state = yy_get_previous_state(); |
---|
962 | |
---|
963 | yy_cp = yy_c_buf_p; |
---|
964 | yy_bp = yytext_ptr + YY_MORE_ADJ; |
---|
965 | goto yy_match; |
---|
966 | |
---|
967 | case EOB_ACT_LAST_MATCH: |
---|
968 | yy_c_buf_p = |
---|
969 | &yy_current_buffer->yy_ch_buf[yy_n_chars]; |
---|
970 | |
---|
971 | yy_current_state = yy_get_previous_state(); |
---|
972 | |
---|
973 | yy_cp = yy_c_buf_p; |
---|
974 | yy_bp = yytext_ptr + YY_MORE_ADJ; |
---|
975 | goto yy_find_action; |
---|
976 | } |
---|
977 | break; |
---|
978 | } |
---|
979 | |
---|
980 | default: |
---|
981 | YY_FATAL_ERROR( |
---|
982 | "fatal flex scanner internal error--no action found" ); |
---|
983 | } /* end of action switch */ |
---|
984 | } /* end of scanning one token */ |
---|
985 | } /* end of yylex */ |
---|
986 | |
---|
987 | |
---|
988 | /* yy_get_next_buffer - try to read in a new buffer |
---|
989 | * |
---|
990 | * Returns a code representing an action: |
---|
991 | * EOB_ACT_LAST_MATCH - |
---|
992 | * EOB_ACT_CONTINUE_SCAN - continue scanning from current position |
---|
993 | * EOB_ACT_END_OF_FILE - end of file |
---|
994 | */ |
---|
995 | |
---|
996 | static int yy_get_next_buffer() |
---|
997 | { |
---|
998 | register char *dest = yy_current_buffer->yy_ch_buf; |
---|
999 | register char *source = yytext_ptr; |
---|
1000 | register int number_to_move, i; |
---|
1001 | int ret_val; |
---|
1002 | |
---|
1003 | if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) |
---|
1004 | YY_FATAL_ERROR( |
---|
1005 | "fatal flex scanner internal error--end of buffer missed" ); |
---|
1006 | |
---|
1007 | if ( yy_current_buffer->yy_fill_buffer == 0 ) |
---|
1008 | { /* Don't try to fill the buffer, so this is an EOF. */ |
---|
1009 | if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 ) |
---|
1010 | { |
---|
1011 | /* We matched a single character, the EOB, so |
---|
1012 | * treat this as a final EOF. |
---|
1013 | */ |
---|
1014 | return EOB_ACT_END_OF_FILE; |
---|
1015 | } |
---|
1016 | |
---|
1017 | else |
---|
1018 | { |
---|
1019 | /* We matched some text prior to the EOB, first |
---|
1020 | * process it. |
---|
1021 | */ |
---|
1022 | return EOB_ACT_LAST_MATCH; |
---|
1023 | } |
---|
1024 | } |
---|
1025 | |
---|
1026 | /* Try to read more data. */ |
---|
1027 | |
---|
1028 | /* First move last chars to start of buffer. */ |
---|
1029 | number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1; |
---|
1030 | |
---|
1031 | for ( i = 0; i < number_to_move; ++i ) |
---|
1032 | *(dest++) = *(source++); |
---|
1033 | |
---|
1034 | if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING ) |
---|
1035 | /* don't do the read, it's not guaranteed to return an EOF, |
---|
1036 | * just force an EOF |
---|
1037 | */ |
---|
1038 | yy_current_buffer->yy_n_chars = yy_n_chars = 0; |
---|
1039 | |
---|
1040 | else |
---|
1041 | { |
---|
1042 | int num_to_read = |
---|
1043 | yy_current_buffer->yy_buf_size - number_to_move - 1; |
---|
1044 | |
---|
1045 | while ( num_to_read <= 0 ) |
---|
1046 | { /* Not enough room in the buffer - grow it. */ |
---|
1047 | #ifdef YY_USES_REJECT |
---|
1048 | YY_FATAL_ERROR( |
---|
1049 | "input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); |
---|
1050 | #else |
---|
1051 | |
---|
1052 | /* just a shorter name for the current buffer */ |
---|
1053 | YY_BUFFER_STATE b = yy_current_buffer; |
---|
1054 | |
---|
1055 | int yy_c_buf_p_offset = |
---|
1056 | (int) (yy_c_buf_p - b->yy_ch_buf); |
---|
1057 | |
---|
1058 | if ( b->yy_is_our_buffer ) |
---|
1059 | { |
---|
1060 | int new_size = b->yy_buf_size * 2; |
---|
1061 | |
---|
1062 | if ( new_size <= 0 ) |
---|
1063 | b->yy_buf_size += b->yy_buf_size / 8; |
---|
1064 | else |
---|
1065 | b->yy_buf_size *= 2; |
---|
1066 | |
---|
1067 | b->yy_ch_buf = (char *) |
---|
1068 | /* Include room in for 2 EOB chars. */ |
---|
1069 | yy_flex_realloc( (void *) b->yy_ch_buf, |
---|
1070 | b->yy_buf_size + 2 ); |
---|
1071 | } |
---|
1072 | else |
---|
1073 | /* Can't grow it, we don't own it. */ |
---|
1074 | b->yy_ch_buf = 0; |
---|
1075 | |
---|
1076 | if ( ! b->yy_ch_buf ) |
---|
1077 | YY_FATAL_ERROR( |
---|
1078 | "fatal error - scanner input buffer overflow" ); |
---|
1079 | |
---|
1080 | yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; |
---|
1081 | |
---|
1082 | num_to_read = yy_current_buffer->yy_buf_size - |
---|
1083 | number_to_move - 1; |
---|
1084 | #endif |
---|
1085 | } |
---|
1086 | |
---|
1087 | if ( num_to_read > YY_READ_BUF_SIZE ) |
---|
1088 | num_to_read = YY_READ_BUF_SIZE; |
---|
1089 | |
---|
1090 | /* Read in more data. */ |
---|
1091 | YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), |
---|
1092 | yy_n_chars, num_to_read ); |
---|
1093 | |
---|
1094 | yy_current_buffer->yy_n_chars = yy_n_chars; |
---|
1095 | } |
---|
1096 | |
---|
1097 | if ( yy_n_chars == 0 ) |
---|
1098 | { |
---|
1099 | if ( number_to_move == YY_MORE_ADJ ) |
---|
1100 | { |
---|
1101 | ret_val = EOB_ACT_END_OF_FILE; |
---|
1102 | yyrestart( yyin ); |
---|
1103 | } |
---|
1104 | |
---|
1105 | else |
---|
1106 | { |
---|
1107 | ret_val = EOB_ACT_LAST_MATCH; |
---|
1108 | yy_current_buffer->yy_buffer_status = |
---|
1109 | YY_BUFFER_EOF_PENDING; |
---|
1110 | } |
---|
1111 | } |
---|
1112 | |
---|
1113 | else |
---|
1114 | ret_val = EOB_ACT_CONTINUE_SCAN; |
---|
1115 | |
---|
1116 | yy_n_chars += number_to_move; |
---|
1117 | yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; |
---|
1118 | yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; |
---|
1119 | |
---|
1120 | yytext_ptr = &yy_current_buffer->yy_ch_buf[0]; |
---|
1121 | |
---|
1122 | return ret_val; |
---|
1123 | } |
---|
1124 | |
---|
1125 | |
---|
1126 | /* yy_get_previous_state - get the state just before the EOB char was reached */ |
---|
1127 | |
---|
1128 | static yy_state_type yy_get_previous_state() |
---|
1129 | { |
---|
1130 | register yy_state_type yy_current_state; |
---|
1131 | register char *yy_cp; |
---|
1132 | |
---|
1133 | yy_current_state = yy_start; |
---|
1134 | |
---|
1135 | for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) |
---|
1136 | { |
---|
1137 | register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); |
---|
1138 | if ( yy_accept[yy_current_state] ) |
---|
1139 | { |
---|
1140 | yy_last_accepting_state = yy_current_state; |
---|
1141 | yy_last_accepting_cpos = yy_cp; |
---|
1142 | } |
---|
1143 | while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) |
---|
1144 | { |
---|
1145 | yy_current_state = (int) yy_def[yy_current_state]; |
---|
1146 | if ( yy_current_state >= 84 ) |
---|
1147 | yy_c = yy_meta[(unsigned int) yy_c]; |
---|
1148 | } |
---|
1149 | yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; |
---|
1150 | } |
---|
1151 | |
---|
1152 | return yy_current_state; |
---|
1153 | } |
---|
1154 | |
---|
1155 | |
---|
1156 | /* yy_try_NUL_trans - try to make a transition on the NUL character |
---|
1157 | * |
---|
1158 | * synopsis |
---|
1159 | * next_state = yy_try_NUL_trans( current_state ); |
---|
1160 | */ |
---|
1161 | |
---|
1162 | #ifdef YY_USE_PROTOS |
---|
1163 | static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state ) |
---|
1164 | #else |
---|
1165 | static yy_state_type yy_try_NUL_trans( yy_current_state ) |
---|
1166 | yy_state_type yy_current_state; |
---|
1167 | #endif |
---|
1168 | { |
---|
1169 | register int yy_is_jam; |
---|
1170 | register char *yy_cp = yy_c_buf_p; |
---|
1171 | |
---|
1172 | register YY_CHAR yy_c = 1; |
---|
1173 | if ( yy_accept[yy_current_state] ) |
---|
1174 | { |
---|
1175 | yy_last_accepting_state = yy_current_state; |
---|
1176 | yy_last_accepting_cpos = yy_cp; |
---|
1177 | } |
---|
1178 | while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) |
---|
1179 | { |
---|
1180 | yy_current_state = (int) yy_def[yy_current_state]; |
---|
1181 | if ( yy_current_state >= 84 ) |
---|
1182 | yy_c = yy_meta[(unsigned int) yy_c]; |
---|
1183 | } |
---|
1184 | yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; |
---|
1185 | yy_is_jam = (yy_current_state == 83); |
---|
1186 | |
---|
1187 | return yy_is_jam ? 0 : yy_current_state; |
---|
1188 | } |
---|
1189 | |
---|
1190 | |
---|
1191 | #ifndef YY_NO_UNPUT |
---|
1192 | #ifdef YY_USE_PROTOS |
---|
1193 | static void yyunput( int c, register char *yy_bp ) |
---|
1194 | #else |
---|
1195 | static void yyunput( c, yy_bp ) |
---|
1196 | int c; |
---|
1197 | register char *yy_bp; |
---|
1198 | #endif |
---|
1199 | { |
---|
1200 | register char *yy_cp = yy_c_buf_p; |
---|
1201 | |
---|
1202 | /* undo effects of setting up yytext */ |
---|
1203 | *yy_cp = yy_hold_char; |
---|
1204 | |
---|
1205 | if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) |
---|
1206 | { /* need to shift things up to make room */ |
---|
1207 | /* +2 for EOB chars. */ |
---|
1208 | register int number_to_move = yy_n_chars + 2; |
---|
1209 | register char *dest = &yy_current_buffer->yy_ch_buf[ |
---|
1210 | yy_current_buffer->yy_buf_size + 2]; |
---|
1211 | register char *source = |
---|
1212 | &yy_current_buffer->yy_ch_buf[number_to_move]; |
---|
1213 | |
---|
1214 | while ( source > yy_current_buffer->yy_ch_buf ) |
---|
1215 | *--dest = *--source; |
---|
1216 | |
---|
1217 | yy_cp += (int) (dest - source); |
---|
1218 | yy_bp += (int) (dest - source); |
---|
1219 | yy_current_buffer->yy_n_chars = |
---|
1220 | yy_n_chars = yy_current_buffer->yy_buf_size; |
---|
1221 | |
---|
1222 | if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) |
---|
1223 | YY_FATAL_ERROR( "flex scanner push-back overflow" ); |
---|
1224 | } |
---|
1225 | |
---|
1226 | *--yy_cp = (char) c; |
---|
1227 | |
---|
1228 | |
---|
1229 | yytext_ptr = yy_bp; |
---|
1230 | yy_hold_char = *yy_cp; |
---|
1231 | yy_c_buf_p = yy_cp; |
---|
1232 | } |
---|
1233 | #endif /* ifndef YY_NO_UNPUT */ |
---|
1234 | |
---|
1235 | |
---|
1236 | #ifdef __cplusplus |
---|
1237 | static int yyinput() |
---|
1238 | #else |
---|
1239 | static int input() |
---|
1240 | #endif |
---|
1241 | { |
---|
1242 | int c; |
---|
1243 | |
---|
1244 | *yy_c_buf_p = yy_hold_char; |
---|
1245 | |
---|
1246 | if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) |
---|
1247 | { |
---|
1248 | /* yy_c_buf_p now points to the character we want to return. |
---|
1249 | * If this occurs *before* the EOB characters, then it's a |
---|
1250 | * valid NUL; if not, then we've hit the end of the buffer. |
---|
1251 | */ |
---|
1252 | if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] ) |
---|
1253 | /* This was really a NUL. */ |
---|
1254 | *yy_c_buf_p = '\0'; |
---|
1255 | |
---|
1256 | else |
---|
1257 | { /* need more input */ |
---|
1258 | int offset = yy_c_buf_p - yytext_ptr; |
---|
1259 | ++yy_c_buf_p; |
---|
1260 | |
---|
1261 | switch ( yy_get_next_buffer() ) |
---|
1262 | { |
---|
1263 | case EOB_ACT_LAST_MATCH: |
---|
1264 | /* This happens because yy_g_n_b() |
---|
1265 | * sees that we've accumulated a |
---|
1266 | * token and flags that we need to |
---|
1267 | * try matching the token before |
---|
1268 | * proceeding. But for input(), |
---|
1269 | * there's no matching to consider. |
---|
1270 | * So convert the EOB_ACT_LAST_MATCH |
---|
1271 | * to EOB_ACT_END_OF_FILE. |
---|
1272 | */ |
---|
1273 | |
---|
1274 | /* Reset buffer status. */ |
---|
1275 | yyrestart( yyin ); |
---|
1276 | |
---|
1277 | /* fall through */ |
---|
1278 | |
---|
1279 | case EOB_ACT_END_OF_FILE: |
---|
1280 | { |
---|
1281 | if ( yywrap() ) |
---|
1282 | return EOF; |
---|
1283 | |
---|
1284 | if ( ! yy_did_buffer_switch_on_eof ) |
---|
1285 | YY_NEW_FILE; |
---|
1286 | #ifdef __cplusplus |
---|
1287 | return yyinput(); |
---|
1288 | #else |
---|
1289 | return input(); |
---|
1290 | #endif |
---|
1291 | } |
---|
1292 | |
---|
1293 | case EOB_ACT_CONTINUE_SCAN: |
---|
1294 | yy_c_buf_p = yytext_ptr + offset; |
---|
1295 | break; |
---|
1296 | } |
---|
1297 | } |
---|
1298 | } |
---|
1299 | |
---|
1300 | c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */ |
---|
1301 | *yy_c_buf_p = '\0'; /* preserve yytext */ |
---|
1302 | yy_hold_char = *++yy_c_buf_p; |
---|
1303 | |
---|
1304 | |
---|
1305 | return c; |
---|
1306 | } |
---|
1307 | |
---|
1308 | |
---|
1309 | #ifdef YY_USE_PROTOS |
---|
1310 | void yyrestart( FILE *input_file ) |
---|
1311 | #else |
---|
1312 | void yyrestart( input_file ) |
---|
1313 | FILE *input_file; |
---|
1314 | #endif |
---|
1315 | { |
---|
1316 | if ( ! yy_current_buffer ) |
---|
1317 | yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); |
---|
1318 | |
---|
1319 | yy_init_buffer( yy_current_buffer, input_file ); |
---|
1320 | yy_load_buffer_state(); |
---|
1321 | } |
---|
1322 | |
---|
1323 | |
---|
1324 | #ifdef YY_USE_PROTOS |
---|
1325 | void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer ) |
---|
1326 | #else |
---|
1327 | void yy_switch_to_buffer( new_buffer ) |
---|
1328 | YY_BUFFER_STATE new_buffer; |
---|
1329 | #endif |
---|
1330 | { |
---|
1331 | if ( yy_current_buffer == new_buffer ) |
---|
1332 | return; |
---|
1333 | |
---|
1334 | if ( yy_current_buffer ) |
---|
1335 | { |
---|
1336 | /* Flush out information for old buffer. */ |
---|
1337 | *yy_c_buf_p = yy_hold_char; |
---|
1338 | yy_current_buffer->yy_buf_pos = yy_c_buf_p; |
---|
1339 | yy_current_buffer->yy_n_chars = yy_n_chars; |
---|
1340 | } |
---|
1341 | |
---|
1342 | yy_current_buffer = new_buffer; |
---|
1343 | yy_load_buffer_state(); |
---|
1344 | |
---|
1345 | /* We don't actually know whether we did this switch during |
---|
1346 | * EOF (yywrap()) processing, but the only time this flag |
---|
1347 | * is looked at is after yywrap() is called, so it's safe |
---|
1348 | * to go ahead and always set it. |
---|
1349 | */ |
---|
1350 | yy_did_buffer_switch_on_eof = 1; |
---|
1351 | } |
---|
1352 | |
---|
1353 | |
---|
1354 | #ifdef YY_USE_PROTOS |
---|
1355 | void yy_load_buffer_state( void ) |
---|
1356 | #else |
---|
1357 | void yy_load_buffer_state() |
---|
1358 | #endif |
---|
1359 | { |
---|
1360 | yy_n_chars = yy_current_buffer->yy_n_chars; |
---|
1361 | yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; |
---|
1362 | yyin = yy_current_buffer->yy_input_file; |
---|
1363 | yy_hold_char = *yy_c_buf_p; |
---|
1364 | } |
---|
1365 | |
---|
1366 | |
---|
1367 | #ifdef YY_USE_PROTOS |
---|
1368 | YY_BUFFER_STATE yy_create_buffer( FILE *file, int size ) |
---|
1369 | #else |
---|
1370 | YY_BUFFER_STATE yy_create_buffer( file, size ) |
---|
1371 | FILE *file; |
---|
1372 | int size; |
---|
1373 | #endif |
---|
1374 | { |
---|
1375 | YY_BUFFER_STATE b; |
---|
1376 | |
---|
1377 | b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); |
---|
1378 | if ( ! b ) |
---|
1379 | YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); |
---|
1380 | |
---|
1381 | b->yy_buf_size = size; |
---|
1382 | |
---|
1383 | /* yy_ch_buf has to be 2 characters longer than the size given because |
---|
1384 | * we need to put in 2 end-of-buffer characters. |
---|
1385 | */ |
---|
1386 | b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 ); |
---|
1387 | if ( ! b->yy_ch_buf ) |
---|
1388 | YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); |
---|
1389 | |
---|
1390 | b->yy_is_our_buffer = 1; |
---|
1391 | |
---|
1392 | yy_init_buffer( b, file ); |
---|
1393 | |
---|
1394 | return b; |
---|
1395 | } |
---|
1396 | |
---|
1397 | |
---|
1398 | #ifdef YY_USE_PROTOS |
---|
1399 | void yy_delete_buffer( YY_BUFFER_STATE b ) |
---|
1400 | #else |
---|
1401 | void yy_delete_buffer( b ) |
---|
1402 | YY_BUFFER_STATE b; |
---|
1403 | #endif |
---|
1404 | { |
---|
1405 | if ( ! b ) |
---|
1406 | return; |
---|
1407 | |
---|
1408 | if ( b == yy_current_buffer ) |
---|
1409 | yy_current_buffer = (YY_BUFFER_STATE) 0; |
---|
1410 | |
---|
1411 | if ( b->yy_is_our_buffer ) |
---|
1412 | yy_flex_free( (void *) b->yy_ch_buf ); |
---|
1413 | |
---|
1414 | yy_flex_free( (void *) b ); |
---|
1415 | } |
---|
1416 | |
---|
1417 | |
---|
1418 | |
---|
1419 | #ifdef YY_USE_PROTOS |
---|
1420 | void yy_init_buffer( YY_BUFFER_STATE b, FILE *file ) |
---|
1421 | #else |
---|
1422 | void yy_init_buffer( b, file ) |
---|
1423 | YY_BUFFER_STATE b; |
---|
1424 | FILE *file; |
---|
1425 | #endif |
---|
1426 | |
---|
1427 | |
---|
1428 | { |
---|
1429 | yy_flush_buffer( b ); |
---|
1430 | |
---|
1431 | b->yy_input_file = file; |
---|
1432 | b->yy_fill_buffer = 1; |
---|
1433 | |
---|
1434 | #if YY_ALWAYS_INTERACTIVE |
---|
1435 | b->yy_is_interactive = 1; |
---|
1436 | #else |
---|
1437 | #if YY_NEVER_INTERACTIVE |
---|
1438 | b->yy_is_interactive = 0; |
---|
1439 | #else |
---|
1440 | b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; |
---|
1441 | #endif |
---|
1442 | #endif |
---|
1443 | } |
---|
1444 | |
---|
1445 | |
---|
1446 | #ifdef YY_USE_PROTOS |
---|
1447 | void yy_flush_buffer( YY_BUFFER_STATE b ) |
---|
1448 | #else |
---|
1449 | void yy_flush_buffer( b ) |
---|
1450 | YY_BUFFER_STATE b; |
---|
1451 | #endif |
---|
1452 | |
---|
1453 | { |
---|
1454 | if ( ! b ) |
---|
1455 | return; |
---|
1456 | |
---|
1457 | b->yy_n_chars = 0; |
---|
1458 | |
---|
1459 | /* We always need two end-of-buffer characters. The first causes |
---|
1460 | * a transition to the end-of-buffer state. The second causes |
---|
1461 | * a jam in that state. |
---|
1462 | */ |
---|
1463 | b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; |
---|
1464 | b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; |
---|
1465 | |
---|
1466 | b->yy_buf_pos = &b->yy_ch_buf[0]; |
---|
1467 | |
---|
1468 | b->yy_at_bol = 1; |
---|
1469 | b->yy_buffer_status = YY_BUFFER_NEW; |
---|
1470 | |
---|
1471 | if ( b == yy_current_buffer ) |
---|
1472 | yy_load_buffer_state(); |
---|
1473 | } |
---|
1474 | |
---|
1475 | |
---|
1476 | #ifndef YY_NO_SCAN_BUFFER |
---|
1477 | #ifdef YY_USE_PROTOS |
---|
1478 | YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size ) |
---|
1479 | #else |
---|
1480 | YY_BUFFER_STATE yy_scan_buffer( base, size ) |
---|
1481 | char *base; |
---|
1482 | yy_size_t size; |
---|
1483 | #endif |
---|
1484 | { |
---|
1485 | YY_BUFFER_STATE b; |
---|
1486 | |
---|
1487 | if ( size < 2 || |
---|
1488 | base[size-2] != YY_END_OF_BUFFER_CHAR || |
---|
1489 | base[size-1] != YY_END_OF_BUFFER_CHAR ) |
---|
1490 | /* They forgot to leave room for the EOB's. */ |
---|
1491 | return 0; |
---|
1492 | |
---|
1493 | b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); |
---|
1494 | if ( ! b ) |
---|
1495 | YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); |
---|
1496 | |
---|
1497 | b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ |
---|
1498 | b->yy_buf_pos = b->yy_ch_buf = base; |
---|
1499 | b->yy_is_our_buffer = 0; |
---|
1500 | b->yy_input_file = 0; |
---|
1501 | b->yy_n_chars = b->yy_buf_size; |
---|
1502 | b->yy_is_interactive = 0; |
---|
1503 | b->yy_at_bol = 1; |
---|
1504 | b->yy_fill_buffer = 0; |
---|
1505 | b->yy_buffer_status = YY_BUFFER_NEW; |
---|
1506 | |
---|
1507 | yy_switch_to_buffer( b ); |
---|
1508 | |
---|
1509 | return b; |
---|
1510 | } |
---|
1511 | #endif |
---|
1512 | |
---|
1513 | |
---|
1514 | #ifndef YY_NO_SCAN_STRING |
---|
1515 | #ifdef YY_USE_PROTOS |
---|
1516 | YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str ) |
---|
1517 | #else |
---|
1518 | YY_BUFFER_STATE yy_scan_string( yy_str ) |
---|
1519 | yyconst char *yy_str; |
---|
1520 | #endif |
---|
1521 | { |
---|
1522 | int len; |
---|
1523 | for ( len = 0; yy_str[len]; ++len ) |
---|
1524 | ; |
---|
1525 | |
---|
1526 | return yy_scan_bytes( yy_str, len ); |
---|
1527 | } |
---|
1528 | #endif |
---|
1529 | |
---|
1530 | |
---|
1531 | #ifndef YY_NO_SCAN_BYTES |
---|
1532 | #ifdef YY_USE_PROTOS |
---|
1533 | YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len ) |
---|
1534 | #else |
---|
1535 | YY_BUFFER_STATE yy_scan_bytes( bytes, len ) |
---|
1536 | yyconst char *bytes; |
---|
1537 | int len; |
---|
1538 | #endif |
---|
1539 | { |
---|
1540 | YY_BUFFER_STATE b; |
---|
1541 | char *buf; |
---|
1542 | yy_size_t n; |
---|
1543 | int i; |
---|
1544 | |
---|
1545 | /* Get memory for full buffer, including space for trailing EOB's. */ |
---|
1546 | n = len + 2; |
---|
1547 | buf = (char *) yy_flex_alloc( n ); |
---|
1548 | if ( ! buf ) |
---|
1549 | YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); |
---|
1550 | |
---|
1551 | for ( i = 0; i < len; ++i ) |
---|
1552 | buf[i] = bytes[i]; |
---|
1553 | |
---|
1554 | buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; |
---|
1555 | |
---|
1556 | b = yy_scan_buffer( buf, n ); |
---|
1557 | if ( ! b ) |
---|
1558 | YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); |
---|
1559 | |
---|
1560 | /* It's okay to grow etc. this buffer, and we should throw it |
---|
1561 | * away when we're done. |
---|
1562 | */ |
---|
1563 | b->yy_is_our_buffer = 1; |
---|
1564 | |
---|
1565 | return b; |
---|
1566 | } |
---|
1567 | #endif |
---|
1568 | |
---|
1569 | |
---|
1570 | #ifndef YY_NO_PUSH_STATE |
---|
1571 | #ifdef YY_USE_PROTOS |
---|
1572 | static void yy_push_state( int new_state ) |
---|
1573 | #else |
---|
1574 | static void yy_push_state( new_state ) |
---|
1575 | int new_state; |
---|
1576 | #endif |
---|
1577 | { |
---|
1578 | if ( yy_start_stack_ptr >= yy_start_stack_depth ) |
---|
1579 | { |
---|
1580 | yy_size_t new_size; |
---|
1581 | |
---|
1582 | yy_start_stack_depth += YY_START_STACK_INCR; |
---|
1583 | new_size = yy_start_stack_depth * sizeof( int ); |
---|
1584 | |
---|
1585 | if ( ! yy_start_stack ) |
---|
1586 | yy_start_stack = (int *) yy_flex_alloc( new_size ); |
---|
1587 | |
---|
1588 | else |
---|
1589 | yy_start_stack = (int *) yy_flex_realloc( |
---|
1590 | (void *) yy_start_stack, new_size ); |
---|
1591 | |
---|
1592 | if ( ! yy_start_stack ) |
---|
1593 | YY_FATAL_ERROR( |
---|
1594 | "out of memory expanding start-condition stack" ); |
---|
1595 | } |
---|
1596 | |
---|
1597 | yy_start_stack[yy_start_stack_ptr++] = YY_START; |
---|
1598 | |
---|
1599 | BEGIN(new_state); |
---|
1600 | } |
---|
1601 | #endif |
---|
1602 | |
---|
1603 | |
---|
1604 | #ifndef YY_NO_POP_STATE |
---|
1605 | static void yy_pop_state() |
---|
1606 | { |
---|
1607 | if ( --yy_start_stack_ptr < 0 ) |
---|
1608 | YY_FATAL_ERROR( "start-condition stack underflow" ); |
---|
1609 | |
---|
1610 | BEGIN(yy_start_stack[yy_start_stack_ptr]); |
---|
1611 | } |
---|
1612 | #endif |
---|
1613 | |
---|
1614 | |
---|
1615 | #ifndef YY_NO_TOP_STATE |
---|
1616 | static int yy_top_state() |
---|
1617 | { |
---|
1618 | return yy_start_stack[yy_start_stack_ptr - 1]; |
---|
1619 | } |
---|
1620 | #endif |
---|
1621 | |
---|
1622 | #ifndef YY_EXIT_FAILURE |
---|
1623 | #define YY_EXIT_FAILURE 2 |
---|
1624 | #endif |
---|
1625 | |
---|
1626 | #ifdef YY_USE_PROTOS |
---|
1627 | static void yy_fatal_error( yyconst char msg[] ) |
---|
1628 | #else |
---|
1629 | static void yy_fatal_error( msg ) |
---|
1630 | char msg[]; |
---|
1631 | #endif |
---|
1632 | { |
---|
1633 | (void) fprintf( stderr, "%s\n", msg ); |
---|
1634 | exit( YY_EXIT_FAILURE ); |
---|
1635 | } |
---|
1636 | |
---|
1637 | |
---|
1638 | |
---|
1639 | /* Redefine yyless() so it works in section 3 code. */ |
---|
1640 | |
---|
1641 | #undef yyless |
---|
1642 | #define yyless(n) \ |
---|
1643 | do \ |
---|
1644 | { \ |
---|
1645 | /* Undo effects of setting up yytext. */ \ |
---|
1646 | yytext[yyleng] = yy_hold_char; \ |
---|
1647 | yy_c_buf_p = yytext + n; \ |
---|
1648 | yy_hold_char = *yy_c_buf_p; \ |
---|
1649 | *yy_c_buf_p = '\0'; \ |
---|
1650 | yyleng = n; \ |
---|
1651 | } \ |
---|
1652 | while ( 0 ) |
---|
1653 | |
---|
1654 | |
---|
1655 | /* Internal utility routines. */ |
---|
1656 | |
---|
1657 | #ifndef yytext_ptr |
---|
1658 | #ifdef YY_USE_PROTOS |
---|
1659 | static void yy_flex_strncpy( char *s1, yyconst char *s2, int n ) |
---|
1660 | #else |
---|
1661 | static void yy_flex_strncpy( s1, s2, n ) |
---|
1662 | char *s1; |
---|
1663 | yyconst char *s2; |
---|
1664 | int n; |
---|
1665 | #endif |
---|
1666 | { |
---|
1667 | register int i; |
---|
1668 | for ( i = 0; i < n; ++i ) |
---|
1669 | s1[i] = s2[i]; |
---|
1670 | } |
---|
1671 | #endif |
---|
1672 | |
---|
1673 | #ifdef YY_NEED_STRLEN |
---|
1674 | #ifdef YY_USE_PROTOS |
---|
1675 | static int yy_flex_strlen( yyconst char *s ) |
---|
1676 | #else |
---|
1677 | static int yy_flex_strlen( s ) |
---|
1678 | yyconst char *s; |
---|
1679 | #endif |
---|
1680 | { |
---|
1681 | register int n; |
---|
1682 | for ( n = 0; s[n]; ++n ) |
---|
1683 | ; |
---|
1684 | |
---|
1685 | return n; |
---|
1686 | } |
---|
1687 | #endif |
---|
1688 | |
---|
1689 | |
---|
1690 | #ifdef YY_USE_PROTOS |
---|
1691 | static void *yy_flex_alloc( yy_size_t size ) |
---|
1692 | #else |
---|
1693 | static void *yy_flex_alloc( size ) |
---|
1694 | yy_size_t size; |
---|
1695 | #endif |
---|
1696 | { |
---|
1697 | return (void *) malloc( size ); |
---|
1698 | } |
---|
1699 | |
---|
1700 | #ifdef YY_USE_PROTOS |
---|
1701 | static void *yy_flex_realloc( void *ptr, yy_size_t size ) |
---|
1702 | #else |
---|
1703 | static void *yy_flex_realloc( ptr, size ) |
---|
1704 | void *ptr; |
---|
1705 | yy_size_t size; |
---|
1706 | #endif |
---|
1707 | { |
---|
1708 | /* The cast to (char *) in the following accommodates both |
---|
1709 | * implementations that use char* generic pointers, and those |
---|
1710 | * that use void* generic pointers. It works with the latter |
---|
1711 | * because both ANSI C and C++ allow castless assignment from |
---|
1712 | * any pointer type to void*, and deal with argument conversions |
---|
1713 | * as though doing an assignment. |
---|
1714 | */ |
---|
1715 | return (void *) realloc( (char *) ptr, size ); |
---|
1716 | } |
---|
1717 | |
---|
1718 | #ifdef YY_USE_PROTOS |
---|
1719 | static void yy_flex_free( void *ptr ) |
---|
1720 | #else |
---|
1721 | static void yy_flex_free( ptr ) |
---|
1722 | void *ptr; |
---|
1723 | #endif |
---|
1724 | { |
---|
1725 | free( ptr ); |
---|
1726 | } |
---|
1727 | |
---|
1728 | #if YY_MAIN |
---|
1729 | int main() |
---|
1730 | { |
---|
1731 | yylex(); |
---|
1732 | return 0; |
---|
1733 | } |
---|
1734 | #endif |
---|
1735 | #line 75 "./activation-context-query-lexer.l" |
---|
1736 | |
---|
1737 | |
---|
1738 | static char * |
---|
1739 | putSymbol (char *_name) |
---|
1740 | { |
---|
1741 | return g_strdup (_name); |
---|
1742 | } |
---|
1743 | |
---|
1744 | static char * |
---|
1745 | putString (char *_str) |
---|
1746 | { |
---|
1747 | int l = strlen (_str); |
---|
1748 | char *p = (char*) g_malloc (l + 1); |
---|
1749 | char *s = _str + 1; |
---|
1750 | char *d = p; |
---|
1751 | while (s < _str + l - 1) |
---|
1752 | { |
---|
1753 | if (*s != '\\') { |
---|
1754 | *d++ = *s++; |
---|
1755 | } else { |
---|
1756 | s++; |
---|
1757 | if (*s == '\\') |
---|
1758 | *d++ = '\\'; |
---|
1759 | else if (*s == 'n') |
---|
1760 | *d++ = '\n'; |
---|
1761 | else if (*s == 'r') |
---|
1762 | *d++ = '\r'; |
---|
1763 | else if (*s == 't') |
---|
1764 | *d++ = '\t'; |
---|
1765 | s++; |
---|
1766 | } |
---|
1767 | } |
---|
1768 | |
---|
1769 | *d = 0; |
---|
1770 | return p; |
---|
1771 | } |
---|
1772 | |
---|
1773 | void |
---|
1774 | initFlex (const char *_code) |
---|
1775 | { |
---|
1776 | yy_switch_to_buffer (yy_scan_string (_code)); |
---|
1777 | } |
---|
1778 | |
---|
1779 | static int |
---|
1780 | yywrap (void) |
---|
1781 | { |
---|
1782 | yy_delete_buffer (YY_CURRENT_BUFFER); |
---|
1783 | return 1; |
---|
1784 | } |
---|