public final class Expression extends AstNodeBase
| Modifier and Type | Class and Description |
|---|---|
static class |
Expression.ExpressionFlag
Defines expression flag for constructors.
|
static class |
Expression.ExpressionType
Defines evaluated type of the expression.
|
static class |
Expression.OptionalFieldInfo
Optional field information returned from the getReferencedOptionalFields() method.
|
| Constructor and Description |
|---|
Expression(AstLocation location,
Package pkg,
int expressionType,
java.lang.String expressionText,
Expression.ExpressionFlag expressionFlag)
Constructor.
|
Expression(AstLocation location,
Package pkg,
int expressionType,
java.lang.String expressionText,
Expression.ExpressionFlag expressionFlag,
Expression operand1)
Constructor.
|
Expression(AstLocation location,
Package pkg,
int expressionType,
java.lang.String expressionText,
Expression.ExpressionFlag expressionFlag,
Expression operand1,
Expression operand2)
Constructor.
|
Expression(AstLocation location,
Package pkg,
int expressionType,
java.lang.String expressionText,
Expression.ExpressionFlag expressionFlag,
Expression operand1,
Expression operand2,
Expression operand3)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
accept(ZserioAstVisitor visitor)
Accept zserio visitor.
|
boolean |
containsIndex()
Checks if expression contains token "index".
|
boolean |
containsTernaryOperator()
Checks if expression contains ternary operator 'a ? b : c'.
|
ZserioType |
getExprOwner()
Gets the owner of the expression.
|
AstNode |
getExprSymbolObject()
Gets the evaluated identifier symbol object for the expression.
|
Expression.ExpressionType |
getExprType()
Gets the evaluated type of the expression.
|
ZserioType |
getExprZserioType()
Gets the evaluated Zserio type for the expression.
|
java.math.BigInteger |
getIntegerLowerBound()
Gets lower bound for integer expression.
|
java.math.BigInteger |
getIntegerUpperBound()
Gets upper bound for integer expression.
|
java.math.BigInteger |
getIntegerValue()
Gets value for integer expression.
|
java.util.Map<Field,Expression.OptionalFieldInfo> |
getReferencedOptionalFields()
Gets all optional Field objects referenced from the expression.
|
<T extends AstNode> |
getReferencedSymbolObjects(java.lang.Class<? extends T> clazz)
Gets all objects of given class referenced from the expression.
|
java.lang.String |
getStringValue()
Gets value for string expression.
|
java.lang.String |
getText()
Gets the expression text given by the parser.
|
int |
getType()
Gets the expression type given by the parser.
|
boolean |
isExplicitVariable()
Checks if the expression contains explicit variable.
|
boolean |
isMostLeftId()
Checks if the expression is most left identifier.
|
boolean |
needsBigInteger()
Gets needs BigInteger flag.
|
boolean |
needsBigIntegerCastingToNative()
Gets needs BigInteger casting to native flag.
|
Expression |
op1()
Gets the first operand for the expression.
|
Expression |
op2()
Gets the second operand for the expression.
|
Expression |
op3()
Gets the third operand for the expression.
|
boolean |
requiresOwnerContext()
Returns true if the expression requires the context of its owner.
|
void |
visitChildren(ZserioAstVisitor visitor)
Visit children of the current AST node using given visitor.
|
getLocationpublic Expression(AstLocation location, Package pkg, int expressionType, java.lang.String expressionText, Expression.ExpressionFlag expressionFlag)
location - AST node location.pkg - Package to which the expression belongs.expressionType - Expression grammar token type.expressionText - Expression grammar token text.expressionFlag - Flag for the expression.public Expression(AstLocation location, Package pkg, int expressionType, java.lang.String expressionText, Expression.ExpressionFlag expressionFlag, Expression operand1)
location - AST node location.pkg - Package to which the expression belongs.expressionType - Expression grammar token type.expressionText - Expression grammar token text.expressionFlag - Flag for the expression.operand1 - Operand of the expression.public Expression(AstLocation location, Package pkg, int expressionType, java.lang.String expressionText, Expression.ExpressionFlag expressionFlag, Expression operand1, Expression operand2)
location - AST node location.pkg - Package to which the expression belongs.expressionType - Expression grammar token type.expressionText - Expression grammar token text.expressionFlag - Flag for the expression.operand1 - Left operand of the expression.operand2 - Right operand of the expression.public Expression(AstLocation location, Package pkg, int expressionType, java.lang.String expressionText, Expression.ExpressionFlag expressionFlag, Expression operand1, Expression operand2, Expression operand3)
location - AST node location.pkg - Package to which the expression belongs.expressionType - Expression grammar token type.expressionText - Expression grammar token text.expressionFlag - Flag for the expression.operand1 - Left operand of the expression.operand2 - Middle operand of the expression.operand3 - Right operand of the expression.public void accept(ZserioAstVisitor visitor)
AstNodevisitor - Visitor to accept.public void visitChildren(ZserioAstVisitor visitor)
AstNodevisitChildren in interface AstNodevisitChildren in class AstNodeBasevisitor - Visitor to use.public int getType()
public java.lang.String getText()
public Expression op1()
public Expression op2()
public Expression op3()
public boolean isExplicitVariable()
public boolean isMostLeftId()
public Expression.ExpressionType getExprType()
public ZserioType getExprZserioType()
public AstNode getExprSymbolObject()
public ZserioType getExprOwner()
public java.math.BigInteger getIntegerValue()
public java.lang.String getStringValue()
public java.math.BigInteger getIntegerLowerBound()
public java.math.BigInteger getIntegerUpperBound()
public boolean needsBigInteger()
public boolean needsBigIntegerCastingToNative()
public <T extends AstNode> java.util.Set<T> getReferencedSymbolObjects(java.lang.Class<? extends T> clazz)
T - Type of the object which should be found.clazz - Class of which object should be found.public java.util.Map<Field,Expression.OptionalFieldInfo> getReferencedOptionalFields()
public boolean requiresOwnerContext()
public boolean containsIndex()
public boolean containsTernaryOperator()
Last updated 2024-10-29 12:52:38