use of mb.nabl2.constraints.scopegraph.CGDecl in project nabl by metaborg.
the class ScopeGraphComponent method solve.
// ------------------------------------------------------------------------------------------------------//
private boolean solve(CGDecl c) {
final ITerm scopeTerm = unifier().findRecursive(c.getScope());
final 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 first agument to " + c));
Occurrence decl = Occurrence.matcher().match(declTerm, unifier()).orElseThrow(() -> new TypeException("Expected an occurrence as second argument to " + c));
scopeGraph.addDecl(scope, decl);
return true;
}
Aggregations