Package net.ssehub.easy.varModel.cst
Class Comment
java.lang.Object
net.ssehub.easy.varModel.cst.ConstraintSyntaxTree
net.ssehub.easy.varModel.cst.Comment
- All Implemented Interfaces:
IAttributeAccess
Represents a comment in a parse tree. This can be placed before any other CST node.
- Author:
- Holger Eichelberger
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Stringprivate ConstraintSyntaxTreeStores the commented expression. -
Constructor Summary
ConstructorsConstructorDescriptionComment(ConstraintSyntaxTree expr, String comment) Creates a new comment node. -
Method Summary
Modifier and TypeMethodDescriptionvoidaccept(IConstraintTreeVisitor visitor) Visiting method for the visitor.booleanReturns the comment text.getExpr()Returns the commented expression.inthashCode()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 Details
-
expr
Stores the commented expression. -
comment
-
-
Constructor Details
-
Comment
Creates a new comment node.- Parameters:
expr- the commented expressioncomment- the comment text
-
-
Method Details
-
getExpr
Returns the commented expression.- Returns:
- the commented expression
-
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.
-
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.
-
getComment
Returns the comment text.- Returns:
- the comment text
-
equals
-
hashCode
public int hashCode()
-