private void pushScript ( ScriptDescription newCurrentScript ) { currentScript = newCurrentScript ; if ( ! scriptStack . isEmpty ( ) ) { ScriptDescription parentScript = scriptStack . peek ( ) ; parentScript . addChildScript ( currentScript ) ; } scriptStack . addFirst ( currentScript ) ; }
Record the provided script as the current script at top of the script stack and add it as a child of the previous current script if there was one .