Package org.spoofax.interpreter.terms

Examples of org.spoofax.interpreter.terms.IStrategoList


        return null;
     
      IStrategoTerm nextDecl = ATermCommands.getApplicationSubterm(term, "NextToplevelDeclaration", 0);
      list.add(nextDecl);
      if (nextDecl.toString().contains(ContentProposerSemantic.COMPLETION_TOKEN)) {
        IStrategoList termList = ATermCommands.makeList("NextToplevelDeclaration", list);
       
        IStrategoList listIt = termList;
        while (!listIt.isEmpty()) {
          ParentAttachment.putParent(listIt.head(), termList, listIt);
          listIt = listIt.tail();
        }
       
        return termList;
      }
       
View Full Code Here


    IStrategoTerm errorTree = STRCommands.assimilate("sugarj-analyze", res.getDesugaringsFile(), tuple, new HybridInterpreter());
   
    assert errorTree.getTermType() == IStrategoTerm.TUPLE && errorTree.getSubtermCount() == 4 :
      "error in sugarj-analyze, did not return tuple with 4 elements";
   
    IStrategoList semErrors = Tools.termAt(errorTree, 1);
    IStrategoList warnings = Tools.termAt(errorTree, 2);
    IStrategoList notes = Tools.termAt(errorTree, 3);
   
    success &= semErrors.isEmpty() && warnings.isEmpty() && notes.isEmpty();
   
    for (IStrategoTerm error : semErrors.getAllSubterms())
      if (error.getTermType() == IStrategoTerm.LIST)
        for (IStrategoTerm deepError : error.getAllSubterms())
          reportCLI(deepError, "error");
      else
        reportCLI(error, "error");
    for (IStrategoTerm warning : warnings.getAllSubterms())
      if (warning.getTermType() == IStrategoTerm.LIST)
        for (IStrategoTerm deepWarning : warning.getAllSubterms())
          reportCLI(deepWarning, "warning");
      else
        reportCLI(warning, "warning");
    for (IStrategoTerm note : notes.getAllSubterms())
      if (note.getTermType() == IStrategoTerm.LIST)
        for (IStrategoTerm deepNote : note.getAllSubterms())
          reportCLI(deepNote, "note");
      else
        reportCLI(note, "note");
View Full Code Here

    assert ts.length > 0;
    return makeList(sort, null, ts);
  }
 
  public static IStrategoList makeList(String sort, IToken emptyListToken, IStrategoTerm... ts) {
    IStrategoList term = factory.makeList(ts);
   
    setAttachment(term, sort, emptyListToken, ts);
    return term;
  }
View Full Code Here

TOP

Related Classes of org.spoofax.interpreter.terms.IStrategoList

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.