Class BlockStatement


public final class BlockStatement extends Statement
A block of multiple statements functioning as a single statement.
  • Constructor Details

    • BlockStatement

      public BlockStatement(int position, List<Statement> statements, boolean scoped)
  • Method Details

    • make

      public static Statement make(int pos, List<Statement> statements, boolean scoped)
    • makeBlock

      public static BlockStatement makeBlock(int pos, List<Statement> statements)
    • makeCompound

      public static Statement makeCompound(Statement before, Statement after)
    • getKind

      public Node.StatementKind getKind()
      Specified by:
      getKind in class Statement
      See Also:
    • accept

      public boolean accept(@Nonnull TreeVisitor visitor)
      Description copied from class: Node
      Visit this AST with a given visitor.
      Specified by:
      accept in class Node
      Returns:
      true to stop recursion and propagate true up the stack, false to continue
    • isEmpty

      public boolean isEmpty()
      Overrides:
      isEmpty in class Statement
    • getStatements

      public List<Statement> getStatements()
    • setStatements

      public void setStatements(List<Statement> statements)
    • isScoped

      public boolean isScoped()
    • setScoped

      public void setScoped(boolean scoped)
    • toString

      @Nonnull public String toString()
      Specified by:
      toString in class Node
      Returns:
      a string representation of this AST node