Finished CFG parser. Untested.