예제 #1
0
void PSIVisitor::visit_graph_stmt(IGraphStmt *stmt) {
	switch (stmt->getStmtType()) {
	case IGraphStmt::GraphStmt_Block: {
		visit_graph_block_stmt(static_cast<IGraphBlockStmt *>(stmt));
	} break;

	case IGraphStmt::GraphStmt_IfElse: {
		fprintf(stdout, "TODO: GraphStmt_IfElse\n");
	} break;

	case IGraphStmt::GraphStmt_Parallel: {
		visit_graph_block_stmt(static_cast<IGraphBlockStmt *>(stmt));
	} break;

	case IGraphStmt::GraphStmt_Schedule: {
		visit_graph_block_stmt(static_cast<IGraphBlockStmt *>(stmt));
	} break;

	case IGraphStmt::GraphStmt_Select: {
		visit_graph_block_stmt(static_cast<IGraphBlockStmt *>(stmt));
	} break;

	case IGraphStmt::GraphStmt_Repeat: {
		IGraphRepeatStmt *r = static_cast<IGraphRepeatStmt *>(stmt);

		// TODO: handle non-forever versions
		visit_graph_stmt(r->getBody());

	} break;

	case IGraphStmt::GraphStmt_Traverse: {
		IGraphTraverseStmt *t = static_cast<IGraphTraverseStmt *>(stmt);

		if (t->getWith()) {
			visit_constraint_stmt(t->getWith());
		}
	} break;

	default: fprintf(stdout, "TODO: handle graph stmt %d\n", stmt->getStmtType());

	}
}
예제 #2
0
void PSIVisitor::visit_graph_stmt(IGraphStmt *stmt) {
	fprintf(stdout, "visit_graph_stmt: %d\n", stmt->getStmtType());
	fflush(stdout);

	push_graph(stmt);

	switch (stmt->getStmtType()) {
	case IGraphStmt::GraphStmt_Block: {
		visit_graph_block_stmt(dynamic_cast<IGraphBlockStmt *>(stmt));
	} break;

	case IGraphStmt::GraphStmt_IfElse: {
		fprintf(stdout, "TODO: GraphStmt_IfElse\n");
	} break;

	case IGraphStmt::GraphStmt_Parallel: {
		visit_graph_parallel_block_stmt(dynamic_cast<IGraphBlockStmt *>(stmt));
	} break;

	case IGraphStmt::GraphStmt_Schedule: {
		visit_graph_schedule_block_stmt(dynamic_cast<IGraphBlockStmt *>(stmt));
	} break;

	case IGraphStmt::GraphStmt_Select: {
		visit_graph_select_stmt(dynamic_cast<IGraphBlockStmt *>(stmt));
	} break;

	case IGraphStmt::GraphStmt_Repeat: {
		visit_graph_repeat_stmt(dynamic_cast<IGraphRepeatStmt *>(stmt));
	} break;

	case IGraphStmt::GraphStmt_Traverse: {
		visit_graph_traverse_stmt(dynamic_cast<IGraphTraverseStmt *>(stmt));
	} break;

	default: fprintf(stdout, "TODO: handle activity stmt %d\n", stmt->getStmtType());

	}

	pop_graph();
}
예제 #3
0
void PSIVisitor::visit_graph_select_stmt(IGraphBlockStmt *s) {
	visit_graph_block_stmt(s);
}