at.dms.ksm
Class MethodBody

java.lang.Object
  |
  +--at.dms.ksm.MethodBody

public class MethodBody
extends java.lang.Object

This class represent the definition of a method body.


Constructor Summary
MethodBody()
           
 
Method Summary
 void addHandler(java.lang.String thrown, LabelReference start, LabelReference end, LabelReference handler)
          Add an exception handler info.
 void addInstruction(Instruction instruction)
          Add an instruction at the end of the instruction list.
 void addLabel(java.lang.String name)
          Add a label at the end of the instruction list.
 void addLineNumber(int line)
          Add a line number info.
 void addVariable(java.lang.String name, java.lang.String type, LabelReference start, LabelReference end, short slot)
          Add a local variable info.
 CodeInfo genCodeInfo()
          Generate a classfile code info, do not optimize.
 Instruction resolveLabel(java.lang.String name)
          Returns the instruction at specified label.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MethodBody

public MethodBody()
Method Detail

addInstruction

public void addInstruction(Instruction instruction)
Add an instruction at the end of the instruction list.

addLabel

public void addLabel(java.lang.String name)
              throws KsmError
Add a label at the end of the instruction list.
Throws:
KsmError - An assembler error.

addHandler

public void addHandler(java.lang.String thrown,
                       LabelReference start,
                       LabelReference end,
                       LabelReference handler)
Add an exception handler info.

addLineNumber

public void addLineNumber(int line)
Add a line number info.

addVariable

public void addVariable(java.lang.String name,
                        java.lang.String type,
                        LabelReference start,
                        LabelReference end,
                        short slot)
Add a local variable info.

resolveLabel

public Instruction resolveLabel(java.lang.String name)
                         throws UnresolvableLabelException
Returns the instruction at specified label.
Parameters:
name - The label name.

genCodeInfo

public CodeInfo genCodeInfo()
                     throws KsmError
Generate a classfile code info, do not optimize.
Throws:
KsmError - An assembler error.