implement parentheses analyze