Refactored statement-level parsing to avoid left-recursion