diff -r 1e38b046267d -r e0bea43517d5 src/mem/slicc/ast/MachineAST.py --- a/src/mem/slicc/ast/MachineAST.py Wed Jun 01 20:57:31 2011 -0500 +++ b/src/mem/slicc/ast/MachineAST.py Wed Jun 01 21:08:06 2011 -0500 @@ -67,6 +67,9 @@ # Generate code for all the internal decls self.decls.generate() + # Carry out the required checks + machine.checkMachine() + # Build the transition table machine.buildTable() diff -r 1e38b046267d -r e0bea43517d5 src/mem/slicc/symbols/StateMachine.py --- a/src/mem/slicc/symbols/StateMachine.py Wed Jun 01 20:57:31 2011 -0500 +++ b/src/mem/slicc/symbols/StateMachine.py Wed Jun 01 21:08:06 2011 -0500 @@ -157,6 +157,26 @@ action.warning(error_msg) self.table = table + # This function is for checking + def checkMachine(self): + print "Checking State Machine %s" % self.ident + + found = False + for func in self.functions: + if func.ident == "setState": + found = True + + if not found: + self.error("Required function setState() not found!") + + found = False + for func in self.functions: + if func.ident == "getState": + found = True + + if not found: + self.error("Required function getState() not found!") + def writeCodeFiles(self, path): self.printControllerPython(path) self.printControllerHH(path)