ts parser written in cpp oops