de.dante.dviware.dvitype
Class DviDisassemble

java.lang.Object
  extended byde.dante.dviware.dvitype.DviDisassemble
All Implemented Interfaces:
DviProcessor

public class DviDisassemble
extends java.lang.Object
implements DviProcessor

This class provides a command line tool to disassemble a DVI file.

Version:
$Revision: 1.5 $
Author:
Gerd Neugebauer

Field Summary
protected static java.lang.String PROP_CONFIG
          The constant PROP_CONFIG contains the name of the property for the configuration resource to use.
 
Constructor Summary
DviDisassemble(java.io.PrintStream out)
          Creates a new object.
 
Method Summary
 void bop(int off, int[] c, int p)
          A DVI bop instruction has been encountered.
 void down(int off, int b)
          A DVI down instruction has been encountered.
 void eop(int off)
          A DVI eop instruction has been encountered.
 void fnt(int off, int k)
          A DVI fnt instruction has been encountered.
 void fntDef(int off, int k, int c, int s, int d, java.lang.String name)
          A DVI fntDef instruction has been encountered.
static void main(java.lang.String[] args)
          The command line interface to dvitype.
 void nop(int off)
          A DVI nop instruction has been encountered.
 void pop(int off)
          A DVI pop instruction has been encountered.
 void post(int off, int p, int num, int den, int mag, int l, int u, int sp, int tp)
          A DVI post instruction has been encountered.
 void postPost(int off, int bop, int id)
          Invoke the callback on a POST_POST instruction.
 void pre(int off, int id, int num, int den, int mag, java.lang.String comment)
          A DVI pre instruction has been encountered.
protected static void process(java.lang.String arg, java.util.logging.Logger logger)
          Process an input file.
 void push(int off)
          A DVI push instruction has been encountered.
 void putChar(int off, int c)
          A DVI put_char instruction has been encountered.
 void putRule(int off, int a, int b)
          A DVI put_rule instruction has been encountered.
 void right(int off, int b)
          A DVI right instruction has been encountered.
 void setChar(int off, int c)
          A DVI set_char instruction has been encountered.
 void setRule(int off, int a, int b)
          A DVI set_rule instruction has been encountered.
 void undef(int off, int c, java.io.InputStream stream)
          A DVI undefined instruction has been encountered.
 void w(int off, int b)
          A DVI w instruction has been encountered.
 void w0(int off)
          A DVI w0 instruction has been encountered.
 void x(int off, int b)
          A DVI x instruction has been encountered.
 void x0(int off)
          A DVI x0 instruction has been encountered.
 void xxx(int off, byte[] x)
          A DVI xxx instruction has been encountered.
 void y(int off, int b)
          A DVI y instruction has been encountered.
 void y0(int off)
          A DVI y0 instruction has been encountered.
 void z(int off, int b)
          A DVI z instruction has been encountered.
 void z0(int off)
          A DVI z0 instruction has been encountered.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROP_CONFIG

protected static final java.lang.String PROP_CONFIG
The constant PROP_CONFIG contains the name of the property for the configuration resource to use.

See Also:
Constant Field Values
Constructor Detail

DviDisassemble

public DviDisassemble(java.io.PrintStream out)
Creates a new object.

Parameters:
out - the output stream
Method Detail

main

public static void main(java.lang.String[] args)
The command line interface to dvitype.

Parameters:
args - the command line arguments

process

protected static void process(java.lang.String arg,
                              java.util.logging.Logger logger)
Process an input file.

Parameters:
arg - the resource name to process
logger - the logger

bop

public void bop(int off,
                int[] c,
                int p)
Description copied from interface: DviProcessor
A DVI bop instruction has been encountered. This instruction signals the beginning of a new page.

Specified by:
bop in interface DviProcessor
Parameters:
off - the current byte position in the input stream
c - the array of page number indicators. The array has length 10. It is initialized from the count registers 0 to 9 at the time the page is shipped out.
p - the pointer to the previous bop instruction or -1 for the first page
See Also:
DviProcessor.bop(int, int[], int)

down

public void down(int off,
                 int b)
Description copied from interface: DviProcessor
A DVI down instruction has been encountered.

v ← v + ⟨a⟩

