Package net.sf.kpex.prolog

Examples of net.sf.kpex.prolog.Cons


    // IO.trace("curr: "+curr);
    Term n = next();
    Term t = null;
    if (n instanceof RbraToken)
    {
      t = new Cons(curr, Const.NIL);
    }
    else if (n instanceof BarToken)
    {
      t = new Cons(curr, getTerm());
      n = next();
      if (!(n instanceof RbraToken))
      {
        throw new ParserException("']'", "bad list end after '|'", n);
      }
    }
    else if (n instanceof CommaToken)
    {
      Term other = getTerm();
      t = new Cons(curr, getListCont(other));
    }
    if (t == null)
    {
      throw new ParserException("| or ]", "bad list continuation", n);
    }
View Full Code Here


  }

  @Override
  public int exec(Prog p)
  {
    Cons L = (Cons) getArg(0);
    return putArg(1, L.getHead(), p);
  }
View Full Code Here

  }

  @Override
  public int exec(Prog p)
  {
    Cons L = (Cons) getArg(0);
    return putArg(1, L.getTail(), p);
  }
View Full Code Here

TOP

Related Classes of net.sf.kpex.prolog.Cons

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.