All Packages Class Hierarchy This Package Previous Next Index
Class prolog.Parser
java.lang.Object
|
+----prolog.Parser
- public final class Parser
- extends Object
An operator-shift-precedence parser for ISO Prolog. Based loosely on that
of GNU Prolog by Daniel
Diaz.
Note that the externally-callable methods are not re-entrant, as they
rely on fields to implement synthetic attributes.
- See Also:
- ParsingException
-
empty_list_functor
- The end-of-list functor.
-
list_functor
-
-
NECK_ARITY
-
-
NECK_FUNCTOR
-
-
ops
- The operator table for this parser.
-
QUERY_ARITY
-
-
QUERY_FUNCTOR
-
-
Parser()
-
-
main(String[])
- Test method - parse stdin and print out the resultant tree.
-
parse(Prolog, Yylex, boolean)
- Parses some prolog text and interprets it in the context of the given
Prolog engine.
-
parse(Yylex)
- Parses a term without interpreting it.
QUERY_FUNCTOR
public static final String QUERY_FUNCTOR
QUERY_ARITY
public static final int QUERY_ARITY
NECK_FUNCTOR
public static final String NECK_FUNCTOR
NECK_ARITY
public static final int NECK_ARITY
empty_list_functor
public static final String empty_list_functor
- The end-of-list functor.
list_functor
public static final String list_functor
ops
public final OperatorTable ops
- The operator table for this parser.
Parser
public Parser()
parse
public boolean parse(Prolog p,
Yylex lex,
boolean interactive) throws IOException, PrologException
- Parses some prolog text and interprets it in the context of the given
Prolog engine. This may involve asserting a clause,
answering a query, etc. Note that only one clause/query/etc. is dealt
with at a time.
- Parameters:
- interactive - print out variable bindings on success.
- Returns:
- true on end-of-file, false otherwise.
parse
public Term parse(Yylex lex) throws IOException, ParsingException
- Parses a term without interpreting it.
- Parameters:
- lex - the lexical analyzer from which we read tokens.
- Throws: IOException
- on stream errors.
- Throws: ParsingException
- on syntax/semantical errors.
main
public static void main(String argv[]) throws Exception
- Test method - parse stdin and print out the resultant tree.
All Packages Class Hierarchy This Package Previous Next Index