add begin/end statement lists to ast