private static ReinterpretCastPrototype DecodeReinterpretCast(IReadOnlyList <LNode> data, DecoderState state)
        {
            var targetType = state.DecodeType(data[0]);

            if (targetType is PointerType)
            {
                return(ReinterpretCastPrototype.Create((PointerType)targetType));
            }
            else
            {
                state.Log.LogSyntaxError(
                    data[0],
                    new Text("expected a pointer type."));
                return(null);
            }
        }
 private static IReadOnlyList <LNode> EncodeReinterpretCast(ReinterpretCastPrototype value, EncoderState state)
 {
     return(new LNode[] { state.Encode(value.TargetType) });
 }
 /// <summary>
 /// Creates a reinterpret cast instruction that converts
 /// from one pointer type to another.
 /// </summary>
 /// <param name="targetType">
 /// A type to convert operands to.
 /// </param>
 /// <param name="operand">
 /// An operand to convert to the target type.
 /// </param>
 /// <returns>
 /// A reinterpret cast instruction.
 /// </returns>
 public static Instruction CreateReinterpretCast(
     PointerType targetType, ValueTag operand)
 {
     return(ReinterpretCastPrototype.Create(targetType).Instantiate(operand));
 }