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

Function get_lexeme_from_string

Core/CLI/src/cli_CommandLineInterface.cpp:812–852  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

810}
811
812void 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
854Symbol* read_identifier_or_context_variable(agent* thisAgent)
855{

Callers 7

ExplainChunksFunction · 0.85
print_symbolFunction · 0.85
DoSMemMethod · 0.85
DoAddWMEMethod · 0.85

Tested by

no test coverage detected