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

📄 token_eq.t.svn-base

📁 这是一个DFA简化和生成LL(1)分析表的程序,自动生成表格及图形
💻 SVN-BASE
字号:
# token_eq.t# Test sub LL1::Parser::token_eq in LL1_parser.pmuse strict;use warnings;use Test::More tests => 19;use LL1_parser;*token_eq = \&LL1::Parser::token_eq;# string != stringok ! token_eq(qw[ 'a' 'b' ]), "'a' != 'b'";ok ! token_eq(qw[ 'a' 'aa' ]), "'a' != 'aa'";ok ! token_eq(qw[ 'aa' 'a' ]), "'aa' != 'a'";# regex != regexok ! token_eq(qw[ 'a' 'b' ]), "/a|b/ != /b/";ok ! token_eq(qw[ /a/ /a*/ ]), "/a/ != /a*/";ok ! token_eq(qw[ /a*/ /a/ ]), "/a*/ != /a/";# regex != stringok ! token_eq(qw[ 'ab' /a/ ]), "'ab' != /a/";ok ! token_eq(qw[ /a/ "ab" ]), '/a/ != "ab"';ok ! token_eq(qw[ /a{2}/ "aaa" ]), '/a{2}/ != "aaa"';# string == stringok token_eq(qw[ 'a' 'a' ]), "'a' == 'a'";ok token_eq(qw[ "a" 'a' ]), "\"a\" == 'a'";ok token_eq(qw[ "a" "a" ]), '"a" == "a"';ok token_eq(qw[ "\"\"" '""' ]), q/"\"\"" '""'/;# regex == stringok token_eq(qw[ 'a' /a/ ]), "'a' == /a/";ok token_eq(qw[ /a/ "a" ]), '/a/ == "a"';ok token_eq('/a{2,2}/', '"aa"'), '/a{2}/ == "aa"';# regex == regexok token_eq(qw[ /[0-9]+/ /\d+/ ]), "/[0-9]+/ == /\\d+/";ok token_eq(qw[ /\w+/ /[A-Za-z0-9_]+/ ]), "/\\w+/ == /[A-Za-z0-9_]+/";ok token_eq(qw[ /[A-Za-z]\w*/ /[a-zA-Z]\w*/ ]),    "/[A-Za-z]\\w*/ == /[a-zA-Z]\\w*/";

⌨️ 快捷键说明

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