Go to the source code of this file.
Macros | |
#define | isoctal(c) (c=='0'||c=='1'||c=='2'||c=='3'||c=='4'||c=='5'||c=='6'||c=='7') |
Variables | |
long | trace_input =FALSE |
static long | inchange |
static long | outchange |
static FILE * | out |
ptr_psi_term | old_state =NULL |
#define isoctal | ( | c | ) | (c=='0'||c=='1'||c=='2'||c=='3'||c=='4'||c=='5'||c=='6'||c=='7') |
void begin_terminal_io | ( | ) |
Definition at line 410 of file token.c.
References inchange, input_state, input_stream, open_input_file(), out, outchange, and output_stream.
void bk_stack_add_psi_attr | ( | ptr_psi_term | t, |
char * | attrname, | ||
ptr_psi_term | g | ||
) |
Definition at line 200 of file token.c.
References bk_stack_insert(), FEATCMP, and heap_copy_string().
void end_terminal_io | ( | ) |
Definition at line 431 of file token.c.
References inchange, input_state, NULL, old_state, out, outchange, output_stream, and restore_state().
GENERIC get_attr | ( | ptr_psi_term | t, |
char * | attrname | ||
) |
Definition at line 210 of file token.c.
References wl_node::data, FEATCMP, and find().
FILE* get_stream | ( | ptr_psi_term | t | ) |
void heap_add_int_attr | ( | ptr_psi_term | t, |
char * | attrname, | ||
long | value | ||
) |
Definition at line 58 of file token.c.
References FEATCMP, heap_alloc(), heap_copy_string(), heap_insert(), heap_psi_term(), integer, REAL, wl_psi_term::type, and wl_psi_term::value_3.
void heap_add_psi_attr | ( | ptr_psi_term | t, |
char * | attrname, | ||
ptr_psi_term | g | ||
) |
Definition at line 184 of file token.c.
References FEATCMP, heap_copy_string(), and heap_insert().
void heap_add_str_attr | ( | ptr_psi_term | t, |
char * | attrname, | ||
char * | str | ||
) |
Definition at line 122 of file token.c.
References FEATCMP, heap_copy_string(), heap_insert(), heap_psi_term(), quoted_string, wl_psi_term::type, and wl_psi_term::value_3.
void heap_mod_int_attr | ( | ptr_psi_term | t, |
char * | attrname, | ||
long | value | ||
) |
Definition at line 91 of file token.c.
References wl_node::data, FEATCMP, find(), REAL, and wl_psi_term::value_3.
void heap_mod_str_attr | ( | ptr_psi_term | t, |
char * | attrname, | ||
char * | str | ||
) |
Definition at line 153 of file token.c.
References wl_node::data, FEATCMP, find(), heap_copy_string(), and wl_psi_term::value_3.
void init_parse_state | ( | ) |
Definition at line 381 of file token.c.
References eof_flag, FALSE, line_count, NULL, old_saved_char, old_saved_psi_term, saved_char, saved_psi_term, start_of_line, stringparse, and TRUE.
long legal_in_name | ( | long | c | ) |
void new_state | ( | ptr_psi_term * | t | ) |
Definition at line 301 of file token.c.
References current_module, CURRENT_MODULE, eof_flag, EOF_FLAG, heap_add_int_attr(), heap_add_psi_attr(), heap_add_str_attr(), heap_psi_term(), input_file_name, INPUT_FILE_NAME, input_stream, inputfilesym, lf_false, lf_true, line_count, LINE_COUNT, wl_module::module_name, null_psi_term, old_saved_char, OLD_SAVED_CHAR, old_saved_psi_term, OLD_SAVED_PSI_TERM, saved_char, SAVED_CHAR, saved_psi_term, SAVED_PSI_TERM, start_of_line, START_OF_LINE, stream, STREAM, wl_psi_term::type, and wl_psi_term::value_3.
long open_input_file | ( | char * | file | ) |
Definition at line 504 of file token.c.
References Errorline(), expand_file_name(), FALSE, init_parse_state(), input_file_name, input_state, input_stream, new_state(), noisy, NULL, restore_state(), save_state(), stdin_state, and TRUE.
long open_output_file | ( | string | file | ) |
Definition at line 554 of file token.c.
References Errorline(), expand_file_name(), FALSE, NULL, output_stream, and TRUE.
void psi_term_error | ( | ) |
Definition at line 661 of file token.c.
References FALSE, input_file_name, parse_ok, perr_i(), perr_s(), and psi_term_line_number.
void put_back_char | ( | long | c | ) |
void put_back_token | ( | psi_term | t | ) |
Definition at line 647 of file token.c.
References Errorline(), NULL, old_saved_psi_term, saved_psi_term, and stack_copy_psi_term().
long read_char | ( | ) |
Definition at line 587 of file token.c.
References EOLN, FALSE, infoline(), input_stream, line_count, NULL, old_saved_char, prompt, saved_char, start_of_line, stringinput, stringparse, trace_input, and TRUE.
void read_comment | ( | ptr_psi_term | tok | ) |
void read_name | ( | ptr_psi_term | tok, |
long | ch, | ||
long (*)(long) | f, | ||
ptr_definition | typ | ||
) |
Definition at line 878 of file token.c.
References bk2_stack_insert(), constant, create_module(), FALSE, find(), global, heap_copy_string(), legal_in_name(), wl_module::module_name, NULL, put_back_char(), read_char(), STRCMP, STRLEN, SYMBOL, symbolic(), TOKEN_ERROR(), TRUE, update_symbol(), var_occurred, var_tree, and warningline().
void read_number | ( | ptr_psi_term | tok, |
long | c | ||
) |
Definition at line 986 of file token.c.
References DIGIT, heap_alloc(), integer, put_back_char(), read_char(), REAL, and real.
void read_string | ( | ptr_psi_term | tok, |
long | e | ||
) |
Definition at line 743 of file token.c.
References base2int(), FALSE, heap_copy_string(), isoctal, NULL, put_back_char(), read_char(), read_string_error(), STRLEN, TOKEN_ERROR(), TRUE, update_symbol(), and warningline().
void read_string_error | ( | int | n | ) |
Definition at line 689 of file token.c.
References FALSE, parse_ok, stringparse, and Syntaxerrorline().
void read_token | ( | ptr_psi_term | tok | ) |
void read_token_b | ( | ptr_psi_term | tok | ) |
void read_token_main | ( | ptr_psi_term | tok, |
long | for_parser | ||
) |
Definition at line 1073 of file token.c.
References bk2_stack_insert(), choice_stack, comment, constant, wl_psi_term::coref, current_module, cut, wl_node::data, DIGIT, eof, EOLN, Errorline(), FALSE, final_dot, final_question, find(), legal_in_name(), line_count, LOWER, nothing, NULL, old_saved_psi_term, prompt, psi_term_line_number, put_back_char(), quoted_string, read_char(), read_comment(), read_name(), read_number(), read_string(), read_token(), saved_psi_term, SINGLE, stack_psi_term(), STRCMP, SYMBOL, symbolic(), TOKEN_ERROR(), TRUE, update_symbol(), UPPER, var_occurred, var_tree, and variable.
void restore_parse_state | ( | ptr_parse_block | pb | ) |
Definition at line 365 of file token.c.
References eof_flag, line_count, old_saved_char, old_saved_psi_term, saved_char, saved_psi_term, and start_of_line.
void restore_state | ( | ptr_psi_term | t | ) |
Definition at line 267 of file token.c.
References eof_flag, EOF_FLAG, get_attr(), input_file_name, INPUT_FILE_NAME, input_stream, lf_true, line_count, LINE_COUNT, NULL, null_psi_term, old_saved_char, OLD_SAVED_CHAR, old_saved_psi_term, OLD_SAVED_PSI_TERM, REAL, saved_char, SAVED_CHAR, saved_psi_term, SAVED_PSI_TERM, start_of_line, START_OF_LINE, and STREAM.
void save_parse_state | ( | ptr_parse_block | pb | ) |
Definition at line 350 of file token.c.
References eof_flag, wl_parse_block::lc, line_count, old_saved_char, old_saved_psi_term, saved_char, saved_psi_term, and start_of_line.
void save_state | ( | ptr_psi_term | t | ) |
Definition at line 230 of file token.c.
References wl_node::data, eof_flag, EOF_FLAG, FEATCMP, find(), heap_add_psi_attr(), heap_mod_int_attr(), heap_mod_str_attr(), heap_psi_term(), input_file_name, INPUT_FILE_NAME, input_stream, lf_false, lf_true, line_count, LINE_COUNT, null_psi_term, old_saved_char, OLD_SAVED_CHAR, old_saved_psi_term, OLD_SAVED_PSI_TERM, saved_char, SAVED_CHAR, saved_psi_term, SAVED_PSI_TERM, start_of_line, START_OF_LINE, STREAM, wl_psi_term::type, and wl_psi_term::value_3.
void stack_add_int_attr | ( | ptr_psi_term | t, |
char * | attrname, | ||
long | value | ||
) |
Definition at line 73 of file token.c.
References FEATCMP, heap_alloc(), heap_copy_string(), integer, REAL, stack_insert(), stack_psi_term(), wl_psi_term::type, and wl_psi_term::value_3.
void stack_add_psi_attr | ( | ptr_psi_term | t, |
char * | attrname, | ||
ptr_psi_term | g | ||
) |
Definition at line 192 of file token.c.
References FEATCMP, heap_copy_string(), and stack_insert().
void stack_add_str_attr | ( | ptr_psi_term | t, |
char * | attrname, | ||
char * | str | ||
) |
Definition at line 136 of file token.c.
References FEATCMP, heap_copy_string(), quoted_string, stack_copy_string(), stack_insert(), stack_psi_term(), wl_psi_term::type, and wl_psi_term::value_3.
void stdin_cleareof | ( | ) |
Definition at line 42 of file token.c.
References eof_flag, FALSE, NULL, old_saved_char, old_saved_psi_term, saved_char, saved_psi_term, start_of_line, stdin_terminal, and TRUE.
long symbolic | ( | long | c | ) |
void TOKEN_ERROR | ( | ptr_psi_term | p | ) |
Definition at line 30 of file token.c.
References error_psi_term, Syntaxerrorline(), and wl_psi_term::type.
ptr_psi_term old_state =NULL |