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 TypeMethodDescriptionbooleanaccept(TreeVisitor visitor) Visit this AST with a given visitor.clone(int position) booleangetConstantValue(int i) Returns the i'th compile-time constant value within a literal or constructor.floatlonggetKind()doublegetValue()booleanstatic Literalstatic LiteralmakeBoolean(int position, boolean value, Type type) static LiteralmakeBoolean(Context context, int position, boolean value) static Literalstatic Literalstatic LiteralmakeInteger(int position, long value, Type type) static LiteralmakeInteger(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, 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:
-
accept
Description copied from class:NodeVisit this AST with a given visitor. -
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
-
clone
- Specified by:
clonein classExpression
-
toString
- Specified by:
toStringin classExpression
-