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