net.janino
Class Java.FunctionDeclarator

java.lang.Object
  |
  +--net.janino.Java.Located
        |
        +--net.janino.Java.FunctionDeclarator
All Implemented Interfaces:
Java.Locatable, Java.Scope
Direct Known Subclasses:
Java.ConstructorDeclarator, Java.MethodDeclarator
Enclosing class:
Java

public abstract static class Java.FunctionDeclarator
extends net.janino.Java.Located
implements Java.Scope

Abstract base class for Java.ConstructorDeclarator and Java.MethodDeclarator.


Field Summary
protected  Java.ClassOrInterfaceDeclaration declaringClassOrInterface
           
protected  short modifiers
           
protected  Java.Type[] thrownExceptions
           
 
Constructor Summary
Java.FunctionDeclarator(Scanner.Location location, Java.ClassOrInterfaceDeclaration declaringClassOrInterface, short modifiers, Java.Type type, java.lang.String name, Java.FormalParameter[] formalParameters, Java.Type[] thrownExceptions)
           
 
Method Summary
 short addConstantFloatInfo(float value)
           
 short addConstantIntegerInfo(int value)
           
 short addConstantStringInfo(java.lang.String value)
           
 short allocateLocalVariable(short size)
           
 void compile(ClassFile classFile, int debuggingInformation)
           
 void compileError(java.lang.String message)
           
 ClassFile.CodeAttribute createDummyCodeAttribute()
           
protected abstract  java.util.List getBlockStatementsToCompile()
           
 Java.Scope getEnclosingScope()
           
 Java.FormalParameter[] getFormalParameters()
           
 Scanner.Location getLocation()
           
 short getModifiers()
           
 java.lang.String getName()
           
 IClass getReturnType()
           
 ClassFile.CodeAttribute.Inserter newInserter()
           
 ClassFile.CodeAttribute.Offset newOffset()
           
 ClassFile.CodeAttribute.Offset newUnsetOffset()
           
 void popInserter()
           
 void pushInserter(ClassFile.CodeAttribute.Inserter ins)
           
 void restoreLocalVariables()
           
 void saveLocalVariables()
           
 void throwParseException(java.lang.String message)
           
 void write(byte[] b)
           
 void writeBranch(int opcode, ClassFile.CodeAttribute.Offset dst)
           
 void writeByte(int v)
           
 void writeConstantClassInfo(java.lang.String descriptor)
           
 void writeConstantDoubleInfo(double value)
           
 void writeConstantFieldrefInfo(java.lang.String classFD, java.lang.String fieldName, java.lang.String fieldFD)
           
 void writeConstantFloatInfo(float value)
           
 void writeConstantIntegerInfo(int value)
           
 void writeConstantInterfaceMethodrefInfo(java.lang.String classFD, java.lang.String methodName, java.lang.String methodMD)
           
 void writeConstantLongInfo(long value)
           
 void writeConstantMethodrefInfo(java.lang.String classFD, java.lang.String methodName, java.lang.String methodMD)
           
 void writeConstantStringInfo(java.lang.String value)
           
 void writeInt(int v)
           
 void writeOffset(ClassFile.CodeAttribute.Offset src, ClassFile.CodeAttribute.Offset dst)
           
 void writeOpcode(int opcode)
           
 void writeShort(int v)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

declaringClassOrInterface

protected Java.ClassOrInterfaceDeclaration declaringClassOrInterface

modifiers

protected short modifiers

thrownExceptions

protected Java.Type[] thrownExceptions
Constructor Detail

Java.FunctionDeclarator

public Java.FunctionDeclarator(Scanner.Location location,
                               Java.ClassOrInterfaceDeclaration declaringClassOrInterface,
                               short modifiers,
                               Java.Type type,
                               java.lang.String name,
                               Java.FormalParameter[] formalParameters,
                               Java.Type[] thrownExceptions)
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".

getModifiers

public short getModifiers()

getReturnType

public IClass getReturnType()
                     throws Java.CompileException

getName

public java.lang.String getName()

getFormalParameters

public Java.FormalParameter[] getFormalParameters()

compile

public void compile(ClassFile classFile,
                    int debuggingInformation)
             throws Java.CompileException

getBlockStatementsToCompile

protected abstract java.util.List getBlockStatementsToCompile()

createDummyCodeAttribute

public ClassFile.CodeAttribute createDummyCodeAttribute()

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

compileError

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

write

public void write(byte[] b)

writeByte

public void writeByte(int v)

writeInt

public void writeInt(int v)

writeShort

public void writeShort(int v)

writeOpcode

public void writeOpcode(int opcode)

writeBranch

public void writeBranch(int opcode,
                        ClassFile.CodeAttribute.Offset dst)

writeOffset

public void writeOffset(ClassFile.CodeAttribute.Offset src,
                        ClassFile.CodeAttribute.Offset dst)

writeConstantClassInfo

public void writeConstantClassInfo(java.lang.String descriptor)

writeConstantFieldrefInfo

public void writeConstantFieldrefInfo(java.lang.String classFD,
                                      java.lang.String fieldName,
                                      java.lang.String fieldFD)

writeConstantMethodrefInfo

public void writeConstantMethodrefInfo(java.lang.String classFD,
                                       java.lang.String methodName,
                                       java.lang.String methodMD)

writeConstantInterfaceMethodrefInfo

public void writeConstantInterfaceMethodrefInfo(java.lang.String classFD,
                                                java.lang.String methodName,
                                                java.lang.String methodMD)

writeConstantStringInfo

public void writeConstantStringInfo(java.lang.String value)

addConstantStringInfo

public short addConstantStringInfo(java.lang.String value)

writeConstantIntegerInfo

public void writeConstantIntegerInfo(int value)

addConstantIntegerInfo

public short addConstantIntegerInfo(int value)

writeConstantFloatInfo

public void writeConstantFloatInfo(float value)

addConstantFloatInfo

public short addConstantFloatInfo(float value)

writeConstantLongInfo

public void writeConstantLongInfo(long value)

writeConstantDoubleInfo

public void writeConstantDoubleInfo(double value)

newOffset

public ClassFile.CodeAttribute.Offset newOffset()

newUnsetOffset

public ClassFile.CodeAttribute.Offset newUnsetOffset()

newInserter

public ClassFile.CodeAttribute.Inserter newInserter()

pushInserter

public void pushInserter(ClassFile.CodeAttribute.Inserter ins)

popInserter

public void popInserter()

saveLocalVariables

public void saveLocalVariables()

restoreLocalVariables

public void restoreLocalVariables()

allocateLocalVariable

public short allocateLocalVariable(short size)