line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
1
|
|
|
1
|
|
40871
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
40
|
|
2
|
1
|
|
|
1
|
|
4
|
use warnings FATAL => 'all'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
48
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
package MarpaX::Languages::C::Scan; |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
# ABSTRACT: C::Scan-like interface |
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
836
|
use MarpaX::Languages::C::AST::Grammar::ISO_ANSI_C_2011::Scan; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
use Carp qw/croak/; |
10
|
|
|
|
|
|
|
use Log::Any qw/$log/; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our $VERSION = '0.45'; # VERSION |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub new { |
16
|
|
|
|
|
|
|
my ($class, %options) = @_; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
my $grammarName = $options{grammarName} || 'ISO-ANSI-C-2011'; |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
if (! defined($grammarName)) { |
21
|
|
|
|
|
|
|
croak 'Usage: new($grammar_Name)'; |
22
|
|
|
|
|
|
|
} elsif ($grammarName eq 'ISO-ANSI-C-2011') { |
23
|
|
|
|
|
|
|
return MarpaX::Languages::C::AST::Grammar::ISO_ANSI_C_2011::Scan->new(%options); |
24
|
|
|
|
|
|
|
} else { |
25
|
|
|
|
|
|
|
croak "Unsupported grammar name $grammarName"; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
# ---------------------------------------------------------------------------------------- |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub replace { |
33
|
|
|
|
|
|
|
my ($self, $from, $to, $declaration, %options) = @_; |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
$log->tracef('Making as AST of %s', $declaration); |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
my $c = MarpaX::Languages::C::Scan->new(content => $declaration, %options); |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
1; |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
__END__ |