Package org.sugarj.editor.strategies

Source Code of org.sugarj.editor.strategies.java_strategy_0_0

package org.sugarj.editor.strategies;

       import org.spoofax.interpreter.terms.IStrategoTerm;
       import org.spoofax.interpreter.terms.ITermFactory;
       import org.strategoxt.lang.Context;
       import org.strategoxt.lang.Strategy;
      
       /**
        * Example Java strategy implementation.
        *
        * This strategy can be used by editor services and can be called
        * in Stratego modules by declaring it as an external strategy
        * as follows:
        *
        * <code>
        *  external java-strategy(|)
        * </code>
        *
        * @see InteropRegisterer  This class registers java_strategy_0_0 for use.
        */
       public class java_strategy_0_0 extends Strategy {
        
         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");
         }
      
       }
TOP

Related Classes of org.sugarj.editor.strategies.java_strategy_0_0

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.