Search in sources :

Example 1 with ICommonsBuilder

use of org.whole.lang.commons.builders.ICommonsBuilder in project whole by wholeplatform.

the class AttributesMatcherFactory method getQualifiedRefAttrPattern.

private static IEntity getQualifiedRefAttrPattern() {
    if (qualifiedRefAttrPattern == null) {
        ModelBuilderOperation mop = new ModelBuilderOperation();
        IXmlBuilder xb = (IXmlBuilder) mop.wGetBuilder(XmlLanguageKit.URI);
        ICommonsBuilder cb = (ICommonsBuilder) mop.wGetBuilder(CommonsLanguageKit.URI);
        xb.Attribute_();
        xb.QualifiedName_();
        cb.Variable_();
        cb.VarType("http://lang.whole.org/Xml#NameSpace");
        cb.VarName("xmlns");
        cb.Quantifier("!");
        cb._Variable();
        xb.Name("ref");
        xb._QualifiedName();
        cb.Variable_();
        cb.VarType("http://lang.whole.org/Xml#Value");
        cb.VarName("value");
        cb.Quantifier("!");
        cb._Variable();
        xb._Attribute();
        qualifiedRefAttrPattern = mop.wGetResult();
    }
    return qualifiedRefAttrPattern;
}
Also used : ModelBuilderOperation(org.whole.lang.builders.ModelBuilderOperation) IXmlBuilder(org.whole.lang.xml.builders.IXmlBuilder) ICommonsBuilder(org.whole.lang.commons.builders.ICommonsBuilder)

Example 2 with ICommonsBuilder

use of org.whole.lang.commons.builders.ICommonsBuilder in project whole by wholeplatform.

the class AttributesMatcherFactory method getNsDeclPattern.

private static IEntity getNsDeclPattern() {
    if (nsDeclPattern == null) {
        ModelBuilderOperation mop = new ModelBuilderOperation();
        IXmlBuilder xb = (IXmlBuilder) mop.wGetBuilder(XmlLanguageKit.URI);
        ICommonsBuilder cb = (ICommonsBuilder) mop.wGetBuilder(CommonsLanguageKit.URI);
        xb.Attribute_();
        xb.QualifiedName_();
        xb.NameSpace("xmlns");
        cb.Variable_();
        cb.VarType(XmlEntityDescriptorEnum.Name);
        cb.VarName("xmlns");
        cb.Quantifier(QuantifierEnum.MANDATORY);
        cb._Variable();
        xb._QualifiedName();
        cb.Variable_();
        cb.VarType(XmlEntityDescriptorEnum.Value);
        cb.VarName("uri");
        cb.Quantifier(QuantifierEnum.MANDATORY);
        cb._Variable();
        xb._Attribute();
        nsDeclPattern = mop.wGetResult();
    }
    return nsDeclPattern;
}
Also used : ModelBuilderOperation(org.whole.lang.builders.ModelBuilderOperation) IXmlBuilder(org.whole.lang.xml.builders.IXmlBuilder) ICommonsBuilder(org.whole.lang.commons.builders.ICommonsBuilder)

Example 3 with ICommonsBuilder

use of org.whole.lang.commons.builders.ICommonsBuilder in project whole by wholeplatform.

the class MatcherTest method buildArtifactsPattern.

public IEntity buildArtifactsPattern(boolean isPattern) {
    ModelBuilderOperation op = new ModelBuilderOperation();
    IArtifactsBuilder b0 = (IArtifactsBuilder) op.wGetBuilder(ArtifactsLanguageKit.URI);
    ICommonsBuilder cb = (ICommonsBuilder) op.wGetBuilder(CommonsLanguageKit.URI);
    b0.PackageArtifact_();
    b0.Name("org.whole.lang.models");
    cb.Resolver();
    b0.Artifacts_(1);
    b0.FileArtifact_();
    cb.Resolver();
    b0.Metadata_();
    b0.Copyright("Copyright 2004-2016 Riccardo Solmi.");
    if (isPattern)
        cb.Variable("licenseText", ArtifactsEntityDescriptorEnum.License, QuantifierEnum.MANDATORY);
    else
        b0.License("LGPL");
    b0.Author("Riccardo Solmi");
    b0._Metadata();
    cb.Resolver();
    b0._FileArtifact();
    b0._Artifacts();
    b0._PackageArtifact();
    return op.wGetResult();
}
Also used : ModelBuilderOperation(org.whole.lang.builders.ModelBuilderOperation) IArtifactsBuilder(org.whole.lang.artifacts.builders.IArtifactsBuilder) ICommonsBuilder(org.whole.lang.commons.builders.ICommonsBuilder)

Example 4 with ICommonsBuilder

