| 1 | 2 | ▶ | use strict; use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 2 | package Inline::C::Parser::Pegex::AST; | ||||||||||
| 3 | 2 | ▶ | use Pegex::Base; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | |||||||||||
| 5 | 2 | extends 'Pegex::Tree'; | |||||||||
| 6 | |||||||||||
| 7 | 2 | has data => {}; | |||||||||
| 8 | |||||||||||
| 9 | sub initial { | ||||||||||
| 10 | 24 | ▶ | my ($self) = @_; | ||||||||
|
Subroutine
initial: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 11 | 24 | my $data = { | |||||||||
| 12 | functions => [], | ||||||||||
| 13 | function => {}, | ||||||||||
| 14 | done => {}, | ||||||||||
| 15 | }; | ||||||||||
| 16 | 24 | $self->data($data); | |||||||||
| 17 | } | ||||||||||
| 18 | |||||||||||
| 19 | sub final { | ||||||||||
| 20 | 24 | ▶ | my ($self, $got) = @_; | ||||||||
|
Subroutine
final: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 21 | 24 | return $self->{data}; | |||||||||
| 22 | } | ||||||||||
| 23 | |||||||||||
| 24 | sub got_function_definition { | ||||||||||
| 25 | 11 | ▶ | my ($self, $ast) = @_; | ||||||||
|
Subroutine
got_function_definition: called CC=4 SCAR=13.9
Pod
undocumented
| |||||||||||
| 26 | 11 | my ($rtype, $name, $args) = @$ast; | |||||||||
| 27 | 11 | my ($rname, $rstars) = @$rtype; | |||||||||
| 28 | 11 | my $data = $self->data; | |||||||||
| 29 | 11 | my $def = $data->{function}{$name} = {}; | |||||||||
| 30 | 11 | push @{$data->{functions}}, $name; | |||||||||
| 31 | 11 | ▶ | $def->{return_type} = $rname . ($rstars ? " $rstars" : ''); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 32 | 11 | $def->{arg_names} = []; | |||||||||
| 33 | 11 | $def->{arg_types} = []; | |||||||||
| 34 | 11 | for my $arg (@$args) { | |||||||||
| 35 | 14 | my ($type, $stars, $name) = @$arg; | |||||||||
| 36 | 14 | push @{$def->{arg_names}}, $name; | |||||||||
| 37 | 14 | ▶ | push @{$def->{arg_types}}, $type . ($stars ? " $stars" : ''); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 38 | } | ||||||||||
| 39 | 11 | $data->{done}{$name} = 1; | |||||||||
| 40 | 11 | return; | |||||||||
| 41 | } | ||||||||||
| 42 | |||||||||||
| 43 | |||||||||||
| 44 | sub got_arg { | ||||||||||
| 45 | 21 | ▶ | my ($self, $ast) = @_; | ||||||||
|
Subroutine
got_arg: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 46 | 21 | pop @$ast; | |||||||||
| 47 | 21 | return $ast; | |||||||||
| 48 | } | ||||||||||
| 49 | |||||||||||
| 50 | 2 | 1; | |||||||||