Examples of ITermFactory


Examples of org.spoofax.interpreter.terms.ITermFactory

        pending.remove(sourceFile);
    }
  }
 
  private Result parseFailureResult(String filename) throws FileNotFoundException, IOException {
    ITermFactory f = ATermCommands.factory;
    IStrategoTerm tbl =
      f.makeAppl(f.makeConstructor("parse-table", 5),
          f.makeInt(6),
          f.makeInt(0),
          f.makeList(),
          f.makeAppl(f.makeConstructor("states", 1), f.makeList()),
          f.makeAppl(f.makeConstructor("priorities", 1),
                     f.makeList(f.makeAppl(f.makeConstructor("arg-gtr-prio", 3),
                                           f.makeInt(257), f.makeInt(1), f.makeInt(257))))); // XXX

    ParseTable pt = null;
    try {
      pt = new ParseTable(tbl, f);
    } catch (InvalidParseTableException e) {
View Full Code Here

Examples of org.spoofax.interpreter.terms.ITermFactory

         public static java_strategy_0_0 instance = new java_strategy_0_0();
      
         @Override
         public IStrategoTerm invoke(Context context, IStrategoTerm current) {
           context.getIOAgent().printError("Input for java-strategy: " + current);
           ITermFactory factory = context.getFactory();
           return factory.makeString("Regards from java-strategy");
         }
View Full Code Here

Examples of org.spoofax.interpreter.terms.ITermFactory

  }

  private static IStrategoAppl composeDefinitions(IStrategoAppl base, List<IStrategoTerm> extensions) {
    IStrategoConstructor cons = base.getConstructor();
    if (cons.getName().equals("Module") && cons.getArity() == 3) {
      ITermFactory factory = Environment.getTermFactory();
      List<IStrategoTerm> allDefinitions = new ArrayList<IStrategoTerm>();
      addAll(allDefinitions, (IStrategoList) termAt(base, 2));
      allDefinitions.addAll(extensions);
      return factory.makeAppl(cons, termAt(base, 0), termAt(base, 1), factory.makeList(allDefinitions));
    } else {
      throw new IllegalStateException("Unsupported editor descriptor format:" + cons);
    }
  }
View Full Code Here

Examples of org.spoofax.interpreter.terms.ITermFactory

  public static java_strategy_0_0 instance = new java_strategy_0_0();

  @Override
  public IStrategoTerm invoke(Context context, IStrategoTerm current) {
    context.getIOAgent().printError("Input for java-strategy: " + current);
    ITermFactory factory = context.getFactory();
    return factory.makeString("Regards from java-strategy");
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.