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. |
From: notifies s. of c. c. <per...@li...> - 2007-02-14 22:53:19
|
Revision: 89 http://svn.sourceforge.net/perl-flat/?rev=89&view=rev Author: estrabd Date: 2007-02-14 14:53:19 -0800 (Wed, 14 Feb 2007) Log Message: ----------- tet Modified Paths: -------------- trunk/perl-flat/lib/FLAT.pm Modified: trunk/perl-flat/lib/FLAT.pm =================================================================== --- trunk/perl-flat/lib/FLAT.pm 2007-02-14 16:01:27 UTC (rev 88) +++ trunk/perl-flat/lib/FLAT.pm 2007-02-14 22:53:19 UTC (rev 89) @@ -122,7 +122,9 @@ shift; use FLAT::Regex::WithExtraOps; use FLAT::DFA; - my $DFA1 = FLAT::Regex::WithExtraOps->new(shift)->as_nfa()->as_dfa->as_min_dfa(); + use FLAT::NFA; + use FLAT::PFA; + my $DFA1 = FLAT::Regex::WithExtraOps->new(shift)->as_pfa()->as_nfa()->as_dfa->as_min_dfa(); print $DFA1->as_graphviz; } @@ -132,8 +134,10 @@ sub nfa2dot { shift; use FLAT::Regex::WithExtraOps; + use FLAT::DFA; use FLAT::NFA; - my $NFA1 = FLAT::Regex::WithExtraOps->new(shift)->as_nfa(); + use FLAT::PFA; + my $NFA1 = FLAT::Regex::WithExtraOps->new(shift)->as_pfa()->as_nfa(); print $NFA1->as_graphviz; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: notifies s. of c. c. <per...@li...> - 2007-02-15 05:56:18
|
Revision: 91 http://svn.sourceforge.net/perl-flat/?rev=91&view=rev Author: estrabd Date: 2007-02-14 21:56:19 -0800 (Wed, 14 Feb 2007) Log Message: ----------- updated the help section Modified Paths: -------------- trunk/perl-flat/lib/FLAT.pm Modified: trunk/perl-flat/lib/FLAT.pm =================================================================== --- trunk/perl-flat/lib/FLAT.pm 2007-02-15 05:45:35 UTC (rev 90) +++ trunk/perl-flat/lib/FLAT.pm 2007-02-15 05:56:19 UTC (rev 91) @@ -129,9 +129,17 @@ against a regular expression, a concrete example will be provided. TO DO: - "getstrings 're1' [opts...]" # given regex, pump strings based on options - "variations 're1' [opts...]" # given regex will provide equivalents +1 Implement "getstrings 're1' [opts...]" # given regex, pump strings + based on options + +2 Implement "variations 're1' [opts...]" # given regex will provide + equivalents +3 Allow random_pre and random_re to accept the number of regexes, the + number of characters, and the character set; eventually it might be + useful to allow modification of the chances of the different operators + occuring... + CREDITS: Blockhead, CPAN.pm (for the example of how to implement these one liners), and #perl on irc.freenode.net for pointing out something I missed when This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: notifies s. of c. c. <per...@li...> - 2007-03-02 04:17:05
|
Revision: 113 http://svn.sourceforge.net/perl-flat/?rev=113&view=rev Author: estrabd Date: 2007-03-01 20:16:19 -0800 (Thu, 01 Mar 2007) Log Message: ----------- took out dependency for Sub::Recursive Modified Paths: -------------- trunk/perl-flat/lib/FLAT.pm Modified: trunk/perl-flat/lib/FLAT.pm =================================================================== --- trunk/perl-flat/lib/FLAT.pm 2007-03-02 04:14:12 UTC (rev 112) +++ trunk/perl-flat/lib/FLAT.pm 2007-03-02 04:16:19 UTC (rev 113) @@ -103,7 +103,7 @@ |____| \___ >__| |____/ \___ / |_______ (____ /____| \/ \/ \/ \/ - NB: Everything is wrt parallel regular expressions, i.e., + NB: Everything is wrt parallel regular expressions, i.e., NB: with the addtional shuffle operator, "&". All this NB: means is that you can use the ambersand (&) as a symbol NB: in the regular expressions you submit because it will be This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: notifies s. of c. c. <per...@li...> - 2007-03-02 04:17:53
|
Revision: 114 http://svn.sourceforge.net/perl-flat/?rev=114&view=rev Author: estrabd Date: 2007-03-01 20:17:49 -0800 (Thu, 01 Mar 2007) Log Message: ----------- took out dependency for Sub::Recursive Modified Paths: -------------- trunk/perl-flat/lib/FLAT.pm Modified: trunk/perl-flat/lib/FLAT.pm =================================================================== --- trunk/perl-flat/lib/FLAT.pm 2007-03-02 04:16:19 UTC (rev 113) +++ trunk/perl-flat/lib/FLAT.pm 2007-03-02 04:17:49 UTC (rev 114) @@ -107,7 +107,9 @@ NB: with the addtional shuffle operator, "&". All this NB: means is that you can use the ambersand (&) as a symbol NB: in the regular expressions you submit because it will be - NB: detected as an operator. + NB: detected as an operator.That said, if you avoid using + NB: the "&" operator, you can forget about all that shuffle + NB: business. COMMANDS: %perl -MFLAT -e This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |