Package tud.gamecontroller.auxiliary

Examples of tud.gamecontroller.auxiliary.InvalidKIFException


  public Term getTermFromKIF(String kif) throws InvalidKIFException {
    try{
      GdlExpression gdlExpr=parser.parse(kif).getElement(0);
      return new Term(parser.getSymbolTable(), stanfordlogic.prover.Term.buildFromGdl(gdlExpr));
    }catch(Exception ex){
      throw new InvalidKIFException("Exception while parsing \""+kif+"\":"+ex);
    }
  }
View Full Code Here


    if(reply!=null){
      descrambledReply=gameScrambler.descramble(reply);
      try {
        TermType moveTerm = match.getGame().getTermFromString(descrambledReply);
        if(moveTerm!=null && !moveTerm.isGround())
          throw new InvalidKIFException("\""+descrambledReply+"\" is not a ground term.");
        move = new Move<TermType>(moveTerm);
      } catch (InvalidKIFException ex) {
        String message = "Error parsing reply \""+reply+"\" from "+this+": "+ex.getMessage();
        logErrorMessage(GameControllerErrorMessage.PARSING_ERROR, message);
      }
View Full Code Here

        if(list2.size() == 1) {
          return list2.get(0);
        }
      }
    }catch(Exception ex){
      throw new InvalidKIFException("Exception while parsing \""+kif+"\":"+ex.getMessage());
    }
    throw new InvalidKIFException("not a valid kif term:"+kif);
  }
View Full Code Here

  public static ExpList parseExpressionList(String kif) throws InvalidKIFException {
    try{
      kif = kif.replace(")", ") ").trim();
      if(kif.charAt(0) != '(' || kif.charAt(kif.length()-1) != ')')
        throw new InvalidKIFException("not a valid kif list:"+kif);
      kif = "(bla " + kif.substring(1, kif.length()).trim();
      ExpList list=Parser.parseDesc(kif);
      if(list.size() != 1){
        throw new InvalidKIFException("Exception while parsing \""+kif+"\":...");
      }
      return ((Connective)list.get(0)).getOperands();
    }catch(Exception ex){
      throw new InvalidKIFException("Exception while parsing \""+kif+"\":"+ex.getMessage());
    }
  }
View Full Code Here

TOP

Related Classes of tud.gamecontroller.auxiliary.InvalidKIFException

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.