use of org.whole.lang.commons.builders.ICommonsBuilder in project whole by wholeplatform.

the class ModelPattern method apply.

public void apply(IBuilderOperation op) {
    IModelsBuilder b0 = (IModelsBuilder) op.wGetBuilder(ModelsLanguageKit.URI);
    ICommonsBuilder cb = (ICommonsBuilder) op.wGetBuilder(CommonsLanguageKit.URI);
    b0.Model_();
    b0.SimpleName("Model1");
    b0.TypeRelations();
    b0.ModelDeclarations_(3);
    b0.SimpleEntity_();
    b0.EntityModifiers();
    b0.SimpleName("Entity1");
    b0.Types();
    b0.Features_(1);
    b0.Feature_();
    b0.FeatureModifiers();
    cb.Variable("dataEntity", "http://lang.whole.org/Models#SimpleName", "MANDATORY");
    b0.SimpleName("data1");
    b0._Feature();
    b0._Features();
    b0._SimpleEntity();
    b0.DataEntity_();
    b0.EntityModifiers();
    cb.Variable("dataEntity", "http://lang.whole.org/Models#SimpleName", "MANDATORY");
    b0.Types();
    cb.Variable("dataType", "http://lang.whole.org/Models#DataType", "MANDATORY");
    b0._DataEntity();
    cb.Variable("modelDeclaration", "http://lang.whole.org/Models#ModelDeclaration", "ZERO_OR_MORE_GREEDY");
    b0._ModelDeclarations();
    b0._Model();
}
Also used : IModelsBuilder(org.whole.lang.models.builders.IModelsBuilder) ICommonsBuilder(org.whole.lang.commons.builders.ICommonsBuilder)

Example 5 with ICommonsBuilder

use of org.whole.lang.commons.builders.ICommonsBuilder in project whole by wholeplatform.

the class SimpleEntityPattern method apply.

public void apply(IBuilderOperation op) {
    IModelsBuilder b0 = (IModelsBuilder) op.wGetBuilder(ModelsLanguageKit.URI);
    ICommonsBuilder cb = (ICommonsBuilder) op.wGetBuilder(CommonsLanguageKit.URI);
    b0.SimpleEntity_();
    b0.EntityModifiers();
    cb.Variable("entityName", "http://lang.whole.org/Models#SimpleName", "MANDATORY");
    b0.Types_();
    cb.Variable("type", "http://lang.whole.org/Models#SimpleName", "ZERO_OR_MORE_GREEDY");
    b0._Types();
    b0.Features_();
    cb.Variable("feature", "http://lang.whole.org/Models#Feature", "ZERO_OR_MORE_GREEDY");
    b0._Features();
    b0._SimpleEntity();
}
Also used : IModelsBuilder(org.whole.lang.models.builders.IModelsBuilder) ICommonsBuilder(org.whole.lang.commons.builders.ICommonsBuilder)

Aggregations

ICommonsBuilder (org.whole.lang.commons.builders.ICommonsBuilder)17 ModelBuilderOperation (org.whole.lang.builders.ModelBuilderOperation)8 IArtifactsBuilder (org.whole.lang.artifacts.builders.IArtifactsBuilder)5 IXmlBuilder (org.whole.lang.xml.builders.IXmlBuilder)5 IImpBuilder (org.whole.examples.lang.imp.builders.IImpBuilder)3 IModelsBuilder (org.whole.lang.models.builders.IModelsBuilder)3 IBuilder (org.whole.lang.builders.IBuilder)1 IBuilderFactory (org.whole.lang.builders.IBuilderFactory)1 CommonsGenericBuilderAdapter (org.whole.lang.commons.builders.CommonsGenericBuilderAdapter)1 CommonsSpecificBuilderAdapter (org.whole.lang.commons.builders.CommonsSpecificBuilderAdapter)1 CommonsContentAssistVisitor (org.whole.lang.commons.visitors.CommonsContentAssistVisitor)1 CommonsDynamicCompilerVisitor (org.whole.lang.commons.visitors.CommonsDynamicCompilerVisitor)1 CommonsInterpreterVisitor (org.whole.lang.commons.visitors.CommonsInterpreterVisitor)1 CommonsPrettyPrinterVisitor (org.whole.lang.commons.visitors.CommonsPrettyPrinterVisitor)1 IEntityContext (org.whole.lang.contexts.IEntityContext)1 IOperation (org.whole.lang.operations.IOperation)1 PrettyPrinterOperation (org.whole.lang.operations.PrettyPrinterOperation)1 AbstractTemplateFactory (org.whole.lang.templates.AbstractTemplateFactory)1 IVisitor (org.whole.lang.visitors.IVisitor)1 IVisitorFactory (org.whole.lang.visitors.IVisitorFactory)1