[antlr-interest] Is ANTLR Yggdrasil supported by ANTLRWorks? (WAS: % in target code)

Loring Craymer lgcraymer at yahoo.com
Thu Mar 27 12:21:08 PDT 2008


Micheal--

I do not expect the initial release to support ANTLRWorks--I have not had the time to dig into ANTLRWorks internals to see what is needed to integrate attribute support intelligently.

The codegen is ANTLR 3 "like"--heavy use of templates and the library code has significant overlap.  The big differences are in tree structure and the attribute support code.  I also have junit tests (not complete, but good enough to test the critical methods) for new classes, and that should help with a port.

I do not intend to support grammar imports in the form that Ter has implemented for ANTLR 3; I do expect to support separate files for DFAs and the like and will support imports of attribute type specifications (these get repeated from one grammar to the next in a multi-pass translator).  There are two reasons for not adding grammar composition, one philosophical, and one as an optimization strategy.  Philosophically, I think that grammar composition should be done at the source level in an IDE (like ANTLRWorks, preferably under eclipse or IntelliJ).  From an optimization standpoint, ANTLR 3 generates too much code; my impression is that the non-linear growth is mostly due to DFA class definitions.  That needs to be investigated more carefully; I think that it is possible to bring generated code size down to something like in ANTLR 2 (excluding the DFA classes).  Tree restructuring and heterogeneous trees have been supported in Yggdrasil from the
 beginning.

--Loring

----- Original Message ----
From: Micheal J <open.zone at virgin.net>
To: antlr-interest at antlr.org
Sent: Thursday, March 27, 2008 11:20:13 AM
Subject: Re: [antlr-interest] Is ANTLR Yggdrasil supported by ANTLRWorks? (WAS: % in target code)

> From: antlr-interest-bounces at antlr.org On Behalf Of Loring Craymer
> Sent: 26 March 2008 22:29
> To: Olivier Lefevre; antlr-interest at antlr.org
> Subject: Re: [antlr-interest] % in target code
>     
> 
> ANTLR 3 attributes are not first class (ANTLR) language elements, and 
> attributes are effectively referenced only within actions ($ syntax) 
> so that ANTLR effectively deals with a superset of the target language,
> not the target language itself.  Further, string templates may be 
> instantiated in actions (% syntax).
> 
> This problem does not occur in ANTLR Yggdrasil, largely as a consequence 
> of having first class attributes that are strongly typed.  I should have 
> a release out within a month or two; I am currently in the middle of 
> developing the tree grammar generator.

Loring,

Is ANTLR Yggdrasil supported by ANTLRWorks (or rather will it be when
released)?

I'd like to better understand the differences with stock ANTLR again though
my focus is on lexer and parser generation. A couple more questions:

- Is the codegen largely v3.0.x-like? (that would simplify adding C#
support)

- Will ANTLR Yggdrasil support v3.1 features e.g. grammar imports in the
coming release? Ever?

Micheal

-----------------------
The best way to contact me is via the list/forum. My time is very limited. 







      ____________________________________________________________________________________
Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20080327/c62751ef/attachment.html 


More information about the antlr-interest mailing list