NAME
MarpaX::Languages::ECMAScript::AST::Grammar::ECMAScript_262_5::Pattern - ECMAScript-262, Edition 5, pattern grammar written in Marpa BNF
VERSION
version 0.020
SYNOPSIS
use strict;
use warnings FATAL => 'all';
use MarpaX::Languages::ECMAScript::AST::Grammar::ECMAScript_262_5::Pattern;
my $grammar = MarpaX::Languages::ECMAScript::AST::Grammar::ECMAScript_262_5::Pattern->new();
my $grammar_content = $grammar->content();
my $grammar_option = $grammar->grammar_option();
my $recce_option = $grammar->recce_option();
DESCRIPTION
This modules returns describes the ECMAScript 262, Edition 5 pattern grammar written in Marpa BNF, as of http://www.ecma-international.org/publications/standards/Ecma-262.htm, section 15.10.1. This module inherits the methods from MarpaX::Languages::ECMAScript::AST::Grammar::ECMAScript_262_5::Base package.
SUBROUTINES/METHODS
new($optionsp)
$optionsp is a reference to hash that may contain the following key/value pair:
- semantics_package
-
As per Marpa::R2, The semantics package is used when resolving action names to fully qualified Perl names. This package must support and behave as documented in the Semantics package (c.f. SEE ALSO).
make_grammar_content($class)
Returns the grammar. This will be injected in the Program's grammar.
lparen($self)
Returns current lexer left parenthesis offsets of captures.
recce_option($self)
Returns option for Marpa::R2::Scanless::R->new(), returned as a reference to a hash.
parse($self, $source, $impl)
Parse the source given as $source using implementation $impl.
value($self, $impl)
Return the parse tree (unique) value. $impl is the recognizer instance for the grammar. Will raise an InternalError exception if there is no parse tree value, or more than one parse tree value. Please note that this method explicity destroys the recognizer using $impl->destroy_R. Value itself is an AST where every string is a perl string. This a subclass of MarpaX::Languages::ECMAScript::AST::Grammar::Base::value() because the position of disjunction left parenthesis is localized, so that value() will see them.
This method is explicitely setting a localized MarpaX::Languages::ECMAScript::AST::Grammar::Pattern::lparen variable that is an array reference of all disjunctions left parenthesis locations in the regular expression perl string.
SEE ALSO
MarpaX::Languages::ECMAScript::AST::Grammar::ECMAScript_262_5::Base
MarpaX::Languages::ECMAScript::AST::Grammar::ECMAScript_262_5::Pattern::Semantics
AUTHOR
Jean-Damien Durand <jeandamiendurand@free.fr>
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.