NAME ^

P6C::IMCC::ExtRegex::CodeGen

SUMMARY ^

Subclass of Regex::CodeGen (found in languages/regex/lib) for generating code that requires Perl6-specific functionality.

Regex::CodeGen calls methods named output_X for every X generated by the rewriting phase (see P6C::IMCC::ExtRegex::Rewrite). Each method must return an array of PIR statements implementing the "operation" X.

METHODS ^

output_string

Convert $atom to a string and store it in $dest.

output_array_elt

Retrieve element $index of the aggregate $array and store it into $dest.

output_array_length

Compute the length of $array and store it into $dest.

output_call_rule

Generate code for calling a subrule $rule_call within a regex tree ($rule_call is of type P6C::rx_call; see P6C::Nodes), passing $args as the arguments and getting back $results.

 $args : [ <name, type, val> ]
 $results : [ <type, val> ]
call_rule_closure

Helper function for output_call_rule when calling a closure.

call_rule_closure

Helper function for output_call_rule when calling a named function.


parrot