Exemple #1
0
 public Signature(Operands operands)
 {
     _signature = new SignatureElement[operands.Count];
     for (int index = 0; index < Count; index++)
     {
         _signature[index] = new SignatureElement(operands[index].DataType, operands[index].Modifier);
     }
 }
Exemple #2
0
 public Signature(Signature signature)
 {
     _signature = new SignatureElement[signature.Count];
     for (int index = 0; index < Count; index++)
     {
         _signature[index] = signature[index];
     }
 }
Exemple #3
0
 public bool Is(SignatureElement AElement)
 {
     return
         (#if VARBINDINGEXACT
          ((FModifier == Modifier.Var) && (AElement.Modifier == Modifier.Var) && FDataType.Equals(AElement.IDataType)) ||
          ((FModifier != Modifier.Var) && (AElement.Modifier != Modifier.Var) && FDataType.Is(AElement.IDataType)));
                         #else
          (
              ((FModifier == Modifier.Var) && (AElement.Modifier == Modifier.Var)) ||
              ((FModifier != Modifier.Var) && (AElement.Modifier != Modifier.Var))
         ) &&
         FDataType.Is(AElement.DataType);
                         #endif
 }
Exemple #4
0
 public override bool Equals(object AObject)
 {
     if (AObject is SignatureElement)
     {
         SignatureElement LObject = (SignatureElement)AObject;
         return
             ((
                  ((FModifier == Modifier.Var) && (LObject.Modifier == Modifier.Var)) ||
                  ((FModifier != Modifier.Var) && (LObject.Modifier != Modifier.Var))
                  ) &&
              FDataType.Equals(LObject.DataType));
     }
     return(false);
 }
        // TODO: This should be compiled and added as cleanup nodes
        // TODO: Handle var arguments for more than just stack references
        protected void CleanupOperand(Program program, Schema.SignatureElement signatureElement, PlanNode argumentNode, object argumentValue)
        {
            switch (signatureElement.Modifier)
            {
            case Modifier.In:
                DataValue.DisposeValue(program.ValueManager, argumentValue);
                break;

            case Modifier.Var:
                if (argumentNode.DataType is Schema.ScalarType)
                {
                    argumentValue = ValueUtility.ValidateValue(program, (Schema.ScalarType)argumentNode.DataType, argumentValue, _operator);
                }
                program.Stack.Poke(((StackReferenceNode)argumentNode).Location, argumentValue);
                break;
            }
        }