COMPILER DESIGN

TOOLS AND TECHNIQUES FOR COMPILER DESIGN

LLVM

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Which components within a compiler framework need to be aware of the abstract syntax tree (AST)?
A
Frontend
B
Optimizer
C
Both of the above
D
None of the above
Explanation: 

Detailed explanation-1: -Syntax tree helps to determine the accuracy of the compiler. If the syntax tree contains an error, the compiler displays an error message. Program analysis and program transformation are some other uses of the syntax tree.

Detailed explanation-2: -In computer science, an abstract syntax tree (AST), or just syntax tree, is a tree representation of the abstract syntactic structure of text (often source code) written in a formal language. Each node of the tree denotes a construct occurring in the text.

Detailed explanation-3: -Abstract syntax trees are important data structures in a compiler. It contains the least unnecessary information. Abstract syntax trees are more compact than a parse tree and can be easily used by a compiler.

There is 1 question to complete.