Ejemplo n.º 1
0
bool AbstractEnv::checkIncludeProcessed(const FilePath&f) const {
	if (includeMap.find(f) != 0) return true;
	const IExprEnvironment *p = getParentScope();
	if (p) return p->checkIncludeProcessed(f);
	else return false;

}
Ejemplo n.º 2
0
StructureSymbol* BasicScope::resolveStructure(Type *type){
		
	string name = type->getName();
	auto currentScope = this->resolveNamedScope(type->getFullName());
	while(currentScope != nullptr){
		if(currentScope->getTypes().count(name)){
			break;
		}
		currentScope = currentScope->getParentScope();
	}

	if(!currentScope || !currentScope->getTypes().count(name)){
		throw NoticeException("Undeclared type'"+ name + "'!");	
	}

	auto typeStructures = currentScope->getTypeStructures();

	if(!typeStructures.count(type)){
		throw TypeException("No way to resolve type " + type->toString() + " as structure!");
	}

	return typeStructures[type];
}