Package icyllis.arc3d.compiler.tree

# Class Swizzle

java.lang.Object
icyllis.arc3d.compiler.tree.Node
icyllis.arc3d.compiler.tree.Expression
icyllis.arc3d.compiler.tree.Swizzle

public final class Swizzle extends Expression
Represents a vector component selection (shuffling) such as 'float3(1, 2, 3).zyx'.

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from class icyllis.arc3d.compiler.tree.Node

  `Node.ElementKind, Node.ExpressionKind, Node.StatementKind, Node.SymbolKind`

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final byte`
  `A`
  SwizzleComponents.
  `static final byte`
  `B`
  SwizzleComponents.
  `static final byte`
  `G`
  SwizzleComponents.
  `static final byte`
  `ONE`
  SwizzleComponents.
  `static final byte`
  `P`
  SwizzleComponents.
  `static final byte`
  `Q`
  SwizzleComponents.
  `static final byte`
  `R`
  SwizzleComponents.
  `static final byte`
  `S`
  SwizzleComponents.
  `static final byte`
  `T`
  SwizzleComponents.
  `static final byte`
  `W`
  SwizzleComponents.
  `static final byte`
  `X`
  SwizzleComponents.
  `static final byte`
  `Y`
  SwizzleComponents.
  `static final byte`
  `Z`
  SwizzleComponents.
  `static final byte`
  `ZERO`
  SwizzleComponents.

  ### Fields inherited from class icyllis.arc3d.compiler.tree.Node

  `mPosition`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `accept(TreeVisitor visitor)`
  Visit this AST with a given visitor.
  `Expression`
  `clone(int position)`
  `static Expression`
  `convert(Context context, int position, Expression base, int maskPosition, String maskString)`
  Create swizzle expressions.
  `Expression`
  `getBase()`
  `byte[]`
  `getComponents()`
  `Node.ExpressionKind`
  `getKind()`
  `static Expression`
  `make(Context context, int position, Expression base, byte[] components, int numComponents)`
  `String`
  `toString(int parentPrecedence)`

  ### Methods inherited from class icyllis.arc3d.compiler.tree.Expression

  `clone, getCoercionCost, getConstantValue, getType, isBooleanLiteral, isConstructorCall, isFloatLiteral, isIncomplete, isIntLiteral, isLiteral, toString`

  ### Methods inherited from class icyllis.arc3d.compiler.tree.Node

  `getEndOffset, getStartOffset`

  ### Methods inherited from class java.lang.Object

  `equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Field Details

  - ### X

    public static final byte X
    SwizzleComponents.
    See Also:
      - Constant Field Values

  - ### Y

    public static final byte Y
    SwizzleComponents.
    See Also:
      - Constant Field Values

  - ### Z

    public static final byte Z
    SwizzleComponents.
    See Also:
      - Constant Field Values

  - ### W

    public static final byte W
    SwizzleComponents.
    See Also:
      - Constant Field Values

  - ### R

    public static final byte R
    SwizzleComponents.
    See Also:
      - Constant Field Values

  - ### G

    public static final byte G
    SwizzleComponents.
    See Also:
      - Constant Field Values

  - ### B

    public static final byte B
    SwizzleComponents.
    See Also:
      - Constant Field Values

  - ### A

    public static final byte A
    SwizzleComponents.
    See Also:
      - Constant Field Values

  - ### S

    public static final byte S
    SwizzleComponents.
    See Also:
      - Constant Field Values

  - ### T

    public static final byte T
    SwizzleComponents.
    See Also:
      - Constant Field Values

  - ### P

    public static final byte P
    SwizzleComponents.
    See Also:
      - Constant Field Values

  - ### Q

    public static final byte Q
    SwizzleComponents.
    See Also:
      - Constant Field Values

  - ### ZERO

    public static final byte ZERO
    SwizzleComponents.
    See Also:
      - Constant Field Values

  - ### ONE

    public static final byte ONE
    SwizzleComponents.
    See Also:
      - Constant Field Values

- ## Method Details

  - ### convert

    @Nullable public static Expression convert(@Nonnull Context context, int position, @Nonnull Expression base, int maskPosition, @Nonnull String maskString)
    Create swizzle expressions. This method permits components containing ZERO or ONE, does typechecking, reports errors via ErrorHandler, and returns an expression that combines constructors and native swizzles (comprised solely of X/Y/W/Z).

  - ### make

    @Nonnull public static Expression make(@Nonnull Context context, int position, @Nonnull Expression base, byte[] components, int numComponents)

  - ### getKind

    public Node.ExpressionKind getKind()
    Specified by:
      `getKind` in class `Expression`
    See Also:
      - `Node.ExpressionKind`

  - ### accept

    public boolean accept(@Nonnull TreeVisitor visitor)
    Description copied from class: `Node`
    Visit this AST with a given visitor.
    Specified by:
      `accept` in class `Node`
    Returns:
      true to stop recursion and propagate true up the stack, false to continue

  - ### getBase

    public Expression getBase()

  - ### getComponents

    public byte[] getComponents()

  - ### clone

    @Nonnull public Expression clone(int position)
    Specified by:
      `clone` in class `Expression`

  - ### toString

    @Nonnull public String toString(int parentPrecedence)
    Specified by:
      `toString` in class `Expression`