line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
2
|
|
|
2
|
|
9
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
85
|
|
2
|
2
|
|
|
2
|
|
11
|
use warnings FATAL => 'all'; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
105
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
package MarpaX::Languages::C::AST::Grammar; |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
# ABSTRACT: C grammar written in Marpa BNF |
7
|
|
|
|
|
|
|
|
8
|
2
|
|
|
2
|
|
1828
|
use MarpaX::Languages::C::AST::Grammar::ISO_ANSI_C_2011; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
81
|
|
9
|
2
|
|
|
2
|
|
17
|
use Carp qw/croak/; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
463
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our $VERSION = '0.45'; # VERSION |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub new { |
15
|
1
|
|
|
1
|
1
|
2
|
my $class = shift; |
16
|
1
|
|
|
|
|
2
|
my $grammarName = shift; |
17
|
|
|
|
|
|
|
|
18
|
1
|
|
|
|
|
3
|
my $self = {}; |
19
|
1
|
50
|
|
|
|
6
|
if (! defined($grammarName)) { |
|
|
50
|
|
|
|
|
|
20
|
0
|
|
|
|
|
0
|
croak 'Usage: new($grammar_Name)'; |
21
|
|
|
|
|
|
|
} elsif ($grammarName eq 'ISO-ANSI-C-2011') { |
22
|
1
|
|
|
|
|
9
|
$self->{_grammar} = MarpaX::Languages::C::AST::Grammar::ISO_ANSI_C_2011->new(@_); |
23
|
|
|
|
|
|
|
} else { |
24
|
0
|
|
|
|
|
0
|
croak "Unsupported grammar name $grammarName"; |
25
|
|
|
|
|
|
|
} |
26
|
1
|
|
|
|
|
21
|
bless($self, $class); |
27
|
|
|
|
|
|
|
|
28
|
1
|
|
|
|
|
5
|
return $self; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub content { |
33
|
1
|
|
|
1
|
1
|
2
|
my ($self) = @_; |
34
|
1
|
|
|
|
|
6
|
return $self->{_grammar}->content(@_); |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub grammar_option { |
39
|
1
|
|
|
1
|
1
|
2
|
my ($self) = @_; |
40
|
1
|
|
|
|
|
18
|
return $self->{_grammar}->grammar_option(@_); |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
sub recce_option { |
45
|
1
|
|
|
1
|
1
|
1
|
my ($self) = @_; |
46
|
1
|
|
|
|
|
9
|
return $self->{_grammar}->recce_option(@_); |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
1; |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
__END__ |