Kernel Prolog with Fluent based Builtins

tarau.jinni
Class Parser

java.lang.Object
  |
  +--java.io.StreamTokenizer
        |
        +--tarau.jinni.Lexer
              |
              +--tarau.jinni.Parser

class Parser
extends Lexer

Simplified Prolog parser: Synatax supported: a0:-a1,...,an. - no operators ( except toplevel :- and ,) - use quotes to create special symbol names, i.e. compute('+',1,2, Result) and write(':-'(a,','(b,c)))


Fields inherited from class tarau.jinni.Lexer
anonymous, dict, inClause, input
 
Fields inherited from class java.io.StreamTokenizer
buf, CT_ALPHA, CT_COMMENT, CT_DIGIT, CT_QUOTE, CT_WHITESPACE, ctype, eolIsSignificantP, forceLower, input, LINENO, NEED_CHAR, nval, peekc, pushedBack, reader, SKIP_LF, slashSlashCommentsP, slashStarCommentsP, sval, TT_EOF, TT_EOL, TT_NOTHING, TT_NUMBER, TT_WORD, ttype
 
Constructor Summary
Parser(java.io.Reader I)
           
Parser(java.lang.String s)
           
Parser(java.lang.String p, java.lang.String s)
           
 
Method Summary
static Clause clsFromString(java.lang.String s)
           
(package private) static Clause errorClause(java.lang.Exception e, java.lang.String type, int line, boolean verbose)
           
private  Term[] getArgs()
           
private  Term getConjCont(Term curr)
           
private  Term getList()
           
private  Term getListCont(Term curr)
           
protected  Term getTerm()
           
protected  Term getTerm(Term n)
           
static boolean isError(Clause C)
           
private static java.lang.String patchEOFString(java.lang.String s)
           
 Clause readClause()
          Main Parser interface: reads a clause together with variable name information
private  Clause readClauseOrEOF()
           
static void showError(Clause C)
           
protected static Clause toClause(Term T, HashDict dict)
           
 
Methods inherited from class tarau.jinni.Lexer
atEOC, atEOF, char2string, getWord, make_const, make_fun, make_int, make_number, make_real, make_var, next, whitespaceChar, wordChar
 
Methods inherited from class java.io.StreamTokenizer
commentChar, eolIsSignificant, lineno, lowerCaseMode, nextToken, ordinaryChar, ordinaryChars, parseNumbers, pushBack, quoteChar, read, resetSyntax, slashSlashComments, slashStarComments, toString, whitespaceChars, wordChars
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Constructor Detail

Parser

public Parser(java.io.Reader I)
       throws java.io.IOException

Parser

public Parser(java.lang.String p,
              java.lang.String s)
       throws java.io.IOException

Parser

public Parser(java.lang.String s)
       throws java.lang.Exception
Method Detail

readClause

public Clause readClause()
Main Parser interface: reads a clause together with variable name information

errorClause

static final Clause errorClause(java.lang.Exception e,
                                java.lang.String type,
                                int line,
                                boolean verbose)

isError

public static final boolean isError(Clause C)

showError

public static final void showError(Clause C)

toClause

protected static final Clause toClause(Term T,
                                       HashDict dict)

readClauseOrEOF

private Clause readClauseOrEOF()
                        throws java.io.IOException

getConjCont

private final Term getConjCont(Term curr)
                        throws java.io.IOException

getTerm

protected final Term getTerm(Term n)
                      throws java.io.IOException

getTerm

protected Term getTerm()
                throws java.io.IOException

getArgs

private final Term[] getArgs()
                      throws java.io.IOException

getList

private final Term getList()
                    throws java.io.IOException

getListCont

private final Term getListCont(Term curr)
                        throws java.io.IOException

patchEOFString

private static final java.lang.String patchEOFString(java.lang.String s)

clsFromString

public static Clause clsFromString(java.lang.String s)

Kernel Prolog with Fluent based Builtins