Exemple #1
0
 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;
 }
Exemple #2
0
 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;
 }
Exemple #3
0
 virtual bool isConstant() {
     return id->getDeclaration() &&
         id->getDeclaration()->isConstant();
 }
Exemple #4
0
 Declaration *getDeclaration() { return id->getDeclaration(); }