trap statement parse tree; also tracks nested