def main(): try: fsm = parseFSM("./sample.fsml") sampleInput = json.load(open("./sample_input.json", "r")) # just for visualization of the fsm dict (not needed anywhere in the code) jsonFile = open("./sample_fsml.json", 'w') jsonFile.write(json.dumps(fsm)) # check the ok constraints ok(fsm) #simulate the fsm output = simulateFSM(fsm, sampleInput) # dump the simulation output to file outFile = open("./sample_output.json", 'w') outFile.write(json.dumps(output)) #generate Code generateCode(fsm) #draw fsm drawFSM(fsm) except FsmException: raise
def testOneFile(self): fsm = parseFSM(self.fsmlFile) self.assertTrue(ok(fsm))