[antlr-interest] Re: alternative prediction mechanism for 3.0

Terence Parr parrt at cs.usfca.edu
Sat Jul 3 12:13:36 PDT 2004


On Jul 2, 2004, at 4:07 PM, antlrbrian wrote:

> --- In antlr-interest at yahoogroups.com, Ric Klaren <klaren at c...> wrote:
>> Terence wrote:
>>> DFA decision = dfaFactory.get("...DFA description...");
>>
>> You mean to have a 'high' level ASCII DFA specification of
>> states/transitions etc. between the ".." or just an id for tha
>> specific DFA?
>>
>> Why not encode the DFA in static tables (that can be 'run'
>> directly without first processing them)?
>> There's lot's of ways to do that if I recall right.
>> It also offers the possibility to dump the tables in separate
>> class files (if size becomes an issue).
>
> Why not generate the DFA to a textual representation, and then compile
> that textual representation to bytecodes. My thinking is:
> 1. The DFA textual representation will be easier to read than
>    generated Java code.
> 2. Using the new Java debugging API's (JSR 45), the classfiles
>    can be generated in such a way that debuggers can trace
>    through the DFA's textual representation directly.
> 4. The JVM GOTO instruction (and other such things) can be used
>    to speed things up if necessary.
> 5. It is a good demo of ANTLR's ability to generate tools
>    that generate binary output. I've only seen source-to-source
>    or source-to-AST translators in ANTLR.

Hi Brian,

A nice idea, one I had considered (generating bytecodes directly that 
is).  Problem people mentioned is that the start up cost is pretty 
expensive for the parser to build/generate the bytecodes...probably not 
an issue for many people, but...

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!
Cofounder, http://www.peerscope.com pure link sharing





 
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