Search in sources :

Example 1 with GenericTypeInstance

use of org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.generics.GenericTypeInstance in project legend-pure by finos.

the class AntlrContextToM3CoreInstance method simpleProperty.

private void simpleProperty(PropertyContext ctx, MutableList<Property<? extends CoreInstance, ?>> properties, MutableList<String> typeParameterNames, MutableList<String> multiplicityParameterNames, ImportStub isOwner, ImportGroup importId, boolean addLines) {
    ListIterable<CoreInstance> stereotypes = null;
    ListIterable<TaggedValue> tags = null;
    DefaultValue defaultValue = null;
    GenericType genericType;
    Multiplicity multiplicity;
    String aggregation;
    String propertyName = ctx.identifier().getText();
    if (ctx.stereotypes() != null) {
        stereotypes = this.stereotypes(ctx.stereotypes(), importId);
    }
    if (ctx.taggedValues() != null) {
        tags = this.taggedValues(ctx.taggedValues(), importId);
    }
    if (ctx.aggregation() != null) {
        if ("(composite)".equals(ctx.aggregation().getText())) {
            aggregation = "Composite";
        } else if ("(shared)".equals(ctx.aggregation().getText())) {
            aggregation = "Shared";
        } else {
            aggregation = "None";
        }
    } else {
        aggregation = "None";
    }
    if (ctx.defaultValue() != null) {
        defaultValue = defaultValue(ctx.defaultValue(), importId, propertyName);
    }
    genericType = this.type(ctx.propertyReturnType().type(), typeParameterNames, "", importId, addLines);
    multiplicity = this.buildMultiplicity(ctx.propertyReturnType().multiplicity().multiplicityArgument());
    Enumeration<?> agg = (Enumeration<?>) this.processorSupport.package_getByUserPath(M3Paths.AggregationKind);
    Enum aggKind = (Enum) agg._values().detect(v -> aggregation.equals(((Enum) v).getName()));
    SourceInformation propertySourceInfo = this.sourceInformation.getPureSourceInformation(ctx.identifier().getStart(), ctx.identifier().getStart(), ctx.getStop());
    PropertyInstance propertyInstance = PropertyInstance.createPersistent(this.repository, propertyName, propertySourceInfo, aggKind, genericType, multiplicity, null);
    propertyInstance._stereotypesCoreInstance(stereotypes);
    propertyInstance._taggedValues(tags);
    propertyInstance._name(propertyName);
    propertyInstance._defaultValue(defaultValue);
    GenericTypeInstance classifierGT = GenericTypeInstance.createPersistent(this.repository, propertySourceInfo);
    ClassInstance propertyType = (ClassInstance) this.processorSupport.package_getByUserPath(M3Paths.Property);
    classifierGT._rawTypeCoreInstance(propertyType);
    classifierGT._multiplicityArguments(Lists.mutable.of(multiplicity));
    GenericTypeInstance classifierGTTA = GenericTypeInstance.createPersistent(this.repository);
    classifierGTTA._rawTypeCoreInstance(isOwner);
    if (!typeParameterNames.isEmpty()) {
        MutableList<GenericType> typeArgs = Lists.mutable.of();
        for (String typeParamName : typeParameterNames) {
            TypeParameterInstance tp = TypeParameterInstance.createPersistent(this.repository, typeParamName);
            GenericTypeInstance gt = GenericTypeInstance.createPersistent(this.repository);
            gt._typeParameter(tp);
            typeArgs.add(gt);
        }
        classifierGTTA._typeArguments(typeArgs);
    }
    if (!multiplicityParameterNames.isEmpty()) {
        MutableList<Multiplicity> multParameters = Lists.mutable.of();
        for (String multiplicityParam : multiplicityParameterNames) {
            MultiplicityInstance mult = MultiplicityInstance.createPersistent(this.repository, null, null);
            mult._multiplicityParameter(multiplicityParam);
            multParameters.add(mult);
        }
        classifierGTTA._multiplicityArguments(multParameters);
    }
    // Clone generic type
    // TODO - do we need a deep clone?
    GenericTypeInstance ngt = GenericTypeInstance.createPersistent(this.repository, genericType.getSourceInformation());
    CoreInstance rawType = genericType._rawTypeCoreInstance();
    if (rawType != null) {
        if (rawType instanceof ImportStub) {
            ImportStub gtis = (ImportStub) rawType;
            ImportStubInstance is = ImportStubInstance.createPersistent(this.repository, gtis.getSourceInformation(), gtis._idOrPath(), gtis._importGroup());
            // ImportStubInstance is = ImportStubInstance.createPersistent(this.repository, gtis.getSourceInformation(), ((ImportStubInstance)gtis)._idOrPathAsCoreInstance().getName(), (ImportGroup)gtis._importGroup());
            ngt._rawTypeCoreInstance(is);
        } else {
            ngt._rawTypeCoreInstance(rawType);
        }
    }
    if (!genericType._typeArguments().isEmpty()) {
        ngt._typeArguments(genericType._typeArguments());
    }
    ngt._typeParameter(genericType._typeParameter());
    if (!genericType._multiplicityArguments().isEmpty()) {
        ngt._multiplicityArguments(genericType._multiplicityArguments());
    }
    classifierGT._typeArguments(Lists.mutable.<GenericType>of(classifierGTTA, ngt));
    propertyInstance._classifierGenericType(classifierGT);
    properties.add(propertyInstance);
}
Also used : Enum(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.Enum) RootRouteNodeInstance(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.treepath.RootRouteNodeInstance) StereotypesContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.StereotypesContext) NotExpressionContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.NotExpressionContext) MultiplicityArgumentContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.MultiplicityArgumentContext) InstanceValueInstance(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.valuespecification.InstanceValueInstance) TaggedValueContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.TaggedValueContext) ExpressionInstanceContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.ExpressionInstanceContext) EnumDefinitionContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.EnumDefinitionContext) InlineDSL(org.finos.legend.pure.m3.serialization.grammar.m3parser.inlinedsl.InlineDSL) LambdaPipeContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.LambdaPipeContext) InstanceAtomicRightSideContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.InstanceAtomicRightSideContext) ContravarianceTypeParameterContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.ContravarianceTypeParameterContext) LambdaParamTypeContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.LambdaParamTypeContext) ClassDefinitionContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.ClassDefinitionContext) Iterate(org.eclipse.collections.impl.utility.Iterate) Enum(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.Enum) PropertyRouteNode(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.treepath.PropertyRouteNode) Import_statementContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.Import_statementContext) GeneralizationInstance(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.relationship.GeneralizationInstance) ListIterable(org.eclipse.collections.api.list.ListIterable) ConcreteFunctionDefinitionInstance(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.function.ConcreteFunctionDefinitionInstance) TypeParameterInstance(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.generics.TypeParameterInstance) PrimitiveCoreInstance(org.finos.legend.pure.m4.coreinstance.primitive.PrimitiveCoreInstance) IdentifierContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.IdentifierContext) PackagePathContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.PackagePathContext) Function(org.eclipse.collections.api.block.function.Function) MutableStack(org.eclipse.collections.api.stack.MutableStack) FunctionTypeSignatureContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.FunctionTypeSignatureContext) ExpressionContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.ExpressionContext) M3Paths(org.finos.legend.pure.m3.navigation.M3Paths) TreePathContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.TreePathContext) ProfileInstance(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.extension.ProfileInstance) ProfileContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.ProfileContext) TypeParameterContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.TypeParameterContext) MutableMap(org.eclipse.collections.api.map.MutableMap) Package(org.finos.legend.pure.m3.coreinstance.Package) LambdaFunctionInstance(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.function.LambdaFunctionInstance) InstanceLiteralContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.InstanceLiteralContext) Sets(org.eclipse.collections.api.factory.Sets) TagInstance(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.extension.TagInstance) LetExpressionContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.LetExpressionContext) ConstraintsContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.ConstraintsContext) FunctionExpressionParametersContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.FunctionExpressionParametersContext) StereotypeInstance(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.extension.StereotypeInstance) PureParserException(org.finos.legend.pure.m4.serialization.grammar.antlr.PureParserException) InstanceRightSideContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.InstanceRightSideContext) MappingLineContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.MappingLineContext) MappingContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.MappingContext) ListIterate(org.eclipse.collections.impl.utility.ListIterate) ValueSpecification(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.valuespecification.ValueSpecification) StereotypeDefinitionsContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.StereotypeDefinitionsContext) QualifiedNameContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.QualifiedNameContext) AssociationInstance(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.relationship.AssociationInstance) AntlrSourceInformation(org.finos.legend.pure.m4.serialization.grammar.antlr.AntlrSourceInformation) ExistingPropertyRouteNode(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.treepath.ExistingPropertyRouteNode) ExpressionInstanceAtomicRightSideContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.ExpressionInstanceAtomicRightSideContext) AssociationProjectionContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.AssociationProjectionContext) ConstraintInstance(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.constraint.ConstraintInstance) Stacks(org.eclipse.collections.api.factory.Stacks) Constraint(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.constraint.Constraint) SimpleFunctionExpression(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.valuespecification.SimpleFunctionExpression) EnumValueContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.EnumValueContext) Tag(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.extension.Tag) Interval(org.antlr.v4.runtime.misc.Interval) NativeFunctionContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.NativeFunctionContext) Predicate2(org.eclipse.collections.api.block.predicate.Predicate2) Generalization(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.relationship.Generalization) BuildMilestoningVariableExpressionContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.BuildMilestoningVariableExpressionContext) MutableList(org.eclipse.collections.api.list.MutableList) MultiplicityInstance(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.multiplicity.MultiplicityInstance) PropertyExpressionContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.PropertyExpressionContext) Maps(org.eclipse.collections.api.factory.Maps) MutableSet(org.eclipse.collections.api.set.MutableSet) FunctionType(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.FunctionType) InstanceContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.InstanceContext) DefinitionContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.DefinitionContext) ImportStub(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel._import.ImportStub) BooleanPartContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.BooleanPartContext) ExpressionOrExpressionGroupContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.ExpressionOrExpressionGroupContext) TaggedValue(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.extension.TaggedValue) QualifiedPropertyContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.QualifiedPropertyContext) TypeContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.TypeContext) ListAdapter(org.eclipse.collections.impl.list.mutable.ListAdapter) SourceState(org.finos.legend.pure.m3.serialization.runtime.SourceState) DefaultValueExpressionContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.DefaultValueExpressionContext) PackageableElement(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.PackageableElement) Multiplicity(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.multiplicity.Multiplicity) Unit(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.Unit) QualifiedProperty(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.function.property.QualifiedProperty) TaggedValueInstance(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.extension.TaggedValueInstance) RouteNode(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.treepath.RouteNode) DefaultValueInstance(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.function.property.DefaultValueInstance) ProgramLineContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.ProgramLineContext) CombinedArithmeticOnlyContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.CombinedArithmeticOnlyContext) InstanceReferenceContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.InstanceReferenceContext) TaggedValuesContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.TaggedValuesContext) ImportInstance(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel._import.ImportInstance) CodeBlockContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.CodeBlockContext) Any(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.Any) ArithmeticPartContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.ArithmeticPartContext) Type(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.Type) InlineDSLTextContent(org.finos.legend.pure.m3.serialization.grammar.m3parser.inlinedsl.InlineDSLTextContent) FunctionVariableExpressionContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.FunctionVariableExpressionContext) CombinedExpressionContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.CombinedExpressionContext) ExistingPropertyRouteNodeInstance(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.treepath.ExistingPropertyRouteNodeInstance) SimpleFunctionExpressionInstance(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.valuespecification.SimpleFunctionExpressionInstance) ExpressionInstanceRightSideContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.ExpressionInstanceRightSideContext) NativeFunctionInstance(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.function.NativeFunctionInstance) InstanceLiteralTokenContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.InstanceLiteralTokenContext) AssociationContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.AssociationContext) EnumStubInstance(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel._import.EnumStubInstance) PropertyStubInstance(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel._import.PropertyStubInstance) DslContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.DslContext) Token(org.antlr.v4.runtime.Token) ImportGroup(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel._import.ImportGroup) VariableContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.VariableContext) TypeParameter(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.generics.TypeParameter) RichIterable(org.eclipse.collections.api.RichIterable) TreePathClassBodyContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.TreePathClassBodyContext) StringEscapeUtils(org.apache.commons.lang3.StringEscapeUtils) EqualNotEqualContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.EqualNotEqualContext) QualifiedPropertyInstance(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.function.property.QualifiedPropertyInstance) ModelRepository(org.finos.legend.pure.m4.ModelRepository) DefaultValue(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.function.property.DefaultValue) TerminalNode(org.antlr.v4.runtime.tree.TerminalNode) SourceAndTargetMappingIdContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.SourceAndTargetMappingIdContext) GenericType(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.generics.GenericType) FunctionDefinitionContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.FunctionDefinitionContext) DerivedPropertyContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.DerivedPropertyContext) DefaultValueContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.DefaultValueContext) NewPropertyRouteNodeFunctionDefinition(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.treepath.NewPropertyRouteNodeFunctionDefinition) GenericTypeInstance(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.generics.GenericTypeInstance) Instance(org.finos.legend.pure.m3.navigation.Instance) ImportsContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.ImportsContext) Lists(org.eclipse.collections.api.factory.Lists) RootRouteNode(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.treepath.RootRouteNode) MilestoningClassProcessor(org.finos.legend.pure.m3.compiler.postprocessing.processor.milestoning.MilestoningClassProcessor) NewPropertyRouteNodeInstance(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.treepath.NewPropertyRouteNodeInstance) FunctionTypeInstance(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.FunctionTypeInstance) TreePathPropertyParameterTypeContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.TreePathPropertyParameterTypeContext) RuleContext(org.antlr.v4.runtime.RuleContext) FastList(org.eclipse.collections.impl.list.mutable.FastList) InlineDSLLibrary(org.finos.legend.pure.m3.serialization.grammar.m3parser.inlinedsl.InlineDSLLibrary) InstancePropertyAssignmentContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.InstancePropertyAssignmentContext) PackageInstance(org.finos.legend.pure.m3.coreinstance.PackageInstance) TagDefinitionsContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.TagDefinitionsContext) Stereotype(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.extension.Stereotype) ExpressionPartContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.ExpressionPartContext) SourceInformation(org.finos.legend.pure.m4.coreinstance.SourceInformation) AllOrFunctionContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.AllOrFunctionContext) ClassInstance(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.ClassInstance) CoreInstance(org.finos.legend.pure.m4.coreinstance.CoreInstance) VariableExpressionInstance(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.valuespecification.VariableExpressionInstance) PropertiesContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.PropertiesContext) InstanceValue(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.valuespecification.InstanceValue) ClassProjectionInstance(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.ClassProjectionInstance) PropertyRefContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.PropertyRefContext) PropertyStub(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel._import.PropertyStub) ComplexPropertyContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.ComplexPropertyContext) Source(org.finos.legend.pure.m3.serialization.runtime.Source) AtomicExpressionContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.AtomicExpressionContext) TypeArgumentsContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.TypeArgumentsContext) TypeParametersWithContravarianceAndMultiplicityParametersContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.TypeParametersWithContravarianceAndMultiplicityParametersContext) MultiplicityArgumentsContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.MultiplicityArgumentsContext) AssociationProjectionInstance(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.relationship.AssociationProjectionInstance) ExpressionInstanceParserPropertyAssignmentContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.ExpressionInstanceParserPropertyAssignmentContext) UnitInstance(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.UnitInstance) ProcessorSupport(org.finos.legend.pure.m3.navigation.ProcessorSupport) ImportGroupInstance(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel._import.ImportGroupInstance) Property(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.function.property.Property) Tuples(org.eclipse.collections.impl.tuple.Tuples) Import(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel._import.Import) TypeAndMultiplicityParametersContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.TypeAndMultiplicityParametersContext) MultiplicityValueInstance(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.multiplicity.MultiplicityValueInstance) KeyExpressionInstance(org.finos.legend.pure.m3.coreinstance.meta.pure.functions.lang.KeyExpressionInstance) List(java.util.List) SimplePropertyContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.SimplePropertyContext) org.finos.legend.pure.m3.navigation._package._Package(org.finos.legend.pure.m3.navigation._package._Package) VariableExpression(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.valuespecification.VariableExpression) StereotypeContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.StereotypeContext) ConstraintContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.ConstraintContext) Context(org.finos.legend.pure.m3.compiler.Context) SignedExpressionContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.SignedExpressionContext) Function0(org.eclipse.collections.api.block.function.Function0) PropertyContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.PropertyContext) RouteNodePropertyStub(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.treepath.RouteNodePropertyStub) PropertyInstance(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.function.property.PropertyInstance) Pair(org.eclipse.collections.api.tuple.Pair) MeasureInstance(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.MeasureInstance) Enumeration(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.Enumeration) EnumerationInstance(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.EnumerationInstance) NewPropertyRouteNode(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.treepath.NewPropertyRouteNode) RouteNodePropertyStubInstance(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.treepath.RouteNodePropertyStubInstance) ImportStubInstance(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel._import.ImportStubInstance) FunctionTypePureTypeContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.FunctionTypePureTypeContext) LambdaFunction(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.function.LambdaFunction) NewPropertyRouteNodeFunctionDefinitionInstance(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.treepath.NewPropertyRouteNodeFunctionDefinitionInstance) M3Properties(org.finos.legend.pure.m3.navigation.M3Properties) PropertyOrFunctionExpressionContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.PropertyOrFunctionExpressionContext) GenericTypeInstance(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.generics.GenericTypeInstance) GenericType(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.generics.GenericType) TypeParameterInstance(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.generics.TypeParameterInstance) Enumeration(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.Enumeration) TaggedValue(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.extension.TaggedValue) QualifiedPropertyInstance(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.function.property.QualifiedPropertyInstance) PropertyInstance(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.function.property.PropertyInstance) ImportStub(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel._import.ImportStub) AntlrSourceInformation(org.finos.legend.pure.m4.serialization.grammar.antlr.AntlrSourceInformation) SourceInformation(org.finos.legend.pure.m4.coreinstance.SourceInformation) DefaultValue(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.function.property.DefaultValue) Multiplicity(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.multiplicity.Multiplicity) MultiplicityInstance(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.multiplicity.MultiplicityInstance) PrimitiveCoreInstance(org.finos.legend.pure.m4.coreinstance.primitive.PrimitiveCoreInstance) CoreInstance(org.finos.legend.pure.m4.coreinstance.CoreInstance) ImportStubInstance(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel._import.ImportStubInstance) ClassInstance(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.ClassInstance)

