[antlr-interest] Is it possible to pass input without using a ANTLR stream? - UPDATED

Nicola Musatti Nicola.Musatti at ObjectWay.it
Tue Dec 15 00:31:45 PST 2009


Hallo, Asha.
You can use an ANTLRStringStream, which takes care of EOF automatically.

See 
http://www.antlr.org/api/Java/classorg_1_1antlr_1_1runtime_1_1_a_n_t_l_r_string_stream.html

Cheers,
Nicola Musatti

Asha Ramegowda wrote:
> Hi,
>
> I am aware that antlr input stream/reader is the important part of the
> parsing, lexing and recognition in antlr as getting character stream is
> important to do all these things.
>
> But, we have a parser that works in JEE environment. And unlike DSL we
> have very small requirement where we have to convert a string to some
> different format. I am not sure whether I can use this normal ANTLR
> stream as this requires a end of file input. So far I see that is a
> integer literal with value -1. And the other approach is to use a ANTLR
> file stream. But using this we can not make our API as a JAR as that
> will contain this input file which needs to be written each time we have
> a new input. As the input dynamically comes from another source please
> let me know, whether I can append this -1 and pass it to the parser?!!!
>
> --
> Thank you,
>
> Asha R
>
>
>
> --
> Thank you,
>
> Asha R
>
>
>
>
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address



More information about the antlr-interest mailing list