コード例 #1
0
void DeclarationBuilder::declareVariable(IToken *id, const AbstractType::Ptr &type)
{
	DUChainWriteLocker lock;
	Declaration *dec = openDefinition<Declaration>(identifierForNode(id), editorFindRange(id, id));
	dec->setType(type);
	dec->setKind(Declaration::Instance);
	closeDeclaration();
}
コード例 #2
0
void DeclarationBuilder::visitVersionSpecification(IVersionSpecification *node)
{
	DeclarationBuilderBase::visitVersionSpecification(node);
	DUChainWriteLocker lock;
	Declaration *label = openDeclaration<Declaration>(node->getToken(), node);
	label->setKind(Declaration::Type);
	closeDeclaration();
}
コード例 #3
0
void DeclarationBuilder::visitDebugSpecification(IDebugSpecification *node)
{
	DeclarationBuilderBase::visitDebugSpecification(node);
	DUChainWriteLocker lock;
	Declaration *label = openDeclaration<Declaration>(node->getIdentifierOrInteger(), node);
	label->setKind(Declaration::Type);
	closeDeclaration();
}
コード例 #4
0
void DeclarationBuilder::visitLabeledStatement(ILabeledStatement *node)
{
	DeclarationBuilderBase::visitLabeledStatement(node);
	DUChainWriteLocker lock;
	Declaration *label = openDeclaration<Declaration>(node->getIdentifier(), node);
	label->setKind(Declaration::Type);
	closeDeclaration();
}
コード例 #5
0
void DeclarationBuilder::visitCatch(ICatch *node)
{
	TypeBuilder::visitCatch(node);
	DUChainWriteLocker lock;
	Declaration *parameter = openDeclaration<Declaration>(node->getIdentifier(), node);
	parameter->setKind(Declaration::Instance);
	parameter->setAbstractType(lastType());
	closeDeclaration();
}
コード例 #6
0
void DeclarationBuilder::visitForeachType(IForeachType *node)
{
	TypeBuilder::visitForeachType(node);
	DUChainWriteLocker lock;
	Declaration *argument = openDeclaration<Declaration>(node->getIdentifier(), node);
	argument->setKind(Declaration::Instance);
	argument->setAbstractType(lastType());
	closeDeclaration();
}
コード例 #7
0
void DeclarationBuilder::visitEnumDeclaration(IEnumDeclaration *node)
{
	DUChainWriteLocker lock;
	Declaration *e = openDeclaration<Declaration>(node->getName(), node);
	e->setKind(Declaration::Type);
	lock.unlock();
	DeclarationBuilderBase::visitEnumDeclaration(node);
	lock.lock();
	e->setInternalContext(lastContext());
	//e->setAbstractType(lastType());
	closeDeclaration();
}
コード例 #8
0
void DeclarationBuilder::visitModule(IModule *node)
{
	if(node->getModuleDeclaration())
	{
		if(node->getModuleDeclaration()->getComment())
			setComment(node->getModuleDeclaration()->getComment());
		
		DUChainWriteLocker lock;
		
		auto m_thisPackage = identifierForNode(node->getModuleDeclaration()->getModuleName());
		KDevelop::RangeInRevision range = editorFindRange(node->getModuleDeclaration()->getModuleName(), node->getModuleDeclaration()->getModuleName());
		
		Declaration *packageDeclaration = openDeclaration<Declaration>(m_thisPackage, range);
		packageDeclaration->setKind(Declaration::Namespace);
		openContext(node, editorFindRange(node, 0), DUContext::Namespace, m_thisPackage);
		packageDeclaration->setInternalContext(currentContext());
		lock.unlock();
		DeclarationBuilderBase::visitModule(node);
		closeContext();
		closeDeclaration();
		topContext()->updateImportsCache();
	}
}