Soar Kernel
9.3.2 08-06-12
|
#include <stdio.h>
Go to the source code of this file.
Data Structures | |
struct | lexeme_info |
struct | lexer_source_file_struct |
Macros | |
#define | BUFSIZE (MAX_LEXER_LINE_LENGTH+2) /* +2 for newline and null at end */ |
#define | LENGTH_OF_LONGEST_SPECIAL_LEXEME |
#define | MAX_LEXEME_LENGTH |
#define | MAX_LEXER_LINE_LENGTH 1000 |
Typedefs | |
typedef struct agent_struct | agent |
typedef char | Bool |
typedef struct lexer_source_file_struct | lexer_source_file |
Enumerations | |
enum | lexer_token_type |
Functions | |
int | current_lexer_parentheses_level (agent *thisAgent) |
void | determine_possible_symbol_types_for_string (char *s, size_t length_of_s, Bool *possible_id, Bool *possible_var, Bool *possible_sc, Bool *possible_ic, Bool *possible_fc, Bool *rereadable) |
Bool | determine_type_of_constituent_string (agent *thisAgent) |
void | fake_rparen_at_next_end_of_line (agent *thisAgent) |
void | get_lexeme (agent *thisAgent) |
Bool | get_lexer_allow_ids (agent *thisAgent) |
void | init_lexer (agent *thisAgent) |
void | print_location_of_most_recent_lexeme (agent *thisAgent) |
void | set_lexer_allow_ids (agent *thisAgent, Bool allow_identifiers) |
void | skip_ahead_to_balanced_parentheses (agent *thisAgent, int parentheses_level) |
void | start_lex_from_file (agent *thisAgent, const char *filename, FILE *already_opened_file) |
void | stop_lex_from_file (agent *thisAgent) |
#define BUFSIZE (MAX_LEXER_LINE_LENGTH+2) /* +2 for newline and null at end */ |
Definition at line 134 of file lexer.h.
Referenced by get_next_char().
#define LENGTH_OF_LONGEST_SPECIAL_LEXEME |
Definition at line 94 of file lexer.h.
Referenced by determine_possible_symbol_types_for_string().
#define MAX_LEXEME_LENGTH |
Definition at line 58 of file lexer.h.
Referenced by lex_dollar(), lex_quote(), lex_vbar(), parse_attribute_path_in_brackets(), parse_item_from_format_string(), print_production(), rhs_value_to_string(), symbol_to_string(), and test_to_string().
#define MAX_LEXER_LINE_LENGTH 1000 |
Definition at line 57 of file lexer.h.
Referenced by get_next_char().
typedef struct agent_struct agent |
typedef struct lexer_source_file_struct lexer_source_file |
enum lexer_token_type |
Definition at line 60 of file lexer.h.
Definition at line 1078 of file lexer.cpp.
References agent_struct::current_file, and lexer_source_file_struct::parentheses_level.
void determine_possible_symbol_types_for_string | ( | char * | s, |
size_t | length_of_s, | ||
Bool * | possible_id, | ||
Bool * | possible_var, | ||
Bool * | possible_sc, | ||
Bool * | possible_ic, | ||
Bool * | possible_fc, | ||
Bool * | rereadable | ||
) |
Definition at line 1125 of file lexer.cpp.
References constituent_char, FALSE, LENGTH_OF_LONGEST_SPECIAL_LEXEME, number_starters, and TRUE.
Referenced by determine_type_of_constituent_string(), get_io_symbol_from_tio_constituent_string(), and symbol_to_string().
Definition at line 307 of file lexer.cpp.
References lexer_source_file_struct::allow_ids, agent_struct::current_file, determine_possible_symbol_types_for_string(), FLOAT_CONSTANT_LEXEME, lexeme_info::float_val, lexeme_info::id_letter, lexeme_info::id_number, IDENTIFIER_LEXEME, INT_CONSTANT_LEXEME, lexeme_info::int_val, lexeme_info::length, agent_struct::lexeme, print(), print_location_of_most_recent_lexeme(), PRINT_WARNINGS_SYSPARAM, QUOTED_STRING_LEXEME, lexeme_info::string, SYM_CONSTANT_LEXEME, agent_struct::sysparams, TRUE, lexeme_info::type, VARIABLE_LEXEME, and xml_generate_warning().
Referenced by get_lexeme_from_string(), lex_ampersand(), lex_constituent_string(), lex_digit(), lex_equal(), lex_greater(), lex_less(), lex_minus(), lex_period(), and lex_plus().
void fake_rparen_at_next_end_of_line | ( | agent * | thisAgent | ) |
Definition at line 1092 of file lexer.cpp.
References agent_struct::current_file, lexer_source_file_struct::fake_rparen_at_eol, lexer_source_file_struct::parentheses_level, and TRUE.
void get_lexeme | ( | agent * | thisAgent | ) |
Definition at line 747 of file lexer.cpp.
References agent_struct::current_char, agent_struct::current_file, do_fake_rparen(), lexer_source_file_struct::fake_rparen_at_eol, FALSE, get_next_char(), lexeme_info::length, agent_struct::lex_alias, lex_eof(), expansion_node::lexeme, agent_struct::lexeme, lexer_routines(), agent_struct::load_errors_quit, expansion_node::next, record_position_of_start_of_lexeme(), lexeme_info::string, and whitespace.
Referenced by lex_unknown(), parse_attr_value_make(), parse_attr_value_tests(), parse_cond(), parse_disjunction_test(), parse_function_call_after_lparen(), parse_head_of_conds_for_one_id(), parse_lti(), parse_preference_specifier_without_referent(), parse_preferences(), parse_preferences_soar8_non_operator(), parse_production(), parse_relational_test(), parse_rhs_action(), parse_rhs_value(), parse_tail_of_conds_for_one_id(), parse_test(), parse_value_test_star(), skip_ahead_to_balanced_parentheses(), smem_parse_chunk(), and smem_parse_chunks().
Definition at line 1109 of file lexer.cpp.
References lexer_source_file_struct::allow_ids, and agent_struct::current_file.
Referenced by parse_lti().
void init_lexer | ( | agent * | thisAgent | ) |
Definition at line 861 of file lexer.cpp.
References constituent_char, lex_ampersand(), lex_at(), lex_comma(), lex_constituent_string(), lex_digit(), lex_dollar(), lex_equal(), lex_exclamation_point(), lex_greater(), lex_lbrace(), lex_less(), lex_lparen(), lex_minus(), lex_period(), lex_plus(), lex_quote(), lex_rbrace(), lex_rparen(), lex_tilde(), lex_up_arrow(), lex_vbar(), lexer_routines(), number_starters, start_lex_from_file(), TRUE, and whitespace.
Referenced by init_soar_agent().
void print_location_of_most_recent_lexeme | ( | agent * | thisAgent | ) |
Definition at line 1022 of file lexer.cpp.
References lexer_source_file_struct::buffer, lexer_source_file_struct::column_of_start_of_last_lexeme, agent_struct::current_char, agent_struct::current_file, lexer_source_file_struct::current_line, lexer_source_file_struct::filename, lexer_source_file_struct::line_of_start_of_last_lexeme, agent_struct::load_errors_quit, print(), print_string(), and reading_from_top_level().
Referenced by determine_type_of_constituent_string(), lex_quote(), lex_vbar(), parse_attr_value_make(), parse_attr_value_tests(), parse_cond(), parse_disjunction_test(), parse_function_call_after_lparen(), parse_head_of_conds_for_one_id(), parse_preferences_soar8_non_operator(), parse_production(), parse_relational_test(), parse_rhs_action(), parse_rhs_value(), and read_identifier_or_context_variable().
Definition at line 1105 of file lexer.cpp.
References lexer_source_file_struct::allow_ids, and agent_struct::current_file.
Referenced by parse_lti(), and smem_parse_chunks().
Definition at line 1082 of file lexer.cpp.
References agent_struct::current_file, EOF_LEXEME, get_lexeme(), agent_struct::lexeme, lexer_source_file_struct::parentheses_level, R_PAREN_LEXEME, TRUE, and lexeme_info::type.
void start_lex_from_file | ( | agent * | thisAgent, |
const char * | filename, | ||
FILE * | already_opened_file | ||
) |
Definition at line 94 of file lexer.cpp.
References allocate_memory(), lexer_source_file_struct::allow_ids, lexer_source_file_struct::buffer, lexer_source_file_struct::column_of_start_of_last_lexeme, agent_struct::current_char, lexer_source_file_struct::current_column, agent_struct::current_file, lexer_source_file_struct::current_line, lexer_source_file_struct::fake_rparen_at_eol, FALSE, lexer_source_file_struct::file, lexer_source_file_struct::filename, agent_struct::lexeme, lexer_source_file_struct::line_of_start_of_last_lexeme, make_memory_block_for_string(), MISCELLANEOUS_MEM_USAGE, lexer_source_file_struct::parent_file, lexer_source_file_struct::parentheses_level, lexer_source_file_struct::saved_current_char, lexer_source_file_struct::saved_lexeme, and TRUE.
Referenced by init_lexer(), and load_file().
void stop_lex_from_file | ( | agent * | thisAgent | ) |
Definition at line 117 of file lexer.cpp.
References agent_struct::current_char, agent_struct::current_file, lexer_source_file_struct::filename, free_memory(), free_memory_block_for_string(), agent_struct::lexeme, MISCELLANEOUS_MEM_USAGE, lexer_source_file_struct::parent_file, print(), reading_from_top_level(), lexer_source_file_struct::saved_current_char, and lexer_source_file_struct::saved_lexeme.
Referenced by load_file().