coverity#1213364 Untrusted loop bound

Change-Id: I518c4819fd4efe605dab0e73c58f8a8c7691b26d
give us a parenStack which can grow to fit any input

Change-Id: Ic464184fe367da33bf8c4790b82656b140e3cbd0
coverity#1242775 Use of untrusted scalar value

and coverity#1242728
and coverity#1242836
and coverity#1242927
and coverity#1242942
and coverity#1242937
and coverity#1242793
and coverity#1242945

move the casts to one single place before they get
scrutinized

Change-Id: I8a14f8d22b5c38d04f4fb538a1eb0baeef04e390
fix higher debug level build

Change-Id: Ic5aae12c6a32c535faf790892810522aa4c527f5