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

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


      stream = ((JavaObjectTerm) a1).object();
    } else {
      throw new IllegalDomainException(this, 1, "stream_or_alias", a1);
    }
    if (!(stream instanceof PrintWriter)) {
      throw new PermissionException(this, "output", "stream", a1, "");
    }
    // print term
    ((PrintWriter) stream).print(a2.dereference().toQuotedString());
    return cont;
  }
View Full Code Here


      stream = ((JavaObjectTerm) a1).object();
    } else {
      throw new IllegalDomainException(this, 1, "stream_or_alias", a1);
    }
    if (!(stream instanceof PushbackReader)) {
      throw new PermissionException(this, "input", "stream", a1, "");
    }
    // read single character
    try {
      int c = ((PushbackReader) stream).read();
      if (c < 0) { // EOF
View Full Code Here

      stream = ((JavaObjectTerm) a1).object();
    } else {
      throw new IllegalDomainException(this, 1, "stream_or_alias", a1);
    }
    if (!(stream instanceof PrintWriter)) {
      throw new PermissionException(this, "output", "stream", a1, "");
    }
    // print single character
    c = ((IntegerTerm) a2).intValue();
    if (!Character.isDefined(c)) {
      throw new RepresentationException(this, 2, "character");
View Full Code Here

        opts = new ListTerm(SYM_OUTPUT, opts);
      } else {
        throw new IllegalDomainException(this, 2, "io_mode", a2);
      }
    } catch (IOException e) {
      throw new PermissionException(this, "open", "source_sink", a1, "");
    }
    if (engine.getStreamManager().containsKey(streamObject)) {
      throw new InternalException("stream object is duplicated");
    }
    // stream_options
    a4 = a4.dereference();
    Term tmp = a4;
    while (!tmp.isNil()) {
      if (tmp.isVariable()) {
        throw new PInstantiationException(this, 4);
      }
      if (!tmp.isList()) {
        throw new IllegalTypeException(this, 4, "list", a4);
      }
      Term car = ((ListTerm) tmp).car().dereference();
      if (car.isVariable()) {
        throw new PInstantiationException(this, 4);
      }
      if (car.isStructure()) {
        SymbolTerm functor = ((StructureTerm) car).functor();
        Term[] args = ((StructureTerm) car).args();
        if (functor.equals(SYM_ALIAS_1)) {
          alias = args[0].dereference();
          if (!alias.isSymbol()) {
            throw new IllegalDomainException(this, 4,
                "stream_option", car);
          }
          if (engine.getStreamManager().containsKey(alias)) {
            throw new PermissionException(this, "open",
                "source_sink", car, "");
          }
        } else {
          throw new IllegalDomainException(this, 4, "stream_option",
              car);
View Full Code Here

      stream = ((JavaObjectTerm) a1).object();
    } else {
      throw new IllegalDomainException(this, 1, "stream_or_alias", a1);
    }
    if (!(stream instanceof PrintWriter)) {
      throw new PermissionException(this, "output", "stream", a1, "");
    }
    engine.setCurrentOutput((PrintWriter) stream);
    return cont;
  }
View Full Code Here

      stream = ((JavaObjectTerm) a1).object();
    } else {
      throw new IllegalDomainException(this, 1, "stream_or_alias", a1);
    }
    if (!(stream instanceof PushbackReader)) {
      throw new PermissionException(this, "input", "stream", a1, "");
    }
    // read token
    s = new StringBuffer();
    try {
      type = Token.read_token(s, (PushbackReader) stream);
View Full Code Here

      stream = ((JavaObjectTerm) a1).object();
    } else {
      throw new IllegalDomainException(this, 1, "stream_or_alias", a1);
    }
    if (!(stream instanceof PushbackReader)) {
      throw new PermissionException(this, "input", "stream", a1, "");
    }
    engine.setCurrentInput((PushbackReader) stream);
    return cont;
  }
View Full Code Here

      stream = ((JavaObjectTerm) a1).object();
    } else {
      throw new IllegalDomainException(this, 1, "stream_or_alias", a1);
    }
    if (!(stream instanceof PushbackReader)) {
      throw new PermissionException(this, "input", "stream", a1, "");
    }
    // skip
    try {
      PushbackReader in = (PushbackReader) stream;
      int c = in.read();
View Full Code Here

      stream = ((JavaObjectTerm) a1).object();
    } else {
      throw new IllegalDomainException(this, 1, "stream_or_alias", a1);
    }
    if (!(stream instanceof PushbackReader)) {
      throw new PermissionException(this, "input", "stream", a1, "");
    }
    // read single character
    try {
      int c = ((PushbackReader) stream).read();
      if (c < 0) { // EOF
View Full Code Here

      stream = ((JavaObjectTerm) a1).object();
    } else {
      throw new IllegalDomainException(this, 1, "stream_or_alias", a1);
    }
    if (!(stream instanceof PushbackReader)) {
      throw new PermissionException(this, "input", "stream", a1, "");
    }
    // read single character
    try {
      int c = ((PushbackReader) stream).read();
      if (c < 0) { // EOF
View Full Code Here

TOP

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

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.