|
@@ -12,11 +12,26 @@ from pypdevs.simulator import Simulator
|
|
|
|
|
|
import json
|
|
|
|
|
|
+max_used_id = 0
|
|
|
+
|
|
|
def get_object_constructor(code):
|
|
|
with open(".code.alc", "w") as f:
|
|
|
f.write(code)
|
|
|
f.flush()
|
|
|
constructors = do_compile(".code.alc", "interface/HUTN/grammars/actionlanguage.g", "CS")
|
|
|
+ global max_used_id
|
|
|
+ initial_id = max_used_id
|
|
|
+ for i, v in enumerate(constructors):
|
|
|
+ if isinstance(v, int):
|
|
|
+ # Integer, so rename
|
|
|
+ constructors[i] += initial_id
|
|
|
+ v = constructors[i]
|
|
|
+ if v > max_used_id:
|
|
|
+ max_used_id += 1
|
|
|
+
|
|
|
+ # Keep a gap for safety purposes!
|
|
|
+ max_used_id += 10
|
|
|
+
|
|
|
return constructors
|
|
|
|
|
|
def translate(operation):
|