—use
strict;
# ABSTRACT: ECMAScript-262, Edition 5, grammar
our
$VERSION
=
'0.003'
;
# VERSION
sub
new {
my
(
$class
) =
@_
;
my
$self
= {};
bless
(
$self
,
$class
);
$self
->_init();
return
$self
;
}
sub
_init {
my
(
$self
) =
@_
;
my
$grammar
= MarpaX::Languages::ECMAScript::AST::Grammar::ECMAScript_262_5::Program->new();
my
$grammar_option
=
$grammar
->grammar_option();
$grammar_option
->{bless_package} =
'ECMAScript_262_5::AST'
;
$grammar_option
->{source} = \
$grammar
->content();
my
$recce_option
=
$grammar
->recce_option();
$self
->{_program} = {
grammar
=>
$grammar
,
impl
=> MarpaX::Languages::ECMAScript::AST::Impl->new(
$grammar_option
,
$recce_option
)
};
}
sub
program {
my
(
$self
) =
@_
;
return
$self
->{_program};
}
1;
__END__
=pod
=encoding utf-8
=head1 NAME
MarpaX::Languages::ECMAScript::AST::Grammar::ECMAScript_262_5 - ECMAScript-262, Edition 5, grammar
=head1 VERSION
version 0.003
=head1 SYNOPSIS
use strict;
use warnings FATAL => 'all';
use MarpaX::Languages::ECMAScript::AST::Grammar::ECMAScript_262_5;
my $ecma = MarpaX::Languages::ECMAScript::AST::Grammar::ECMAScript_262_5->new();
my $program = $ecma->program();
=head1 DESCRIPTION
This modules returns all grammars needed for the ECMAScript 262, Edition 5 grammars written in Marpa BNF, as of L<http://www.ecma-international.org/publications/standards/Ecma-262.htm>.
=head1 SUBROUTINES/METHODS
=head2 new()
Instance a new object.
=head2 program()
Returns the program grammar as a hash reference that is
=over
=item grammar
A MarpaX::Languages::ECMAScript::AST::Grammar::Base object
=item impl
A MarpaX::Languages::ECMAScript::AST::Impl object
=back
=head1 AUTHOR
Jean-Damien Durand <jeandamiendurand@free.fr>
=head1 COPYRIGHT AND LICENSE
This software is copyright (c) 2013 by Jean-Damien Durand.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
=cut