Add missing @Override attributes in generated code, use hard tabs instead of spaces
This commit is contained in:
parent
ca0b1d399c
commit
f5edb7653a
|
@ -47,12 +47,12 @@ import org.antlr.v4.runtime.Token;
|
|||
|
||||
public class <file.grammarName>BaseListener implements <file.grammarName>Listener {
|
||||
<file.listenerNames:{lname |
|
||||
public void enter<lname; format="cap">(<file.parserName>.<lname; format="cap">Context ctx) { \}
|
||||
public void exit<lname; format="cap">(<file.parserName>.<lname; format="cap">Context ctx) { \}}; separator="\n">
|
||||
@Override public void enter<lname; format="cap">(<file.parserName>.<lname; format="cap">Context ctx) { \}
|
||||
@Override public void exit<lname; format="cap">(<file.parserName>.<lname; format="cap">Context ctx) { \}}; separator="\n">
|
||||
|
||||
public void enterEveryRule(ParserRuleContext\<<InputSymbolType()>\> ctx) { }
|
||||
public void exitEveryRule(ParserRuleContext\<<InputSymbolType()>\> ctx) { }
|
||||
public void visitTerminal(ParserRuleContext\<<InputSymbolType()>\> ctx, <InputSymbolType()> symbol) { }
|
||||
@Override public void enterEveryRule(ParserRuleContext\<<InputSymbolType()>\> ctx) { }
|
||||
@Override public void exitEveryRule(ParserRuleContext\<<InputSymbolType()>\> ctx) { }
|
||||
@Override public void visitTerminal(ParserRuleContext\<<InputSymbolType()>\> ctx, <InputSymbolType()> symbol) { }
|
||||
}
|
||||
>>
|
||||
|
||||
|
@ -76,13 +76,13 @@ import org.antlr.v4.runtime.*;
|
|||
|
||||
public class <file.grammarName>BaseParseListener implements <file.grammarName>ParseListener {
|
||||
<file.listenerEnterNames:{lname |
|
||||
public void enter<lname; format="cap">(ParserRuleContext\<<InputSymbolType()>\> ctx) { \}}; separator="\n">
|
||||
@Override public void enter<lname; format="cap">(ParserRuleContext\<<InputSymbolType()>\> ctx) { \}}; separator="\n">
|
||||
<file.listenerExitNames:{lname |
|
||||
public void exit<lname; format="cap">(<file.parserName>.<lname; format="cap">Context ctx) { \}}; separator="\n">
|
||||
@Override public void exit<lname; format="cap">(<file.parserName>.<lname; format="cap">Context ctx) { \}}; separator="\n">
|
||||
|
||||
public void enterNonLRRule(ParserRuleContext\<<InputSymbolType()>\> ctx) { }
|
||||
public void exitEveryRule(ParserRuleContext\<<InputSymbolType()>\> ctx) { }
|
||||
public void visitTerminal(ParserRuleContext\<<InputSymbolType()>\> ctx, <InputSymbolType()> symbol) { }
|
||||
@Override public void enterNonLRRule(ParserRuleContext\<<InputSymbolType()>\> ctx) { }
|
||||
@Override public void exitEveryRule(ParserRuleContext\<<InputSymbolType()>\> ctx) { }
|
||||
@Override public void visitTerminal(ParserRuleContext\<<InputSymbolType()>\> ctx, <InputSymbolType()> symbol) { }
|
||||
}
|
||||
>>
|
||||
|
||||
|
@ -104,7 +104,7 @@ import org.antlr.v4.runtime.Token;
|
|||
|
||||
public class <file.grammarName>BaseVisitor\<T> extends ParseTreeVisitor\<T> implements <file.grammarName>Visitor\<T> {
|
||||
<file.visitorNames:{lname |
|
||||
public T visit<lname; format="cap">(<file.parserName>.<lname; format="cap">Context ctx) { visitChildren(ctx); return null; \}}; separator="\n">
|
||||
@Override public T visit<lname; format="cap">(<file.parserName>.<lname; format="cap">Context ctx) { visitChildren(ctx); return null; \}}; separator="\n">
|
||||
}
|
||||
>>
|
||||
|
||||
|
@ -623,12 +623,14 @@ public static class <struct.name> extends <currentRule.name; format="cap">Contex
|
|||
>>
|
||||
|
||||
ListenerDispatchMethod(method) ::= <<
|
||||
@Override
|
||||
public void <if(method.isEnter)>enter<else>exit<endif>Rule(ParseTreeListener\<<InputSymbolType()>\> listener) {
|
||||
if ( listener instanceof <parser.grammarName>Listener ) ((<parser.grammarName>Listener)listener).<if(method.isEnter)>enter<else>exit<endif><struct.derivedFromName; format="cap">(this);
|
||||
}
|
||||
>>
|
||||
|
||||
VisitorDispatchMethod(method) ::= <<
|
||||
@Override
|
||||
public \<T> T accept(ParseTreeVisitor\<? extends T> visitor) {
|
||||
if ( visitor instanceof <parser.grammarName>Visitor ) return ((<parser.grammarName>Visitor\<T>)visitor).visit<struct.derivedFromName; format="cap">(this);
|
||||
else return null;
|
||||
|
@ -636,6 +638,7 @@ public \<T> T accept(ParseTreeVisitor\<? extends T> visitor) {
|
|||
>>
|
||||
|
||||
ParseListenerDispatchMethod(method) ::= <<
|
||||
@Override
|
||||
public void <if(method.isEnter)>enter<else>exit<endif>Rule(ParseListener\<<InputSymbolType()>\> listener) {
|
||||
if ( listener instanceof <parser.grammarName>ParseListener ) ((<parser.grammarName>ParseListener)listener).<if(method.isEnter)>enter<else>exit<endif><struct.derivedFromName; format="cap">(this);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue