[antlr-interest] controlled input stream parsing

Alexey Demakov demakov at ispras.ru
Fri Dec 3 00:39:59 PST 2004


From: "rbohn777" <rbohn777 at yahoo.com>
> I'm new to antlr, so I'm writing a simple CSV parser.  In my grammar,
> each line is referred to as a record.  What I want to do is have the
> parser and lexer only consume as much needed from the input stream
> until it finds a record and then stop until a client requests the next
> record at which it will pull from the input stream again until it
> finds the next record.  Is this possible?

Yes, it is possible, but it is not antlr responsibility.
You can read a string from input stream on each request and pass it 
(using StringReader) to antlr to parse.

Regards,
Alexey

-----
Alexey Demakov
TreeDL: Tree Description Language: http://treedl.sourceforge.net
RedVerst Group: http://www.unitesk.com




 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/antlr-interest/

<*> To unsubscribe from this group, send an email to:
    antlr-interest-unsubscribe at yahoogroups.com

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





More information about the antlr-interest mailing list