Statically typed PEG generator