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
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
Modifier and TypeFieldDescriptionstatic final byte
SwizzleComponents.static final byte
SwizzleComponents.static final byte
SwizzleComponents.static final byte
SwizzleComponents.static final byte
SwizzleComponents.static final byte
SwizzleComponents.static final byte
SwizzleComponents.static final byte
SwizzleComponents.static final byte
SwizzleComponents.static final byte
SwizzleComponents.static final byte
SwizzleComponents.static final byte
SwizzleComponents.static final byte
SwizzleComponents.static final byte
SwizzleComponents. -
Method Summary
Modifier and TypeMethodDescriptionboolean
accept
(TreeVisitor visitor) Visit this AST with a given visitor.clone
(int position) static Expression
convert
(Context context, int position, Expression base, int maskPosition, String maskString) Create swizzle expressions.getBase()
byte[]
getKind()
static Expression
make
(Context context, int position, Expression base, byte[] components, int numComponents) 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
-
Field Details
-
X
public static final byte XSwizzleComponents.- See Also:
-
Y
public static final byte YSwizzleComponents.- See Also:
-
Z
public static final byte ZSwizzleComponents.- See Also:
-
W
public static final byte WSwizzleComponents.- See Also:
-
R
public static final byte RSwizzleComponents.- See Also:
-
G
public static final byte GSwizzleComponents.- See Also:
-
B
public static final byte BSwizzleComponents.- See Also:
-
A
public static final byte ASwizzleComponents.- See Also:
-
S
public static final byte SSwizzleComponents.- See Also:
-
T
public static final byte TSwizzleComponents.- See Also:
-
P
public static final byte PSwizzleComponents.- See Also:
-
Q
public static final byte QSwizzleComponents.- See Also:
-
ZERO
public static final byte ZEROSwizzleComponents.- See Also:
-
ONE
public static final byte ONESwizzleComponents.- See Also:
-
-
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
- Specified by:
getKind
in classExpression
- See Also:
-
accept
Description copied from class:Node
Visit this AST with a given visitor. -
getBase
-
getComponents
public byte[] getComponents() -
clone
- Specified by:
clone
in classExpression
-
toString
- Specified by:
toString
in classExpression
-