net.janino
Class Java.Block

java.lang.Object
  |
  +--net.janino.Java.Statement
        |
        +--net.janino.Java.Block
All Implemented Interfaces:
Java.BlockStatement, Java.Locatable, Java.Scope
Enclosing class:
Java

public static class Java.Block
extends Java.Statement

Representation of a JavaTM "block" (JLS 14.2).

The statements that the block defines are executed in sequence.


Fields inherited from class net.janino.Java.Statement
enclosingScope
 
Constructor Summary
Java.Block(Scanner.Location location, Java.Scope enclosingScope)
           
 
Method Summary
 void addStatement(Java.BlockStatement statement)
           
 void addStatements(java.util.Vector statements)
           
 boolean compile(ClassFile.CodeAttribute codeAttribute)
           
 short defineLocalVariable(Java.Locatable locatable, ClassFile.CodeAttribute codeAttribute, boolean finaL, IClass type, java.lang.String name)
           
 void defineLocalVariables(ClassFile.CodeAttribute codeAttribute, Java.LocalVariableDeclarationStatement lvds)
           
 Java.BlockStatement[] getStatements()
           
 
Methods inherited from class net.janino.Java.Statement
getEnclosingScope, getLocation, leave, throwCompileException, throwParseException
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Java.Block

public Java.Block(Scanner.Location location,
                  Java.Scope enclosingScope)
Method Detail

addStatement

public void addStatement(Java.BlockStatement statement)

addStatements

public void addStatements(java.util.Vector statements)

getStatements

public Java.BlockStatement[] getStatements()

compile

public boolean compile(ClassFile.CodeAttribute codeAttribute)
                throws Java.CompileException
Overrides:
compile in class Java.Statement
Following copied from interface: net.janino.Java.BlockStatement
Returns:
false if this statement cannot complete normally (14.20)

defineLocalVariable

public short defineLocalVariable(Java.Locatable locatable,
                                 ClassFile.CodeAttribute codeAttribute,
                                 boolean finaL,
                                 IClass type,
                                 java.lang.String name)
                          throws Java.CompileException

defineLocalVariables

public void defineLocalVariables(ClassFile.CodeAttribute codeAttribute,
                                 Java.LocalVariableDeclarationStatement lvds)
                          throws Java.CompileException