MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

COMPILER DESIGN

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Grammar of the programming is checked at ____ phase of compiler.
A
Syntax Analyzer
B
Lexical Analyzer
C
Semantic Analyzer
D
Scanner
Explanation: 

Detailed explanation-1: -The grammar of the programming is checked at Syntax analysis phase of the compiler.

Detailed explanation-2: -Therefore, this phase uses context-free grammar (CFG), which is recognized by push-down automata. It implies that every Regular Grammar is also context-free, but there exists some problems, which are beyond the scope of Regular Grammar. CFG is a helpful tool in describing the syntax of programming languages.

Detailed explanation-3: -Syntax Analysis: Basically, in the second phase, it analyses the syntactical structure and inspects if the given input is correct or not in terms of programming syntax. It accepts tokens as input and provides a parse tree as output. It is also known as parsing in a compiler.

Detailed explanation-4: -Syntax Analysis is a second phase of the compiler design process in which the given input string is checked for the confirmation of rules and structure of the formal grammar. It analyses the syntactical structure and checks if the given input is in the correct syntax of the programming language or not.

There is 1 question to complete.