Remove tree parser reference
Formatting: no space after cast
ATNSimulator.stateFactory sets the ruleIndex (required), not the stateNumber (it's overwritten in ATN.addState)
Extract checkCondition helper method
Add several additional checks to verifyATN
Handle potential null value
Remove unnecessary null checks
Fix handling of rule stop states in full context mode
Simplify similar code paths