Package icyllis.arc3d.compiler.tree
Class Literal
java.lang.Object
icyllis.arc3d.compiler.tree.Node
icyllis.arc3d.compiler.tree.Expression
icyllis.arc3d.compiler.tree.Literal
A constant value. These can contain ints, floats, or booleans.
-
Nested Class Summary
Nested classes/interfaces inherited from class icyllis.arc3d.compiler.tree.Node
Node.ElementKind, Node.ExpressionKind, Node.StatementKind, Node.SymbolKind -
Field Summary
-
Method Summary
Modifier and TypeMethodDescription@NonNull Expressioncopy(int position) boolean@NonNull OptionalDoublegetConstantValue(int i) Returns the i'th compile-time constant value within a literal or constructor.floatlonggetKind()doublegetValue()booleanstatic @NonNull Literalstatic @NonNull LiteralmakeBoolean(int position, boolean value, Type type) static @NonNull LiteralmakeBoolean(@NonNull Context context, int position, boolean value) static @NonNull Literalstatic @NonNull Literalstatic @NonNull LiteralmakeInteger(int position, long value, Type type) static @NonNull LiteralmakeInteger(@NonNull Context context, int position, long value, boolean signed) @NonNull StringtoString(int parentPrecedence) Methods inherited from class icyllis.arc3d.compiler.tree.Expression
accept, copy, getCoercionCost, getType, isBooleanLiteral, isConstructorCall, isFloatLiteral, isIncomplete, isIntLiteral, toStringMethods inherited from class icyllis.arc3d.compiler.tree.Node
getEndOffset, getStartOffset
-
Method Details
-
makeFloat
-
makeFloat
-
makeInteger
-
makeInteger
-
makeBoolean
-
makeBoolean
-
make
-
getKind
- Specified by:
getKindin classExpression- See Also:
-
isLiteral
public boolean isLiteral()- Overrides:
isLiteralin classExpression
-
getFloatValue
public float getFloatValue() -
getIntegerValue
public long getIntegerValue() -
getBooleanValue
public boolean getBooleanValue() -
getValue
public double getValue() -
getConstantValue
Description copied from class:ExpressionReturns the i'th compile-time constant value within a literal or constructor. Indices which do not contain compile-time constant values will return empty. `vec4(1, vec2(2), 3)` contains four compile-time constants: (1, 2, 2, 3) `mat2(f)` contains four slots, and two are constant: (empty, 0, 0, empty)- Overrides:
getConstantValuein classExpression
-
copy
- Specified by:
copyin classExpression
-
toString
- Specified by:
toStringin classExpression
-