Package org.codehaus.groovy.classgen.asm.sc

# Class StaticTypesStatementWriter

java.lang.Object
org.codehaus.groovy.classgen.asm.StatementWriter
org.codehaus.groovy.classgen.asm.sc.StaticTypesStatementWriter

public class StaticTypesStatementWriter extends StatementWriter
A class to write out the optimized statements.

- ## Field Summary

  ### Fields inherited from class org.codehaus.groovy.classgen.asm.StatementWriter

  `controller`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `StaticTypesStatementWriter(StaticTypesWriterController controller)`
  Creates a statement writer that favors statically typed loop and block generation.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `writeBlockStatement(BlockStatement statement)`
  Generates bytecode for a block statement by visiting each contained statement.
  `protected void`
  `writeForInLoop(ForStatement loop)`
  Generates bytecode for a for-in loop by calling `iterator()` on the collection expression and delegating loop control to `StatementWriter.writeForInLoopControlAndBlock(org.codehaus.groovy.ast.stmt.ForStatement)`.

  ### Methods inherited from class org.codehaus.groovy.classgen.asm.StatementWriter

  `defineLoopIndexVariable, incrementForLoopIndexVariable, storeForLoopVariable, writeAssert, writeBreak, writeContinue, writeDoWhileLoop, writeExpressionStatement, writeForInLoopControlAndBlock, writeForLoopWithClosureList, writeForStatement, writeIfElse, writeIteratorHasNext, writeIteratorNext, writeLoopBackEdge, writeReturn, writeStatementLabel, writeSwitch, writeSynchronized, writeThrow, writeTryCatchFinally, writeWhileLoop`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### StaticTypesStatementWriter

    public StaticTypesStatementWriter(StaticTypesWriterController controller)
    Creates a statement writer that favors statically typed loop and block generation.

- ## Method Details

  - ### writeBlockStatement

    public void writeBlockStatement(BlockStatement statement)
    Generates bytecode for a block statement by visiting each contained statement. Pushes the block's variable scope, emits the statements, and pops afterward. Named labels on the block create a breakable region so that `break label` within the block jumps to the end of it.
    Overrides:
      `writeBlockStatement` in class `StatementWriter`
    Parameters:
      `statement` - the block statement to compile

  - ### writeForInLoop

    protected void writeForInLoop(ForStatement loop)
    Generates bytecode for a for-in loop by calling `iterator()` on the collection expression and delegating loop control to `StatementWriter.writeForInLoopControlAndBlock(org.codehaus.groovy.ast.stmt.ForStatement)`.
    Overrides:
      `writeForInLoop` in class `StatementWriter`
    Parameters:
      `loop` - the for-in statement to compile