JFlex
Class PackEmitter
public abstract class PackEmitter
extends java.lang.Object
Encodes int
arrays as strings.
Also splits up strings when longer than 64K in UTF8 encoding.
Subclasses emit unpacking code.
Usage protocol:
p.emitInit();
for each data: p.emitData(data);
p.emitUnpack();
protected int | chunks - number of existing string chunks
|
protected String | name - name of the generated array (mixed case, no yy prefix)
|
protected StringBuffer | out - output buffer
|
PackEmitter(String name) - Create new emitter for an array.
|
void | breaks() - Execute line/chunk break if necessary.
|
protected String | constName() - Convert array name into all uppercase internal scanner
constant name.
|
void | emitInit() - Emit declaration of decoded member and open first chunk.
|
void | emitUC(int i) - Emit single unicode character.
|
abstract void | emitUnpack() - Emit the unpacking code.
|
protected void | nl() - emit newline
|
protected void | println(String s)
|
String | toString() - Return current output buffer.
|
chunks
protected int chunks
number of existing string chunks
name
protected String name
name of the generated array (mixed case, no yy prefix)
out
protected StringBuffer out
output buffer
PackEmitter
public PackEmitter(String name)
Create new emitter for an array.
name
- the name of the generated array
breaks
public void breaks()
Execute line/chunk break if necessary.
Leave space for at least two chars.
constName
protected String constName()
Convert array name into all uppercase internal scanner
constant name.
name
as a internal constant name.
emitInit
public void emitInit()
Emit declaration of decoded member and open first chunk.
emitUC
public void emitUC(int i)
Emit single unicode character.
Updates length, position, etc.
i
- the character to emit.
emitUnpack
public abstract void emitUnpack()
Emit the unpacking code.
nl
protected void nl()
emit newline
println
protected void println(String s)
toString
public String toString()
Return current output buffer.