Specified by:
down in interface DviProcessor
Parameters:
off - the current byte position in the input stream
b - the number of DVI units to move down. If negative then the current position moves upwards.
See Also:
DviProcessor.down(int, int)

eop

public void eop(int off)
Description copied from interface: DviProcessor
A DVI eop instruction has been encountered. This instruction signals the end of a page.

Specified by:
eop in interface DviProcessor
Parameters:
off - the current byte position in the input stream
See Also:
DviProcessor.eop(int)

fnt

public void fnt(int off,
                int k)
Description copied from interface: DviProcessor
A DVI fnt instruction has been encountered.

f ← ⟨k⟩

Specified by:
fnt in interface DviProcessor
Parameters:
off - the current byte position in the input stream
k - the new font number; this number is not negative
See Also:
DviProcessor.fnt(int, int)

fntDef

public void fntDef(int off,
                   int k,
                   int c,
                   int s,
                   int d,
                   java.lang.String name)
Description copied from interface: DviProcessor
A DVI fntDef instruction has been encountered.

Specified by:
fntDef in interface DviProcessor
Parameters:
off - the current byte position in the input stream
k - the number of the font
c -
s -
d -
name -
See Also:
DviProcessor.fntDef(int, int, int, int, int, java.lang.String)

nop

public void nop(int off)
Description copied from interface: DviProcessor
A DVI nop instruction has been encountered. This instruction simply does nothing. It just occupies one byte in the input stream.

Specified by:
nop in interface DviProcessor
Parameters:
off - the current byte position in the input stream
See Also:
DviProcessor.nop(int)

pop

public void pop(int off)
Description copied from interface: DviProcessor
A DVI pop instruction has been encountered.

The registers h, b, w, x, y, z are poped from the stack.

Specified by:
pop in interface DviProcessor
Parameters:
off - the current byte position in the input stream
See Also:
DviProcessor.pop(int)

post

public void post(int off,
                 int p,
                 int num,
                 int den,
                 int mag,
                 int l,
                 int u,
                 int sp,
                 int tp)
Description copied from interface: DviProcessor
A DVI post instruction has been encountered.

Specified by:
post in interface DviProcessor
Parameters:
off - the current byte position in the input stream
p -
num - the numerator
den - the denominator
mag - the magnification
l -
u -
sp -
tp -
See Also:
DviProcessor.post(int, int, int, int, int, int, int, int, int)

postPost

public void postPost(int off,
                     int bop,
                     int id)
Description copied from interface: DviProcessor
Invoke the callback on a POST_POST instruction. This is the last instruction in a DVI file.

Specified by:
postPost in interface DviProcessor
Parameters:
off - the offset in the file of this instruction
bop - the index of the last BOP instruction
id - the id of this DVI version. Usually this is 2.
See Also:
DviProcessor.postPost(int, int, int)

pre

public void pre(int off,
                int id,
                int num,
                int den,
                int mag,
                java.lang.String comment)
Description copied from interface: DviProcessor
A DVI pre instruction has been encountered.

Specified by:
pre in interface DviProcessor
Parameters:
off - the current byte position in the input stream
id -
num -
den -
mag -
comment -
See Also:
DviProcessor.pre(int, int, int, int, int, java.lang.String)

push

public void push(int off)
Description copied from interface: DviProcessor
A DVI push instruction has been encountered.

Specified by:
push in interface DviProcessor
Parameters:
off - the current byte position in the input stream
See Also:
DviProcessor.push(int)

putChar

public void putChar(int off,
                    int c)
Description copied from interface: DviProcessor
A DVI put_char instruction has been encountered.

Specified by:
putChar in interface DviProcessor
Parameters:
off - the current byte position
c - the number of the character to set
See Also:
DviProcessor.putChar(int, int)

putRule

public void putRule(int off,
                    int a,
                    int b)
Description copied from interface: DviProcessor
A DVI put_rule instruction has been encountered.

Specified by:
putRule in interface DviProcessor
Parameters:
off - the current byte position in the input stream
a - the width
b - the height
See Also:
DviProcessor.putRule(int, int, int)

right

public void right(int off,
                  int b)
Description copied from interface: DviProcessor
A DVI right instruction has been encountered.

h ← h + ⟨b⟩

The argument b is added to the horizontal position h. If b is positive then the horizontal position is moved rightward by the given number of DVI units. If b is negative this means a movement leftwards.

