notio
Interface Parser


public abstract interface Parser

The required interface for all parsers. All parsers should implement this interface to facilitate pluggability. While a parser must implement the entire interface, it can opt to throw an UnimplementedFeature exception if it does not support parsing of a particular nonterminal. Minimally, a parser should support the Unit nonterminal.

See Also:
UnimplementedFeatureException

Method Summary
 Concept Concept()
          Attempts to parse a concept from the input stream.
 java.lang.Class getUnitClass()
          Returns a Class object that indicates what class the Unit parse method will return.
 Graph Graph()
          Attempts to parse a graph from the input stream.
 void initializeParser(java.io.Reader reader, KnowledgeBase kBase, TranslationContext tContext)
          Initializes the parser to parse the specified character reader.
 Relation Relation()
          Attempts to parse a relation from the input stream.
 java.lang.Object Unit()
          Attempts to parse the default unit from the input stream.
 

Method Detail

initializeParser

public void initializeParser(java.io.Reader reader,
                             KnowledgeBase kBase,
                             TranslationContext tContext)
                      throws ParserException
Initializes the parser to parse the specified character reader.
Parameters:
reader - the reader whose contents are to be parsed.
kBase - the knowledge base to be used while parsing.
tContext - the translation context to be used while parsing.
Throws:
ParserException - if an error occurs while initializing the parser.

getUnitClass

public java.lang.Class getUnitClass()
Returns a Class object that indicates what class the Unit parse method will return.
Returns:
a Class object that indicates what class the Unit parse method will return.
See Also:
Unit()

Unit

public java.lang.Object Unit()
                      throws ParserException
Attempts to parse the default unit from the input stream. The default unit is whatever a particular parser is usually intended to parse.
Returns:
the unit object parsed from the input stream.
Throws:
ParserException - if an error occurs while parsing.

Graph

public Graph Graph()
            throws ParserException
Attempts to parse a graph from the input stream.
Returns:
the graph parsed from the input stream.
Throws:
ParserException - if an error occurs while parsing.

Concept

public Concept Concept()
                throws ParserException
Attempts to parse a concept from the input stream.
Returns:
the concept parsed from the input stream.
Throws:
ParserException - if an error occurs while parsing.

Relation

public Relation Relation()
                  throws ParserException
Attempts to parse a relation from the input stream.
Returns:
the relation parsed from the input stream.
Throws:
ParserException - if an error occurs while parsing.


Copyright 1998-1999 Finnegan Southey