public void freeVariables ( SyntacticItem e , Set < WyalFile . VariableDeclaration > freeVars ) { if ( e instanceof Expr . VariableAccess ) { Expr . VariableAccess va = ( Expr . VariableAccess ) e ; freeVars . add ( va . getVariableDeclaration ( ) ) ; } else if ( e instanceof Expr . Quantifier ) { Expr . Quantifier q = ( Expr . Quantifier ) e ; freeVariables ( q . getBody ( ) , freeVars ) ; // Remove any bound variables for ( WyalFile . VariableDeclaration vd : q . getParameters ( ) ) { freeVars . remove ( vd ) ; } } else { for ( int i = 0 ; i != e . size ( ) ; ++ i ) { SyntacticItem item = e . get ( i ) ; if ( item != null ) { freeVariables ( item , freeVars ) ; } } } }
Determine all free variables which are used within the given expression . A free variable is one which is not bound within the expression itself .