Search in sources :

Example 1 with IMiscBuilder

use of org.whole.lang.misc.builders.IMiscBuilder in project whole by wholeplatform.

the class MiscLanguageDeployer method deploy.

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

        public IBuilder create(IBuilder strategy, IEntityContext entityContext) {
            return new MiscGenericBuilderAdapter((IMiscBuilder) strategy, entityContext);
        }
    });
    platform.addOperationFactory(MiscLanguageKit.URI, SpecificBuilderAdapterOperation.ID, new IBuilderFactory() {

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

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

        public IVisitor create(IOperation operation, int stage) {
            if (stage == 0)
                return new MiscOperationVisitor();
            else
                return null;
        }
    });
    platform.addOperationFactory(MiscLanguageKit.URI, ValidatorOperation.ID, new IVisitorFactory() {

        public IVisitor create(IOperation operation, int stage) {
            return new MiscOperationVisitor();
        }
    });
    platform.addOperationFactory(MiscLanguageKit.URI, ArtifactsGeneratorOperation.ID, new IVisitorFactory() {

        public IVisitor create(IOperation operation, int stage) {
            return new MiscOperationVisitor();
        }
    });
    platform.addOperationFactory(MiscLanguageKit.URI, NormalizerOperation.ID, new IVisitorFactory() {

        public IVisitor create(IOperation operation, int stage) {
            return new MiscOperationVisitor();
        }
    });
    platform.addOperationFactory(MiscLanguageKit.URI, DynamicCompilerOperation.ID, new IVisitorFactory() {

        public IVisitor create(IOperation operation, int stage) {
            return new MiscDynamicCompilerVisitor();
        }
    });
}
Also used : IBuilder(org.whole.lang.builders.IBuilder) IOperation(org.whole.lang.operations.IOperation) MiscDynamicCompilerVisitor(org.whole.lang.misc.visitors.MiscDynamicCompilerVisitor) IVisitor(org.whole.lang.visitors.IVisitor) IEntityContext(org.whole.lang.contexts.IEntityContext) IMiscBuilder(org.whole.lang.misc.builders.IMiscBuilder) IBuilderFactory(org.whole.lang.builders.IBuilderFactory) IVisitorFactory(org.whole.lang.visitors.IVisitorFactory) MiscGenericBuilderAdapter(org.whole.lang.misc.builders.MiscGenericBuilderAdapter) MiscSpecificBuilderAdapter(org.whole.lang.misc.builders.MiscSpecificBuilderAdapter) MiscOperationVisitor(org.whole.lang.misc.visitors.MiscOperationVisitor)

Example 2 with IMiscBuilder

use of org.whole.lang.misc.builders.IMiscBuilder in project whole by wholeplatform.

the class ModelsInfo method apply.

