Soar Kernel
9.3.2 08-06-12
|
#include <portability.h>
#include <stdlib.h>
#include "parser.h"
#include "symtab.h"
#include "kernel.h"
#include "gdatastructs.h"
#include "production.h"
#include "mem.h"
#include "rhsfun.h"
#include "agent.h"
#include "init_soar.h"
#include "print.h"
#include "rete.h"
#include "xml.h"
#include "reinforcement_learning.h"
#include "semantic_memory.h"
#include <ctype.h>
Go to the source code of this file.
Variables | |
const char * | help_on_lhs_grammar [] |
const char * | help_on_rhs_grammar [] |
Definition at line 1852 of file parser.cpp.
References action_struct::next, and NIL.
Referenced by parse_production().
Definition at line 546 of file parser.cpp.
References three_field_tests_struct::attr_test, CONJUNCTIVE_NEGATION_CONDITION, copy_of_equality_test_found_in_test(), copy_test(), condition_struct::data, deallocate_test(), condition_struct::condition_main_data_union::ncc, condition_struct::next, NIL, POSITIVE_CONDITION, condition_struct::condition_main_data_union::tests, ncc_info_struct::top, and condition_struct::type.
Referenced by parse_attr_value_tests().
Definition at line 510 of file parser.cpp.
References CONJUNCTIVE_NEGATION_CONDITION, copy_of_equality_test_found_in_test(), copy_test(), condition_struct::data, deallocate_test(), three_field_tests_struct::id_test, condition_struct::condition_main_data_union::ncc, condition_struct::next, NIL, POSITIVE_CONDITION, condition_struct::condition_main_data_union::tests, ncc_info_struct::top, and condition_struct::type.
Referenced by parse_attr_value_tests(), and parse_conds_for_one_id().
Bool is_preference_lexeme | ( | enum lexer_token_type | test_lexeme | ) |
Definition at line 1260 of file parser.cpp.
References AMPERSAND_LEXEME, EQUAL_LEXEME, EXCLAMATION_POINT_LEXEME, FALSE, GREATER_LEXEME, LESS_LEXEME, MINUS_LEXEME, PLUS_LEXEME, TILDE_LEXEME, and TRUE.
Referenced by parse_preference_specifier_without_referent().
Definition at line 92 of file parser.cpp.
References make_equality_test_without_adding_reference(), and make_placeholder_var().
Referenced by parse_attr_value_tests(), parse_head_of_conds_for_one_id(), parse_tail_of_conds_for_one_id(), and parse_value_test_star().
Definition at line 62 of file parser.cpp.
References make_variable(), NIL, and agent_struct::placeholder_counter.
Referenced by make_placeholder_test(), and parse_attr_value_make().
Definition at line 257 of file parser.cpp.
References abort_with_fatal_error(), BUFFER_MSG_SIZE, FLOAT_CONSTANT_LEXEME, lexeme_info::float_val, lexeme_info::id_letter, lexeme_info::id_number, IDENTIFIER_LEXEME, INT_CONSTANT_LEXEME, lexeme_info::int_val, agent_struct::lexeme, make_float_constant(), make_int_constant(), make_sym_constant(), make_variable(), NIL, smem_lti_get_id(), smem_lti_soar_make(), SMEM_LTI_UNKNOWN_LEVEL, lexeme_info::string, SYM_CONSTANT_LEXEME, lexeme_info::type, and VARIABLE_LEXEME.
Referenced by parse_disjunction_test(), parse_relational_test(), and parse_rhs_value().
Definition at line 592 of file parser.cpp.
References ncc_info_struct::bottom, agent_struct::condition_pool, CONJUNCTIVE_NEGATION_CONDITION, condition_struct::data, condition_struct::condition_main_data_union::ncc, NEGATIVE_CONDITION, condition_struct::next, NIL, POSITIVE_CONDITION, condition_struct::prev, ncc_info_struct::top, and condition_struct::type.
Referenced by parse_attr_value_tests(), and parse_cond().
Definition at line 1616 of file parser.cpp.
References deallocate_action_list(), deallocate_rhs_value(), first_letter_from_rhs_value(), get_lexeme(), agent_struct::lexeme, make_placeholder_var(), action_struct::next, NIL, parse_preferences(), parse_preferences_soar8_non_operator(), parse_rhs_value(), PERIOD_LEXEME, print(), print_location_of_most_recent_lexeme(), R_PAREN_LEXEME, rhs_value_to_string(), symbol_remove_ref(), symbol_to_rhs_value(), lexeme_info::type, and UP_ARROW_LEXEME.
Referenced by parse_rhs_action().
Definition at line 706 of file parser.cpp.
References add_new_test_to_test(), three_field_tests_struct::attr_test, agent_struct::condition_pool, copy_test(), condition_struct::data, deallocate_condition_list(), deallocate_test(), FALSE, fill_in_attr_tests(), fill_in_id_tests(), first_letter_from_test(), get_lexeme(), three_field_tests_struct::id_test, agent_struct::lexeme, make_placeholder_test(), MINUS_LEXEME, negate_condition_list(), condition_struct::next, NIL, parse_test(), parse_value_test_star(), PERIOD_LEXEME, POSITIVE_CONDITION, condition_struct::prev, print(), print_location_of_most_recent_lexeme(), condition_struct::test_for_acceptable_preference, test_includes_equality_test_for_symbol(), condition_struct::condition_main_data_union::tests, TRUE, lexeme_info::type, condition_struct::type, UP_ARROW_LEXEME, and three_field_tests_struct::value_test.
Referenced by parse_tail_of_conds_for_one_id().
Definition at line 982 of file parser.cpp.
References deallocate_condition_list(), FALSE, get_lexeme(), L_BRACE_LEXEME, agent_struct::lexeme, MINUS_LEXEME, negate_condition_list(), NIL, parse_cond_plus(), parse_conds_for_one_id(), print(), print_location_of_most_recent_lexeme(), R_BRACE_LEXEME, TRUE, and lexeme_info::type.
Referenced by parse_cond_plus().
Definition at line 1021 of file parser.cpp.
References deallocate_condition_list(), L_BRACE_LEXEME, L_PAREN_LEXEME, agent_struct::lexeme, MINUS_LEXEME, condition_struct::next, NIL, parse_cond(), condition_struct::prev, and lexeme_info::type.
Referenced by parse_cond(), and parse_lhs().
condition * parse_conds_for_one_id | ( | agent * | thisAgent, |
char | first_letter_if_no_id_given, | ||
test * | dest_id_test | ||
) |
Definition at line 943 of file parser.cpp.
References copy_of_equality_test_found_in_test(), deallocate_test(), fill_in_id_tests(), NIL, parse_head_of_conds_for_one_id(), and parse_tail_of_conds_for_one_id().
Referenced by parse_cond(), and parse_value_test_star().
Definition at line 403 of file parser.cpp.
References agent_struct::complex_test_pool, complex_test_struct::data, deallocate_test(), destructively_reverse_list(), complex_test_struct::test_info_union::disjunction_list, DISJUNCTION_TEST, FLOAT_CONSTANT_LEXEME, get_lexeme(), GREATER_GREATER_LEXEME, INT_CONSTANT_LEXEME, LESS_LESS_LEXEME, agent_struct::lexeme, make_symbol_for_current_lexeme(), make_test_from_complex_test(), NIL, print(), print_location_of_most_recent_lexeme(), push(), SYM_CONSTANT_LEXEME, lexeme_info::type, and complex_test_struct::type.
Referenced by parse_simple_test().
Definition at line 1141 of file parser.cpp.
References allocate_cons(), rhs_function_struct::can_be_rhs_value, rhs_function_struct::can_be_stand_alone_action, deallocate_rhs_value(), find_sym_constant(), cons_struct::first, funcall_list_to_rhs_value(), get_lexeme(), agent_struct::lexeme, lookup_rhs_function(), MINUS_LEXEME, sym_constant_struct::name, rhs_function_struct::name, NIL, rhs_function_struct::num_args_expected, parse_rhs_value(), PLUS_LEXEME, print(), print_location_of_most_recent_lexeme(), R_PAREN_LEXEME, cons_struct::rest, symbol_union::sc, lexeme_info::string, and lexeme_info::type.
Referenced by parse_rhs_action(), and parse_rhs_value().
Definition at line 797 of file parser.cpp.
References add_new_test_to_test(), add_to_growable_string(), agent_struct::complex_test_pool, copy_of_equality_test_found_in_test(), deallocate_test(), free_growable_string(), get_lexeme(), GOAL_ID_TEST, IDENTIFIER_SYMBOL_TYPE, IMPASSE_ID_TEST, L_PAREN_LEXEME, agent_struct::lexeme, make_blank_growable_string(), make_blank_test(), make_placeholder_test(), make_test_from_complex_test(), MINUS_LEXEME, NIL, parse_test(), print(), print_location_of_most_recent_lexeme(), print_with_symbols(), R_PAREN_LEXEME, referent_of_equality_test(), lexeme_info::string, SYM_CONSTANT_LEXEME, symbol_to_string(), test_includes_equality_test_for_symbol(), text_of_growable_string(), lexeme_info::type, complex_test_struct::type, UP_ARROW_LEXEME, VARIABLE_SYMBOL_TYPE, and xml_generate_warning().
Referenced by parse_conds_for_one_id().
Definition at line 1050 of file parser.cpp.
References NIL, and parse_cond_plus().
Referenced by parse_production().
bool parse_lti | ( | agent * | thisAgent | ) |
Definition at line 1791 of file parser.cpp.
References AT_LEXEME, get_lexeme(), get_lexer_allow_ids(), agent_struct::lexeme, set_lexer_allow_ids(), and lexeme_info::type.
Referenced by parse_relational_test(), parse_rhs_action(), and parse_rhs_value().
Definition at line 1308 of file parser.cpp.
References ACCEPTABLE_PREFERENCE_TYPE, AMPERSAND_LEXEME, BEST_PREFERENCE_TYPE, BETTER_PREFERENCE_TYPE, BINARY_INDIFFERENT_PREFERENCE_TYPE, BINARY_PARALLEL_PREFERENCE_TYPE, COMMA_LEXEME, EQUAL_LEXEME, EXCLAMATION_POINT_LEXEME, FLOAT_CONSTANT_LEXEME, get_lexeme(), GREATER_LEXEME, INT_CONSTANT_LEXEME, is_preference_lexeme(), LESS_LEXEME, agent_struct::lexeme, MINUS_LEXEME, NUMERIC_INDIFFERENT_PREFERENCE_TYPE, PLUS_LEXEME, PROHIBIT_PREFERENCE_TYPE, R_PAREN_LEXEME, REJECT_PREFERENCE_TYPE, REQUIRE_PREFERENCE_TYPE, TILDE_LEXEME, lexeme_info::type, UNARY_INDIFFERENT_PREFERENCE_TYPE, UNARY_PARALLEL_PREFERENCE_TYPE, UP_ARROW_LEXEME, WORSE_PREFERENCE_TYPE, and WORST_PREFERENCE_TYPE.
Referenced by parse_preferences(), and parse_preferences_soar8_non_operator().
Definition at line 1412 of file parser.cpp.
References ACCEPTABLE_PREFERENCE_TYPE, agent_struct::action_pool, action_struct::attr, COMMA_LEXEME, copy_rhs_value(), deallocate_action_list(), get_lexeme(), action_struct::id, agent_struct::lexeme, MAKE_ACTION, action_struct::next, NIL, parse_preference_specifier_without_referent(), parse_rhs_value(), PLUS_LEXEME, preference_is_binary(), action_struct::preference_type, action_struct::referent, symbol_add_ref(), symbol_to_rhs_value(), TRUE, lexeme_info::type, action_struct::type, and action_struct::value.
Referenced by parse_attr_value_make().
action* parse_preferences_soar8_non_operator | ( | agent * | thisAgent, |
Symbol * | id, | ||
rhs_value | attr, | ||
rhs_value | value | ||
) |
Definition at line 1493 of file parser.cpp.
References ACCEPTABLE_PREFERENCE_TYPE, agent_struct::action_pool, action_struct::attr, COMMA_LEXEME, copy_rhs_value(), deallocate_action_list(), get_lexeme(), action_struct::id, agent_struct::lexeme, MAKE_ACTION, action_struct::next, NIL, parse_preference_specifier_without_referent(), PLUS_LEXEME, preference_is_binary(), action_struct::preference_type, print(), print_location_of_most_recent_lexeme(), REJECT_PREFERENCE_TYPE, rhs_value_to_string(), symbol_add_ref(), symbol_to_rhs_value(), symbol_to_string(), TRUE, lexeme_info::type, action_struct::type, action_struct::value, and xml_generate_warning().
Referenced by parse_attr_value_make().
|
read |
Definition at line 1878 of file parser.cpp.
References add_production_to_rete(), CHUNK_PRODUCTION_TYPE, deallocate_action_list(), deallocate_condition_list(), DECLARED_I_SUPPORT, DECLARED_O_SUPPORT, production_struct::declared_support, DEFAULT_PRODUCTION_TYPE, destructively_reverse_action_list(), production_struct::documentation, DUPLICATE_PRODUCTION, excise_production(), FALSE, free_memory_block_for_string(), get_lexeme(), production_struct::interrupt, agent_struct::lexeme, make_memory_block_for_string(), make_production(), make_sym_constant(), agent_struct::name, condition_struct::next, NIL, parse_lhs(), parse_rhs(), print(), print_location_of_most_recent_lexeme(), print_with_symbols(), sym_constant_struct::production, QUOTED_STRING_LEXEME, R_PAREN_LEXEME, reset_placeholder_variable_generator(), reset_variable_generator(), RIGHT_ARROW_LEXEME, production_struct::rl_rule, rl_rule_meta(), rl_valid_template(), symbol_union::sc, lexeme_info::string, substitute_for_placeholders_in_action_list(), substitute_for_placeholders_in_condition_list(), SYM_CONSTANT_LEXEME, symbol_remove_ref(), agent_struct::sysparams, TEMPLATE_PRODUCTION_TYPE, TRACE_LOADING_SYSPARAM, TRUE, lexeme_info::type, UNDECLARED_SUPPORT, and USER_PRODUCTION_TYPE.
Definition at line 315 of file parser.cpp.
References agent_struct::complex_test_pool, complex_test_struct::data, EQUAL_LEXEME, FALSE, FLOAT_CONSTANT_LEXEME, get_lexeme(), GREATER_EQUAL_LEXEME, GREATER_LEXEME, GREATER_OR_EQUAL_TEST, GREATER_TEST, IDENTIFIER_LEXEME, INT_CONSTANT_LEXEME, LESS_EQUAL_GREATER_LEXEME, LESS_EQUAL_LEXEME, LESS_LEXEME, LESS_OR_EQUAL_TEST, LESS_TEST, agent_struct::lexeme, make_equality_test_without_adding_reference(), make_symbol_for_current_lexeme(), make_test_from_complex_test(), NIL, NOT_EQUAL_LEXEME, NOT_EQUAL_TEST, parse_lti(), print(), print_location_of_most_recent_lexeme(), complex_test_struct::test_info_union::referent, SAME_TYPE_TEST, SYM_CONSTANT_LEXEME, TRUE, lexeme_info::type, complex_test_struct::type, and VARIABLE_LEXEME.
Referenced by parse_simple_test().
Definition at line 1817 of file parser.cpp.
References deallocate_action_list(), FALSE, agent_struct::lexeme, action_struct::next, NIL, parse_rhs_action(), R_PAREN_LEXEME, TRUE, and lexeme_info::type.
Referenced by parse_production().
Definition at line 1729 of file parser.cpp.
References abort_with_fatal_error(), agent_struct::action_pool, BUFFER_MSG_SIZE, deallocate_action_list(), FUNCALL_ACTION, get_lexeme(), lexeme_info::id_letter, lexeme_info::id_number, IDENTIFIER_LEXEME, L_PAREN_LEXEME, agent_struct::lexeme, make_variable(), action_struct::next, NIL, parse_attr_value_make(), parse_function_call_after_lparen(), parse_lti(), print(), print_location_of_most_recent_lexeme(), R_PAREN_LEXEME, smem_lti_get_id(), smem_lti_soar_make(), SMEM_LTI_UNKNOWN_LEVEL, lexeme_info::string, symbol_remove_ref(), TRUE, lexeme_info::type, action_struct::type, action_struct::value, and VARIABLE_LEXEME.
Referenced by parse_rhs().
Definition at line 1225 of file parser.cpp.
References FALSE, FLOAT_CONSTANT_LEXEME, get_lexeme(), IDENTIFIER_LEXEME, INT_CONSTANT_LEXEME, L_PAREN_LEXEME, agent_struct::lexeme, make_symbol_for_current_lexeme(), parse_function_call_after_lparen(), parse_lti(), print(), print_location_of_most_recent_lexeme(), SYM_CONSTANT_LEXEME, symbol_to_rhs_value(), lexeme_info::type, and VARIABLE_LEXEME.
Referenced by parse_attr_value_make(), parse_function_call_after_lparen(), and parse_preferences().
Definition at line 446 of file parser.cpp.
References LESS_LESS_LEXEME, agent_struct::lexeme, parse_disjunction_test(), parse_relational_test(), and lexeme_info::type.
Referenced by parse_test().
Definition at line 887 of file parser.cpp.
References three_field_tests_struct::attr_test, agent_struct::condition_pool, condition_struct::data, deallocate_condition_list(), FALSE, get_lexeme(), three_field_tests_struct::id_test, agent_struct::lexeme, make_placeholder_test(), condition_struct::next, NIL, parse_attr_value_tests(), POSITIVE_CONDITION, condition_struct::prev, R_PAREN_LEXEME, condition_struct::test_for_acceptable_preference, condition_struct::condition_main_data_union::tests, lexeme_info::type, condition_struct::type, and three_field_tests_struct::value_test.
Referenced by parse_conds_for_one_id().
Definition at line 459 of file parser.cpp.
References add_new_test_to_test(), complex_test_from_test(), complex_test_struct::test_info_union::conjunct_list, CONJUNCTIVE_TEST, complex_test_struct::data, deallocate_test(), destructively_reverse_list(), get_lexeme(), L_BRACE_LEXEME, agent_struct::lexeme, make_blank_test(), NIL, parse_simple_test(), R_BRACE_LEXEME, test_is_complex_test(), lexeme_info::type, and complex_test_struct::type.
Referenced by parse_attr_value_tests(), parse_head_of_conds_for_one_id(), and parse_value_test_star().
Definition at line 634 of file parser.cpp.
References add_new_test_to_test(), three_field_tests_struct::attr_test, agent_struct::condition_pool, condition_struct::data, deallocate_condition_list(), FALSE, get_lexeme(), three_field_tests_struct::id_test, insert_at_head_of_dll, L_PAREN_LEXEME, agent_struct::lexeme, make_placeholder_test(), MINUS_LEXEME, condition_struct::next, NIL, parse_conds_for_one_id(), parse_test(), PLUS_LEXEME, POSITIVE_CONDITION, condition_struct::prev, R_PAREN_LEXEME, condition_struct::test_for_acceptable_preference, test_includes_equality_test_for_symbol(), condition_struct::condition_main_data_union::tests, TRUE, lexeme_info::type, condition_struct::type, UP_ARROW_LEXEME, and three_field_tests_struct::value_test.
Referenced by parse_attr_value_tests().
void reset_placeholder_variable_generator | ( | agent * | thisAgent | ) |
Definition at line 57 of file parser.cpp.
References agent_struct::placeholder_counter.
Referenced by parse_production().
Definition at line 184 of file parser.cpp.
References action_struct::attr, action_struct::id, MAKE_ACTION, action_struct::next, NIL, rhs_value_is_symbol(), substitute_for_placeholders_in_symbol(), action_struct::type, and action_struct::value.
Referenced by parse_production().
Definition at line 167 of file parser.cpp.
References three_field_tests_struct::attr_test, CONJUNCTIVE_NEGATION_CONDITION, condition_struct::data, three_field_tests_struct::id_test, condition_struct::condition_main_data_union::ncc, NEGATIVE_CONDITION, condition_struct::next, NIL, POSITIVE_CONDITION, substitute_for_placeholders_in_test(), condition_struct::condition_main_data_union::tests, ncc_info_struct::top, condition_struct::type, and three_field_tests_struct::value_test.
Referenced by parse_production().
Definition at line 113 of file parser.cpp.
References variable_struct::current_binding_value, FALSE, generate_new_variable(), symbol_add_ref(), symbol_remove_ref(), TRUE, symbol_union::var, and VARIABLE_SYMBOL_TYPE.
Referenced by substitute_for_placeholders_in_action_list(), and substitute_for_placeholders_in_test().
Definition at line 139 of file parser.cpp.
References complex_test_from_test(), complex_test_struct::test_info_union::conjunct_list, CONJUNCTIVE_TEST, complex_test_struct::data, DISJUNCTION_TEST, cons_struct::first, GOAL_ID_TEST, IMPASSE_ID_TEST, NIL, complex_test_struct::test_info_union::referent, cons_struct::rest, substitute_for_placeholders_in_symbol(), test_is_blank_or_equality_test(), test_is_blank_test(), and complex_test_struct::type.
Referenced by substitute_for_placeholders_in_condition_list().
const char* help_on_lhs_grammar[] |
Definition at line 224 of file parser.cpp.
const char* help_on_rhs_grammar[] |
Definition at line 1099 of file parser.cpp.