Example 2 with GenericTypeInstance

use of org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.generics.GenericTypeInstance in project legend-pure by finos.

the class AntlrContextToM3CoreInstance method nativeFunction.

private void nativeFunction(NativeFunctionContext ctx, ImportGroup importId, String space, MutableList<CoreInstance> coreInstancesResult) {
    this.functionCounter++;
    NativeFunctionInstance function = NativeFunctionInstance.createPersistent(this.repository, ctx.qualifiedName().identifier().getText() + this.functionCounter, this.sourceInformation.getPureSourceInformation(ctx.NATIVE().getSymbol(), ctx.qualifiedName().identifier().getStart(), ctx.END_LINE().getSymbol()));
    MutableList<String> typeParametersNames = Lists.mutable.empty();
    MutableList<String> multiplicityParametersNames = Lists.mutable.empty();
    if (ctx.typeAndMultiplicityParameters() != null) {
        this.typeParametersAndMultiplicityParameters(ctx.typeAndMultiplicityParameters(), typeParametersNames, multiplicityParametersNames);
    }
    FunctionType signature = functionTypeSignature(ctx.functionTypeSignature(), function, typeParametersNames, multiplicityParametersNames, importId, spacePlusTabs(space, 1));
    function._functionName(ctx.qualifiedName().identifier().getText());
    PackageInstance packageInstance = this.buildPackage(ctx.qualifiedName().packagePath());
    function._package(packageInstance);
    packageInstance._childrenAdd(function);
    GenericTypeInstance genericTypeInstance = GenericTypeInstance.createPersistent(this.repository);
    Type type = (Type) this.processorSupport.package_getByUserPath(M3Paths.NativeFunction);
    genericTypeInstance._rawTypeCoreInstance(type);
    GenericTypeInstance genericTypeInstanceTa = GenericTypeInstance.createPersistent(this.repository);
    genericTypeInstanceTa._rawTypeCoreInstance(signature);
    genericTypeInstance._typeArguments(Lists.mutable.<GenericType>of(genericTypeInstanceTa));
    function._classifierGenericType(genericTypeInstance);
    coreInstancesResult.add(function);
}
Also used : PackageInstance(org.finos.legend.pure.m3.coreinstance.PackageInstance) GenericTypeInstance(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.generics.GenericTypeInstance) FunctionType(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.FunctionType) Type(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.Type) GenericType(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.generics.GenericType) FunctionType(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.FunctionType) NativeFunctionInstance(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.function.NativeFunctionInstance)

