IContext.cs 703 B

1234567891011121314151617181920212223242526272829303132333435
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. namespace ExpressionLib
  6. {
  7. public interface IContext<T>
  8. {
  9. // The number of arguments the operator operates on
  10. int NumParams(string oprtr);
  11. // Should return the product of the values, processed by the operator
  12. T EvalOperator(string oprtr, List<T> values);
  13. //
  14. bool IsValue(string c);
  15. bool IsValue(string c, out T r);
  16. //
  17. bool IsOperator(string c);
  18. //
  19. int PriorityOf(string c);
  20. //
  21. Associativity AssociativityOf(string c);
  22. }
  23. public enum Associativity
  24. {
  25. Left,
  26. Right
  27. }
  28. }