From: notifies s. of c. c. <per...@li...> - 2007-02-14 16:01:57
|
Revision: 88 http://svn.sourceforge.net/perl-flat/?rev=88&view=rev Author: estrabd Date: 2007-02-14 08:01:27 -0800 (Wed, 14 Feb 2007) Log Message: ----------- one liners looking good! Modified Paths: -------------- trunk/perl-flat/lib/FLAT.pm Modified: trunk/perl-flat/lib/FLAT.pm =================================================================== --- trunk/perl-flat/lib/FLAT.pm 2007-02-14 06:37:25 UTC (rev 87) +++ trunk/perl-flat/lib/FLAT.pm 2007-02-14 16:01:27 UTC (rev 88) @@ -58,9 +58,8 @@ } } -# Support for perl one liners - like what CPAN.pm uses -use Exporter (); -@ISA = 'Exporter'; +# Support for perl one liners - like what CPAN.pm uses #<- should move all to another file +use base 'Exporter'; #instead of: use Exporter (); @ISA = 'Exporter'; use vars qw(@EXPORT $AUTOLOAD); @EXPORT = qw(compare @@ -69,7 +68,8 @@ nfa2dot pfa2dot random_pre - random_re + random_re + help ); # Todo: validate, test (string against re), validate (re), @@ -87,6 +87,23 @@ package FLAT::OneLiners; +sub help { +print <<END +%perl -MFLAT -e + "compare 're1','re2'" + "dump 're1'" + "dfa2dot 're1'" + "nfa2dot 're1'" + "pfa2dot 're1'" + random_pre + random_re + help + To Do: + "getstrings 're1' [opts...]" # given regex, pump strings based on options + "variations 're1' [opts...]" # given regex will provide equivalents +END +} + # dumps parse tree # Usage: # perl -MFLAT -e "dump('a&b&c&d*e*')" @@ -135,7 +152,7 @@ # Usage: # perl -MFLAT -e "compare('a','a&b&c&d*e*')" #<-- no match, btw sub compare { - shift; + shift; use FLAT::Regex::WithExtraOps; use FLAT::DFA; use FLAT::PFA; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |