gerrit_owners.PRED_add_owner_approval_2 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;
/*
add_owner_approval/2 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_add_owner_approval_2.*;
public final class PRED_add_owner_approval_2 extends Predicate.P2 {
static final SymbolTerm s1 = SymbolTerm.intern(".*");
static final SymbolTerm s2 = SymbolTerm.intern("label", 2);
static final SymbolTerm s3 = SymbolTerm.intern("Owner-Approval");
static final SymbolTerm s4 = SymbolTerm.intern("need", 1);
static final Operation add_owner_approval_2_sub_1 = new PRED_add_owner_approval_2_sub_1();
static final Operation add_owner_approval_2_1 = new PRED_add_owner_approval_2_1();
static final Operation add_owner_approval_2_2 = new PRED_add_owner_approval_2_2();
public PRED_add_owner_approval_2(Term a1, Term a2, Operation cont) {
this.arg1 = a1;
this.arg2 = a2;
this.cont = cont;
}
@Override
public Operation exec(Prolog engine) {
engine.areg1 = arg1;
engine.areg2 = arg2;
engine.cont = cont;
engine.setB0();
return engine.jtry2(add_owner_approval_2_1, add_owner_approval_2_sub_1);
}
}
final class PRED_add_owner_approval_2_sub_1 extends Operation {
@Override
public Operation exec(Prolog engine) {
return engine.trust(add_owner_approval_2_2);
}
}
final class PRED_add_owner_approval_2_1 extends Operation {
@Override
public Operation exec(Prolog engine) {
// add_owner_approval(A,B):-gerrit:commit_delta(.*,C,D,E),'$dummy_0_src/main/prolog/gerrit_owners.pl'(F,G,D,C,E),B=[label('Owner-Approval',need(H))|A],!
Term a1, a2, a3, a4, a5, a6, a7, a8, a9;
Operation p1, p2, p3;
Operation cont;
a1 = engine.areg1;
a2 = engine.areg2;
cont = engine.cont;
// add_owner_approval(A,B):-['$get_level'(C),gerrit:commit_delta(.*,D,E,F),'$dummy_0_src/main/prolog/gerrit_owners.pl'(G,H,E,D,F),'$unify'(B,[label('Owner-Approval',need(I))|A]),'$cut'(C)]
a3 = new VariableTerm(engine);
//START inline expansion of $get_level(a(3))
if (! a3.unify(new IntegerTerm(engine.B0), engine.trail)) {
return engine.fail();
}
//END inline expansion
a4 = new VariableTerm(engine);
a5 = new VariableTerm(engine);
a6 = new VariableTerm(engine);
Term[] y1 = {new VariableTerm(engine)};
a7 = new StructureTerm(s4, y1);
Term[] y2 = {s3, a7};
a8 = new StructureTerm(s2, y2);
a9 = new ListTerm(a8, a1);
p1 = new PRED_$cut_1(a3, cont);
p2 = new PRED_$unify_2(a2, a9, p1);
p3 = new PRED_$dummy_0_src$002Fmain$002Fprolog$002Fgerrit_owners$002Epl_5(new VariableTerm(engine), new VariableTerm(engine), a5, a4, a6, p2);
return new gerrit.PRED_commit_delta_4(s1, a4, a5, a6, p3);
}
}
final class PRED_add_owner_approval_2_2 extends Operation {
@Override
public Operation exec(Prolog engine) {
// add_owner_approval(A,B):-A=B
Term a1, a2;
Operation cont;
a1 = engine.areg1;
a2 = engine.areg2;
cont = engine.cont;
// add_owner_approval(A,B):-['$unify'(A,B)]
//START inline expansion of $unify(a(1),a(2))
if (! a1.unify(a2, engine.trail)) {
return engine.fail();
}
//END inline expansion
return cont;
}
}