Commit 7e973df2 authored by Maxime Perrotin's avatar Maxime Perrotin

Use the same separator as opengeode

Avoid using unicode separators
parent 1a775037
......@@ -5,7 +5,7 @@
Template for a simple model checker
(c) Maxime Perrotin / European Space Agency, 2015-2019
(c) Maxime Perrotin / European Space Agency, 2015-2020
The python3 version does not rely on StringTemplate but uses f-strings
......@@ -14,6 +14,8 @@ The python3 version does not rely on StringTemplate but uses f-strings
from typing import List
import opengeode
SEP=opengeode.AdaGenerator.SEPARATOR
# f-strings don' t support backslash, so it is not directly possible to do
# a f{"\n".join(...)}. instead. We need to put the backslash outside, and do
# f{LF.join(...)}. Alternatively chr(10).join() would also work.
......@@ -52,7 +54,7 @@ def print_event (interface: str, sort: str, param : bool) -> str:
def check_ppty (num: int, model: str) -> str:
return f'''Errno := {num};
Res := {model}_Stop_Conditions.p\u00dcproperty_{num};
Res := {model}_Stop_Conditions.p{SEP}property_{num};
if Res then
return Res;
end if;
......@@ -235,7 +237,7 @@ def generate(ast, stop_conditions):
exhausts = []
for name, sort in pis.items():
# get a mapping {input: {state : transition}}
opengeode.Helper.flatten(process, sep=u'\u00dc')
opengeode.Helper.flatten(process, sep=SEP)
mapping = opengeode.Helper.map_input_state(process)
states = [state for state in mapping[name].keys() if "START" not
in state]
......
......@@ -9,7 +9,7 @@ and generate code to verify the property
This shall be used in combination with the OpenGEODE simulator
(c) European Space Agency, 2015-2019
(c) European Space Agency, 2015-2020
Author: Maxime.Perrotin@esa.int
'''
......@@ -39,6 +39,7 @@ console = logging.StreamHandler(sys.__stdout__)
console.setFormatter(ColorFormatter())
log.addHandler(console)
SEP=opengeode.AdaGenerator.SEPARATOR
MAKEFILE_TEMPLATE = '''all: build
clean:
......@@ -98,7 +99,7 @@ def parse_input_files(pr_files, ppty_file, simu=True):
stmts, string, local_decl = opengeode.AdaGenerator.expression(each)
log.info(string)
# Flatten the process to have the proper state names
opengeode.Helper.flatten(process, sep=u'\u00dc')
opengeode.Helper.flatten(process, sep=SEP)
process.content.inner_procedures = []
process.procedures = []
process.transitions = []
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment