[antlr-interest] Re: controlled input stream parsing

rbohn777 rbohn777 at yahoo.com
Fri Dec 3 07:29:23 PST 2004



> You can read a string from input stream on each request and pass it 
> (using StringReader) to antlr to parse.

yes, but then I would be acting as the lexer.  It's trivial here
because in my example I'm delimiting a record by a newline.  However,
what about more complicated grammars where newlines may not delimit a
record.

~Ryan


--- In antlr-interest at yahoogroups.com, "Alexey Demakov" <demakov at i...>
wrote:
> From: "rbohn777" <rbohn777 at y...>
> > 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