Commit 75737f20 authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Complete syntax and semantic checks of process types

parent 8778e665
......@@ -153,7 +153,7 @@ def paste_floating_objects(scene):
new_item = Renderer.render(each, scene, states=states)
symbols.append(new_item)
new_item.nested_scene = scene.create_subscene(
type(new_item).__name__.lower())
new_item.context_name)
# Render recursively, creating any required scene
try:
new_item.nested_scene.render_everything(each.content)
......
......@@ -95,6 +95,9 @@ def parse_scene(scene, full_model=False):
else:
for each in scene.processes:
if ":" in unicode(each):
# ignore instances of process type
continue
#pr_data.extend(generate(each))
# Only one process is supported - return now because
# the text areas must not be parsed - some may have been
......
......@@ -473,8 +473,9 @@ class SDL_Scene(QtGui.QGraphicsScene, object):
@property
def processes(self):
''' Return visible processes components of the scene '''
return (it for it in self.visible_symb if isinstance(it, Process) and
not isinstance(it, Procedure))
return (it for it in self.visible_symb
if (isinstance(it, Process) and not isinstance(it, Procedure))
or isinstance(it, ProcessType))
@property
......@@ -1962,7 +1963,10 @@ class SDL_View(QtGui.QGraphicsView, object):
process.processName = "Syntax_Error"
elif len(ast.processes) == 1:
process, = ast.processes
self.filename = process.filename
if not process.instance_of_name:
self.filename = process.filename
else:
self.filename = process.instance_of_ref.filename
self.readonly_pr = ast.pr_files - {self.filename}
else:
# More than one process
......@@ -2054,6 +2058,7 @@ class SDL_View(QtGui.QGraphicsView, object):
if not scene.global_syntax_check():
self.messages_window.addItem("Aborted. Fix syntax errors first")
return
self.messages_window.addItem("No syntax errors")
self.messages_window.addItem("Checking semantics")
if scene.context not in ('process', 'state', 'procedure', 'block'):
......
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