public static Set<String> getFreeVariables(Expression2 expression) {
    Set<String> freeVariables = Sets.newHashSet();
    ScopeSet scopes = getScopes(expression);
    for (int i = 0; i < expression.size(); i++) {
      Scope scope = scopes.getScope(i);
      String varName = getFreeVariable(expression, i, scope);
      if (varName != null) {
        freeVariables.add(varName);
      }
    }
    return freeVariables;
  }
public static Set < String > getFreeVariables ( Expression2 expression ) { Set < String > freeVariables = Sets . newHashSet ( ) ; ScopeSet scopes = getScopes ( expression ) ; for ( int i = 0 ; i < expression . size ( ) ; i ++ ) { Scope scope = scopes . getScope ( i ) ; String varName = getFreeVariable ( expression , i , scope ) ; if ( varName != null ) { freeVariables . add ( varName ) ; } } return freeVariables ; }
Gets all free variables in {@code expression}, i.e.,
variables whose values are determined by the environment
in which the expression is evaluated.

@param expression
@return