Package com.googlecode.prolog_cafe.lang

Examples of com.googlecode.prolog_cafe.lang.BufferingPrologControl.execute()


    pcl.setEnabled(EnumSet.allOf(Prolog.Feature.class), false);
    pcl.setEnabled(Prolog.Feature.IO, true);
    pcl.setEnabled(Prolog.Feature.STATISTICS_RUNTIME, true);

    pcl.initialize(Prolog.BUILTIN);
    pcl.execute(Prolog.BUILTIN, "set_prolog_flag",
        SymbolTerm.intern("print_stack_trace"),
        SymbolTerm.intern("on"));

    for (String file : fileName) {
      String path;
View Full Code Here


      try {
        path = new File(file).getCanonicalPath();
      } catch (IOException e) {
        path = new File(file).getAbsolutePath();
      }
      pcl.execute(Prolog.BUILTIN, "consult", SymbolTerm.create(path));
      System.err.println();
      System.err.flush();
    }

    try {
View Full Code Here

      System.err.println();
      System.err.flush();
    }

    try {
      pcl.execute(Prolog.BUILTIN, "cafeteria");
      write("% halt\n");
      return 0;
    } catch (HaltException halt) {
      write("% halt(" + halt.getStatus() + ")\n");
      return halt.getStatus();
View Full Code Here

    BufferingPrologControl ctl = newEmptyMachine(systemLoader);
    PushbackReader in = new PushbackReader(
        new StringReader(rules),
        Prolog.PUSHBACK_SIZE);

    if (!ctl.execute(
        Prolog.BUILTIN, "consult_stream",
        SymbolTerm.intern("rules.pl"),
        new JavaObjectTerm(in))) {
      throw new CompileException("Cannot consult rules of " + project);
    }
View Full Code Here

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.