Python on Parrot Python on Parrot #52

Parsing Python's indent rules

if_stmt   ::= "if" expression ":" suite
              ( "elif" expression ":" suite )*
              [ "else" ":" suite ]

In PGE:

rule if_stmt {
    'if' <expression> ':' <suite>
    [ 'elif' <expression> ':' <suite> ]*
    [ 'else' ':' <suite> ]?
}
Copyright © 2007 Patrick Michaud