Search in sources :

Example 1 with JavaSpecificBuilderAdapter

use of org.whole.lang.java.builders.JavaSpecificBuilderAdapter in project whole by wholeplatform.

the class JDT2JavaBuilder method transform.

public static IEntity transform(ASTNode model) {
    JavaSpecificBuilderAdapter builder = new JavaSpecificBuilderAdapter(new ModelBuilder());
    transform(model, builder);
    return builder.wGetResult();
}
Also used : ModelBuilder(org.whole.lang.builders.ModelBuilder) JavaSpecificBuilderAdapter(org.whole.lang.java.builders.JavaSpecificBuilderAdapter)

Example 2 with JavaSpecificBuilderAdapter

use of org.whole.lang.java.builders.JavaSpecificBuilderAdapter in project whole by wholeplatform.

the class JavaLanguageDeployer method deploy.

public void deploy(ReflectionFactory platform) {
    platform.addLanguageKit(new JavaLanguageKit());
    platform.addOperationFactory(JavaLanguageKit.URI, GenericBuilderAdapterOperation.ID, new IBuilderFactory() {

        public IBuilder create(IBuilder strategy, IEntityContext entityContext) {
            return new JavaGenericBuilderAdapter((IJavaBuilder) strategy, entityContext);
        }
    });
    platform.addOperationFactory(JavaLanguageKit.URI, SpecificBuilderAdapterOperation.ID, new IBuilderFactory() {

        public IBuilder create(IBuilder strategy, IEntityContext entityContext) {
            return new JavaSpecificBuilderAdapter(strategy, entityContext);
        }
    });
    platform.addOperationFactory(JavaLanguageKit.URI, PrettyPrinterOperation.ID, new IVisitorFactory() {

        public IVisitor create(IOperation operation, int stage) {
            return new JavaPrettyPrinterVisitor((PrettyPrinterOperation) operation);
        }
    });
    platform.addOperationFactory(JavaLanguageKit.URI, InterpreterOperation.ID, new IVisitorFactory() {

        public IVisitor create(IOperation operation, int stage) {
            if (stage == 0)
                return new JavaInterpreterVisitor();
            else
                return null;
        }
    });
}
Also used : IBuilder(org.whole.lang.builders.IBuilder) IOperation(org.whole.lang.operations.IOperation) PrettyPrinterOperation(org.whole.lang.operations.PrettyPrinterOperation) IJavaBuilder(org.whole.lang.java.builders.IJavaBuilder) IVisitor(org.whole.lang.visitors.IVisitor) IEntityContext(org.whole.lang.contexts.IEntityContext) IBuilderFactory(org.whole.lang.builders.IBuilderFactory) IVisitorFactory(org.whole.lang.visitors.IVisitorFactory) JavaPrettyPrinterVisitor(org.whole.lang.java.visitors.JavaPrettyPrinterVisitor) JavaSpecificBuilderAdapter(org.whole.lang.java.builders.JavaSpecificBuilderAdapter) JavaGenericBuilderAdapter(org.whole.lang.java.builders.JavaGenericBuilderAdapter) JavaInterpreterVisitor(org.whole.lang.java.visitors.JavaInterpreterVisitor)

Aggregations

JavaSpecificBuilderAdapter (org.whole.lang.java.builders.JavaSpecificBuilderAdapter)2 IBuilder (org.whole.lang.builders.IBuilder)1 IBuilderFactory (org.whole.lang.builders.IBuilderFactory)1 ModelBuilder (org.whole.lang.builders.ModelBuilder)1 IEntityContext (org.whole.lang.contexts.IEntityContext)1 IJavaBuilder (org.whole.lang.java.builders.IJavaBuilder)1 JavaGenericBuilderAdapter (org.whole.lang.java.builders.JavaGenericBuilderAdapter)1 JavaInterpreterVisitor (org.whole.lang.java.visitors.JavaInterpreterVisitor)1 JavaPrettyPrinterVisitor (org.whole.lang.java.visitors.JavaPrettyPrinterVisitor)1 IOperation (org.whole.lang.operations.IOperation)1 PrettyPrinterOperation (org.whole.lang.operations.PrettyPrinterOperation)1 IVisitor (org.whole.lang.visitors.IVisitor)1 IVisitorFactory (org.whole.lang.visitors.IVisitorFactory)1