示例#1
0
文件: DAGraph.cpp 项目: jingzbu/TAsK
bool DAGraph::explore(int vertex, bool *visited){
	
	visited[vertex] = true;
	preVisit(vertex);
	std::list<StarLink*> &linksList = (nodes_[vertex])->outLinks;
	int index = -1;
	bool backEdgeDetected = false;
	StarLink* link = NULL;
	for(std::list<StarLink*>::iterator it = linksList.begin(); it != linksList.end(); ++it){
		link = *it;
		index = link->getNodeToIndex();
		if (checkPositiveFlow(link->getIndex())) {
			handleExploredLink(link);
			if ((nodes_[index])->pre == 0) {
				backEdgeDetected = explore(index, visited);
				if (backEdgeDetected) return true;
			}
			if ((nodes_[index])->pre > 0 && (nodes_[index])->post == 0) {
				return handleBackEdge(link);
			}
		} 
	}
	postVisit(vertex);
	return false;
};
示例#2
0
bool ExpDotWriter::postVisit(const std::shared_ptr<Location> &exp)
{
    return postVisit(std::static_pointer_cast<Unary>(exp));
}