示例#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(); }