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

Function smem_parse_chunk

Core/SoarKernel/src/semantic_memory.cpp:3468–3778  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3466}
3467
3468bool smem_parse_chunk(agent* thisAgent, smem_str_to_chunk_map* chunks, smem_chunk_set* newbies)
3469{
3470 bool return_val = false;
3471
3472 smem_chunk* new_chunk = new smem_chunk;
3473 new_chunk->slots = NULL;
3474
3475 std::string* chunk_name = NULL;
3476
3477 char temp_letter;
3478 uint64_t temp_number;
3479
3480 bool good_at;
3481
3482 //
3483
3484 // consume left paren
3485 get_lexeme(thisAgent);
3486
3487 if ((thisAgent->lexeme.type == AT_LEXEME) || (thisAgent->lexeme.type == IDENTIFIER_LEXEME) || (thisAgent->lexeme.type == VARIABLE_LEXEME))
3488 {
3489 good_at = true;
3490
3491 if (thisAgent->lexeme.type == AT_LEXEME)
3492 {
3493 get_lexeme(thisAgent);
3494
3495 good_at = (thisAgent->lexeme.type == IDENTIFIER_LEXEME);
3496 }
3497
3498 if (good_at)
3499 {
3500 // save identifier
3501 chunk_name = smem_parse_lti_name(&(thisAgent->lexeme), &(temp_letter), &(temp_number));
3502 new_chunk->lti_letter = temp_letter;
3503 new_chunk->lti_number = temp_number;
3504 new_chunk->lti_id = NIL;
3505 new_chunk->soar_id = NIL;
3506 new_chunk->slots = new smem_slot_map;
3507
3508 // consume id
3509 get_lexeme(thisAgent);
3510
3511 //
3512
3513 uint64_t intermediate_counter = 1;
3514 smem_chunk* intermediate_parent;
3515 smem_chunk* temp_chunk;
3516 std::string temp_key;
3517 std::string* temp_key2;
3518 Symbol* chunk_attr;
3519 smem_chunk_value* chunk_value;
3520 smem_slot* s;
3521
3522 // populate slots
3523 while (thisAgent->lexeme.type == UP_ARROW_LEXEME)
3524 {
3525 intermediate_parent = new_chunk;

Callers 1

smem_parse_chunksFunction · 0.85

Calls 15

get_lexemeFunction · 0.85
smem_parse_lti_nameFunction · 0.85
smem_parse_constant_attrFunction · 0.85
smem_make_slotFunction · 0.85
make_str_constantFunction · 0.85
make_int_constantFunction · 0.85
make_float_constantFunction · 0.85
symbol_remove_refFunction · 0.85
smem_deallocate_chunkFunction · 0.85
endMethod · 0.80
push_backMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected