Class ContinueStatement

  • All Implemented Interfaces:
    java.lang.Comparable<AstNode>, java.lang.Iterable<Node>

    public class ContinueStatement
    extends Jump
    A continue statement. Node type is Token.CONTINUE.

    ContinueStatement :
       continue [no LineTerminator here] [Identifier] ;
    • Constructor Detail

      • ContinueStatement

        public ContinueStatement()
      • ContinueStatement

        public ContinueStatement​(int pos)
      • ContinueStatement

        public ContinueStatement​(int pos,
                                 int len)
      • ContinueStatement

        public ContinueStatement​(Name label)
      • ContinueStatement

        public ContinueStatement​(int pos,
                                 Name label)
      • ContinueStatement

        public ContinueStatement​(int pos,
                                 int len,
                                 Name label)
    • Method Detail

      • getTarget

        public Loop getTarget()
        Returns continue target
      • setTarget

        public void setTarget​(Loop target)
        Sets continue target. Does NOT set the parent of the target node: the target node is an ancestor of this node.
        Parameters:
        target - continue target
        Throws:
        java.lang.IllegalArgumentException - if target is null
      • getLabel

        public Name getLabel()
        Returns the intended label of this continue statement
        Returns:
        the continue label. Will be null if the statement consisted only of the keyword "continue".
      • setLabel

        public void setLabel​(Name label)
        Sets the intended label of this continue statement. Only applies if the statement was of the form "continue <label>".
        Parameters:
        label - the continue label, or null if not present.
      • toSource

        public java.lang.String toSource​(int depth)
        Description copied from class: AstNode
        Emits source code for this node. Callee is responsible for calling this function recursively on children, incrementing indent as appropriate.

        Note: if the parser was in error-recovery mode, some AST nodes may have null children that are expected to be non-null when no errors are present. In this situation, the behavior of the toSource method is undefined: toSource implementations may assume that the AST node is error-free, since it is intended to be invoked only at runtime after a successful parse.

        Overrides:
        toSource in class Jump
        Parameters:
        depth - the current recursion depth, typically beginning at 0 when called on the root node.
      • visit

        public void visit​(NodeVisitor v)
        Visits this node, then visits the label if non-null.
        Overrides:
        visit in class Jump
        Parameters:
        v - the object to call with this node and its children