Python on Parrot Python on Parrot #53

Parsing Python's indent rules

statement ::= stmt_list NEWLINE
                | compound_stmt

stmt_list ::= simple_stmt (";" simple_stmt)* [";"]

In PGE:

token statement { <stmt_list> <newline> | <compound_stmt> }

rule stmt_list { <simple_stmt> [ ';' <simple_stmt> ]* ';'? }
Copyright © 2007 Patrick Michaud