Example 3 with GenericTypeInstance

use of org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.generics.GenericTypeInstance in project legend-pure by finos.

the class AntlrContextToM3CoreInstance method propertyExpression.

private CoreInstance propertyExpression(PropertyExpressionContext ctx, CoreInstance result, MutableList<ValueSpecification> parameters, MutableList<String> typeParametersNames, LambdaContext lambdaContext, String space, ImportGroup importId) {
    parameters.clear();
    boolean function = false;
    IdentifierContext property = ctx.identifier();
    CoreInstance parameter;
    if (ctx.functionExpressionParameters() != null) {
        function = true;
        FunctionExpressionParametersContext fepCtx = ctx.functionExpressionParameters();
        if (fepCtx.combinedExpression() != null) {
            for (CombinedExpressionContext ceCtx : fepCtx.combinedExpression()) {
                parameter = this.combinedExpression(ceCtx, "param", typeParametersNames, lambdaContext, spacePlusTabs(space, 4), true, importId, addLines);
                parameters.add((ValueSpecification) parameter);
            }
        }
    } else if (ctx.functionExpressionLatestMilestoningDateParameter() != null) {
        function = true;
        ListIterate.collect(ctx.functionExpressionLatestMilestoningDateParameter().LATEST_DATE(), terminalNode -> InstanceValueInstance.createPersistent(repository, sourceInformation.getPureSourceInformation(terminalNode.getSymbol()), null, null)._values(Lists.immutable.with(repository.newLatestDateCoreInstance())), parameters);
    }
    if (!function) {
        SimpleFunctionExpressionInstance sfe = SimpleFunctionExpressionInstance.createPersistent(this.repository, this.sourceInformation.getPureSourceInformation(property.getStart()), null, null, importId, null);
        InstanceValue instanceValue = this.doWrap(property, false);
        // Going to become an auto-map lambda so set a name to be used for the lambda
        instanceValue.setName(lambdaContext.getLambdaFunctionUniqueName());
        instanceValue._multiplicity(this.getPureOne());
        GenericTypeInstance gt = GenericTypeInstance.createPersistent(this.repository);
        Type ti = (Type) this.processorSupport.package_getByUserPath("String");
        gt._rawTypeCoreInstance(ti);
        instanceValue._genericType(gt);
        sfe._propertyName(instanceValue);
        sfe._parametersValues(Lists.mutable.of((ValueSpecification) result));
        result = sfe;
    } else {
        SimpleFunctionExpressionInstance sfe = SimpleFunctionExpressionInstance.createPersistent(this.repository, this.sourceInformation.getPureSourceInformation(property.getStart()), null, null, importId, null);
        InstanceValue instanceValue = this.doWrap(property, false);
        // Going to become an auto-map lambda so set a name to be used for the lambda
        instanceValue.setName(lambdaContext.getLambdaFunctionUniqueName());
        instanceValue._multiplicity(this.getPureOne());
        GenericTypeInstance gt = GenericTypeInstance.createPersistent(this.repository);
        Type ti = (Type) this.processorSupport.package_getByUserPath("String");
        gt._rawTypeCoreInstance(ti);
        instanceValue._genericType(gt);
        sfe._qualifiedPropertyName(instanceValue);
        sfe._parametersValues(Lists.mutable.of((ValueSpecification) result).withAll(parameters));
        result = sfe;
    }
    return result;
}
Also used : RootRouteNodeInstance(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.treepath.RootRouteNodeInstance) StereotypesContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.StereotypesContext) NotExpressionContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.NotExpressionContext) MultiplicityArgumentContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.MultiplicityArgumentContext) InstanceValueInstance(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.valuespecification.InstanceValueInstance) TaggedValueContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.TaggedValueContext) ExpressionInstanceContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.ExpressionInstanceContext) EnumDefinitionContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.EnumDefinitionContext) InlineDSL(org.finos.legend.pure.m3.serialization.grammar.m3parser.inlinedsl.InlineDSL) LambdaPipeContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.LambdaPipeContext) InstanceAtomicRightSideContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.InstanceAtomicRightSideContext) ContravarianceTypeParameterContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.ContravarianceTypeParameterContext) LambdaParamTypeContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.LambdaParamTypeContext) ClassDefinitionContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.ClassDefinitionContext) Iterate(org.eclipse.collections.impl.utility.Iterate) Enum(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.Enum) PropertyRouteNode(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.treepath.PropertyRouteNode) Import_statementContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.Import_statementContext) GeneralizationInstance(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.relationship.GeneralizationInstance) ListIterable(org.eclipse.collections.api.list.ListIterable) ConcreteFunctionDefinitionInstance(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.function.ConcreteFunctionDefinitionInstance) TypeParameterInstance(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.generics.TypeParameterInstance) PrimitiveCoreInstance(org.finos.legend.pure.m4.coreinstance.primitive.PrimitiveCoreInstance) IdentifierContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.IdentifierContext) PackagePathContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.PackagePathContext) Function(org.eclipse.collections.api.block.function.Function) MutableStack(org.eclipse.collections.api.stack.MutableStack) FunctionTypeSignatureContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.FunctionTypeSignatureContext) ExpressionContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.ExpressionContext) M3Paths(org.finos.legend.pure.m3.navigation.M3Paths) TreePathContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.TreePathContext) ProfileInstance(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.extension.ProfileInstance) ProfileContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.ProfileContext) TypeParameterContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.TypeParameterContext) MutableMap(org.eclipse.collections.api.map.MutableMap) Package(org.finos.legend.pure.m3.coreinstance.Package) LambdaFunctionInstance(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.function.LambdaFunctionInstance) InstanceLiteralContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.InstanceLiteralContext) Sets(org.eclipse.collections.api.factory.Sets) TagInstance(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.extension.TagInstance) LetExpressionContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.LetExpressionContext) ConstraintsContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.ConstraintsContext) FunctionExpressionParametersContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.FunctionExpressionParametersContext) StereotypeInstance(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.extension.StereotypeInstance) PureParserException(org.finos.legend.pure.m4.serialization.grammar.antlr.PureParserException) InstanceRightSideContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.InstanceRightSideContext) MappingLineContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.MappingLineContext) MappingContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.MappingContext) ListIterate(org.eclipse.collections.impl.utility.ListIterate) ValueSpecification(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.valuespecification.ValueSpecification) StereotypeDefinitionsContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.StereotypeDefinitionsContext) QualifiedNameContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.QualifiedNameContext) AssociationInstance(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.relationship.AssociationInstance) AntlrSourceInformation(org.finos.legend.pure.m4.serialization.grammar.antlr.AntlrSourceInformation) ExistingPropertyRouteNode(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.treepath.ExistingPropertyRouteNode) ExpressionInstanceAtomicRightSideContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.ExpressionInstanceAtomicRightSideContext) AssociationProjectionContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.AssociationProjectionContext) ConstraintInstance(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.constraint.ConstraintInstance) Stacks(org.eclipse.collections.api.factory.Stacks) Constraint(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.constraint.Constraint) SimpleFunctionExpression(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.valuespecification.SimpleFunctionExpression) EnumValueContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.EnumValueContext) Tag(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.extension.Tag) Interval(org.antlr.v4.runtime.misc.Interval) NativeFunctionContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.NativeFunctionContext) Predicate2(org.eclipse.collections.api.block.predicate.Predicate2) Generalization(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.relationship.Generalization) BuildMilestoningVariableExpressionContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.BuildMilestoningVariableExpressionContext) MutableList(org.eclipse.collections.api.list.MutableList) MultiplicityInstance(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.multiplicity.MultiplicityInstance) PropertyExpressionContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.PropertyExpressionContext) Maps(org.eclipse.collections.api.factory.Maps) MutableSet(org.eclipse.collections.api.set.MutableSet) FunctionType(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.FunctionType) InstanceContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.InstanceContext) DefinitionContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.DefinitionContext) ImportStub(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel._import.ImportStub) BooleanPartContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.BooleanPartContext) ExpressionOrExpressionGroupContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.ExpressionOrExpressionGroupContext) TaggedValue(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.extension.TaggedValue) QualifiedPropertyContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.QualifiedPropertyContext) TypeContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.TypeContext) ListAdapter(org.eclipse.collections.impl.list.mutable.ListAdapter) SourceState(org.finos.legend.pure.m3.serialization.runtime.SourceState) DefaultValueExpressionContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.DefaultValueExpressionContext) PackageableElement(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.PackageableElement) Multiplicity(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.multiplicity.Multiplicity) Unit(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.Unit) QualifiedProperty(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.function.property.QualifiedProperty) TaggedValueInstance(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.extension.TaggedValueInstance) RouteNode(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.treepath.RouteNode) DefaultValueInstance(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.function.property.DefaultValueInstance) ProgramLineContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.ProgramLineContext) CombinedArithmeticOnlyContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.CombinedArithmeticOnlyContext) InstanceReferenceContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.InstanceReferenceContext) TaggedValuesContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.TaggedValuesContext) ImportInstance(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel._import.ImportInstance) CodeBlockContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.CodeBlockContext) Any(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.Any) ArithmeticPartContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.ArithmeticPartContext) Type(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.Type) InlineDSLTextContent(org.finos.legend.pure.m3.serialization.grammar.m3parser.inlinedsl.InlineDSLTextContent) FunctionVariableExpressionContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.FunctionVariableExpressionContext) CombinedExpressionContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.CombinedExpressionContext) ExistingPropertyRouteNodeInstance(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.treepath.ExistingPropertyRouteNodeInstance) SimpleFunctionExpressionInstance(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.valuespecification.SimpleFunctionExpressionInstance) ExpressionInstanceRightSideContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.ExpressionInstanceRightSideContext) NativeFunctionInstance(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.function.NativeFunctionInstance) InstanceLiteralTokenContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.InstanceLiteralTokenContext) AssociationContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.AssociationContext) EnumStubInstance(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel._import.EnumStubInstance) PropertyStubInstance(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel._import.PropertyStubInstance) DslContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.DslContext) Token(org.antlr.v4.runtime.Token) ImportGroup(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel._import.ImportGroup) VariableContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.VariableContext) TypeParameter(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.generics.TypeParameter) RichIterable(org.eclipse.collections.api.RichIterable) TreePathClassBodyContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.TreePathClassBodyContext) StringEscapeUtils(org.apache.commons.lang3.StringEscapeUtils) EqualNotEqualContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.EqualNotEqualContext) QualifiedPropertyInstance(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.function.property.QualifiedPropertyInstance) ModelRepository(org.finos.legend.pure.m4.ModelRepository) DefaultValue(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.function.property.DefaultValue) TerminalNode(org.antlr.v4.runtime.tree.TerminalNode) SourceAndTargetMappingIdContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.SourceAndTargetMappingIdContext) GenericType(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.generics.GenericType) FunctionDefinitionContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.FunctionDefinitionContext) DerivedPropertyContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.DerivedPropertyContext) DefaultValueContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.DefaultValueContext) NewPropertyRouteNodeFunctionDefinition(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.treepath.NewPropertyRouteNodeFunctionDefinition) GenericTypeInstance(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.generics.GenericTypeInstance) Instance(org.finos.legend.pure.m3.navigation.Instance) ImportsContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.ImportsContext) Lists(org.eclipse.collections.api.factory.Lists) RootRouteNode(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.treepath.RootRouteNode) MilestoningClassProcessor(org.finos.legend.pure.m3.compiler.postprocessing.processor.milestoning.MilestoningClassProcessor) NewPropertyRouteNodeInstance(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.treepath.NewPropertyRouteNodeInstance) FunctionTypeInstance(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.FunctionTypeInstance) TreePathPropertyParameterTypeContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.TreePathPropertyParameterTypeContext) RuleContext(org.antlr.v4.runtime.RuleContext) FastList(org.eclipse.collections.impl.list.mutable.FastList) InlineDSLLibrary(org.finos.legend.pure.m3.serialization.grammar.m3parser.inlinedsl.InlineDSLLibrary) InstancePropertyAssignmentContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.InstancePropertyAssignmentContext) PackageInstance(org.finos.legend.pure.m3.coreinstance.PackageInstance) TagDefinitionsContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.TagDefinitionsContext) Stereotype(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.extension.Stereotype) ExpressionPartContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.ExpressionPartContext) SourceInformation(org.finos.legend.pure.m4.coreinstance.SourceInformation) AllOrFunctionContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.AllOrFunctionContext) ClassInstance(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.ClassInstance) CoreInstance(org.finos.legend.pure.m4.coreinstance.CoreInstance) VariableExpressionInstance(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.valuespecification.VariableExpressionInstance) PropertiesContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.PropertiesContext) InstanceValue(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.valuespecification.InstanceValue) ClassProjectionInstance(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.ClassProjectionInstance) PropertyRefContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.PropertyRefContext) PropertyStub(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel._import.PropertyStub) ComplexPropertyContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.ComplexPropertyContext) Source(org.finos.legend.pure.m3.serialization.runtime.Source) AtomicExpressionContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.AtomicExpressionContext) TypeArgumentsContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.TypeArgumentsContext) TypeParametersWithContravarianceAndMultiplicityParametersContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.TypeParametersWithContravarianceAndMultiplicityParametersContext) MultiplicityArgumentsContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.MultiplicityArgumentsContext) AssociationProjectionInstance(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.relationship.AssociationProjectionInstance) ExpressionInstanceParserPropertyAssignmentContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.ExpressionInstanceParserPropertyAssignmentContext) UnitInstance(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.UnitInstance) ProcessorSupport(org.finos.legend.pure.m3.navigation.ProcessorSupport) ImportGroupInstance(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel._import.ImportGroupInstance) Property(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.function.property.Property) Tuples(org.eclipse.collections.impl.tuple.Tuples) Import(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel._import.Import) TypeAndMultiplicityParametersContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.TypeAndMultiplicityParametersContext) MultiplicityValueInstance(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.multiplicity.MultiplicityValueInstance) KeyExpressionInstance(org.finos.legend.pure.m3.coreinstance.meta.pure.functions.lang.KeyExpressionInstance) List(java.util.List) SimplePropertyContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.SimplePropertyContext) org.finos.legend.pure.m3.navigation._package._Package(org.finos.legend.pure.m3.navigation._package._Package) VariableExpression(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.valuespecification.VariableExpression) StereotypeContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.StereotypeContext) ConstraintContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.ConstraintContext) Context(org.finos.legend.pure.m3.compiler.Context) SignedExpressionContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.SignedExpressionContext) Function0(org.eclipse.collections.api.block.function.Function0) PropertyContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.PropertyContext) RouteNodePropertyStub(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.treepath.RouteNodePropertyStub) PropertyInstance(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.function.property.PropertyInstance) Pair(org.eclipse.collections.api.tuple.Pair) MeasureInstance(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.MeasureInstance) Enumeration(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.Enumeration) EnumerationInstance(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.EnumerationInstance) NewPropertyRouteNode(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.treepath.NewPropertyRouteNode) RouteNodePropertyStubInstance(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.treepath.RouteNodePropertyStubInstance) ImportStubInstance(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel._import.ImportStubInstance) FunctionTypePureTypeContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.FunctionTypePureTypeContext) LambdaFunction(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.function.LambdaFunction) NewPropertyRouteNodeFunctionDefinitionInstance(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.treepath.NewPropertyRouteNodeFunctionDefinitionInstance) M3Properties(org.finos.legend.pure.m3.navigation.M3Properties) PropertyOrFunctionExpressionContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.PropertyOrFunctionExpressionContext) GenericTypeInstance(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.generics.GenericTypeInstance) FunctionType(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.FunctionType) Type(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.Type) GenericType(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.generics.GenericType) FunctionExpressionParametersContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.FunctionExpressionParametersContext) SimpleFunctionExpressionInstance(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.valuespecification.SimpleFunctionExpressionInstance) PrimitiveCoreInstance(org.finos.legend.pure.m4.coreinstance.primitive.PrimitiveCoreInstance) CoreInstance(org.finos.legend.pure.m4.coreinstance.CoreInstance) ValueSpecification(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.valuespecification.ValueSpecification) InstanceValue(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.valuespecification.InstanceValue) CombinedExpressionContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.CombinedExpressionContext) IdentifierContext(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.IdentifierContext)

