changeset b3f2dfbe8006 in /z/repo/m5
details: http://repo.m5sim.org/m5?cmd=changeset;node=b3f2dfbe8006
description:
ruby: slicc state machine error fixes
Added error messages when:
- a state does not exist in a machine's list of known states.
- an event does not exist in a machine
- the actions of a certain machine have not been declared
diffstat:
1 file changed, 11 insertions(+)
src/mem/slicc/ast/TransitionDeclAST.py | 11 +++++++++++
diffs (24 lines):
diff -r 6b6b8f01429c -r b3f2dfbe8006 src/mem/slicc/ast/TransitionDeclAST.py
--- a/src/mem/slicc/ast/TransitionDeclAST.py Wed Nov 18 13:55:58 2009 -0800
+++ b/src/mem/slicc/ast/TransitionDeclAST.py Wed Nov 18 13:55:58 2009 -0800
@@ -46,9 +46,20 @@
if machine is None:
self.error("Transition declaration not part of a machine.")
+ for action in self.actions:
+ if action not in machine.actions:
+ self.error("Invalid action: %s is not part of machine: %s" % \
+ (action, machine))
+
for state in self.states:
+ if state not in machine.states:
+ self.error("Invalid state: %s is not part of machine: %s" % \
+ (state, machine))
next_state = self.next_state or state
for event in self.events:
+ if event not in machine.events:
+ self.error("Invalid event: %s is not part of machine: %s"
% \
+ (event, machine))
t = Transition(self.symtab, machine, state, event, next_state,
self.actions, self.location, self.pairs)
machine.addTransition(t)
_______________________________________________
m5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/m5-dev