Commit c20dbdb3 authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Parse properties in one shot

parent 5ba1bf19
......@@ -49,20 +49,20 @@ def parse_input_files(pr_files, ppty_file):'SDL parser OK')
# Parse the stop conditions (property file)
stop_conditions = []
with open(ppty_file, 'r') as ppties:
for line in ppties.readlines():
if not line.strip():
expr, syntax, semantic, warnings, term = \
opengeode.ogParser.parseSingleElement('stop_if', line, process)
if syntax or semantic or warnings:
log.error('Error in expression: {}'.format(line))
with open(ppty_file, 'r') as pt:
stop_conditions, syntax, semantic, warnings, term = \
opengeode.ogParser.parseSingleElement('stop_if',, process)
for each in syntax:
for each in semantic:
for each in warnings:
if syntax or semantic or warnings or not stop_conditions:
raise IOError('Error parsing stop conditions - Aborting')
# Set the context in the Ada generator
if stop_conditions:
opengeode.AdaGenerator.TYPES = process.dataview
opengeode.AdaGenerator.VARIABLES = process.variables
opengeode.AdaGenerator.PROCEDURES = process.procedures
......@@ -104,7 +104,10 @@ def cli():
log.debug('SDL files: {}'.format(', '.join(options.models)))
log.debug('Property file: {}'.format(options.spec))
parse_input_files(options.models, options.spec)
except IOError as err:
return 0
stop if a = two
stop if state = timeout
stop if a = two;
stop if state = timeout;
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