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