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

Function parse_test

Core/SoarKernel/src/parser.cpp:523–557  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

521----------------------------------------------------------------- */
522
523test parse_test(agent* thisAgent)
524{
525 complex_test* ct;
526 test t, temp;
527
528 if (thisAgent->lexeme.type != L_BRACE_LEXEME)
529 {
530 return parse_simple_test(thisAgent);
531 }
532 /* --- parse and return conjunctive test --- */
533 get_lexeme(thisAgent);
534 t = make_blank_test();
535 do
536 {
537 temp = parse_simple_test(thisAgent);
538 if (!temp)
539 {
540 deallocate_test(thisAgent, t);
541 return NIL;
542 }
543 add_new_test_to_test(thisAgent, &t, temp);
544 }
545 while (thisAgent->lexeme.type != R_BRACE_LEXEME);
546 get_lexeme(thisAgent); /* consume the "}" */
547
548 if (test_is_complex_test(t))
549 {
550 ct = complex_test_from_test(t);
551 if (ct->type == CONJUNCTIVE_TEST)
552 ct->data.conjunct_list =
553 destructively_reverse_list(ct->data.conjunct_list);
554 }
555
556 return t;
557}
558
559/* =================================================================
560 Routines for Conditions

Callers 3

parse_value_test_starFunction · 0.85
parse_attr_value_testsFunction · 0.85

Calls 8

parse_simple_testFunction · 0.85
get_lexemeFunction · 0.85
make_blank_testFunction · 0.85
deallocate_testFunction · 0.85
add_new_test_to_testFunction · 0.85
test_is_complex_testFunction · 0.85
complex_test_from_testFunction · 0.85

Tested by

no test coverage detected