예제 #1
0
def prob6(input, output):
	f = open(input, 'r');
	choice = int(f.readline());
	if choice == 0:
		FA = SDK.readDFAtable(f);
		Project_06.drawDFA(FA, output)
	else:
		FA = SDK.readEpsNFAtable(f);
		Project_06.drawNFA(FA, output)
	f.close();
예제 #2
0
def prob2(input, output):
	#input
	f = open(input, 'r');

	myNFA = SDK.readEpsNFAtable(f);
	f.close();


	g = open(output, 'w');

	#newDfaTable = dict([((id[frozenset(k[0])], k[1]), dfaTable[k]) for k in dfaTable.keys()]);

	DFA = Project_02.NfaToDfa(myNFA);

	SDK.writeDFAtable(g, DFA);

	#for st in dfaState:
		#g.write(str(id[frozenset(st)]) + ': ' + str(st) + '\n');
	g.close();