Package net.ssehub.easy.varModel.cst
Class UnresolvedExpression
java.lang.Object
net.ssehub.easy.varModel.cst.ConstraintSyntaxTree
net.ssehub.easy.varModel.cst.UnresolvedExpression
- All Implemented Interfaces:
IAttributeAccess
Denotes an expression (tree) which is currently unresolved
due to deferred imports, e.g. model imports resolved at runtime.
- Author:
- Holger Eichelberger
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ConstraintSyntaxTreeprivate ConstraintSyntaxTreeprivate String -
Constructor Summary
ConstructorsConstructorDescriptionUnresolvedExpression(String unresolvedLeaf) Creates an unresolved expression as a (currently unknown) textual leaf.UnresolvedExpression(ConstraintSyntaxTree expression) Creates an unresolved expression as an inner tree node. -
Method Summary
Modifier and TypeMethodDescriptionvoidaccept(IConstraintTreeVisitor visitor) Visiting method for the visitor.Returns the actual expression.Returns the unresolved leaf text.Infers the datatype of the subtree represented by this object.booleanisLeaf()Returns whether this tree node represents a CST leaf.booleanReturns whether this expression is actually resolved.(package private) voidsetActualExpression(ConstraintSyntaxTree actualExpression) Changes the actual expression.voidsetConstantValue(Value value) Changes the actual expression to a constant value.Methods inherited from class net.ssehub.easy.varModel.cst.ConstraintSyntaxTree
getAttribute, getAttribute, getAttributesCount, getContainedType, getName, getParent, isSemanticallyEqual
-
Field Details
-
actualExpression
-
expression
-
unresolvedLeaf
-
-
Constructor Details
-
UnresolvedExpression
Creates an unresolved expression as a (currently unknown) textual leaf.- Parameters:
unresolvedLeaf- the the unresolved leaf
-
UnresolvedExpression
Creates an unresolved expression as an inner tree node.- Parameters:
expression- the contained (unresolved) expression
-
-
Method Details
-
isLeaf
public boolean isLeaf()Returns whether this tree node represents a CST leaf.- Returns:
trueif it is a leaf,falseelse
-
isResolved
public boolean isResolved()Returns whether this expression is actually resolved.- Returns:
trueif it is resolved,falseelse
-
getUnresolvedLeaf
Returns the unresolved leaf text.- Returns:
- the unresolved leaf text (may be null)
-
setConstantValue
Changes the actual expression to a constant value.- Parameters:
value- the inferred constant value
-
setActualExpression
Changes the actual expression.- Parameters:
actualExpression- the new actual expression
-
getActualExpression
Returns the actual expression. This may be an inferred constant value or the actually resolvedexpression.- Returns:
- the actual expression (may be null)
-
accept
Description copied from class:ConstraintSyntaxTreeVisiting method for the visitor.
This method is used for saving this model element.- Specified by:
acceptin classConstraintSyntaxTree- Parameters:
visitor- The visitor, which should save this model element.
-
inferDatatype
Description copied from class:ConstraintSyntaxTreeInfers the datatype of the subtree represented by this object.- Specified by:
inferDatatypein classConstraintSyntaxTree- Returns:
- the data type
- Throws:
CSTSemanticException- Will be thrown if parameters of (sub-) trees do not fit together.
-