Class ContinueStmt

  • All Implemented Interfaces:
    ASTNode, Statement

    public final class ContinueStmt
    extends Object
    implements Statement
    A continue statement with an optional target label.
    • Constructor Detail

      • ContinueStmt

        public ContinueStmt​(String targetLabel,
                            SourceLocation location)
        Creates a continue statement.
        Parameters:
        targetLabel - label to continue to, or null for an unlabeled continue
        location - source location, or null for unknown
      • ContinueStmt

        public ContinueStmt​(String targetLabel)
        Creates a continue statement with an unknown location.
        Parameters:
        targetLabel - label to continue to, or null for an unlabeled continue
      • ContinueStmt

        public ContinueStmt()
        Creates an unlabeled continue statement.
    • Method Detail

      • getTargetLabel

        public String getTargetLabel()
        Returns:
        the target label
      • setTargetLabel

        public void setTargetLabel​(String targetLabel)
        Sets the label this continue targets.
        Parameters:
        targetLabel - the new target label, or null for an unlabeled continue
      • getLocation

        public SourceLocation getLocation()
        Description copied from interface: ASTNode
        Gets the source location of this node.
        Specified by:
        getLocation in interface ASTNode
        Returns:
        the location
      • getParent

        public ASTNode getParent()
        Description copied from interface: ASTNode
        Gets the parent node in the AST tree.
        Specified by:
        getParent in interface ASTNode
        Returns:
        the parent
      • setParent

        public void setParent​(ASTNode parent)
        Sets the enclosing AST node.
        Specified by:
        setParent in interface ASTNode
        Parameters:
        parent - the new parent node
      • hasLabel

        public boolean hasLabel()
        Returns:
        true if this continue targets a label
      • accept

        public <T> T accept​(SourceVisitor<T> visitor)
        Description copied from interface: ASTNode
        Accepts a visitor for this node.
        Specified by:
        accept in interface ASTNode
        Type Parameters:
        T - the return type of the visitor
        Parameters:
        visitor - the visitor to accept
        Returns:
        the result from the visitor