Modifier and Type | Field and Description |
---|---|
org.antlr.runtime.tree.CommonTree |
ast
How do we interpret syntax of template? (debug only)
|
int |
codeSize |
Map<String,FormalArgument> |
formalArguments |
boolean |
hasFormalArgs |
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? |
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.RegionType |
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.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 and Description |
---|
CompiledST() |
Modifier and Type | Method and Description |
---|---|
void |
addArg(FormalArgument a)
Used by
ST.add(java.lang.String, java.lang.Object) to add args one by one without turning on full formal args definition signal. |
void |
addImplicitlyDefinedTemplate(CompiledST sub) |
CompiledST |
clone()
Cloning the
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. |
void |
defineArgDefaultValueTemplates(STGroup group) |
void |
defineFormalArgs(List<FormalArgument> args) |
void |
defineImplicitlyDefinedTemplates(STGroup group) |
String |
disasm() |
void |
dump() |
Interval |
getTemplateRange() |
String |
getTemplateSource() |
String |
instrs() |
public String name
public String prefix
"/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 String template
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 STGroup nativeGroup
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 CompiledST clone() 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(CompiledST sub)
public void defineArgDefaultValueTemplates(STGroup group)
public void defineFormalArgs(List<FormalArgument> args)
public void addArg(FormalArgument a)
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(STGroup group)
public String getTemplateSource()
public Interval getTemplateRange()
public String instrs()
public void dump()
public String disasm()
Copyright © 2024. All rights reserved.