notio
Interface Generator

All Known Implementing Classes:
notio.translators.SimpleGenerator, LFGenerator, CGIFGenerator

public interface Generator

The Generator interface. All generators should implement this interface to facilitate pluggability. While a generator must implement the entire interface, it can opt to throw an UnimplementedFeature exception if it does not support generating of a particular nonterminal. Minimally, a generator should support the Unit nonterminal.

See Also:
UnimplementedFeatureException

Method Summary
 void generateActor(Actor actor)
          Generates the specified actor.
 void generateCGStream(java.util.Vector graphs)
          Generates the specified vector of graphs as a CGStream.
 void generateConcept(Concept concept)
          Generates the specified concept.
 void generateGraph(Graph graph)
          Generates the specified graph.
 void generateOutermostContext(Graph graph)
          Generates the specified graph which is treated as the outermost context for purposes for scoping.
 void generateRelation(Relation relation)
          Generates the specified relation.
 void generateUnit(java.lang.Object unit)
          Generates the specified unit object.
 java.lang.Class getUnitClass()
          Returns a Class object that indicates what class the Unit generate method requires.
 void initializeGenerator(java.io.Writer writer, KnowledgeBase kBase, TranslationContext tContext)
          Initializes the generator to generate into the specified writer.
 

Method Detail

initializeGenerator

public void initializeGenerator(java.io.Writer writer,
                                KnowledgeBase kBase,
                                TranslationContext tContext)
                         throws GeneratorException
Initializes the generator to generate into the specified writer.
Parameters:
writer - the writer to be generated into.
kBase - the knowledge base to be used while parsing.
tContext - the translation context to be used while parsing.
Throws:
GeneratorException - if an error occurs while initializing the generator.

getUnitClass

public java.lang.Class getUnitClass()
Returns a Class object that indicates what class the Unit generate method requires.
Returns:
a Class object that indicates what class the Unit generate method requires.
See Also:
generateUnit(java.lang.Object)

generateUnit

public void generateUnit(java.lang.Object unit)
                  throws GeneratorException
Generates the specified unit object.
Parameters:
unit - the unit to be generated.
Throws:
GeneratorException - if an error occurs while generating.

generateOutermostContext

public void generateOutermostContext(Graph graph)
                              throws GeneratorException
Generates the specified graph which is treated as the outermost context for purposes for scoping. This method should be used instead of generateGraph() when no translation information is to be used from previous translation sessions and when the generator can safely assume that the graph is "self-contained".
Parameters:
graph - the graph to be generated.
Throws:
GeneratorException - if an error occurs while generating.
UnimplementedFeatureException - if this generator does not support this generation method.

generateCGStream

public void generateCGStream(java.util.Vector graphs)
                      throws GeneratorException
Generates the specified vector of graphs as a CGStream.
Parameters:
graphs - the vector of graphs to be generated.
Throws:
GeneratorException - if an error occurs while generating.
UnimplementedFeatureException - if this generator does not support this generation method.

generateGraph

public void generateGraph(Graph graph)
                   throws GeneratorException
Generates the specified graph.
Parameters:
graph - the graph to be generated.
Throws:
GeneratorException - if an error occurs while generating.
UnimplementedFeatureException - if this generator does not support this generation method.

generateConcept

public void generateConcept(Concept concept)
                     throws GeneratorException
Generates the specified concept.
Parameters:
concept - the concept to be generated.
Throws:
GeneratorException - if an error occurs while generating.
UnimplementedFeatureException - if this generator does not support this generation method.

generateRelation

public void generateRelation(Relation relation)
                      throws GeneratorException
Generates the specified relation.
Parameters:
relation - the relation to be generated.
Throws:
GeneratorException - if an error occurs while generating.
UnimplementedFeatureException - if this generator does not support this generation method.

generateActor

public void generateActor(Actor actor)
                   throws GeneratorException
Generates the specified actor.
Parameters:
actor - the actor to be generated.
Throws:
GeneratorException - if an error occurs while generating.
UnimplementedFeatureException - if this generator does not support this generation method.


Copyright 1998-2001 Finnegan Southey