[antlr-interest] The mo st import questions for me about antlr?

liigo liigo at hotpop.com
Mon May 9 23:08:06 PDT 2005


Is there anyone who has made his own language(script) with help by antlr?
Would you please give me a samples?




ÔÚ Tue, 10 May 2005 13:11:46 +0800£¬Nigel Sheridan-Smith  
<nbsherid at secsme.org.au> дµÀ:

>> -----Original Message-----
>> From: liigo [mailto:liigo at hotpop.com]
>> Sent: Tuesday, 10 May 2005 2:56 PM
>> To: Nigel Sheridan-Smith
>> Subject: Re: (ÈðÐÇÌáʾ-´ËÓʼþ¿ÉÄÜÊÇÀ¬»øÓʼþ)RE: [antlr-interest] The  
>> most import
>> questions for me about antlr?
>>
>> ÔÚ Tue, 10 May 2005 12:23:17 +0800£¬Nigel Sheridan-Smith
>> <nbsherid at secsme.org.au> дµÀ:
>>
>> Hi Nigel,
>>
>> Thank you very much for help.
>> I have other questions:
>>    antlr just do parse the script, and I must do the interprete?
>>    Antlr will generate some source file(*.java/*.cpp...), and I must
>> "change" these file to do my things?
>>
>> Maybe I need some examples:)
>>
>
> Yes, it will parse the script for you, but you must build your own  
> interpreter. However, ANTLR tries to help with that too if you use the  
> tree parsers.
>
> The output from your "language.g" file will be source files (*.java,  
> *.cpp, *.cs, etc) that you can compile. You will need at least another  
> class to run the lexer and parser from. Generally, it's not advisable to  
> modify the source files generated later on - rather, you add actions to  
> the grammar file and run ANTLR to regenerate again.
>
> Have a look at this tutorial. It has a neat expression evaluator example:
>
> http://supportweb.cs.bham.ac.uk/documentation/tutorials/docsystem/build/tutorials/antlr/antlrhome.html
>
> and the other tutorials here:
>
> http://www.antlr.org/doc/getting-started.html
>
> Cheers
>
> Nigel
>
> --
> Nigel Sheridan-Smith
> PhD research student
>
> Faculty of Engineering
> University of Technology, Sydney
> Phone: 02 9514 7946
> Fax: 02 9514 2435
>
>





More information about the antlr-interest mailing list