MCPcopy Create free account
hub / github.com/SoarGroup/Soar / parse_rhs_value

Function parse_rhs_value

Core/SoarKernel/src/parser.cpp:1493–1520  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1491----------------------------------------------------------------- */
1492
1493rhs_value parse_rhs_value(agent* thisAgent)
1494{
1495 rhs_value rv;
1496
1497 if (thisAgent->lexeme.type == L_PAREN_LEXEME)
1498 {
1499 get_lexeme(thisAgent);
1500 return parse_function_call_after_lparen(thisAgent, false);
1501 }
1502
1503 // Check for long term identifier notation
1504 bool id_lti = parse_lti(thisAgent);
1505
1506 if ((thisAgent->lexeme.type == SYM_CONSTANT_LEXEME) ||
1507 (thisAgent->lexeme.type == INT_CONSTANT_LEXEME) ||
1508 (thisAgent->lexeme.type == FLOAT_CONSTANT_LEXEME) ||
1509 (thisAgent->lexeme.type == VARIABLE_LEXEME) ||
1510 (thisAgent->lexeme.type == IDENTIFIER_LEXEME))
1511 {
1512 // IDENTIFIER_LEXEME only possible if id_lti true due to set_lexer_allow_ids above
1513 rv = symbol_to_rhs_value(make_symbol_for_current_lexeme(thisAgent, id_lti));
1514 get_lexeme(thisAgent);
1515 return rv;
1516 }
1517 print(thisAgent, "Illegal value for RHS value\n");
1518 print_location_of_most_recent_lexeme(thisAgent);
1519 return NULL;
1520}
1521
1522
1523/* -----------------------------------------------------------------

Callers 3

parse_preferencesFunction · 0.85
parse_attr_value_makeFunction · 0.85

Calls 7

get_lexemeFunction · 0.85
parse_ltiFunction · 0.85
symbol_to_rhs_valueFunction · 0.85
printFunction · 0.85

Tested by

no test coverage detected