gerrit_owners.PRED_owner_approved_1 Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gerrit-owners Show documentation
Show all versions of gerrit-owners Show documentation
Gerrit Plugin that provides a Prolog predicate for enabling per directory code review requirements.
The newest version!
package gerrit_owners;
/*
owner_approved/1 defined in src/main/prolog/gerrit_owners.pl
This file is generated by Prolog Cafe.
PLEASE DO NOT EDIT!
*/
import com.googlecode.prolog_cafe.lang.*;
import com.googlecode.prolog_cafe.builtin.*;
import static gerrit_owners.PRED_owner_approved_1.*;
final class PRED_owner_approved_1 extends Predicate.P1 {
static final SymbolTerm s1 = SymbolTerm.intern("label", 2);
static final SymbolTerm s2 = SymbolTerm.intern("Code-Review");
static final IntegerTerm si3 = new IntegerTerm(2);
static final Term[] s4 = {s2, si3};
static final StructureTerm s5 = new StructureTerm(s1, s4);
public PRED_owner_approved_1(Term a1, Operation cont) {
this.arg1 = a1;
this.cont = cont;
}
@Override
public Operation exec(Prolog engine) {
// owner_approved(A):-owner(A,B),gerrit:commit_label(label('Code-Review',2),B),!
engine.setB0();
Term a1, a2, a3;
Operation p1, p2;
a1 = arg1;
// owner_approved(A):-['$get_level'(B),owner(A,C),gerrit:commit_label(label('Code-Review',2),C),'$cut'(B)]
a2 = new VariableTerm(engine);
//START inline expansion of $get_level(a(2))
if (! a2.unify(new IntegerTerm(engine.B0), engine.trail)) {
return engine.fail();
}
//END inline expansion
a3 = new VariableTerm(engine);
p1 = new PRED_$cut_1(a2, cont);
p2 = new gerrit.PRED_commit_label_2(s5, a3, p1);
return new PRED_owner_2(a1, a3, p2);
}
}