Replace the hand-crafted parser with a parsley-based grammar