*/
  public static void loadFile(String file) {
    { String temp000 = Stella.findFileInLoadPath(file, null);

      file = ((temp000 != null) ? temp000 : file);
    }
    Stella.ensureFileExists(file, "load-file");
    { boolean toplevelinvocationP = ((String)(Stella.$CURRENTFILE$.get())) == null;
      boolean skipcommandP = false;
      boolean seeninmoduleP = false;
      Cons commands = Stella.NIL;
      InputFileStream inputstream = null;

      try {
        { Object old$Currentfile$000 = Stella.$CURRENTFILE$.get();

          try {
            Native.setSpecial(Stella.$CURRENTFILE$, Stella.fileBaseName(file));
            inputstream = InputFileStream.newInputFileStream(file);
            { Object old$Module$000 = Stella.$MODULE$.get();
              Object old$Context$000 = Stella.$CONTEXT$.get();

              try {
                Native.setSpecial(Stella.$MODULE$, ((Module)(Stella.$MODULE$.get())));
                Native.setSpecial(Stella.$CONTEXT$, ((Module)(Stella.$MODULE$.get())));
                { Stella_Object tree = null;
                  SExpressionIterator iter000 = InputStream.sExpressions(inputstream);

                  loop000 : while (iter000.nextP()) {
                    tree = iter000.value;
                    if (Stella_Object.safePrimaryType(tree) == Stella.SGT_STELLA_CONS) {
                      { Cons tree000 = ((Cons)(tree));

                        { Object [] caller_MV_returnarray = new Object[1];

                          skipcommandP = Cons.handleInModuleTree(tree000, seeninmoduleP, true, caller_MV_returnarray);
                          seeninmoduleP = ((boolean)(((BooleanWrapper)(caller_MV_returnarray[0])).wrapperValue));
                        }
                        if (skipcommandP) {
                          continue loop000;
                        }
                        { Stella_Object operator = tree000.value;

                          if (Surrogate.subtypeOfSymbolP(Stella_Object.safePrimaryType(operator))) {
                            { Symbol operator000 = ((Symbol)(operator));

                              if ((operator000 == Stella.SYM_STELLA_DEFMODULE) ||
                                  ((operator000 == Stella.SYM_STELLA_DEFSYSTEM) ||
                                   ((operator000 == Stella.SYM_STELLA_DEFCLASS) ||
                                    ((operator000 == Stella.SYM_STELLA_DEFSLOT) ||
                                     ((operator000 == Stella.SYM_STELLA_DEFUN) ||
                                      (operator000 == Stella.SYM_STELLA_DEFMETHOD)))))) {
                                Stella_Object.evaluateCommand(tree000, false);
                              }
                              else {
                                if (Symbol.lookupCommand(operator000) != null) {
                                  commands = Cons.cons(tree000, commands);
                                }
                                else {
                                  Stella_Object.evaluateCommand(tree000, false);
                                }
                              }
                            }
                          }
                          else {
                            Stella_Object.evaluateCommand(tree000, false);
                          }
                        }
                      }
                    }
                    else {
                      Stella_Object.evaluateCommand(tree, false);
                    }
                  }
                }
                { Object old$Translationphase$000 = Stella.$TRANSLATIONPHASE$.get();

                  try {
                    Native.setSpecial(Stella.$TRANSLATIONPHASE$, Stella.KWD_FINALIZE);
                    SystemDefinition.runSystemFinalization(((SystemDefinition)(Stella.$CURRENTSYSTEMDEFINITION$.get())));

                  } finally {
                    Stella.$TRANSLATIONPHASE$.set(old$Translationphase$000);
                  }
                }
                { boolean finalizeP = ((SystemDefinition)(Stella.$CURRENTSYSTEMDEFINITION$.get())) != null;

                  { Stella_Object tree = null;
                    Cons iter001 = commands.reverse();

                    for (;!(iter001 == Stella.NIL); iter001 = iter001.rest) {
                      tree = iter001.value;
                      Stella_Object.evaluateCommand(tree, finalizeP);
                    }
                  }
                }

              } finally {
                Stella.$CONTEXT$.set(old$Context$000);
                Stella.$MODULE$.set(old$Module$000);
              }
            }

          } finally {
            Stella.$CURRENTFILE$.set(old$Currentfile$000);
          }
        }

      } finally {
        if (toplevelinvocationP) {
          Stella.sweepTransients();
        }
        if (inputstream != null) {
          inputstream.free();
        }
      }
    }
  }