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
public class UnresolvedExpression extends ConstraintSyntaxTree
Denotes an expression (tree) which is currently unresolved due to deferred imports, e.g. model imports resolved at runtime.- Author:
- Holger Eichelberger
-
-
Field Summary
Fields Modifier and Type Field Description private ConstraintSyntaxTreeactualExpressionprivate ConstraintSyntaxTreeexpressionprivate java.lang.StringunresolvedLeaf
-
Constructor Summary
Constructors Constructor Description UnresolvedExpression(java.lang.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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(IConstraintTreeVisitor visitor)Visiting method for the visitor.ConstraintSyntaxTreegetActualExpression()Returns the actual expression.java.lang.StringgetUnresolvedLeaf()Returns the unresolved leaf text.IDatatypeinferDatatype()Infers the datatype of the subtree represented by this object.booleanisLeaf()Returns whether this tree node represents a CST leaf.booleanisResolved()Returns 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 Detail
-
actualExpression
private ConstraintSyntaxTree actualExpression
-
expression
private ConstraintSyntaxTree expression
-
unresolvedLeaf
private java.lang.String unresolvedLeaf
-
-
Constructor Detail
-
UnresolvedExpression
public UnresolvedExpression(java.lang.String unresolvedLeaf)
Creates an unresolved expression as a (currently unknown) textual leaf.- Parameters:
unresolvedLeaf- the the unresolved leaf
-
UnresolvedExpression
public UnresolvedExpression(ConstraintSyntaxTree expression)
Creates an unresolved expression as an inner tree node.- Parameters:
expression- the contained (unresolved) expression
-
-
Method Detail
-
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
public java.lang.String getUnresolvedLeaf()
Returns the unresolved leaf text.- Returns:
- the unresolved leaf text (may be null)
-
setConstantValue
public void setConstantValue(Value value)
Changes the actual expression to a constant value.- Parameters:
value- the inferred constant value
-
setActualExpression
void setActualExpression(ConstraintSyntaxTree actualExpression)
Changes the actual expression.- Parameters:
actualExpression- the new actual expression
-
getActualExpression
public ConstraintSyntaxTree getActualExpression()
Returns the actual expression. This may be an inferred constant value or the actually resolvedexpression.- Returns:
- the actual expression (may be null)
-
accept
public void accept(IConstraintTreeVisitor visitor)
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
public IDatatype inferDatatype() throws CSTSemanticException
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.
-
-