这是一个DFA简化和生成LL(1)分析表的程序,自动生成表格及图形

源代码在线查看: re2pl.pl.svn-base

软件大小: 892 K
上传用户: maige49
关键词: DFA LL 程序
下载地址: 免注册下载 普通下载 VIP

相关代码

				#: re2pl.pl				#: Compile regex to perl lexing code				#: Copyright (c) 2006 Agent Zhang				#: 2006-05-19 2006-05-19								use strict;				use warnings;								use Getopt::Std;				use re::DFA::Perl;								my %opts;				getopts('hn:', \%opts);								if ($opts{h}) {				    Usage(0);				}								if (! @ARGV) {				    Usage(1);				}								sub Usage {				    my $code = shift;				    my $msg = "Usage: re2pl [-h] [-n ] \n";				    if ($code == 0) {				        print $msg;				        exit(0);				    } else {				        warn $msg;				        exit($code);				    }				}								my $subname = $opts{n};				my $regex = shift;				my $code = re::DFA::Perl->as_code($regex, $subname);				if (defined $code) {				    print $code;				} else {				    exit(1);				}							

相关资源