Examples of ExistenceException


Examples of jp.ac.kobe_u.cs.prolog.lang.ExistenceException

    a1 = a1.dereference();
    if (a1.isVariable()) {
      throw new PInstantiationException(this, 1);
    } else if (a1.isSymbol()) {
      if (!engine.getStreamManager().containsKey(a1)) {
        throw new ExistenceException(this, 1, "stream", a1, "");
      }
      stream = ((JavaObjectTerm) engine.getStreamManager().get(a1))
          .object();
    } else if (a1.isJavaObject()) {
      stream = ((JavaObjectTerm) a1).object();
View Full Code Here

Examples of jp.ac.kobe_u.cs.prolog.lang.ExistenceException

    a1 = a1.dereference();
    if (a1.isVariable()) {
      throw new PInstantiationException(this, 1);
    } else if (a1.isSymbol()) {
      if (!engine.getStreamManager().containsKey(a1)) {
        throw new ExistenceException(this, 1, "stream", a1, "");
      }
      stream = ((JavaObjectTerm) engine.getStreamManager().get(a1))
          .object();
    } else if (a1.isJavaObject()) {
      stream = ((JavaObjectTerm) a1).object();
View Full Code Here

Examples of jp.ac.kobe_u.cs.prolog.lang.ExistenceException

          if (engine.getUnknown().equals("fail")) {
            return engine.fail();
          }
          Term[] fa = { SymbolTerm.makeSymbol(functor),
              new IntegerTerm(arity) };
          throw new ExistenceException(this, 0, "procedure",
              new StructureTerm(SYM_SLASH_2, fa), "");
        }
      }
      constr = clazz.getConstructor();
      constr.setAccessible(true);
View Full Code Here

Examples of jp.ac.kobe_u.cs.prolog.lang.ExistenceException

      throw new IllegalTypeException(this, 2, "atom", a2);
    }
    try {
      if (a2.equals(SYM_READ)) {
        if (!file.exists()) {
          throw new ExistenceException(this, 1, "source_sink", a1, "");
        }
        PushbackReader in = new PushbackReader(new BufferedReader(
            new FileReader(file)), Prolog.PUSHBACK_SIZE);
        streamObject = new JavaObjectTerm(in);
        opts = new ListTerm(SYM_INPUT, opts);
View Full Code Here

Examples of jp.ac.kobe_u.cs.prolog.lang.ExistenceException

    a1 = a1.dereference();
    if (a1.isVariable()) {
      throw new PInstantiationException(this, 1);
    } else if (a1.isSymbol()) {
      if (!engine.getStreamManager().containsKey(a1)) {
        throw new ExistenceException(this, 1, "stream", a1, "");
      }
      stream = ((JavaObjectTerm) engine.getStreamManager().get(a1))
          .object();
    } else if (a1.isJavaObject()) {
      stream = ((JavaObjectTerm) a1).object();
View Full Code Here

Examples of jp.ac.kobe_u.cs.prolog.lang.ExistenceException

    a1 = a1.dereference();
    if (a1.isVariable()) {
      throw new PInstantiationException(this, 1);
    } else if (a1.isSymbol()) {
      if (!engine.getStreamManager().containsKey(a1)) {
        throw new ExistenceException(this, 1, "stream", a1, "");
      }
      stream = ((JavaObjectTerm) engine.getStreamManager().get(a1))
          .object();
    } else if (a1.isJavaObject()) {
      stream = ((JavaObjectTerm) a1).object();
View Full Code Here

Examples of jp.ac.kobe_u.cs.prolog.lang.ExistenceException

    a1 = a1.dereference();
    if (a1.isVariable()) {
      throw new PInstantiationException(this, 1);
    } else if (a1.isSymbol()) {
      if (!engine.getStreamManager().containsKey(a1)) {
        throw new ExistenceException(this, 1, "stream", a1, "");
      }
      stream = ((JavaObjectTerm) engine.getStreamManager().get(a1))
          .object();
    } else if (a1.isJavaObject()) {
      stream = ((JavaObjectTerm) a1).object();
View Full Code Here

Examples of jp.ac.kobe_u.cs.prolog.lang.ExistenceException

    a1 = a1.dereference();
    if (a1.isVariable()) {
      throw new PInstantiationException(this, 1);
    } else if (a1.isSymbol()) {
      if (!engine.getStreamManager().containsKey(a1)) {
        throw new ExistenceException(this, 1, "stream", a1, "");
      }
      stream = ((JavaObjectTerm) engine.getStreamManager().get(a1))
          .object();
    } else if (a1.isJavaObject()) {
      stream = ((JavaObjectTerm) a1).object();
View Full Code Here

Examples of jp.ac.kobe_u.cs.prolog.lang.ExistenceException

    a1 = a1.dereference();
    if (a1.isVariable()) {
      throw new PInstantiationException(this, 1);
    } else if (a1.isSymbol()) {
      if (!engine.getStreamManager().containsKey(a1)) {
        throw new ExistenceException(this, 1, "stream", a1, "");
      }
      stream = ((JavaObjectTerm) engine.getStreamManager().get(a1))
          .object();
    } else if (a1.isJavaObject()) {
      stream = ((JavaObjectTerm) a1).object();
View Full Code Here

Examples of jp.ac.kobe_u.cs.prolog.lang.ExistenceException

      // Parameterized constructor
      clazz = Class.forName(((StructureTerm) a1).name());
      arity = ((StructureTerm) a1).arity();
      constrs = clazz.getConstructors();
      if (constrs.length == 0) {
        throw new ExistenceException(this, 1, "constructor", a1, "");
      }
      pArgs = ((StructureTerm) a1).args();
      jArgs = new Object[arity];
      for (int i = 0; i < arity; i++) {
        pArgs[i] = pArgs[i].dereference();
        if (!pArgs[i].isJavaObject()) {
          pArgs[i] = new JavaObjectTerm(pArgs[i]);
        }
        jArgs[i] = pArgs[i].toJava();
      }
      for (Constructor constr : constrs) {
        if (checkParameterTypes(constr.getParameterTypes(), pArgs)) {
          try {
            c = constr;
            // c.setAccessible(true);
            instance = c.newInstance(jArgs);
            break; // Succeeds to create new instance
          } catch (Exception e) {
            c = null; // Back to loop
          }
        }
      }
      if (c == null) {
        throw new ExistenceException(this, 1, "constructor", a1, "");
      }
      if (!a2.unify(toPrologTerm(instance), engine.trail)) {
        return engine.fail();
      }
      return cont;
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.