Perl 6 Compiler Perl 6 Compiler Status and the Parrot Compiler Toolkit #27

Various subrules

token regex_term { / <regex: /> / }

rule scoped_variables { <scope_declarator> <variable> }
token scope_declarator { [ my | our ] }

token variable { \$/ | \$_ | <sigil> <twigil>? <name> }
token sigil { <[$@%^&]> }
token twigil { <[.^*+?=!]> }
token name { <ident> [ \:\: <ident> ]* }

token integer {
    | 0 [ b <[01]>+           [ _ <[01]>+ ]*
        | o <[0..7]>+         [ _ <[0..7]>+ ]*
        | x <[0..9a..fA..F]>+ [ _ <[0..9a..fA..F]>+ ]*
        | d \d+               [ _ \d+]*
        ]
    | \d+[_\d+]*
}
Copyright © 2006 Patrick Michaud