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 Details

  • Constructor Details

    • UnresolvedExpression

      public UnresolvedExpression(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 Details

    • isLeaf

      public boolean isLeaf()
      Returns whether this tree node represents a CST leaf.
      Returns:
      true if it is a leaf, false else
    • isResolved

      public boolean isResolved()
      Returns whether this expression is actually resolved.
      Returns:
      true if it is resolved, false else
    • getUnresolvedLeaf

      public 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 resolved expression.
      Returns:
      the actual expression (may be null)
    • accept

      public void accept(IConstraintTreeVisitor visitor)
      Description copied from class: ConstraintSyntaxTree
      Visiting method for the visitor.
      This method is used for saving this model element.
      Specified by:
      accept in class ConstraintSyntaxTree
      Parameters:
      visitor - The visitor, which should save this model element.
    • inferDatatype

      public IDatatype inferDatatype() throws CSTSemanticException
      Description copied from class: ConstraintSyntaxTree
      Infers the datatype of the subtree represented by this object.
      Specified by:
      inferDatatype in class ConstraintSyntaxTree
      Returns:
      the data type
      Throws:
      CSTSemanticException - Will be thrown if parameters of (sub-) trees do not fit together.