Package org.nlogo.nvm

Examples of org.nlogo.nvm.CompilerResults


  }

  private boolean compileProcedures() {
    workspace.world.program(workspace.world.newProgram());
    try {
      CompilerResults results =
          workspace.compiler().compileProgram
              (proceduresInterface.innerSource(), workspace.world.newProgram(getGlobalVariableNames()),
                  workspace.getExtensionManager());
      workspace.setProcedures(results.proceduresMap());
      for (Procedure procedure : workspace.getProcedures().values()) {
        if (procedure.fileName.equals("")) {
          procedure.setOwner(proceduresInterface);
        } else if (procedure.fileName.equals("aggregate")) {
          procedure.setOwner(workspace.aggregateManager());
        } else {
          procedure.setOwner(new ExternalFileInterface(procedure.fileName));
        }
      }
      workspace.init();
      workspace.world.program(results.program());
      new org.nlogo.window.Events.CompiledEvent
          (proceduresInterface, results.program(), null, null)
          .raise(this);
      return true;
    } catch (CompilerException error) {
      if (AbstractWorkspace.isApplet()) {
        System.err.println("CompilerException: " + error);
View Full Code Here



  private void compileSource(org.nlogo.api.JobOwner owner,
                             List<org.nlogo.window.Events.CompiledEvent> errorEvents) {
    try {
      CompilerResults results =
          workspace.compiler().compileMoreCode
              (owner.source(), scala.Some.apply(owner.classDisplayName() + " '" + owner.displayName() + "'"),
                  workspace.world.program(), workspace.getProcedures(), workspace.getExtensionManager());

      if (!results.procedures().isEmpty()) {
        results.head().init(workspace);
        results.head().setOwner(owner);
        new org.nlogo.window.Events.CompiledEvent
            (owner, workspace.world.program(), results.head(), null).raise(this);
      }
    } catch (CompilerException error) {
      errorEvents.add
          (new org.nlogo.window.Events.CompiledEvent
              (owner, workspace.world.program(), null, error));
View Full Code Here

      widgets.add(owner);
      return;
    }
    if (owner.isCommandCenter()) {
      try {
        CompilerResults results =
            workspace.compiler().compileMoreCode
                (owner.source(), scala.Some.apply(owner.classDisplayName()), workspace.world.program(),
                    workspace.getProcedures(), workspace.getExtensionManager());
        results.head().init(workspace);
        results.head().setOwner(owner);
        new org.nlogo.window.Events.CompiledEvent
            (owner, workspace.world.program(), results.head(), null).raise(this);
      } catch (CompilerException error) {
        new org.nlogo.window.Events.CompiledEvent
            (owner, workspace.world.program(), null, error)
            .raise(this);
      }
View Full Code Here

TOP

Related Classes of org.nlogo.nvm.CompilerResults

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.