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
public class Comment extends ConstraintSyntaxTree
Represents a comment in a parse tree. This can be placed before any other CST node.- Author:
- Holger Eichelberger
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Stringcommentprivate ConstraintSyntaxTreeexprStores the commented expression.
-
Constructor Summary
Constructors Constructor Description Comment(ConstraintSyntaxTree expr, java.lang.String comment)Creates a new comment node.
-
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)java.lang.StringgetComment()Returns the comment text.ConstraintSyntaxTreegetExpr()Returns the commented expression.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
-
expr
private ConstraintSyntaxTree expr
Stores the commented expression.
-
comment
private java.lang.String comment
-
-
Constructor Detail
-
Comment
public Comment(ConstraintSyntaxTree expr, java.lang.String comment)
Creates a new comment node.- Parameters:
expr- the commented expressioncomment- the comment text
-
-
Method Detail
-
getExpr
public ConstraintSyntaxTree getExpr()
Returns the commented expression.- Returns:
- the commented expression
-
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.
-
getComment
public java.lang.String getComment()
Returns the comment text.- Returns:
- the comment text
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-