|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--com.svincent.moksa.WamObject
|
+--com.svincent.moksa.PrologParser
|
+--com.svincent.moksa.MiniPrologParser
Parses a subset of the Prolog language, that I call 'Mini-Prolog'.
Moksa includes two Prolog parsers: this one, written entirely in Java, and another, which supports the entire ISO Prolog grammar, written in Prolog.
This parser may one day be extended to parse all of Prolog.
Mini-Prolog is defined as follows:
A pleasant property of this language is that it is LA(1). It never has to peek ahead more than one token.
| Constructor Summary | |
MiniPrologParser(Io _io)
|
|
| Method Summary | |
PrologTerm |
parseClause(Io.PrologInput in)
Parse a Prolog clause. |
PrologTerm |
parseTerm(Io.PrologInput in)
Parse a Prolog term. |
| Methods inherited from class com.svincent.moksa.PrologParser |
parseClause,
parseFile,
parseTerm |
| Methods inherited from class com.svincent.moksa.WamObject |
tag,
tag |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Constructor Detail |
public MiniPrologParser(Io _io)
| Method Detail |
public PrologTerm parseClause(Io.PrologInput in)
throws java.io.IOException,
PrologParseException
Parse a Prolog clause. This ends at the next end ('.') character, and typically contains something of the form "Term :- Term, Term."
Returns null on EOF.
public PrologTerm parseTerm(Io.PrologInput in)
throws java.io.IOException,
PrologParseException
Parse a Prolog term. This is the primitive term stuff we're all familiar with: atoms, integers, compound terms, floats, etc.
Returns null on EOF.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
This is documentation for Moksa Prolog, which can be found at http://www.svincent.com/moksa/
Copyright © 1999 Shawn P. Vincent.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.