use of org.finos.legend.pure.m3.compiler.unload.walk.WalkerState in project legend-pure by finos.
the class IncrementalCompiler_Old method walkTheGraphForUnload.
private SetIterable<CoreInstance> walkTheGraphForUnload() {
WalkerState walkerState = new WalkerState(this.processorSupport);
Matcher walkerMatcher = new Matcher(this.modelRepository, this.context, this.processorSupport);
this.library.getParsers().asLazy().flatCollect(Parser::getUnLoadWalkers).concatenate(this.dslLibrary.getInlineDSLs().asLazy().flatCollect(InlineDSL::getUnLoadWalkers)).forEach(walkerMatcher::addMatchIfTypeIsKnown);
this.toUnload.forEach(i -> walkerMatcher.match(i, walkerState));
return walkerState.getInstances();
}
use of org.finos.legend.pure.m3.compiler.unload.walk.WalkerState in project legend-pure by finos.
the class ProfileUnloaderWalk method run.
@Override
public void run(Profile profile, MatcherState state, Matcher matcher, ModelRepository modelRepository, Context context) throws PureCompilationException {
WalkerState walkerState = (WalkerState) state;
walkerState.addInstance(profile);
for (Tag tag : profile._p_tags()) {
for (AnnotatedElement modelElement : tag._modelElements()) {
matcher.fullMatch(modelElement, state);
}
}
for (Stereotype stereotype : profile._p_stereotypes()) {
for (AnnotatedElement modelElement : stereotype._modelElements()) {
matcher.fullMatch(modelElement, state);
}
}
}
use of org.finos.legend.pure.m3.compiler.unload.walk.WalkerState in project legend-pure by finos.
the class IncrementalCompiler_New method walkTheGraphForUnload.
private MutableSet<CoreInstance> walkTheGraphForUnload(MutableSet<CoreInstance> instances) {
WalkerState walkerState = new WalkerState(this.processorSupport);
Matcher walkerMatcher = new Matcher(this.modelRepository, this.context, this.processorSupport);
this.library.getParsers().asLazy().flatCollect(Parser::getUnLoadWalkers).concatenate(this.dslLibrary.getInlineDSLs().asLazy().flatCollect(InlineDSL::getUnLoadWalkers)).forEach(walkerMatcher::addMatchIfTypeIsKnown);
instances.forEach(i -> walkerMatcher.match(i, walkerState));
return walkerState.getInstances().toSet();
}
use of org.finos.legend.pure.m3.compiler.unload.walk.WalkerState in project legend-pure by finos.
the class MappingUnloaderWalk method run.
@Override
public void run(Mapping mapping, MatcherState state, Matcher matcher, ModelRepository modelRepository, Context context) throws PureCompilationException {
WalkerState walkerState = (WalkerState) state;
walkerState.addInstance(mapping);
for (SetImplementation classMapping : mapping._classMappings()) {
matcher.fullMatch(classMapping, state);
}
for (EnumerationMapping enumerationMapping : mapping._enumerationMappings()) {
matcher.fullMatch(enumerationMapping, state);
}
for (AssociationImplementation associationMapping : mapping._associationMappings()) {
matcher.fullMatch(associationMapping, state);
}
}
use of org.finos.legend.pure.m3.compiler.unload.walk.WalkerState in project legend-pure by finos.
the class DiagramUnloaderWalk method run.
@Override
public void run(Diagram diagram, MatcherState state, Matcher matcher, ModelRepository modelRepository, Context context) throws PureCompilationException {
WalkerState walkerState = (WalkerState) state;
walkerState.addInstance(diagram);
walkerState.addInstances(diagram._typeViewsCoreInstance());
walkerState.addInstances(diagram._associationViews());
walkerState.addInstances(diagram._propertyViews());
walkerState.addInstances(diagram._generalizationViews());
}
Aggregations