Package org.spoofax.interpreter.terms

Examples of org.spoofax.interpreter.terms.IStrategoTerm


    try {
      interp.load(ctree.getAbsolutePath());
      interp.setCurrent(in);
     
      if (interp.invoke(strategy)) {
        IStrategoTerm term = interp.current();

        //XXX performance improvement?
//        interp.reset();
               
//        IToken left = ImploderAttachment.getLeftToken(in);
View Full Code Here


   *             and Stratego statements.
   * @param str result file
   * @throws InvalidParseTableException
   */
  public static IStrategoTerm extractSTR(IStrategoTerm term) throws IOException {
    IStrategoTerm result = null;
    Context extractionContext = SugarJContexts.extractionContext();
    try {
      result = extract_str_0_0.instance.invoke(extractionContext, term);
    }
    catch (StrategoExit e) {
View Full Code Here

   * Filters Spoofax editor-service declarations.
   *
   * @param term a SugarJ extension declaration.
   */
  public static IStrategoTerm extractEditor(IStrategoTerm term) throws IOException {
    IStrategoTerm result = null;
    Context extractionContext = SugarJContexts.extractionContext();
    try {
      result = extract_editor_0_0.instance.invoke(extractionContext, term);
    }
    catch (StrategoExit e) {
View Full Code Here

    }
    return result;
  }

  public static IStrategoTerm renameRules(IStrategoTerm term, String oldName, String newName) throws IOException {
    IStrategoTerm result = null;
    Context renameRulesContext = SugarJContexts.renameRulesContext();
    try {
      IStrategoTerm toldName = renameRulesContext.getFactory().makeString(oldName);
      IStrategoTerm tnewName = renameRulesContext.getFactory().makeString(newName);
      result = rename_rules_0_2.instance.invoke(renameRulesContext, term, toldName, tnewName);
    }
    catch (StrategoExit e) {
      if (e.getValue() != 0 || result == null)
        throw new RuntimeException("Stratego extraction failed", e);
View Full Code Here

TOP

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

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.