Package org.rascalmpl.uri

Examples of org.rascalmpl.uri.ClassResourceInput


     
      reg.registerInputOutput(fileURIResolver);
    }
    else {
      eval.addRascalSearchPathContributor(StandardLibraryContributor.getInstance());
      reg.registerInput(new ClassResourceInput(reg, "courses", getClass(), "/org/rascalmpl/courses"));
    }
   
    eval.addRascalSearchPath(URIUtil.rootScheme("tutor"));
    eval.addRascalSearchPath(URIUtil.rootScheme("courses"));
View Full Code Here


    resolverRegistry.registerInput(https);

    CWDURIResolver cwd = new CWDURIResolver();
    resolverRegistry.registerInputOutput(cwd);

    ClassResourceInput library = new ClassResourceInput(resolverRegistry, "std", getClass(), "/org/rascalmpl/library");
    resolverRegistry.registerInput(library);

    ClassResourceInput testdata = new ClassResourceInput(resolverRegistry, "testdata", getClass(), "/org/rascalmpl/test/data");
    resolverRegistry.registerInput(testdata);
   
    ClassResourceInput benchmarkdata = new ClassResourceInput(resolverRegistry, "benchmarks", getClass(), "/org/rascalmpl/benchmark");
    resolverRegistry.registerInput(benchmarkdata);
   
    resolverRegistry.registerInput(new JarURIResolver());

    resolverRegistry.registerInputOutput(rascalPathResolver);

    resolverRegistry.registerInputOutput(new HomeURIResolver());
    resolverRegistry.registerInputOutput(new TempURIResolver());
   
    // here we have code that makes sure that courses can be edited by
    // maintainers of Rascal, using the -Drascal.courses=/path/to/courses property.
    final String courseSrc = System.getProperty("rascal.courses");
    if (courseSrc != null) {
       FileURIResolver fileURIResolver = new FileURIResolver() {
        @Override
        public String scheme() {
          return "courses";
        }
       
        @Override
        protected String getPath(URI uri) {
          String path = uri.getPath();
          return courseSrc + (path.startsWith("/") ? path : ("/" + path));
        }
      };
     
      resolverRegistry.registerInputOutput(fileURIResolver);
    }
    else {
      resolverRegistry.registerInput(new ClassResourceInput(resolverRegistry, "courses", getClass(), "/org/rascalmpl/courses"));
    }
 
    ClassResourceInput tutor = new ClassResourceInput(resolverRegistry, "tutor", getClass(), "/org/rascalmpl/tutor");
    resolverRegistry.registerInput(tutor);
   
    // default event trigger to swallow events
    setEventTrigger(AbstractInterpreterEventTrigger.newNullEventTrigger());
  }
View Full Code Here

      Object instance = clazz.newInstance();
      if (instance instanceof IRascalJUnitTestSetup) {
        ((IRascalJUnitTestSetup) instance).setup(evaluator);
      }
      else {
        IURIInputStreamResolver resolver = new ClassResourceInput(evaluator.getResolverRegistry(), "junit", clazz, "/");
        evaluator.getResolverRegistry().registerInput(resolver);
        evaluator.addRascalSearchPath(URIUtil.rootScheme("junit"));
      }
    } catch (InstantiationException e) {
      throw new ImplementationError("could not setup tests for: " + clazz.getCanonicalName(), e);
View Full Code Here

TOP

Related Classes of org.rascalmpl.uri.ClassResourceInput

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.