⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 evalre.pl.svn-base

📁 这是一个DFA简化和生成LL(1)分析表的程序,自动生成表格及图形
💻 SVN-BASE
字号:
#: evalre.pl#: evaluate regex using Perl or C#: 2006-05-19 2006-05-19use strict;use warnings;use re::DFA::Perl;use re::DFA::C;use Getopt::Std;my %opts;getopts('hpc', \%opts);if ($opts{h}) {    Usage(0);}if (@ARGV != 2) {    Usage(1);}sub Usage {    my $code = shift;    my $msg = "Usage: re2c [-p] [-c] <regex> <text>\n";    if ($code == 0) {        print $msg;        exit(0);    } else {        warn $msg;        exit($code);    }}if ($opts{p} and $opts{c}) {    die "error: Only one of the C and Perl emitters should be selected.\n";}my ($regex, $text) = @ARGV;my $match;if ($opts{c}) {    *match = re::DFA::C->as_method($regex);    $match = match($text);} else {    *match = re::DFA::Perl->as_method($regex);    $match = match($text);}if (defined $match) {    $match =~ s/'/\\'/g;    print "match: '$match'\n";} else {    print "fail to match";    exit(1);}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -