Example
simple.pg:
grammar Simple::Grammar ; token variable { [ <alpha> | _ ] \w* } token number { \d+ } token addop { \+ | - } token mulop { \* | / } rule expression { <addterm> [ <addop> <addterm> ]* } rule addterm { <multerm> [ <mulop> <multerm> ]* } rule multerm { <variable> | <number> | \( <expression> \) }
(Note: we cover "token" vs. "rule" a bit later.)