Package icyllis.arc3d.compiler.tree
Class Expression
java.lang.Object
icyllis.arc3d.compiler.tree.Node
icyllis.arc3d.compiler.tree.Expression
- Direct Known Subclasses:
BinaryExpression,ConditionalExpression,ConstructorCall,FieldAccess,FunctionCall,FunctionReference,IndexExpression,Literal,Poison,PostfixExpression,PrefixExpression,Swizzle,TypeReference,VariableReference
Abstract superclass of all expressions.
-
Nested Class Summary
Nested classes/interfaces inherited from class icyllis.arc3d.compiler.tree.Node
Node.ElementKind, Node.ExpressionKind, Node.StatementKind, Node.SymbolKind -
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanaccept(@NonNull TreeVisitor visitor) Visit this AST with a given visitor.final Expressioncopy()Returns a deep copy at the same position.abstract Expressioncopy(int position) final longgetCoercionCost(Type other) getConstantValue(int i) Returns the i'th compile-time constant value within a literal or constructor.abstract Node.ExpressionKindgetKind()final TypegetType()final booleanbooleanfinal booleanfinal booleanisIncomplete(Context context) Returns true if this expression is incomplete.final booleanbooleanfinal StringtoString()Returns a description of the expression.abstract StringtoString(int parentPrecedence) Methods inherited from class icyllis.arc3d.compiler.tree.Node
getEndOffset, getStartOffset
-
Constructor Details
-
Expression
-
-
Method Details
-
getKind
- See Also:
-
accept
Description copied from class:NodeVisit this AST with a given visitor. -
getType
-
isConstructorCall
public boolean isConstructorCall() -
isLiteral
public boolean isLiteral() -
isIntLiteral
public final boolean isIntLiteral() -
isFloatLiteral
public final boolean isFloatLiteral() -
isBooleanLiteral
public final boolean isBooleanLiteral() -
getCoercionCost
- See Also:
-
isIncomplete
Returns true if this expression is incomplete. Specifically, dangling function/method-call references that were never invoked, or type references that were never constructed, are considered incomplete expressions and should result in an error. -
getConstantValue
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) -
copy
Returns a deep copy at the same position. -
copy
-
toString
Returns a description of the expression. -
toString
-