MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

COMPILER DESIGN

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Which one of the following statements is FALSE?
A
Context-free grammar can be used to specify both lexical and syntax rules
B
Type checking is done before parsing
C
High-level language programs can be translated to different Intermediate Representations
D
Arguments to a function can be passed using the program stack
Explanation: 

Detailed explanation-1: -Detailed Solution. Type checking performs at the semantic analysis phase, and parsing performs at the syntax analysis phase. Since the Syntax analysis phase comes before semantic analysis, therefore Type Checking is always done after parsing. Therefore Option 2 is false and is the correct answer.

Detailed explanation-2: -Explanation: Type checking is done at semantic analysis phase and parsing is done at syntax analysis phase. And we know Syntax analysis phase comes before semantic analysis. So Option (B) is False. All other options seems Correct.

Detailed explanation-3: -Correct answer is option ‘B’. Can you explain this answer?. Solutions for Which one of the following statements is FALSE? a)Context-free grammar can be used to specify both lexical and syntax rules.

Detailed explanation-4: -Correct Option: D x = 4 × 5 ⇒ x = 20 ‘is an example of common subexpression elimination.] is False. is called the “constant folding” technique of compiler optimization.

Detailed explanation-5: -3. Which of the following statements are false? Explanation: Every recursive language is recursively enumerable but there exists recursively enumerable languages that are not recursive.

There is 1 question to complete.