net.janino
Class Java.Statement

java.lang.Object
  |
  +--net.janino.Java.Statement
All Implemented Interfaces:
Java.BlockStatement, Java.Locatable, Java.Scope
Direct Known Subclasses:
Java.Block, Java.BreakableStatement, Java.BreakStatement, Java.ContinueStatement, Java.ExpressionStatement, Java.FieldDeclarator, Java.IfStatement, Java.LocalVariableDeclarationStatement, Java.ReturnStatement, Java.SynchronizedStatement, Java.ThrowStatement, Java.TryStatement
Enclosing class:
Java

public abstract static class Java.Statement
extends java.lang.Object
implements Java.BlockStatement, Java.Scope


Field Summary
protected  Java.Scope enclosingScope
           
 
Constructor Summary
protected Java.Statement(Scanner.Location location, Java.Scope enclosingScope)
           
 
Method Summary
abstract  boolean compile(ClassFile.CodeAttribute codeAttribute)
           
 Java.Scope getEnclosingScope()
           
 Scanner.Location getLocation()
           
 void leave(ClassFile.CodeAttribute codeAttribute)
          Clean up the statement context.
 void throwCompileException(java.lang.String message)
           
 void throwParseException(java.lang.String message)
           
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

enclosingScope

protected final Java.Scope enclosingScope
Constructor Detail

Java.Statement

protected Java.Statement(Scanner.Location location,
                         Java.Scope enclosingScope)
Method Detail

getEnclosingScope

public Java.Scope getEnclosingScope()
Specified by:
getEnclosingScope in interface Java.Scope
Following copied from interface: net.janino.Java.Scope
Returns:
Enclusing scope or "null".

getLocation

public Scanner.Location getLocation()
Specified by:
getLocation in interface Java.Locatable

throwParseException

public void throwParseException(java.lang.String message)
                         throws Parser.ParseException
Specified by:
throwParseException in interface Java.Locatable

throwCompileException

public void throwCompileException(java.lang.String message)
                           throws Java.CompileException
Specified by:
throwCompileException in interface Java.Locatable

compile

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

leave

public void leave(ClassFile.CodeAttribute codeAttribute)
Description copied from interface: Java.BlockStatement
Clean up the statement context. This is currently relevant for "try ... catch ... finally" statements (execute "finally" clause) and "synchronized" statements (monitorexit).

Statements like "return", "break", "continue" must call this method for all the statements they terminate.

Notice: The code generated by this method must not modify the operand stack, i.e. if the code needs any state information, then that information must be passed to it in unnamed local variables.

Specified by:
leave in interface Java.BlockStatement