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