Browse Source

Fixed compilation error in to_SCCD model

Yentl Van Tendeloo 5 years ago
parent
commit
7aa25ebfec
2 changed files with 4 additions and 5 deletions
  1. 3 4
      models/FTGPM/transformations/to_SCCD.mvc
  2. 1 1
      scripts/test_compile.py

+ 3 - 4
models/FTGPM/transformations/to_SCCD.mvc

@@ -30,7 +30,7 @@ Composite schedule {
                         code = "include \"primitives.alh\"\n"
                         code = string_join(code, "Void function constructor_body (attributes : Element, parameters : Element):\n")
                         code = string_join(code, "\tdict_add(attributes, \"id\",'")
-                        code = string_join(code, cast_i2s(0))
+                        code = string_join(code, cast_string(0))
                         code = string_join(code, "')\n")
                         code = string_join(code, "\tdict_add(attributes, \"queue\", list_create())\n")
                         code = string_join(code, "\tdict_add(attributes, \"finish\", dict_create())\n")
@@ -142,7 +142,7 @@ Composite schedule {
                         code = "include \"primitives.alh\"\n"
                         code = string_join(code, "Boolean function script(attributes : Element, parameters : Element):\n")
                         code = string_join(code, "\tlog(\"QUEUE\")\n")
-                        code = string_join(code, "\tlog(cast_i2s(list_len(attributes[\"queue\"])))\n")
+                        code = string_join(code, "\tlog(cast_string(list_len(attributes[\"queue\"])))\n")
                         code = string_join(code, "\treturn integer_gt(list_len(attributes[\"queue\"]), 0)!")
                         result = compile_code(code)
                         if element_eq(result, read_root()):
@@ -1520,8 +1520,7 @@ Composite schedule {
                             return result!
                     $
             }
-            
-            Post_Activity2State_link (post_j_0, post_j_6){
+            Post_Activity2State_link (post_j_0, post_j_6) {
             	label = "14"
             }
         }         

+ 1 - 1
scripts/test_compile.py

@@ -1,4 +1,4 @@
 import sys
 sys.path.append("interface/HUTN/")
 from hutn_compiler.compiler import main as compile_code
-print(compile_code(sys.argv[1], "interface/HUTN/grammars/actionlanguage.g", "CS"))
+compile_code(sys.argv[1], "interface/HUTN/grammars/actionlanguage.g", "CS")