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 TypeMethodDescriptionboolean
accept
(TreeVisitor visitor) Visit this AST with a given visitor.clone
(int position) boolean
getConstantValue
(int i) Returns the i'th compile-time constant value within a literal or constructor.float
long
getKind()
double
getValue()
boolean
static Literal
static Literal
makeBoolean
(int position, boolean value, Type type) static Literal
makeBoolean
(Context context, int position, boolean value) static Literal
static Literal
static Literal
makeInteger
(int position, long value, Type type) static Literal
makeInteger
(Context context, int position, long value) toString
(int parentPrecedence) Methods inherited from class icyllis.arc3d.compiler.tree.Expression
clone, getCoercionCost, getType, isBooleanLiteral, isConstructorCall, isFloatLiteral, isIncomplete, isIntLiteral, toString
Methods inherited from class icyllis.arc3d.compiler.tree.Node
getEndOffset, getStartOffset
-
Method Details
-
makeFloat
-
makeFloat
-
makeInteger
-
makeInteger
-
makeBoolean
-
makeBoolean
-
make
-
getKind
- Specified by:
getKind
in classExpression
- See Also:
-
accept
Description copied from class:Node
Visit this AST with a given visitor. -
isLiteral
public boolean isLiteral()- Overrides:
isLiteral
in classExpression
-
getFloatValue
public float getFloatValue() -
getIntegerValue
public long getIntegerValue() -
getBooleanValue
public boolean getBooleanValue() -
getValue
public double getValue() -
getConstantValue
Description copied from class:Expression
Returns 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:
getConstantValue
in classExpression
-
clone
- Specified by:
clone
in classExpression
-
toString
- Specified by:
toString
in classExpression
-