code: public Variable getDeclaredVariable(String name, boolean publicOnly) {
          //private Set mPrivateVars;
  
          Variable var = mDeclared.get(name);
          if (var != null) {
              // If its okay to be private or its public then...
              if (!publicOnly || mPrivateVars == null ||
                  !mPrivateVars.contains(var)) {
                  return var;
              }
          }
          
          if (mParent != null) {
              return mParent.getDeclaredVariable(name);
          }
          
          return null;
      }
docs: Returns a declared variable by name. Search begins in this scope and
  moves up into parent scopes. If not found, null is returned. A public-
  only variable can be requested.
  
  @return Null if no declared variable found with the given name