COMPILER DESIGN

SYNTAX ANALYSIS

TOP DOWN AND BOTTOM UP PARSING

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
The output of syntax analysis is
A
Syntax tree
B
Parse tree
C
DAG
D
Annotated tree
Explanation: 

Detailed explanation-1: -The output of this phase is a parse tree. This way, the parser accomplishes two tasks, i.e., parsing the code, looking for errors and generating a parse tree as the output of the phase. Parsers are expected to parse the whole code even if some errors exist in the program.

Detailed explanation-2: -The output from the parser is assumed to be a representation of the parse tree (example shown above) for the stream of tokens produced by the scanner. There are many approaches to parsing, including both top-down and bottom-up approaches, as well as using leftmost or rightmost derivation.

Detailed explanation-3: -Parsing, syntax analysis, or syntactic analysis is the process of analyzing a string of symbols, either in natural language, computer languages or data structures, conforming to the rules of a formal grammar. The term parsing comes from Latin pars (orationis), meaning part (of speech).

There is 1 question to complete.