P6C::IMCC::ExtRegex::CodeGen
Subclass of Regex::Rewrite (found in languages/regex/lib) for generating code that requires Perl6-specific functionality.
Regex::Rewrite
Regex::Rewrite calls methods named rewrite_X for every tree opcode X generated by the parser or adapter. (see P6C::IMCC::ExtRegex::Adapter). Each rewrite method must return an array of list ops implementing the "operation" X.
rewrite_X
X
Shortcut for creating a new list op.
Create a passthru op that inserts a PIR expression directly into the output stream.
Create a new local variable. Mainly just dispatches to P6C::IMCC::add_localvar, but also make the variable unique. Uniquer. Um... something.
The intent is to create a variable that is local to the currently-being-rewritten rule match. The reason why it can't just bounce over to the P6C routine is because we could generate multiple rule matches within one subroutine, so we need to ensure that their local variables do not collide.
Match a Perl6 string variable. $atom is a Node corresponding to the string var to match (it will have $atom->var called on it.)
Match a Perl6 array $array by doing an exact match on each element of the array. Uses rewrite_dynamic_alternate, defined in the superclass Regex::Rewrite.
Call a subrule. $rule is a P6C::rx_call.
P6C::rx_call
To install Ruby, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Ruby
CPAN shell
perl -MCPAN -e shell install Ruby
For more information on module installation, please visit the detailed CPAN module installation guide.