APL Parrot Target Practice #11

BNF to Perl 6 rule conversion example

The BNF rule

expression ::= subexpression
            |  subexpression dyadic-identifier expression
            |  monadic-identifier expression
            |  target ← expression

becomes

rule expression { 
    | <target> ← <expression>
    | <monadic_identifier> <expression>
    | <subexpression> [ <dyadic_identifier> <expression> ]?
}
Copyright © 2006 Will Coleda & Patrick Michaud