| 1 | 260 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 2 | 260 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 3 | 260 | our $VERSION = 0.02; | |
| 4 | |||
| 5 | package Lox::Stmt; | ||
| 6 | 1448 | ▶ | sub new { |
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 7 | 1448 | my ($class, $args) = @_; | |
| 8 | 1448 | return bless { %$args }, $class; | |
| 9 | } | ||
| 10 | |||
| 11 | package Lox::Stmt::Break; | ||
| 12 | 260 | ▶ | use parent -norequire, 'Lox::Stmt'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 13 | |||
| 14 | 4 | ▶ | sub accept { |
|
Subroutine
accept: called CC=1 SCAR=0.0
| |||
| 15 | 4 | my ($self, $visitor) = @_; | |
| 16 | 4 | return $visitor->visit_break_stmt($self); | |
| 17 | } | ||
| 18 | |||
| 19 | package Lox::Stmt::Block; | ||
| 20 | 260 | ▶ | use parent -norequire, 'Lox::Stmt'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 21 | 167 | ▶ | sub statements { $_[0]->{statements} } |
|
Subroutine
statements: called CC=1 SCAR=0.0
| |||
| 22 | |||
| 23 | 167 | ▶ | sub accept { |
|
Subroutine
accept: called CC=1 SCAR=0.0
| |||
| 24 | 167 | my ($self, $visitor) = @_; | |
| 25 | 167 | return $visitor->visit_block_stmt($self); | |
| 26 | } | ||
| 27 | |||
| 28 | package Lox::Stmt::Class; | ||
| 29 | 260 | ▶ | use parent -norequire, 'Lox::Stmt'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 30 | 469 | ▶ | sub name { $_[0]->{name} } |
|
Subroutine
name: called CC=1 SCAR=0.0
| |||
| 31 | 178 | ▶ | sub methods { $_[0]->{methods} } |
|
Subroutine
methods: called CC=1 SCAR=0.0
| |||
| 32 | 274 | ▶ | sub superclass { $_[0]->{superclass} } |
|
Subroutine
superclass: called CC=1 SCAR=0.0
| |||
| 33 | |||
| 34 | 181 | ▶ | sub accept { |
|
Subroutine
accept: called CC=1 SCAR=0.0
| |||
| 35 | 181 | my ($self, $visitor) = @_; | |
| 36 | 181 | return $visitor->visit_class_stmt($self); | |
| 37 | } | ||
| 38 | |||
| 39 | package Lox::Stmt::Expression; | ||
| 40 | 260 | ▶ | use parent -norequire, 'Lox::Stmt'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 41 | 565 | ▶ | sub expression { $_[0]->{expression} } |
|
Subroutine
expression: called CC=1 SCAR=0.0
| |||
| 42 | |||
| 43 | 565 | ▶ | sub accept { |
|
Subroutine
accept: called CC=1 SCAR=0.0
| |||
| 44 | 565 | my ($self, $visitor) = @_; | |
| 45 | 565 | return $visitor->visit_expression_stmt($self); | |
| 46 | } | ||
| 47 | |||
| 48 | package Lox::Stmt::Function; | ||
| 49 | 260 | ▶ | use parent -norequire, 'Lox::Stmt'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 50 | 492 | ▶ | sub name { $_[0]->{name} } |
|
Subroutine
name: called CC=1 SCAR=0.0
| |||
| 51 | 1226 | ▶ | sub params { $_[0]->{params} } |
|
Subroutine
params: called CC=1 SCAR=0.0
| |||
| 52 | 448 | ▶ | sub body { $_[0]->{body} } |
|
Subroutine
body: called CC=1 SCAR=0.0
| |||
| 53 | |||
| 54 | 156 | ▶ | sub accept { |
|
Subroutine
accept: called CC=1 SCAR=0.0
| |||
| 55 | 156 | my ($self, $visitor) = @_; | |
| 56 | 156 | return $visitor->visit_function_stmt($self); | |
| 57 | } | ||
| 58 | |||
| 59 | package Lox::Stmt::If; | ||
| 60 | 260 | ▶ | use parent -norequire, 'Lox::Stmt'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 61 | 365 | ▶ | sub condition { $_[0]->{condition} } |
|
Subroutine
condition: called CC=1 SCAR=0.0
| |||
| 62 | 197 | ▶ | sub then_branch { $_[0]->{then_branch} } |
|
Subroutine
then_branch: called CC=1 SCAR=0.0
| |||
| 63 | 238 | ▶ | sub else_branch { $_[0]->{else_branch} } |
|
Subroutine
else_branch: called CC=1 SCAR=0.0
| |||
| 64 | |||
| 65 | 365 | ▶ | sub accept { |
|
Subroutine
accept: called CC=1 SCAR=0.0
| |||
| 66 | 365 | my ($self, $visitor) = @_; | |
| 67 | 365 | return $visitor->visit_if_stmt($self); | |
| 68 | } | ||
| 69 | |||
| 70 | package Lox::Stmt::Print; | ||
| 71 | 260 | ▶ | use parent -norequire, 'Lox::Stmt'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 72 | 932 | ▶ | sub expression { $_[0]->{expression} } |
|
Subroutine
expression: called CC=1 SCAR=0.0
| |||
| 73 | |||
| 74 | 932 | ▶ | sub accept { |
|
Subroutine
accept: called CC=1 SCAR=0.0
| |||
| 75 | 932 | my ($self, $visitor) = @_; | |
| 76 | 932 | return $visitor->visit_print_stmt($self); | |
| 77 | } | ||
| 78 | |||
| 79 | package Lox::Stmt::Return; | ||
| 80 | 260 | ▶ | use parent -norequire, 'Lox::Stmt'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 81 | 1 | ▶ | sub keyword { $_[0]->{keyword} } |
|
Subroutine
keyword: called CC=1 SCAR=0.0
| |||
| 82 | 867 | ▶ | sub value { $_[0]->{value} } |
|
Subroutine
value: called CC=1 SCAR=0.0
| |||
| 83 | |||
| 84 | 438 | ▶ | sub accept { |
|
Subroutine
accept: called CC=1 SCAR=0.0
| |||
| 85 | 438 | my ($self, $visitor) = @_; | |
| 86 | 438 | return $visitor->visit_return_stmt($self); | |
| 87 | } | ||
| 88 | |||
| 89 | package Lox::Stmt::Var; | ||
| 90 | 260 | ▶ | use parent -norequire, 'Lox::Stmt'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 91 | 467 | ▶ | sub name { $_[0]->{name} } |
|
Subroutine
name: called CC=1 SCAR=0.0
| |||
| 92 | 452 | ▶ | sub initializer { $_[0]->{initializer} } |
|
Subroutine
initializer: called CC=1 SCAR=0.0
| |||
| 93 | |||
| 94 | 313 | ▶ | sub accept { |
|
Subroutine
accept: called CC=1 SCAR=0.0
| |||
| 95 | 313 | my ($self, $visitor) = @_; | |
| 96 | 313 | return $visitor->visit_var_stmt($self); | |
| 97 | } | ||
| 98 | |||
| 99 | package Lox::Stmt::While; | ||
| 100 | 260 | ▶ | use parent -norequire, 'Lox::Stmt'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 101 | 82 | ▶ | sub condition { $_[0]->{condition} } |
|
Subroutine
condition: called CC=1 SCAR=0.0
| |||
| 102 | 65 | ▶ | sub body { $_[0]->{body} } |
|
Subroutine
body: called CC=1 SCAR=0.0
| |||
| 103 | |||
| 104 | 56 | ▶ | sub accept { |
|
Subroutine
accept: called CC=1 SCAR=0.0
| |||
| 105 | 56 | my ($self, $visitor) = @_; | |
| 106 | 56 | return $visitor->visit_while_stmt($self); | |
| 107 | } | ||
| 108 | |||
| 109 | 260 | 1; | |