Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
HiveParser pushes/pops messages describing the current parse rule like so:
joinSource @init { gParent.msgs.push("join source"); } @after { gParent.msgs.pop(); } ...
The ANTLR generated code for the init/after actions looks like this:
gParent.msgs.push("join source"); ... if ( state.backtracking==0 ) { gParent.msgs.pop(); }
If we have a parse rule that does some lookahead, the message is always pushed onto the message stack since the init action has no check of state.backtracking. But that message is never popped because the after action does check state.backtracking. As a result there can be a bunch of parser context messages added to the stack which are never taken off.