Package org.rascalmpl.interpreter.env

Examples of org.rascalmpl.interpreter.env.GlobalEnvironment.addModule()


  private boolean initialized;
  private boolean loaded;
 
  public StaticChecker(PrintWriter stderr, PrintWriter stdout) {
    GlobalEnvironment heap = new GlobalEnvironment();
    ModuleEnvironment root = heap.addModule(new ModuleEnvironment("___static_checker___", heap));
    eval = new Evaluator(ValueFactoryFactory.getValueFactory(), stderr, stdout, root, heap);
    eval.addRascalSearchPathContributor(StandardLibraryContributor.getInstance());
    checkerEnabled = false;
    initialized = false;
    loaded = false;
View Full Code Here


    return System.getProperty("rascal.courses");
  }
 
  public RascalTutor() {
    GlobalEnvironment heap = new GlobalEnvironment();
    ModuleEnvironment root = heap.addModule(new ModuleEnvironment("___TUTOR___", heap));
    PrintWriter stderr = new PrintWriter(System.err);
    PrintWriter stdout = new PrintWriter(System.out);
    eval = new Evaluator(ValueFactoryFactory.getValueFactory(), stderr, stdout, root, heap);
   
    URIResolverRegistry reg = eval.getResolverRegistry();
View Full Code Here

      robin = 0;
      IEvaluator<?> callingEval = ctx.getEvaluator();
     
     
      GlobalEnvironment heap = new GlobalEnvironment();
      ModuleEnvironment root = heap.addModule(new ModuleEnvironment("___full_module_parser___", heap));
      cachedEvaluator = new Evaluator(callingEval.getValueFactory(), callingEval.getStdErr(), callingEval.getStdOut(), root, heap);
      cachedEvaluator.getResolverRegistry().copyResolverRegistries(ctx.getResolverRegistry());
     
      // Update the classpath so it is the same as in the context interpreter.
      cachedEvaluator.getConfiguration().setRascalJavaClassPathProperty(ctx.getConfiguration().getRascalJavaClassPathProperty());
View Full Code Here

    GlobalEnvironment heap = eval.__getHeap();
   
    if (!heap.existsModule(name)) {
      //System.err.println("importModule: " + name);
      // deal with a fresh module that needs initialization
      heap.addModule(new ModuleEnvironment(name, heap));
      loadModule(src, name, eval);
    }
    else if (eval.getCurrentEnvt() == eval.__getRootScope()) {
      // in the root scope we treat an import as a "reload"
      heap.resetModule(name);
View Full Code Here

    GlobalEnvironment heap = eval.__getHeap();
    ModuleEnvironment other = heap.getModule(name);;
   
    if (other == null) {
      // deal with a fresh module that needs initialization
      heap.addModule(new ModuleEnvironment(name, heap));
      other = loadModule(x, name, eval);
    }
    else if (eval.getCurrentEnvt() == eval.__getRootScope()) {
      // in the root scope we treat an extend as a "reload"
      heap.resetModule(name);
View Full Code Here

    GlobalEnvironment heap = eval.getHeap();
   
    ModuleEnvironment env = heap.getModule(name);
    if (env == null) {
      env = new ModuleEnvironment(name, heap);
      heap.addModule(env);
    }
   
    try {
      Module module = buildModule(name, env, eval);
View Full Code Here

      GlobalEnvironment heap = eval.__getHeap();
      ModuleEnvironment env = heap.getModule(name);

      if (env == null) {
        env = new ModuleEnvironment(name, heap);
        heap.addModule(env);
      }

      Environment oldEnv = eval.getCurrentEnvt();
      eval.setCurrentEnvt(env); // such that declarations end up in
      // the module scope
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.