| Modifier and Type | Field and Description |
|---|---|
org |
ast
How do we interpret syntax of template? (debug only)
|
int |
codeSize
|
Map |
formalArguments
|
boolean |
hasFormalArgs
|
List |
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?
|
String |
name
|
STGroup |
nativeGroup
The group that physically defines this
ST definition.
|
int |
numberOfArgsWithDefaultValues
|
String |
prefix
Every template knows where it is relative to the group that loaded it.
|
ST |
regionDefType
If someone refs
<@r()> in template t, an implicit
|
Interval |
sourceMap
|
String |
strings
|
String |
template
The original, immutable pattern (not really used again after initial "compilation").
|
org |
templateDefStartToken
The token that begins template definition; could be
<@r> of region.
|
org |
tokens
Overall token stream for template (debug only).
|
| Constructor and Description |
|---|
CompiledST()
|
| Modifier and Type | Method and Description |
|---|---|
void |
addArg(FormalArgument
Used by
ST to add args one by one without turning on full formal args definition signal.
|
void |
addImplicitlyDefinedTemplate(CompiledST
|
CompiledST |
clone()
Cloning the
CompiledST for an
ST instance allows
ST to be called safely during interpretation for templates that do not contain formal arguments.
|
void |
defineArgDefaultValueTemplates(STGroup
|
void |
defineFormalArgs(List
|
void |
defineImplicitlyDefinedTemplates(STGroup
|
String |
disasm()
|
void |
dump()
|
Interval |
getTemplateRange()
|
String |
getTemplateSource()
|
String |
instrs()
|
public Stringname
public Stringprefix
"/prefix/name" is the fully qualified name of this template. All calls to
STGroup.getInstanceOf(java.lang.String) calls must use fully qualified names. A
"/" is added to the front if you don't specify one. Template references within template code, however, uses relative names, unless of course the name starts with
"/".
This has nothing to do with the outer filesystem path to the group dir or group file.
We set this as we load/compile the template.
Always ends with "/".
public Stringtemplate
public org.antlr .runtime .Token templateDefStartToken
<@r> of region.
public org.antlr .runtime .TokenStream tokens
public org.antlr .runtime .tree .CommonTree ast
public Map<String ,FormalArgument > formalArguments
public boolean hasFormalArgs
public int numberOfArgsWithDefaultValues
public List<CompiledST > implicitlyDefinedTemplates
public STGroupnativeGroup
ST definition. We use it to initiate interpretation via
ST.toString() . From there, it becomes field
Interpreter.group and is fixed until rendering completes.
public boolean isRegion
<@region>...<@end> embedded in another template?
public ST.RegionType regionDefType
<@r()> in template t, an implicit
@t.r() ::= ""
is defined, but you can overwrite this def by defining your own. We need to prevent more than one manual def though. Between this var and isRegion we can determine these cases.
public boolean isAnonSubtemplate
public String[] strings
public byte[] instrs
public int codeSize
public Interval[] sourceMap
public CompiledSTclone() throws CloneNotSupportedException
CompiledST for an
ST instance allows
ST.add(java.lang.String, java.lang.Object) to be called safely during interpretation for templates that do not contain formal arguments.
clone in class
Object
CompiledST instance. The copy is a shallow copy, with the exception of the
formalArguments field which is also cloned.
CloneNotSupportedException - If the current instance cannot be cloned.
public void addImplicitlyDefinedTemplate(CompiledSTsub)
public void defineArgDefaultValueTemplates(STGroupgroup)
public void defineFormalArgs(List<FormalArgument > args)
public void addArg(FormalArgumenta)
ST.add(java.lang.String, java.lang.Object) to add args one by one without turning on full formal args definition signal.
public void defineImplicitlyDefinedTemplates(STGroupgroup)
public StringgetTemplateSource()
public IntervalgetTemplateRange()
public Stringinstrs()
public void dump()
public Stringdisasm()