Example 4 with GenericTypeInstance

use of org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.generics.GenericTypeInstance in project legend-pure by finos.

the class AntlrContextToM3CoreInstance method qualifiedProperty.

private void qualifiedProperty(QualifiedPropertyContext ctx, MutableList<QualifiedProperty<? extends CoreInstance>> qualifiedProperties, MutableList<String> typeParameterNames, MutableList<String> multiplicityParameterNames, ImportStub isOwner, ImportGroup importId, boolean addLines, int qualifiedPropertyIndex) {
    ListIterable<CoreInstance> stereotypes = (ctx.stereotypes() == null) ? null : stereotypes(ctx.stereotypes(), importId);
    ListIterable<TaggedValue> tags = (ctx.taggedValues() == null) ? null : taggedValues(ctx.taggedValues(), importId);
    MutableList<VariableExpression> vars = Lists.mutable.of();
    ListIterable<ValueSpecification> code = Lists.fixedSize.empty();
    GenericType genericType = this.type(ctx.propertyReturnType().type(), typeParameterNames, "", importId, addLines);
    Multiplicity multiplicity = this.buildMultiplicity(ctx.propertyReturnType().multiplicity().multiplicityArgument());
    String propertyName = ctx.identifier().getText();
    final String qualifiedPropertyName = propertyName + "_" + qualifiedPropertyIndex;
    if (ctx.qualifiedPropertyBody() != null) {
        if (ctx.qualifiedPropertyBody().functionVariableExpression() != null) {
            ListIterate.collect(ctx.qualifiedPropertyBody().functionVariableExpression(), fveCtx -> functionVariableExpression(fveCtx, typeParameterNames, importId, ""), vars);
        }
        if (ctx.qualifiedPropertyBody().codeBlock() != null) {
            LambdaContext lambdaContext = new LambdaContext(isOwner._idOrPath().replace("::", "_") + "_" + qualifiedPropertyName);
            code = this.codeBlock(ctx.qualifiedPropertyBody().codeBlock(), typeParameterNames, importId, lambdaContext, addLines, "");
        }
    }
    GenericTypeInstance variableGenericType = GenericTypeInstance.createPersistent(this.repository);
    variableGenericType._rawTypeCoreInstance(isOwner);
    if (typeParameterNames.notEmpty()) {
        MutableList<GenericType> typeArgs = typeParameterNames.collect(n -> GenericTypeInstance.createPersistent(this.repository)._typeParameter(TypeParameterInstance.createPersistent(this.repository, n)));
        variableGenericType._typeArguments(typeArgs);
    }
    if (multiplicityParameterNames.notEmpty()) {
        MutableList<Multiplicity> multParameters = multiplicityParameterNames.collect(n -> MultiplicityInstance.createPersistent(this.repository, null, null)._multiplicityParameter(n));
        variableGenericType._multiplicityArguments(multParameters);
    }
    VariableExpressionInstance vei = VariableExpressionInstance.createPersistent(this.repository, variableGenericType, this.getPureOne(), "this");
    GenericTypeInstance ngt = GenericTypeInstance.createPersistent(this.repository);
    CoreInstance rawType = genericType._rawTypeCoreInstance();
    if (rawType != null) {
        if (rawType instanceof ImportStub) {
            ImportStub gtis = (ImportStub) rawType;
            ImportStubInstance is = ImportStubInstance.createPersistent(this.repository, gtis.getSourceInformation(), gtis._idOrPath(), gtis._importGroup());
            // ImportStubInstance is = ImportStubInstance.createPersistent(this.repository, gtis.getSourceInformation(), ((ImportStubInstance)gtis)._idOrPathAsCoreInstance().getName(), (ImportGroup)gtis._importGroup());
            ngt._rawTypeCoreInstance(is);
        } else {
            ngt._rawTypeCoreInstance(rawType);
        }
    }
    if (!genericType._typeArguments().isEmpty()) {
        ngt._typeArguments(genericType._typeArguments());
    }
    ngt._typeParameter(genericType._typeParameter());
    if (!genericType._multiplicityArguments().isEmpty()) {
        ngt._multiplicityArguments(genericType._multiplicityArguments());
    }
    QualifiedPropertyInstance qpi = QualifiedPropertyInstance.createPersistent(this.repository, qualifiedPropertyName, this.sourceInformation.getPureSourceInformation(ctx.identifier().getStart(), ctx.identifier().getStart(), ctx.getStop()), genericType, multiplicity, null);
    qpi._name(propertyName);
    qpi._functionName(propertyName);
    qpi._expressionSequence(code);
    qpi._stereotypesCoreInstance(stereotypes);
    qpi._taggedValues(tags);
    FunctionTypeInstance ft = FunctionTypeInstance.createPersistent(this.repository, qpi.getSourceInformation(), multiplicity, ngt);
    if (!typeParameterNames.isEmpty()) {
        ft._typeParameters(this.processTypeParametersInstance(this.repository, typeParameterNames));
    }
    ft._parameters(Lists.mutable.<VariableExpression>of(vei).withAll(vars));
    GenericTypeInstance ftGenericTypeInstance = GenericTypeInstance.createPersistent(this.repository);
    ftGenericTypeInstance._rawTypeCoreInstance(ft);
    GenericTypeInstance genericTypeInstance = GenericTypeInstance.createPersistent(this.repository);
    genericTypeInstance._rawTypeCoreInstance(this.processorSupport.package_getByUserPath(M3Paths.QualifiedProperty));
    genericTypeInstance._typeArguments(Lists.fixedSize.<GenericType>of(ftGenericTypeInstance));
    qpi._classifierGenericType(genericTypeInstance);
    qualifiedProperties.add(qpi);
}
Also used : GenericTypeInstance(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.generics.GenericTypeInstance) GenericType(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.generics.GenericType) FunctionTypeInstance(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.FunctionTypeInstance) TaggedValue(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.extension.TaggedValue) ValueSpecification(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.valuespecification.ValueSpecification) VariableExpression(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.valuespecification.VariableExpression) ImportStub(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel._import.ImportStub) Multiplicity(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.multiplicity.Multiplicity) PrimitiveCoreInstance(org.finos.legend.pure.m4.coreinstance.primitive.PrimitiveCoreInstance) CoreInstance(org.finos.legend.pure.m4.coreinstance.CoreInstance) VariableExpressionInstance(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.valuespecification.VariableExpressionInstance) QualifiedPropertyInstance(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.function.property.QualifiedPropertyInstance) ImportStubInstance(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel._import.ImportStubInstance)

