parrotcode: compiler and parser for Perl 6 regex | |
Contents | Compilers |
P6Regex - compiler and parser for Perl 6 regex
compile_p6regex(PMC source, PMC adverbs :slurpy :named)
source
according to Perl 6 regex syntax and the associated adverbs
.
Normally this function is obtained using compreg 'PGE::P6Regex'
instead of calling it directly.target
named parameter is supplied,
then it will return the parse tree (target='parse'),
the expression tree (target='exp'),
or the resulting PIR code (target='PIR').regex(PMC mob, PMC adverbs :slurpy :named)
<regex>
rule in PGE::Grammar
,
so one can call it from another regex to parse valid Perl 6 regular expressions.onload()
parse_term(PMC mob [, PMC adverbs :slurpy :named])
parse_term_ws(PMC mob)
parse_quant(PMC mob)
parse_dollar(PMC mob)
parse_subname(STR target, INT pos)
target
starting at pos
looking for a subrule name (following Perl 6's identifier syntax).
Returns any subrule name found,
and the ending position of the name.parse_subrule(PMC mob)
parse_enumcharclass(PMC mob)
parse_quoted_literal
parse_modifier
PIR_closure(string code)
|