| 1932 | ----------------------------------------------------------------- */ |
| 1933 | |
| 1934 | action* parse_attr_value_make(agent* thisAgent, Symbol* id) |
| 1935 | { |
| 1936 | rhs_value attr, value; |
| 1937 | action* all_actions, *new_actions, *last; |
| 1938 | Symbol* old_id, *new_var; |
| 1939 | |
| 1940 | /* JC Added, need to store the attribute name */ |
| 1941 | char szAttribute[256]; |
| 1942 | |
| 1943 | if (thisAgent->lexeme.type != UP_ARROW_LEXEME) |
| 1944 | { |
| 1945 | print(thisAgent, "Expected ^ in RHS make action\n"); |
| 1946 | print_location_of_most_recent_lexeme(thisAgent); |
| 1947 | return NIL; |
| 1948 | } |
| 1949 | old_id = id; |
| 1950 | |
| 1951 | get_lexeme(thisAgent); /* consume up-arrow, advance to attribute */ |
| 1952 | attr = parse_rhs_value(thisAgent); |
| 1953 | if (! attr) |
| 1954 | { |
| 1955 | return NIL; |
| 1956 | } |
| 1957 | |
| 1958 | /* JC Added, we will need the attribute as a string, so we get it here */ |
| 1959 | rhs_value_to_string(attr, szAttribute, 256); |
| 1960 | |
| 1961 | all_actions = NIL; |
| 1962 | |
| 1963 | /* allow dot notation "." in RHS attribute path 10/15/98 KJC */ |
| 1964 | while (thisAgent->lexeme.type == PERIOD_LEXEME) |
| 1965 | { |
| 1966 | get_lexeme(thisAgent); /* consume the "." */ |
| 1967 | |
| 1968 | /* set up for next attribute in path: make dummy variable, |
| 1969 | and create new action in the path */ |
| 1970 | new_var = make_placeholder_var(thisAgent, first_letter_from_rhs_value(attr)); |
| 1971 | |
| 1972 | /* parse_preferences actually creates the action. Even though |
| 1973 | there aren't really any preferences to read, we need the default |
| 1974 | acceptable prefs created for all attributes in path */ |
| 1975 | |
| 1976 | if (strcmp(szAttribute, "operator") != 0) |
| 1977 | { |
| 1978 | new_actions = parse_preferences_soar8_non_operator(thisAgent, id, attr, |
| 1979 | symbol_to_rhs_value(new_var)); |
| 1980 | } |
| 1981 | else |
| 1982 | { |
| 1983 | new_actions = parse_preferences(thisAgent, id, attr, symbol_to_rhs_value(new_var)); |
| 1984 | } |
| 1985 | |
| 1986 | for (last = new_actions; last->next != NIL; last = last->next) |
| 1987 | /* continue */; |
| 1988 | |
| 1989 | last->next = all_actions; |
| 1990 | all_actions = new_actions; |
| 1991 |
no test coverage detected