line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Mylisp::SppGrammar;
|
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
20
|
use 5.012;
|
|
1
|
|
|
|
|
5
|
|
4
|
1
|
|
|
1
|
|
8
|
use experimental 'switch';
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
6
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
130
|
use Exporter;
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
158
|
|
7
|
|
|
|
|
|
|
our @ISA = qw(Exporter);
|
8
|
|
|
|
|
|
|
our @EXPORT = qw(GetSppGrammar);
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub GetSppGrammar {
|
11
|
|
|
|
|
|
|
return <<'EOF'
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
door -> |\s+ _comm Spec|+ $
|
14
|
|
|
|
|
|
|
_comm -> '#'~$$
|
15
|
|
|
|
|
|
|
Spec -> Token '->' | Blank Branch atom |+| \v $ |
|
16
|
|
|
|
|
|
|
Blank -> \h+
|
17
|
|
|
|
|
|
|
atom -> |
|
18
|
|
|
|
|
|
|
Group Token Str String Kstr
|
19
|
|
|
|
|
|
|
Cclass Char Chclass Sym Expr
|
20
|
|
|
|
|
|
|
Assert Any Rept Till
|
21
|
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
Branch -> '|' | \s+ _comm atom |+ '|'
|
23
|
|
|
|
|
|
|
Group -> '{' | \s+ _comm Branch atom |+ '}'
|
24
|
|
|
|
|
|
|
Token -> [\a\-]+
|
25
|
|
|
|
|
|
|
Kstr -> ':'[\a\-]+
|
26
|
|
|
|
|
|
|
Str -> \'| [^\\']+ {\\.} |+\'
|
27
|
|
|
|
|
|
|
String -> \"| [^\\"]+ {\\.} |+\"
|
28
|
|
|
|
|
|
|
Cclass -> \\[adhlsuvwxADHLSUVWX]
|
29
|
|
|
|
|
|
|
Char -> \\.
|
30
|
|
|
|
|
|
|
Chclass -> \[ Flip?|\s Cclass Char Range Cchar|+ \]
|
31
|
|
|
|
|
|
|
Flip -> '^'
|
32
|
|
|
|
|
|
|
Range -> \w\-\w
|
33
|
|
|
|
|
|
|
Cchar -> [^ \s \] \# \\ ]
|
34
|
|
|
|
|
|
|
Assert -> | '^^' '$$' '^' '$' |
|
35
|
|
|
|
|
|
|
Any -> '.'
|
36
|
|
|
|
|
|
|
Rept -> [?*+]
|
37
|
|
|
|
|
|
|
Till -> '~'
|
38
|
|
|
|
|
|
|
Sym -> [@$][\a\-]+
|
39
|
|
|
|
|
|
|
Sub -> [\a\-]+
|
40
|
|
|
|
|
|
|
Expr -> '(' eatom+ ')'
|
41
|
|
|
|
|
|
|
Array -> '[' eatom* ']'
|
42
|
|
|
|
|
|
|
eatom -> | Array Sub Sym Kstr |
|
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
EOF
|
45
|
0
|
|
|
0
|
0
|
|
}
|
46
|
|
|
|
|
|
|
1;
|