Package org.stringtemplate.v4.compiler
Class CompilationState
java.lang.Object
org.stringtemplate.v4.compiler.CompilationState
Temporary data used during construction and functions that fill it / use it.
Result is
impl CompiledST object.-
Field Summary
FieldsModifier and TypeFieldDescription(package private) ErrorManager(package private) CompiledSTThe compiled code implementation to fill in.(package private) intTrack instruction location withinimpl.instrsarray; this is next address to write to.(package private) StringTableTrack unique strings; copy intoCompiledST.stringsafter compilation.(package private) org.antlr.runtime.TokenStream -
Constructor Summary
ConstructorsConstructorDescriptionCompilationState(ErrorManager errMgr, String name, org.antlr.runtime.TokenStream tokens) -
Method Summary
Modifier and TypeMethodDescriptionintvoidemit(short opcode) voidemit(org.antlr.runtime.tree.CommonTree opAST, short opcode) voidemit1(org.antlr.runtime.tree.CommonTree opAST, short opcode, int arg) voidvoidemit2(org.antlr.runtime.tree.CommonTree opAST, short opcode, int arg, int arg2) voidprotected voidensureCapacity(int n) voidfunc(org.antlr.runtime.Token templateToken, org.antlr.runtime.tree.CommonTree id) voidindent(org.antlr.runtime.tree.CommonTree indent) voidvoidrefAttr(org.antlr.runtime.Token templateToken, org.antlr.runtime.tree.CommonTree id) voidsetOption(org.antlr.runtime.tree.CommonTree id) voidwrite(int addr, short value) static voidwriteShort(byte[] memory, int index, short value) Write value at index into a byte array highest to lowest byte, left to right.
-
Field Details
-
impl
CompiledST implThe compiled code implementation to fill in. -
stringtable
StringTable stringtableTrack unique strings; copy intoCompiledST.stringsafter compilation. -
ip
int ipTrack instruction location withinimpl.instrsarray; this is next address to write to. Byte-addressable memory. -
tokens
org.antlr.runtime.TokenStream tokens -
errMgr
ErrorManager errMgr
-
-
Constructor Details
-
CompilationState
-
-
Method Details
-
defineString
-
refAttr
public void refAttr(org.antlr.runtime.Token templateToken, org.antlr.runtime.tree.CommonTree id) -
setOption
public void setOption(org.antlr.runtime.tree.CommonTree id) -
func
public void func(org.antlr.runtime.Token templateToken, org.antlr.runtime.tree.CommonTree id) -
emit
public void emit(short opcode) -
emit
public void emit(org.antlr.runtime.tree.CommonTree opAST, short opcode) -
emit1
public void emit1(org.antlr.runtime.tree.CommonTree opAST, short opcode, int arg) -
emit2
public void emit2(org.antlr.runtime.tree.CommonTree opAST, short opcode, int arg, int arg2) -
emit2
-
emit1
-
insert
-
write
public void write(int addr, short value) -
ensureCapacity
protected void ensureCapacity(int n) -
indent
public void indent(org.antlr.runtime.tree.CommonTree indent) -
writeShort
public static void writeShort(byte[] memory, int index, short value) Write value at index into a byte array highest to lowest byte, left to right.
-