예제 #1
0
파일: ast.hpp 프로젝트: bsurmanski/wlc
 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;
 }
예제 #2
0
파일: ast.hpp 프로젝트: bsurmanski/wlc
 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;
 }
예제 #3
0
파일: ast.hpp 프로젝트: bsurmanski/wlc
 virtual bool isConstant() {
     return id->getDeclaration() &&
         id->getDeclaration()->isConstant();
 }
예제 #4
0
파일: ast.hpp 프로젝트: bsurmanski/wlc
 Declaration *getDeclaration() { return id->getDeclaration(); }