From 7df762056280a338a2ec349015403b6f506a0dbf Mon Sep 17 00:00:00 2001 From: Nicolas Schodet Date: Fri, 18 Dec 2009 01:11:28 +0100 Subject: tools/dfagen: add origin to states, events and branches, refs #102 --- tools/dfagen/dfagen/automaton.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'tools/dfagen/dfagen/automaton.py') diff --git a/tools/dfagen/dfagen/automaton.py b/tools/dfagen/dfagen/automaton.py index c24fe1e6..63a701f6 100644 --- a/tools/dfagen/dfagen/automaton.py +++ b/tools/dfagen/dfagen/automaton.py @@ -1,9 +1,10 @@ class Event: """Event definition.""" - def __init__ (self, name, comments = ''): + def __init__ (self, name, comments = '', origin = None): self.name = name self.comments = comments + self.origin = origin pass def __str__ (self): @@ -15,10 +16,11 @@ class Event: class State: """State definition.""" - def __init__ (self, name, comments = '', initial = False): + def __init__ (self, name, comments = '', initial = False, origin = None): self.name = name self.comments = comments self.initial = initial + self.origin = origin self.transitions = { } self.transitions_list = [ ] self.attributes = None @@ -73,11 +75,13 @@ class Transition: class TransitionBranch: - def __init__ (self, event, name = None, to = None, comments = ''): + def __init__ (self, event, name = None, to = None, comments = '', + origin = None): self.event = event self.name = name self.to = to self.comments = comments + self.origin = origin self.attributes = None def __str__ (self): -- cgit v1.2.3