code: public boolean bindToVariable(VariableRef ref) {
          String name = ref.getName();
          Variable var = getDeclaredVariable(name);
          
          if (var != null) {
              ref.setType(null);
              ref.setVariable(var);
              mVariableRefs.add(ref);
              return true;
          }
          else {
              return false;
          }
      }
docs: Attempt to bind variable reference to a variable in this scope or a
  parent scope. If the variable to bind to isn't available or doesn't
  exist, false is returned.
  
  @return true if reference has been bound