[antlr-interest] Java and static arrays: a serious joke

Olivier Dragon dragonoe at mcmaster.ca
Mon Jun 5 12:19:12 PDT 2006


On Fri, Jun 02, 2006 at 06:48:03PM -0700, Terence Parr wrote:
> Quickly count in your head how many bytecodes per a[0]=10.  You'll  
> see that it's many bytes for each int you want to store.  How big can  
> a method be?  64k.  That doesn't leave much room for lots of state  
> tables.
> ...
> won't compile.  Look carefully at the example in my email (and the  
> link if still unclear).

Ah :) I did not know that! It puts the problem in perspective.

So I presume using enums for token types is out of the question. We're
still stuck in `int'-land. The enum maps appear to be nice and
relatively fast (backed by fixed size arrays) but probably would end up
being too big or too slow for the DFAs you're building.

-Olivier

-- 
          __-/|    ? ?     |\-__
     __--/  /  \   (^^)   /  \  \--__
  _-/   /   /  /\ / ( )  /\  \   \   \-_
 /  /   /  /  /  (   ^^ ~  \  \  \   \  \
 / Oli Dragon    ( dragonoe at mcmaster.ca \
/  B.Eng. Sfwr   ( dragon.homelinux.org  \
/  /  /    /__--_ (   ) __--__\    \  \  \
|  /  /  _/        \_ \_       \_  \  \  |
 \/  / _/            \_ \_       \_ \  \/
  \_/ /                -\_\        \ \_/
    \/                    )         \/
                        *~
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://www.antlr.org/pipermail/antlr-interest/attachments/20060605/b5f9c3a2/attachment.bin


More information about the antlr-interest mailing list