[antlr-interest] Using previously matched parser rule in decision making

Gavin Lambert antlr at mirality.co.nz
Tue Mar 9 01:53:18 PST 2010


At 15:47 9/03/2010, Ron Burk wrote:
 >It is an interesting idea for a top-down parser generator
 >to just make the parsing stack of non-terminals available
 >to user actions. Whether that's easy or hard depends on
 >the details of how the tool generates parser code. But
 >certainly knowing the context you expect to be in is
 >arguably an advantage of top-down over bottom-up
 >parsing, so there's an argument to be made for making
 >that information available.

You can use ANTLR's scopes to do that.  There are ways to tell if 
a particular scope has been entered, how many times it has been 
entered, and to retrieve information from any of those levels.



More information about the antlr-interest mailing list