Implement stack size limitation for iterative parsing.