public void pushContext ( ) { int max = contexts . length ; contexts [ contextPos ] . declsOK = false ; contextPos ++ ; // Extend the array if necessary if ( contextPos >= max ) { Context newContexts [ ] = new Context [ max * 2 ] ; System . arraycopy ( contexts , 0 , newContexts , 0 , max ) ; max *= 2 ; contexts = newContexts ; } // Allocate the context if necessary. currentContext = contexts [ contextPos ] ; if ( currentContext == null ) { contexts [ contextPos ] = currentContext = new Context ( ) ; } // Set the parent, if any. if ( contextPos > 0 ) { currentContext . setParent ( contexts [ contextPos - 1 ] ) ; } }
Start a new Namespace context . The new context will automatically inherit the declarations of its parent context but it will also keep track of which declarations were made within this context .