Beispiel #1
0
 private VariableReference[] GetReferences() {
     if (_refs != null) {
         VariableReference[] references = new VariableReference[_refs.Values.Count];
         _refs.Values.CopyTo(references, 0);
         return references;
     } else {
         return new VariableReference[0];
     }
 }
Beispiel #2
0
 private VariableReference GetOrMakeRef(Variable variable) {
     Debug.Assert(variable != null);
     if (_refs == null) {
         _refs = new Dictionary<Variable, VariableReference>();
     }
     VariableReference reference;
     if (!_refs.TryGetValue(variable, out reference)) {
         _refs[variable] = reference = new VariableReference(variable);
     }
     return reference;
 }
Beispiel #3
0
        public override bool Equals(object obj)
        {
            VariableReference b = obj as VariableReference;

            return(b.Variable.Name == Variable.Name && b.Variable.Block == Variable.Block);
        }
Beispiel #4
0
 internal VariableReference Reference(Variable variable)
 {
     if (_references == null) {
         _references = new Dictionary<Variable, VariableReference>();
     }
     if (variable.Block == null)
     {
       return null;
     }
     VariableReference reference;
     if (!_references.TryGetValue(variable, out reference)) {
         _references[variable] = reference = new VariableReference(variable);
     }
     return reference;
 }
Beispiel #5
0
 internal IList<VariableReference> GetReferences()
 {
     if (_references != null) {
         Dictionary<Variable, VariableReference>.ValueCollection values = _references.Values;
         VariableReference[] refs = new VariableReference[values.Count];
         int index = 0;
         foreach (VariableReference vr in values) {
             refs[index++] = vr;
         }
         return refs;
     } else {
         return new VariableReference[0];
     }
 }