public void apply(IBuilderOperation op) {
    IMiscBuilder b0 = (IMiscBuilder) op.wGetBuilder(MiscLanguageKit.URI);
    org.whole.lang.commons.builders.ICommonsBuilder cb = (org.whole.lang.commons.builders.ICommonsBuilder) op.wGetBuilder(org.whole.lang.commons.reflect.CommonsLanguageKit.URI);
    b0.Misc_(2);
    cb.SameStageFragment_();
    IArtifactsBuilder b1 = (IArtifactsBuilder) op.wGetBuilder(ArtifactsLanguageKit.URI);
    b1.PackageArtifact_();
    b1.Name("org.whole.lang.models");
    b1.Metadata_();
    b1.Copyright("Copyright 2004-2016 Riccardo Solmi.");
    b1.License("* All rights reserved. This program and the accompanying materials\n* are made available under the terms of the GNU Lesser General Public License\n* which accompanies this distribution, and is available at\n* http://www.gnu.org/copyleft/lesser.html");
    b1.Author("Riccardo Solmi");
    b1._Metadata();
    cb.Resolver();
    b1._PackageArtifact();
    cb._SameStageFragment();
    cb.SameStageFragment_();
    IModelsBuilder b2 = (IModelsBuilder) op.wGetBuilder(ModelsLanguageKit.URI);
    b2.Model_();
    b2.SimpleName("Info");
    b2.TypeRelations();
    b2.ModelDeclarations_(7);
    b2.SimpleEntity_();
    b2.EntityModifiers();
    b2.SimpleName("ModelInfo");
    b2.Types();
    b2.Features_(7);
    b2.Feature_();
    b2.FeatureModifiers();
    b2.SimpleName("Values");
    b2.SimpleName("declarations");
    b2._Feature();
    b2.Feature_();
    b2.FeatureModifiers();
    b2.SimpleName("Values");
    b2.SimpleName("entities");
    b2._Feature();
    b2.Feature_();
    b2.FeatureModifiers();
    b2.SimpleName("Values");
    b2.SimpleName("types");
    b2._Feature();
    b2.Feature_();
    b2.FeatureModifiers();
    b2.SimpleName("ValuesMap");
    b2.SimpleName("featuresMap");
    b2._Feature();
    b2.Feature_();
    b2.FeatureModifiers();
    b2.SimpleName("OccurrencesMap");
    b2.SimpleName("entityOccurrencesMap");
    b2._Feature();
    b2.Feature_();
    b2.FeatureModifiers();
    b2.SimpleName("OccurrencesMap");
    b2.SimpleName("featureOccurrencesMap");
    b2._Feature();
    b2.Feature_();
    b2.FeatureModifiers();
    b2.SimpleName("OccurrencesMap");
    b2.SimpleName("typeOccurrencesMap");
    b2._Feature();
    b2._Features();
    b2._SimpleEntity();
    b2.MapEntity_();
    b2.EntityModifiers();
    b2.SimpleName("OccurrencesMap");
    b2.Types();
    b2.SimpleName("Value");
    b2.SimpleName("Occurrences");
    b2._MapEntity();
    b2.CompositeEntity_();
    b2.EntityModifiers();
    b2.SimpleName("Occurrences");
    b2.Types();
    b2.ComponentModifiers();
    b2.SimpleName("Occurrence");
    b2._CompositeEntity();
    b2.DataEntity_();
    b2.EntityModifiers();
    b2.SimpleName("Occurrence");
    b2.Types();
    b2.DataType("org.whole.lang.model.IEntity");
    b2._DataEntity();
    b2.MapEntity_();
    b2.EntityModifiers();
    b2.SimpleName("ValuesMap");
    b2.Types();
    b2.SimpleName("Value");
    b2.SimpleName("Values");
    b2._MapEntity();
    b2.CompositeEntity_();
    b2.EntityModifiers();
    b2.SimpleName("Values");
    b2.Types();
    b2.ComponentModifiers_(1);
    b2.ComponentModifier("unique");
    b2._ComponentModifiers();
    b2.SimpleName("Value");
    b2._CompositeEntity();
    b2.DataEntity_();
    b2.EntityModifiers();
    b2.SimpleName("Value");
    b2.Types();
    b2.DataType("String");
    b2._DataEntity();
    b2._ModelDeclarations();
    b2._Model();
    cb._SameStageFragment();
    b0._Misc();
}
Also used : IMiscBuilder(org.whole.lang.misc.builders.IMiscBuilder) IModelsBuilder(org.whole.lang.models.builders.IModelsBuilder) IArtifactsBuilder(org.whole.lang.artifacts.builders.IArtifactsBuilder)

Aggregations

IMiscBuilder (org.whole.lang.misc.builders.IMiscBuilder)2 IArtifactsBuilder (org.whole.lang.artifacts.builders.IArtifactsBuilder)1 IBuilder (org.whole.lang.builders.IBuilder)1 IBuilderFactory (org.whole.lang.builders.IBuilderFactory)1 IEntityContext (org.whole.lang.contexts.IEntityContext)1 MiscGenericBuilderAdapter (org.whole.lang.misc.builders.MiscGenericBuilderAdapter)1 MiscSpecificBuilderAdapter (org.whole.lang.misc.builders.MiscSpecificBuilderAdapter)1 MiscDynamicCompilerVisitor (org.whole.lang.misc.visitors.MiscDynamicCompilerVisitor)1 MiscOperationVisitor (org.whole.lang.misc.visitors.MiscOperationVisitor)1 IModelsBuilder (org.whole.lang.models.builders.IModelsBuilder)1 IOperation (org.whole.lang.operations.IOperation)1 IVisitor (org.whole.lang.visitors.IVisitor)1 IVisitorFactory (org.whole.lang.visitors.IVisitorFactory)1