Esempio n. 1
0
 public Cast(Entity.DataType resultType)
 {
     ResultType = resultType;
     AddInput(Reference, new Entity.Variable(AnyType.Instance), true);
     AddOutput(Value, new Entity.Variable(resultType), true);
     AddOutput(Succeed, new Entity.Variable(Scalar.Boolean));
 }
Esempio n. 2
0
 public Fill(Entity.DataType stored) : base()
 {
     AddInput("array", new Entity.Variable(new Entity.Type.ListType(stored)), true);
     AddInput("element", new Entity.Variable(stored));
     AddInput("count", new Entity.Variable(Entity.Type.Scalar.Integer));
     AddOutput("count", new Entity.Variable(Entity.Type.Scalar.Integer));
 }
Esempio n. 3
0
 public SetValueAt(Entity.DataType stored) : base()
 {
     Entity.Variable val = new Entity.Variable(stored);
     AddInput("array", new Entity.Variable(new Entity.Type.ListType(stored)), true);
     AddInput("value", val);
     AddInput("index", new Entity.Variable(Entity.Type.Scalar.Integer));
     AddOutput("value", val, true);
 }
Esempio n. 4
0
 /// <summary>
 /// Constructor that need inputs and outputs type, and the operation to execute
 /// </summary>
 /// <param name="lOpType">Type of the left operand</param>
 /// <param name="rOpType">Type of the right operand</param>
 /// <param name="operation">Operation to execute</param>
 /// <param name="resultType">Type of the returned value</param>
 public BinaryOperator(Entity.DataType lOpType, Entity.DataType rOpType, Func <dynamic, dynamic, dynamic> operation, Entity.DataType resultType, bool outreference = false) : base(resultType, operation, outreference)
 {
     AddInput(Global.Operator.Left, new Entity.Variable(lOpType), true);
     AddInput(Global.Operator.Right, new Entity.Variable(rOpType), true);
 }
Esempio n. 5
0
 /// <summary>
 /// Constructor that need inputs types
 /// </summary>
 /// <param name="leftOpType">Type of the left operand</param>
 /// <param name="rightOpType">Type of the right operand</param>
 public Greater(Entity.DataType leftOpType, Entity.DataType rightOpType) :
     base(leftOpType, rightOpType, (dynamic left, dynamic right) => leftOpType.OperatorGt(left, right))
 {
 }
Esempio n. 6
0
 /// <summary>
 /// Constructor that
 /// </summary>
 /// <param name="lOpType">Type of the left operand</param>
 /// <param name="rOpType">Type of the right operand</param>
 /// <param name="resType">Type of the returned value</param>
 public BinaryAnd(Entity.DataType lOpType, Entity.DataType rOpType, Entity.DataType resType) :
     base(lOpType, rOpType, (dynamic left, dynamic right) => lOpType.OperatorBAnd(left, right), resType)
 {
 }
Esempio n. 7
0
 /// <summary>
 /// Constructor that need input and output type
 /// </summary>
 /// <param name="opType">Operand type</param>
 /// <param name="resType">Returned value type</param>
 public Increment(Entity.DataType opType, Entity.DataType resType) : base(opType, (dynamic op) => ++ op, resType)
 {
 }
Esempio n. 8
0
 /// <summary>
 /// Constructor that need input and output type
 /// </summary>
 /// <param name="opType">Type of the operand</param>
 /// <param name="resType">Type of the returned value</param>
 public BinaryNot(Entity.DataType opType, Entity.DataType resType) :
     base(opType, (dynamic op) => opType.OperatorBNot(op), resType)
 {
 }
Esempio n. 9
0
 /// <summary>
 /// Constructor need inputs and output type
 /// </summary>
 /// <param name="lOpType">Type of the left operand</param>
 /// <param name="rOpType">Type of the right operand</param>
 /// <param name="resType">Type of the returned value</param>
 public Access(Entity.DataType lOpType, Entity.DataType rOpType, Entity.DataType resType) :
     base(lOpType, rOpType, (dynamic left, dynamic right) => lOpType.OperatorAccess(left, right), resType, true)
 {
 }
Esempio n. 10
0
 /// <summary>
 /// Constructor that need inputs and output type
 /// </summary>
 /// <param name="lOpType">Type of the left operand</param>
 /// <param name="rOpType">Type of the right operand</param>
 /// <param name="resultType">Type of the returned value</param>
 public Add(Entity.DataType lOpType, Entity.DataType rOpType, Entity.DataType resultType) :
     base(lOpType, rOpType, (dynamic left, dynamic right) => lOpType.OperatorAdd(left, right), resultType)
 {
 }
Esempio n. 11
0
 /// <summary>
 /// Constructor that
 /// </summary>
 /// <param name="lOpType">Type of the left operand</param>
 /// <param name="rOpType">Type of the right operand</param>
 /// <param name="resType">Type of the returned value</param>
 public Multiplicate(Entity.DataType lOpType, Entity.DataType rOpType, Entity.DataType resType) :
     base(lOpType, rOpType, (dynamic left, dynamic right) => lOpType.OperatorMul(left, right), resType)
 {
 }
