MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

COMPILER DESIGN

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
What is the name of the process that determining whether a string of tokens can be generated by a grammar?
A
Analyzing
B
Translation
C
Recognizing
D
Parsing
Explanation: 

Detailed explanation-1: -Parsing is the process of determining if a string of tokens can be generated by a grammar.

Detailed explanation-2: -Explanation: Parsing is used to determine whether tokens can be generated by a given grammar.

Detailed explanation-3: -Lexical analysis is the starting phase of the compiler. It gathers modified source code that is written in the form of sentences from the language preprocessor. The lexical analyzer is responsible for breaking these syntaxes into a series of tokens, by removing whitespace in the source code.

Detailed explanation-4: -Syntax Analysis It takes the token produced by lexical analysis as input and generates a parse tree (or syntax tree). In this phase, token arrangements are checked against the source code grammar, i.e. the parser checks if the expression made by the tokens is syntactically correct.

There is 1 question to complete.