public class TemplateGenerator extends Object implements ITemplateGenerator
| Modifier and Type | Field and Description |
|---|---|
static String |
ALTERNATE_EXPRESSION_BEGIN |
static int |
ALTERNATE_EXPRESSION_BEGIN_LEN |
static String |
ALTERNATE_EXPRESSION_END |
static int |
ALTERNATE_EXPRESSION_END_LEN |
static String |
COMMENT_BEGIN |
static int |
COMMENT_BEGIN_LEN |
static String |
COMMENT_END |
static int |
COMMENT_END_LEN |
static char |
DECLARATION_SUFFIX |
static char |
DIRECTIVE_SUFFIX |
static char |
ESCAPED_ALTERNATE_EXPRESSION_BEGIN_CHAR |
static char |
ESCAPED_SCRIPTLET_BEGIN_CHAR |
static char |
ESCAPED_SCRIPTLET_MARKER |
static char |
EXPRESSION_SUFFIX |
static String |
GS_TEMPLATE |
static String |
GS_TEMPLATE_PARSED |
static LockingLazyVar<ISymbol> |
PRINT_CONTENT_SYMBOL |
static LockingLazyVar<ISymbol> |
PRINT_RANGE_SYMBOL |
static String |
SCRIPTLET_BEGIN |
static int |
SCRIPTLET_BEGIN_LEN |
static String |
SCRIPTLET_END |
static int |
SCRIPTLET_END_LEN |
static int |
SUBSTR_CHUNKSIZE |
PRINT_COMPRESSED_METHOD, PRINT_METHOD, PRINT_RANGE_METHOD| Modifier and Type | Method and Description |
|---|---|
void |
compile(ISymbolTable symTable) |
void |
compile(Stack<IScriptPartId> scriptPartIdStack,
ISymbolTable symTable,
Map<String,Set<IFunctionSymbol>> dfsDeclByName,
ITypeUsesMap typeUsesMap,
Stack<BlockExpression> blocks,
ContextInferenceManager ctxInferenceMgr) |
void |
execute(Writer writer,
ISymbolTable symbolTable) |
void |
execute(Writer writer,
StringEscaper escaper,
ISymbolTable symTable) |
static void |
generateTemplate(Reader readerTemplate,
Writer writerOut,
ISymbolTable symTable)
Generates a template of any format having embedded Gosu.
|
static void |
generateTemplate(Reader readerTemplate,
Writer writerOut,
ISymbolTable symTable,
boolean strict)
Generates a template of any format having embedded Gosu.
|
String |
getFullyQualifiedTypeName() |
List<ISymbol> |
getParameters() |
Program |
getProgram() |
String |
getSource() |
IType |
getSuperType() |
static TemplateGenerator |
getTemplate(Reader readerTemplate) |
static TemplateGenerator |
getTemplate(Reader readerTemplate,
String fullyQualifiedName) |
List<TemplateParseException> |
getTemplateSyntaxProblems() |
boolean |
isForStringLiteral() |
boolean |
isValid() |
static void |
printContent(String strContent,
boolean escape)
For internal use only!!
|
static void |
printRange(int iStart,
int iEnd) |
void |
setContextInferenceManager(ContextInferenceManager ctxInferenceMgr) |
void |
setDisableAlternative(boolean disableAlternative) |
void |
setForStringLiteral(boolean bForStringLiteralTemplate) |
void |
setUseStudioEditorParser(boolean useStudioEditorParser) |
String |
toString() |
void |
verify(IGosuParser parser) |
void |
verify(IGosuParser parser,
Map<String,Set<IFunctionSymbol>> dfsDeclByName,
ITypeUsesMap typeUsesMap) |
public static final String GS_TEMPLATE
public static final String GS_TEMPLATE_PARSED
public static final String SCRIPTLET_BEGIN
public static final String SCRIPTLET_END
public static final char EXPRESSION_SUFFIX
public static final char DECLARATION_SUFFIX
public static final char DIRECTIVE_SUFFIX
public static final String COMMENT_BEGIN
public static final String COMMENT_END
public static final String ALTERNATE_EXPRESSION_BEGIN
public static final String ALTERNATE_EXPRESSION_END
public static final char ESCAPED_SCRIPTLET_MARKER
public static final char ESCAPED_SCRIPTLET_BEGIN_CHAR
public static final char ESCAPED_ALTERNATE_EXPRESSION_BEGIN_CHAR
public static final int SCRIPTLET_BEGIN_LEN
public static final int SCRIPTLET_END_LEN
public static final int COMMENT_BEGIN_LEN
public static final int COMMENT_END_LEN
public static final int ALTERNATE_EXPRESSION_BEGIN_LEN
public static final int ALTERNATE_EXPRESSION_END_LEN
public static final LockingLazyVar<ISymbol> PRINT_CONTENT_SYMBOL
public static final LockingLazyVar<ISymbol> PRINT_RANGE_SYMBOL
public static final int SUBSTR_CHUNKSIZE
public static void generateTemplate(Reader readerTemplate, Writer writerOut, ISymbolTable symTable) throws TemplateParseException
readerTemplate - The source of the template.writerOut - Where the output should go.symTable - The symbol table to use.TemplateParseException - on execution exceptionpublic static void generateTemplate(Reader readerTemplate, Writer writerOut, ISymbolTable symTable, boolean strict) throws TemplateParseException
readerTemplate - The source of the template.writerOut - Where the output should go.symTable - The symbol table to use.strict - whether to allow althernative templateTemplateParseException - on execution exceptionpublic static TemplateGenerator getTemplate(Reader readerTemplate)
public static TemplateGenerator getTemplate(Reader readerTemplate, String fullyQualifiedName)
public Program getProgram()
getProgram in interface ITemplateGeneratorpublic void execute(Writer writer, ISymbolTable symbolTable) throws TemplateParseException
execute in interface ITemplateGeneratorTemplateParseExceptionpublic void execute(Writer writer, StringEscaper escaper, ISymbolTable symTable) throws TemplateParseException
execute in interface ITemplateGeneratorTemplateParseExceptionpublic void compile(ISymbolTable symTable) throws TemplateParseException
compile in interface ITemplateGeneratorTemplateParseExceptionpublic void compile(Stack<IScriptPartId> scriptPartIdStack, ISymbolTable symTable, Map<String,Set<IFunctionSymbol>> dfsDeclByName, ITypeUsesMap typeUsesMap, Stack<BlockExpression> blocks, ContextInferenceManager ctxInferenceMgr) throws TemplateParseException
TemplateParseExceptionpublic void verify(IGosuParser parser, Map<String,Set<IFunctionSymbol>> dfsDeclByName, ITypeUsesMap typeUsesMap) throws ParseResultsException
ParseResultsExceptionpublic void verify(IGosuParser parser) throws ParseResultsException
verify in interface ITemplateGeneratorParseResultsExceptionpublic List<TemplateParseException> getTemplateSyntaxProblems()
getTemplateSyntaxProblems in interface ITemplateGeneratorpublic static void printContent(String strContent, boolean escape)
public static void printRange(int iStart,
int iEnd)
public void setDisableAlternative(boolean disableAlternative)
public void setContextInferenceManager(ContextInferenceManager ctxInferenceMgr)
public void setForStringLiteral(boolean bForStringLiteralTemplate)
public boolean isForStringLiteral()
public boolean isValid()
isValid in interface ITemplateGeneratorpublic String getFullyQualifiedTypeName()
getFullyQualifiedTypeName in interface ITemplateGeneratorpublic List<ISymbol> getParameters()
getParameters in interface ITemplateGeneratorpublic IType getSuperType()
getSuperType in interface ITemplateGeneratorpublic void setUseStudioEditorParser(boolean useStudioEditorParser)
public String getSource()
getSource in interface ITemplateGeneratorCopyright © 2015. All rights reserved.