MCPcopy Create free account
hub / github.com/devosoft/avida / VisitVariableReference

Method VisitVariableReference

avida-core/source/script/cSemanticASTVisitor.cc:828–843  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

826
827
828void cSemanticASTVisitor::VisitVariableReference(cASTVariableReference& node)
829{
830 if (m_fun_def_arg) {
831 SEMANTIC_ERROR(FUNCTION_DEFAULT_VARIABLE_REF_INVALID);
832 return;
833 }
834
835 int var_id = -1;
836 bool global = false;
837 if (lookupVariable(node.GetName(), var_id, global)) {
838 node.SetVar(var_id, global);
839 node.SetType(m_cur_symtbl->GetVariableType(var_id));
840 } else {
841 SEMANTIC_ERROR(VARIABLE_UNDEFINED, (const char*)node.GetName());
842 }
843}
844
845
846void cSemanticASTVisitor::VisitUnpackTarget(cASTUnpackTarget& node)

Callers

nothing calls this directly

Calls 3

GetNameMethod · 0.45
SetVarMethod · 0.45
SetTypeMethod · 0.45

Tested by

no test coverage detected