line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
2
|
|
|
2
|
|
8
|
use strict; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
51
|
|
2
|
2
|
|
|
2
|
|
6
|
use warnings FATAL => 'all'; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
64
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
package MarpaX::Languages::C::AST::Grammar; |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
# ABSTRACT: C grammar written in Marpa BNF |
7
|
|
|
|
|
|
|
|
8
|
2
|
|
|
2
|
|
1225
|
use MarpaX::Languages::C::AST::Grammar::ISO_ANSI_C_2011; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
55
|
|
9
|
2
|
|
|
2
|
|
11
|
use Carp qw/croak/; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
377
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our $VERSION = '0.46'; # VERSION |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub new { |
15
|
1
|
|
|
1
|
1
|
3
|
my $class = shift; |
16
|
1
|
|
|
|
|
1
|
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
|
|
|
|
|
15
|
bless($self, $class); |
27
|
|
|
|
|
|
|
|
28
|
1
|
|
|
|
|
4
|
return $self; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub content { |
33
|
1
|
|
|
1
|
1
|
2
|
my ($self) = @_; |
34
|
1
|
|
|
|
|
7
|
return $self->{_grammar}->content(@_); |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub grammar_option { |
39
|
1
|
|
|
1
|
1
|
3
|
my ($self) = @_; |
40
|
1
|
|
|
|
|
8
|
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__ |