X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.graph.compiler%2Fsrc%2Forg%2Fsimantics%2Fgraph%2Fcompiler%2Finternal%2Ftranslation%2FChildGraphTranslator.java;fp=bundles%2Forg.simantics.graph.compiler%2Fsrc%2Forg%2Fsimantics%2Fgraph%2Fcompiler%2Finternal%2Ftranslation%2FChildGraphTranslator.java;h=826904493337f39885ac3efa84c7ebb04c26fcaf;hp=c543aa980658b70dbbdd2299d4e669e896899e9d;hb=0ae2b770234dfc3cbb18bd38f324125cf0faca07;hpb=24e2b34260f219f0d1644ca7a138894980e25b14 diff --git a/bundles/org.simantics.graph.compiler/src/org/simantics/graph/compiler/internal/translation/ChildGraphTranslator.java b/bundles/org.simantics.graph.compiler/src/org/simantics/graph/compiler/internal/translation/ChildGraphTranslator.java index c543aa980..826904493 100644 --- a/bundles/org.simantics.graph.compiler/src/org/simantics/graph/compiler/internal/translation/ChildGraphTranslator.java +++ b/bundles/org.simantics.graph.compiler/src/org/simantics/graph/compiler/internal/translation/ChildGraphTranslator.java @@ -1,35 +1,35 @@ -package org.simantics.graph.compiler.internal.translation; - -import gnu.trove.list.array.TIntArrayList; - -import org.antlr.runtime.tree.Tree; -import org.simantics.graph.store.GraphStore; - -public class ChildGraphTranslator extends GraphTranslator { - - TIntArrayList correspondences = new TIntArrayList(); - GraphTranslator parent; - - public ChildGraphTranslator(GraphTranslator parent, GraphStore store) { - super(parent.paths, parent.problems, store); - this.parent = parent; - } - - @Override - public int getVariable(Tree place, String text) { - if(variables.containsKey(text)) - return variables.get(text); - else { - correspondences.add(parent.getVariable(place, text)); - int id = identities.newResource(); - correspondences.add(id); - variables.put(text, id); - locate(id, place); - return id; - } - } - - public int[] getCorrespondences() { - return correspondences.toArray(); - } -} +package org.simantics.graph.compiler.internal.translation; + +import gnu.trove.list.array.TIntArrayList; + +import org.antlr.runtime.tree.Tree; +import org.simantics.graph.store.GraphStore; + +public class ChildGraphTranslator extends GraphTranslator { + + TIntArrayList correspondences = new TIntArrayList(); + GraphTranslator parent; + + public ChildGraphTranslator(GraphTranslator parent, GraphStore store) { + super(parent.paths, parent.problems, store); + this.parent = parent; + } + + @Override + public int getVariable(Tree place, String text) { + if(variables.containsKey(text)) + return variables.get(text); + else { + correspondences.add(parent.getVariable(place, text)); + int id = identities.newResource(); + correspondences.add(id); + variables.put(text, id); + locate(id, place); + return id; + } + } + + public int[] getCorrespondences() { + return correspondences.toArray(); + } +}