Package jp.ac.kobe_u.cs.prolog.builtin

Source Code of jp.ac.kobe_u.cs.prolog.builtin.PRED_peek_code_1

package jp.ac.kobe_u.cs.prolog.builtin;
import jp.ac.kobe_u.cs.prolog.lang.Predicate;
import jp.ac.kobe_u.cs.prolog.lang.Prolog;
import jp.ac.kobe_u.cs.prolog.lang.Term;
import jp.ac.kobe_u.cs.prolog.lang.VariableTerm;
/*
This file is generated by Prolog Cafe.
PLEASE DO NOT EDIT!
*/
/**
<code>peek_code/1</code> defined in builtins.pl<br>
@author Mutsunori Banbara (banbara@kobe-u.ac.jp)
@author Naoyuki Tamura (tamura@kobe-u.ac.jp)
@version 1.0
*/
public class PRED_peek_code_1 extends Predicate {

    public Term arg1;

    public PRED_peek_code_1(Term a1, Predicate cont) {
        arg1 = a1;
        this.cont = cont;
    }

    public PRED_peek_code_1(){}

    public void setArgument(Term[] args, Predicate cont) {
        arg1 = args[0];
        this.cont = cont;
    }

    public int arity() { return 1; }

    public String toString() {
        return "peek_code(" + arg1 + ")";
    }

    public Predicate exec(Prolog engine) {
    // peek_code(A):-current_input(B),peek_code(B,A)
        engine.setB0();
        Term a1, a2;
        Predicate p1;
        a1 = arg1;
    // peek_code(A):-[current_input(B),peek_code(B,A)]
        a2 = new VariableTerm(engine);
        p1 = new PRED_peek_code_2(a2, a1, cont);
        return new PRED_current_input_1(a2, p1);
    }
}
TOP

Related Classes of jp.ac.kobe_u.cs.prolog.builtin.PRED_peek_code_1

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.