SandMark version 3.0


sandmark.util.controlflowgraph
Class CodeContext

java.lang.Object
  |
  +--sandmark.util.controlflowgraph.CodeContext

public class CodeContext
extends java.lang.Object

A CodeContext encapsulates an InstructionHandle and an InstructionList to simplify the generation of sequences of code. Instance methods of the CodeContext update the InstructionHandle (the "code pointer") when called to insert or append new instructions in the underlying InstructionList.


Constructor Summary
CodeContext(de.fub.bytecode.generic.InstructionList l)
          Constructs a CodeContext for the given InstructionList and initializes the code pointer to null.
CodeContext(de.fub.bytecode.generic.InstructionList l, de.fub.bytecode.generic.InstructionHandle h)
          Constructs a CodeContext for the given InstructionList and initializes the code pointer to the given value.
 
Method Summary
 void append(de.fub.bytecode.generic.Instruction ins)
          Appends an instruction at the code pointer, and updates it.
 de.fub.bytecode.generic.InstructionHandle getHandle()
          Returns the code pointer.
 void getHandle(de.fub.bytecode.generic.InstructionHandle h)
          Sets the code pointer.
 void insert(de.fub.bytecode.generic.Instruction ins)
          Inserts an instruction at the code pointer, and updates it.
 java.lang.String toString()
          Returns a concise string representation of this CodeContext.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CodeContext

public CodeContext(de.fub.bytecode.generic.InstructionList l)
Constructs a CodeContext for the given InstructionList and initializes the code pointer to null.


CodeContext

public CodeContext(de.fub.bytecode.generic.InstructionList l,
                   de.fub.bytecode.generic.InstructionHandle h)
Constructs a CodeContext for the given InstructionList and initializes the code pointer to the given value.

Method Detail

getHandle

public de.fub.bytecode.generic.InstructionHandle getHandle()
Returns the code pointer.


getHandle

public void getHandle(de.fub.bytecode.generic.InstructionHandle h)
Sets the code pointer.


append

public void append(de.fub.bytecode.generic.Instruction ins)
Appends an instruction at the code pointer, and updates it.


insert

public void insert(de.fub.bytecode.generic.Instruction ins)
Inserts an instruction at the code pointer, and updates it.


toString

public java.lang.String toString()
Returns a concise string representation of this CodeContext.

Overrides:
toString in class java.lang.Object

SandMark version 3.0

Wed Jan 29 10:30:05 MST 2003