line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Mylisp::MyGrammar;
|
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
21
|
use 5.012;
|
|
1
|
|
|
|
|
4
|
|
4
|
1
|
|
|
1
|
|
8
|
use experimental 'switch';
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
6
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
127
|
use Exporter;
|
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
142
|
|
7
|
|
|
|
|
|
|
our @ISA = qw(Exporter);
|
8
|
|
|
|
|
|
|
our @EXPORT = qw(GetMyGrammar);
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub GetMyGrammar {
|
11
|
|
|
|
|
|
|
return <<'EOF'
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
door -> |_comm \s+ Expr|+ $
|
14
|
|
|
|
|
|
|
_comm -> '#'~$$
|
15
|
|
|
|
|
|
|
Expr -> '(' atom+ ')'
|
16
|
|
|
|
|
|
|
atom -> |\s+ _comm Expr Array Hash Int Kstr
|
17
|
|
|
|
|
|
|
Lstr Str String Char
|
18
|
|
|
|
|
|
|
Aindex Arange Ocall Oper Arg Var Sub|
|
19
|
|
|
|
|
|
|
Array -> '[' atom+ ']'
|
20
|
|
|
|
|
|
|
Hash -> '{' |\s+ Pair|+ '}'
|
21
|
|
|
|
|
|
|
Pair -> Kstr '=>' |Kstr Var Sub Int|
|
22
|
|
|
|
|
|
|
Int -> \-?\d+
|
23
|
|
|
|
|
|
|
Char -> \\.
|
24
|
|
|
|
|
|
|
Kstr -> \:[\w\-:]+
|
25
|
|
|
|
|
|
|
Lstr -> \'\'\'~{\'\'\'}
|
26
|
|
|
|
|
|
|
Str -> \'| [^\\']+ {\\.} |+\'
|
27
|
|
|
|
|
|
|
String -> \"| [^\\"]+ {\\.} |+\"
|
28
|
|
|
|
|
|
|
Aindex -> Var{'['| Int Kstr Str Var |']'}+
|
29
|
|
|
|
|
|
|
Arange -> Var'['| Int Var | ':' | Int Var |?']'
|
30
|
|
|
|
|
|
|
Ocall -> Var\.Sub
|
31
|
|
|
|
|
|
|
Oper -> [\-+=>
|
32
|
|
|
|
|
|
|
Arg -> [$@]name[:][\a\-?+|]+
|
33
|
|
|
|
|
|
|
Var -> [$@]name
|
34
|
|
|
|
|
|
|
Sub -> name{'::'name}*
|
35
|
|
|
|
|
|
|
name -> [\a\-]+
|
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
EOF
|
38
|
0
|
|
|
0
|
0
|
|
}
|
39
|
|
|
|
|
|
|
1;
|