RVF-116: FIXED : Added additional checks to remove trailing parenthesis from tokens when processing SQL