[antlr-interest] Does it make sense to use Antlr for interactive parsing?

Jim Idle jimi at temporal-wave.com
Thu Nov 20 14:50:02 PST 2008


On Thu, 2008-11-20 at 15:13 -0600, Vishwanath Hawargi wrote:

> Hello,
>  Another dumb question from me.
> 
> I am looking for parsing an expression from the command line. Each of
> these expressions are syntactically correct.
> Instead of having a input file, i am having one expression at a time
> to  be processed.
> In this situation is it optimal/ ok to use antlr to validate and
> generate the tokens?
> 
> Also, how do i process input arg instead of input file?
> 


It makes sense if the input is relatively complicated, but if it is
just: command {options} something, then probably custom code is as good.
You run it exactly the same way as a file but use the StringStream
rather than the file stream. See teh api docs:

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

Jim


> please let me know.
> 
> thank you.
> vishwa
> 
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address
> 


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20081120/721a45a1/attachment.html 


More information about the antlr-interest mailing list