[antlr-interest] ANTLR feedback

youcef belattaf youcef.belattaf at gmail.com
Sun Apr 20 16:18:04 PDT 2008


Thank you for answers,

To make each command to be parsed, the parser must read an EOF after these
commands. The only way i find to realize that is to close the OutputStream
(PipedOutpuStream). So i've to create a new PipedOutputStream for each
command. In addition, the program is multi-threaded and it's diffucult to
recreate the streams (synchronization).

On Mon, Apr 21, 2008 at 1:00 AM, Terence Parr <parrt at antlr.org> wrote:

> antlr reads all input at the moment; not good for your application.
>  Trying passing complete, single commands to the parser.  Each command has
> EOF on it.  Read another command and pass to parser etc...
> Ter
> PS      please direct these questions to interest list.
> On Apr 20, 2008, at 3:07 PM, youcef.belattaf at gmail.com wrote:
>
>  timestamp=20080420_15.07.24
> > email=youcef.belattaf at gmail.com
> > name=Youcef BELATTAF
> > ANTLRVersion=3.0.1
> > ANTLRWorksVersion=
> > StringTemplateVersion=
> > OS=
> > JavaVersion=6
> > software=ANTLR
> > RemoteHost=sto93-4-88-162-214-37.fbx.proxad.net
> > uploadedFile=false
> > feedback=Hello,
> > I've a question, excuse me for my bad english. I've a thread which reads
> > commands from a socket. I would like these commands to be parsed by an ANTLR
> > parser. But to start parsing, the parser needs the EOF. How can I insert an
> > EOF in the stream.
> >
> > I've used a PipedInputStream/PipedOutputStream between the socket and
> > the parser in order to insert an EOF after each command, but i have to close
> > the stream after each command, I think there's a better solution.
> >
> > So i've realy 2 questions :
> >
> > 1. How can I make the ANTLR Parser start parsing without detecting the
> > EOF ?
> >
> > 2. How can I insert an EOF in a streal without closing it ?
> >
> > Thank you.
> >
> >
> >
>


-- 
--
Youcef BELATTAF
22, Rru Charles Garnier
93400, Saint Ouen.
Tel : 06 12 63 55 93
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20080421/348842ff/attachment.html 


More information about the antlr-interest mailing list