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