| 810 | } |
| 811 | |
| 812 | void get_lexeme_from_string(agent* thisAgent, const char* the_lexeme) |
| 813 | { |
| 814 | int i; |
| 815 | const char* c; |
| 816 | bool sym_constant_start_found = false; |
| 817 | bool sym_constant_end_found = false; |
| 818 | |
| 819 | for (c = the_lexeme, i = 0; *c; c++, i++) |
| 820 | { |
| 821 | if (*c == '|') |
| 822 | { |
| 823 | if (!sym_constant_start_found) |
| 824 | { |
| 825 | i--; |
| 826 | sym_constant_start_found = true; |
| 827 | } |
| 828 | else |
| 829 | { |
| 830 | i--; |
| 831 | sym_constant_end_found = true; |
| 832 | } |
| 833 | } |
| 834 | else |
| 835 | { |
| 836 | thisAgent->lexeme.string[i] = *c; |
| 837 | } |
| 838 | } |
| 839 | |
| 840 | thisAgent->lexeme.string[i] = '\0'; /* Null terminate lexeme string */ |
| 841 | |
| 842 | thisAgent->lexeme.length = i; |
| 843 | |
| 844 | if (sym_constant_end_found) |
| 845 | { |
| 846 | thisAgent->lexeme.type = SYM_CONSTANT_LEXEME; |
| 847 | } |
| 848 | else |
| 849 | { |
| 850 | determine_type_of_constituent_string(thisAgent); |
| 851 | } |
| 852 | } |
| 853 | |
| 854 | Symbol* read_identifier_or_context_variable(agent* thisAgent) |
| 855 | { |
no test coverage detected