public SpiceEvaluationContext( string name, SpiceExpressionMode mode, ISpiceNetlistCaseSensitivitySettings caseSetting, IRandomizer randomizer, IExpressionParserFactory expressionParserFactory, IExpressionFeaturesReader expressionFeaturesReader, IExpressionValueProvider expressionValueProvider, INameGenerator nameGenerator, IResultService resultService) : base(name, caseSetting, randomizer, expressionParserFactory, expressionFeaturesReader, expressionValueProvider, nameGenerator, resultService) { Mode = mode; CreateCommonFunctions(); CreateSpiceFunctions(); CreateSpiceParameters(); }
public EvaluationContext( string name, ISpiceNetlistCaseSensitivitySettings caseSettings, IRandomizer randomizer, IExpressionParserFactory expressionParserFactory, IExpressionFeaturesReader expressionFeaturesReader, IExpressionValueProvider expressionValueProvider, INameGenerator nameGenerator, IResultService resultService) { _caseSettings = caseSettings; ExpressionParserFactory = expressionParserFactory; ExpressionFeaturesReader = expressionFeaturesReader; ExpressionValueProvider = expressionValueProvider; NameGenerator = nameGenerator; ResultService = resultService; Name = name; Parameters = new Dictionary <string, Expression>(StringComparerProvider.Get(caseSettings.IsParameterNameCaseSensitive)); Arguments = new Dictionary <string, Expression>(StringComparerProvider.Get(caseSettings.IsParameterNameCaseSensitive)); Functions = new Dictionary <string, List <IFunction> >(StringComparerProvider.Get(caseSettings.IsFunctionNameCaseSensitive)); Children = new List <EvaluationContext>(); ExpressionRegistry = new ExpressionRegistry(caseSettings.IsParameterNameCaseSensitive, caseSettings.IsExpressionNameCaseSensitive); FunctionsBody = new Dictionary <string, string>(); FunctionArguments = new Dictionary <string, List <string> >(); Randomizer = randomizer; }
/// <summary> /// Initializes a new instance of the <see cref="MathExpressionCompiler" /> class. /// </summary> /// <param name="charComparer">The character comparer.</param> /// <param name="parserFactory">The parser factory.</param> public MathExpressionCompiler(IEqualityComparer <char> charComparer, IExpressionParserFactory parserFactory) { charComparer ??= CharComparer.Ordinal; var comparer = new SourceCodeFragmentContentComparer(charComparer); _functionsByNameByArgCount = new Dictionary <IReadOnlyList <char>, Dictionary <int, Func <object[], object> > >(comparer); _variables = new Dictionary <IReadOnlyList <char>, Func <object> >(comparer); _constants = new Dictionary <IReadOnlyList <char>, object>(comparer); _parser = parserFactory.Create(this, this, charComparer); }
public ExpressionValueProvider(IExpressionParserFactory parserFactory) { _parserFactory = parserFactory; }
public ExpressionFeaturesReader(IExpressionParserFactory factory) { _factory = factory; }