Parser with rudimentary error handling