Example 5 with GenericTypeInstance

use of org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.generics.GenericTypeInstance in project legend-pure by finos.

the class AntlrContextToM3CoreInstance method unitInstanceParser.

/**
 * Parse the instantiation of an instance of UNIT.
 */
private InstanceValueInstance unitInstanceParser(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.UnitInstanceContext ctx, ImportGroup importId) {
    org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.UnitInstanceLiteralContext uctx = ctx.unitInstanceLiteral();
    GenericTypeInstance genericTypeInstance = GenericTypeInstance.createPersistent(this.repository);
    CoreInstance typeImportStub = ImportStubInstance.createPersistent(this.repository, this.sourceInformation.getPureSourceInformation(ctx.unitName().identifier().getStart()), this.getUnitNameWithMeasure(ctx.unitName()), importId);
    genericTypeInstance._rawTypeCoreInstance(typeImportStub);
    InstanceValueInstance iv = InstanceValueInstance.createPersistent(this.repository, genericTypeInstance, this.getPureOne());
    PrimitiveCoreInstance<?> result;
    if (uctx.MINUS() != null) {
        if (uctx.INTEGER() != null) {
            result = this.repository.newIntegerCoreInstance("-" + uctx.INTEGER().getText());
        } else if (uctx.DECIMAL() != null) {
            result = this.repository.newDecimalCoreInstance("-" + uctx.DECIMAL().getText());
        } else {
            result = this.repository.newFloatCoreInstance("-" + uctx.FLOAT().getText());
        }
    } else {
        if (uctx.INTEGER() != null) {
            result = this.repository.newIntegerCoreInstance("+" + uctx.INTEGER().getText());
        } else if (uctx.DECIMAL() != null) {
            result = this.repository.newDecimalCoreInstance("+" + uctx.DECIMAL().getText());
        } else {
            result = this.repository.newFloatCoreInstance("+" + uctx.FLOAT().getText());
        }
    }
    iv._genericType(genericTypeInstance);
    iv._multiplicity(this.getPureOne());
    iv._values(Lists.mutable.with(result.getValue()));
    InstanceValueInstance wrapperIv = InstanceValueInstance.createPersistent(this.repository, genericTypeInstance, this.getPureOne());
    wrapperIv._genericType(genericTypeInstance);
    wrapperIv._multiplicity(this.getPureOne());
    wrapperIv._values(Lists.mutable.with(iv));
    return wrapperIv;
}
Also used : GenericTypeInstance(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.generics.GenericTypeInstance) InstanceValueInstance(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.valuespecification.InstanceValueInstance) PrimitiveCoreInstance(org.finos.legend.pure.m4.coreinstance.primitive.PrimitiveCoreInstance) CoreInstance(org.finos.legend.pure.m4.coreinstance.CoreInstance)

