I'm aware this question was asked 10 years ago (or thereabouts). But..., we're still facing this problem with Antlr 4.16 (latest version). Sufficiently deeply nested Cobol if-then-else statements with optional trailing end-if can take upto 7 minutes in the parser - from start rule... We've profiled it, and we're seeing all the time spent in the if-then -else walking. We're using the same grammar if_statement: IF condition THEN? statement_list (ELSE statement_list)? END_IF?
Any thoughts or suggestions would be welcome.