/// <summary> /// Called by an expression when it references another expression in the engine /// </summary> /// <param name="tailName"></param> /// <param name="context"></param> internal void AddDependency(string tailName, ExpressionContext context) { ExpressionResultPair actualTail = this.GetTail(tailName); string headName = context.CalcEngineExpressionName; ExpressionResultPair actualHead = this.GetTail(headName); // An expression could depend on the same reference more than once (ie: "a + a * a") _myDependencies.AddDepedency(actualTail, actualHead); }
public void Add(string atomName, string expression, ExpressionContext context) { Utility.AssertNotNull(atomName, "atomName"); Utility.AssertNotNull(expression, "expression"); Utility.AssertNotNull(context, "context"); BatchLoadInfo info = new BatchLoadInfo(atomName, expression, context); _myNameInfoMap.Add(atomName, info); _myDependencies.AddTail(atomName); ICollection <string> references = this.GetReferences(expression, context); foreach (string reference in references) { _myDependencies.AddTail(reference); _myDependencies.AddDepedency(reference, atomName); } }