// variable (parameter, keyword-value) reference void DCompiler::Var(RefDNode n) { string V=n->getText(); int i=pro->FindVar(V); if( i != -1) { n->SetVarIx(i); return; } DVar *c=pro->FindCommonVar(V); if( c != NULL) { n->setType(VARPTR); n->SetVar(c); return; } SizeT u=pro->AddVar(V); if( env != NULL) { SizeT e=env->AddEnv(); if( u != e) throw GDLException("env and pro out of sync."); } n->SetVarIx(static_cast<int>(u)); // cout << "Added Var "<<V<<" as #" << u << endl; }
void DCompiler::SysVar(RefDNode n) { n->SetVar(NULL); }