Ejemplo n.º 1
0
        public void Accept(IPrimitiveVisitor visitor)
        {
            switch (this.PrimitiveType)
            {
            case PrimitiveType.Boolean:
                visitor.Visit((IPrimitiveExpression <bool>) this);
                break;

            case PrimitiveType.Byte:
                visitor.Visit((IPrimitiveExpression <byte>) this);
                break;

            case PrimitiveType.SByte:
                visitor.Visit((IPrimitiveExpression <sbyte>) this);
                break;

            case PrimitiveType.Int16:
                visitor.Visit((IPrimitiveExpression <short>) this);
                break;

            case PrimitiveType.UInt16:
                visitor.Visit((IPrimitiveExpression <ushort>) this);
                break;

            case PrimitiveType.Int32:
                visitor.Visit((IPrimitiveExpression <int>) this);
                break;

            case PrimitiveType.UInt32:
                visitor.Visit((IPrimitiveExpression <uint>) this);
                break;

            case PrimitiveType.Int64:
                visitor.Visit((IPrimitiveExpression <long>) this);
                break;

            case PrimitiveType.UInt64:
                visitor.Visit((IPrimitiveExpression <ulong>) this);
                break;

            case PrimitiveType.Decimal:
                visitor.Visit((IPrimitiveExpression <decimal>) this);
                break;

            case PrimitiveType.Float:
                visitor.Visit((IPrimitiveExpression <float>) this);
                break;

            case PrimitiveType.Double:
                visitor.Visit((IPrimitiveExpression <double>) this);
                break;

            case PrimitiveType.Char:
                visitor.Visit((IPrimitiveExpression <char>) this);
                break;

            case PrimitiveType.String:
                visitor.Visit((IPrimitiveExpression <string>) this);
                break;

            case PrimitiveType.Null:
                visitor.VisitNull();
                break;

            case Abstract.PrimitiveType.Type:
                visitor.Visit((IPrimitiveExpression <IType>) this);
                break;

            default:
                return;
            }
        }
Ejemplo n.º 2
0
 public void Accept(IPrimitiveVisitor visitor)
 {
     visitor.Visit(this);
 }
Ejemplo n.º 3
0
        public TResult Visit <TResult, TContext>(IPrimitiveVisitor <TResult, TContext> visitor, TContext context)
        {
            switch (this.PrimitiveType)
            {
            case PrimitiveType.Boolean:
                return(visitor.Visit((IPrimitiveExpression <bool>) this, context));

            case PrimitiveType.Byte:
                return(visitor.Visit((IPrimitiveExpression <byte>) this, context));

            case PrimitiveType.SByte:
                return(visitor.Visit((IPrimitiveExpression <sbyte>) this, context));

            case PrimitiveType.Int16:
                return(visitor.Visit((IPrimitiveExpression <short>) this, context));

            case PrimitiveType.UInt16:
                return(visitor.Visit((IPrimitiveExpression <ushort>) this, context));

            case PrimitiveType.Int32:
                return(visitor.Visit((IPrimitiveExpression <int>) this, context));

            case PrimitiveType.UInt32:
                return(visitor.Visit((IPrimitiveExpression <uint>) this, context));

            case PrimitiveType.Int64:
                return(visitor.Visit((IPrimitiveExpression <long>) this, context));

            case PrimitiveType.UInt64:
                return(visitor.Visit((IPrimitiveExpression <ulong>) this, context));

            case PrimitiveType.Decimal:
                return(visitor.Visit((IPrimitiveExpression <decimal>) this, context));

            case PrimitiveType.Float:
                return(visitor.Visit((IPrimitiveExpression <float>) this, context));

            case PrimitiveType.Double:
                return(visitor.Visit((IPrimitiveExpression <double>) this, context));

            case PrimitiveType.Char:
                return(visitor.Visit((IPrimitiveExpression <char>) this, context));

            case PrimitiveType.String:
                return(visitor.Visit((IPrimitiveExpression <string>) this, context));

            case PrimitiveType.Null:
                return(visitor.VisitNull(context));

            default:
                return(default(TResult));

            case Abstract.PrimitiveType.Type:
                return(visitor.Visit((IPrimitiveExpression <IType>) this, context));
            }
        }