Esempio n. 12
0
 /// <summary>
 /// Constructor that need inputs type
 /// </summary>
 /// <param name="leftOpType">Type of the left operand</param>
 /// <param name="rightOpType">Type of the right operand</param>
 public Different(Entity.DataType leftOpType, Entity.DataType rightOpType) :
     base(leftOpType, rightOpType, (dynamic left, dynamic right) => !leftOpType.OperatorEqual(left, right))
 {
 }
Esempio n. 13
0
 /// <summary>
 /// Constructor that need input and output type, and the operation the execute
 /// </summary>
 /// <param name="opType">Type of the operand</param>
 /// <param name="operation">Operation to execute</param>
 /// <param name="resultType">Type of the returned value</param>
 public UnaryOperator(Entity.DataType opType, Func <dynamic, dynamic> operation, Entity.DataType resultType, bool outreference = false) : base(resultType, operation, outreference)
 {
     AddInput("Operand", new Entity.Variable(opType), true);
 }
Esempio n. 14
0
 /// <summary>
 /// Constructor that only need input type (assume that output is same type)
 /// </summary>
 /// <param name="opType">Operand type</param>
 public Not(Entity.DataType opType) : base(opType, (dynamic op) => !op, Scalar.Boolean)
 {
 }
Esempio n. 15
0
 public Clear(Entity.DataType stored) : base()
 {
     AddInput("array", new Entity.Variable(new Entity.Type.ListType(stored)), true);
 }
Esempio n. 16
0
 /// <summary>
 /// Constructor that need inputs, outputs and operation
 /// </summary>
 /// <param name="inputs">Dictionnary of all inputs</param>
 /// <param name="outputType">Dictionnary of all outputs</param>
 /// <param name="operation">Operation to execute</param>
 public Operator(Entity.DataType outputType, Delegate operation, bool outreference = false) : base()
 {
     AddOutput(Global.Operator.Result, new Entity.Variable(outputType), outreference);
     this.operation = operation;
 }
Esempio n. 17
0
 /// <summary>
 /// Constructor that need inputs types and the operation to process
 /// </summary>
 /// <param name="lOpType">Type of the left operand</param>
 /// <param name="rOpType">Type of the right operand</param>
 /// <param name="operation">Operation to execute</param>
 public LogicalOperator(Entity.DataType lOpType, Entity.DataType rOpType, Func <dynamic, dynamic, dynamic> operation) :
     base(lOpType, rOpType, operation, Entity.Type.Scalar.Boolean)
 {
 }
Esempio n. 18
0
 /// <summary>
 /// Constructor that need input and output type
 /// </summary>
 /// <param name="opType">Operand type</param>
 /// <param name="resType">Returned value type</param>
 public Inverse(Entity.DataType opType, Entity.DataType resType) : base(opType, (dynamic op) => - op, resType)
 {
 }
Esempio n. 19
0
 /// <summary>
 /// Checks if an output type is compatible with a given type
 /// </summary>
 /// <param name="name">Name of the ouput</param>
 /// <param name="type">Type to check</param>
 /// <returns>Treue if types are compatibles, false either</returns>
 public bool IsOutputCompatible(string name, Entity.DataType type)
 {
     return(type.IsValueOfType(outputs[name].Value));
 }
Esempio n. 20
0
 /// <summary>
 /// Constructor that need inputs type
 /// </summary>
 /// <param name="leftOpType">Type of the left operand</param>
 /// <param name="rightOpType">Type of the right operand</param>
 public LessEqual(Entity.DataType leftOpType, Entity.DataType rightOpType) :
     base(leftOpType, rightOpType, (dynamic left, dynamic right) => leftOpType.OperatorLtEq(left, right))
 {
 }
Esempio n. 21
0
 /// <summary>
 /// Constructor that
 /// </summary>
 /// <param name="lOpType">Type of the left operand</param>
 /// <param name="rOpType">Type of the right operand</param>
 /// <param name="resType">Type of the returned value</param>
 public Xor(Entity.DataType lOpType, Entity.DataType rOpType, Entity.DataType resType) :
     base(lOpType, rOpType, (dynamic left, dynamic right) => lOpType.OperatorXor(left, right), resType)
 {
 }
Esempio n. 22
0
 /// <summary>
 /// Constructor that
 /// </summary>
 /// <param name="lOpType">Type of the left operand</param>
 /// <param name="rOpType">Type of the right operand</param>
 /// <param name="resType">Type of the returned value</param>
 public Substract(Entity.DataType lOpType, Entity.DataType rOpType, Entity.DataType resType) :
     base(lOpType, rOpType, (dynamic left, dynamic right) => lOpType.OperatorSub(left, right), resType)
 {
 }