Revert "Removed useless code"

This reverts commit 91d1d73ea48474ac24393fe26dc0b1d35b7339a0.
Revert "Revert "Simplified parsing, but there is still an extra ' ) ' at the end when printing parse tree.""

This reverts commit 47b32603445706497d2b6c96d34fc590a4ea88c1.