[antlr-interest] can tree grammers have an output of AST?

Loring Craymer lgcraymer at yahoo.com
Sun Oct 15 20:57:09 PDT 2006


Rob--

Check out ANTLR Yggdrasil.  There is a zip in the
"file sharing" area of antlr.org; I am in the process
of setting up the antlr-yggdrasil project on
sourceforge.

Ter's latest statement on translation philosophy is
that trees are built during parsing and then walked
one or more times without transformation (that started
the latest thread on translation approaches, after
all).  ANTLR 3 was not designed to do complex
multi-pass transformations, nor was it designed _not_
to support such transformations, for that matter. 
However, features usually don't "just happen" in
software, but instead are the result of explicit
design or redesign efforts.

Yggdrasil is a work in progress--it does not
automatically generate tree grammars yet, for
example--but it will support complex multi-pass
transformation in its current form.

--Loring

--- Robert Hill <rob.hill at blueyonder.co.uk> wrote:

> Can you create a tree grammar that has an output of
> AST in v3.0b4?
> 
> The tree grammar I have compiles fine when I have
> output=template
> But when I change to output = AST, I get errors like
> the following.
> 
> 
>
D:\ActiveProjects\IdeaProjects\Jtest1\src\SemanticCheck.java
> (178:39)cannot
> find symbol
>
D:\ActiveProjects\IdeaProjects\Jtest1\src\SemanticCheck.java:178:
> cannot
> find symbol
> symbol  : method create(org.antlr.runtime.tree.Tree)
> location: interface
> org.antlr.runtime.tree.TreeAdaptor
>                
> adaptor.setTokenBoundaries(retval.tree,
> retval.start,
> retval.stop);
> 
> 
> ok, I gather that it cant find the create method,
> but If I edit the java
> output, and type a '.' after the name the
> intellisense pops up (im using
> intelliJ) and the create method is present.
> 
> Is this another class path issue? Or am I missing
> another directive that's
> buried somewhere in the wiki??
> 
> Any ideas anyone?!
> 
> Cheers!
> 
> Rob
> 
> 
> 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


More information about the antlr-interest mailing list