dk.brics.grammar.operations
Class Automaton2Grammar

java.lang.Object
  extended by dk.brics.grammar.operations.Automaton2Grammar

public class Automaton2Grammar
extends Object

Converter from automata to regular grammars. The resulting grammars contain only one-transition-interval terminal automata.


Constructor Summary
Automaton2Grammar()
          Constructs a new converter.
 
Method Summary
 Grammar convert(Automaton a)
          Converts the given automaton to a new grammar.
 String extend(Grammar g, Automaton a)
          Extends an existing grammar with a right linear sub-grammar corresponding to a given automaton.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Automaton2Grammar

public Automaton2Grammar()
Constructs a new converter.

Method Detail

convert

public Grammar convert(Automaton a)
Converts the given automaton to a new grammar.

Parameters:
a - automaton
Returns:
grammar
See Also:
extend(Grammar, Automaton)

extend

public String extend(Grammar g,
                     Automaton a)
Extends an existing grammar with a right linear sub-grammar corresponding to a given automaton. If invoking this on multiple automata, extending the same grammar, then the same Automaton2Grammar converter should be used. All new productions and entities are non-labeled.

Parameters:
g - existing grammar
a - automaton to convert
Returns:
start nonterminal of the new sub-grammar


Copyright © 2005-2008 Anders Møller.