private ILimitValueSource CreateValueSourceFrom(ScopeLimitSatementNode limitNode) { Debug.Assert(limitNode.IsLiteral || limitNode.IsCounterReference); if (limitNode.IsLiteral) { return(new LiteralLimitValueSource(limitNode.Literal)); } var theCounter = Counters.First(counter => counter.CounterName == limitNode.CounterReference.CounterName); return(new CounterLimitValueSource(theCounter)); }
private ILimitValueSource CreateValueSourceFrom(ScopeLimitSatementNode limitNode) { Debug.Assert(limitNode.IsLiteral || limitNode.IsCounterReference || limitNode.IsFunctionInvocation); if (limitNode.IsLiteral) { return(new LiteralLimitValueSource(limitNode.Literal)); } if (limitNode.IsFunctionInvocation) { var functionInvocationContext = new FunctionInvocationContext(limitNode.FunctionInvocation, Model); return(new FunctionInvocationValueSource(functionInvocationContext)); } var theCounter = Counters.First(counter => counter.CounterName == limitNode.CounterReference.CounterName); return(new CounterLimitValueSource(theCounter)); }