Specified by:
right in interface DviProcessor
Parameters:
off - the current byte position in the input stream
b - the distance to move in DVI units
See Also:
DviProcessor.right(int, int)

setChar

public void setChar(int off,
                    int c)
Description copied from interface: DviProcessor
A DVI set_char instruction has been encountered.

Specified by:
setChar in interface DviProcessor
Parameters:
off - the current byte position
c - the number of the character to set
See Also:
DviProcessor.setChar(int, int)

setRule

public void setRule(int off,
                    int a,
                    int b)
Description copied from interface: DviProcessor
A DVI set_rule instruction has been encountered.

Specified by:
setRule in interface DviProcessor
Parameters:
off - the current byte position
a - the width
b - the height
See Also:
DviProcessor.setRule(int, int, int)

undef

public void undef(int off,
                  int c,
                  java.io.InputStream stream)
Description copied from interface: DviProcessor
A DVI undefined instruction has been encountered. This callback is invoked for the op-codes 250–255 which are undefined in TeX.

Specified by:
undef in interface DviProcessor
Parameters:
off - the current byte position
c - the opcode encountered
stream - the input stream to read further bytes from
See Also:
DviProcessor.undef(int, int, java.io.InputStream)

w

public void w(int off,
              int b)
Description copied from interface: DviProcessor
A DVI w instruction has been encountered.

The register w is assigned from the parameter of this instruction. Afterwards the register w is added to the horizontal position h.

Specified by:
w in interface DviProcessor
Parameters:
off - the current byte position in the input stream
b - the distance to add in DVI units
See Also:
DviProcessor.w(int, int)

w0

public void w0(int off)
Description copied from interface: DviProcessor
A DVI w0 instruction has been encountered.

h ← h + w

The register w is added to the horizontal position h.

Specified by:
w0 in interface DviProcessor
Parameters:
off - the current byte position in the input stream
See Also:
DviProcessor.w0(int)

x

public void x(int off,
              int b)
Description copied from interface: DviProcessor
A DVI x instruction has been encountered.

x ← ⟨b⟩
h ← h + x

Specified by:
x in interface DviProcessor
Parameters:
off - the current byte position in the input stream
b - the distance to move in DVI units
See Also:
DviProcessor.x(int, int)

x0

public void x0(int off)
Description copied from interface: DviProcessor
A DVI x0 instruction has been encountered.

h ← h + x

The register x is added to the horizontal position h.

Specified by:
x0 in interface DviProcessor
Parameters:
off - the current byte position in the input stream
See Also:
DviProcessor.x0(int)

xxx

public void xxx(int off,
                byte[] x)
Description copied from interface: DviProcessor
A DVI xxx instruction has been encountered. This instruction is used to pass some bytes uninterpreted to the DVI processor. In TeX this is accomplished with the primitive \special.

Specified by:
xxx in interface DviProcessor
Parameters:
off - the current byte position in the input stream
x - the array of bytes carrying the content
See Also:
DviProcessor.xxx(int, byte[])

y

public void y(int off,
              int b)
Description copied from interface: DviProcessor
A DVI y instruction has been encountered.

y ← ⟨a⟩
v ← v + y

Specified by:
y in interface DviProcessor
Parameters:
off - the current byte position in the input stream
b - the distance to move
See Also:
DviProcessor.y(int, int)

y0

public void y0(int off)
Description copied from interface: DviProcessor
A DVI y0 instruction has been encountered.

Set v ← v + y; thus the current position is moved down y DVI units.

Specified by:
y0 in interface DviProcessor
Parameters:
off - the current byte position in the input stream
See Also:
DviProcessor.y0(int)

z

public void z(int off,
              int b)
Description copied from interface: DviProcessor
A DVI z instruction has been encountered.

z ← ⟨a⟩
v ← v + z

Specified by:
z in interface DviProcessor
Parameters:
off - the current byte position in the input stream
b - the distance to move
See Also:
DviProcessor.z(int, int)

z0

public void z0(int off)
Description copied from interface: DviProcessor
A DVI z0 instruction has been encountered.

v ← v + z

Specified by:
z0 in interface DviProcessor
Parameters:
off - the current byte position in the input stream
See Also:
DviProcessor.z0(int)