use of org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3Parser.TreePathContext in project legend-pure by finos.
the class AntlrContextToM3CoreInstance method treePath.
public CoreInstance treePath(TreePathContext ctx, ImportGroup importId) {
GenericType treePathGT = this.type(ctx.type(), Lists.mutable.empty(), "", importId, true);
if (Iterate.notEmpty(treePathGT._typeArguments())) {
throw new PureParserException(treePathGT.getSourceInformation(), "TreePath doesn't support GenericTypes");
}
boolean includeAll = ctx.treePathClassBody() != null && ctx.treePathClassBody().simplePropertyFilter() != null && ctx.treePathClassBody().simplePropertyFilter().STAR() != null;
String rootRouteNodeName = ctx.alias() != null ? ctx.alias().identifier().getText() : ctx.type().qualifiedName().identifier().getText();
RootRouteNode rootRouteNode = RootRouteNodeInstance.createPersistent(this.repository, this.sourceInformation.getPureSourceInformation(ctx.getStart(), ctx.getStart(), ctx.getStop()), String.valueOf(includeAll), rootRouteNodeName, treePathGT);
if (ctx.stereotypes() != null) {
rootRouteNode._stereotypesCoreInstance(this.stereotypes(ctx.stereotypes(), importId));
}
if (ctx.taggedValues() != null) {
rootRouteNode._taggedValues(this.taggedValues(ctx.taggedValues(), importId));
}
if (ctx.treePathClassBody() != null) {
this.treepathBody(ctx.treePathClassBody(), rootRouteNode, importId, new LambdaContext(importId.getName() + rootRouteNodeName), "");
}
return rootRouteNode;
}
Aggregations