Refactor: main parsing engine

Split parsing into two separate responsibilities: parsing and semantics