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; }
static Parser <ESOperator> SimpleOperator(string op, ESOSimpleType opType) { return (Parse .String(op) .Token() .Named("Solvable Operator") .Return(new ESOSimple(op, opType))); }
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); }
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)); }
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)); }
public ESOSimple(string op, ESOSimpleType type) : base(op) { this.type = type; }