Exemplo n.º 1
0
bool CFlowGraphDebugger::GetBreakpoints(DynArray<SBreakPoint>& breakpointsDynArray)
{
	if (m_DebugInfo.empty())
	{
		return false;
	}

	TDebugInfo::const_iterator iterDebugInfo = m_DebugInfo.begin();

	for (iterDebugInfo; iterDebugInfo != m_DebugInfo.end(); ++iterDebugInfo)
	{
		TFlowNodesDebugInfo flownodesDebugInfo = (*iterDebugInfo).second;
		TFlowNodesDebugInfo::const_iterator iterNodesDebugInfo = flownodesDebugInfo.begin();

		for (iterNodesDebugInfo; iterNodesDebugInfo != flownodesDebugInfo.end(); ++iterNodesDebugInfo)
		{
			SBreakPoints breakpoints = (*iterNodesDebugInfo).second;
			// Fill with INPUT port breakpoints
			FillDynArray(breakpointsDynArray, breakpoints.inputPorts, (*iterDebugInfo).first, (*iterNodesDebugInfo).first, false);
			// Fill with OUTPUT port breakpoints
			FillDynArray(breakpointsDynArray, breakpoints.outputPorts, (*iterDebugInfo).first, (*iterNodesDebugInfo).first, true);
		}
	}

	if (breakpointsDynArray.empty())
	{
		return false;
	}

	return true;
}
Exemplo n.º 2
0
int main (int argl, char ** argc) {
	
	DynArray <char *> files;
	
	for (int i=1; i<argl; ++i) {
		if (argc [i][0] == '-') {
			if (string (argc [i]) == "--help") {
				printHelp (argc [0]);
				return 0;
			}
		} else {
			files.push_back (argc [i]);
		}
	}
	
	if (files.empty ()) {
		
		string line, prog;
		while (std::getline (std::cin, line)) {
			if (not line.empty ()) {
				prog += line + "\n";
			} else if (not prog.empty ()) {
				auto n = parse (prog);
				print (n);
				delete n;
				std::cout << std::endl;
				prog = line;
			}
		}
		if (not prog.empty()) {
			auto n = parse (prog);
			print (n);
			delete n;
		}
		
	} else {
		for (char * f : files) {
			std::ifstream fin (f);
			string buff, prog;
			while (std::getline (fin, buff)) prog += buff + "\n";
			std::cout << "########" << f << "########" << std::endl;
			auto n = parse (prog);
			print (n);
			delete n;
			std::cout << "########" << f << "########" << std::endl;
		}
	}
	
	return 0;
	
}