public class CompiledST
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
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 |
java.lang.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
@t.r() ::= ""
is defined, but you can overwrite this def by defining your own. |
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 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) |
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() |
public java.lang.String name
public java.lang.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 java.lang.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 java.util.Map<java.lang.String,FormalArgument> formalArguments
public boolean hasFormalArgs
public int numberOfArgsWithDefaultValues
public java.util.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 java.lang.String[] strings
public byte[] instrs
public int codeSize
public Interval[] sourceMap
public void addImplicitlyDefinedTemplate(CompiledST sub)
public void defineArgDefaultValueTemplates(STGroup group)
public void defineFormalArgs(java.util.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 java.lang.String getTemplateSource()
public Interval getTemplateRange()
public java.lang.String instrs()
public void dump()
public java.lang.String disasm()