Question 1
What is the primary function of the Syntax Analysis (Parsing) phase in a compiler?
Syntax analysis accepts the stream of tokens generated by the lexical analyzer and verifies whether the sequence conforms to the syntactic rules of the programming language (defined by a CFG), outputting a parse tree or syntax tree.