public void setNumberOfVars ( final int num ) { if ( this . varnum != 0 ) throw new UnsupportedOperationException ( "Variable number is already set. Resetting it is not supported" ) ; if ( num < 1 || num > MAXVAR ) throw new IllegalArgumentException ( "Invalid variable number: " + num ) ; this . vars = new int [ num * 2 ] ; this . level2var = new int [ num + 1 ] ; this . refstack = new int [ num * 2 + 4 ] ; this . refstacktop = 0 ; while ( this . varnum < num ) { this . vars [ this . varnum * 2 ] = pushRef ( makeNode ( this . varnum , 0 , 1 ) ) ; this . vars [ this . varnum * 2 + 1 ] = makeNode ( this . varnum , 1 , 0 ) ; popref ( 1 ) ; this . nodes [ this . vars [ this . varnum * 2 ] ] . refcou = MAXREF ; this . nodes [ this . vars [ this . varnum * 2 + 1 ] ] . refcou = MAXREF ; this . level2var [ this . varnum ] = this . varnum ; this . varnum ++ ; } this . nodes [ 0 ] . level = num ; this . nodes [ 1 ] . level = num ; this . level2var [ num ] = num ; varResize ( ) ; }
Sets the number of variables to use . It may be called more than one time but only to increase the number of variables .