laser.regularlanguage.util
Class REtoFSAConverter<L extends LabelInterface>

java.lang.Object
  extended by laser.regularlanguage.util.REtoFSAConverter<L>
Type Parameters:
L - The type of labels used by the REs and FSAs

public class REtoFSAConverter<L extends LabelInterface>
extends java.lang.Object

The REtoFSAParser class converts from the given RE to the corresponding FSA.

Author:
Heather M. Conboy (laser-software@cs.umass.edu)

Constructor Summary
REtoFSAConverter(RLFactory<L> rlFactory, FSAFactoryInterface<L> fsaFactory)
          Creates a new REtoFSAConverter that will use the given FSA factory to create the FSA.
 
Method Summary
 MutableFSAInterface<L> convert(RE<L> theRE)
          Converts from the given RE to the corresponding FSA.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

REtoFSAConverter

public REtoFSAConverter(RLFactory<L> rlFactory,
                        FSAFactoryInterface<L> fsaFactory)
Creates a new REtoFSAConverter that will use the given FSA factory to create the FSA.

Parameters:
rlFactory - The RL factory to be used to help convert between REs and FSAs (non-null)
fsaFactory - The FSA factory to be used to create the FSA (non-null)
Method Detail

convert

public MutableFSAInterface<L> convert(RE<L> theRE)
                                                      throws FSAInterfaceException,
                                                             REException
Converts from the given RE to the corresponding FSA.

PRECONDITIONS:

Parameters:
theRE - The RE to be converted
Returns:
The corresponding FSA
Throws:
FSAInterfaceException - if an FSA related error occurs during the conversion
REException - if an RE related error occurs during the conversion