Exemple #1
0
 public BaseOperation(
     string name,
     IEmittable.Emitter emitter,
     OperationTypeDescriptor descriptor,
     IBaseExpression[] args,
     Delegate evaluator = null
     )
 {
     this.evaluator = evaluator;
     if (args.Length != descriptor.ArgTypes.Length)
     {
         throw new ArgumentsNumberMismatchException(
                   name,
                   descriptor.ArgTypes.Length, args.Length
                   );
     }
     if (args != null)
     {
         int i = 0;
         Array.ForEach(args,
                       arg => IBaseExpression.CheckTypes(
                           name, "operation argument #" + i,
                           descriptor.ArgTypes[i], arg.GetResultType()
                           )
                       );
     }
     this.name       = name;
     this.descriptor = descriptor;
     this.emitter    = emitter;
     this.args       = args;
 }
Exemple #2
0
 public BaseOperation(
     string name,
     IEmittable.Emitter emitter,
     OperationTypeDescriptor descriptor,
     Delegate evaluator = null
     ) : this(name, emitter, descriptor, new IBaseExpression[0], evaluator)
 {
 }