[antlr-interest] Parsing a TokenStream in piecemeal fashion

mzukowski at yci.com mzukowski at yci.com
Fri Feb 21 08:44:39 PST 2003


I'm sure you've figured it out by now, but for the record....

This one is easy, just create your parser, make a loop and repeatedly call
the rule you want to call.  Make sure the rule you call is a valid start
rule, meaning that no other rules call it.  If it isn't then make a simple
one like

startingAddExpr: addExpr ;

Monty

-----Original Message-----
From: micheal_jor <open.zone at virgin.net> [mailto:open.zone at virgin.net]
Sent: Friday, January 31, 2003 5:46 AM
To: antlr-interest at yahoogroups.com
Subject: [antlr-interest] Parsing a TokenStream in piecemeal fashion


Hi,

Any ideas on how to create a Parser instance and use it to parse a 
few tokens at a time from a TokenStream repeatedly. Obviously there 
wouldn't be an EOF condition/character most of the time.

If it's relevant, each invocation of the Parser builds an AST 
fragment that is fed to TreeParser(s).

Micheal



 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 


 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 



More information about the antlr-interest mailing list