[antlr-interest] we can do push/pop error stuff for 4%

Olivier Dragon dragonoe at mcmaster.ca
Sat May 27 15:02:33 PDT 2006


On Sat, May 27, 2006 at 02:29:57PM -0700, Terence Parr wrote:
> >I think it might also have to do with fact that java.util.Stack is
> >based on Vector, which is a resizeable array with default size 10. If
> >your grammar uses more than 10 elements it's going to do a lot of
> >resizing.
> 
> Oh, right.  Yeah, I set my stack at 75 min.

Maybe try

stack.ensureCapacity(75)

to make things fair :) (and possibly avoid duplicating code that
actually might work fine) There's no way to set the capacity increment
though, which according to the Vector documentation is initially set to
0. At least for a Stack. If you use Vector you can specify it in the
constructor. Hopefully that won't affect things too much.

-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/20060527/e48ee3f5/attachment.bin


More information about the antlr-interest mailing list