Refactoring: Move tokenize_asdl to callable object, extract conditions to function, remove duplicated Exception