#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <stdlib.h>
#include "hecmw_ctrllex.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 41 |
◆ 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_ctrl_init_buffer |
◆ YY_INPUT
#define YY_INPUT |
( |
|
buf, |
|
|
|
result, |
|
|
|
max_size |
|
) |
| |
Value:
int c = '*'; \
for (n = 0; n < max_size && (c = getc(
HECMW_ctrlin)) != 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_ctrlin)) == 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 667 of file hecmw_ctrllex.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_ctrl_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
◆ 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_ctrlensure_buffer_stack(); \
} \
}
#define YY_CURRENT_BUFFER
Definition at line 335 of file hecmw_ctrllex.c.
◆ yy_set_interactive
#define yy_set_interactive |
( |
|
is_interactive | ) |
|
Value: { \
HECMW_ctrlensure_buffer_stack(); \
} \
}
Definition at line 325 of file hecmw_ctrllex.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 = \
} while (0)
#define YY_DO_BEFORE_ACTION
Definition at line 1865 of file hecmw_ctrllex.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'; \
} while (0)
Definition at line 1865 of file hecmw_ctrllex.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_ctrl_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 1600 of file hecmw_ctrllex.c.
◆ HECMW_ctrl_delete_buffer()
◆ HECMW_ctrl_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 1668 of file hecmw_ctrllex.c.
◆ HECMW_ctrl_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 1782 of file hecmw_ctrllex.c.
◆ HECMW_ctrl_scan_bytes()
Setup the input buffer state to scan the given bytes. The next call to HECMW_ctrllex() 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 1828 of file hecmw_ctrllex.c.
◆ HECMW_ctrl_scan_string()
Setup the input buffer state to scan a string. The next call to HECMW_ctrllex() 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_ctrl_scan_bytes() instead.
Definition at line 1816 of file hecmw_ctrllex.c.
◆ HECMW_ctrl_switch_to_buffer()
Switch to a different input buffer.
- Parameters
-
new_buffer | The new input buffer. |
Definition at line 1559 of file hecmw_ctrllex.c.
◆ HECMW_ctrlalloc()
◆ HECMW_ctrlfree()
void HECMW_ctrlfree |
( |
void * |
ptr | ) |
|
◆ HECMW_ctrlget_debug()
int HECMW_ctrlget_debug |
( |
void |
| ) |
|
◆ HECMW_ctrlget_extra()
◆ HECMW_ctrlget_in()
FILE * HECMW_ctrlget_in |
( |
void |
| ) |
|
◆ HECMW_ctrlget_leng()
◆ HECMW_ctrlget_lineno()
int HECMW_ctrlget_lineno |
( |
void |
| ) |
|
◆ HECMW_ctrlget_out()
FILE * HECMW_ctrlget_out |
( |
void |
| ) |
|
◆ HECMW_ctrlget_text()
char * HECMW_ctrlget_text |
( |
void |
| ) |
|
◆ HECMW_ctrllex()
int HECMW_ctrllex |
( |
void |
| ) |
|
◆ HECMW_ctrllex_destroy()
int HECMW_ctrllex_destroy |
( |
void |
| ) |
|
◆ HECMW_ctrllex_get_lineno()
int HECMW_ctrllex_get_lineno |
( |
void |
| ) |
|
◆ HECMW_ctrllex_get_number()
double HECMW_ctrllex_get_number |
( |
void |
| ) |
|
◆ HECMW_ctrllex_get_text()
char * HECMW_ctrllex_get_text |
( |
void |
| ) |
|
◆ HECMW_ctrllex_next_token()
int HECMW_ctrllex_next_token |
( |
void |
| ) |
|
◆ HECMW_ctrllex_next_token_skip()
int HECMW_ctrllex_next_token_skip |
( |
int |
skip_token | ) |
|
◆ HECMW_ctrllex_set_input()
int HECMW_ctrllex_set_input |
( |
FILE * |
fp | ) |
|
◆ HECMW_ctrllex_skip_line()
int HECMW_ctrllex_skip_line |
( |
void |
| ) |
|
◆ HECMW_ctrllex_unput_token()
int HECMW_ctrllex_unput_token |
( |
void |
| ) |
|
◆ HECMW_ctrlpop_buffer_state()
void HECMW_ctrlpop_buffer_state |
( |
void |
| ) |
|
Removes and deletes the top of the stack, if present. The next element becomes the new top.
Definition at line 1717 of file hecmw_ctrllex.c.
◆ HECMW_ctrlpush_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 1691 of file hecmw_ctrllex.c.
◆ HECMW_ctrlrealloc()
void * HECMW_ctrlrealloc |
( |
void * |
ptr, |
|
|
yy_size_t |
size |
|
) |
| |
◆ HECMW_ctrlrestart()
void HECMW_ctrlrestart |
( |
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 1544 of file hecmw_ctrllex.c.
◆ HECMW_ctrlset_debug()
void HECMW_ctrlset_debug |
( |
int |
debug_flag | ) |
|
◆ HECMW_ctrlset_extra()
◆ HECMW_ctrlset_in()
void HECMW_ctrlset_in |
( |
FILE * |
in_str | ) |
|
◆ HECMW_ctrlset_lineno()
void HECMW_ctrlset_lineno |
( |
int |
line_number | ) |
|
◆ HECMW_ctrlset_out()
void HECMW_ctrlset_out |
( |
FILE * |
out_str | ) |
|
◆ HECMW_ctrlwrap()
int HECMW_ctrlwrap |
( |
void |
| ) |
|
◆ if()
◆ isatty()
◆ while()
◆ HECMW_ctrl_flex_debug
int HECMW_ctrl_flex_debug = 0 |
◆ HECMW_ctrlin
FILE * HECMW_ctrlin = (FILE *)0 |
◆ HECMW_ctrlleng
◆ HECMW_ctrllineno
◆ HECMW_ctrlout
FILE * HECMW_ctrlout = (FILE *)0 |
◆ HECMW_ctrltext
◆ yy_act
◆ yy_bp
◆ yy_cp
◆ YY_DECL
Initial value:The main scanner function which does all the work.
Definition at line 745 of file hecmw_ctrllex.c.