예제 #1
0
  static {
    heap = new GlobalEnvironment();
    root = heap.addModule(new ModuleEnvironment("___test___", heap));
    modules = new TestModuleResolver();

    stderr = new PrintWriter(System.err);
    stdout = new PrintWriter(System.out);
    evaluator = new Evaluator(ValueFactoryFactory.getValueFactory(), stderr, stdout, root, heap);

    evaluator.addRascalSearchPathContributor(StandardLibraryContributor.getInstance());
    URIResolverRegistry resolverRegistry = URIResolverRegistry.getInstance();

    evaluator.addRascalSearchPath(URIUtil.rootLocation("test-modules"));
    resolverRegistry.registerInput(modules);

    evaluator.addRascalSearchPath(URIUtil.rootLocation("benchmarks"));
    resolverRegistry.registerInput(
        new ClassResourceInput("benchmarks", Evaluator.class, "/org/rascalmpl/benchmark"));
    try {
      assert (false);
      throw new RuntimeException(
          "Make sure you enable the assert statement in your run configuration ( add -ea )");
    } catch (AssertionError e) {

    }
  }
예제 #2
0
 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);
   eval.addRascalSearchPathContributor(StandardLibraryContributor.getInstance());
   eval.addRascalSearchPath(URIUtil.rootScheme("tutor"));
   eval.addRascalSearchPath(URIUtil.rootScheme("courses"));
 }
예제 #3
0
 public void addRascalSearchPathContributor(ISourceLocation loc) {
   eval.addRascalSearchPath(loc);
 }