Forráskód Böngészése

Added workaround to find the grammar in all situations

Yentl Van Tendeloo 9 éve
szülő
commit
887105b863

+ 3 - 1
interface/HUTN/hutn_compiler/model_visitor.py

@@ -1,5 +1,6 @@
 from visitor import Visitor
 from compiler import main as do_compile
+import os
 
 def jsonstr(s):
     return '"%s"' % s
@@ -104,4 +105,5 @@ class ModelVisitor(Visitor):
             with open(".constraint.alc", 'w') as f:
                 f.write(constraint)
                 f.flush()
-            self.constructors.extend(['"add_constraint"', jsonstr(self.current_model), jsonstr(self.current_element)] + do_compile(".constraint.alc", "interface/HUTN/grammars/actionlanguage.g", "CS"))
+            directory = os.path.realpath(__file__).rsplit(os.sep, 1)[0]
+            self.constructors.extend(['"add_constraint"', jsonstr(self.current_model), jsonstr(self.current_element)] + do_compile(".constraint.alc", directory + "/../grammars/actionlanguage.g", "CS"))

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 1 - 0
interface/HUTN/test/modelling_language/expected/petrinets_constraints