| 1 | 3 | ▶ | use strict; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 2 | 3 | ▶ | use warnings FATAL => 'all'; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 3 | |||||||||||||||
| 4 | package MarpaX::Languages::ECMAScript::AST::Grammar; | ||||||||||||||
| 5 | |||||||||||||||
| 6 | # ABSTRACT: ECMAScript grammar written in Marpa BNF | ||||||||||||||
| 7 | |||||||||||||||
| 8 | 3 | ▶ | use MarpaX::Languages::ECMAScript::AST::Grammar::ECMAScript_262_5; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 9 | 3 | ▶ | use MarpaX::Languages::ECMAScript::AST::Exceptions qw/:all/; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 10 | |||||||||||||||
| 11 | 3 | our $VERSION = '0.020'; # VERSION | |||||||||||||
| 12 | |||||||||||||||
| 13 | |||||||||||||||
| 14 | 0 | ▶ | sub new { | ||||||||||||
|
Subroutine
new: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||
| 15 | 0 | my ($class, $grammarName, %grammarSpecificOptions) = @_; | |||||||||||||
| 16 | |||||||||||||||
| 17 | 0 | my $self = {}; | |||||||||||||
| 18 | 0 | ▶ | if (! defined($grammarName)) { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 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 | 0 | ▶ | sub program { | ||||||||||||
|
Subroutine
program: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||
| 33 | 0 | my ($self) = @_; | |||||||||||||
| 34 | 0 | return $self->{_grammar}->program; | |||||||||||||
| 35 | } | ||||||||||||||
| 36 | |||||||||||||||
| 37 | |||||||||||||||
| 38 | 0 | ▶ | sub grammarAlias { | ||||||||||||
|
Subroutine
grammarAlias: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||
| 39 | 0 | my ($self) = @_; | |||||||||||||
| 40 | 0 | return $self->{_grammarAlias}; | |||||||||||||
| 41 | } | ||||||||||||||
| 42 | |||||||||||||||
| 43 | |||||||||||||||
| 44 | 0 | ▶ | sub template { | ||||||||||||
|
Subroutine
template: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||
| 45 | 0 | my ($self) = @_; | |||||||||||||
| 46 | 0 | return $self->{_grammar}->template; | |||||||||||||
| 47 | } | ||||||||||||||
| 48 | |||||||||||||||
| 49 | |||||||||||||||
| 50 | 0 | ▶ | sub stringNumericLiteral { | ||||||||||||
|
Subroutine
stringNumericLiteral: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||
| 51 | 0 | my ($self) = @_; | |||||||||||||
| 52 | 0 | return $self->{_grammar}->stringNumericLiteral; | |||||||||||||
| 53 | } | ||||||||||||||
| 54 | |||||||||||||||
| 55 | |||||||||||||||
| 56 | 0 | ▶ | sub pattern { | ||||||||||||
|
Subroutine
pattern: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||
| 57 | 0 | my ($self) = @_; | |||||||||||||
| 58 | 0 | return $self->{_grammar}->pattern; | |||||||||||||
| 59 | } | ||||||||||||||
| 60 | |||||||||||||||
| 61 | |||||||||||||||
| 62 | 0 | ▶ | sub JSON { | ||||||||||||
|
Subroutine
JSON: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||
| 63 | 0 | my ($self) = @_; | |||||||||||||
| 64 | 0 | return $self->{_grammar}->JSON; | |||||||||||||
| 65 | } | ||||||||||||||
| 66 | |||||||||||||||
| 67 | |||||||||||||||
| 68 | 0 | ▶ | sub URI { | ||||||||||||
|
Subroutine
URI: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||
| 69 | 0 | my ($self) = @_; | |||||||||||||
| 70 | 0 | return $self->{_grammar}->URI; | |||||||||||||
| 71 | } | ||||||||||||||
| 72 | |||||||||||||||
| 73 | |||||||||||||||
| 74 | 0 | ▶ | sub spacesAny { | ||||||||||||
|
Subroutine
spacesAny: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||
| 75 | 0 | my ($self) = @_; | |||||||||||||
| 76 | 0 | return $self->{_grammar}->spacesAny; | |||||||||||||
| 77 | } | ||||||||||||||
| 78 | |||||||||||||||
| 79 | |||||||||||||||
| 80 | 3 | 1; | |||||||||||||
| 81 | |||||||||||||||
| 82 | __END__ | ||||||||||||||