#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <stdlib.h>
#include "hecmw_gflex.h"
#include "hecmw_util.h"
#include <unistd.h>
Go to the source code of this file.
◆ BEGIN
#define BEGIN (yy_start) = 1 + 2 * |
◆ ECHO
◆ EOB_ACT_CONTINUE_SCAN
#define EOB_ACT_CONTINUE_SCAN 0 |
◆ EOB_ACT_END_OF_FILE
#define EOB_ACT_END_OF_FILE 1 |
◆ EOB_ACT_LAST_MATCH
#define EOB_ACT_LAST_MATCH 2 |
◆ FLEX_BETA
◆ FLEX_SCANNER
◆ FLEXINT_H
◆ INITIAL
◆ INT16_MAX
#define INT16_MAX (32767) |
◆ INT16_MIN
#define INT16_MIN (-32767 - 1) |
◆ INT32_MAX
#define INT32_MAX (2147483647) |
◆ INT32_MIN
#define INT32_MIN (-2147483647 - 1) |
◆ INT8_MAX
◆ INT8_MIN
◆ REJECT
#define REJECT reject_used_but_not_detected |
◆ UINT16_MAX
#define UINT16_MAX (65535U) |
◆ UINT32_MAX
#define UINT32_MAX (4294967295U) |
◆ UINT8_MAX
◆ unput
◆ YY_AT_BOL
◆ YY_BREAK
◆ YY_BUF_SIZE
#define YY_BUF_SIZE 16384 |
◆ YY_BUFFER_EOF_PENDING
#define YY_BUFFER_EOF_PENDING 2 |
◆ YY_BUFFER_NEW
◆ YY_BUFFER_NORMAL
#define YY_BUFFER_NORMAL 1 |
◆ yy_create_buffer
◆ YY_CURRENT_BUFFER
#define YY_CURRENT_BUFFER ((yy_buffer_stack) ? (yy_buffer_stack)[(yy_buffer_stack_top)] : NULL) |
◆ YY_CURRENT_BUFFER_LVALUE
#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] |
◆ YY_DECL
◆ YY_DECL_IS_OURS
#define YY_DECL_IS_OURS 1 |
◆ yy_delete_buffer
◆ YY_DO_BEFORE_ACTION
#define YY_DO_BEFORE_ACTION |
◆ YY_END_OF_BUFFER
#define YY_END_OF_BUFFER 10 |
◆ YY_END_OF_BUFFER_CHAR
#define YY_END_OF_BUFFER_CHAR 0 |
◆ YY_EXIT_FAILURE
#define YY_EXIT_FAILURE 2 |
◆ YY_EXTRA_TYPE
#define YY_EXTRA_TYPE void * |
◆ YY_FATAL_ERROR
#define YY_FATAL_ERROR |
( |
|
msg | ) |
yy_fatal_error(msg) |
◆ yy_flex_debug
◆ YY_FLEX_MAJOR_VERSION
#define YY_FLEX_MAJOR_VERSION 2 |
◆ YY_FLEX_MINOR_VERSION
#define YY_FLEX_MINOR_VERSION 5 |
◆ YY_FLEX_SUBMINOR_VERSION
#define YY_FLEX_SUBMINOR_VERSION 35 |
◆ yy_flush_buffer
◆ YY_FLUSH_BUFFER
◆ yy_init_buffer
#define yy_init_buffer HECMW_gf_init_buffer |
◆ YY_INPUT
#define YY_INPUT |
( |
|
buf, |
|
|
|
result, |
|
|
|
max_size |
|
) |
| |
Value:
int c = '*'; \
yy_size_t n; \
for (n = 0; n < max_size && (c = getc(
HECMW_gfin)) != EOF && c !=
'\n'; \
++n) \
buf[n] = (char)c; \
if (c == '\n') buf[n++] = (char)c; \
result = n; \
} else { \
errno = 0; \
while ((result = fread(buf, 1, max_size,
HECMW_gfin)) == 0 && \
if (errno != EINTR) { \
YY_FATAL_ERROR("input in flex scanner failed"); \
break; \
} \
errno = 0; \
} \
}
#define YY_CURRENT_BUFFER_LVALUE
#define YY_FATAL_ERROR(msg)
Definition at line 555 of file hecmw_gflex.c.
◆ YY_INT_ALIGNED
#define YY_INT_ALIGNED short int |
◆ YY_LESS_LINENO
#define YY_LESS_LINENO |
( |
|
n | ) |
|
◆ yy_load_buffer_state
#define yy_load_buffer_state |
( |
|
void | ) |
HECMW_gf_load_buffer_state |
◆ YY_MORE_ADJ
◆ yy_new_buffer
◆ YY_NEW_FILE
◆ YY_NULL
◆ YY_NUM_RULES
◆ YY_READ_BUF_SIZE
#define YY_READ_BUF_SIZE 8192 |
◆ YY_RESTORE_YY_MORE_OFFSET
#define YY_RESTORE_YY_MORE_OFFSET |
◆ YY_RULE_SETUP
Value:
YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \
YY_USER_ACTION
Definition at line 625 of file hecmw_gflex.c.
◆ YY_SC_TO_UI
#define YY_SC_TO_UI |
( |
|
c | ) |
((unsigned int)(unsigned char)c) |
◆ yy_set_bol
#define yy_set_bol |
( |
|
at_bol | ) |
|
Value: { \
HECMW_gfensure_buffer_stack(); \
YY_CURRENT_BUFFER_LVALUE = \
} \
YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
}
#define YY_CURRENT_BUFFER
Definition at line 336 of file hecmw_gflex.c.
◆ yy_set_interactive
#define yy_set_interactive |
( |
|
is_interactive | ) |
|
Value: { \
HECMW_gfensure_buffer_stack(); \
YY_CURRENT_BUFFER_LVALUE = \
} \
YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
}
Definition at line 326 of file hecmw_gflex.c.
◆ YY_START
#define YY_START (((yy_start)-1) / 2) |
◆ YY_START_STACK_INCR
#define YY_START_STACK_INCR 25 |
◆ YY_STATE_BUF_SIZE
◆ YY_STATE_EOF
◆ YY_STRUCT_YY_BUFFER_STATE
#define YY_STRUCT_YY_BUFFER_STATE |
◆ yy_switch_to_buffer
◆ YY_TYPEDEF_YY_BUFFER_STATE
#define YY_TYPEDEF_YY_BUFFER_STATE |
◆ YY_TYPEDEF_YY_SIZE_T
#define YY_TYPEDEF_YY_SIZE_T |
◆ YY_USER_ACTION
◆ yyalloc
◆ yyconst
◆ yyfree
◆ yyin
◆ yyleng
◆ yyless [1/2]
Value: do { \
\
int yyless_macro_arg = (n); \
YY_LESS_LINENO(yyless_macro_arg); \
*
yy_cp = (yy_hold_char); \
YY_RESTORE_YY_MORE_OFFSET(yy_c_buf_p) =
yy_cp = \
YY_DO_BEFORE_ACTION; \
} while (0)
Definition at line 1487 of file hecmw_gflex.c.
◆ yyless [2/2]
Value: do { \
\
int yyless_macro_arg = (n); \
YY_LESS_LINENO(yyless_macro_arg); \
(yy_hold_char) = *(yy_c_buf_p); \
*(yy_c_buf_p) = '\0'; \
HECMW_gfleng = yyless_macro_arg; \
} while (0)
Definition at line 1487 of file hecmw_gflex.c.
◆ yylex
◆ yylineno
◆ yymore
#define yymore |
( |
| ) |
yymore_used_but_not_detected |
◆ yyout
◆ yyrealloc
◆ yyrestart
◆ YYSTATE
◆ YYTABLES_NAME
#define YYTABLES_NAME "yytables" |
◆ yyterminate
#define yyterminate |
( |
| ) |
return YY_NULL |
◆ yytext
◆ yytext_ptr
◆ yywrap
◆ flex_int16_t
◆ flex_int32_t
◆ flex_int8_t
◆ flex_uint16_t
◆ flex_uint32_t
◆ flex_uint8_t
◆ YY_BUFFER_STATE
◆ YY_CHAR
◆ yy_size_t
◆ yy_state_type
◆ HECMW_gf_create_buffer()
Allocate and initialize an input buffer state.
- Parameters
-
file | A readable stream. |
size | The character buffer size in bytes. When in doubt, use YY_BUF_SIZE . |
- Returns
- the allocated buffer state.
Definition at line 1215 of file hecmw_gflex.c.
◆ HECMW_gf_delete_buffer()
◆ HECMW_gf_flush_buffer()
Discard all buffered characters. On the next scan, YY_INPUT will be called.
- Parameters
-
b | the buffer state to be flushed, usually YY_CURRENT_BUFFER . |
Definition at line 1288 of file hecmw_gflex.c.
◆ HECMW_gf_scan_buffer()
Setup the input buffer state to scan directly from a user-specified character buffer.
- Parameters
-
base | the character buffer |
size | the size in bytes of the character buffer |
- Returns
- the newly allocated buffer state object.
Definition at line 1402 of file hecmw_gflex.c.
◆ HECMW_gf_scan_bytes()
Setup the input buffer state to scan the given bytes. The next call to HECMW_gflex() will scan from a copy of bytes.
- Parameters
-
bytes | the byte buffer to scan |
len | the number of bytes in the buffer pointed to by bytes. |
- Returns
- the newly allocated buffer state object.
Definition at line 1449 of file hecmw_gflex.c.
◆ HECMW_gf_scan_string()
Setup the input buffer state to scan a string. The next call to HECMW_gflex() will scan from a copy of str.
- Parameters
-
yystr | a NUL-terminated string to scan |
- Returns
- the newly allocated buffer state object.
- Note
- If you want to scan bytes that may contain NUL values, then use HECMW_gf_scan_bytes() instead.
Definition at line 1437 of file hecmw_gflex.c.
◆ HECMW_gf_switch_to_buffer()
Switch to a different input buffer.
- Parameters
-
new_buffer | The new input buffer. |
Definition at line 1174 of file hecmw_gflex.c.
◆ HECMW_gfalloc()
◆ HECMW_gffree()
void HECMW_gffree |
( |
void * |
ptr | ) |
|
◆ HECMW_gfget_debug()
int HECMW_gfget_debug |
( |
void |
| ) |
|
◆ HECMW_gfget_extra()
◆ HECMW_gfget_in()
FILE * HECMW_gfget_in |
( |
void |
| ) |
|
◆ HECMW_gfget_leng()
◆ HECMW_gfget_lineno()
int HECMW_gfget_lineno |
( |
void |
| ) |
|
◆ HECMW_gfget_out()
FILE * HECMW_gfget_out |
( |
void |
| ) |
|
◆ HECMW_gfget_text()
char * HECMW_gfget_text |
( |
void |
| ) |
|
◆ HECMW_gflex()
◆ HECMW_gflex_destroy()
int HECMW_gflex_destroy |
( |
void |
| ) |
|
◆ HECMW_gflex_get_lineno()
int HECMW_gflex_get_lineno |
( |
void |
| ) |
|
◆ HECMW_gflex_get_number()
double HECMW_gflex_get_number |
( |
void |
| ) |
|
◆ HECMW_gflex_get_text()
char* HECMW_gflex_get_text |
( |
void |
| ) |
|
◆ HECMW_gflex_next_token()
int HECMW_gflex_next_token |
( |
void |
| ) |
|
◆ HECMW_gflex_next_token_skip()
int HECMW_gflex_next_token_skip |
( |
int |
skip_token | ) |
|
◆ HECMW_gflex_readsize()
long HECMW_gflex_readsize |
( |
void |
| ) |
|
◆ HECMW_gflex_set_input()
int HECMW_gflex_set_input |
( |
FILE * |
fp | ) |
|
◆ HECMW_gflex_skip_line()
int HECMW_gflex_skip_line |
( |
void |
| ) |
|
◆ HECMW_gfpop_buffer_state()
void HECMW_gfpop_buffer_state |
( |
void |
| ) |
|
Removes and deletes the top of the stack, if present. The next element becomes the new top.
Definition at line 1340 of file hecmw_gflex.c.
◆ HECMW_gfpush_buffer_state()
Pushes the new state onto the stack. The new state becomes the current state. This function will allocate the stack if necessary.
- Parameters
-
Definition at line 1314 of file hecmw_gflex.c.
◆ HECMW_gfrealloc()
void * HECMW_gfrealloc |
( |
void * |
ptr, |
|
|
yy_size_t |
size |
|
) |
| |
◆ HECMW_gfrestart()
void HECMW_gfrestart |
( |
FILE * |
input_file | ) |
|
Immediately switch to a different input stream.
- Parameters
-
input_file | A readable stream. |
- Note
- This function does not reset the start condition to
INITIAL
.
Definition at line 1160 of file hecmw_gflex.c.
◆ HECMW_gfset_debug()
void HECMW_gfset_debug |
( |
int |
debug_flag | ) |
|
◆ HECMW_gfset_extra()
◆ HECMW_gfset_in()
void HECMW_gfset_in |
( |
FILE * |
in_str | ) |
|
◆ HECMW_gfset_lineno()
void HECMW_gfset_lineno |
( |
int |
line_number | ) |
|
Set the current line number.
- Parameters
-
Definition at line 1531 of file hecmw_gflex.c.
◆ HECMW_gfset_out()
void HECMW_gfset_out |
( |
FILE * |
out_str | ) |
|
◆ HECMW_gfwrap()
int HECMW_gfwrap |
( |
void |
| ) |
|
◆ if()
◆ isatty()
◆ while()
◆ HECMW_gf_flex_debug
int HECMW_gf_flex_debug = 0 |
◆ HECMW_gfin
FILE * HECMW_gfin = (FILE *)0 |
◆ HECMW_gfleng
◆ HECMW_gflineno
◆ HECMW_gfout
FILE * HECMW_gfout = (FILE *)0 |
◆ HECMW_gftext
◆ yy_act
◆ yy_bp
◆ yy_cp
◆ YY_DECL
Initial value:The main scanner function which does all the work.
Definition at line 633 of file hecmw_gflex.c.