long optimize ( ) throws RegexException { LOG . debug ( "initial cleanup" ) ; cleanup ( ) ; /* may simplify situation */ dumpnfa ( ) ; LOG . debug ( "empties" ) ; fixempties ( ) ; /* get rid of EMPTY arcs */ LOG . debug ( "constraints" ) ; pullback ( ) ; /* pull back constraints backward */ pushfwd ( ) ; /* push fwd constraints forward */ LOG . debug ( "final cleanup" ) ; cleanup ( ) ; /* final tidying */ return analyze ( ) ; /* and analysis */ }
optimize - optimize an NFA