Package jp.ac.kobe_u.cs.prolog.lang

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


    Object stream = null;

    // Char
    a2 = a2.dereference();
    if (a2.isVariable()) {
      throw new PInstantiationException(this, 2);
    }
    if (!a2.isInteger()) {
      try {
        a2 = Arithmetic.evaluate(a2);
      } catch (BuiltinException e) {
        e.goal = this;
        e.argNo = 2;
        throw e;
      }
    }
    n = ((NumberTerm) a2).intValue();
    if (!Character.isDefined(n)) {
      throw new RepresentationException(this, 2, "character_code");
    }
    // S_or_a
    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))
View Full Code Here


      throw new IllegalTypeException(this, 2, "in_character", a2);
    }
    // S_or_a
    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))
View Full Code Here

    Term a1;
    a1 = arg1;

    a1 = a1.dereference();
    if (a1.isVariable()) {
      throw new PInstantiationException(this, 1);
    }
    throw new TermException(a1);
  }
View Full Code Here

        throw new IllegalTypeException(this, 2, "variable", a2);
      }
      // 1st. argument (atom or callable term)
      a1 = a1.dereference();
      if (a1.isVariable()) {
        throw new PInstantiationException(this, 1);
      }
      if (!a1.isSymbol() && !a1.isStructure()) {
        throw new IllegalTypeException(this, 1, "callable", a1);
      }
      if (a1.isSymbol()) { // No argument constructor
View Full Code Here

    // functor(?X,+Y,+Z)
    a1 = a1.dereference();
    if (a1.isVariable()) {
      a2 = a2.dereference();
      if (a2.isVariable()) {
        throw new PInstantiationException(this, 2);
      }
      if (!a2.isSymbol() && !a2.isNumber() && !a2.isJavaObject()
          && !a2.isClosure()) {
        throw new IllegalTypeException(this, 2, "atomic", a2);
      }
      a3 = a3.dereference();
      if (a3.isVariable()) {
        throw new PInstantiationException(this, 3);
      }
      if (!a3.isInteger()) {
        throw new IllegalTypeException(this, 3, "integer", a3);
      }
      int n = ((IntegerTerm) a3).intValue();
View Full Code Here

    Term a1;
    a1 = arg1;

    a1 = a1.dereference();
    if (a1.isVariable()) {
      throw new PInstantiationException(this, 1);
    }
    if (!a1.isInteger()) {
      throw new IllegalTypeException(this, 1, "integer", a1);
    }
    engine.exceptionRaised = ((IntegerTerm) a1).intValue();
View Full Code Here

    }
    // a3 is a variable
    a1 = a1.dereference();
    a2 = a2.dereference();
    if (a1.isVariable()) {
      throw new PInstantiationException(this, 1);
    }
    if (a2.isVariable()) {
      throw new PInstantiationException(this, 2);
    }
    if (!a1.isSymbol()) {
      throw new IllegalTypeException(this, 1, "integer", a1);
    }
    if (!a2.isSymbol()) {
View Full Code Here

      throw new IllegalTypeException(this, 2, "in_character", a2);
    }
    // S_or_a
    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))
View Full Code Here

      }
    }
    // S_or_a
    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))
View Full Code Here

    Object hash = null;

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

TOP

Related Classes of jp.ac.kobe_u.cs.prolog.lang.PInstantiationException

Copyright © 2018 www.massapicom. 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.