Class BlockStatement

All Implemented Interfaces:
Terminal, Cloneable

public class BlockStatement extends Statement
Represents a block used as a statement.
  • Constructor Details

    • BlockStatement

      public BlockStatement(int lineNumber, Block block)
      Constructor
      Parameters:
      lineNumber - line number
      block - the block to execute
  • Method Details

    • isTerminal

      public boolean isTerminal()
      Description copied from class: Statement
      Is this a terminal statement, i.e. does it end control flow like a throw or return?
      Specified by:
      isTerminal in interface Terminal
      Overrides:
      isTerminal in class Statement
      Returns:
      true if this node statement is terminal
    • isSynthetic

      public boolean isSynthetic()
      Tells if this is a synthetic block statement or not.
      Returns:
      true if this is a synthetic statement
    • accept

      public Node accept(NodeVisitor<? extends LexicalContext> visitor)
      Description copied from class: Node
      Provides a means to navigate the IR.
      Specified by:
      accept in class Node
      Parameters:
      visitor - Node visitor.
      Returns:
      node the node or its replacement after visitation, null if no further visitations are required
    • accept

      public <R> R accept(TranslatorNodeVisitor<? extends LexicalContext, R> visitor)
      Description copied from class: Node
      Provides a means to navigate the IR.
      Specified by:
      accept in class Node
      Parameters:
      visitor - Node visitor.
      Returns:
      node the node or its replacement after visitation, null if no further visitations are required
    • toString

      public void toString(StringBuilder sb, boolean printType)
      Description copied from class: Node
      Print logic that decides whether to show the optimistic type or not - for example it should not be printed after just parse, when it hasn't been computed, or has been set to a trivially provable value
      Specified by:
      toString in class Node
      Parameters:
      sb - string builder
      printType - print type?
    • getBlock

      public Block getBlock()
      Return the block to be executed
      Returns:
      the block
    • setBlock

      public BlockStatement setBlock(Block block)
      Reset the block to be executed
      Parameters:
      block - the block
      Returns:
      new or same execute node