[antlr-interest] building instruction/ASTnode pairs

Terence Parr parrt at cs.usfca.edu
Sun Nov 14 09:36:53 PST 2004


Loring spake:

>> Arrays, besides being memory hogs, do not address the root cause of 
>> the
>> cyclic reference problem.  The cyclic reference problem is due to the
>> current brute force tree construction algorithm; a better approach is 
>> to
>> build a stream of instruction/payload pairs and then construct the 
>> tree
>> after all instructions have been gathered.
>
john mitchell spake:

> Yes, the cyclic reference problem is crucial to deal with cleanly.  
> Antlr's
> existing model of tree (re-)construction is brittle.  A linguistic 
> approach
> (create stream of instructions, sort & unique'ify, and apply) is both 
> more
> powerful and simpler.

Loring or John.  May i have a simple example (rule + pseudo-actions or 
whatever) that explains more precisely about what you intend?  I 
understand the concept; TokenStreamRewriteEngine does not actually 
modify the token buffer, it tracks a list of "instructions" that are 
carried out when you say "toString()".

Ter
--
CS Professor & Grad Director, University of San Francisco
Creator, ANTLR Parser Generator, http://www.antlr.org
Cofounder, http://www.jguru.com
Cofounder, http://www.knowspam.net enjoy email again!





 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/antlr-interest/

<*> To unsubscribe from this group, send an email to:
    antlr-interest-unsubscribe at yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 





More information about the antlr-interest mailing list