Package net.ssehub.easy.varModel.cst
Class Let
- java.lang.Object
-
- net.ssehub.easy.varModel.cst.ConstraintSyntaxTree
-
- net.ssehub.easy.varModel.cst.Let
-
- All Implemented Interfaces:
IAttributeAccess
- Direct Known Subclasses:
IterLet
public class Let extends ConstraintSyntaxTree
Represents a let expression, i.e. a local variable declaration which can be used in the attached expression.- Author:
- Holger Eichelberger
-
-
Field Summary
Fields Modifier and Type Field Description private ConstraintSyntaxTreeinExprprivate DecisionVariableDeclarationvar
-
Constructor Summary
Constructors Constructor Description Let(DecisionVariableDeclaration var, ConstraintSyntaxTree inExpr)Creates a new let expression.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(IConstraintTreeVisitor visitor)Visiting method for the visitor.booleanequals(java.lang.Object obj)ConstraintSyntaxTreegetInExpression()Returns the expression the local variable may be used in.ConstraintSyntaxTreegetInitExpression()Returns the initialization expression.DecisionVariableDeclarationgetVariable()Returns the local variable.inthashCode()IDatatypeinferDatatype()Infers the datatype of the subtree represented by this object.-
Methods inherited from class net.ssehub.easy.varModel.cst.ConstraintSyntaxTree
getAttribute, getAttribute, getAttributesCount, getContainedType, getName, getParent, isSemanticallyEqual
-
-
-
-
Field Detail
-
var
private DecisionVariableDeclaration var
-
inExpr
private ConstraintSyntaxTree inExpr
-
-
Constructor Detail
-
Let
public Let(DecisionVariableDeclaration var, ConstraintSyntaxTree inExpr)
Creates a new let expression.- Parameters:
var- the local variableinExpr- the expression the local variable may be used in
-
-
Method Detail
-
getVariable
public DecisionVariableDeclaration getVariable()
Returns the local variable.- Returns:
- the local variable
-
getInitExpression
public ConstraintSyntaxTree getInitExpression()
Returns the initialization expression.- Returns:
- the initialization expression
-
getInExpression
public ConstraintSyntaxTree getInExpression()
Returns the expression the local variable may be used in.- Returns:
- the expression using the local variable
-
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.
-
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.
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-