[AST] Refactor format string parsing into parser classes (NFC) (#243043)
The functions that analyze printf and scanf format strings were free
functions threading the same parameters through every call. Gather them
into classes and turn constant parameters into class members.
Since I'm changing function signatures, I took this opportunity to
rename them to lowerCamelCase to conform to the coding standard.