private void GenerateEvaluatablePatterns(EvaluatableCollection <T> evaluatables) { foreach (var kvp in evaluatables.Where(kvp => kvp.Value.SpecialUnary)) { _unOps += $"({Regex.Escape(kvp.Key)})|"; } _unOps = _unOps.TrimEnd('|'); }
public SimpleParser(EvaluatableCollection <double> ops) { Evaluator = new PostFixEvaluator(ops); Converter = new PostFixConverter(ops); }
public PostFixEvaluator(EvaluatableCollection <double> ops) { Ops = ops; }
public InputHelper(EvaluatableCollection <T> evaluatables) { _evaluatables = evaluatables; GenerateEvaluatablePatterns(_evaluatables); }
public PostFixConverter(EvaluatableCollection <double> evaluatables, string decimalSeparators = ".") { Evaluatables = evaluatables; Separators = decimalSeparators.ToCharArray(); }