Esempio n. 1
0
				xb=xb and True
	if(xb):
		n_states.pop(0)

	for y in alphabets:
		for z in range(len(n_table[y])):
			if y!='lambda':
				n_table[y][z]=n_states.index(n_table[y][z])

	n_fstates=[]
	for f in final_state:
		if f != '' :
			for n in range(len(n_states)):
				if f in n_states[n]:
					n_fstates.append(n)

	return n_table, alphabets, n_fstates	


if __name__ == '__main__':
	#file_name = input("Enter input file name: ")
	file_name='inputA3.txt'
	table, alphabets, final_state = read(file_name)
	n_table, alphabets, n_fstates= subsetDFA(table, alphabets, final_state)
	while(True):
		test_str = input('Enter test string: ')
		print(process(test_str,n_table, alphabets, n_fstates))



def test_process_type():
    ensure(a2.process.__code__.co_argcount == 3, 'argument number test')
    result = a2.process('test.txt', 3, {'e': '9'})
    ensure(result == None, 'argument number test')
Esempio n. 3
0
def test_process_type():
    ensure(a2.process.__code__.co_argcount == 3, 'argument number test')
    result = a2.process('test.txt', 3, {'e': '9'})
    ensure(result == None, 'argument number test')