org.extex.ocpware.writer
Class OcpOmegaWriter

java.lang.Object
  extended by org.extex.ocpware.writer.AbstractWriter
      extended by org.extex.ocpware.writer.OcpOmegaWriter
All Implemented Interfaces:
OcpWriter
Direct Known Subclasses:
OcpOmegaWriter2

public class OcpOmegaWriter
extends AbstractWriter

This is a writer for ΩCP programs which conforms to the one provided with Omega.

Version:
$Revision: 6447 $
Author:
Gerd Neugebauer

Constructor Summary
  OcpOmegaWriter()
          Creates a new object.
protected OcpOmegaWriter(int adjust, boolean fill)
          Creates a new object.
 
Method Summary
protected  java.lang.String charString(int value)
          Generate an alternate description of a character for printable characters.
protected  boolean disassemble(java.io.PrintStream out, int[] t, int j)
          Dump a dis-assembled form of an instruction.
protected  void print(java.io.PrintStream out, java.lang.String key, int value)
          Print a number as hex and as decimal and optionally as character to an output stream.
protected  void printNum(int off, java.io.PrintStream out, java.lang.String key, int value, int value2)
          Print a number as hex and as decimal to an output stream.
protected  void printNum(java.io.PrintStream out, java.lang.String key, int value)
          Print a number as hex and as decimal to an output stream.
 void write(java.io.OutputStream stream, OcpProgram ocp)
          Write the ΩCP program to an output stream.
 
Methods inherited from class org.extex.ocpware.writer.AbstractWriter
booleanResource, format, room
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OcpOmegaWriter

public OcpOmegaWriter()
Creates a new object.


OcpOmegaWriter

protected OcpOmegaWriter(int adjust,
                         boolean fill)
Creates a new object.

Parameters:
adjust - the adjust length
fill - the fill indicator
Method Detail

charString

protected java.lang.String charString(int value)
Generate an alternate description of a character for printable characters.

Parameters:
value - the character code
Returns:
the character string

disassemble

protected boolean disassemble(java.io.PrintStream out,
                              int[] t,
                              int j)
Dump a dis-assembled form of an instruction.

Parameters:
out - the output stream
t - the array
j - the index
Returns:
true iff another word as argument is required

print

protected void print(java.io.PrintStream out,
                     java.lang.String key,
                     int value)
Print a number as hex and as decimal and optionally as character to an output stream.

Parameters:
out - the output stream
key - the resource bundle key
value - the value to print

printNum

protected void printNum(int off,
                        java.io.PrintStream out,
                        java.lang.String key,
                        int value,
                        int value2)
Print a number as hex and as decimal to an output stream.

Parameters:
off - offset
out - the output stream
key - the resource bundle key
value - the value to print
value2 - the second value to print

printNum

protected void printNum(java.io.PrintStream out,
                        java.lang.String key,
                        int value)
Print a number as hex and as decimal to an output stream.

Parameters:
out - the output stream
key - the resource bundle key
value - the value to print

write

public void write(java.io.OutputStream stream,
                  OcpProgram ocp)
Write the ΩCP program to an output stream.

Parameters:
stream - the output stream
ocp - the ocp program
See Also:
OcpWriter.write(java.io.OutputStream, org.extex.ocpware.type.OcpProgram)