Class BreakStmt
- java.lang.Object
-
- com.tonic.analysis.source.ast.stmt.BreakStmt
-
-
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.StringgetTargetLabel()booleanhasLabel()voidsetLocation(SourceLocation location)Sets this statement's source location.voidsetParent(ASTNode parent)Sets the enclosing AST node.voidsetTargetLabel(String targetLabel)Sets the label this break targets.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
-
BreakStmt
public BreakStmt(String targetLabel, SourceLocation location)
Creates a break statement.- Parameters:
targetLabel- label to break to, or null for an unlabeled breaklocation- source location, or null for unknown
-
BreakStmt
public BreakStmt(String targetLabel)
Creates a break statement with an unknown location.- Parameters:
targetLabel- label to break to, or null for an unlabeled break
-
BreakStmt
public BreakStmt()
Creates an unlabeled break statement.
-
-
Method Detail
-
getTargetLabel
public String getTargetLabel()
- Returns:
- the target label
-
setTargetLabel
public void setTargetLabel(String targetLabel)
Sets the label this break targets.- Parameters:
targetLabel- the new target label, or null for an unlabeled break
-
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 AST node.
-
hasLabel
public boolean hasLabel()
- Returns:
- true if this break targets a label
-
accept
public <T> T accept(SourceVisitor<T> visitor)
Description copied from interface:ASTNodeAccepts a visitor for this node.
-
setLocation
public void setLocation(SourceLocation location)
Description copied from interface:StatementSets this statement's source location.- Specified by:
setLocationin interfaceStatement- Parameters:
location- the provenance to stamp, or null forSourceLocation.UNKNOWN
-
-