virtual Identifier *lookup(std::string member){ Identifier *id = getScope()->lookupInScope(member); if(base){ UserTypeDeclaration *bdecl = base->getDeclaration()->userTypeDeclaration(); if(!id && bdecl) id = bdecl->lookup(member); } return id; }
virtual int64_t asInteger() { if(isConstant()) { VariableDeclaration *vdecl = id->getDeclaration()->variableDeclaration(); if(vdecl && vdecl->value) { return vdecl->value->asInteger(); } } else { emit_message(msg::ERROR, "attempt to convert non-const identifier to int", loc); } return 0; }
virtual bool isConstant() { return id->getDeclaration() && id->getDeclaration()->isConstant(); }
Declaration *getDeclaration() { return id->getDeclaration(); }