language independent C++ grammar [was Re: [antlr-interest] UpdatedC++ parser version 3.1 published November 2005]

Luis Sergio Oliveira euluis at zmail.pt
Wed Nov 23 14:41:19 PST 2005


Micheal J wrote:

>>But, all this would be much more desirable if we could have the whole 
>>grammar base defined
>>in a language independent way. So, is this feasible - to have 
>>a grammar 
>>which is usable
>>by C++, Java, Python and other languages without having to 
>>hand port it 
>>from the C++ version
>>every time David provides a new update?
>>
>>I notice that the examples with ANTLR are made available in several 
>>languages. Is there some
>>particular magic that enables this automatically or is it out 
>>of manual 
>>porting efforts?
>>    
>>
>
>Magic?. Yes. I do believe Ter has a team of dedicated elfs punching away on
>keybaords at ANTLR HQ somewhere near Lapland......  ;-)
>
>As to the problems of supporting multiple language versions of a single
>grammar, Bodgan Mitu's annotation tool (the ASP grammar guy - Anakreon I
>think his name was - did an update to it) offers one way of achieving this.
>You can find it here:
>	http://parr-research.com/share/1081982914285/annotation20040415.tgz
>
>Anakreon's ASP grammars project is also an example of how to use the tool -
>http://storm.cs.unipi.gr/~anakreon/aspa.html
>
>
>  
>
Thanks Micheal,

the annotation tool seams to fit my wishes, but, why isn't this used for 
simplifying
the ANTLR examples maintenance?... Well, maybe because it is cheaper to 
feed the
elfs ;-)

So, David, I'll try to use the annotation tool and if it works I'll get 
back with a C++ and
Java version of the grammar. If not I'll report the failure anyway. Are 
you interested?

-- 
Luis Sergio Oliveira





More information about the antlr-interest mailing list