line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
46
|
|
2
|
1
|
|
|
1
|
|
6
|
use warnings FATAL => 'all'; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
81
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
package MarpaX::Languages::ECMAScript::AST::Grammar; |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
# ABSTRACT: ECMAScript grammar written in Marpa BNF |
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
844
|
use MarpaX::Languages::ECMAScript::AST::Grammar::ECMAScript_262_5; |
|
1
|
|
|
|
|
22
|
|
|
1
|
|
|
|
|
42
|
|
9
|
1
|
|
|
1
|
|
8
|
use MarpaX::Languages::ECMAScript::AST::Exceptions qw/:all/; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
592
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our $VERSION = '0.018'; # VERSION |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub new { |
15
|
0
|
|
|
0
|
1
|
|
my ($class, $grammarName, %grammarSpecificOptions) = @_; |
16
|
|
|
|
|
|
|
|
17
|
0
|
|
|
|
|
|
my $self = {}; |
18
|
0
|
0
|
|
|
|
|
if (! defined($grammarName)) { |
|
|
0
|
|
|
|
|
|
19
|
0
|
|
|
|
|
|
InternalError(error => 'Usage: new($grammar_Name)'); |
20
|
|
|
|
|
|
|
} elsif ($grammarName eq 'ECMAScript-262-5') { |
21
|
0
|
|
|
|
|
|
$self->{_grammarAlias} = 'ECMAScript_262_5'; |
22
|
0
|
|
|
|
|
|
$self->{_grammar} = MarpaX::Languages::ECMAScript::AST::Grammar::ECMAScript_262_5->new(%grammarSpecificOptions); |
23
|
|
|
|
|
|
|
} else { |
24
|
0
|
|
|
|
|
|
InternalError(error => "Unsupported grammar name $grammarName"); |
25
|
|
|
|
|
|
|
} |
26
|
0
|
|
|
|
|
|
bless($self, $class); |
27
|
|
|
|
|
|
|
|
28
|
0
|
|
|
|
|
|
return $self; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub program { |
33
|
0
|
|
|
0
|
1
|
|
my ($self) = @_; |
34
|
0
|
|
|
|
|
|
return $self->{_grammar}->program; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub grammarAlias { |
39
|
0
|
|
|
0
|
1
|
|
my ($self) = @_; |
40
|
0
|
|
|
|
|
|
return $self->{_grammarAlias}; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
sub template { |
45
|
0
|
|
|
0
|
1
|
|
my ($self) = @_; |
46
|
0
|
|
|
|
|
|
return $self->{_grammar}->template; |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
sub stringNumericLiteral { |
51
|
0
|
|
|
0
|
1
|
|
my ($self) = @_; |
52
|
0
|
|
|
|
|
|
return $self->{_grammar}->stringNumericLiteral; |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
sub pattern { |
57
|
0
|
|
|
0
|
1
|
|
my ($self) = @_; |
58
|
0
|
|
|
|
|
|
return $self->{_grammar}->pattern; |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
sub JSON { |
63
|
0
|
|
|
0
|
1
|
|
my ($self) = @_; |
64
|
0
|
|
|
|
|
|
return $self->{_grammar}->JSON; |
65
|
|
|
|
|
|
|
} |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
sub URI { |
69
|
0
|
|
|
0
|
1
|
|
my ($self) = @_; |
70
|
0
|
|
|
|
|
|
return $self->{_grammar}->URI; |
71
|
|
|
|
|
|
|
} |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
sub spacesAny { |
75
|
0
|
|
|
0
|
1
|
|
my ($self) = @_; |
76
|
0
|
|
|
|
|
|
return $self->{_grammar}->spacesAny; |
77
|
|
|
|
|
|
|
} |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
1; |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
__END__ |