use of org.finos.legend.pure.m3.inlinedsl.graph.serialization.grammar.GraphParser.GraphPathContext in project legend-pure by finos.
the class GraphAntlrTreeWalker method visitRootGraphDefinition.
private String visitRootGraphDefinition(GraphDefinitionContext graphDefinitionContext, DefinitionContext definitionContext) {
SourceInformation definitionSourceInfo = this.sourceInformation.getPureSourceInformation(definitionContext.start, graphDefinitionContext.start, graphDefinitionContext.stop);
SourceInformation classSourceInfo = this.sourceInformation.getPureSourceInformation(definitionContext.qualifiedName().start, definitionContext.qualifiedName().identifier().start, definitionContext.qualifiedName().stop);
MutableList<String> subTrees = FastList.newList();
for (GraphPathContext graphPathContext : graphDefinitionContext.graphPaths().graphPath()) {
subTrees.add(this.visitGraphPathContext(graphPathContext));
}
return "^meta::pure::graphFetch::RootGraphFetchTree<" + definitionContext.qualifiedName().getText() + "> " + definitionSourceInfo.toM4String() + " (" + "class = " + "^meta::pure::metamodel::import::ImportStub " + classSourceInfo.toM4String() + " (importGroup = system::imports::" + this.importId._name() + ", idOrPath = '" + definitionContext.qualifiedName().getText() + "'), " + "subTrees = " + subTrees.makeString("[", ", ", "]") + ")";
}
use of org.finos.legend.pure.m3.inlinedsl.graph.serialization.grammar.GraphParser.GraphPathContext in project legend-pure by finos.
the class GraphAntlrTreeWalker method visitGraphPathContext.
private String visitGraphPathContext(GraphPathContext graphPathContext) {
SourceInformation definitionSourceInfo = this.sourceInformation.getPureSourceInformation(graphPathContext.start, graphPathContext.start, graphPathContext.stop);
SourceInformation propertySourceInfo = this.sourceInformation.getPureSourceInformation(graphPathContext.identifier().start, graphPathContext.identifier().start, graphPathContext.identifier().stop);
MutableList<String> subTrees = FastList.newList();
if (graphPathContext.graphDefinition() != null) {
for (GraphPathContext subGraphPathContext : graphPathContext.graphDefinition().graphPaths().graphPath()) {
subTrees.add(this.visitGraphPathContext(subGraphPathContext));
}
}
MutableList<String> parameters = FastList.newList();
if (graphPathContext.propertyParameters() != null) {
for (ParameterContext parameterContext : graphPathContext.propertyParameters().parameter()) {
parameters.add(this.visitParameterContext(parameterContext));
}
}
String subType = "";
if (graphPathContext.subtype() != null) {
SourceInformation subTypeSourceInfo = this.sourceInformation.getPureSourceInformation(graphPathContext.subtype().qualifiedName().start, graphPathContext.subtype().qualifiedName().start, graphPathContext.subtype().qualifiedName().stop);
subType = "^meta::pure::metamodel::import::ImportStub " + subTypeSourceInfo.toM4String() + " (importGroup = system::imports::" + this.importId._name() + ", idOrPath = '" + graphPathContext.subtype().qualifiedName().getText() + "')";
}
String alias = "";
if (graphPathContext.alias() != null) {
alias = graphPathContext.alias().STRING().getText();
}
return "^meta::pure::graphFetch::PropertyGraphFetchTree " + definitionSourceInfo.toM4String() + " (" + "property = " + "^meta::pure::metamodel::import::PropertyStub " + propertySourceInfo.toM4String() + " (propertyName = '" + graphPathContext.identifier().getText() + "'), " + "parameters = " + parameters.makeString("[", ", ", "]") + ", " + "subTrees = " + subTrees.makeString("[", ", ", "]") + ", " + "subType = [" + subType + "]" + ", " + "alias = [" + alias + "]" + ")";
}
Aggregations