Moved the code that prints the AST before checking for Syntax errors