use of mb.nabl2.constraints.scopegraph.CGExportEdge in project nabl by metaborg.
the class ScopeGraphComponent method solve.
private boolean solve(CGExportEdge c) {
ITerm scopeTerm = unifier().findRecursive(c.getScope());
ITerm declTerm = unifier().findRecursive(c.getDeclaration());
if (!(scopeTerm.isGround() && declTerm.isGround())) {
return false;
}
Scope scope = Scope.matcher().match(scopeTerm, unifier()).orElseThrow(() -> new TypeException("Expected a scope as third argument to " + c));
Occurrence decl = Occurrence.matcher().match(declTerm, unifier()).orElseThrow(() -> new TypeException("Expected an occurrence as first argument to " + c));
scopeGraph.addExportEdge(decl, c.getLabel(), scope);
return true;
}
Aggregations