[antlr-interest] Non trivial C# examples

Benjamin Shropshire shro8822 at vandals.uidaho.edu
Sun Feb 17 15:15:28 PST 2008


Thomas Brandon wrote:
> On Feb 17, 2008 6:25 AM, Benjamin Shropshire
> <shro8822 at vandals.uidaho.edu> wrote:
>   
>> Thomas Brandon wrote:
>>     
>>> Check out the examples package. Available from the ANTLR download page
>>> or from http://www.antlr.org/download/examples-v3.tar.gz
>>>
>>> Tom.
>>>
>>>
>>>       
>> Don't take my word choice to seriously but:
>>
>> WHY THE #$%@#$@ isn't that link on the FRONT PAGE!?!?!?!
>>
>> :-b
>>     
> Well, it's on the download page which you presumably went to to get
> ANTLR. But I'll admit it isn't very visible there. Not sure if it's in
> the newer intermediate builds, I think the examples may only have been
> added to the depot since the last release. That would seem a good idea
> if they aren't already.
>   
>> That link or a link to some sort of index* to it should be on the front
>> page (I think putting it on the top-of-page link bar would be about
>> right). Also I think it would be handy to have more examples of minimal
>> grammars that demonstrate features. (I rather hope the code for these
>> already exist in antlr's test suite.)
>>
>>     
> Some of those are just small examples that demonstrate
> features\approaches. Not sure how sensibly you could break it down
> further.
>
>   
I think things like the following would be practical and useful:

a grammar that shows how to accumulate terms with a '*' rules using AST, 
string templates, and action rules.
how to pass an arbitrary type from a sub rule back up
how to pass an arbitrary type as a parameter
...

I don't known enough about antlr to suggest others but I suspect that 
this is illustrative. As mentioned befour, these cases would parallel 
the set of cases that should be in the test suite. They don't even have 
to be very realistic, just able to show how something works.

> Tom.
>   



More information about the antlr-interest mailing list