All Downloads are FREE. Search and download functionalities are using the official Maven repository.

gerrit_owners.PRED_add_owner_approval_3 Maven / Gradle / Ivy

Go to download

Gerrit Plugin that provides a Prolog predicate for enabling per directory code review requirements.

The newest version!
package gerrit_owners;
/*
 add_owner_approval/3 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_3.*;

public final class PRED_add_owner_approval_3 extends Predicate.P3 {
    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_3_sub_1 = new PRED_add_owner_approval_3_sub_1();
    static final Operation add_owner_approval_3_1 = new PRED_add_owner_approval_3_1();
    static final Operation add_owner_approval_3_2 = new PRED_add_owner_approval_3_2();

    public PRED_add_owner_approval_3(Term a1, Term a2, Term a3, Operation cont) {
        this.arg1 = a1;
        this.arg2 = a2;
        this.arg3 = a3;
        this.cont = cont;
    }

    @Override
    public Operation exec(Prolog engine) {
        engine.areg1 = arg1;
        engine.areg2 = arg2;
        engine.areg3 = arg3;
        engine.cont = cont;
        engine.setB0();
        return engine.jtry3(add_owner_approval_3_1, add_owner_approval_3_sub_1);
    }
}

final class PRED_add_owner_approval_3_sub_1 extends Operation {
    @Override
    public Operation exec(Prolog engine) {
        return engine.trust(add_owner_approval_3_2);
    }
}

final class PRED_add_owner_approval_3_1 extends Operation {
    @Override
    public Operation exec(Prolog engine) {
    // add_owner_approval(A,B,C):-gerrit:commit_delta(.*,D,E,F),'$dummy_3_src/main/prolog/gerrit_owners.pl'(G,H,E,D,F,A),C=[label('Owner-Approval',need(I))|B],!
        Term a1, a2, a3, a4, a5, a6, a7, a8, a9, a10;
        Operation p1, p2, p3;
        Operation cont;
        a1 = engine.areg1;
        a2 = engine.areg2;
        a3 = engine.areg3;
        cont = engine.cont;
    // add_owner_approval(A,B,C):-['$get_level'(D),gerrit:commit_delta(.*,E,F,G),'$dummy_3_src/main/prolog/gerrit_owners.pl'(H,I,F,E,G,A),'$unify'(C,[label('Owner-Approval',need(J))|B]),'$cut'(D)]
        a4 = new VariableTerm(engine);
        //START inline expansion of $get_level(a(4))
        if (! a4.unify(new IntegerTerm(engine.B0), engine.trail)) {
            return engine.fail();
        }
        //END inline expansion
        a5 = new VariableTerm(engine);
        a6 = new VariableTerm(engine);
        a7 = new VariableTerm(engine);
        Term[] y1 = {new VariableTerm(engine)};
        a8 = new StructureTerm(s4, y1);
        Term[] y2 = {s3, a8};
        a9 = new StructureTerm(s2, y2);
        a10 = new ListTerm(a9, a2);
        p1 = new PRED_$cut_1(a4, cont);
        p2 = new PRED_$unify_2(a3, a10, p1);
        p3 = new PRED_$dummy_3_src$002Fmain$002Fprolog$002Fgerrit_owners$002Epl_6(new VariableTerm(engine), new VariableTerm(engine), a6, a5, a7, a1, p2);
        return new gerrit.PRED_commit_delta_4(s1, a5, a6, a7, p3);
    }
}

final class PRED_add_owner_approval_3_2 extends Operation {
    @Override
    public Operation exec(Prolog engine) {
    // add_owner_approval(A,B,C):-B=C
        Term a1, a2, a3;
        Operation cont;
        a1 = engine.areg1;
        a2 = engine.areg2;
        a3 = engine.areg3;
        cont = engine.cont;
    // add_owner_approval(A,B,C):-['$unify'(B,C)]
        //START inline expansion of $unify(a(2),a(3))
        if (! a2.unify(a3, engine.trail)) {
            return engine.fail();
        }
        //END inline expansion
        return cont;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy