line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
24
|
|
2
|
1
|
|
|
1
|
|
3
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
91
|
|
3
|
|
|
|
|
|
|
package Lox::Expr; |
4
|
|
|
|
|
|
|
our $VERSION = 0.02; |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
sub new { |
7
|
2
|
|
|
2
|
0
|
5
|
my ($class, $args) = @_; |
8
|
2
|
|
|
|
|
9
|
return bless { %$args }, $class; |
9
|
|
|
|
|
|
|
} |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
package Lox::Expr::Variable; |
12
|
1
|
|
|
1
|
|
6
|
use parent -norequire, 'Lox::Expr'; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
6
|
|
13
|
|
|
|
|
|
|
our $VERSION = 0.02; |
14
|
|
|
|
|
|
|
|
15
|
1
|
|
|
1
|
|
5
|
sub name { $_[0]->{name} } |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub accept { |
18
|
2
|
|
|
2
|
|
3
|
my ($self, $visitor) = @_; |
19
|
2
|
|
|
|
|
7
|
return $visitor->visit_variable_expr($self); |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
package Lox::Expr::Unary; |
23
|
1
|
|
|
1
|
|
118
|
use parent -norequire, 'Lox::Expr'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
4
|
|
24
|
|
|
|
|
|
|
our $VERSION = 0.02; |
25
|
0
|
|
|
0
|
|
0
|
sub operator { $_[0]->{operator} } |
26
|
0
|
|
|
0
|
|
0
|
sub right { $_[0]->{right} } |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub accept { |
29
|
0
|
|
|
0
|
|
0
|
my ($self, $visitor) = @_; |
30
|
0
|
|
|
|
|
0
|
return $visitor->visit_unary_expr($self); |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
package Lox::Expr::Assign; |
34
|
1
|
|
|
1
|
|
147
|
use parent -norequire, 'Lox::Expr'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
3
|
|
35
|
|
|
|
|
|
|
our $VERSION = 0.02; |
36
|
0
|
|
|
0
|
|
0
|
sub name { $_[0]->{name} } |
37
|
0
|
|
|
0
|
|
0
|
sub value { $_[0]->{value} } |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub accept { |
40
|
0
|
|
|
0
|
|
0
|
my ($self, $visitor) = @_; |
41
|
0
|
|
|
|
|
0
|
return $visitor->visit_assign_expr($self); |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
package Lox::Expr::Binary; |
45
|
1
|
|
|
1
|
|
124
|
use parent -norequire, 'Lox::Expr'; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
3
|
|
46
|
|
|
|
|
|
|
our $VERSION = 0.02; |
47
|
0
|
|
|
0
|
|
0
|
sub left { $_[0]->{left} } |
48
|
0
|
|
|
0
|
|
0
|
sub operator { $_[0]->{operator} } |
49
|
0
|
|
|
0
|
|
0
|
sub right { $_[0]->{right} } |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
sub accept { |
52
|
0
|
|
|
0
|
|
0
|
my ($self, $visitor) = @_; |
53
|
0
|
|
|
|
|
0
|
return $visitor->visit_binary_expr($self); |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
package Lox::Expr::Call; |
57
|
1
|
|
|
1
|
|
151
|
use parent -norequire, 'Lox::Expr'; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
34
|
|
58
|
|
|
|
|
|
|
our $VERSION = 0.02; |
59
|
0
|
|
|
0
|
|
0
|
sub arguments { $_[0]->{arguments} } |
60
|
0
|
|
|
0
|
|
0
|
sub callee { $_[0]->{callee} } |
61
|
0
|
|
|
0
|
|
0
|
sub paren { $_[0]->{paren} } |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
sub accept { |
64
|
0
|
|
|
0
|
|
0
|
my ($self, $visitor) = @_; |
65
|
0
|
|
|
|
|
0
|
return $visitor->visit_call_expr($self); |
66
|
|
|
|
|
|
|
} |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
package Lox::Expr::Get; |
69
|
1
|
|
|
1
|
|
172
|
use parent -norequire, 'Lox::Expr'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
3
|
|
70
|
|
|
|
|
|
|
our $VERSION = 0.02; |
71
|
0
|
|
|
0
|
|
0
|
sub name { $_[0]->{name} } |
72
|
0
|
|
|
0
|
|
0
|
sub object { $_[0]->{object} } |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
sub accept { |
75
|
0
|
|
|
0
|
|
0
|
my ($self, $visitor) = @_; |
76
|
0
|
|
|
|
|
0
|
return $visitor->visit_get_expr($self); |
77
|
|
|
|
|
|
|
} |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
package Lox::Expr::Function; |
80
|
1
|
|
|
1
|
|
132
|
use parent -norequire, 'Lox::Expr'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
3
|
|
81
|
|
|
|
|
|
|
our $VERSION = 0.02; |
82
|
0
|
|
|
0
|
|
0
|
sub params { $_[0]->{params} } |
83
|
0
|
|
|
0
|
|
0
|
sub body { $_[0]->{body} } |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
sub accept { |
86
|
0
|
|
|
0
|
|
0
|
my ($self, $visitor) = @_; |
87
|
0
|
|
|
|
|
0
|
return $visitor->visit_function_expr($self); |
88
|
|
|
|
|
|
|
} |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
package Lox::Expr::Grouping; |
91
|
1
|
|
|
1
|
|
129
|
use parent -norequire, 'Lox::Expr'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
3
|
|
92
|
|
|
|
|
|
|
our $VERSION = 0.02; |
93
|
0
|
|
|
0
|
|
0
|
sub expression { $_[0]->{expression} } |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
sub accept { |
96
|
0
|
|
|
0
|
|
0
|
my ($self, $visitor) = @_; |
97
|
0
|
|
|
|
|
0
|
return $visitor->visit_grouping_expr($self); |
98
|
|
|
|
|
|
|
} |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
package Lox::Expr::Literal; |
101
|
1
|
|
|
1
|
|
110
|
use parent -norequire, 'Lox::Expr'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
9
|
|
102
|
|
|
|
|
|
|
our $VERSION = 0.02; |
103
|
1
|
|
|
1
|
|
3
|
sub value { $_[0]->{value} } |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
sub accept { |
106
|
2
|
|
|
2
|
|
3
|
my ($self, $visitor) = @_; |
107
|
2
|
|
|
|
|
8
|
return $visitor->visit_literal_expr($self); |
108
|
|
|
|
|
|
|
} |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
package Lox::Expr::Logical; |
111
|
1
|
|
|
1
|
|
91
|
use parent -norequire, 'Lox::Expr'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
3
|
|
112
|
|
|
|
|
|
|
our $VERSION = 0.02; |
113
|
0
|
|
|
0
|
|
|
sub left { $_[0]->{left} } |
114
|
0
|
|
|
0
|
|
|
sub operator { $_[0]->{operator} } |
115
|
0
|
|
|
0
|
|
|
sub right { $_[0]->{right} } |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
sub accept { |
118
|
0
|
|
|
0
|
|
|
my ($self, $visitor) = @_; |
119
|
0
|
|
|
|
|
|
return $visitor->visit_logical_expr($self); |
120
|
|
|
|
|
|
|
} |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
package Lox::Expr::Set; |
123
|
1
|
|
|
1
|
|
158
|
use parent -norequire, 'Lox::Expr'; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
3
|
|
124
|
|
|
|
|
|
|
our $VERSION = 0.02; |
125
|
0
|
|
|
0
|
|
|
sub name { $_[0]->{name} } |
126
|
0
|
|
|
0
|
|
|
sub object { $_[0]->{object} } |
127
|
0
|
|
|
0
|
|
|
sub value { $_[0]->{value} } |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
sub accept { |
130
|
0
|
|
|
0
|
|
|
my ($self, $visitor) = @_; |
131
|
0
|
|
|
|
|
|
return $visitor->visit_set_expr($self); |
132
|
|
|
|
|
|
|
} |
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
package Lox::Expr::Super; |
135
|
1
|
|
|
1
|
|
149
|
use parent -norequire, 'Lox::Expr'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
3
|
|
136
|
|
|
|
|
|
|
our $VERSION = 0.02; |
137
|
0
|
|
|
0
|
|
|
sub keyword { $_[0]->{keyword} } |
138
|
0
|
|
|
0
|
|
|
sub method { $_[0]->{method} } |
139
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
sub accept { |
141
|
0
|
|
|
0
|
|
|
my ($self, $visitor) = @_; |
142
|
0
|
|
|
|
|
|
return $visitor->visit_super_expr($self); |
143
|
|
|
|
|
|
|
} |
144
|
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
package Lox::Expr::This; |
146
|
1
|
|
|
1
|
|
107
|
use parent -norequire, 'Lox::Expr'; |
|
1
|
|
|
|
|
8
|
|
|
1
|
|
|
|
|
4
|
|
147
|
|
|
|
|
|
|
our $VERSION = 0.02; |
148
|
0
|
|
|
0
|
|
|
sub keyword { $_[0]->{keyword} } |
149
|
0
|
|
|
0
|
|
|
sub name { $_[0]->keyword } |
150
|
|
|
|
|
|
|
|
151
|
|
|
|
|
|
|
sub accept { |
152
|
0
|
|
|
0
|
|
|
my ($self, $visitor) = @_; |
153
|
0
|
|
|
|
|
|
return $visitor->visit_this_expr($self); |
154
|
|
|
|
|
|
|
} |
155
|
|
|
|
|
|
|
|
156
|
|
|
|
|
|
|
1; |