[antlr-interest] DFA's encoded directly in java bytecodes

Martin Probst mail at martin-probst.com
Mon Oct 25 02:45:52 PDT 2004


Hi,
I'm pretty sure you know about this but it wasn't mentioned on the list so
I thought I'll drop a line ...

> For the Java target of ANTLR 3.0, I've been concerned about the hideous
> nature of the code generated for DFA machines.  Without a goto
> instruction in Java, [...]

It is true that there is no *real* goto statement in Java (and the
reserved keyword isn't used) but there is somewhat of a goto statement
that looks like this:
mylabel1:
  for (...)
    for (...)
    if (ragnaroek)
      break mylabel1;
which is effectively a goto, though it will not work if you want to jump
out of the current function. Are you sure you cannot use that? I would
personally prefer stuffing all the code into one big function instead of
writing to class files directly. Sun is known to not break binary
compatibilty but its always better to let the "real" compilers do the
compiling IMHO.

Regards,
Martin


 
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