[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9055]
This commit is contained in:
parrt 2011-09-07 17:13:32 -08:00
parent 297087770e
commit c16782c848
2 changed files with 4 additions and 2 deletions

View File

@ -39,8 +39,8 @@ ListenerFile(listener) ::= <<
@SuppressWarnings({"all", "warnings", "unchecked", "unused"})
public interface <listener.grammarName>Listener {
<listener.rules:{r |
void enterRule(<listener.grammarName>.<r.name>_ctx ctx);
void exitRule(<listener.grammarName>.<r.name>_ctx ctx);}; separator="\n">
void enterRule(<listener.parserName>.<r.name>_ctx ctx);
void exitRule(<listener.parserName>.<r.name>_ctx ctx);}; separator="\n">
}
>>

View File

@ -12,12 +12,14 @@ import java.util.Collection;
public class ListenerFile extends OutputModelObject {
public String fileName;
public String grammarName;
public String parserName;
public Collection<Rule> rules;
public ListenerFile(OutputModelFactory factory, String fileName) {
super(factory);
this.fileName = fileName;
Grammar g = factory.getGrammar();
parserName = g.getRecognizerName();
grammarName = g.name;
rules = g.rules.values();
}