| 458 | ----------------------------------------------------------------- */ |
| 459 | |
| 460 | test parse_disjunction_test(agent* thisAgent) |
| 461 | { |
| 462 | complex_test* ct; |
| 463 | test t; |
| 464 | |
| 465 | if (thisAgent->lexeme.type != LESS_LESS_LEXEME) |
| 466 | { |
| 467 | print(thisAgent, "Expected << to begin disjunction test\n"); |
| 468 | print_location_of_most_recent_lexeme(thisAgent); |
| 469 | return NIL; |
| 470 | } |
| 471 | get_lexeme(thisAgent); |
| 472 | |
| 473 | allocate_with_pool(thisAgent, &thisAgent->complex_test_pool, &ct); |
| 474 | ct->type = DISJUNCTION_TEST; |
| 475 | ct->data.disjunction_list = NIL; |
| 476 | t = make_test_from_complex_test(ct); |
| 477 | |
| 478 | while (thisAgent->lexeme.type != GREATER_GREATER_LEXEME) |
| 479 | { |
| 480 | switch (thisAgent->lexeme.type) |
| 481 | { |
| 482 | case SYM_CONSTANT_LEXEME: |
| 483 | case INT_CONSTANT_LEXEME: |
| 484 | case FLOAT_CONSTANT_LEXEME: |
| 485 | push(thisAgent, make_symbol_for_current_lexeme(thisAgent, false), ct->data.disjunction_list); |
| 486 | get_lexeme(thisAgent); |
| 487 | break; |
| 488 | default: |
| 489 | print(thisAgent, "Expected constant or >> while reading disjunction test\n"); |
| 490 | print_location_of_most_recent_lexeme(thisAgent); |
| 491 | deallocate_test(thisAgent, t); |
| 492 | return NIL; |
| 493 | } |
| 494 | } |
| 495 | get_lexeme(thisAgent); /* consume the >> */ |
| 496 | ct->data.disjunction_list = |
| 497 | destructively_reverse_list(ct->data.disjunction_list); |
| 498 | return t; |
| 499 | } |
| 500 | |
| 501 | /* ----------------------------------------------------------------- |
| 502 | Parse Simple Test |
no test coverage detected