FrontISTR 5.2.0
Large-scale structural analysis program with finit element method
Loading...
Searching...
No Matches
hecmw_gflex.c
Go to the documentation of this file.
1
2#line 3 "<stdout>"
3
4#define YY_INT_ALIGNED short int
5
6/* A lexical scanner generated by flex */
7
8#define yy_create_buffer HECMW_gf_create_buffer
9#define yy_delete_buffer HECMW_gf_delete_buffer
10#define yy_flex_debug HECMW_gf_flex_debug
11#define yy_init_buffer HECMW_gf_init_buffer
12#define yy_flush_buffer HECMW_gf_flush_buffer
13#define yy_load_buffer_state HECMW_gf_load_buffer_state
14#define yy_switch_to_buffer HECMW_gf_switch_to_buffer
15#define yyin HECMW_gfin
16#define yyleng HECMW_gfleng
17#define yylex HECMW_gflex
18#define yylineno HECMW_gflineno
19#define yyout HECMW_gfout
20#define yyrestart HECMW_gfrestart
21#define yytext HECMW_gftext
22#define yywrap HECMW_gfwrap
23#define yyalloc HECMW_gfalloc
24#define yyrealloc HECMW_gfrealloc
25#define yyfree HECMW_gffree
26
27#define FLEX_SCANNER
28#define YY_FLEX_MAJOR_VERSION 2
29#define YY_FLEX_MINOR_VERSION 5
30#define YY_FLEX_SUBMINOR_VERSION 35
31#if YY_FLEX_SUBMINOR_VERSION > 0
32#define FLEX_BETA
33#endif
34
35/* First, we deal with platform-specific or compiler-specific issues. */
36
37/* begin standard C headers. */
38#include <stdio.h>
39#include <string.h>
40#include <errno.h>
41#include <stdlib.h>
42
43/* end standard C headers. */
44
45/* flex integer type definitions */
46
47#ifndef FLEXINT_H
48#define FLEXINT_H
49
50/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
51
52#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
53
54/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
55 * if you want the limit (max/min) macros for int types.
56 */
57#ifndef __STDC_LIMIT_MACROS
58#define __STDC_LIMIT_MACROS 1
59#endif
60
61#include <inttypes.h>
62typedef int8_t flex_int8_t;
63typedef uint8_t flex_uint8_t;
64typedef int16_t flex_int16_t;
65typedef uint16_t flex_uint16_t;
66typedef int32_t flex_int32_t;
67typedef uint32_t flex_uint32_t;
68typedef uint64_t flex_uint64_t;
69#else
70typedef signed char flex_int8_t;
71typedef short int flex_int16_t;
72typedef int flex_int32_t;
73typedef unsigned char flex_uint8_t;
74typedef unsigned short int flex_uint16_t;
75typedef unsigned int flex_uint32_t;
76#endif /* ! C99 */
77
78/* Limits of integral types. */
79#ifndef INT8_MIN
80#define INT8_MIN (-128)
81#endif
82#ifndef INT16_MIN
83#define INT16_MIN (-32767 - 1)
84#endif
85#ifndef INT32_MIN
86#define INT32_MIN (-2147483647 - 1)
87#endif
88#ifndef INT8_MAX
89#define INT8_MAX (127)
90#endif
91#ifndef INT16_MAX
92#define INT16_MAX (32767)
93#endif
94#ifndef INT32_MAX
95#define INT32_MAX (2147483647)
96#endif
97#ifndef UINT8_MAX
98#define UINT8_MAX (255U)
99#endif
100#ifndef UINT16_MAX
101#define UINT16_MAX (65535U)
102#endif
103#ifndef UINT32_MAX
104#define UINT32_MAX (4294967295U)
105#endif
106
107#endif /* ! FLEXINT_H */
108
109#ifdef __cplusplus
110
111/* The "const" storage-class-modifier is valid. */
112#define YY_USE_CONST
113
114#else /* ! __cplusplus */
115
116/* C99 requires __STDC__ to be defined as 1. */
117#if defined(__STDC__)
118
119#define YY_USE_CONST
120
121#endif /* defined (__STDC__) */
122#endif /* ! __cplusplus */
123
124#ifdef YY_USE_CONST
125#define yyconst const
126#else
127#define yyconst
128#endif
129
130/* Returned upon end-of-file. */
131#define YY_NULL 0
132
133/* Promotes a possibly negative, possibly signed char to an unsigned
134 * integer for use as an array index. If the signed char is negative,
135 * we want to instead treat it as an 8-bit unsigned char, hence the
136 * double cast.
137 */
138#define YY_SC_TO_UI(c) ((unsigned int)(unsigned char)c)
139
140/* Enter a start condition. This macro really ought to take a parameter,
141 * but we do it the disgusting crufty way forced on us by the ()-less
142 * definition of BEGIN.
143 */
144#define BEGIN (yy_start) = 1 + 2 *
145
146/* Translate the current start state into a value that can be later handed
147 * to BEGIN to return to the state. The YYSTATE alias is for lex
148 * compatibility.
149 */
150#define YY_START (((yy_start)-1) / 2)
151#define YYSTATE YY_START
152
153/* Action number for EOF rule of a given start state. */
154#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
155
156/* Special action meaning "start processing a new file". */
157#define YY_NEW_FILE HECMW_gfrestart(HECMW_gfin)
158
159#define YY_END_OF_BUFFER_CHAR 0
160
161/* Size of default input buffer. */
162#ifndef YY_BUF_SIZE
163#define YY_BUF_SIZE 16384
164#endif
165
166/* The state buf must be large enough to hold one state per character in the
167 * main buffer.
168 */
169#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
170
171#ifndef YY_TYPEDEF_YY_BUFFER_STATE
172#define YY_TYPEDEF_YY_BUFFER_STATE
174#endif
175
176#ifndef YY_TYPEDEF_YY_SIZE_T
177#define YY_TYPEDEF_YY_SIZE_T
178typedef size_t yy_size_t;
179#endif
180
182
183extern FILE *HECMW_gfin, *HECMW_gfout;
184
185#define EOB_ACT_CONTINUE_SCAN 0
186#define EOB_ACT_END_OF_FILE 1
187#define EOB_ACT_LAST_MATCH 2
188
189#define YY_LESS_LINENO(n)
190
191/* Return all but the first "n" matched characters back to the input stream. */
192#define yyless(n) \
193 do { \
194 /* Undo effects of setting up HECMW_gftext. */ \
195 int yyless_macro_arg = (n); \
196 YY_LESS_LINENO(yyless_macro_arg); \
197 *yy_cp = (yy_hold_char); \
198 YY_RESTORE_YY_MORE_OFFSET(yy_c_buf_p) = yy_cp = \
199 yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
200 YY_DO_BEFORE_ACTION; /* set up HECMW_gftext again */ \
201 } while (0)
202
203#define unput(c) yyunput(c, (yytext_ptr))
204
205#ifndef YY_STRUCT_YY_BUFFER_STATE
206#define YY_STRUCT_YY_BUFFER_STATE
207struct yy_buffer_state {
208 FILE *yy_input_file;
209
210 char *yy_ch_buf; /* input buffer */
211 char *yy_buf_pos; /* current position in input buffer */
212
213 /* Size of input buffer in bytes, not including room for EOB
214 * characters.
215 */
217
218 /* Number of characters read into yy_ch_buf, not including EOB
219 * characters.
220 */
222
223 /* Whether we "own" the buffer - i.e., we know we created it,
224 * and can realloc() it to grow it, and should free() it to
225 * delete it.
226 */
228
229 /* Whether this is an "interactive" input source; if so, and
230 * if we're using stdio for input, then we want to use getc()
231 * instead of fread(), to make sure we stop fetching input after
232 * each newline.
233 */
235
236 /* Whether we're considered to be at the beginning of a line.
237 * If so, '^' rules will be active on the next match, otherwise
238 * not.
239 */
240 int yy_at_bol;
241
242 int yy_bs_lineno;
243 int yy_bs_column;
245 /* Whether to try to fill the input buffer when we reach the
246 * end of it.
247 */
248 int yy_fill_buffer;
249
251
252#define YY_BUFFER_NEW 0
253#define YY_BUFFER_NORMAL 1
254/* When an EOF's been seen but there's still some text to process
255 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
256 * shouldn't try reading from the input source any more. We might
257 * still have a bunch of tokens to match, though, because of
258 * possible backing-up.
259 *
260 * When we actually see the EOF, we change the status to "new"
261 * (via HECMW_gfrestart()), so that the user can continue scanning by
262 * just pointing HECMW_gfin at a new input file.
263 */
264#define YY_BUFFER_EOF_PENDING 2
265};
266#endif /* !YY_STRUCT_YY_BUFFER_STATE */
267
268/* Stack of input buffers. */
269static size_t yy_buffer_stack_top = 0;
270static size_t yy_buffer_stack_max = 0;
271static YY_BUFFER_STATE *yy_buffer_stack = 0;
273/* We provide macros for accessing buffer states in case in the
274 * future we want to put the buffer states in a more general
275 * "scanner state".
276 *
277 * Returns the top of the stack, or NULL.
278 */
279#define YY_CURRENT_BUFFER \
280 ((yy_buffer_stack) ? (yy_buffer_stack)[(yy_buffer_stack_top)] : NULL)
281
282/* Same as previous macro, but useful when we know that the buffer stack is not
283 * NULL or when we need an lvalue. For internal use only.
284 */
285#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
286
287/* yy_hold_char holds the character lost when HECMW_gftext is formed. */
288static char yy_hold_char;
289static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */
291
292/* Points to current character in buffer. */
293static char *yy_c_buf_p = (char *)0;
294static int yy_init = 0; /* whether we need to initialize */
295static int yy_start = 0; /* start state number */
296
297/* Flag which is used to allow HECMW_gfwrap()'s to do buffer switches
298 * instead of setting up a fresh HECMW_gfin. A bit of a hack ...
299 */
300static int yy_did_buffer_switch_on_eof;
301
302void HECMW_gfrestart(FILE *input_file);
304YY_BUFFER_STATE HECMW_gf_create_buffer(FILE *file, int size);
308void HECMW_gfpop_buffer_state(void);
309
310static void HECMW_gfensure_buffer_stack(void);
311static void HECMW_gf_load_buffer_state(void);
312static void HECMW_gf_init_buffer(YY_BUFFER_STATE b, FILE *file);
313
314#define YY_FLUSH_BUFFER HECMW_gf_flush_buffer(YY_CURRENT_BUFFER)
315
319
321void *HECMW_gfrealloc(void *, yy_size_t);
322void HECMW_gffree(void *);
323
324#define yy_new_buffer HECMW_gf_create_buffer
325
326#define yy_set_interactive(is_interactive) \
327 { \
328 if (!YY_CURRENT_BUFFER) { \
329 HECMW_gfensure_buffer_stack(); \
330 YY_CURRENT_BUFFER_LVALUE = \
331 HECMW_gf_create_buffer(HECMW_gfin, YY_BUF_SIZE); \
332 } \
333 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
334 }
335
336#define yy_set_bol(at_bol) \
337 { \
338 if (!YY_CURRENT_BUFFER) { \
339 HECMW_gfensure_buffer_stack(); \
340 YY_CURRENT_BUFFER_LVALUE = \
341 HECMW_gf_create_buffer(HECMW_gfin, YY_BUF_SIZE); \
342 } \
343 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
344 }
345
346#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
347
348/* Begin user sect3 */
349
350typedef unsigned char YY_CHAR;
351
352FILE *HECMW_gfin = (FILE *)0, *HECMW_gfout = (FILE *)0;
353
354typedef int yy_state_type;
355
356extern int HECMW_gflineno;
357
359
360extern char *HECMW_gftext;
361#define yytext_ptr HECMW_gftext
362
363static yy_state_type yy_get_previous_state(void);
364static yy_state_type yy_try_NUL_trans(yy_state_type current_state);
365static int yy_get_next_buffer(void);
366static void yy_fatal_error(yyconst char msg[]);
367
368/* Done after the current pattern has been matched and before the
369 * corresponding action - sets up HECMW_gftext.
370 */
371#define YY_DO_BEFORE_ACTION \
372 (yytext_ptr) = yy_bp; \
373 HECMW_gfleng = (yy_size_t)(yy_cp - yy_bp); \
374 (yy_hold_char) = *yy_cp; \
375 *yy_cp = '\0'; \
376 (yy_c_buf_p) = yy_cp;
377
378#define YY_NUM_RULES 9
379#define YY_END_OF_BUFFER 10
380/* This struct is not used in this scanner,
381 but its presence is necessary. */
382struct yy_trans_info {
385};
386static yyconst flex_int16_t yy_accept[28] = {0, 0, 0, 10, 8, 3, 4, 8, 2, 8,
387 6, 5, 7, 2, 3, 4, 2, 6, 5, 6,
388 0, 7, 2, 1, 2, 0, 6, 0};
389
390static yyconst flex_int32_t yy_ec[256] = {
391 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 4, 1, 1, 1, 1, 1,
392 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 5, 1, 6, 1, 1,
393 1, 1, 1, 1, 1, 7, 1, 8, 9, 1, 10, 10, 10, 10, 10, 10, 10, 10, 10,
394 10, 1, 1, 1, 1, 1, 1, 1, 11, 11, 11, 11, 12, 11, 11, 11, 11, 11, 11,
395 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 1, 1, 1, 1,
396 11, 1, 11, 11, 11, 11,
397
398 12, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
399 11, 11, 11, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
400 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
401 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
402 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
403 1, 1, 1, 1, 1,
404
405 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
406 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
407 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1};
408
409static yyconst flex_int32_t yy_meta[13] = {0, 1, 1, 2, 1, 1, 1,
410 3, 4, 1, 4, 5, 5};
411
412static yyconst flex_int16_t yy_base[32] = {
413 0, 0, 8, 44, 45, 41, 45, 39, 0, 6, 7, 0, 0, 17, 39, 45,
414 0, 0, 0, 0, 30, 0, 19, 45, 21, 17, 8, 45, 25, 27, 32, 35};
415
416static yyconst flex_int16_t yy_def[32] = {
417 0, 27, 1, 27, 27, 27, 27, 27, 28, 27, 27, 9, 29, 30, 27, 27,
418 28, 10, 9, 10, 31, 29, 30, 27, 30, 27, 27, 0, 27, 27, 27, 27};
419
420static yyconst flex_int16_t yy_nxt[58] = {
421 0, 4, 5, 6, 7, 8, 8, 9, 9, 10, 11, 12, 12, 13, 13,
422 17, 18, 19, 26, 20, 23, 24, 23, 24, 23, 24, 16, 26, 16, 16,
423 16, 21, 21, 22, 22, 22, 22, 22, 25, 25, 26, 14, 15, 14, 27,
424 3, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27};
425
426static yyconst flex_int16_t yy_chk[58] = {
427 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2,
428 9, 9, 10, 26, 10, 13, 13, 22, 22, 24, 24, 28, 25, 28, 28,
429 28, 29, 29, 30, 30, 30, 30, 30, 31, 31, 20, 14, 7, 5, 3,
430 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27};
431
432static yy_state_type yy_last_accepting_state;
433static char *yy_last_accepting_cpos;
434
435extern int HECMW_gf_flex_debug;
437
438/* The intent behind this definition is that it'll catch
439 * any uses of REJECT which flex missed.
440 */
441#define REJECT reject_used_but_not_detected
442#define yymore() yymore_used_but_not_detected
443#define YY_MORE_ADJ 0
444#define YY_RESTORE_YY_MORE_OFFSET
446#line 1 "../src/common/hecmw_gflex.l"
447#line 2 "../src/common/hecmw_gflex.l"
448#include <string.h>
449#include "hecmw_gflex.h"
450#include "hecmw_util.h"
451
452typedef union {
453 double dval;
454 char *str;
455} YYSTYPE;
456
457static YYSTYPE yylval;
458static int lineno;
459static long len = 0;
460
461#line 502 "<stdout>"
462
463#define INITIAL 0
464
465#ifndef YY_NO_UNISTD_H
466/* Special case for "unistd.h", since it is non-ANSI. We include it way
467 * down here because we want the user's section 1 to have been scanned first.
468 * The user has a chance to override it with an option.
469 */
470#include <unistd.h>
471#endif
472
473#ifndef YY_EXTRA_TYPE
474#define YY_EXTRA_TYPE void *
475#endif
476
477static int yy_init_globals(void);
478
479/* Accessor methods to globals.
480 These are made visible to non-reentrant scanners for convenience. */
481
482int HECMW_gflex_destroy(void);
483
484int HECMW_gfget_debug(void);
485
486void HECMW_gfset_debug(int debug_flag);
487
489
491
492FILE *HECMW_gfget_in(void);
493
494void HECMW_gfset_in(FILE *in_str);
495
496FILE *HECMW_gfget_out(void);
497
498void HECMW_gfset_out(FILE *out_str);
499
501
502char *HECMW_gfget_text(void);
503
504int HECMW_gfget_lineno(void);
505
506void HECMW_gfset_lineno(int line_number);
507
508/* Macros after this point can all be overridden by user definitions in
509 * section 1.
510 */
511
512#ifndef YY_SKIP_YYWRAP
513#ifdef __cplusplus
514extern "C" int HECMW_gfwrap(void);
515#else
516extern int HECMW_gfwrap(void);
517#endif
518#endif
519
520#ifndef yytext_ptr
521static void yy_flex_strncpy(char *, yyconst char *, int);
522#endif
523
524#ifdef YY_NEED_STRLEN
525static int yy_flex_strlen(yyconst char *);
526#endif
527
528#ifndef YY_NO_INPUT
529
530#ifdef __cplusplus
531static int yyinput(void);
532#else
533static int input(void);
534#endif
535
536#endif
537
538/* Amount of stuff to slurp up with each read. */
539#ifndef YY_READ_BUF_SIZE
540#define YY_READ_BUF_SIZE 8192
541#endif
542
543/* Copy whatever the last rule matched to the standard output. */
544#ifndef ECHO
545/* This used to be an fputs(), but since the string might contain NUL's,
546 * we now use fwrite().
547 */
548#define ECHO fwrite(HECMW_gftext, HECMW_gfleng, 1, HECMW_gfout)
549#endif
550
551/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
552 * is returned in "result".
553 */
554#ifndef YY_INPUT
555#define YY_INPUT(buf, result, max_size) \
556 if (YY_CURRENT_BUFFER_LVALUE->yy_is_interactive) { \
557 int c = '*'; \
558 yy_size_t n; \
559 for (n = 0; n < max_size && (c = getc(HECMW_gfin)) != EOF && c != '\n'; \
560 ++n) \
561 buf[n] = (char)c; \
562 if (c == '\n') buf[n++] = (char)c; \
563 if (c == EOF && ferror(HECMW_gfin)) \
564 YY_FATAL_ERROR("input in flex scanner failed"); \
565 result = n; \
566 } else { \
567 errno = 0; \
568 while ((result = fread(buf, 1, max_size, HECMW_gfin)) == 0 && \
569 ferror(HECMW_gfin)) { \
570 if (errno != EINTR) { \
571 YY_FATAL_ERROR("input in flex scanner failed"); \
572 break; \
573 } \
574 errno = 0; \
575 clearerr(HECMW_gfin); \
576 } \
577 }
578
579#endif
580
581/* No semi-colon after return; correct usage is to write "yyterminate();" -
582 * we don't want an extra ';' after the "return" because that will cause
583 * some compilers to complain about unreachable statements.
584 */
585#ifndef yyterminate
586#define yyterminate() return YY_NULL
587#endif
588
589/* Number of entries by which start-condition stack grows. */
590#ifndef YY_START_STACK_INCR
591#define YY_START_STACK_INCR 25
592#endif
593
594/* Report a fatal error. */
595#ifndef YY_FATAL_ERROR
596#define YY_FATAL_ERROR(msg) yy_fatal_error(msg)
597#endif
598
599/* end tables serialization structures and prototypes */
600
601/* Default declaration of generated scanner - a define so the user can
602 * easily add parameters.
603 */
604#ifndef YY_DECL
605#define YY_DECL_IS_OURS 1
606
607extern int HECMW_gflex(void);
608
609#define YY_DECL int HECMW_gflex(void)
610#endif /* !YY_DECL */
611
612/* Code executed at the beginning of each rule, after HECMW_gftext and
613 * HECMW_gfleng
614 * have been set up.
615 */
616#ifndef YY_USER_ACTION
617#define YY_USER_ACTION
618#endif
619
620/* Code executed at the end of each rule. */
621#ifndef YY_BREAK
622#define YY_BREAK break;
623#endif
624
625#define YY_RULE_SETUP \
626 if (HECMW_gfleng > 0) \
627 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \
628 (HECMW_gftext[HECMW_gfleng - 1] == '\n'); \
629 YY_USER_ACTION
630
634 register yy_state_type yy_current_state;
635 register char *yy_cp, *yy_bp;
636 register int yy_act;
637
638#line 28 "../src/common/hecmw_gflex.l"
639
640#line 688 "<stdout>"
641
642 if (!(yy_init)) {
643 (yy_init) = 1;
644
645#ifdef YY_USER_INIT
646 YY_USER_INIT;
647#endif
648
649 if (!(yy_start)) (yy_start) = 1; /* first start state */
650
651 if (!HECMW_gfin) HECMW_gfin = stdin;
652
653 if (!HECMW_gfout) HECMW_gfout = stdout;
654
655 if (!YY_CURRENT_BUFFER) {
656 HECMW_gfensure_buffer_stack();
659 }
660
661 HECMW_gf_load_buffer_state();
662 }
663
664 while (1) /* loops until end-of-file is reached */
665 {
666 yy_cp = (yy_c_buf_p);
667
668 /* Support of HECMW_gftext. */
669 *yy_cp = (yy_hold_char);
670
671 /* yy_bp points to the position in yy_ch_buf of the start of
672 * the current run.
673 */
674 yy_bp = yy_cp;
675
676 yy_current_state = (yy_start);
677 yy_current_state += YY_AT_BOL();
678 yy_match:
679 do {
680 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
681 if (yy_accept[yy_current_state]) {
682 (yy_last_accepting_state) = yy_current_state;
683 (yy_last_accepting_cpos) = yy_cp;
684 }
685 while (yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state) {
686 yy_current_state = (int)yy_def[yy_current_state];
687 if (yy_current_state >= 28) yy_c = yy_meta[(unsigned int)yy_c];
688 }
689 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int)yy_c];
690 ++yy_cp;
691 } while (yy_base[yy_current_state] != 45);
692
693 yy_find_action:
694 yy_act = yy_accept[yy_current_state];
695 if (yy_act == 0) { /* have to back up */
696 yy_cp = (yy_last_accepting_cpos);
697 yy_current_state = (yy_last_accepting_state);
698 yy_act = yy_accept[yy_current_state];
699 }
700
702
703 do_action: /* This label is used only to access EOF actions. */
704
705 switch (yy_act) { /* beginning of action switch */
706 case 0: /* must back up */
707 /* undo the effects of YY_DO_BEFORE_ACTION */
708 *yy_cp = (yy_hold_char);
709 yy_cp = (yy_last_accepting_cpos);
710 yy_current_state = (yy_last_accepting_state);
711 goto yy_find_action;
712
713 case 1:
714 /* rule 1 can match eol */
716#line 30 "../src/common/hecmw_gflex.l"
717 {
718 len += HECMW_gfleng;
719 lineno++;
720 }
722 case 2:
724#line 31 "../src/common/hecmw_gflex.l"
725 {
726 len += HECMW_gfleng;
727 }
729 case 3:
731#line 32 "../src/common/hecmw_gflex.l"
732 {
733 len += HECMW_gfleng;
734 }
736 case 4:
737 /* rule 4 can match eol */
739#line 33 "../src/common/hecmw_gflex.l"
740 {
741 len += HECMW_gfleng;
742 lineno++;
743 return HECMW_GFLEX_NL;
744 }
746 case 5:
748#line 35 "../src/common/hecmw_gflex.l"
749 {
750 len += HECMW_gfleng;
751 yylval.dval = atof(HECMW_gftext);
752 return HECMW_GFLEX_INT;
753 }
755 case 6:
757#line 40 "../src/common/hecmw_gflex.l"
758 {
759 len += HECMW_gfleng;
760 yylval.dval = atof(HECMW_gftext);
761 return HECMW_GFLEX_DOUBLE;
762 }
764 case 7:
766#line 45 "../src/common/hecmw_gflex.l"
767 {
768 len += HECMW_gfleng;
769 yylval.str = HECMW_gftext;
770 return HECMW_GFLEX_NAME;
771 }
773 case 8:
775#line 50 "../src/common/hecmw_gflex.l"
776 {
777 len += HECMW_gfleng;
778 return HECMW_gftext[0];
779 }
781 case YY_STATE_EOF(INITIAL):
782#line 51 "../src/common/hecmw_gflex.l"
783 {
784 return 0;
785 }
787 case 9:
789#line 53 "../src/common/hecmw_gflex.l"
790 ECHO;
792#line 835 "<stdout>"
793
794 case YY_END_OF_BUFFER: {
795 /* Amount of text matched not including the EOB char. */
796 int yy_amount_of_matched_text = (int)(yy_cp - (yytext_ptr)) - 1;
797
798 /* Undo the effects of YY_DO_BEFORE_ACTION. */
799 *yy_cp = (yy_hold_char);
801
802 if (YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW) {
803 /* We're scanning a new file or input source. It's
804 * possible that this happened because the user
805 * just pointed HECMW_gfin at a new source and called
806 * HECMW_gflex(). If so, then we have to assure
807 * consistency between YY_CURRENT_BUFFER and our
808 * globals. Here is the right place to do so, because
809 * this is the first action (other than possibly a
810 * back-up) that will match for the new input source.
811 */
812 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
813 YY_CURRENT_BUFFER_LVALUE->yy_input_file = HECMW_gfin;
814 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
815 }
816
817 /* Note that here we test for yy_c_buf_p "<=" to the position
818 * of the first EOB in the buffer, since yy_c_buf_p will
819 * already have been incremented past the NUL character
820 * (since all states make transitions on EOB to the
821 * end-of-buffer state). Contrast this with the test
822 * in input().
823 */
824 if ((yy_c_buf_p) <=
826 ->yy_ch_buf[(yy_n_chars)]) { /* This was really a NUL. */
827 yy_state_type yy_next_state;
828
829 (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
830
831 yy_current_state = yy_get_previous_state();
832
833 /* Okay, we're now positioned to make the NUL
834 * transition. We couldn't have
835 * yy_get_previous_state() go ahead and do it
836 * for us because it doesn't know how to deal
837 * with the possibility of jamming (and we don't
838 * want to build jamming into it because then it
839 * will run more slowly).
840 */
841
842 yy_next_state = yy_try_NUL_trans(yy_current_state);
843
845
846 if (yy_next_state) {
847 /* Consume the NUL. */
848 yy_cp = ++(yy_c_buf_p);
849 yy_current_state = yy_next_state;
850 goto yy_match;
851 }
852
853 else {
854 yy_cp = (yy_c_buf_p);
855 goto yy_find_action;
856 }
857 }
858
859 else
860 switch (yy_get_next_buffer()) {
861 case EOB_ACT_END_OF_FILE: {
862 (yy_did_buffer_switch_on_eof) = 0;
863
864 if (HECMW_gfwrap()) {
865 /* Note: because we've taken care in
866 * yy_get_next_buffer() to have set up
867 * HECMW_gftext, we can now set up
868 * yy_c_buf_p so that if some total
869 * hoser (like flex itself) wants to
870 * call the scanner after we return the
871 * YY_NULL, it'll still work - another
872 * YY_NULL will get returned.
873 */
874 (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
875
877 goto do_action;
878 }
879
880 else {
881 if (!(yy_did_buffer_switch_on_eof)) YY_NEW_FILE;
882 }
883 break;
884 }
885
887 (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
888
889 yy_current_state = yy_get_previous_state();
890
891 yy_cp = (yy_c_buf_p);
893 goto yy_match;
894
896 (yy_c_buf_p) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
897
898 yy_current_state = yy_get_previous_state();
899
900 yy_cp = (yy_c_buf_p);
902 goto yy_find_action;
903 }
904 break;
905 }
906
907 default:
908 YY_FATAL_ERROR("fatal flex scanner internal error--no action found");
909 } /* end of action switch */
910 } /* end of scanning one token */
911} /* end of HECMW_gflex */
912
913/* yy_get_next_buffer - try to read in a new buffer
914 *
915 * Returns a code representing an action:
916 * EOB_ACT_LAST_MATCH -
917 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
918 * EOB_ACT_END_OF_FILE - end of file
919 */
920static int yy_get_next_buffer(void) {
921 register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
922 register char *source = (yytext_ptr);
923 register int number_to_move, i;
924 int ret_val;
925
926 if ((yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1])
927 YY_FATAL_ERROR("fatal flex scanner internal error--end of buffer missed");
928
929 if (YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer ==
930 0) { /* Don't try to fill the buffer, so this is an EOF. */
931 if ((yy_c_buf_p) - (yytext_ptr)-YY_MORE_ADJ == 1) {
932 /* We matched a single character, the EOB, so
933 * treat this as a final EOF.
934 */
935 return EOB_ACT_END_OF_FILE;
936 }
937
938 else {
939 /* We matched some text prior to the EOB, first
940 * process it.
941 */
942 return EOB_ACT_LAST_MATCH;
943 }
944 }
945
946 /* Try to read more data. */
947
948 /* First move last chars to start of buffer. */
949 number_to_move = (int)((yy_c_buf_p) - (yytext_ptr)) - 1;
950
951 for (i = 0; i < number_to_move; ++i) *(dest++) = *(source++);
952
953 if (YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING)
954 /* don't do the read, it's not guaranteed to return an EOF,
955 * just force an EOF
956 */
957 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
958
959 else {
960 yy_size_t num_to_read =
961 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
962
963 while (num_to_read <= 0) { /* Not enough room in the buffer - grow it. */
964
965 /* just a shorter name for the current buffer */
967
968 int yy_c_buf_p_offset = (int)((yy_c_buf_p)-b->yy_ch_buf);
969
970 if (b->yy_is_our_buffer) {
971 yy_size_t new_size = b->yy_buf_size * 2;
972
973 if (new_size <= 0)
974 b->yy_buf_size += b->yy_buf_size / 8;
975 else
976 b->yy_buf_size *= 2;
977
978 b->yy_ch_buf = (char *)
979 /* Include room in for 2 EOB chars. */
980 HECMW_gfrealloc((void *)b->yy_ch_buf, b->yy_buf_size + 2);
981 } else
982 /* Can't grow it, we don't own it. */
983 b->yy_ch_buf = 0;
984
985 if (!b->yy_ch_buf)
986 YY_FATAL_ERROR("fatal error - scanner input buffer overflow");
987
988 (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
989
990 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
991 }
992
993 if (num_to_read > YY_READ_BUF_SIZE) num_to_read = YY_READ_BUF_SIZE;
994
995 /* Read in more data. */
996 YY_INPUT((&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
997 (yy_n_chars), num_to_read);
998
999 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1000 }
1001
1002 if ((yy_n_chars) == 0) {
1003 if (number_to_move == YY_MORE_ADJ) {
1004 ret_val = EOB_ACT_END_OF_FILE;
1006 }
1007
1008 else {
1009 ret_val = EOB_ACT_LAST_MATCH;
1011 }
1012 }
1013
1014 else
1015 ret_val = EOB_ACT_CONTINUE_SCAN;
1016
1017 if ((yy_size_t)((yy_n_chars) + number_to_move) >
1018 YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1019 /* Extend the array by 50%, plus the number we really need. */
1020 yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
1021 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *)HECMW_gfrealloc(
1022 (void *)YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, new_size);
1023 if (!YY_CURRENT_BUFFER_LVALUE->yy_ch_buf)
1024 YY_FATAL_ERROR("out of dynamic memory in yy_get_next_buffer()");
1025 }
1026
1027 (yy_n_chars) += number_to_move;
1028 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1029 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
1030
1031 (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1032
1033 return ret_val;
1034}
1035
1036/* yy_get_previous_state - get the state just before the EOB char was reached */
1037
1038static yy_state_type yy_get_previous_state(void) {
1039 register yy_state_type yy_current_state;
1040 register char *yy_cp;
1041
1042 yy_current_state = (yy_start);
1043 yy_current_state += YY_AT_BOL();
1044
1045 for (yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp) {
1046 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1047 if (yy_accept[yy_current_state]) {
1048 (yy_last_accepting_state) = yy_current_state;
1049 (yy_last_accepting_cpos) = yy_cp;
1050 }
1051 while (yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state) {
1052 yy_current_state = (int)yy_def[yy_current_state];
1053 if (yy_current_state >= 28) yy_c = yy_meta[(unsigned int)yy_c];
1054 }
1055 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int)yy_c];
1056 }
1057
1058 return yy_current_state;
1059}
1060
1061/* yy_try_NUL_trans - try to make a transition on the NUL character
1062 *
1063 * synopsis
1064 * next_state = yy_try_NUL_trans( current_state );
1065 */
1066static yy_state_type yy_try_NUL_trans(yy_state_type yy_current_state) {
1067 register int yy_is_jam;
1068 register char *yy_cp = (yy_c_buf_p);
1069
1070 register YY_CHAR yy_c = 1;
1071 if (yy_accept[yy_current_state]) {
1072 (yy_last_accepting_state) = yy_current_state;
1073 (yy_last_accepting_cpos) = yy_cp;
1074 }
1075 while (yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state) {
1076 yy_current_state = (int)yy_def[yy_current_state];
1077 if (yy_current_state >= 28) yy_c = yy_meta[(unsigned int)yy_c];
1078 }
1079 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int)yy_c];
1080 yy_is_jam = (yy_current_state == 27);
1081
1082 return yy_is_jam ? 0 : yy_current_state;
1083}
1084
1085#ifndef YY_NO_INPUT
1086#ifdef __cplusplus
1087static int yyinput(void)
1088#else
1089static int input(void)
1090#endif
1091
1092{
1093 int c;
1094
1095 *(yy_c_buf_p) = (yy_hold_char);
1096
1097 if (*(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR) {
1098 /* yy_c_buf_p now points to the character we want to return.
1099 * If this occurs *before* the EOB characters, then it's a
1100 * valid NUL; if not, then we've hit the end of the buffer.
1101 */
1102 if ((yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)])
1103 /* This was really a NUL. */
1104 *(yy_c_buf_p) = '\0';
1105
1106 else { /* need more input */
1107 yy_size_t offset = (yy_c_buf_p) - (yytext_ptr);
1108 ++(yy_c_buf_p);
1109
1110 switch (yy_get_next_buffer()) {
1111 case EOB_ACT_LAST_MATCH:
1112 /* This happens because yy_g_n_b()
1113 * sees that we've accumulated a
1114 * token and flags that we need to
1115 * try matching the token before
1116 * proceeding. But for input(),
1117 * there's no matching to consider.
1118 * So convert the EOB_ACT_LAST_MATCH
1119 * to EOB_ACT_END_OF_FILE.
1120 */
1121
1122 /* Reset buffer status. */
1124
1125 /*FALLTHROUGH*/
1126
1127 case EOB_ACT_END_OF_FILE: {
1128 if (HECMW_gfwrap()) return 0;
1129
1130 if (!(yy_did_buffer_switch_on_eof)) YY_NEW_FILE;
1131#ifdef __cplusplus
1132 return yyinput();
1133#else
1134 return input();
1135#endif
1136 }
1137
1139 (yy_c_buf_p) = (yytext_ptr) + offset;
1140 break;
1141 }
1142 }
1143 }
1144
1145 c = *(unsigned char *)(yy_c_buf_p); /* cast for 8-bit char's */
1146 *(yy_c_buf_p) = '\0'; /* preserve HECMW_gftext */
1147 (yy_hold_char) = *++(yy_c_buf_p);
1148
1149 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n');
1150
1151 return c;
1152}
1153#endif /* ifndef YY_NO_INPUT */
1154
1160void HECMW_gfrestart(FILE *input_file) {
1161 if (!YY_CURRENT_BUFFER) {
1162 HECMW_gfensure_buffer_stack();
1164 }
1165
1166 HECMW_gf_init_buffer(YY_CURRENT_BUFFER, input_file);
1167 HECMW_gf_load_buffer_state();
1168}
1169
1175 /* TODO. We should be able to replace this entire function body
1176 * with
1177 * HECMW_gfpop_buffer_state();
1178 * HECMW_gfpush_buffer_state(new_buffer);
1179*/
1180 HECMW_gfensure_buffer_stack();
1181 if (YY_CURRENT_BUFFER == new_buffer) return;
1182
1183 if (YY_CURRENT_BUFFER) {
1184 /* Flush out information for old buffer. */
1185 *(yy_c_buf_p) = (yy_hold_char);
1186 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1187 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1188 }
1189
1190 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1191 HECMW_gf_load_buffer_state();
1192
1193 /* We don't actually know whether we did this switch during
1194 * EOF (HECMW_gfwrap()) processing, but the only time this flag
1195 * is looked at is after HECMW_gfwrap() is called, so it's safe
1196 * to go ahead and always set it.
1197 */
1198 (yy_did_buffer_switch_on_eof) = 1;
1199}
1200
1201static void HECMW_gf_load_buffer_state(void) {
1202 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1203 (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1204 HECMW_gfin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1205 (yy_hold_char) = *(yy_c_buf_p);
1206}
1207
1217
1218 b = (YY_BUFFER_STATE)HECMW_gfalloc(sizeof(struct yy_buffer_state));
1219 if (!b) YY_FATAL_ERROR("out of dynamic memory in HECMW_gf_create_buffer()");
1220
1221 b->yy_buf_size = size;
1222
1223 /* yy_ch_buf has to be 2 characters longer than the size given because
1224 * we need to put in 2 end-of-buffer characters.
1225 */
1226 b->yy_ch_buf = (char *)HECMW_gfalloc(b->yy_buf_size + 2);
1227 if (!b->yy_ch_buf)
1228 YY_FATAL_ERROR("out of dynamic memory in HECMW_gf_create_buffer()");
1229
1230 b->yy_is_our_buffer = 1;
1231
1232 HECMW_gf_init_buffer(b, file);
1233
1234 return b;
1235}
1236
1242 if (!b) return;
1243
1244 if (b == YY_CURRENT_BUFFER) /* Not sure if we should pop here. */
1246
1247 if (b->yy_is_our_buffer) HECMW_gffree((void *)b->yy_ch_buf);
1248
1249 HECMW_gffree((void *)b);
1250}
1251
1252#ifndef __cplusplus
1253extern int isatty(int);
1254#endif /* __cplusplus */
1255
1256/* Initializes or reinitializes a buffer.
1257 * This function is sometimes called more than once on the same buffer,
1258 * such as during a HECMW_gfrestart() or at EOF.
1259 */
1260static void HECMW_gf_init_buffer(YY_BUFFER_STATE b, FILE *file)
1261
1262{
1263 int oerrno = errno;
1264
1266
1267 b->yy_input_file = file;
1268 b->yy_fill_buffer = 1;
1269
1270 /* If b is the current buffer, then HECMW_gf_init_buffer was _probably_
1271 * called from HECMW_gfrestart() or through yy_get_next_buffer.
1272 * In that case, we don't want to reset the lineno or column.
1273 */
1274 if (b != YY_CURRENT_BUFFER) {
1275 b->yy_bs_lineno = 1;
1276 b->yy_bs_column = 0;
1277 }
1278
1279 b->yy_is_interactive = file ? (isatty(fileno(file)) > 0) : 0;
1280
1281 errno = oerrno;
1282}
1283
1289 if (!b) return;
1290
1291 b->yy_n_chars = 0;
1292
1293 /* We always need two end-of-buffer characters. The first causes
1294 * a transition to the end-of-buffer state. The second causes
1295 * a jam in that state.
1296 */
1299
1300 b->yy_buf_pos = &b->yy_ch_buf[0];
1301
1302 b->yy_at_bol = 1;
1304
1305 if (b == YY_CURRENT_BUFFER) HECMW_gf_load_buffer_state();
1306}
1307
1315 if (new_buffer == NULL) return;
1316
1317 HECMW_gfensure_buffer_stack();
1318
1319 /* This block is copied from HECMW_gf_switch_to_buffer. */
1320 if (YY_CURRENT_BUFFER) {
1321 /* Flush out information for old buffer. */
1322 *(yy_c_buf_p) = (yy_hold_char);
1323 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1324 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1325 }
1326
1327 /* Only push if top exists. Otherwise, replace top. */
1328 if (YY_CURRENT_BUFFER) (yy_buffer_stack_top)++;
1329 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1330
1331 /* copied from HECMW_gf_switch_to_buffer. */
1332 HECMW_gf_load_buffer_state();
1333 (yy_did_buffer_switch_on_eof) = 1;
1334}
1335
1341 if (!YY_CURRENT_BUFFER) return;
1342
1345 if ((yy_buffer_stack_top) > 0) --(yy_buffer_stack_top);
1346
1347 if (YY_CURRENT_BUFFER) {
1348 HECMW_gf_load_buffer_state();
1349 (yy_did_buffer_switch_on_eof) = 1;
1350 }
1351}
1352
1353/* Allocates the stack if it does not exist.
1354 * Guarantees space for at least one push.
1355 */
1356static void HECMW_gfensure_buffer_stack(void) {
1357 yy_size_t num_to_alloc;
1358
1359 if (!(yy_buffer_stack)) {
1360 /* First allocation is just for 2 elements, since we don't know if this
1361 * scanner will even need a stack. We use 2 instead of 1 to avoid an
1362 * immediate realloc on the next call.
1363*/
1364 num_to_alloc = 1;
1365 (yy_buffer_stack) = (struct yy_buffer_state **)HECMW_gfalloc(
1366 num_to_alloc * sizeof(struct yy_buffer_state *));
1367 if (!(yy_buffer_stack))
1368 YY_FATAL_ERROR("out of dynamic memory in HECMW_gfensure_buffer_stack()");
1369
1370 memset((yy_buffer_stack), 0,
1371 num_to_alloc * sizeof(struct yy_buffer_state *));
1372
1373 (yy_buffer_stack_max) = num_to_alloc;
1374 (yy_buffer_stack_top) = 0;
1375 return;
1376 }
1377
1378 if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1) {
1379 /* Increase the buffer to prepare for a possible push. */
1380 int grow_size = 8 /* arbitrary grow size */;
1381
1382 num_to_alloc = (yy_buffer_stack_max) + grow_size;
1383 (yy_buffer_stack) = (struct yy_buffer_state **)HECMW_gfrealloc(
1384 (yy_buffer_stack), num_to_alloc * sizeof(struct yy_buffer_state *));
1385 if (!(yy_buffer_stack))
1386 YY_FATAL_ERROR("out of dynamic memory in HECMW_gfensure_buffer_stack()");
1387
1388 /* zero only the new slots.*/
1389 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0,
1390 grow_size * sizeof(struct yy_buffer_state *));
1391 (yy_buffer_stack_max) = num_to_alloc;
1392 }
1393}
1394
1404
1405 if (size < 2 || base[size - 2] != YY_END_OF_BUFFER_CHAR ||
1406 base[size - 1] != YY_END_OF_BUFFER_CHAR)
1407 /* They forgot to leave room for the EOB's. */
1408 return 0;
1409
1410 b = (YY_BUFFER_STATE)HECMW_gfalloc(sizeof(struct yy_buffer_state));
1411 if (!b) YY_FATAL_ERROR("out of dynamic memory in HECMW_gf_scan_buffer()");
1412
1413 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1414 b->yy_buf_pos = b->yy_ch_buf = base;
1415 b->yy_is_our_buffer = 0;
1416 b->yy_input_file = 0;
1417 b->yy_n_chars = b->yy_buf_size;
1418 b->yy_is_interactive = 0;
1419 b->yy_at_bol = 1;
1420 b->yy_fill_buffer = 0;
1422
1424
1425 return b;
1426}
1427
1438 return HECMW_gf_scan_bytes(yystr, strlen(yystr));
1439}
1440
1450 yy_size_t _yybytes_len) {
1452 char *buf;
1453 yy_size_t n, i;
1454
1455 /* Get memory for full buffer, including space for trailing EOB's. */
1456 n = _yybytes_len + 2;
1457 buf = (char *)HECMW_gfalloc(n);
1458 if (!buf) YY_FATAL_ERROR("out of dynamic memory in HECMW_gf_scan_bytes()");
1459
1460 for (i = 0; i < _yybytes_len; ++i) buf[i] = yybytes[i];
1461
1462 buf[_yybytes_len] = buf[_yybytes_len + 1] = YY_END_OF_BUFFER_CHAR;
1463
1464 b = HECMW_gf_scan_buffer(buf, n);
1465 if (!b) YY_FATAL_ERROR("bad buffer in HECMW_gf_scan_bytes()");
1466
1467 /* It's okay to grow etc. this buffer, and we should throw it
1468 * away when we're done.
1469 */
1470 b->yy_is_our_buffer = 1;
1471
1472 return b;
1473}
1474
1475#ifndef YY_EXIT_FAILURE
1476#define YY_EXIT_FAILURE 2
1477#endif
1478
1479static void yy_fatal_error(yyconst char *msg) {
1480 (void)fprintf(stderr, "%s\n", msg);
1481 exit(YY_EXIT_FAILURE);
1482}
1483
1484/* Redefine yyless() so it works in section 3 code. */
1485
1486#undef yyless
1487#define yyless(n) \
1488 do { \
1489 /* Undo effects of setting up HECMW_gftext. */ \
1490 int yyless_macro_arg = (n); \
1491 YY_LESS_LINENO(yyless_macro_arg); \
1492 HECMW_gftext[HECMW_gfleng] = (yy_hold_char); \
1493 (yy_c_buf_p) = HECMW_gftext + yyless_macro_arg; \
1494 (yy_hold_char) = *(yy_c_buf_p); \
1495 *(yy_c_buf_p) = '\0'; \
1496 HECMW_gfleng = yyless_macro_arg; \
1497 } while (0)
1498
1499/* Accessor methods (get/set functions) to struct members. */
1500
1505
1509FILE *HECMW_gfget_in(void) { return HECMW_gfin; }
1510
1514FILE *HECMW_gfget_out(void) { return HECMW_gfout; }
1515
1520
1525char *HECMW_gfget_text(void) { return HECMW_gftext; }
1526
1531void HECMW_gfset_lineno(int line_number) { HECMW_gflineno = line_number; }
1532
1539void HECMW_gfset_in(FILE *in_str) { HECMW_gfin = in_str; }
1540
1541void HECMW_gfset_out(FILE *out_str) { HECMW_gfout = out_str; }
1542
1544
1545void HECMW_gfset_debug(int bdebug) { HECMW_gf_flex_debug = bdebug; }
1546
1547static int yy_init_globals(void) {
1548 /* Initialization is the same as for the non-reentrant scanner.
1549*This function is called from HECMW_gflex_destroy(), so don't allocate here.
1550*/
1551
1552 (yy_buffer_stack) = 0;
1553 (yy_buffer_stack_top) = 0;
1554 (yy_buffer_stack_max) = 0;
1555 (yy_c_buf_p) = (char *)0;
1556 (yy_init) = 0;
1557 (yy_start) = 0;
1558
1559/* Defined in main.c */
1560#ifdef YY_STDINIT
1561 HECMW_gfin = stdin;
1562 HECMW_gfout = stdout;
1563#else
1564 HECMW_gfin = (FILE *)0;
1565 HECMW_gfout = (FILE *)0;
1566#endif
1567
1568 /* For future reference: Set errno on error, since we are called by
1569 * HECMW_gflex_init()
1570 */
1571 return 0;
1572}
1573
1574/* HECMW_gflex_destroy is for both reentrant and non-reentrant scanners. */
1576 /* Pop the buffer stack, destroying each element. */
1577 while (YY_CURRENT_BUFFER) {
1581 }
1582
1583 /* Destroy the stack itself. */
1584 HECMW_gffree((yy_buffer_stack));
1585 (yy_buffer_stack) = NULL;
1586
1587 /* Reset the globals. This is important in a non-reentrant scanner so the next
1588 * time
1589 * HECMW_gflex() is called, initialization will occur. */
1590 yy_init_globals();
1591
1592 return 0;
1593}
1594
1595/*
1596 * Internal utility routines.
1597 */
1598
1599#ifndef yytext_ptr
1600static void yy_flex_strncpy(char *s1, yyconst char *s2, int n) {
1601 register int i;
1602 for (i = 0; i < n; ++i) s1[i] = s2[i];
1603}
1604#endif
1605
1606#ifdef YY_NEED_STRLEN
1607static int yy_flex_strlen(yyconst char *s) {
1608 register int n;
1609 for (n = 0; s[n]; ++n)
1610 ;
1611
1612 return n;
1613}
1614#endif
1615
1616void *HECMW_gfalloc(yy_size_t size) { return (void *)malloc(size); }
1617
1618void *HECMW_gfrealloc(void *ptr, yy_size_t size) {
1619 /* The cast to (char *) in the following accommodates both
1620 * implementations that use char* generic pointers, and those
1621 * that use void* generic pointers. It works with the latter
1622 * because both ANSI C and C++ allow castless assignment from
1623 * any pointer type to void*, and deal with argument conversions
1624 * as though doing an assignment.
1625 */
1626 return (void *)realloc((char *)ptr, size);
1627}
1628
1629void HECMW_gffree(void *ptr) {
1630 free((char *)ptr); /* see HECMW_gfrealloc() for (char *) cast */
1631}
1632
1633#define YYTABLES_NAME "yytables"
1634
1635#line 53 "../src/common/hecmw_gflex.l"
1636
1637int HECMW_gflex_get_lineno(void) { return lineno; }
1638
1639double HECMW_gflex_get_number(void) { return yylval.dval; }
1640
1641char *HECMW_gflex_get_text(void) { return HECMW_gftext; }
1642
1644
1645int HECMW_gflex_next_token_skip(int skip_token) {
1646 int token;
1647 while ((token = HECMW_gflex())) {
1648 if (token != skip_token) break;
1649 }
1650 return token;
1651}
1652
1653long HECMW_gflex_readsize(void) { return len; }
1654
1656 static int first = 1;
1657 if (fp == NULL) return -1;
1658 if (first) {
1659 HECMW_gfin = fp;
1660 first = 0;
1661 } else {
1662 HECMW_gfrestart(fp);
1663 }
1664 lineno = 1;
1665 len = 0;
1666 return 0;
1667}
1668
1670 int token;
1671 while ((token = HECMW_gflex_next_token())) {
1672 if (token == HECMW_GFLEX_NL) break;
1673 }
1674 return token;
1675}
1676
1677int HECMW_gfwrap(void) { return 1; }
unsigned char YY_CHAR
Definition: hecmw_ablex.c:349
short int flex_int16_t
Definition: hecmw_ablex.c:70
int flex_int32_t
Definition: hecmw_ablex.c:71
int yy_state_type
Definition: hecmw_ablex.c:353
size_t yy_size_t
Definition: hecmw_ablex.c:177
#define YY_NEW_FILE
Definition: hecmw_gflex.c:157
int HECMW_gflex_next_token_skip(int skip_token)
Definition: hecmw_gflex.c:1645
void HECMW_gf_flush_buffer(YY_BUFFER_STATE b)
Definition: hecmw_gflex.c:1288
int HECMW_gfget_debug(void)
Definition: hecmw_gflex.c:1543
int HECMW_gfwrap(void)
Definition: hecmw_gflex.c:1677
unsigned char flex_uint8_t
Definition: hecmw_gflex.c:73
int HECMW_gflex_set_input(FILE *fp)
Definition: hecmw_gflex.c:1655
unsigned char YY_CHAR
Definition: hecmw_gflex.c:350
void HECMW_gfpop_buffer_state(void)
Definition: hecmw_gflex.c:1340
void * HECMW_gfrealloc(void *, yy_size_t)
Definition: hecmw_gflex.c:1618
#define YY_EXTRA_TYPE
Definition: hecmw_gflex.c:474
void HECMW_gffree(void *)
Definition: hecmw_gflex.c:1629
short int flex_int16_t
Definition: hecmw_gflex.c:71
int HECMW_gflex_destroy(void)
Definition: hecmw_gflex.c:1575
unsigned int flex_uint32_t
Definition: hecmw_gflex.c:75
#define YY_BREAK
Definition: hecmw_gflex.c:622
char * HECMW_gftext
Definition: hecmw_gflex.c:445
int HECMW_gflex(void)
struct yy_buffer_state * YY_BUFFER_STATE
Definition: hecmw_gflex.c:173
#define YY_BUFFER_NEW
Definition: hecmw_gflex.c:252
#define YY_RESTORE_YY_MORE_OFFSET
Definition: hecmw_gflex.c:444
int HECMW_gflex_get_lineno(void)
Definition: hecmw_gflex.c:1637
YY_BUFFER_STATE HECMW_gf_scan_string(yyconst char *yy_str)
Definition: hecmw_gflex.c:1437
#define YY_BUFFER_NORMAL
Definition: hecmw_gflex.c:253
#define YY_MORE_ADJ
Definition: hecmw_gflex.c:443
#define YY_RULE_SETUP
Definition: hecmw_gflex.c:625
int HECMW_gflex_skip_line(void)
Definition: hecmw_gflex.c:1669
#define YY_AT_BOL()
Definition: hecmw_gflex.c:346
register char * yy_bp
Definition: hecmw_gflex.c:635
double HECMW_gflex_get_number(void)
Definition: hecmw_gflex.c:1639
#define yytext_ptr
Definition: hecmw_gflex.c:361
signed char flex_int8_t
Definition: hecmw_gflex.c:70
void HECMW_gfset_in(FILE *in_str)
Definition: hecmw_gflex.c:1539
long HECMW_gflex_readsize(void)
Definition: hecmw_gflex.c:1653
#define EOB_ACT_END_OF_FILE
Definition: hecmw_gflex.c:186
register int yy_act
Definition: hecmw_gflex.c:636
#define YY_CURRENT_BUFFER_LVALUE
Definition: hecmw_gflex.c:285
int flex_int32_t
Definition: hecmw_gflex.c:72
#define YY_START
Definition: hecmw_gflex.c:150
YY_BUFFER_STATE HECMW_gf_scan_buffer(char *base, yy_size_t size)
Definition: hecmw_gflex.c:1402
void HECMW_gfset_lineno(int line_number)
Definition: hecmw_gflex.c:1531
int yy_state_type
Definition: hecmw_gflex.c:354
#define YY_CURRENT_BUFFER
Definition: hecmw_gflex.c:279
int HECMW_gflineno
Definition: hecmw_gflex.c:358
FILE * HECMW_gfin
Definition: hecmw_gflex.c:352
#define yyconst
Definition: hecmw_gflex.c:127
#define INITIAL
Definition: hecmw_gflex.c:463
#define YY_READ_BUF_SIZE
Definition: hecmw_gflex.c:540
int HECMW_gf_flex_debug
Definition: hecmw_gflex.c:436
void HECMW_gfset_out(FILE *out_str)
Definition: hecmw_gflex.c:1541
#define YY_INPUT(buf, result, max_size)
Definition: hecmw_gflex.c:555
#define ECHO
Definition: hecmw_gflex.c:548
#define YY_END_OF_BUFFER
Definition: hecmw_gflex.c:379
#define YY_STATE_EOF(state)
Definition: hecmw_gflex.c:154
int isatty(int)
#define YY_END_OF_BUFFER_CHAR
Definition: hecmw_gflex.c:159
register char * yy_cp
Definition: hecmw_gflex.c:635
yy_size_t HECMW_gfleng
Definition: hecmw_gflex.c:290
void * HECMW_gfalloc(yy_size_t)
Definition: hecmw_gflex.c:1616
#define YY_FATAL_ERROR(msg)
Definition: hecmw_gflex.c:596
void HECMW_gfset_debug(int debug_flag)
Definition: hecmw_gflex.c:1545
char * HECMW_gflex_get_text(void)
Definition: hecmw_gflex.c:1641
unsigned short int flex_uint16_t
Definition: hecmw_gflex.c:74
int HECMW_gflex_next_token(void)
Definition: hecmw_gflex.c:1643
#define YY_DO_BEFORE_ACTION
Definition: hecmw_gflex.c:371
FILE * HECMW_gfget_in(void)
Definition: hecmw_gflex.c:1509
#define EOB_ACT_LAST_MATCH
Definition: hecmw_gflex.c:187
size_t yy_size_t
Definition: hecmw_gflex.c:178
#define YY_BUFFER_EOF_PENDING
Definition: hecmw_gflex.c:264
FILE * HECMW_gfout
Definition: hecmw_gflex.c:183
void HECMW_gfrestart(FILE *input_file)
Definition: hecmw_gflex.c:1160
YY_EXTRA_TYPE HECMW_gfget_extra(void)
YY_BUFFER_STATE HECMW_gf_scan_bytes(yyconst char *bytes, yy_size_t len)
Definition: hecmw_gflex.c:1449
YY_BUFFER_STATE HECMW_gf_create_buffer(FILE *file, int size)
Definition: hecmw_gflex.c:1215
#define EOB_ACT_CONTINUE_SCAN
Definition: hecmw_gflex.c:185
yy_size_t HECMW_gfget_leng(void)
Definition: hecmw_gflex.c:1519
#define YY_DECL
Definition: hecmw_gflex.c:609
#define YY_BUF_SIZE
Definition: hecmw_gflex.c:163
#define YY_EXIT_FAILURE
Definition: hecmw_gflex.c:1476
int HECMW_gfget_lineno(void)
Definition: hecmw_gflex.c:1504
#define YY_SC_TO_UI(c)
Definition: hecmw_gflex.c:138
char * HECMW_gfget_text(void)
Definition: hecmw_gflex.c:1525
FILE * HECMW_gfget_out(void)
Definition: hecmw_gflex.c:1514
void HECMW_gfpush_buffer_state(YY_BUFFER_STATE new_buffer)
Definition: hecmw_gflex.c:1314
void HECMW_gfset_extra(YY_EXTRA_TYPE user_defined)
void HECMW_gf_delete_buffer(YY_BUFFER_STATE b)
Definition: hecmw_gflex.c:1241
void HECMW_gf_switch_to_buffer(YY_BUFFER_STATE new_buffer)
Definition: hecmw_gflex.c:1174
@ HECMW_GFLEX_NAME
Definition: hecmw_gflex.h:15
@ HECMW_GFLEX_INT
Definition: hecmw_gflex.h:13
@ HECMW_GFLEX_NL
Definition: hecmw_gflex.h:12
@ HECMW_GFLEX_DOUBLE
Definition: hecmw_gflex.h:14
#define NULL
FILE * yy_input_file
Definition: hecmw_ablex.c:207
yy_size_t yy_buf_size
Definition: hecmw_ablex.c:215
yy_size_t yy_n_chars
Definition: hecmw_ablex.c:220
flex_int32_t yy_verify
Definition: hecmw_ablex.c:382
flex_int32_t yy_nxt
Definition: hecmw_ablex.c:383
char * str
Definition: hecmw_ablex.c:1108
double dval
Definition: hecmw_ablex.c:1107