traverse ast to get state info for class blocks