1 package org.simantics.graph.compiler.internal.translation;
3 import gnu.trove.list.array.TIntArrayList;
5 import org.antlr.runtime.tree.Tree;
6 import org.simantics.graph.store.GraphStore;
8 public class ChildGraphTranslator extends GraphTranslator {
10 TIntArrayList correspondences = new TIntArrayList();
11 GraphTranslator parent;
13 public ChildGraphTranslator(GraphTranslator parent, GraphStore store) {
14 super(parent.paths, parent.problems, store);
19 public int getVariable(Tree place, String text) {
20 if(variables.containsKey(text))
21 return variables.get(text);
23 correspondences.add(parent.getVariable(place, text));
24 int id = identities.newResource();
25 correspondences.add(id);
26 variables.put(text, id);
32 public int[] getCorrespondences() {
33 return correspondences.toArray();