private void push ( final LazyNode token ) { stackTop . addChild ( token ) ; // The stack allocation strategy here is to increase it in increments // of a power of two. This lets us check when all low bits are set and // its time to increase the stack again. // This lets us do a compare between a constant and a variable instead // of between two variables. if ( ( stackPointer & STACK_INCREASE ) == STACK_INCREASE ) { LazyNode [ ] newStack = new LazyNode [ STACK_SIZE + STACK_INCREASE + 1 ] ; System . arraycopy ( stack , 0 , newStack , 0 , STACK_SIZE ) ; STACK_SIZE = STACK_SIZE + STACK_INCREASE + 1 ; stack = newStack ; } stack [ stackPointer ++ ] = token ; stackTop = token ; }
Push a token onto the stack and attach it to the previous top as a child