line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
2
|
|
|
2
|
|
7
|
use strict; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
68
|
|
2
|
2
|
|
|
2
|
|
9
|
use warnings FATAL => 'all'; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
87
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
package MarpaX::Languages::C::AST::Grammar; |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
# ABSTRACT: C grammar written in Marpa BNF |
7
|
|
|
|
|
|
|
|
8
|
2
|
|
|
2
|
|
1086
|
use MarpaX::Languages::C::AST::Grammar::ISO_ANSI_C_2011; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
62
|
|
9
|
2
|
|
|
2
|
|
9
|
use Carp qw/croak/; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
414
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our $VERSION = '0.47'; # VERSION |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub new { |
15
|
1
|
|
|
1
|
1
|
2
|
my $class = shift; |
16
|
1
|
|
|
|
|
2
|
my $grammarName = shift; |
17
|
|
|
|
|
|
|
|
18
|
1
|
|
|
|
|
2
|
my $self = {}; |
19
|
1
|
50
|
|
|
|
5
|
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
|
|
|
|
|
13
|
bless($self, $class); |
27
|
|
|
|
|
|
|
|
28
|
1
|
|
|
|
|
3
|
return $self; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub content { |
33
|
1
|
|
|
1
|
1
|
1
|
my ($self) = @_; |
34
|
1
|
|
|
|
|
4
|
return $self->{_grammar}->content(@_); |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub grammar_option { |
39
|
1
|
|
|
1
|
1
|
2
|
my ($self) = @_; |
40
|
1
|
|
|
|
|
10
|
return $self->{_grammar}->grammar_option(@_); |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
sub recce_option { |
45
|
1
|
|
|
1
|
1
|
2
|
my ($self) = @_; |
46
|
1
|
|
|
|
|
4
|
return $self->{_grammar}->recce_option(@_); |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
1; |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
__END__ |