MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

COMPILER DESIGN

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Parser are expected to parse the whole code
A
TRUE
B
FALSE
C
MAY BE
D
Cant say
Explanation: 

Detailed explanation-1: -Explanation: Parsers are expected to parse the whole code even if some errors exist in the program. Explanation: The grammar clearly indicates which type of structure does a program has.

Detailed explanation-2: -Parsers are used when there is a need to represent input data from source code abstractly as a data structure so that it can be checked for the correct syntax. Coding languages and other technologies use parsing of some type for this purpose.

Detailed explanation-3: -Explanation: Parsing or syntactic analysis is the process of analysing a string of symbols and conforming to the rules of grammar.

Detailed explanation-4: -A compiler reads the whole source code at once, creates tokens, checks semantics, generates intermediate code, executes the whole program and may involve many passes.

Detailed explanation-5: -Parser is a compiler that is used to break the data into smaller elements coming from lexical analysis phase. A parser takes input in the form of sequence of tokens and produces output in the form of parse tree. Parsing is of two types: top down parsing and bottom up parsing.

There is 1 question to complete.