Package org.sugarj.driver.caching

Examples of org.sugarj.driver.caching.ModuleKey


    }));
   
    for (Path grammarFile : baseLang.getPackagedGrammars()) {
      Map<String, Integer> map = new HashMap<String, Integer>();
      map.put(grammarFile.getAbsolutePath(), FileCommands.fileHash(grammarFile));
      ModuleKey key = new ModuleKey(map, "");
      Path permissiveGrammar = lookupGrammarInCache(sdfCache, key);
      if (permissiveGrammar == null) {
        permissiveGrammar = FileCommands.newTempFile("def");
        makePermissive(new AbsolutePath(grammarFile.getAbsolutePath()), permissiveGrammar);
        permissiveGrammar = cacheParseTable(sdfCache, key, permissiveGrammar, environment);
View Full Code Here


                              Environment environment,
                              AbstractBaseLanguage baseLang) throws IOException,
                                                          InvalidParseTableException,
                                                          TokenExpectedException,
                                                          SGLRException {
    ModuleKey key = getModuleKeyForGrammar(sdf, module, dependentFiles, sdfParser);
    Path tbl = lookupGrammarInCache(sdfCache, key);
    if (tbl == null) {
      tbl = generateParseTable(key, sdf, module, environment.getIncludePath(), sdfCache, environment, baseLang);
      tbl = cacheParseTable(sdfCache, key, tbl, environment);
    }
View Full Code Here

      IStrategoTerm imports = ATermCommands.getApplicationSubterm(aterm, "module", 1);
      IStrategoTerm body = ATermCommands.getApplicationSubterm(aterm, "module", 2);
      IStrategoTerm term = ATermCommands.makeTuple(imports, body);

      return new ModuleKey(dependentFiles, SDF_FILE_PATTERN, term);
    } catch (Exception e) {
      throw new SGLRException(parser, "could not parse SDF file " + sdf, e);
    } finally {
      log.endTask();
    }
View Full Code Here

                              AbstractBaseProcessor baseProcessor) throws IOException,
                                                          InvalidParseTableException,
                                                          TokenExpectedException,
                                                          BadTokenException,
                                                          SGLRException {
    ModuleKey key = getModuleKeyForAssimilation(str, main, dependentFiles, strParser);
    Path prog = lookupAssimilationInCache(strCache, key);
    StrategoException error = null;
   
    if (prog == null) {
      try {
View Full Code Here

    try {
      IStrategoTerm aterm = (IStrategoTerm) strParser.parse(FileCommands.readFileAsString(str), str.getAbsolutePath(), "StrategoModule");

      aterm = ATermCommands.getApplicationSubterm(aterm, "Module", 1);

      return new ModuleKey(dependentFiles, STR_FILE_PATTERN, aterm);
    } catch (Exception e) {
      throw new SGLRException(strParser, "could not parse STR file " + str, e);
    } finally {
      log.endTask();
    }
View Full Code Here

TOP

Related Classes of org.sugarj.driver.caching.ModuleKey

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.