Closed Virtlink closed 1 year ago
This PR adds the following options to the stratego-runtime CFG configuration block:
stratego-runtime
class-kind
Generated
Manual
with-primitive-library
IOperatorRegistry
base-StrategoRuntimeBuilderFactory
StrategoRuntimeBuilderFactory
extend-StrategoRuntimeBuilderFactory
This PR also adds the documentation.
Usage example for with-primitive-library:
stratego-runtime { with-primitive-library = java mb.tiger.MyPrimitiveLibrary }
package mb.tiger; import org.spoofax.interpreter.library.AbstractStrategoOperatorRegistry; import javax.inject.Inject; public final class MyPrimitiveLibrary extends AbstractStrategoOperatorRegistry { @Inject public MyPrimitiveLibrary() { add(new MyPrimitive()); } @Override public String getOperatorRegistryName() { return getClass().getSimpleName(); } }
Usage example for overriding the generated classes:
stratego-runtime { class-kind = Generated base-StrategoRuntimeBuilderFactory = java mb.tiger.MyTigerStrategoRuntimeBuilderFactory extend-StrategoRuntimeBuilderFactory = java mb.tiger.MyExtendedTigerStrategoRuntimeBuilderFactory }
This PR adds the following options to the
stratego-runtime
CFG configuration block:class-kind
to specify the class kind (Generated
orManual
)with-primitive-library
to specify one or more implementation ofIOperatorRegistry
(Stratego primitive library) to be loadedbase-StrategoRuntimeBuilderFactory
to override the package and name of the (generated)StrategoRuntimeBuilderFactory
implementationextend-StrategoRuntimeBuilderFactory
to specif the package and name of the (manual)StrategoRuntimeBuilderFactory
implementationThis PR also adds the documentation.
Usage example for
with-primitive-library
:Usage example for overriding the generated classes: