Fixes #802. Trigger events for alt labels in parser listeners.

This commit is contained in:
Terence Parr 2015-05-19 18:08:13 -07:00
parent 1374896a16
commit 3674d45476
1 changed files with 4 additions and 1 deletions

View File

@ -632,7 +632,7 @@ public abstract class Parser extends Recognizer<Token, ParserATNSimulator> {
public void exitRule() {
_ctx.stop = _input.LT(-1);
// trigger event on _ctx, before it reverts to parent
if ( _parseListeners != null) triggerExitRuleEvent();
if ( _parseListeners != null ) triggerExitRuleEvent();
setState(_ctx.invokingState);
_ctx = (ParserRuleContext)_ctx.parent;
}
@ -648,6 +648,9 @@ public abstract class Parser extends Recognizer<Token, ParserATNSimulator> {
}
}
_ctx = localctx;
if ( _parseListeners != null ) {
triggerEnterRuleEvent();
}
}
/**