use of org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.MappingLineContext in project legend-pure by finos.
the class AntlrContextToM3CoreInstance method mappingLine.
public TemporaryPurePropertyMapping mappingLine(MappingLineContext ctx, LambdaContext lambdaContext, String cl, ImportGroup importId) {
String sourceMappingId = null;
String targetMappingId = null;
Pair<String, SourceInformation> enumerationMappingInformation = null;
if (ctx.sourceAndTargetMappingId() != null) {
SourceAndTargetMappingIdContext sctx = ctx.sourceAndTargetMappingId();
if (sctx.targetId() != null) {
sourceMappingId = sctx.sourceId().qualifiedName().getText();
targetMappingId = sctx.targetId().qualifiedName().getText();
} else {
targetMappingId = sctx.sourceId().qualifiedName().getText();
}
}
if (ctx.ENUMERATION_MAPPING() != null) {
IdentifierContext identifier = ctx.identifier();
String enumerationMappingName = identifier.getText();
SourceInformation enumerationMappingReferenceSourceInformation = this.sourceInformation.getPureSourceInformation(identifier.getStart(), identifier.getStart(), identifier.getStop());
enumerationMappingInformation = Tuples.pair(enumerationMappingName, enumerationMappingReferenceSourceInformation);
}
return TemporaryPurePropertyMapping.build(this.sourceInformation.getPureSourceInformation(ctx.qualifiedName().getStart()), ctx.PLUS() != null, ctx.type() == null ? null : this.type(ctx.type(), Lists.mutable.empty(), "", importId, true), ctx.multiplicity() == null ? null : this.buildMultiplicity(ctx.multiplicity().multiplicityArgument()), ctx.qualifiedName().getText(), this.combinedExpression(ctx.combinedExpression(), "", Lists.mutable.empty(), lambdaContext, "", true, importId, true), sourceMappingId, targetMappingId, ctx.STAR() != null, enumerationMappingInformation);
}
Aggregations