Package org.spoofax.interpreter.library.ssl

Examples of org.spoofax.interpreter.library.ssl.StrategoHashMap


  }

  @Override
  public boolean call(IContext context, Strategy[] svars, IStrategoTerm[] tvars) throws InterpreterException {
    List<Renaming> renamings = environment.getRenamings();
    StrategoHashMap map = new StrategoHashMap(renamings.size(), Math.max(1, renamings.size()));
   
    for (Renaming r : renamings) {
      List<IStrategoTerm> qualTerms = new LinkedList<IStrategoTerm>();
      for (String qual : r.pkgs)
        qualTerms.add(ATermCommands.makeString(qual));
      IStrategoTerm quals = ATermCommands.makeList("Qualifiers", qualTerms);
      IStrategoTerm from = ATermCommands.makeString(r.from);
      IStrategoTerm to = ATermCommands.makeString(r.to);
     
      if (!map.containsKey(from))
        map.put(from, to);
      if (!map.containsKey(ATermCommands.makeTuple(quals, from)))
      map.put(ATermCommands.makeTuple(quals, from), to);
    }
   
    context.setCurrent(ATermCommands.makeAppl("Hashtable", "", 1, map));
    return true;
  }
View Full Code Here

TOP

Related Classes of org.spoofax.interpreter.library.ssl.StrategoHashMap

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.