public override VariableDef GetVariable(Node node, AnalysisUnit unit, string name, bool addRef = true) { if (name == _name) { if (addRef) { _variable.AddReference(node, unit); } return(_variable); } return(base.GetVariable(node, unit, name, addRef)); }
public IAnalysisSet GetValue(Node node, AnalysisUnit unit, ProjectEntry declaringScope, IAnalysisSet @this, bool addRef) { if (Values == null) { Values = new EphemeralVariableDef(); } var res = Values.GetTypes(unit, declaringScope); if (res.Count > 0) { // Don't add references to ephemeral values... If they // gain types we'll re-enqueue and the reference will be // added then. if (addRef && !Values.IsEphemeral) { Values.AddReference(node, unit); } } if (Getter != null) { res = res.Union(Getter.GetTypesNoCopy(unit, declaringScope).Call(node, unit, @this, ExpressionEvaluator.EmptySets)); } return(res); }
public VariableDef CreateVariable(Node node, AnalysisUnit unit, string name, bool addRef = true) { var res = GetVariable(node, unit, name, addRef); if (res == null) { _variables[name] = res = new VariableDef(); if (addRef) { res.AddReference(node, unit); } } return res; }
public VariableDef CreateVariable(Node node, AnalysisUnit unit, string name, bool addRef = true) { var res = GetVariable(node, unit, name, addRef); if (res == null) { _variables[name] = res = new VariableDef(); if (addRef) { res.AddReference(node, unit); } } return(res); }
public override void DeleteMember(Node node, AnalysisUnit unit, string name) { VariableDef def = GetValuesDef(name); def.AddReference(node, unit); }