Top Description Fields Constructors Methods
org.stringtemplate.v4.compiler

public Class Compiler

extends Object
Class Inheritance
Imports
java.util.Collections, .HashMap, .List, .Map, java.util.concurrent.atomic.AtomicInteger, org.antlr.runtime.ANTLRStringStream, .CommonTokenStream, .NoViableAltException, .Parser, .RecognitionException, .Token, .TokenStream, org.antlr.runtime.tree.CommonTreeNodeStream, org.stringtemplate.v4.Interpreter, .ST, .STGroup, org.stringtemplate.v4.misc.ErrorType

A compiler for a single template.

Field Summary

Modifier and TypeField and Description
public static final Map<String, String>
public static Map<String, Short>
public STGroup
public static final int
public static final String
public static AtomicInteger
subtemplateCount

Name subtemplates _sub1, _sub2, ...

public static final Map<String, Interpreter.Option>
public static final int

Constructor Summary

AccessConstructor and Description
public
public

Method Summary

Modifier and TypeMethod and Description
public CompiledST
compile(String template)

public CompiledST
compile(String name, String template)

Compile full template with unknown formal arguments.

public CompiledST
compile(String srcName, String name, List<FormalArgument> args, String template, Token templateToken)

Compile full template with respect to a list of formal arguments.

public static CompiledST
defineBlankRegion(CompiledST outermostImpl, Token nameToken)

public static String
protected void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

defaultOptionValuesback to summary
public static final Map<String, String> defaultOptionValues
funcsback to summary
public static Map<String, Short> funcs
groupback to summary
public STGroup group
NUM_OPTIONSback to summary
public static final int NUM_OPTIONS
SUBTEMPLATE_PREFIXback to summary
public static final String SUBTEMPLATE_PREFIX
subtemplateCountback to summary
public static AtomicInteger subtemplateCount

Name subtemplates _sub1, _sub2, ...

supportedOptionsback to summary
public static final Map<String, Interpreter.Option> supportedOptions
TEMPLATE_INITIAL_CODE_SIZEback to summary
public static final int TEMPLATE_INITIAL_CODE_SIZE

Constructor Detail

Compilerback to summary
public Compiler()
Compilerback to summary
public Compiler(STGroup group)

Method Detail

compileback to summary
public CompiledST compile(String template)
compileback to summary
public CompiledST compile(String name, String template)

Compile full template with unknown formal arguments.

compileback to summary
public CompiledST compile(String srcName, String name, List<FormalArgument> args, String template, Token templateToken)

Compile full template with respect to a list of formal arguments.

defineBlankRegionback to summary
public static CompiledST defineBlankRegion(CompiledST outermostImpl, Token nameToken)
getNewSubtemplateNameback to summary
public static String getNewSubtemplateName()
reportMessageAndThrowSTExceptionback to summary
protected void reportMessageAndThrowSTException(TokenStream tokens, Token templateToken, Parser parser, RecognitionException re)