summaryrefslogtreecommitdiff
path: root/lib/automata.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/automata.py')
-rwxr-xr-xlib/automata.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/automata.py b/lib/automata.py
index 2d5c27c..df8363f 100755
--- a/lib/automata.py
+++ b/lib/automata.py
@@ -259,7 +259,7 @@ class PTA:
def __init__(self, state_names: list = [],
accepting_states: list = None,
parameters: list = [], initial_param_values: list = None,
- instance: str = None):
+ instance: str = None, header: str = None):
"""
Return a new PTA object.
@@ -270,11 +270,13 @@ class PTA:
parameters -- names of PTA parameters
initial_param_values -- initial value for each parameter
instance -- class used for generated C++ code
+ header -- header include path for C++ class definition
"""
self.state = dict([[state_name, State(state_name)] for state_name in state_names])
self.accepting_states = accepting_states.copy() if accepting_states else None
self.parameters = parameters.copy()
self.instance = instance
+ self.header = header
if initial_param_values:
self.initial_param_values = initial_param_values.copy()
else:
@@ -386,6 +388,9 @@ class PTA:
if 'instance' in yaml_input:
kwargs['instance'] = yaml_input['instance']
+ if 'header' in yaml_input:
+ kwargs['header'] = yaml_input['header']
+
pta = cls(**kwargs)
for trans_name in sorted(yaml_input['transition'].keys()):