Class SuperExpr
- java.lang.Object
-
- com.tonic.analysis.source.ast.expr.SuperExpr
-
- All Implemented Interfaces:
ASTNode,Expression
public final class SuperExpr extends Object implements Expression
Represents the 'super' expression.
-
-
Constructor Summary
Constructors Constructor Description SuperExpr(SourceType type)Creates a super reference with an unknown source position.SuperExpr(SourceType type, SourceLocation location)Creates a super reference of the given type.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> Taccept(SourceVisitor<T> visitor)Accepts a visitor for this node.SourceLocationgetLocation()Gets the source location of this node.ASTNodegetParent()Gets the parent node in the AST tree.SourceTypegetType()Gets the inferred type of this expression.voidsetParent(ASTNode parent)Sets the enclosing node.StringtoString()-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.tonic.analysis.source.ast.ASTNode
deepClone, findAll, findAll, findAncestor, findFirst, findFirst, getChildren, getRoot, isDescendantOf, remove, replaceWith, stream, stream, walk
-
-
-
-
Constructor Detail
-
SuperExpr
public SuperExpr(SourceType type, SourceLocation location)
Creates a super reference of the given type.- Parameters:
type- the superclass type this expression denoteslocation- source position, null for unknown- Throws:
NullPointerException- if the type is null
-
SuperExpr
public SuperExpr(SourceType type)
Creates a super reference with an unknown source position.- Parameters:
type- the superclass type this expression denotes- Throws:
NullPointerException- if the type is null
-
-
Method Detail
-
getType
public SourceType getType()
Description copied from interface:ExpressionGets the inferred type of this expression.- Specified by:
getTypein interfaceExpression- Returns:
- the type
-
getLocation
public SourceLocation getLocation()
Description copied from interface:ASTNodeGets the source location of this node.- Specified by:
getLocationin interfaceASTNode- Returns:
- the location
-
getParent
public ASTNode getParent()
Description copied from interface:ASTNodeGets the parent node in the AST tree.
-
setParent
public void setParent(ASTNode parent)
Sets the enclosing node.
-
accept
public <T> T accept(SourceVisitor<T> visitor)
Description copied from interface:ASTNodeAccepts a visitor for this node.
-
-