Class TemplateParser.TemplateParserListener
- java.lang.Object
-
- com.fizzed.rocker.antlr4.RockerParserBaseListener
-
- com.fizzed.rocker.compiler.TemplateParser.TemplateParserListener
-
- All Implemented Interfaces:
RockerParserListener,org.antlr.v4.runtime.tree.ParseTreeListener
- Enclosing class:
- TemplateParser
public static class TemplateParser.TemplateParserListener extends RockerParserBaseListener
-
-
Field Summary
Fields Modifier and Type Field Description private org.antlr.v4.runtime.ANTLRInputStreaminputprivate TemplateModelmodelprivate java.lang.StringtemplatePathprivate java.util.Stack<WithStatement>withStatements
-
Constructor Summary
Constructors Constructor Description TemplateParserListener(org.antlr.v4.runtime.ANTLRInputStream input, TemplateModel model, java.lang.String templatePath)
-
Method Summary
-
Methods inherited from class com.fizzed.rocker.antlr4.RockerParserBaseListener
enterArgumentsDeclaration, enterBlock, enterContentClosureExpression, enterEvalExpression, enterImportStatement, enterNullTernaryExpression, enterOptionStatement, enterTemplate, enterTemplateContent, enterValueClosureExpression, enterValueExpression, exitArgumentsStatement, exitBlock, exitComment, exitContentClosureExpression, exitEval, exitEvalExpression, exitIfElseBlock, exitIfElseIfBlock, exitImportDeclaration, exitImportStatement, exitNullTernary, exitNullTernaryExpression, exitOptionDeclaration, exitOptionStatement, exitPlain, exitPlainElseIfBlock, exitTemplate, exitTemplateContent, exitValue, exitValueClosureExpression, exitValueExpression, exitWithElseBlock, visitErrorNode, visitTerminal
-
-
-
-
Field Detail
-
input
private final org.antlr.v4.runtime.ANTLRInputStream input
-
model
private final TemplateModel model
-
templatePath
private final java.lang.String templatePath
-
withStatements
private final java.util.Stack<WithStatement> withStatements
-
-
Constructor Detail
-
TemplateParserListener
public TemplateParserListener(org.antlr.v4.runtime.ANTLRInputStream input, TemplateModel model, java.lang.String templatePath)
-
-
Method Detail
-
createSourceRef
public SourceRef createSourceRef(org.antlr.v4.runtime.ParserRuleContext rule)
-
createSourceRef
public SourceRef createSourceRef(org.antlr.v4.runtime.ParserRuleContext rule, org.antlr.v4.runtime.Token start, org.antlr.v4.runtime.Token stop)
-
enterEveryRule
public void enterEveryRule(org.antlr.v4.runtime.ParserRuleContext ctx)
Description copied from class:RockerParserBaseListenerThe default implementation does nothing.
- Specified by:
enterEveryRulein interfaceorg.antlr.v4.runtime.tree.ParseTreeListener- Overrides:
enterEveryRulein classRockerParserBaseListener
-
exitEveryRule
public void exitEveryRule(org.antlr.v4.runtime.ParserRuleContext ctx)
Description copied from class:RockerParserBaseListenerThe default implementation does nothing.
- Specified by:
exitEveryRulein interfaceorg.antlr.v4.runtime.tree.ParseTreeListener- Overrides:
exitEveryRulein classRockerParserBaseListener
-
verifyTemplateHeaderElementOK
public void verifyTemplateHeaderElementOK()
-
areWeCurrentlyInAForLoop
public boolean areWeCurrentlyInAForLoop()
-
areWeCurrentlyInASwitchBlock
public boolean areWeCurrentlyInASwitchBlock()
-
areWeCurrentlyInACase
public boolean areWeCurrentlyInACase()
-
areWeCurrentlyInADefault
public boolean areWeCurrentlyInADefault()
-
enterComment
public void enterComment(RockerParser.CommentContext ctx)
Description copied from class:RockerParserBaseListenerEnter a parse tree produced byRockerParser.comment().The default implementation does nothing.
- Specified by:
enterCommentin interfaceRockerParserListener- Overrides:
enterCommentin classRockerParserBaseListener- Parameters:
ctx- the parse tree
-
enterImportDeclaration
public void enterImportDeclaration(RockerParser.ImportDeclarationContext ctx)
Description copied from class:RockerParserBaseListenerEnter a parse tree produced byRockerParser.importDeclaration().The default implementation does nothing.
- Specified by:
enterImportDeclarationin interfaceRockerParserListener- Overrides:
enterImportDeclarationin classRockerParserBaseListener- Parameters:
ctx- the parse tree
-
enterOptionDeclaration
public void enterOptionDeclaration(RockerParser.OptionDeclarationContext ctx)
Description copied from class:RockerParserBaseListenerEnter a parse tree produced byRockerParser.optionDeclaration().The default implementation does nothing.
- Specified by:
enterOptionDeclarationin interfaceRockerParserListener- Overrides:
enterOptionDeclarationin classRockerParserBaseListener- Parameters:
ctx- the parse tree
-
exitArgumentsDeclaration
public void exitArgumentsDeclaration(RockerParser.ArgumentsDeclarationContext ctx)
Description copied from class:RockerParserBaseListenerExit a parse tree produced byRockerParser.argumentsDeclaration().The default implementation does nothing.
- Specified by:
exitArgumentsDeclarationin interfaceRockerParserListener- Overrides:
exitArgumentsDeclarationin classRockerParserBaseListener- Parameters:
ctx- the parse tree
-
enterArgumentsStatement
public void enterArgumentsStatement(RockerParser.ArgumentsStatementContext ctx)
Description copied from class:RockerParserBaseListenerEnter a parse tree produced byRockerParser.argumentsStatement().The default implementation does nothing.
- Specified by:
enterArgumentsStatementin interfaceRockerParserListener- Overrides:
enterArgumentsStatementin classRockerParserBaseListener- Parameters:
ctx- the parse tree
-
enterPlain
public void enterPlain(RockerParser.PlainContext ctx)
Description copied from class:RockerParserBaseListenerEnter a parse tree produced byRockerParser.plain().The default implementation does nothing.
- Specified by:
enterPlainin interfaceRockerParserListener- Overrides:
enterPlainin classRockerParserBaseListener- Parameters:
ctx- the parse tree
-
enterPlainBlock
public void enterPlainBlock(RockerParser.PlainBlockContext ctx)
Description copied from class:RockerParserBaseListenerEnter a parse tree produced byRockerParser.plainBlock().The default implementation does nothing.
- Specified by:
enterPlainBlockin interfaceRockerParserListener- Overrides:
enterPlainBlockin classRockerParserBaseListener- Parameters:
ctx- the parse tree
-
exitPlainBlock
public void exitPlainBlock(RockerParser.PlainBlockContext ctx)
Description copied from class:RockerParserBaseListenerExit a parse tree produced byRockerParser.plainBlock().The default implementation does nothing.
- Specified by:
exitPlainBlockin interfaceRockerParserListener- Overrides:
exitPlainBlockin classRockerParserBaseListener- Parameters:
ctx- the parse tree
-
enterPlainElseIfBlock
public void enterPlainElseIfBlock(RockerParser.PlainElseIfBlockContext ctx)
Description copied from class:RockerParserBaseListenerEnter a parse tree produced byRockerParser.plainElseIfBlock().The default implementation does nothing.
- Specified by:
enterPlainElseIfBlockin interfaceRockerParserListener- Overrides:
enterPlainElseIfBlockin classRockerParserBaseListener- Parameters:
ctx- the parse tree
-
enterPlainElseBlock
public void enterPlainElseBlock(RockerParser.PlainElseBlockContext ctx)
Description copied from class:RockerParserBaseListenerEnter a parse tree produced byRockerParser.plainElseBlock().The default implementation does nothing.
- Specified by:
enterPlainElseBlockin interfaceRockerParserListener- Overrides:
enterPlainElseBlockin classRockerParserBaseListener- Parameters:
ctx- the parse tree
-
exitPlainElseBlock
public void exitPlainElseBlock(RockerParser.PlainElseBlockContext ctx)
Description copied from class:RockerParserBaseListenerExit a parse tree produced byRockerParser.plainElseBlock().The default implementation does nothing.
- Specified by:
exitPlainElseBlockin interfaceRockerParserListener- Overrides:
exitPlainElseBlockin classRockerParserBaseListener- Parameters:
ctx- the parse tree
-
enterValueClosure
public void enterValueClosure(RockerParser.ValueClosureContext ctx)
Description copied from class:RockerParserBaseListenerEnter a parse tree produced byRockerParser.valueClosure().The default implementation does nothing.
- Specified by:
enterValueClosurein interfaceRockerParserListener- Overrides:
enterValueClosurein classRockerParserBaseListener- Parameters:
ctx- the parse tree
-
exitValueClosure
public void exitValueClosure(RockerParser.ValueClosureContext ctx)
Description copied from class:RockerParserBaseListenerExit a parse tree produced byRockerParser.valueClosure().The default implementation does nothing.
- Specified by:
exitValueClosurein interfaceRockerParserListener- Overrides:
exitValueClosurein classRockerParserBaseListener- Parameters:
ctx- the parse tree
-
enterContentClosure
public void enterContentClosure(RockerParser.ContentClosureContext ctx)
Description copied from class:RockerParserBaseListenerEnter a parse tree produced byRockerParser.contentClosure().The default implementation does nothing.
- Specified by:
enterContentClosurein interfaceRockerParserListener- Overrides:
enterContentClosurein classRockerParserBaseListener- Parameters:
ctx- the parse tree
-
exitContentClosure
public void exitContentClosure(RockerParser.ContentClosureContext ctx)
Description copied from class:RockerParserBaseListenerExit a parse tree produced byRockerParser.contentClosure().The default implementation does nothing.
- Specified by:
exitContentClosurein interfaceRockerParserListener- Overrides:
exitContentClosurein classRockerParserBaseListener- Parameters:
ctx- the parse tree
-
enterValue
public void enterValue(RockerParser.ValueContext ctx)
Description copied from class:RockerParserBaseListenerEnter a parse tree produced byRockerParser.value().The default implementation does nothing.
- Specified by:
enterValuein interfaceRockerParserListener- Overrides:
enterValuein classRockerParserBaseListener- Parameters:
ctx- the parse tree
-
enterNullTernary
public void enterNullTernary(RockerParser.NullTernaryContext ctx)
Description copied from class:RockerParserBaseListenerEnter a parse tree produced byRockerParser.nullTernary().The default implementation does nothing.
- Specified by:
enterNullTernaryin interfaceRockerParserListener- Overrides:
enterNullTernaryin classRockerParserBaseListener- Parameters:
ctx- the parse tree
-
enterEval
public void enterEval(RockerParser.EvalContext ctx)
Description copied from class:RockerParserBaseListenerEnter a parse tree produced byRockerParser.eval().The default implementation does nothing.
- Specified by:
enterEvalin interfaceRockerParserListener- Overrides:
enterEvalin classRockerParserBaseListener- Parameters:
ctx- the parse tree
-
enterForBlock
public void enterForBlock(RockerParser.ForBlockContext ctx)
Description copied from class:RockerParserBaseListenerEnter a parse tree produced byRockerParser.forBlock().The default implementation does nothing.
- Specified by:
enterForBlockin interfaceRockerParserListener- Overrides:
enterForBlockin classRockerParserBaseListener- Parameters:
ctx- the parse tree
-
exitForBlock
public void exitForBlock(RockerParser.ForBlockContext ctx)
Description copied from class:RockerParserBaseListenerExit a parse tree produced byRockerParser.forBlock().The default implementation does nothing.
- Specified by:
exitForBlockin interfaceRockerParserListener- Overrides:
exitForBlockin classRockerParserBaseListener- Parameters:
ctx- the parse tree
-
enterWithBlock
public void enterWithBlock(RockerParser.WithBlockContext ctx)
Description copied from class:RockerParserBaseListenerEnter a parse tree produced byRockerParser.withBlock().The default implementation does nothing.
- Specified by:
enterWithBlockin interfaceRockerParserListener- Overrides:
enterWithBlockin classRockerParserBaseListener- Parameters:
ctx- the parse tree
-
enterWithElseBlock
public void enterWithElseBlock(RockerParser.WithElseBlockContext ctx)
Description copied from class:RockerParserBaseListenerEnter a parse tree produced byRockerParser.withElseBlock().The default implementation does nothing.
- Specified by:
enterWithElseBlockin interfaceRockerParserListener- Overrides:
enterWithElseBlockin classRockerParserBaseListener- Parameters:
ctx- the parse tree
-
exitWithBlock
public void exitWithBlock(RockerParser.WithBlockContext ctx)
Description copied from class:RockerParserBaseListenerExit a parse tree produced byRockerParser.withBlock().The default implementation does nothing.
- Specified by:
exitWithBlockin interfaceRockerParserListener- Overrides:
exitWithBlockin classRockerParserBaseListener- Parameters:
ctx- the parse tree
-
enterIfBlock
public void enterIfBlock(RockerParser.IfBlockContext ctx)
Description copied from class:RockerParserBaseListenerEnter a parse tree produced byRockerParser.ifBlock().The default implementation does nothing.
- Specified by:
enterIfBlockin interfaceRockerParserListener- Overrides:
enterIfBlockin classRockerParserBaseListener- Parameters:
ctx- the parse tree
-
exitIfBlock
public void exitIfBlock(RockerParser.IfBlockContext ctx)
Description copied from class:RockerParserBaseListenerExit a parse tree produced byRockerParser.ifBlock().The default implementation does nothing.
- Specified by:
exitIfBlockin interfaceRockerParserListener- Overrides:
exitIfBlockin classRockerParserBaseListener- Parameters:
ctx- the parse tree
-
enterIfElseIfBlock
public void enterIfElseIfBlock(RockerParser.IfElseIfBlockContext ctx)
Description copied from class:RockerParserBaseListenerEnter a parse tree produced byRockerParser.ifElseIfBlock().The default implementation does nothing.
- Specified by:
enterIfElseIfBlockin interfaceRockerParserListener- Overrides:
enterIfElseIfBlockin classRockerParserBaseListener- Parameters:
ctx- the parse tree
-
enterIfElseBlock
public void enterIfElseBlock(RockerParser.IfElseBlockContext ctx)
Description copied from class:RockerParserBaseListenerEnter a parse tree produced byRockerParser.ifElseBlock().The default implementation does nothing.
- Specified by:
enterIfElseBlockin interfaceRockerParserListener- Overrides:
enterIfElseBlockin classRockerParserBaseListener- Parameters:
ctx- the parse tree
-
enterSwitchBlock
public void enterSwitchBlock(RockerParser.SwitchBlockContext ctx)
Description copied from class:RockerParserBaseListenerEnter a parse tree produced byRockerParser.switchBlock().The default implementation does nothing.
- Specified by:
enterSwitchBlockin interfaceRockerParserListener- Overrides:
enterSwitchBlockin classRockerParserBaseListener- Parameters:
ctx- the parse tree
-
exitSwitchBlock
public void exitSwitchBlock(RockerParser.SwitchBlockContext ctx)
Description copied from class:RockerParserBaseListenerExit a parse tree produced byRockerParser.switchBlock().The default implementation does nothing.
- Specified by:
exitSwitchBlockin interfaceRockerParserListener- Overrides:
exitSwitchBlockin classRockerParserBaseListener- Parameters:
ctx- the parse tree
-
enterSwitchExpressionBlock
public void enterSwitchExpressionBlock(RockerParser.SwitchExpressionBlockContext ctx)
Description copied from class:RockerParserBaseListenerEnter a parse tree produced byRockerParser.switchExpressionBlock().The default implementation does nothing.
- Specified by:
enterSwitchExpressionBlockin interfaceRockerParserListener- Overrides:
enterSwitchExpressionBlockin classRockerParserBaseListener- Parameters:
ctx- the parse tree
-
exitSwitchExpressionBlock
public void exitSwitchExpressionBlock(RockerParser.SwitchExpressionBlockContext ctx)
Description copied from class:RockerParserBaseListenerExit a parse tree produced byRockerParser.switchExpressionBlock().The default implementation does nothing.
- Specified by:
exitSwitchExpressionBlockin interfaceRockerParserListener- Overrides:
exitSwitchExpressionBlockin classRockerParserBaseListener- Parameters:
ctx- the parse tree
-
enterSwitchExpressionCase
public void enterSwitchExpressionCase(RockerParser.SwitchExpressionCaseContext ctx)
Description copied from class:RockerParserBaseListenerEnter a parse tree produced byRockerParser.switchExpressionCase().The default implementation does nothing.
- Specified by:
enterSwitchExpressionCasein interfaceRockerParserListener- Overrides:
enterSwitchExpressionCasein classRockerParserBaseListener- Parameters:
ctx- the parse tree
-
exitSwitchExpressionCase
public void exitSwitchExpressionCase(RockerParser.SwitchExpressionCaseContext ctx)
Description copied from class:RockerParserBaseListenerExit a parse tree produced byRockerParser.switchExpressionCase().The default implementation does nothing.
- Specified by:
exitSwitchExpressionCasein interfaceRockerParserListener- Overrides:
exitSwitchExpressionCasein classRockerParserBaseListener- Parameters:
ctx- the parse tree
-
enterSwitchExpressionDefault
public void enterSwitchExpressionDefault(RockerParser.SwitchExpressionDefaultContext ctx)
Description copied from class:RockerParserBaseListenerEnter a parse tree produced byRockerParser.switchExpressionDefault().The default implementation does nothing.
- Specified by:
enterSwitchExpressionDefaultin interfaceRockerParserListener- Overrides:
enterSwitchExpressionDefaultin classRockerParserBaseListener- Parameters:
ctx- the parse tree
-
exitSwitchExpressionDefault
public void exitSwitchExpressionDefault(RockerParser.SwitchExpressionDefaultContext ctx)
Description copied from class:RockerParserBaseListenerExit a parse tree produced byRockerParser.switchExpressionDefault().The default implementation does nothing.
- Specified by:
exitSwitchExpressionDefaultin interfaceRockerParserListener- Overrides:
exitSwitchExpressionDefaultin classRockerParserBaseListener- Parameters:
ctx- the parse tree
-
verifySwitchBlock
private void verifySwitchBlock()
-
verifySwitchExpressionBlock
private void verifySwitchExpressionBlock()
-
inSwitchButNotCaseOrDefault
private boolean inSwitchButNotCaseOrDefault(int i)
-
inSwitchExpressionButNotCaseOrDefault
private boolean inSwitchExpressionButNotCaseOrDefault(int i)
-
enterSwitchCase
public void enterSwitchCase(RockerParser.SwitchCaseContext ctx)
Description copied from class:RockerParserBaseListenerEnter a parse tree produced byRockerParser.switchCase().The default implementation does nothing.
- Specified by:
enterSwitchCasein interfaceRockerParserListener- Overrides:
enterSwitchCasein classRockerParserBaseListener- Parameters:
ctx- the parse tree
-
exitSwitchCase
public void exitSwitchCase(RockerParser.SwitchCaseContext ctx)
Description copied from class:RockerParserBaseListenerExit a parse tree produced byRockerParser.switchCase().The default implementation does nothing.
- Specified by:
exitSwitchCasein interfaceRockerParserListener- Overrides:
exitSwitchCasein classRockerParserBaseListener- Parameters:
ctx- the parse tree
-
enterSwitchDefault
public void enterSwitchDefault(RockerParser.SwitchDefaultContext ctx)
Description copied from class:RockerParserBaseListenerEnter a parse tree produced byRockerParser.switchDefault().The default implementation does nothing.
- Specified by:
enterSwitchDefaultin interfaceRockerParserListener- Overrides:
enterSwitchDefaultin classRockerParserBaseListener- Parameters:
ctx- the parse tree
-
exitSwitchDefault
public void exitSwitchDefault(RockerParser.SwitchDefaultContext ctx)
Description copied from class:RockerParserBaseListenerExit a parse tree produced byRockerParser.switchDefault().The default implementation does nothing.
- Specified by:
exitSwitchDefaultin interfaceRockerParserListener- Overrides:
exitSwitchDefaultin classRockerParserBaseListener- Parameters:
ctx- the parse tree
-
-