Debian Codegraph @

src/Base/Quantity.lex.c

raw
1 // SPDX-License-Identifier: LGPL-2.1-or-later
2
3 // clang-format off
4 #line 2 "Quantity.lex.c"
5
6 #line 4 "Quantity.lex.c"
7
8 #define YY_INT_ALIGNED short int
9
10 /* A lexical scanner generated by flex */
11
12 #define FLEX_SCANNER
13 #define YY_FLEX_MAJOR_VERSION 2
14 #define YY_FLEX_MINOR_VERSION 6
15 #define YY_FLEX_SUBMINOR_VERSION 4
16 #if YY_FLEX_SUBMINOR_VERSION > 0
17 #define FLEX_BETA
18 #endif
19
20 /* First, we deal with platform-specific or compiler-specific issues. */
21
22 /* begin standard C headers. */
23 #include <stdio.h>
24 #include <string.h>
25 #include <errno.h>
26 #include <stdlib.h>
27
28 /* end standard C headers. */
29
30 /* flex integer type definitions */
31
32 #ifndef FLEXINT_H
33 #define FLEXINT_H
34
35 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
36
37 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
38
39 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
40 * if you want the limit (max/min) macros for int types.
41 */
42 #ifndef __STDC_LIMIT_MACROS
43 #define __STDC_LIMIT_MACROS 1
44 #endif
45
46 #include <inttypes.h>
47 typedef int8_t flex_int8_t;
48 typedef uint8_t flex_uint8_t;
49 typedef int16_t flex_int16_t;
50 typedef uint16_t flex_uint16_t;
51 typedef int32_t flex_int32_t;
52 typedef uint32_t flex_uint32_t;
53 #else
54 typedef signed char flex_int8_t;
55 typedef short int flex_int16_t;
56 typedef int flex_int32_t;
57 typedef unsigned char flex_uint8_t;
58 typedef unsigned short int flex_uint16_t;
59 typedef unsigned int flex_uint32_t;
60
61 /* Limits of integral types. */
62 #ifndef INT8_MIN
63 #define INT8_MIN (-128)
64 #endif
65 #ifndef INT16_MIN
66 #define INT16_MIN (-32767-1)
67 #endif
68 #ifndef INT32_MIN
69 #define INT32_MIN (-2147483647-1)
70 #endif
71 #ifndef INT8_MAX
72 #define INT8_MAX (127)
73 #endif
74 #ifndef INT16_MAX
75 #define INT16_MAX (32767)
76 #endif
77 #ifndef INT32_MAX
78 #define INT32_MAX (2147483647)
79 #endif
80 #ifndef UINT8_MAX
81 #define UINT8_MAX (255U)
82 #endif
83 #ifndef UINT16_MAX
84 #define UINT16_MAX (65535U)
85 #endif
86 #ifndef UINT32_MAX
87 #define UINT32_MAX (4294967295U)
88 #endif
89
90 #ifndef SIZE_MAX
91 #define SIZE_MAX (~(size_t)0)
92 #endif
93
94 #endif /* ! C99 */
95
96 #endif /* ! FLEXINT_H */
97
98 /* begin standard C++ headers. */
99
100 /* TODO: this is always defined, so inline it */
101 #define yyconst const
102
103 #if defined(__GNUC__) && __GNUC__ >= 3
104 #define yynoreturn __attribute__((__noreturn__))
105 #else
106 #define yynoreturn
107 #endif
108
109 /* Returned upon end-of-file. */
110 #define YY_NULL 0
111
112 /* Promotes a possibly negative, possibly signed char to an
113 * integer in range [0..255] for use as an array index.
114 */
115 #define YY_SC_TO_UI(c) ((YY_CHAR) (c))
116
117 /* Enter a start condition. This macro really ought to take a parameter,
118 * but we do it the disgusting crufty way forced on us by the ()-less
119 * definition of BEGIN.
120 */
121 #define BEGIN (yy_start) = 1 + 2 *
122 /* Translate the current start state into a value that can be later handed
123 * to BEGIN to return to the state. The YYSTATE alias is for lex
124 * compatibility.
125 */
126 #define YY_START (((yy_start) - 1) / 2)
127 #define YYSTATE YY_START
128 /* Action number for EOF rule of a given start state. */
129 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
130 /* Special action meaning "start processing a new file". */
131 #define YY_NEW_FILE yyrestart( yyin )
132 #define YY_END_OF_BUFFER_CHAR 0
133
134 /* Size of default input buffer. */
135 #ifndef YY_BUF_SIZE
136 #ifdef __ia64__
137 /* On IA-64, the buffer size is 16k, not 8k.
138 * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
139 * Ditto for the __ia64__ case accordingly.
140 */
141 #define YY_BUF_SIZE 32768
142 #else
143 #define YY_BUF_SIZE 16384
144 #endif /* __ia64__ */
145 #endif
146
147 /* The state buf must be large enough to hold one state per character in the main buffer.
148 */
149 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
150
151 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
152 #define YY_TYPEDEF_YY_BUFFER_STATE
153 typedef struct yy_buffer_state *YY_BUFFER_STATE;
154 #endif
155
156 #ifndef YY_TYPEDEF_YY_SIZE_T
157 #define YY_TYPEDEF_YY_SIZE_T
158 typedef size_t yy_size_t;
159 #endif
160
161 extern int yyleng;
162
163 extern FILE *yyin, *yyout;
164
165 #define EOB_ACT_CONTINUE_SCAN 0
166 #define EOB_ACT_END_OF_FILE 1
167 #define EOB_ACT_LAST_MATCH 2
168
169 #define YY_LESS_LINENO(n)
170 #define YY_LINENO_REWIND_TO(ptr)
171
172 /* Return all but the first "n" matched characters back to the input stream. */
173 #define yyless(n) \
174 do \
175 { \
176 /* Undo effects of setting up yytext. */ \
177 int yyless_macro_arg = (n); \
178 YY_LESS_LINENO(yyless_macro_arg);\
179 *yy_cp = (yy_hold_char); \
180 YY_RESTORE_YY_MORE_OFFSET \
181 (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
182 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
183 } \
184 while ( 0 )
185 #define unput(c) yyunput( c, (yytext_ptr) )
186
187 #ifndef YY_STRUCT_YY_BUFFER_STATE
188 #define YY_STRUCT_YY_BUFFER_STATE
189 struct yy_buffer_state
190 {
191 FILE *yy_input_file;
192
193 char *yy_ch_buf; /* input buffer */
194 char *yy_buf_pos; /* current position in input buffer */
195
196 /* Size of input buffer in bytes, not including room for EOB
197 * characters.
198 */
199 int yy_buf_size;
200
201 /* Number of characters read into yy_ch_buf, not including EOB
202 * characters.
203 */
204 int yy_n_chars;
205
206 /* Whether we "own" the buffer - i.e., we know we created it,
207 * and can realloc() it to grow it, and should free() it to
208 * delete it.
209 */
210 int yy_is_our_buffer;
211
212 /* Whether this is an "interactive" input source; if so, and
213 * if we're using stdio for input, then we want to use getc()
214 * instead of fread(), to make sure we stop fetching input after
215 * each newline.
216 */
217 int yy_is_interactive;
218
219 /* Whether we're considered to be at the beginning of a line.
220 * If so, '^' rules will be active on the next match, otherwise
221 * not.
222 */
223 int yy_at_bol;
224
225 int yy_bs_lineno; /**< The line count. */
226 int yy_bs_column; /**< The column count. */
227
228 /* Whether to try to fill the input buffer when we reach the
229 * end of it.
230 */
231 int yy_fill_buffer;
232
233 int yy_buffer_status;
234
235 #define YY_BUFFER_NEW 0
236 #define YY_BUFFER_NORMAL 1
237 /* When an EOF's been seen but there's still some text to process
238 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
239 * shouldn't try reading from the input source any more. We might
240 * still have a bunch of tokens to match, though, because of
241 * possible backing-up.
242 *
243 * When we actually see the EOF, we change the status to "new"
244 * (via yyrestart()), so that the user can continue scanning by
245 * just pointing yyin at a new input file.
246 */
247 #define YY_BUFFER_EOF_PENDING 2
248
249 };
250 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
251
252 /* Stack of input buffers. */
253 static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
254 static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
255 static YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array. */
256
257 /* We provide macros for accessing buffer states in case in the
258 * future we want to put the buffer states in a more general
259 * "scanner state".
260 *
261 * Returns the top of the stack, or NULL.
262 */
263 #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
264 ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
265 : NULL)
266 /* Same as previous macro, but useful when we know that the buffer stack is not
267 * NULL or when we need an lvalue. For internal use only.
268 */
269 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
270
271 /* yy_hold_char holds the character lost when yytext is formed. */
272 static char yy_hold_char;
273 static int yy_n_chars; /* number of characters read into yy_ch_buf */
274 int yyleng;
275
276 /* Points to current character in buffer. */
277 static char *yy_c_buf_p = NULL;
278 static int yy_init = 0; /* whether we need to initialize */
279 static int yy_start = 0; /* start state number */
280
281 /* Flag which is used to allow yywrap()'s to do buffer switches
282 * instead of setting up a fresh yyin. A bit of a hack ...
283 */
284 static int yy_did_buffer_switch_on_eof;
285
286 void yyrestart ( FILE *input_file );
287 void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer );
288 YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size );
289 void yy_delete_buffer ( YY_BUFFER_STATE b );
290 void yy_flush_buffer ( YY_BUFFER_STATE b );
291 void yypush_buffer_state ( YY_BUFFER_STATE new_buffer );
292 void yypop_buffer_state ( void );
293
294 static void yyensure_buffer_stack ( void );
295 static void yy_load_buffer_state ( void );
296 static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file );
297 #define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER )
298
299 YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size );
300 YY_BUFFER_STATE yy_scan_string ( const char *yy_str );
301 YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len );
302
303 void *yyalloc ( yy_size_t );
304 void *yyrealloc ( void *, yy_size_t );
305 void yyfree ( void * );
306
307 #define yy_new_buffer yy_create_buffer
308 #define yy_set_interactive(is_interactive) \
309 { \
310 if ( ! YY_CURRENT_BUFFER ){ \
311 yyensure_buffer_stack (); \
312 YY_CURRENT_BUFFER_LVALUE = \
313 yy_create_buffer( yyin, YY_BUF_SIZE ); \
314 } \
315 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
316 }
317 #define yy_set_bol(at_bol) \
318 { \
319 if ( ! YY_CURRENT_BUFFER ){\
320 yyensure_buffer_stack (); \
321 YY_CURRENT_BUFFER_LVALUE = \
322 yy_create_buffer( yyin, YY_BUF_SIZE ); \
323 } \
324 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
325 }
326 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
327
328 #define yywrap() (/*CONSTCOND*/1)
329 #define YY_SKIP_YYWRAP
330 typedef flex_uint8_t YY_CHAR;
331
332 FILE *yyin = NULL, *yyout = NULL;
333
334 typedef int yy_state_type;
335
336 extern int yylineno;
337 int yylineno = 1;
338
339 extern char *yytext;
340 #ifdef yytext_ptr
341 #undef yytext_ptr
342 #endif
343 #define yytext_ptr yytext
344
345 static yy_state_type yy_get_previous_state ( void );
346 static yy_state_type yy_try_NUL_trans ( yy_state_type current_state );
347 static int yy_get_next_buffer ( void );
348 static void yynoreturn yy_fatal_error ( const char* msg );
349
350 /* Done after the current pattern has been matched and before the
351 * corresponding action - sets up yytext.
352 */
353 #define YY_DO_BEFORE_ACTION \
354 (yytext_ptr) = yy_bp; \
355 yyleng = (int) (yy_cp - yy_bp); \
356 (yy_hold_char) = *yy_cp; \
357 *yy_cp = '\0'; \
358 (yy_c_buf_p) = yy_cp;
359 #define YY_NUM_RULES 154
360 #define YY_END_OF_BUFFER 155
361 /* This struct is not used in this scanner,
362 but its presence is necessary. */
363 struct yy_trans_info
364 {
365 flex_int32_t yy_verify;
366 flex_int32_t yy_nxt;
367 };
368 static const flex_int16_t yy_accept[265] =
369 { 0,
370 0, 0, 0, 0, 155, 153, 4, 5, 45, 47,
371 6, 153, 7, 153, 131, 130, 33, 94, 98, 96,
372 104, 109, 37, 126, 61, 153, 153, 87, 95, 82,
373 78, 1, 153, 153, 153, 153, 136, 153, 27, 32,
374 153, 153, 17, 15, 153, 153, 153, 153, 30, 29,
375 153, 153, 153, 153, 3, 154, 2, 5, 134, 132,
376 133, 131, 131, 0, 128, 114, 0, 0, 19, 36,
377 0, 64, 0, 0, 85, 0, 0, 112, 0, 65,
378 0, 0, 81, 97, 115, 0, 0, 0, 0, 0,
379 0, 43, 0, 13, 0, 0, 0, 14, 117, 0,
380
381 46, 0, 44, 35, 0, 111, 63, 0, 0, 86,
382 83, 80, 0, 0, 28, 16, 0, 55, 0, 34,
383 99, 105, 110, 38, 62, 88, 0, 84, 79, 0,
384 26, 51, 18, 12, 0, 0, 102, 108, 9, 57,
385 103, 135, 0, 0, 0, 0, 0, 58, 0, 0,
386 101, 107, 40, 90, 0, 24, 10, 50, 122, 0,
387 0, 0, 0, 0, 133, 0, 131, 0, 0, 131,
388 22, 68, 21, 0, 67, 119, 0, 91, 23, 0,
389 113, 143, 0, 0, 0, 69, 120, 54, 141, 59,
390 123, 142, 125, 20, 0, 66, 116, 0, 118, 76,
391
392 60, 56, 145, 0, 0, 49, 31, 0, 144, 41,
393 52, 147, 75, 124, 148, 0, 0, 150, 0, 0,
394 100, 106, 39, 89, 0, 25, 11, 127, 129, 8,
395 0, 134, 0, 132, 0, 133, 0, 131, 93, 77,
396 71, 137, 138, 139, 92, 121, 0, 0, 70, 42,
397 149, 53, 152, 151, 48, 0, 0, 140, 146, 72,
398 73, 0, 74, 0
399 } ;
400
401 static const YY_CHAR yy_ec[256] =
402 { 0,
403 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
404 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
405 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
406 1, 2, 1, 4, 1, 1, 1, 1, 5, 6,
407 6, 6, 7, 8, 9, 10, 6, 11, 12, 13,
408 14, 14, 14, 14, 14, 14, 14, 1, 1, 1,
409 6, 1, 1, 1, 15, 1, 16, 1, 17, 18,
410 19, 20, 1, 21, 22, 1, 23, 24, 25, 26,
411 1, 1, 27, 28, 1, 29, 30, 1, 1, 1,
412 31, 1, 32, 6, 1, 1, 33, 34, 35, 36,
413
414 37, 38, 39, 40, 41, 1, 42, 43, 44, 45,
415 46, 47, 48, 49, 50, 51, 52, 1, 53, 54,
416 55, 56, 1, 1, 1, 1, 1, 57, 1, 1,
417 1, 1, 1, 1, 1, 58, 1, 1, 1, 1,
418 1, 1, 1, 1, 1, 59, 1, 1, 1, 1,
419 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
420 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
421 1, 1, 1, 1, 1, 60, 1, 61, 62, 1,
422 63, 1, 1, 1, 1, 1, 1, 1, 1, 1,
423 1, 1, 1, 64, 1, 1, 1, 1, 1, 1,
424
425 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
426 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
427 1, 1, 1, 1, 1, 65, 1, 1, 1, 1,
428 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
429 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
430 1, 1, 1, 1, 1
431 } ;
432
433 static const YY_CHAR yy_meta[66] =
434 { 0,
435 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
436 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
437 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1, 1, 1, 1,
441 1, 1, 1, 1, 1
442 } ;
443
444 static const flex_int16_t yy_base[266] =
445 { 0,
446 0, 0, 63, 64, 394, 395, 395, 390, 395, 395,
447 395, 57, 395, 61, 68, 76, 365, 362, 395, 57,
448 334, 395, 395, 77, 345, 348, 354, 395, 71, 371,
449 60, 395, 65, 352, 85, 75, 78, 333, 337, 395,
450 337, 124, 74, 160, 91, 325, 116, 347, 85, 97,
451 190, 343, 62, 70, 395, 395, 395, 375, 159, 202,
452 209, 219, 230, 241, 395, 395, 321, 343, 395, 395,
453 319, 395, 334, 340, 395, 343, 321, 395, 326, 395,
454 313, 319, 317, 395, 395, 316, 319, 323, 330, 313,
455 318, 395, 309, 395, 309, 307, 272, 395, 395, 260,
456
457 395, 253, 395, 395, 238, 395, 395, 243, 248, 395,
458 395, 239, 245, 244, 395, 395, 230, 102, 227, 395,
459 395, 395, 395, 395, 395, 395, 219, 395, 395, 231,
460 395, 98, 395, 216, 122, 220, 395, 395, 395, 395,
461 395, 395, 205, 216, 215, 204, 118, 395, 200, 191,
462 395, 395, 395, 395, 189, 395, 395, 395, 395, 241,
463 124, 169, 263, 275, 279, 288, 292, 301, 306, 310,
464 395, 395, 395, 183, 395, 395, 184, 395, 395, 175,
465 395, 395, 161, 164, 160, 395, 395, 395, 395, 395,
466 395, 395, 395, 395, 158, 395, 395, 157, 395, 395,
467
468 395, 395, 186, 148, 146, 395, 395, 150, 395, 395,
469 395, 395, 395, 395, 152, 140, 132, 139, 125, 120,
470 395, 395, 395, 395, 118, 395, 395, 395, 395, 395,
471 314, 319, 323, 327, 331, 335, 339, 343, 395, 395,
472 395, 395, 395, 147, 395, 395, 144, 103, 395, 395,
473 395, 395, 395, 395, 395, 98, 93, 395, 395, 395,
474 395, 57, 395, 395, 97
475 } ;
476
477 static const flex_int16_t yy_def[266] =
478 { 0,
479 264, 1, 265, 265, 264, 264, 264, 264, 264, 264,
480 264, 264, 264, 264, 264, 264, 264, 264, 264, 264,
481 264, 264, 264, 264, 264, 264, 264, 264, 264, 264,
482 264, 264, 264, 264, 264, 264, 264, 264, 264, 264,
483 264, 264, 264, 264, 264, 264, 264, 264, 264, 264,
484 264, 264, 264, 264, 264, 264, 264, 264, 264, 264,
485 264, 264, 264, 264, 264, 264, 264, 264, 264, 264,
486 264, 264, 264, 264, 264, 264, 264, 264, 264, 264,
487 264, 264, 264, 264, 264, 264, 264, 264, 264, 264,
488 264, 264, 264, 264, 264, 264, 264, 264, 264, 264,
489
490 264, 264, 264, 264, 264, 264, 264, 264, 264, 264,
491 264, 264, 264, 264, 264, 264, 264, 264, 264, 264,
492 264, 264, 264, 264, 264, 264, 264, 264, 264, 264,
493 264, 264, 264, 264, 264, 264, 264, 264, 264, 264,
494 264, 264, 264, 264, 264, 264, 264, 264, 264, 264,
495 264, 264, 264, 264, 264, 264, 264, 264, 264, 264,
496 264, 264, 264, 264, 264, 264, 264, 264, 264, 264,
497 264, 264, 264, 264, 264, 264, 264, 264, 264, 264,
498 264, 264, 264, 264, 264, 264, 264, 264, 264, 264,
499 264, 264, 264, 264, 264, 264, 264, 264, 264, 264,
500
501 264, 264, 264, 264, 264, 264, 264, 264, 264, 264,
502 264, 264, 264, 264, 264, 264, 264, 264, 264, 264,
503 264, 264, 264, 264, 264, 264, 264, 264, 264, 264,
504 264, 264, 264, 264, 264, 264, 264, 264, 264, 264,
505 264, 264, 264, 264, 264, 264, 264, 264, 264, 264,
506 264, 264, 264, 264, 264, 264, 264, 264, 264, 264,
507 264, 264, 264, 0, 264
508 } ;
509
510 static const flex_int16_t yy_nxt[461] =
511 { 0,
512 6, 7, 8, 9, 10, 11, 11, 12, 13, 14,
513 15, 16, 15, 15, 17, 18, 6, 19, 20, 21,
514 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
515 32, 6, 33, 34, 35, 36, 37, 38, 39, 40,
516 41, 42, 43, 44, 45, 46, 47, 6, 48, 49,
517 50, 51, 6, 6, 52, 6, 6, 6, 6, 6,
518 6, 6, 6, 53, 54, 56, 56, 59, 59, 59,
519 59, 60, 60, 60, 60, 61, 67, 62, 63, 63,
520 63, 63, 68, 61, 64, 62, 63, 63, 63, 63,
521 81, 70, 64, 84, 57, 57, 71, 55, 86, 87,
522
523 72, 73, 74, 75, 64, 263, 99, 118, 137, 85,
524 138, 97, 64, 76, 88, 89, 82, 91, 98, 119,
525 92, 159, 93, 77, 160, 146, 161, 162, 94, 149,
526 95, 100, 147, 141, 139, 148, 150, 96, 104, 201,
527 206, 262, 207, 105, 106, 202, 261, 107, 108, 109,
528 110, 260, 111, 112, 259, 216, 142, 209, 113, 258,
529 114, 143, 115, 257, 210, 144, 217, 116, 256, 59,
530 59, 59, 59, 117, 120, 163, 255, 121, 254, 122,
531 123, 124, 253, 125, 228, 229, 126, 127, 128, 129,
532 252, 251, 250, 130, 249, 163, 248, 247, 131, 246,
533
534 132, 245, 133, 134, 244, 135, 136, 151, 243, 152,
535 242, 153, 60, 60, 60, 60, 154, 155, 164, 165,
536 165, 165, 165, 241, 240, 166, 239, 230, 156, 167,
537 167, 167, 167, 157, 220, 168, 219, 61, 164, 62,
538 63, 63, 63, 63, 218, 166, 64, 169, 215, 169,
539 214, 170, 170, 170, 170, 168, 213, 212, 221, 211,
540 222, 208, 223, 205, 204, 203, 64, 224, 225, 231,
541 200, 231, 199, 232, 232, 232, 232, 198, 197, 226,
542 196, 233, 195, 233, 227, 234, 234, 234, 234, 165,
543 165, 165, 165, 194, 235, 166, 235, 193, 236, 236,
544
545 236, 236, 167, 167, 167, 167, 192, 237, 168, 237,
546 191, 238, 238, 238, 238, 166, 170, 170, 170, 170,
547 170, 170, 170, 170, 232, 232, 232, 232, 168, 232,
548 232, 232, 232, 234, 234, 234, 234, 234, 234, 234,
549 234, 236, 236, 236, 236, 236, 236, 236, 236, 238,
550 238, 238, 238, 238, 238, 238, 238, 190, 189, 188,
551 187, 186, 185, 184, 183, 182, 181, 180, 179, 178,
552 177, 176, 175, 174, 173, 172, 171, 58, 158, 145,
553 140, 103, 102, 101, 90, 83, 80, 79, 78, 69,
554 66, 65, 58, 264, 5, 264, 264, 264, 264, 264,
555
556 264, 264, 264, 264, 264, 264, 264, 264, 264, 264,
557 264, 264, 264, 264, 264, 264, 264, 264, 264, 264,
558 264, 264, 264, 264, 264, 264, 264, 264, 264, 264,
559 264, 264, 264, 264, 264, 264, 264, 264, 264, 264,
560 264, 264, 264, 264, 264, 264, 264, 264, 264, 264,
561 264, 264, 264, 264, 264, 264, 264, 264, 264, 264
562 } ;
563
564 static const flex_int16_t yy_chk[461] =
565 { 0,
566 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
567 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
568 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
569 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
570 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
571 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
572 1, 1, 1, 1, 1, 3, 4, 12, 12, 12,
573 12, 14, 14, 14, 14, 15, 20, 15, 15, 15,
574 15, 15, 20, 16, 15, 16, 16, 16, 16, 16,
575 29, 24, 16, 31, 3, 4, 24, 265, 33, 33,
576
577 24, 24, 24, 24, 15, 262, 37, 43, 45, 31,
578 45, 36, 16, 24, 33, 33, 29, 35, 36, 43,
579 35, 53, 35, 24, 53, 49, 54, 54, 35, 50,
580 35, 37, 49, 47, 45, 49, 50, 35, 42, 118,
581 132, 257, 132, 42, 42, 118, 256, 42, 42, 42,
582 42, 248, 42, 42, 247, 147, 47, 135, 42, 244,
583 42, 47, 42, 225, 135, 47, 147, 42, 220, 59,
584 59, 59, 59, 42, 44, 59, 219, 44, 218, 44,
585 44, 44, 217, 44, 161, 161, 44, 44, 44, 44,
586 216, 215, 208, 44, 205, 59, 204, 203, 44, 198,
587
588 44, 195, 44, 44, 185, 44, 44, 51, 184, 51,
589 183, 51, 60, 60, 60, 60, 51, 51, 60, 61,
590 61, 61, 61, 180, 177, 61, 174, 162, 51, 62,
591 62, 62, 62, 51, 155, 62, 150, 63, 60, 63,
592 63, 63, 63, 63, 149, 61, 63, 64, 146, 64,
593 145, 64, 64, 64, 64, 62, 144, 143, 160, 136,
594 160, 134, 160, 130, 127, 119, 63, 160, 160, 163,
595 117, 163, 114, 163, 163, 163, 163, 113, 112, 160,
596 109, 164, 108, 164, 160, 164, 164, 164, 164, 165,
597 165, 165, 165, 105, 166, 165, 166, 102, 166, 166,
598
599 166, 166, 167, 167, 167, 167, 100, 168, 167, 168,
600 97, 168, 168, 168, 168, 165, 169, 169, 169, 169,
601 170, 170, 170, 170, 231, 231, 231, 231, 167, 232,
602 232, 232, 232, 233, 233, 233, 233, 234, 234, 234,
603 234, 235, 235, 235, 235, 236, 236, 236, 236, 237,
604 237, 237, 237, 238, 238, 238, 238, 96, 95, 93,
605 91, 90, 89, 88, 87, 86, 83, 82, 81, 79,
606 77, 76, 74, 73, 71, 68, 67, 58, 52, 48,
607 46, 41, 39, 38, 34, 30, 27, 26, 25, 21,
608 18, 17, 8, 5, 264, 264, 264, 264, 264, 264,
609
610 264, 264, 264, 264, 264, 264, 264, 264, 264, 264,
611 264, 264, 264, 264, 264, 264, 264, 264, 264, 264,
612 264, 264, 264, 264, 264, 264, 264, 264, 264, 264,
613 264, 264, 264, 264, 264, 264, 264, 264, 264, 264,
614 264, 264, 264, 264, 264, 264, 264, 264, 264, 264,
615 264, 264, 264, 264, 264, 264, 264, 264, 264, 264
616 } ;
617
618 static yy_state_type yy_last_accepting_state;
619 static char *yy_last_accepting_cpos;
620
621 extern int yy_flex_debug;
622 int yy_flex_debug = 0;
623
624 /* The intent behind this definition is that it'll catch
625 * any uses of REJECT which flex missed.
626 */
627 #define REJECT reject_used_but_not_detected
628 #define yymore() yymore_used_but_not_detected
629 #define YY_MORE_ADJ 0
630 #define YY_RESTORE_YY_MORE_OFFSET
631 char *yytext;
632 #line 1 "Quantity.l"
633 #line 2 "Quantity.l"
634 /***************************************************************************
635 * Copyright (c) 2013 Jürgen Riegel <[email protected]> *
636 * *
637 * This library is free software; you can redistribute it and/or *
638 * modify it under the terms of the GNU Library General Public *
639 * License as published by the Free Software Foundation; either *
640 * version 2 of the License, or (at your option) any later version. *
641 * *
642 * This library is distributed in the hope that it will be useful, *
643 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
644 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
645 * GNU Library General Public License for more details. *
646 * *
647 * You should have received a copy of the GNU Library General Public *
648 * License along with this library; see the file COPYING.LIB. If not, *
649 * write to the Free Software Foundation, Inc., 59 Temple Place, *
650 * Suite 330, Boston, MA 02111-1307, USA *
651 * *
652 ***************************************************************************/
653
654 /* Lexer for the FreeCAD Units language */
655
656 /* This disables inclusion of unistd.h, which is not available under Visual C++
657 * on Win32. The C++ scanner uses STL streams instead. */
658 #define YY_NO_UNISTD_H
659
660 #line 658 "Quantity.lex.c"
661 /*** Flex Declarations and Options ***/
662 /* the manual says "somewhat more optimized" */
663 /* no support for include files is planned */
664
665 #line 663 "Quantity.lex.c"
666
667 #define INITIAL 0
668 #define C_COMMENT 1
669
670 #ifndef YY_NO_UNISTD_H
671 /* Special case for "unistd.h", since it is non-ANSI. We include it way
672 * down here because we want the user's section 1 to have been scanned first.
673 * The user has a chance to override it with an option.
674 */
675 #include <unistd.h>
676 #endif
677
678 #ifndef YY_EXTRA_TYPE
679 #define YY_EXTRA_TYPE void *
680 #endif
681
682 static int yy_init_globals ( void );
683
684 /* Accessor methods to globals.
685 These are made visible to non-reentrant scanners for convenience. */
686
687 int yylex_destroy ( void );
688
689 int yyget_debug ( void );
690
691 void yyset_debug ( int debug_flag );
692
693 YY_EXTRA_TYPE yyget_extra ( void );
694
695 void yyset_extra ( YY_EXTRA_TYPE user_defined );
696
697 FILE *yyget_in ( void );
698
699 void yyset_in ( FILE * _in_str );
700
701 FILE *yyget_out ( void );
702
703 void yyset_out ( FILE * _out_str );
704
705 int yyget_leng ( void );
706
707 char *yyget_text ( void );
708
709 int yyget_lineno ( void );
710
711 void yyset_lineno ( int _line_number );
712
713 /* Macros after this point can all be overridden by user definitions in
714 * section 1.
715 */
716
717 #ifndef YY_SKIP_YYWRAP
718 #ifdef __cplusplus
719 extern "C" int yywrap ( void );
720 #else
721 extern int yywrap ( void );
722 #endif
723 #endif
724
725 #ifndef YY_NO_UNPUT
726
727 #endif
728
729 #ifndef yytext_ptr
730 static void yy_flex_strncpy ( char *, const char *, int );
731 #endif
732
733 #ifdef YY_NEED_STRLEN
734 static int yy_flex_strlen ( const char * );
735 #endif
736
737 #ifndef YY_NO_INPUT
738 #ifdef __cplusplus
739 static int yyinput ( void );
740 #else
741 static int input ( void );
742 #endif
743
744 #endif
745
746 /* Amount of stuff to slurp up with each read. */
747 #ifndef YY_READ_BUF_SIZE
748 #ifdef __ia64__
749 /* On IA-64, the buffer size is 16k, not 8k */
750 #define YY_READ_BUF_SIZE 16384
751 #else
752 #define YY_READ_BUF_SIZE 8192
753 #endif /* __ia64__ */
754 #endif
755
756 /* Copy whatever the last rule matched to the standard output. */
757 #ifndef ECHO
758 /* This used to be an fputs(), but since the string might contain NUL's,
759 * we now use fwrite().
760 */
761 #define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0)
762 #endif
763
764 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
765 * is returned in "result".
766 */
767 #ifndef YY_INPUT
768 #define YY_INPUT(buf,result,max_size) \
769 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
770 { \
771 int c = '*'; \
772 int n; \
773 for ( n = 0; n < max_size && \
774 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
775 buf[n] = (char) c; \
776 if ( c == '\n' ) \
777 buf[n++] = (char) c; \
778 if ( c == EOF && ferror( yyin ) ) \
779 YY_FATAL_ERROR( "input in flex scanner failed" ); \
780 result = n; \
781 } \
782 else \
783 { \
784 errno=0; \
785 while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \
786 { \
787 if( errno != EINTR) \
788 { \
789 YY_FATAL_ERROR( "input in flex scanner failed" ); \
790 break; \
791 } \
792 errno=0; \
793 clearerr(yyin); \
794 } \
795 }\
796 \
797
798 #endif
799
800 /* No semi-colon after return; correct usage is to write "yyterminate();" -
801 * we don't want an extra ';' after the "return" because that will cause
802 * some compilers to complain about unreachable statements.
803 */
804 #ifndef yyterminate
805 #define yyterminate() return YY_NULL
806 #endif
807
808 /* Number of entries by which start-condition stack grows. */
809 #ifndef YY_START_STACK_INCR
810 #define YY_START_STACK_INCR 25
811 #endif
812
813 /* Report a fatal error. */
814 #ifndef YY_FATAL_ERROR
815 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
816 #endif
817
818 /* end tables serialization structures and prototypes */
819
820 /* Default declaration of generated scanner - a define so the user can
821 * easily add parameters.
822 */
823 #ifndef YY_DECL
824 #define YY_DECL_IS_OURS 1
825
826 extern int yylex (void);
827
828 #define YY_DECL int yylex (void)
829 #endif /* !YY_DECL */
830
831 /* Code executed at the beginning of each rule, after yytext and yyleng
832 * have been set up.
833 */
834 #ifndef YY_USER_ACTION
835 #define YY_USER_ACTION
836 #endif
837
838 /* Code executed at the end of each rule. */
839 #ifndef YY_BREAK
840 #define YY_BREAK /*LINTED*/break;
841 #endif
842
843 #define YY_RULE_SETUP \
844 YY_USER_ACTION
845
846 /** The main scanner function which does all the work.
847 */
848 YY_DECL
849 {
850 yy_state_type yy_current_state;
851 char *yy_cp, *yy_bp;
852 int yy_act;
853
854 if ( !(yy_init) )
855 {
856 (yy_init) = 1;
857
858 #ifdef YY_USER_INIT
859 YY_USER_INIT;
860 #endif
861
862 if ( ! (yy_start) )
863 (yy_start) = 1; /* first start state */
864
865 if ( ! yyin )
866 yyin = stdin;
867
868 if ( ! yyout )
869 yyout = stdout;
870
871 if ( ! YY_CURRENT_BUFFER ) {
872 yyensure_buffer_stack ();
873 YY_CURRENT_BUFFER_LVALUE =
874 yy_create_buffer( yyin, YY_BUF_SIZE );
875 }
876
877 yy_load_buffer_state( );
878 }
879
880 {
881 #line 49 "Quantity.l"
882
883
884 #line 882 "Quantity.lex.c"
885
886 while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */
887 {
888 yy_cp = (yy_c_buf_p);
889
890 /* Support of yytext. */
891 *yy_cp = (yy_hold_char);
892
893 /* yy_bp points to the position in yy_ch_buf of the start of
894 * the current run.
895 */
896 yy_bp = yy_cp;
897
898 yy_current_state = (yy_start);
899 yy_match:
900 do
901 {
902 YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
903 if ( yy_accept[yy_current_state] )
904 {
905 (yy_last_accepting_state) = yy_current_state;
906 (yy_last_accepting_cpos) = yy_cp;
907 }
908 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
909 {
910 yy_current_state = (int) yy_def[yy_current_state];
911 if ( yy_current_state >= 265 )
912 yy_c = yy_meta[yy_c];
913 }
914 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
915 ++yy_cp;
916 }
917 while ( yy_current_state != 264 );
918 yy_cp = (yy_last_accepting_cpos);
919 yy_current_state = (yy_last_accepting_state);
920
921 yy_find_action:
922 yy_act = yy_accept[yy_current_state];
923
924 YY_DO_BEFORE_ACTION;
925
926 do_action: /* This label is used only to access EOF actions. */
927
928 switch ( yy_act )
929 { /* beginning of action switch */
930 case 0: /* must back up */
931 /* undo the effects of YY_DO_BEFORE_ACTION */
932 *yy_cp = (yy_hold_char);
933 yy_cp = (yy_last_accepting_cpos);
934 yy_current_state = (yy_last_accepting_state);
935 goto yy_find_action;
936
937 case 1:
938 YY_RULE_SETUP
939 #line 51 "Quantity.l"
940 { BEGIN(C_COMMENT); }
941 YY_BREAK
942 case 2:
943 YY_RULE_SETUP
944 #line 52 "Quantity.l"
945 { BEGIN(INITIAL); }
946 YY_BREAK
947 case 3:
948 YY_RULE_SETUP
949 #line 53 "Quantity.l"
950 { ;}
951 YY_BREAK
952 case 4:
953 YY_RULE_SETUP
954 #line 56 "Quantity.l"
955 ;
956 YY_BREAK
957 case 5:
958 /* rule 5 can match eol */
959 YY_RULE_SETUP
960 #line 57 "Quantity.l"
961 ;
962 YY_BREAK
963 case 6:
964 YY_RULE_SETUP
965 #line 59 "Quantity.l"
966 return *yytext;
967 YY_BREAK
968 case 7:
969 YY_RULE_SETUP
970 #line 61 "Quantity.l"
971 return MINUSSIGN;
972 YY_BREAK
973 case 8:
974 YY_RULE_SETUP
975 #line 62 "Quantity.l"
976 return MINUSSIGN;
977 YY_BREAK
978 case 9:
979 YY_RULE_SETUP
980 #line 64 "Quantity.l"
981 yylval = Quantity::NanoMetre; return UNIT; // nano meter
982 YY_BREAK
983 case 10:
984 YY_RULE_SETUP
985 #line 65 "Quantity.l"
986 yylval = Quantity::MicroMetre; return UNIT; // micro meter
987 YY_BREAK
988 case 11:
989 YY_RULE_SETUP
990 #line 66 "Quantity.l"
991 yylval = Quantity::MicroMetre; return UNIT; // micro meter (greek micro in UTF8)
992 YY_BREAK
993 case 12:
994 YY_RULE_SETUP
995 #line 67 "Quantity.l"
996 yylval = Quantity::MilliMetre; return UNIT; // milli meter (internal standard length)
997 YY_BREAK
998 case 13:
999 YY_RULE_SETUP
1000 #line 68 "Quantity.l"
1001 yylval = Quantity::CentiMetre; return UNIT; // centi meter
1002 YY_BREAK
1003 case 14:
1004 YY_RULE_SETUP
1005 #line 69 "Quantity.l"
1006 yylval = Quantity::DeciMetre; return UNIT; // deci meter
1007 YY_BREAK
1008 case 15:
1009 YY_RULE_SETUP
1010 #line 70 "Quantity.l"
1011 yylval = Quantity::Metre; return UNIT; // Metre
1012 YY_BREAK
1013 case 16:
1014 YY_RULE_SETUP
1015 #line 71 "Quantity.l"
1016 yylval = Quantity::KiloMetre; return UNIT; // kilo meter
1017 YY_BREAK
1018 case 17:
1019 YY_RULE_SETUP
1020 #line 73 "Quantity.l"
1021 yylval = Quantity::Liter; return UNIT; // Liter (dm^3)
1022 YY_BREAK
1023 case 18:
1024 YY_RULE_SETUP
1025 #line 74 "Quantity.l"
1026 yylval = Quantity::MilliLiter; return UNIT; // milli Liter
1027 YY_BREAK
1028 case 19:
1029 YY_RULE_SETUP
1030 #line 76 "Quantity.l"
1031 yylval = Quantity::Hertz; return UNIT; // Hertz
1032 YY_BREAK
1033 case 20:
1034 YY_RULE_SETUP
1035 #line 77 "Quantity.l"
1036 yylval = Quantity::KiloHertz; return UNIT; // kilo Hertz
1037 YY_BREAK
1038 case 21:
1039 YY_RULE_SETUP
1040 #line 78 "Quantity.l"
1041 yylval = Quantity::MegaHertz; return UNIT; // mega Hertz
1042 YY_BREAK
1043 case 22:
1044 YY_RULE_SETUP
1045 #line 79 "Quantity.l"
1046 yylval = Quantity::GigaHertz; return UNIT; // giga Hertz
1047 YY_BREAK
1048 case 23:
1049 YY_RULE_SETUP
1050 #line 80 "Quantity.l"
1051 yylval = Quantity::TeraHertz; return UNIT; // tera Hertz
1052 YY_BREAK
1053 case 24:
1054 YY_RULE_SETUP
1055 #line 82 "Quantity.l"
1056 yylval = Quantity::MicroGram; return UNIT; // micro gram
1057 YY_BREAK
1058 case 25:
1059 YY_RULE_SETUP
1060 #line 83 "Quantity.l"
1061 yylval = Quantity::MicroGram; return UNIT; // micro gram
1062 YY_BREAK
1063 case 26:
1064 YY_RULE_SETUP
1065 #line 84 "Quantity.l"
1066 yylval = Quantity::MilliGram; return UNIT; // milli gram
1067 YY_BREAK
1068 case 27:
1069 YY_RULE_SETUP
1070 #line 85 "Quantity.l"
1071 yylval = Quantity::Gram; return UNIT; // gram
1072 YY_BREAK
1073 case 28:
1074 YY_RULE_SETUP
1075 #line 86 "Quantity.l"
1076 yylval = Quantity::KiloGram; return UNIT; // kilo gram (internal standard for mass)
1077 YY_BREAK
1078 case 29:
1079 YY_RULE_SETUP
1080 #line 87 "Quantity.l"
1081 yylval = Quantity::Ton; return UNIT; // Metric Tonne
1082 YY_BREAK
1083 case 30:
1084 YY_RULE_SETUP
1085 #line 89 "Quantity.l"
1086 yylval = Quantity::Second; return UNIT; // second (internal standard time)
1087 YY_BREAK
1088 case 31:
1089 YY_RULE_SETUP
1090 #line 90 "Quantity.l"
1091 yylval = Quantity::Minute; return UNIT; // minute
1092 YY_BREAK
1093 case 32:
1094 YY_RULE_SETUP
1095 #line 91 "Quantity.l"
1096 yylval = Quantity::Hour; return UNIT; // hour
1097 YY_BREAK
1098 case 33:
1099 YY_RULE_SETUP
1100 #line 93 "Quantity.l"
1101 yylval = Quantity::Ampere; return UNIT; // Ampere (internal standard electric current)
1102 YY_BREAK
1103 case 34:
1104 YY_RULE_SETUP
1105 #line 94 "Quantity.l"
1106 yylval = Quantity::MilliAmpere; return UNIT; // milli Ampere
1107 YY_BREAK
1108 case 35:
1109 YY_RULE_SETUP
1110 #line 95 "Quantity.l"
1111 yylval = Quantity::KiloAmpere; return UNIT; // kilo Ampere
1112 YY_BREAK
1113 case 36:
1114 YY_RULE_SETUP
1115 #line 96 "Quantity.l"
1116 yylval = Quantity::MegaAmpere; return UNIT; // mega Ampere
1117 YY_BREAK
1118 case 37:
1119 YY_RULE_SETUP
1120 #line 98 "Quantity.l"
1121 yylval = Quantity::Kelvin; return UNIT; // Kelvin (internal standard thermodynamic temperature)
1122 YY_BREAK
1123 case 38:
1124 YY_RULE_SETUP
1125 #line 99 "Quantity.l"
1126 yylval = Quantity::MilliKelvin; return UNIT; // milli Kelvin
1127 YY_BREAK
1128 case 39:
1129 YY_RULE_SETUP
1130 #line 100 "Quantity.l"
1131 yylval = Quantity::MicroKelvin; return UNIT; // micro Kelvin
1132 YY_BREAK
1133 case 40:
1134 YY_RULE_SETUP
1135 #line 101 "Quantity.l"
1136 yylval = Quantity::MicroKelvin; return UNIT; // micro Kelvin
1137 YY_BREAK
1138 case 41:
1139 YY_RULE_SETUP
1140 #line 103 "Quantity.l"
1141 yylval = Quantity::Mole; return UNIT; // Mole (internal standard amount of substance)
1142 YY_BREAK
1143 case 42:
1144 YY_RULE_SETUP
1145 #line 104 "Quantity.l"
1146 yylval = Quantity::MilliMole; return UNIT; // Milli Mole
1147 YY_BREAK
1148 case 43:
1149 YY_RULE_SETUP
1150 #line 106 "Quantity.l"
1151 yylval = Quantity::Candela; return UNIT; // Candela (internal standard luminous intensity)
1152 YY_BREAK
1153 case 44:
1154 YY_RULE_SETUP
1155 #line 108 "Quantity.l"
1156 yylval = Quantity::Inch; return UNIT; // inch
1157 YY_BREAK
1158 case 45:
1159 YY_RULE_SETUP
1160 #line 109 "Quantity.l"
1161 yylval = Quantity::Inch; return UNIT; // inch
1162 YY_BREAK
1163 case 46:
1164 YY_RULE_SETUP
1165 #line 110 "Quantity.l"
1166 yylval = Quantity::Foot; return UNIT; // foot
1167 YY_BREAK
1168 case 47:
1169 YY_RULE_SETUP
1170 #line 111 "Quantity.l"
1171 yylval = Quantity::Foot; return UNIT; // foot
1172 YY_BREAK
1173 case 48:
1174 YY_RULE_SETUP
1175 #line 112 "Quantity.l"
1176 yylval = Quantity::Thou; return UNIT; // thou (in/1000)
1177 YY_BREAK
1178 case 49:
1179 YY_RULE_SETUP
1180 #line 113 "Quantity.l"
1181 yylval = Quantity::Thou; return UNIT; // mil (the thou in US)
1182 YY_BREAK
1183 case 50:
1184 YY_RULE_SETUP
1185 #line 114 "Quantity.l"
1186 yylval = Quantity::Yard; return UNIT; // yard
1187 YY_BREAK
1188 case 51:
1189 YY_RULE_SETUP
1190 #line 115 "Quantity.l"
1191 yylval = Quantity::Mile; return UNIT; // mile
1192 YY_BREAK
1193 case 52:
1194 YY_RULE_SETUP
1195 #line 117 "Quantity.l"
1196 yylval = Quantity::MilePerHour; return UNIT; // mile per hour
1197 YY_BREAK
1198 case 53:
1199 YY_RULE_SETUP
1200 #line 118 "Quantity.l"
1201 yylval = Quantity::SquareFoot; return UNIT; // square foot
1202 YY_BREAK
1203 case 54:
1204 YY_RULE_SETUP
1205 #line 119 "Quantity.l"
1206 yylval = Quantity::CubicFoot; return UNIT; // cubic foot
1207 YY_BREAK
1208 case 55:
1209 YY_RULE_SETUP
1210 #line 121 "Quantity.l"
1211 yylval = Quantity::Pound; return UNIT; // pound
1212 YY_BREAK
1213 case 56:
1214 YY_RULE_SETUP
1215 #line 122 "Quantity.l"
1216 yylval = Quantity::Pound; return UNIT; // pound
1217 YY_BREAK
1218 case 57:
1219 YY_RULE_SETUP
1220 #line 123 "Quantity.l"
1221 yylval = Quantity::Ounce; return UNIT; // ounce
1222 YY_BREAK
1223 case 58:
1224 YY_RULE_SETUP
1225 #line 124 "Quantity.l"
1226 yylval = Quantity::Stone; return UNIT; // Stone
1227 YY_BREAK
1228 case 59:
1229 YY_RULE_SETUP
1230 #line 125 "Quantity.l"
1231 yylval = Quantity::Hundredweights; return UNIT; // hundredweights
1232 YY_BREAK
1233 case 60:
1234 YY_RULE_SETUP
1235 #line 127 "Quantity.l"
1236 yylval = Quantity::PoundForce; return UNIT; // pound
1237 YY_BREAK
1238 case 61:
1239 YY_RULE_SETUP
1240 #line 129 "Quantity.l"
1241 yylval = Quantity::Newton; return UNIT; // Newton (kg*m/s^2)
1242 YY_BREAK
1243 case 62:
1244 YY_RULE_SETUP
1245 #line 130 "Quantity.l"
1246 yylval = Quantity::MilliNewton; return UNIT; // milli Newton
1247 YY_BREAK
1248 case 63:
1249 YY_RULE_SETUP
1250 #line 131 "Quantity.l"
1251 yylval = Quantity::KiloNewton; return UNIT; // kilo Newton
1252 YY_BREAK
1253 case 64:
1254 YY_RULE_SETUP
1255 #line 132 "Quantity.l"
1256 yylval = Quantity::MegaNewton; return UNIT; // mega Newton
1257 YY_BREAK
1258 case 65:
1259 YY_RULE_SETUP
1260 #line 134 "Quantity.l"
1261 yylval = Quantity::Pascal; return UNIT; // Pascal (kg/m/s^2 or N/m^2)
1262 YY_BREAK
1263 case 66:
1264 YY_RULE_SETUP
1265 #line 135 "Quantity.l"
1266 yylval = Quantity::KiloPascal; return UNIT; // kilo Pascal
1267 YY_BREAK
1268 case 67:
1269 YY_RULE_SETUP
1270 #line 136 "Quantity.l"
1271 yylval = Quantity::MegaPascal; return UNIT; // mega Pascal
1272 YY_BREAK
1273 case 68:
1274 YY_RULE_SETUP
1275 #line 137 "Quantity.l"
1276 yylval = Quantity::GigaPascal; return UNIT; // giga Pascal
1277 YY_BREAK
1278 case 69:
1279 YY_RULE_SETUP
1280 #line 139 "Quantity.l"
1281 yylval = Quantity::Bar; return UNIT; // 1 bar = 100 kPa
1282 YY_BREAK
1283 case 70:
1284 YY_RULE_SETUP
1285 #line 140 "Quantity.l"
1286 yylval = Quantity::MilliBar; return UNIT; // milli Bar
1287 YY_BREAK
1288 case 71:
1289 YY_RULE_SETUP
1290 #line 142 "Quantity.l"
1291 yylval = Quantity::Torr; return UNIT; // portion of Pascal ( 101325/760 )
1292 YY_BREAK
1293 case 72:
1294 YY_RULE_SETUP
1295 #line 143 "Quantity.l"
1296 yylval = Quantity::mTorr; return UNIT; //
1297 YY_BREAK
1298 case 73:
1299 YY_RULE_SETUP
1300 #line 144 "Quantity.l"
1301 yylval = Quantity::yTorr; return UNIT; //
1302 YY_BREAK
1303 case 74:
1304 YY_RULE_SETUP
1305 #line 145 "Quantity.l"
1306 yylval = Quantity::yTorr; return UNIT; //
1307 YY_BREAK
1308 case 75:
1309 YY_RULE_SETUP
1310 #line 147 "Quantity.l"
1311 yylval = Quantity::PSI; return UNIT; // pounds/in^2
1312 YY_BREAK
1313 case 76:
1314 YY_RULE_SETUP
1315 #line 148 "Quantity.l"
1316 yylval = Quantity::KSI; return UNIT; // 1000 x pounds/in^2
1317 YY_BREAK
1318 case 77:
1319 YY_RULE_SETUP
1320 #line 149 "Quantity.l"
1321 yylval = Quantity::MPSI; return UNIT; // 1000 ksi
1322 YY_BREAK
1323 case 78:
1324 YY_RULE_SETUP
1325 #line 151 "Quantity.l"
1326 yylval = Quantity::Watt; return UNIT; // Watt (kg*m^2/s^3)
1327 YY_BREAK
1328 case 79:
1329 YY_RULE_SETUP
1330 #line 152 "Quantity.l"
1331 yylval = Quantity::MilliWatt; return UNIT; // milli Watt
1332 YY_BREAK
1333 case 80:
1334 YY_RULE_SETUP
1335 #line 153 "Quantity.l"
1336 yylval = Quantity::KiloWatt; return UNIT; // kilo Watt
1337 YY_BREAK
1338 case 81:
1339 YY_RULE_SETUP
1340 #line 154 "Quantity.l"
1341 yylval = Quantity::VoltAmpere; return UNIT; // VoltAmpere (kg*m^2/s^3)
1342 YY_BREAK
1343 case 82:
1344 YY_RULE_SETUP
1345 #line 156 "Quantity.l"
1346 yylval = Quantity::Volt; return UNIT; // Volt (kg*m^2/A/s^3)
1347 YY_BREAK
1348 case 83:
1349 YY_RULE_SETUP
1350 #line 157 "Quantity.l"
1351 yylval = Quantity::KiloVolt; return UNIT; // kilo Volt
1352 YY_BREAK
1353 case 84:
1354 YY_RULE_SETUP
1355 #line 158 "Quantity.l"
1356 yylval = Quantity::MilliVolt; return UNIT; // milli Volt
1357 YY_BREAK
1358 case 85:
1359 YY_RULE_SETUP
1360 #line 160 "Quantity.l"
1361 yylval = Quantity::MegaSiemens; return UNIT; // mega Siemens
1362 YY_BREAK
1363 case 86:
1364 YY_RULE_SETUP
1365 #line 161 "Quantity.l"
1366 yylval = Quantity::KiloSiemens; return UNIT; // kilo Siemens
1367 YY_BREAK
1368 case 87:
1369 YY_RULE_SETUP
1370 #line 162 "Quantity.l"
1371 yylval = Quantity::Siemens; return UNIT; // Siemens (A^2*s^3/kg/m^2)
1372 YY_BREAK
1373 case 88:
1374 YY_RULE_SETUP
1375 #line 163 "Quantity.l"
1376 yylval = Quantity::MilliSiemens; return UNIT; // milli Siemens
1377 YY_BREAK
1378 case 89:
1379 YY_RULE_SETUP
1380 #line 164 "Quantity.l"
1381 yylval = Quantity::MicroSiemens; return UNIT; // micro Siemens
1382 YY_BREAK
1383 case 90:
1384 YY_RULE_SETUP
1385 #line 165 "Quantity.l"
1386 yylval = Quantity::MicroSiemens; return UNIT; // micro Siemens
1387 YY_BREAK
1388 case 91:
1389 YY_RULE_SETUP
1390 #line 167 "Quantity.l"
1391 yylval = Quantity::Ohm; return UNIT; // Ohm (kg*m^2/A^2/s^3)
1392 YY_BREAK
1393 case 92:
1394 YY_RULE_SETUP
1395 #line 168 "Quantity.l"
1396 yylval = Quantity::KiloOhm; return UNIT; // kilo Ohm
1397 YY_BREAK
1398 case 93:
1399 YY_RULE_SETUP
1400 #line 169 "Quantity.l"
1401 yylval = Quantity::MegaOhm; return UNIT; // mega Ohm
1402 YY_BREAK
1403 case 94:
1404 YY_RULE_SETUP
1405 #line 171 "Quantity.l"
1406 yylval = Quantity::Coulomb; return UNIT; // Coulomb (A*s)
1407 YY_BREAK
1408 case 95:
1409 YY_RULE_SETUP
1410 #line 173 "Quantity.l"
1411 yylval = Quantity::Tesla; return UNIT; // Tesla (kg/s^2/A)
1412 YY_BREAK
1413 case 96:
1414 YY_RULE_SETUP
1415 #line 174 "Quantity.l"
1416 yylval = Quantity::Gauss; return UNIT; // Gauss (1 G = 1e-4 T)
1417 YY_BREAK
1418 case 97:
1419 YY_RULE_SETUP
1420 #line 176 "Quantity.l"
1421 yylval = Quantity::Weber; return UNIT; // Weber (kg*m^2/s^2/A)
1422 YY_BREAK
1423 case 98:
1424 YY_RULE_SETUP
1425 #line 178 "Quantity.l"
1426 yylval = Quantity::Farad; return UNIT; // Farad (s^4*A^2/m^2/kg)
1427 YY_BREAK
1428 case 99:
1429 YY_RULE_SETUP
1430 #line 179 "Quantity.l"
1431 yylval = Quantity::MilliFarad; return UNIT; // milli Farad
1432 YY_BREAK
1433 case 100:
1434 YY_RULE_SETUP
1435 #line 180 "Quantity.l"
1436 yylval = Quantity::MicroFarad; return UNIT; // micro Farad
1437 YY_BREAK
1438 case 101:
1439 YY_RULE_SETUP
1440 #line 181 "Quantity.l"
1441 yylval = Quantity::MicroFarad; return UNIT; // micro Farad
1442 YY_BREAK
1443 case 102:
1444 YY_RULE_SETUP
1445 #line 182 "Quantity.l"
1446 yylval = Quantity::NanoFarad; return UNIT; // nano Farad
1447 YY_BREAK
1448 case 103:
1449 YY_RULE_SETUP
1450 #line 183 "Quantity.l"
1451 yylval = Quantity::PicoFarad; return UNIT; // pico Farad
1452 YY_BREAK
1453 case 104:
1454 YY_RULE_SETUP
1455 #line 185 "Quantity.l"
1456 yylval = Quantity::Henry; return UNIT; // Henry (kg*m^2/s^2/A^2)
1457 YY_BREAK
1458 case 105:
1459 YY_RULE_SETUP
1460 #line 186 "Quantity.l"
1461 yylval = Quantity::MilliHenry; return UNIT; // milli Henry
1462 YY_BREAK
1463 case 106:
1464 YY_RULE_SETUP
1465 #line 187 "Quantity.l"
1466 yylval = Quantity::MicroHenry; return UNIT; // micro Henry
1467 YY_BREAK
1468 case 107:
1469 YY_RULE_SETUP
1470 #line 188 "Quantity.l"
1471 yylval = Quantity::MicroHenry; return UNIT; // micro Henry
1472 YY_BREAK
1473 case 108:
1474 YY_RULE_SETUP
1475 #line 189 "Quantity.l"
1476 yylval = Quantity::NanoHenry; return UNIT; // nano Henry
1477 YY_BREAK
1478 case 109:
1479 YY_RULE_SETUP
1480 #line 191 "Quantity.l"
1481 yylval = Quantity::Joule; return UNIT; // Joule (kg*m^2/s^2)
1482 YY_BREAK
1483 case 110:
1484 YY_RULE_SETUP
1485 #line 192 "Quantity.l"
1486 yylval = Quantity::MilliJoule; return UNIT; // milli Joule
1487 YY_BREAK
1488 case 111:
1489 YY_RULE_SETUP
1490 #line 193 "Quantity.l"
1491 yylval = Quantity::KiloJoule; return UNIT; // kilo Joule
1492 YY_BREAK
1493 case 112:
1494 YY_RULE_SETUP
1495 #line 194 "Quantity.l"
1496 yylval = Quantity::NewtonMeter; return UNIT; // N*m = Joule
1497 YY_BREAK
1498 case 113:
1499 YY_RULE_SETUP
1500 #line 195 "Quantity.l"
1501 yylval = Quantity::VoltAmpereSecond; return UNIT; // V*A*s = Joule
1502 YY_BREAK
1503 case 114:
1504 YY_RULE_SETUP
1505 #line 196 "Quantity.l"
1506 yylval = Quantity::WattSecond; return UNIT; //
1507 YY_BREAK
1508 case 115:
1509 YY_RULE_SETUP
1510 #line 197 "Quantity.l"
1511 yylval = Quantity::WattSecond; return UNIT; // W*s = Joule
1512 YY_BREAK
1513 case 116:
1514 YY_RULE_SETUP
1515 #line 198 "Quantity.l"
1516 yylval = Quantity::KiloWattHour; return UNIT; // 1 kWh = 3.6e6 J
1517 YY_BREAK
1518 case 117:
1519 YY_RULE_SETUP
1520 #line 199 "Quantity.l"
1521 yylval = Quantity::ElectronVolt; return UNIT; // 1 eV = 1.602176634e-19 J
1522 YY_BREAK
1523 case 118:
1524 YY_RULE_SETUP
1525 #line 200 "Quantity.l"
1526 yylval = Quantity::KiloElectronVolt; return UNIT;
1527 YY_BREAK
1528 case 119:
1529 YY_RULE_SETUP
1530 #line 201 "Quantity.l"
1531 yylval = Quantity::MegaElectronVolt; return UNIT;
1532 YY_BREAK
1533 case 120:
1534 YY_RULE_SETUP
1535 #line 202 "Quantity.l"
1536 yylval = Quantity::Calorie; return UNIT; // 1 cal = 4.1868 J
1537 YY_BREAK
1538 case 121:
1539 YY_RULE_SETUP
1540 #line 203 "Quantity.l"
1541 yylval = Quantity::KiloCalorie; return UNIT;
1542 YY_BREAK
1543 case 122:
1544 YY_RULE_SETUP
1545 #line 205 "Quantity.l"
1546 yylval = Quantity::Degree; return UNIT; // degree (internal standard angle)
1547 YY_BREAK
1548 case 123:
1549 YY_RULE_SETUP
1550 #line 206 "Quantity.l"
1551 yylval = Quantity::Degree; return UNIT; // degree (internal standard angle)
1552 YY_BREAK
1553 case 124:
1554 YY_RULE_SETUP
1555 #line 207 "Quantity.l"
1556 yylval = Quantity::Radian; return UNIT; // radian
1557 YY_BREAK
1558 case 125:
1559 YY_RULE_SETUP
1560 #line 208 "Quantity.l"
1561 yylval = Quantity::Gon; return UNIT; // gon
1562 YY_BREAK
1563 case 126:
1564 YY_RULE_SETUP
1565 #line 209 "Quantity.l"
1566 yylval = Quantity::AngMinute; return UNIT; // minute(Angular)
1567 YY_BREAK
1568 case 127:
1569 YY_RULE_SETUP
1570 #line 210 "Quantity.l"
1571 yylval = Quantity::AngMinute; return UNIT; // minute(Angular)
1572 YY_BREAK
1573 case 128:
1574 YY_RULE_SETUP
1575 #line 211 "Quantity.l"
1576 yylval = Quantity::AngSecond; return UNIT; // second(Angular)
1577 YY_BREAK
1578 case 129:
1579 YY_RULE_SETUP
1580 #line 212 "Quantity.l"
1581 yylval = Quantity::AngSecond; return UNIT; // second(Angular)
1582 YY_BREAK
1583 case 130:
1584 YY_RULE_SETUP
1585 #line 214 "Quantity.l"
1586 yylval = Quantity(1.0); return ONE;
1587 YY_BREAK
1588 case 131:
1589 YY_RULE_SETUP
1590 #line 215 "Quantity.l"
1591 yylval = Quantity(num_change(yytext,'.',',')); return NUM;
1592 YY_BREAK
1593 case 132:
1594 YY_RULE_SETUP
1595 #line 216 "Quantity.l"
1596 yylval = Quantity(num_change(yytext,'.',',')); return NUM;
1597 YY_BREAK
1598 case 133:
1599 YY_RULE_SETUP
1600 #line 217 "Quantity.l"
1601 yylval = Quantity(num_change(yytext,',','.')); return NUM;
1602 YY_BREAK
1603 case 134:
1604 YY_RULE_SETUP
1605 #line 218 "Quantity.l"
1606 yylval = Quantity(num_change(yytext,',','.')); return NUM;
1607 YY_BREAK
1608 case 135:
1609 YY_RULE_SETUP
1610 #line 220 "Quantity.l"
1611 yylval = Quantity(std::numbers::pi); return NUM; // constant pi
1612 YY_BREAK
1613 case 136:
1614 YY_RULE_SETUP
1615 #line 221 "Quantity.l"
1616 yylval = Quantity(std::numbers::e); return NUM; // constant e
1617 YY_BREAK
1618 case 137:
1619 YY_RULE_SETUP
1620 #line 223 "Quantity.l"
1621 return ACOS;
1622 YY_BREAK
1623 case 138:
1624 YY_RULE_SETUP
1625 #line 224 "Quantity.l"
1626 return ASIN;
1627 YY_BREAK
1628 case 139:
1629 YY_RULE_SETUP
1630 #line 225 "Quantity.l"
1631 return ATAN;
1632 YY_BREAK
1633 case 140:
1634 YY_RULE_SETUP
1635 #line 226 "Quantity.l"
1636 return ATAN2;
1637 YY_BREAK
1638 case 141:
1639 YY_RULE_SETUP
1640 #line 227 "Quantity.l"
1641 return COS;
1642 YY_BREAK
1643 case 142:
1644 YY_RULE_SETUP
1645 #line 228 "Quantity.l"
1646 return EXP;
1647 YY_BREAK
1648 case 143:
1649 YY_RULE_SETUP
1650 #line 229 "Quantity.l"
1651 return ABS;
1652 YY_BREAK
1653 case 144:
1654 YY_RULE_SETUP
1655 #line 230 "Quantity.l"
1656 return MOD;
1657 YY_BREAK
1658 case 145:
1659 YY_RULE_SETUP
1660 #line 231 "Quantity.l"
1661 return LOG;
1662 YY_BREAK
1663 case 146:
1664 YY_RULE_SETUP
1665 #line 232 "Quantity.l"
1666 return LOG10;
1667 YY_BREAK
1668 case 147:
1669 YY_RULE_SETUP
1670 #line 233 "Quantity.l"
1671 return POW;
1672 YY_BREAK
1673 case 148:
1674 YY_RULE_SETUP
1675 #line 234 "Quantity.l"
1676 return SIN;
1677 YY_BREAK
1678 case 149:
1679 YY_RULE_SETUP
1680 #line 235 "Quantity.l"
1681 return SINH;
1682 YY_BREAK
1683 case 150:
1684 YY_RULE_SETUP
1685 #line 236 "Quantity.l"
1686 return TAN;
1687 YY_BREAK
1688 case 151:
1689 YY_RULE_SETUP
1690 #line 237 "Quantity.l"
1691 return TANH;
1692 YY_BREAK
1693 case 152:
1694 YY_RULE_SETUP
1695 #line 238 "Quantity.l"
1696 return SQRT;
1697 YY_BREAK
1698 case 153:
1699 YY_RULE_SETUP
1700 #line 240 "Quantity.l"
1701 return *yytext;
1702 YY_BREAK
1703 case 154:
1704 YY_RULE_SETUP
1705 #line 241 "Quantity.l"
1706 ECHO;
1707 YY_BREAK
1708 #line 1706 "Quantity.lex.c"
1709 case YY_STATE_EOF(INITIAL):
1710 case YY_STATE_EOF(C_COMMENT):
1711 yyterminate();
1712
1713 case YY_END_OF_BUFFER:
1714 {
1715 /* Amount of text matched not including the EOB char. */
1716 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
1717
1718 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1719 *yy_cp = (yy_hold_char);
1720 YY_RESTORE_YY_MORE_OFFSET
1721
1722 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1723 {
1724 /* We're scanning a new file or input source. It's
1725 * possible that this happened because the user
1726 * just pointed yyin at a new source and called
1727 * yylex(). If so, then we have to assure
1728 * consistency between YY_CURRENT_BUFFER and our
1729 * globals. Here is the right place to do so, because
1730 * this is the first action (other than possibly a
1731 * back-up) that will match for the new input source.
1732 */
1733 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1734 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
1735 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1736 }
1737
1738 /* Note that here we test for yy_c_buf_p "<=" to the position
1739 * of the first EOB in the buffer, since yy_c_buf_p will
1740 * already have been incremented past the NUL character
1741 * (since all states make transitions on EOB to the
1742 * end-of-buffer state). Contrast this with the test
1743 * in input().
1744 */
1745 if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1746 { /* This was really a NUL. */
1747 yy_state_type yy_next_state;
1748
1749 (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
1750
1751 yy_current_state = yy_get_previous_state( );
1752
1753 /* Okay, we're now positioned to make the NUL
1754 * transition. We couldn't have
1755 * yy_get_previous_state() go ahead and do it
1756 * for us because it doesn't know how to deal
1757 * with the possibility of jamming (and we don't
1758 * want to build jamming into it because then it
1759 * will run more slowly).
1760 */
1761
1762 yy_next_state = yy_try_NUL_trans( yy_current_state );
1763
1764 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1765
1766 if ( yy_next_state )
1767 {
1768 /* Consume the NUL. */
1769 yy_cp = ++(yy_c_buf_p);
1770 yy_current_state = yy_next_state;
1771 goto yy_match;
1772 }
1773
1774 else
1775 {
1776 yy_cp = (yy_last_accepting_cpos);
1777 yy_current_state = (yy_last_accepting_state);
1778 goto yy_find_action;
1779 }
1780 }
1781
1782 else switch ( yy_get_next_buffer( ) )
1783 {
1784 case EOB_ACT_END_OF_FILE:
1785 {
1786 (yy_did_buffer_switch_on_eof) = 0;
1787
1788 if ( yywrap( ) )
1789 {
1790 /* Note: because we've taken care in
1791 * yy_get_next_buffer() to have set up
1792 * yytext, we can now set up
1793 * yy_c_buf_p so that if some total
1794 * hoser (like flex itself) wants to
1795 * call the scanner after we return the
1796 * YY_NULL, it'll still work - another
1797 * YY_NULL will get returned.
1798 */
1799 (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
1800
1801 yy_act = YY_STATE_EOF(YY_START);
1802 goto do_action;
1803 }
1804
1805 else
1806 {
1807 if ( ! (yy_did_buffer_switch_on_eof) )
1808 YY_NEW_FILE;
1809 }
1810 break;
1811 }
1812
1813 case EOB_ACT_CONTINUE_SCAN:
1814 (yy_c_buf_p) =
1815 (yytext_ptr) + yy_amount_of_matched_text;
1816
1817 yy_current_state = yy_get_previous_state( );
1818
1819 yy_cp = (yy_c_buf_p);
1820 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1821 goto yy_match;
1822
1823 case EOB_ACT_LAST_MATCH:
1824 (yy_c_buf_p) =
1825 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
1826
1827 yy_current_state = yy_get_previous_state( );
1828
1829 yy_cp = (yy_c_buf_p);
1830 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1831 goto yy_find_action;
1832 }
1833 break;
1834 }
1835
1836 default:
1837 YY_FATAL_ERROR(
1838 "fatal flex scanner internal error--no action found" );
1839 } /* end of action switch */
1840 } /* end of scanning one token */
1841 } /* end of user's declarations */
1842 } /* end of yylex */
1843
1844 /* yy_get_next_buffer - try to read in a new buffer
1845 *
1846 * Returns a code representing an action:
1847 * EOB_ACT_LAST_MATCH -
1848 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1849 * EOB_ACT_END_OF_FILE - end of file
1850 */
1851 static int yy_get_next_buffer (void)
1852 {
1853 char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1854 char *source = (yytext_ptr);
1855 int number_to_move, i;
1856 int ret_val;
1857
1858 if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
1859 YY_FATAL_ERROR(
1860 "fatal flex scanner internal error--end of buffer missed" );
1861
1862 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1863 { /* Don't try to fill the buffer, so this is an EOF. */
1864 if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
1865 {
1866 /* We matched a single character, the EOB, so
1867 * treat this as a final EOF.
1868 */
1869 return EOB_ACT_END_OF_FILE;
1870 }
1871
1872 else
1873 {
1874 /* We matched some text prior to the EOB, first
1875 * process it.
1876 */
1877 return EOB_ACT_LAST_MATCH;
1878 }
1879 }
1880
1881 /* Try to read more data. */
1882
1883 /* First move last chars to start of buffer. */
1884 number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr) - 1);
1885
1886 for ( i = 0; i < number_to_move; ++i )
1887 *(dest++) = *(source++);
1888
1889 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1890 /* don't do the read, it's not guaranteed to return an EOF,
1891 * just force an EOF
1892 */
1893 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1894
1895 else
1896 {
1897 int num_to_read =
1898 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1899
1900 while ( num_to_read <= 0 )
1901 { /* Not enough room in the buffer - grow it. */
1902
1903 /* just a shorter name for the current buffer */
1904 YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
1905
1906 int yy_c_buf_p_offset =
1907 (int) ((yy_c_buf_p) - b->yy_ch_buf);
1908
1909 if ( b->yy_is_our_buffer )
1910 {
1911 int new_size = b->yy_buf_size * 2;
1912
1913 if ( new_size <= 0 )
1914 b->yy_buf_size += b->yy_buf_size / 8;
1915 else
1916 b->yy_buf_size *= 2;
1917
1918 b->yy_ch_buf = (char *)
1919 /* Include room in for 2 EOB chars. */
1920 yyrealloc( (void *) b->yy_ch_buf,
1921 (yy_size_t) (b->yy_buf_size + 2) );
1922 }
1923 else
1924 /* Can't grow it, we don't own it. */
1925 b->yy_ch_buf = NULL;
1926
1927 if ( ! b->yy_ch_buf )
1928 YY_FATAL_ERROR(
1929 "fatal error - scanner input buffer overflow" );
1930
1931 (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1932
1933 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1934 number_to_move - 1;
1935
1936 }
1937
1938 if ( num_to_read > YY_READ_BUF_SIZE )
1939 num_to_read = YY_READ_BUF_SIZE;
1940
1941 /* Read in more data. */
1942 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1943 (yy_n_chars), num_to_read );
1944
1945 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1946 }
1947
1948 if ( (yy_n_chars) == 0 )
1949 {
1950 if ( number_to_move == YY_MORE_ADJ )
1951 {
1952 ret_val = EOB_ACT_END_OF_FILE;
1953 yyrestart( yyin );
1954 }
1955
1956 else
1957 {
1958 ret_val = EOB_ACT_LAST_MATCH;
1959 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1960 YY_BUFFER_EOF_PENDING;
1961 }
1962 }
1963
1964 else
1965 ret_val = EOB_ACT_CONTINUE_SCAN;
1966
1967 if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1968 /* Extend the array by 50%, plus the number we really need. */
1969 int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
1970 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc(
1971 (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size );
1972 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1973 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1974 /* "- 2" to take care of EOB's */
1975 YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2);
1976 }
1977
1978 (yy_n_chars) += number_to_move;
1979 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1980 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
1981
1982 (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1983
1984 return ret_val;
1985 }
1986
1987 /* yy_get_previous_state - get the state just before the EOB char was reached */
1988
1989 static yy_state_type yy_get_previous_state (void)
1990 {
1991 yy_state_type yy_current_state;
1992 char *yy_cp;
1993
1994 yy_current_state = (yy_start);
1995
1996 for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1997 {
1998 YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1999 if ( yy_accept[yy_current_state] )
2000 {
2001 (yy_last_accepting_state) = yy_current_state;
2002 (yy_last_accepting_cpos) = yy_cp;
2003 }
2004 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
2005 {
2006 yy_current_state = (int) yy_def[yy_current_state];
2007 if ( yy_current_state >= 265 )
2008 yy_c = yy_meta[yy_c];
2009 }
2010 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
2011 }
2012
2013 return yy_current_state;
2014 }
2015
2016 /* yy_try_NUL_trans - try to make a transition on the NUL character
2017 *
2018 * synopsis
2019 * next_state = yy_try_NUL_trans( current_state );
2020 */
2021 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
2022 {
2023 int yy_is_jam;
2024 char *yy_cp = (yy_c_buf_p);
2025
2026 YY_CHAR yy_c = 1;
2027 if ( yy_accept[yy_current_state] )
2028 {
2029 (yy_last_accepting_state) = yy_current_state;
2030 (yy_last_accepting_cpos) = yy_cp;
2031 }
2032 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
2033 {
2034 yy_current_state = (int) yy_def[yy_current_state];
2035 if ( yy_current_state >= 265 )
2036 yy_c = yy_meta[yy_c];
2037 }
2038 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
2039 yy_is_jam = (yy_current_state == 264);
2040
2041 return yy_is_jam ? 0 : yy_current_state;
2042 }
2043
2044 #ifndef YY_NO_UNPUT
2045
2046 #endif
2047
2048 #ifndef YY_NO_INPUT
2049 #ifdef __cplusplus
2050 static int yyinput (void)
2051 #else
2052 static int input (void)
2053 #endif
2054
2055 {
2056 int c;
2057
2058 *(yy_c_buf_p) = (yy_hold_char);
2059
2060 if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
2061 {
2062 /* yy_c_buf_p now points to the character we want to return.
2063 * If this occurs *before* the EOB characters, then it's a
2064 * valid NUL; if not, then we've hit the end of the buffer.
2065 */
2066 if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
2067 /* This was really a NUL. */
2068 *(yy_c_buf_p) = '\0';
2069
2070 else
2071 { /* need more input */
2072 int offset = (int) ((yy_c_buf_p) - (yytext_ptr));
2073 ++(yy_c_buf_p);
2074
2075 switch ( yy_get_next_buffer( ) )
2076 {
2077 case EOB_ACT_LAST_MATCH:
2078 /* This happens because yy_g_n_b()
2079 * sees that we've accumulated a
2080 * token and flags that we need to
2081 * try matching the token before
2082 * proceeding. But for input(),
2083 * there's no matching to consider.
2084 * So convert the EOB_ACT_LAST_MATCH
2085 * to EOB_ACT_END_OF_FILE.
2086 */
2087
2088 /* Reset buffer status. */
2089 yyrestart( yyin );
2090
2091 /*FALLTHROUGH*/
2092
2093 case EOB_ACT_END_OF_FILE:
2094 {
2095 if ( yywrap( ) )
2096 return 0;
2097
2098 if ( ! (yy_did_buffer_switch_on_eof) )
2099 YY_NEW_FILE;
2100 #ifdef __cplusplus
2101 return yyinput();
2102 #else
2103 return input();
2104 #endif
2105 }
2106
2107 case EOB_ACT_CONTINUE_SCAN:
2108 (yy_c_buf_p) = (yytext_ptr) + offset;
2109 break;
2110 }
2111 }
2112 }
2113
2114 c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
2115 *(yy_c_buf_p) = '\0'; /* preserve yytext */
2116 (yy_hold_char) = *++(yy_c_buf_p);
2117
2118 return c;
2119 }
2120 #endif /* ifndef YY_NO_INPUT */
2121
2122 /** Immediately switch to a different input stream.
2123 * @param input_file A readable stream.
2124 *
2125 * @note This function does not reset the start condition to @c INITIAL .
2126 */
2127 void yyrestart (FILE * input_file )
2128 {
2129
2130 if ( ! YY_CURRENT_BUFFER ){
2131 yyensure_buffer_stack ();
2132 YY_CURRENT_BUFFER_LVALUE =
2133 yy_create_buffer( yyin, YY_BUF_SIZE );
2134 }
2135
2136 yy_init_buffer( YY_CURRENT_BUFFER, input_file );
2137 yy_load_buffer_state( );
2138 }
2139
2140 /** Switch to a different input buffer.
2141 * @param new_buffer The new input buffer.
2142 *
2143 */
2144 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer )
2145 {
2146
2147 /* TODO. We should be able to replace this entire function body
2148 * with
2149 * yypop_buffer_state();
2150 * yypush_buffer_state(new_buffer);
2151 */
2152 yyensure_buffer_stack ();
2153 if ( YY_CURRENT_BUFFER == new_buffer )
2154 return;
2155
2156 if ( YY_CURRENT_BUFFER )
2157 {
2158 /* Flush out information for old buffer. */
2159 *(yy_c_buf_p) = (yy_hold_char);
2160 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
2161 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
2162 }
2163
2164 YY_CURRENT_BUFFER_LVALUE = new_buffer;
2165 yy_load_buffer_state( );
2166
2167 /* We don't actually know whether we did this switch during
2168 * EOF (yywrap()) processing, but the only time this flag
2169 * is looked at is after yywrap() is called, so it's safe
2170 * to go ahead and always set it.
2171 */
2172 (yy_did_buffer_switch_on_eof) = 1;
2173 }
2174
2175 static void yy_load_buffer_state (void)
2176 {
2177 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
2178 (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
2179 yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
2180 (yy_hold_char) = *(yy_c_buf_p);
2181 }
2182
2183 /** Allocate and initialize an input buffer state.
2184 * @param file A readable stream.
2185 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
2186 *
2187 * @return the allocated buffer state.
2188 */
2189 YY_BUFFER_STATE yy_create_buffer (FILE * file, int size )
2190 {
2191 YY_BUFFER_STATE b;
2192
2193 b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) );
2194 if ( ! b )
2195 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
2196
2197 b->yy_buf_size = size;
2198
2199 /* yy_ch_buf has to be 2 characters longer than the size given because
2200 * we need to put in 2 end-of-buffer characters.
2201 */
2202 b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) );
2203 if ( ! b->yy_ch_buf )
2204 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
2205
2206 b->yy_is_our_buffer = 1;
2207
2208 yy_init_buffer( b, file );
2209
2210 return b;
2211 }
2212
2213 /** Destroy the buffer.
2214 * @param b a buffer created with yy_create_buffer()
2215 *
2216 */
2217 void yy_delete_buffer (YY_BUFFER_STATE b )
2218 {
2219
2220 if ( ! b )
2221 return;
2222
2223 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
2224 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
2225
2226 if ( b->yy_is_our_buffer )
2227 yyfree( (void *) b->yy_ch_buf );
2228
2229 yyfree( (void *) b );
2230 }
2231
2232 /* Initializes or reinitializes a buffer.
2233 * This function is sometimes called more than once on the same buffer,
2234 * such as during a yyrestart() or at EOF.
2235 */
2236 static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file )
2237
2238 {
2239 int oerrno = errno;
2240
2241 yy_flush_buffer( b );
2242
2243 b->yy_input_file = file;
2244 b->yy_fill_buffer = 1;
2245
2246 /* If b is the current buffer, then yy_init_buffer was _probably_
2247 * called from yyrestart() or through yy_get_next_buffer.
2248 * In that case, we don't want to reset the lineno or column.
2249 */
2250 if (b != YY_CURRENT_BUFFER){
2251 b->yy_bs_lineno = 1;
2252 b->yy_bs_column = 0;
2253 }
2254
2255 b->yy_is_interactive = 0;
2256
2257 errno = oerrno;
2258 }
2259
2260 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
2261 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
2262 *
2263 */
2264 void yy_flush_buffer (YY_BUFFER_STATE b )
2265 {
2266 if ( ! b )
2267 return;
2268
2269 b->yy_n_chars = 0;
2270
2271 /* We always need two end-of-buffer characters. The first causes
2272 * a transition to the end-of-buffer state. The second causes
2273 * a jam in that state.
2274 */
2275 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
2276 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
2277
2278 b->yy_buf_pos = &b->yy_ch_buf[0];
2279
2280 b->yy_at_bol = 1;
2281 b->yy_buffer_status = YY_BUFFER_NEW;
2282
2283 if ( b == YY_CURRENT_BUFFER )
2284 yy_load_buffer_state( );
2285 }
2286
2287 /** Pushes the new state onto the stack. The new state becomes
2288 * the current state. This function will allocate the stack
2289 * if necessary.
2290 * @param new_buffer The new state.
2291 *
2292 */
2293 void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
2294 {
2295 if (new_buffer == NULL)
2296 return;
2297
2298 yyensure_buffer_stack();
2299
2300 /* This block is copied from yy_switch_to_buffer. */
2301 if ( YY_CURRENT_BUFFER )
2302 {
2303 /* Flush out information for old buffer. */
2304 *(yy_c_buf_p) = (yy_hold_char);
2305 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
2306 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
2307 }
2308
2309 /* Only push if top exists. Otherwise, replace top. */
2310 if (YY_CURRENT_BUFFER)
2311 (yy_buffer_stack_top)++;
2312 YY_CURRENT_BUFFER_LVALUE = new_buffer;
2313
2314 /* copied from yy_switch_to_buffer. */
2315 yy_load_buffer_state( );
2316 (yy_did_buffer_switch_on_eof) = 1;
2317 }
2318
2319 /** Removes and deletes the top of the stack, if present.
2320 * The next element becomes the new top.
2321 *
2322 */
2323 void yypop_buffer_state (void)
2324 {
2325 if (!YY_CURRENT_BUFFER)
2326 return;
2327
2328 yy_delete_buffer(YY_CURRENT_BUFFER );
2329 YY_CURRENT_BUFFER_LVALUE = NULL;
2330 if ((yy_buffer_stack_top) > 0)
2331 --(yy_buffer_stack_top);
2332
2333 if (YY_CURRENT_BUFFER) {
2334 yy_load_buffer_state( );
2335 (yy_did_buffer_switch_on_eof) = 1;
2336 }
2337 }
2338
2339 /* Allocates the stack if it does not exist.
2340 * Guarantees space for at least one push.
2341 */
2342 static void yyensure_buffer_stack (void)
2343 {
2344 yy_size_t num_to_alloc;
2345
2346 if (!(yy_buffer_stack)) {
2347
2348 /* First allocation is just for 2 elements, since we don't know if this
2349 * scanner will even need a stack. We use 2 instead of 1 to avoid an
2350 * immediate realloc on the next call.
2351 */
2352 num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
2353 (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
2354 (num_to_alloc * sizeof(struct yy_buffer_state*)
2355 );
2356 if ( ! (yy_buffer_stack) )
2357 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
2358
2359 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
2360
2361 (yy_buffer_stack_max) = num_to_alloc;
2362 (yy_buffer_stack_top) = 0;
2363 return;
2364 }
2365
2366 if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
2367
2368 /* Increase the buffer to prepare for a possible push. */
2369 yy_size_t grow_size = 8 /* arbitrary grow size */;
2370
2371 num_to_alloc = (yy_buffer_stack_max) + grow_size;
2372 (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
2373 ((yy_buffer_stack),
2374 num_to_alloc * sizeof(struct yy_buffer_state*)
2375 );
2376 if ( ! (yy_buffer_stack) )
2377 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
2378
2379 /* zero only the new slots.*/
2380 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
2381 (yy_buffer_stack_max) = num_to_alloc;
2382 }
2383 }
2384
2385 /** Setup the input buffer state to scan directly from a user-specified character buffer.
2386 * @param base the character buffer
2387 * @param size the size in bytes of the character buffer
2388 *
2389 * @return the newly allocated buffer state object.
2390 */
2391 YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size )
2392 {
2393 YY_BUFFER_STATE b;
2394
2395 if ( size < 2 ||
2396 base[size-2] != YY_END_OF_BUFFER_CHAR ||
2397 base[size-1] != YY_END_OF_BUFFER_CHAR )
2398 /* They forgot to leave room for the EOB's. */
2399 return NULL;
2400
2401 b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) );
2402 if ( ! b )
2403 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
2404
2405 b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */
2406 b->yy_buf_pos = b->yy_ch_buf = base;
2407 b->yy_is_our_buffer = 0;
2408 b->yy_input_file = NULL;
2409 b->yy_n_chars = b->yy_buf_size;
2410 b->yy_is_interactive = 0;
2411 b->yy_at_bol = 1;
2412 b->yy_fill_buffer = 0;
2413 b->yy_buffer_status = YY_BUFFER_NEW;
2414
2415 yy_switch_to_buffer( b );
2416
2417 return b;
2418 }
2419
2420 /** Setup the input buffer state to scan a string. The next call to yylex() will
2421 * scan from a @e copy of @a str.
2422 * @param yystr a NUL-terminated string to scan
2423 *
2424 * @return the newly allocated buffer state object.
2425 * @note If you want to scan bytes that may contain NUL values, then use
2426 * yy_scan_bytes() instead.
2427 */
2428 YY_BUFFER_STATE yy_scan_string (const char * yystr )
2429 {
2430
2431 return yy_scan_bytes( yystr, (int) strlen(yystr) );
2432 }
2433
2434 /** Setup the input buffer state to scan the given bytes. The next call to yylex() will
2435 * scan from a @e copy of @a bytes.
2436 * @param yybytes the byte buffer to scan
2437 * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
2438 *
2439 * @return the newly allocated buffer state object.
2440 */
2441 YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len )
2442 {
2443 YY_BUFFER_STATE b;
2444 char *buf;
2445 yy_size_t n;
2446 int i;
2447
2448 /* Get memory for full buffer, including space for trailing EOB's. */
2449 n = (yy_size_t) (_yybytes_len + 2);
2450 buf = (char *) yyalloc( n );
2451 if ( ! buf )
2452 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
2453
2454 for ( i = 0; i < _yybytes_len; ++i )
2455 buf[i] = yybytes[i];
2456
2457 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
2458
2459 b = yy_scan_buffer( buf, n );
2460 if ( ! b )
2461 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
2462
2463 /* It's okay to grow etc. this buffer, and we should throw it
2464 * away when we're done.
2465 */
2466 b->yy_is_our_buffer = 1;
2467
2468 return b;
2469 }
2470
2471 #ifndef YY_EXIT_FAILURE
2472 #define YY_EXIT_FAILURE 2
2473 #endif
2474
2475 static void yynoreturn yy_fatal_error (const char* msg )
2476 {
2477 fprintf( stderr, "%s\n", msg );
2478 exit( YY_EXIT_FAILURE );
2479 }
2480
2481 /* Redefine yyless() so it works in section 3 code. */
2482
2483 #undef yyless
2484 #define yyless(n) \
2485 do \
2486 { \
2487 /* Undo effects of setting up yytext. */ \
2488 int yyless_macro_arg = (n); \
2489 YY_LESS_LINENO(yyless_macro_arg);\
2490 yytext[yyleng] = (yy_hold_char); \
2491 (yy_c_buf_p) = yytext + yyless_macro_arg; \
2492 (yy_hold_char) = *(yy_c_buf_p); \
2493 *(yy_c_buf_p) = '\0'; \
2494 yyleng = yyless_macro_arg; \
2495 } \
2496 while ( 0 )
2497
2498 /* Accessor methods (get/set functions) to struct members. */
2499
2500 /** Get the current line number.
2501 *
2502 */
2503 int yyget_lineno (void)
2504 {
2505
2506 return yylineno;
2507 }
2508
2509 /** Get the input stream.
2510 *
2511 */
2512 FILE *yyget_in (void)
2513 {
2514 return yyin;
2515 }
2516
2517 /** Get the output stream.
2518 *
2519 */
2520 FILE *yyget_out (void)
2521 {
2522 return yyout;
2523 }
2524
2525 /** Get the length of the current token.
2526 *
2527 */
2528 int yyget_leng (void)
2529 {
2530 return yyleng;
2531 }
2532
2533 /** Get the current token.
2534 *
2535 */
2536
2537 char *yyget_text (void)
2538 {
2539 return yytext;
2540 }
2541
2542 /** Set the current line number.
2543 * @param _line_number line number
2544 *
2545 */
2546 void yyset_lineno (int _line_number )
2547 {
2548
2549 yylineno = _line_number;
2550 }
2551
2552 /** Set the input stream. This does not discard the current
2553 * input buffer.
2554 * @param _in_str A readable stream.
2555 *
2556 * @see yy_switch_to_buffer
2557 */
2558 void yyset_in (FILE * _in_str )
2559 {
2560 yyin = _in_str ;
2561 }
2562
2563 void yyset_out (FILE * _out_str )
2564 {
2565 yyout = _out_str ;
2566 }
2567
2568 int yyget_debug (void)
2569 {
2570 return yy_flex_debug;
2571 }
2572
2573 void yyset_debug (int _bdebug )
2574 {
2575 yy_flex_debug = _bdebug ;
2576 }
2577
2578 static int yy_init_globals (void)
2579 {
2580 /* Initialization is the same as for the non-reentrant scanner.
2581 * This function is called from yylex_destroy(), so don't allocate here.
2582 */
2583
2584 (yy_buffer_stack) = NULL;
2585 (yy_buffer_stack_top) = 0;
2586 (yy_buffer_stack_max) = 0;
2587 (yy_c_buf_p) = NULL;
2588 (yy_init) = 0;
2589 (yy_start) = 0;
2590
2591 /* Defined in main.c */
2592 #ifdef YY_STDINIT
2593 yyin = stdin;
2594 yyout = stdout;
2595 #else
2596 yyin = NULL;
2597 yyout = NULL;
2598 #endif
2599
2600 /* For future reference: Set errno on error, since we are called by
2601 * yylex_init()
2602 */
2603 return 0;
2604 }
2605
2606 /* yylex_destroy is for both reentrant and non-reentrant scanners. */
2607 int yylex_destroy (void)
2608 {
2609
2610 /* Pop the buffer stack, destroying each element. */
2611 while(YY_CURRENT_BUFFER){
2612 yy_delete_buffer( YY_CURRENT_BUFFER );
2613 YY_CURRENT_BUFFER_LVALUE = NULL;
2614 yypop_buffer_state();
2615 }
2616
2617 /* Destroy the stack itself. */
2618 yyfree((yy_buffer_stack) );
2619 (yy_buffer_stack) = NULL;
2620
2621 /* Reset the globals. This is important in a non-reentrant scanner so the next time
2622 * yylex() is called, initialization will occur. */
2623 yy_init_globals( );
2624
2625 return 0;
2626 }
2627
2628 /*
2629 * Internal utility routines.
2630 */
2631
2632 #ifndef yytext_ptr
2633 static void yy_flex_strncpy (char* s1, const char * s2, int n )
2634 {
2635
2636 int i;
2637 for ( i = 0; i < n; ++i )
2638 s1[i] = s2[i];
2639 }
2640 #endif
2641
2642 #ifdef YY_NEED_STRLEN
2643 static int yy_flex_strlen (const char * s )
2644 {
2645 int n;
2646 for ( n = 0; s[n]; ++n )
2647 ;
2648
2649 return n;
2650 }
2651 #endif
2652
2653 void *yyalloc (yy_size_t size )
2654 {
2655 return malloc(size);
2656 }
2657
2658 void *yyrealloc (void * ptr, yy_size_t size )
2659 {
2660
2661 /* The cast to (char *) in the following accommodates both
2662 * implementations that use char* generic pointers, and those
2663 * that use void* generic pointers. It works with the latter
2664 * because both ANSI C and C++ allow castless assignment from
2665 * any pointer type to void*, and deal with argument conversions
2666 * as though doing an assignment.
2667 */
2668 return realloc(ptr, size);
2669 }
2670
2671 void yyfree (void * ptr )
2672 {
2673 free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
2674 }
2675
2676 #define YYTABLES_NAME "yytables"
2677
2678 #line 241 "Quantity.l"