Transpilation of G1 rule No $ruleId, i.e. $lhs ::= @rhs
\$value is the value of RHS No \$index (starting at 0).
Generated generic template.
Instantiate a new object. Takes as optional argument a reference to a hash that may contain the following key/values:
G1 callback (CODE ref).
G1 callback arguments (ARRAY ref). The g1 callback is called like: &$g1Callback(@{$g1CallbackArgs}, \$rc, $ruleId, $value, $index, $lhs, @rhs), where $value is the AST parse tree value of RHS No $index of this G1 rule number $ruleId, whose full definition is $lhs ::= @rhs. If the callback is defined, this will always be executed first, and it must return a true value putting its eventual result in $rc. Only when it returns true, lexemes are processed.
lexeme callback (CODE ref).
Lexeme callback arguments (ARRAY ref). The lexeme callback is called like: &$lexemeCallback(@{$lexemeCallbackArgs}, \$rc, $name, $ruleId, $value, $index, $lhs, @rhs), where $value is the AST parse tree value of RHS No $index of this G1 rule number $ruleId, whose full definition is $lhs ::= @rhs. The RHS being a lexeme, $name contains the lexeme's name. If the callback is defined, this will always be executed first, and it must return a true value putting its result in $rc, otherwise default behaviour applies: return the lexeme value as-is.
Returns the characters of lexeme inside $value, that is an array reference. C.f. grammar default lexeme action.
Returns indentation, i.e. two spaces times current number of indentations. Optional $inc is used to change the number of indentations.
Tranpiles the $ast AST, that is the parse tree value from Marpa.
To install MarpaX::Languages::ECMAScript::AST, copy and paste the appropriate command in to your terminal.
cpanm
cpanm MarpaX::Languages::ECMAScript::AST
CPAN shell
perl -MCPAN -e shell install MarpaX::Languages::ECMAScript::AST
For more information on module installation, please visit the detailed CPAN module installation guide.