Package org.stringtemplate.v4.compiler
Class Compiler
- java.lang.Object
-
- org.stringtemplate.v4.compiler.Compiler
-
public class Compiler extends Object
A compiler for a single template.
-
-
Field Summary
Fields Modifier and Type Field Description static Map<String,String>defaultOptionValuesstatic Map<String,Short>funcsSTGroupgroupstatic intNUM_OPTIONSstatic StringSUBTEMPLATE_PREFIXstatic AtomicIntegersubtemplateCountName subtemplates_sub1,_sub2, ...static Map<String,Interpreter.Option>supportedOptionsstatic intTEMPLATE_INITIAL_CODE_SIZE
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description CompiledSTcompile(String template)CompiledSTcompile(String name, String template)Compile full template with unknown formal arguments.CompiledSTcompile(String srcName, String name, List<FormalArgument> args, String template, org.antlr.runtime.Token templateToken)Compile full template with respect to a list of formal arguments.static CompiledSTdefineBlankRegion(CompiledST outermostImpl, org.antlr.runtime.Token nameToken)static StringgetNewSubtemplateName()protected voidreportMessageAndThrowSTException(org.antlr.runtime.TokenStream tokens, org.antlr.runtime.Token templateToken, org.antlr.runtime.Parser parser, org.antlr.runtime.RecognitionException re)
-
-
-
Field Detail
-
SUBTEMPLATE_PREFIX
public static final String SUBTEMPLATE_PREFIX
- See Also:
- Constant Field Values
-
TEMPLATE_INITIAL_CODE_SIZE
public static final int TEMPLATE_INITIAL_CODE_SIZE
- See Also:
- Constant Field Values
-
supportedOptions
public static final Map<String,Interpreter.Option> supportedOptions
-
NUM_OPTIONS
public static final int NUM_OPTIONS
-
subtemplateCount
public static AtomicInteger subtemplateCount
Name subtemplates_sub1,_sub2, ...
-
group
public STGroup group
-
-
Constructor Detail
-
Compiler
public Compiler()
-
Compiler
public Compiler(STGroup group)
-
-
Method Detail
-
compile
public CompiledST compile(String template)
-
compile
public CompiledST compile(String name, String template)
Compile full template with unknown formal arguments.
-
compile
public CompiledST compile(String srcName, String name, List<FormalArgument> args, String template, org.antlr.runtime.Token templateToken)
Compile full template with respect to a list of formal arguments.
-
defineBlankRegion
public static CompiledST defineBlankRegion(CompiledST outermostImpl, org.antlr.runtime.Token nameToken)
-
getNewSubtemplateName
public static String getNewSubtemplateName()
-
reportMessageAndThrowSTException
protected void reportMessageAndThrowSTException(org.antlr.runtime.TokenStream tokens, org.antlr.runtime.Token templateToken, org.antlr.runtime.Parser parser, org.antlr.runtime.RecognitionException re)
-
-