org.stringtemplate.v4.compiler
Class CompiledST

java.lang.Object
  extended by org.stringtemplate.v4.compiler.CompiledST

public class CompiledST
extends java.lang.Object

The result of compiling an ST. Contains all the bytecode instructions, string table, bytecode address to source code map, and other bookkeeping info. It's the implementation of an ST you might say. All instances of the same template share a single implementation (impl field).


Field Summary
 org.antlr.runtime.tree.CommonTree ast
          How do we interpret syntax of template? (debug only)
 int codeSize
           
 java.util.Map<java.lang.String,FormalArgument> formalArguments
           
 boolean hasFormalArgs
           
 java.util.List<CompiledST> implicitlyDefinedTemplates
          A list of all regions and subtemplates
 byte[] instrs
           
 boolean isAnonSubtemplate
           
 boolean isRegion
          Does this template come from a <@region>...<@end> embedded in another template?
 java.lang.String name
           
 STGroup nativeGroup
          The group that physically defines this ST definition.
 int numberOfArgsWithDefaultValues
           
 ST.RegionType regionDefType
          If someone refs <@r()> in template t, an implicit
 Interval[] sourceMap
           
 java.lang.String[] strings
           
 java.lang.String template
          The original, immutable pattern (not really used again after initial "compilation").
 org.antlr.runtime.Token templateDefStartToken
          The token that begins template definition; could be <@r> of region.
 org.antlr.runtime.TokenStream tokens
          Overall token stream for template (debug only)
 
Constructor Summary
CompiledST()
           
 
Method Summary
 void addArg(FormalArgument a)
          Used by ST.add() to add args one by one w/o turning on full formal args definition signal
 void addImplicitlyDefinedTemplate(CompiledST sub)
           
 void defineArgDefaultValueTemplates(STGroup group)
           
 void defineFormalArgs(java.util.List<FormalArgument> args)
           
 void defineImplicitlyDefinedTemplates(STGroup group)
           
 java.lang.String disasm()
           
 void dump()
           
 Interval getTemplateRange()
           
 java.lang.String getTemplateSource()
           
 java.lang.String instrs()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

public java.lang.String name

template

public java.lang.String template
The original, immutable pattern (not really used again after initial "compilation"). Useful for debugging. Even for subtemplates, this is entire overall template.


templateDefStartToken

public org.antlr.runtime.Token templateDefStartToken
The token that begins template definition; could be <@r> of region.


tokens

public org.antlr.runtime.TokenStream tokens
Overall token stream for template (debug only)


ast

public org.antlr.runtime.tree.CommonTree ast
How do we interpret syntax of template? (debug only)


formalArguments

public java.util.Map<java.lang.String,FormalArgument> formalArguments

hasFormalArgs

public boolean hasFormalArgs

numberOfArgsWithDefaultValues

public int numberOfArgsWithDefaultValues

implicitlyDefinedTemplates

public java.util.List<CompiledST> implicitlyDefinedTemplates
A list of all regions and subtemplates


nativeGroup

public STGroup nativeGroup
The group that physically defines this ST definition. We use it to initiate interpretation via ST.toString(). From there, it becomes field 'group' in interpreter and is fixed until rendering completes.


isRegion

public boolean isRegion
Does this template come from a <@region>...<@end> embedded in another template?


regionDefType

public ST.RegionType regionDefType
If someone refs <@r()> in template t, an implicit


isAnonSubtemplate

public boolean isAnonSubtemplate

strings

public java.lang.String[] strings

instrs

public byte[] instrs

codeSize

public int codeSize

sourceMap

public Interval[] sourceMap
Constructor Detail

CompiledST

public CompiledST()
Method Detail

addImplicitlyDefinedTemplate

public void addImplicitlyDefinedTemplate(CompiledST sub)

defineArgDefaultValueTemplates

public void defineArgDefaultValueTemplates(STGroup group)

defineFormalArgs

public void defineFormalArgs(java.util.List<FormalArgument> args)

addArg

public void addArg(FormalArgument a)
Used by ST.add() to add args one by one w/o turning on full formal args definition signal


defineImplicitlyDefinedTemplates

public void defineImplicitlyDefinedTemplates(STGroup group)

getTemplateSource

public java.lang.String getTemplateSource()

getTemplateRange

public Interval getTemplateRange()

instrs

public java.lang.String instrs()

dump

public void dump()

disasm

public java.lang.String disasm()


Copyright © 2011. All Rights Reserved.