Package org.rascalmpl.interpreter.env

Examples of org.rascalmpl.interpreter.env.ModuleEnvironment


  private static final String packageName = "org.rascalmpl.java.parser.object";
  private static final boolean debug = false;

  public ParserGenerator(IRascalMonitor monitor, PrintWriter out, List<ClassLoader> loaders, IValueFactory factory, Configuration config) {
    GlobalEnvironment heap = new GlobalEnvironment();
    ModuleEnvironment scope = new ModuleEnvironment("___parsergenerator___", heap);
    this.evaluator = new Evaluator(ValueFactoryFactory.getValueFactory(), out, out, scope,heap);
    this.evaluator.getConfiguration().setRascalJavaClassPathProperty(config.getRascalJavaClassPathProperty());
    evaluator.addRascalSearchPathContributor(StandardLibraryContributor.getInstance());   
    this.evaluator.setBootstrapperProperty(true);
    this.bridge = new JavaBridge(loaders, factory, config);
View Full Code Here


    this.tr = new TypeReifier(values);
    duration = values.integer(1000*100); // default duration for eval
  }

  private ModuleEnvironment getUniqueModuleEnvironment(IEvaluatorContext ctx) {
    ModuleEnvironment mod = new ModuleEnvironment("___EVAL_INSTANCE___" + evalCount++ , ctx.getHeap());
    return mod;
  }
View Full Code Here

  }

  private Evaluator getSharedEvaluator(IEvaluatorContext ctx) {
    if (this.eval == null) {
      GlobalEnvironment heap = new GlobalEnvironment();
      ModuleEnvironment root = new ModuleEnvironment("___EVAL___", heap);
      this.eval = new Evaluator(ctx.getValueFactory(), ctx.getStdErr(), ctx.getStdOut(), root, heap, ctx.getEvaluator().getClassLoaders(), ctx.getEvaluator().getRascalResolver());
      this.eval.getConfiguration().setRascalJavaClassPathProperty(ctx.getConfiguration().getRascalJavaClassPathProperty());
    }
   
    return this.eval;
View Full Code Here

    IEvaluator<Result<IValue>> evaluator = ctx.getEvaluator();
    EvalTimer timer = new EvalTimer(evaluator, duration.intValue());

    Result<IValue> result = null;
    Environment old = evaluator.getCurrentEnvt();
    ModuleEnvironment env = getUniqueModuleEnvironment(evaluator);
   
    try {
      timer.start();
     
      evaluator.setCurrentEnvt(env);
View Full Code Here

  private static final String packageName = "org.rascalmpl.java.parser.object";
  private static final boolean debug = false;

  public ParserGenerator(IRascalMonitor monitor, PrintWriter out, List<ClassLoader> loaders, IValueFactory factory, Configuration config) {
    GlobalEnvironment heap = new GlobalEnvironment();
    ModuleEnvironment scope = new ModuleEnvironment("___parsergenerator___", heap);
    this.evaluator = new Evaluator(ValueFactoryFactory.getValueFactory(), out, out, scope,heap);
    evaluator.addRascalSearchPathContributor(StandardLibraryContributor.getInstance());    this.evaluator.setBootstrapperProperty(true);
    this.bridge = new JavaBridge(loaders, factory, config);
    this.vf = factory;
   
View Full Code Here

  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

  }
 
  private Evaluator createEvaluator(IEvaluatorContext ctx) {
    if (this.evaluator == null) {
      GlobalEnvironment heap = new GlobalEnvironment();
      ModuleEnvironment root = new ModuleEnvironment("___SCREEN___", heap);
      errString = new StringWriter();
      outString = new StringWriter();
      err = new PrintWriter(errString);
      out = new PrintWriter(outString);
      this.evaluator = new Evaluator(values, err, out, root, heap, ctx.getEvaluator().getClassLoaders(), ctx.getEvaluator().getRascalResolver());
View Full Code Here

   
    return this.evaluator;
  }
 
  private ModuleEnvironment getUniqueModuleEnvironment(Evaluator eval) {
    ModuleEnvironment mod = new ModuleEnvironment("___SCREEN_INSTANCE___", eval.getHeap());
    eval.getHeap().addModule(mod);
    return mod; 
  }
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

TOP

Related Classes of org.rascalmpl.interpreter.env.ModuleEnvironment

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.