Interface LabelNode

All Superinterfaces:
ASTNode
All Known Subinterfaces:
OrdinaryLabelNode, SwitchLabelNode

public interface LabelNode extends ASTNode
Represents a label in a program. This can be either an ordinary label, which is an identifier followed by a colon followed by a statement, and can be used as the target of a goto (for example); or it can be a case or default label used in a switch statement.
  • Method Details

    • getStatement

      StatementNode getStatement()
      The statement which is preceded by a label (but not including the label). Note that the statement is not a child of this node. If it were, the AST would not be a tree.
      Returns:
      the statement labeled
    • setStatement

      void setStatement(StatementNode statement)
      Sets the value returned by getStatement().
      Parameters:
      statement - the statement labeled
    • copy

      LabelNode copy()
      Description copied from interface: ASTNode
      Returns a deep copy of this AST node. The node and all of its descendants will be cloned. The cloning does not copy analysis or attribute information.
      Specified by:
      copy in interface ASTNode
      Returns:
      deep copy of this node