first version of PEG parser