Package net.ssehub.easy.varModel.cst
Class CompoundAccess
java.lang.Object
net.ssehub.easy.varModel.cst.ConstraintSyntaxTree
net.ssehub.easy.varModel.cst.CompoundAccess
- All Implemented Interfaces:
IAttributeAccess
Represents an expression which accesses a compound slot where
the compound is specified as a
ConstraintSyntaxTree.- Author:
- Holger Eichelberger
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ConstraintSyntaxTreeprivate AbstractVariableprivate String -
Constructor Summary
ConstructorsConstructorDescriptionConstructor for serialization.CompoundAccess(ConstraintSyntaxTree compoundExpression, String slotName) Creates a compound access node. -
Method Summary
Modifier and TypeMethodDescriptionvoidaccept(IConstraintTreeVisitor visitor) Visiting method for the visitor.booleanThe expression denoting the compound to access.Returns the resolved compound slot.Returns the name of the slot.Returns the static type in case that this compound access is a static access.inthashCode()Infers the datatype of the subtree represented by this object.private DecisionVariableDeclarationsearchSlot(Compound comp, String slotName) Searches for a slot incompor its refined compounds.Methods inherited from class net.ssehub.easy.varModel.cst.ConstraintSyntaxTree
getAttribute, getAttribute, getAttributesCount, getContainedType, getName, getParent, isSemanticallyEqual
-
Field Details
-
compoundExpression
-
slotName
-
slot
-
-
Constructor Details
-
CompoundAccess
CompoundAccess()Constructor for serialization. -
CompoundAccess
Creates a compound access node.- Parameters:
compoundExpression- an expression denoting a compoundslotName- the name of the accessed slot
-
-
Method Details
-
searchSlot
Searches for a slot incompor its refined compounds.- Parameters:
comp- the compound to searchslotName- the name to search- Returns:
- the containing compound or null
-
getStaticType
Returns the static type in case that this compound access is a static access.- Returns:
- the static type or null
- Throws:
CSTSemanticException- in case of semantic errors
-
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.
-
getCompoundExpression
The expression denoting the compound to access.- Returns:
- the compound expression
-
getSlotName
Returns the name of the slot.- Returns:
- the name of the slot
-
getResolvedSlot
Returns the resolved compound slot. The result is only valid ifinferDatatype()was called before this operation.- Returns:
- the resolved slot, null if the slot cannot
be resolved or
inferDatatype()was not called before
-
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.
-
equals
-
hashCode
public int hashCode()
-