Пример #1
0
 private ESOSimpleTypeObject(ESOSimpleType type, EType?input, EType output, Func <dynamic, dynamic, dynamic> calc)
 {
     this.type   = type;
     this.calc   = calc;
     this.input  = input;
     this.output = output;
 }
Пример #2
0
 static Parser <ESOperator> SimpleOperator(string op, ESOSimpleType opType)
 {
     return
         (Parse
          .String(op)
          .Token()
          .Named("Solvable Operator")
          .Return(new ESOSimple(op, opType)));
 }
Пример #3
0
 static Parser <ESOperator> SimpleOperator(string op, string not, ESOSimpleType opType)
 {
     return
         (from begin in
          SimpleOperator(op, opType)
          from end in
          Parse.Chars(not).Not()
          select begin);
 }
Пример #4
0
        public static EVariable Calc(ESOSimpleType type, EVariable a, EVariable b)
        {
            ESOSimpleTypeObject selected = dict[type];

            if (selected == null)
            {
                throw new ELangException("Invalid operation: " + type.ToString());
            }
            return(selected.Calc(a, b));
        }
Пример #5
0
 private static void Add(Dictionary <ESOSimpleType, ESOSimpleTypeObject> temp,
                         ESOSimpleType type, EType?input, EType output,
                         Func <dynamic, dynamic, dynamic> calc)
 {
     temp.Add(type, new ESOSimpleTypeObject(type, input, output, calc));
 }
Пример #6
0
 public ESOSimple(string op, ESOSimpleType type) :
     base(op)
 {
     this.type = type;
 }