|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.google.clearsilver.jsilver.syntax.analysis.AnalysisAdapter
com.google.clearsilver.jsilver.syntax.analysis.DepthFirstAdapter
com.google.clearsilver.jsilver.compiler.TemplateTranslator
public class TemplateTranslator
Translates a JSilver AST into compilable Java code. This executes much faster than the interpreter.
TemplateCompiler
Field Summary | |
---|---|
static JavaExpression |
CONTEXT
|
static JavaExpression |
DATA
|
static JavaExpression |
DATA_CONTEXT
|
static JavaExpression |
NULL
|
static JavaExpression |
RESOURCE_LOADER
|
static JavaExpression |
TEMPLATE_LOADER
|
static JavaExpression |
THIS_TEMPLATE
|
Constructor Summary | |
---|---|
TemplateTranslator(String packageName,
String className,
Writer output,
boolean propagateEscapeStatus)
|
Method Summary | |
---|---|
void |
caseAAltCommand(AAltCommand node)
<?cs alt:someValue > ... |
void |
caseAAutoescapeCommand(AAutoescapeCommand node)
A fake command injected by AutoEscaper. |
void |
caseACallCommand(ACallCommand node)
<?cs call:someMacro(x,y) command. |
void |
caseADataCommand(ADataCommand node)
Chunk of data (i.e. |
void |
caseADefCommand(ADefCommand node)
<?cs def:someMacro(x,y) > ... |
void |
caseAEachCommand(AEachCommand node)
<?cs each:x=Stuff > ... |
void |
caseAEscapeCommand(AEscapeCommand node)
<?cs escape:'html' > command. |
void |
caseAEvarCommand(AEvarCommand node)
<?cs evar:blah > command. |
void |
caseAHardIncludeCommand(AHardIncludeCommand node)
<?cs include!'somefile.cs' > command. |
void |
caseAHardLincludeCommand(AHardLincludeCommand node)
<?cs linclude:'somefile.cs' > command. |
void |
caseAIfCommand(AIfCommand node)
<?cs if:blah > ... |
void |
caseAIncludeCommand(AIncludeCommand node)
<?cs include:'somefile.cs' > command. |
void |
caseALincludeCommand(ALincludeCommand node)
<?cs linclude:'somefile.cs' > command. |
void |
caseALoopCommand(ALoopCommand node)
<?cs loop:0,10 > ... |
void |
caseALoopIncCommand(ALoopIncCommand node)
<?cs loop:0,10,2 > ... |
void |
caseALoopToCommand(ALoopToCommand node)
<?cs loop:10 > ... |
void |
caseALvarCommand(ALvarCommand node)
<?cs lvar:blah > command. |
void |
caseANameCommand(ANameCommand node)
<?cs name:blah > command. |
void |
caseASetCommand(ASetCommand node)
<?cs set:x='y' > command. |
void |
caseAUvarCommand(AUvarCommand node)
<?cs uvar:blah > expression. |
void |
caseAVarCommand(AVarCommand node)
<?cs var:blah > expression. |
void |
caseAWithCommand(AWithCommand node)
<?cs with:x=Something > ... |
void |
caseStart(Start node)
|
void |
caseTCsOpen(TCsOpen node)
Every time a <cs token is found, grab the line and column and call context.setCurrentPosition() so this is captured for stack traces. |
Methods inherited from class com.google.clearsilver.jsilver.syntax.analysis.AnalysisAdapter |
---|
caseEOF, caseTAlt, caseTAnd, caseTArgWhitespace, caseTAssignment, caseTAutoescape, caseTBang, caseTBracketClose, caseTBracketOpen, caseTCall, caseTComma, caseTCommandDelimiter, caseTComment, caseTCommentStart, caseTContentType, caseTCsClose, caseTData, caseTDecNumber, caseTDef, caseTDollar, caseTDot, caseTEach, caseTElse, caseTElseIf, caseTEq, caseTEscape, caseTEvar, caseTGt, caseTGte, caseTHardDelimiter, caseTHash, caseTHexNumber, caseTIf, caseTInclude, caseTInline, caseTLinclude, caseTLoop, caseTLt, caseTLte, caseTLvar, caseTMinus, caseTName, caseTNe, caseTOr, caseTParenClose, caseTParenOpen, caseTPercent, caseTPlus, caseTQuestion, caseTSet, caseTSlash, caseTStar, caseTString, caseTUvar, caseTVar, caseTWith, caseTWord, defaultCase, getIn, getOut, setIn, setOut |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final JavaExpression DATA
public static final JavaExpression CONTEXT
public static final JavaExpression DATA_CONTEXT
public static final JavaExpression NULL
public static final JavaExpression RESOURCE_LOADER
public static final JavaExpression TEMPLATE_LOADER
public static final JavaExpression THIS_TEMPLATE
Constructor Detail |
---|
public TemplateTranslator(String packageName, String className, Writer output, boolean propagateEscapeStatus)
Method Detail |
---|
public void caseStart(Start node)
caseStart
in interface Analysis
caseStart
in class DepthFirstAdapter
public void caseADataCommand(ADataCommand node)
caseADataCommand
in interface Analysis
caseADataCommand
in class DepthFirstAdapter
public void caseAVarCommand(AVarCommand node)
caseAVarCommand
in interface Analysis
caseAVarCommand
in class DepthFirstAdapter
public void caseAUvarCommand(AUvarCommand node)
caseAUvarCommand
in interface Analysis
caseAUvarCommand
in class DepthFirstAdapter
public void caseASetCommand(ASetCommand node)
caseASetCommand
in interface Analysis
caseASetCommand
in class DepthFirstAdapter
public void caseANameCommand(ANameCommand node)
caseANameCommand
in interface Analysis
caseANameCommand
in class DepthFirstAdapter
public void caseAIfCommand(AIfCommand node)
caseAIfCommand
in interface Analysis
caseAIfCommand
in class DepthFirstAdapter
public void caseAEachCommand(AEachCommand node)
caseAEachCommand
in interface Analysis
caseAEachCommand
in class DepthFirstAdapter
public void caseAWithCommand(AWithCommand node)
caseAWithCommand
in interface Analysis
caseAWithCommand
in class DepthFirstAdapter
public void caseALoopToCommand(ALoopToCommand node)
caseALoopToCommand
in interface Analysis
caseALoopToCommand
in class DepthFirstAdapter
public void caseALoopCommand(ALoopCommand node)
caseALoopCommand
in interface Analysis
caseALoopCommand
in class DepthFirstAdapter
public void caseALoopIncCommand(ALoopIncCommand node)
caseALoopIncCommand
in interface Analysis
caseALoopIncCommand
in class DepthFirstAdapter
public void caseAAltCommand(AAltCommand node)
caseAAltCommand
in interface Analysis
caseAAltCommand
in class DepthFirstAdapter
public void caseAEscapeCommand(AEscapeCommand node)
caseAEscapeCommand
in interface Analysis
caseAEscapeCommand
in class DepthFirstAdapter
public void caseAAutoescapeCommand(AAutoescapeCommand node)
caseAAutoescapeCommand
in interface Analysis
caseAAutoescapeCommand
in class DepthFirstAdapter
public void caseAHardLincludeCommand(AHardLincludeCommand node)
caseAHardLincludeCommand
in interface Analysis
caseAHardLincludeCommand
in class DepthFirstAdapter
public void caseALincludeCommand(ALincludeCommand node)
caseALincludeCommand
in interface Analysis
caseALincludeCommand
in class DepthFirstAdapter
public void caseAHardIncludeCommand(AHardIncludeCommand node)
caseAHardIncludeCommand
in interface Analysis
caseAHardIncludeCommand
in class DepthFirstAdapter
public void caseAIncludeCommand(AIncludeCommand node)
caseAIncludeCommand
in interface Analysis
caseAIncludeCommand
in class DepthFirstAdapter
public void caseALvarCommand(ALvarCommand node)
caseALvarCommand
in interface Analysis
caseALvarCommand
in class DepthFirstAdapter
public void caseAEvarCommand(AEvarCommand node)
caseAEvarCommand
in interface Analysis
caseAEvarCommand
in class DepthFirstAdapter
public void caseADefCommand(ADefCommand node)
caseADefCommand
in interface Analysis
caseADefCommand
in class DepthFirstAdapter
public void caseACallCommand(ACallCommand node)
caseACallCommand
in interface Analysis
caseACallCommand
in class DepthFirstAdapter
public void caseTCsOpen(TCsOpen node)
caseTCsOpen
in interface Analysis
caseTCsOpen
in class AnalysisAdapter
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |