Пример #1
0
 public override IAnalysisSet AddNodeValue(Node node, NodeValueKind kind, IAnalysisSet variable) {
     return OuterScope.AddNodeValue(node, kind, variable);
 }
Пример #2
0
 public NodeValue(NodeValueKind kind, IAnalysisSet variable, NodeValue value) {
     Kind = kind;
     Variable = variable;
     Next = value;
 }
Пример #3
0
 internal bool TryGetNodeValue(Node node, NodeValueKind kind, out IAnalysisSet variable) {
     foreach (var s in EnumerateTowardsGlobal) {
         NodeValue value;
         if (s._nodeValues.TryGetValue(node, out value)) {
             while (value != null) {
                 if (value.Kind == kind) {
                     variable = value.Variable;
                     return true;
                 }
                 value = value.Next;
             }
         }
     }
     variable = null;
     return false;
 }
Пример #4
0
 /// <summary>
 /// Cached node variables so that we don't continually create new entries for basic nodes such
 /// as sequences, lambdas, etc...
 /// </summary>
 public IAnalysisSet GetOrMakeNodeValue(Node node, NodeValueKind kind, Func<Node, IAnalysisSet> maker) {
     IAnalysisSet result;
     if (!TryGetNodeValue(node, kind, out result)) {
         result = maker(node);
         AddNodeValue(node, kind, result);
     }
     return result;
 }
Пример #5
0
        public virtual IAnalysisSet AddNodeValue(Node node, NodeValueKind kind, IAnalysisSet variable) {
            NodeValue next;
            _nodeValues.TryGetValue(node, out next);
#if DEBUG
            var tmp = next;
            while (tmp != null) {
                Debug.Assert(tmp.Kind != kind);
                tmp = tmp.Next;
            }
#endif
            _nodeValues[node] = new NodeValue(kind, variable, next);
            return variable;
        }