]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/internal/parsing/translation/ValueRepository.java
(refs #7260) Added a new DerivedProperty to SCLValues
[simantics/platform.git] / bundles / org.simantics.scl.compiler / src / org / simantics / scl / compiler / internal / parsing / translation / ValueRepository.java
index d0e81402d17fa6e07636f0bd685fef830ba64017..a0d5702222c5a157eb10a49169872f8f18ff7b08 100644 (file)
@@ -12,12 +12,14 @@ import org.simantics.scl.compiler.internal.parsing.declarations.DValueAst;
 import gnu.trove.impl.Constants;
 import gnu.trove.map.hash.THashMap;
 import gnu.trove.map.hash.TObjectLongHashMap;
+import gnu.trove.set.hash.THashSet;
 
 public class ValueRepository {
     THashMap<String, ArrayList<DValueAst>> values = 
             new THashMap<String, ArrayList<DValueAst>>();
     THashMap<String, ArrayList<DAnnotationAst>> annotations = 
             new THashMap<String, ArrayList<DAnnotationAst>>();
+    THashSet<String> derived = new THashSet<String>(); 
     TObjectLongHashMap<String> locations = new TObjectLongHashMap<String>(Constants.DEFAULT_CAPACITY, Constants.DEFAULT_LOAD_FACTOR,
             Locations.NO_LOCATION); 
             
@@ -85,4 +87,12 @@ public class ValueRepository {
     public long getLocation(String name) {
         return locations.get(name);
     }
+    
+    public boolean isDerived(String name) {
+        return derived.contains(name);
+    }
+    
+    public void setDerived(String name) {
+        derived.add(name);
+    }
 }