abc::Grammar::Actions - ast transformations for abc
This file contains the methods that are used by the parse grammar to build the PAST representation of an abc program. Each method below corresponds to a rule in grammar.pg, and is invoked at the point where {*} appears in the rule, with the current match object as the first argument. If the line containing {*} also has a #= key comment, then the value of the comment is passed as the second argument to the method.
{*}
#= key
Some hopefully helpful hints for reading this file:
It often helps to refer to the rules in grammar.pg when looking at the corresponding methods here.
Within a method, $<foo> refers to the named capture foo within the $/ match object. Normally this is either another match object or an array of match objects.
$<foo>
foo
$/
The make function and $(...) are used to set and retrieve the result object for a match. Here, we use the result object to hold the ast representation of any given match. So, in the code below, whenever you see an expression like $($<foo>), we're really saying "the ast of <foo>".
make
$(...)
$($<foo>)
<foo>
To install Parrot::PMC, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Parrot::PMC
CPAN shell
perl -MCPAN -e shell install Parrot::PMC
For more information on module installation, please visit the detailed CPAN module installation guide.