Aggregations

GenericTypeInstance (org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.generics.GenericTypeInstance)22 CoreInstance (org.finos.legend.pure.m4.coreinstance.CoreInstance)18 PrimitiveCoreInstance (org.finos.legend.pure.m4.coreinstance.primitive.PrimitiveCoreInstance)17 GenericType (org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.generics.GenericType)15 PackageInstance (org.finos.legend.pure.m3.coreinstance.PackageInstance)12 FunctionType (org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.FunctionType)11 Type (org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.Type)11 ImportStubInstance (org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel._import.ImportStubInstance)10 TaggedValue (org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.extension.TaggedValue)9 Multiplicity (org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.multiplicity.Multiplicity)9 ClassInstance (org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.ClassInstance)9 ValueSpecification (org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.valuespecification.ValueSpecification)9 GeneralizationInstance (org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.relationship.GeneralizationInstance)8 FunctionTypeInstance (org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.FunctionTypeInstance)7 InstanceValueInstance (org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.valuespecification.InstanceValueInstance)7 Constraint (org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.constraint.Constraint)6 Generalization (org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.relationship.Generalization)6 TypeParameterInstance (org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.generics.TypeParameterInstance)6 InstanceValue (org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.valuespecification.InstanceValue)6 VariableExpression (org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.valuespecification.VariableExpression)6