add Jinja2-based tapaal exporter
This commit is contained in:
parent
6aa5302e36
commit
26d8655147
4 changed files with 110 additions and 0 deletions
17
examples/petrinet/translational_semantics/tapaal/exporter.py
Normal file
17
examples/petrinet/translational_semantics/tapaal/exporter.py
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
import jinja2
|
||||
import os
|
||||
THIS_DIR = os.path.dirname(__file__)
|
||||
|
||||
from api.od import ODAPI
|
||||
from examples.petrinet import helpers
|
||||
from util.module_to_dict import module_to_dict
|
||||
|
||||
def export_tapaal(state, m, mm):
|
||||
loader = jinja2.FileSystemLoader(searchpath=THIS_DIR)
|
||||
environment = jinja2.Environment(loader=loader)
|
||||
template = environment.get_template("tapaal.jinja2")
|
||||
return template.render({
|
||||
'odapi': ODAPI(state, m, mm),
|
||||
**globals()['__builtins__'],
|
||||
**module_to_dict(helpers),
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue