Record stack size used by parser and apply it during error checking too