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