[antlr-interest] automatic tree grammar generation

Kamal Verma kverma at yahoo.com
Mon May 19 16:49:38 PDT 2008


Wonderful, when can we have it.

Few months ago I had similar need and I almost thought of same thing. It will be wonderful if have it as a command line option on antlr. Like "-treeg <filename>". How about string templating the 'AST' of 'antlr' grammar. ( inside the tool )

It will also help with understanding of generated AST and debug and develop the grammar.

I will love to hear Terence thoughts on this.

Regards,
-Kamal


----- Original Message ----
From: Loring Craymer <lgcraymer at yahoo.com>
To: Bernardo Elayda <belayda at gmail.com>; antlr-interest at antlr.org
Sent: Monday, May 19, 2008 5:07:18 PM
Subject: Re: [antlr-interest] automatic tree grammar generation


Bernardo--

I did a version of ANTLR 2 (2.8) with that capability, but the distribution got buried behind the OpenChannel licensing conditions.  That was one of the things that inspired the ANTLR 3 effort, and is (or will be--modeling transformations that use the attribute algebra takes a bit of effort to implement) a key feature of ANTLR Yggdrasil.  Automated tree grammar generation does cut development time significantly.

The lack of a first-class attribute syntax in ANTLR 3 makes it very difficult to impossible to build a "complete" tree grammar automatically (long-distance translocations would be hidden in actions) for some of the interesting translation situations, but it should be possible to cover 99% of the cases arising with hand editing for the remainder.

I am in the middle of getting the tree grammar generation working for Yggdrasil.  It will take me about three weeks of intensive debug and test to get the attribute algebra modeling working (but don't ask me when I will have those three weeks--I have other priorities) and then about a month to get the annotation-based (^ and current rule tree manipulations) transformation passes.  Once I have that, I intend to release a pre-1.0 version of Yggdrasil for general use.

--Loring


----- Original Message ----
From: Bernardo Elayda <belayda at gmail.com>
To: antlr-interest at antlr.org
Sent: Monday, May 19, 2008 11:28:05 AM
Subject: [antlr-interest] automatic tree grammar generation

Hi!

If a tree grammar is derived from an AST made by ANTLR, shouldn't the creation of the tree grammar be able to happen automatically?
If this can't be done today, I think this would be a nice feature for the future.

This question occurred to me while I was writing a paper on using ANTLR as a front-end for a virtual machine.

tia,
Bernie Elayda


      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20080519/7fcc1ed4/attachment.html 


More information about the antlr-interest mailing list