retagged by
11,585 views
28 votes
28 votes

Which one of the following statements is FALSE?

  1. Context-free grammar can be used to specify both lexical and syntax rules
  2. Type checking is done before parsing
  3. High-level language programs can be translated to different Intermediate Representations
  4. Arguments to a function can be passed using the program stack
retagged by

3 Answers

Best answer
54 votes
54 votes
A. Since Lexical rules are nothing but regular expressions, we can use CFGs to represent such rules.(Every Type-$3$ grammar is Type-$2$ grammar) Additionally, syntax rules can be represented by CFGs. (True)

B. Type checking is done during Semantic Analysis phase which comes after Parsing. (False)

C. We have various types of Intermediate Code Representations, ex $3$-address code, Postfix notation, Syntax trees. (True)

D. Program stack holds the activation record of the function called, which stores function parameters, return value, return address etc.(True)

Correct Answer: $B$
edited by
2 votes
2 votes
B is clearly false as type checking is done using SDTs which is basically semantic analysis.SDTs are basically parse trees hence parsing needs to be done first and then only can we do type checking.
Answer:

Related questions

39 votes
39 votes
5 answers
1
Madhav asked Feb 14, 2017
9,523 views
Match the following according to input (from the left column) to the compiler phase (in the right column) that processes it:$$\begin{array}{|l|l|}\hline \text{P. Syntax t...
22 votes
22 votes
1 answer
2
Akash Kanase asked Feb 12, 2016
5,023 views
Match the following:$$\begin{array}{ll|ll}\hline \text{(P)} & \text{Lexical analysis} & \text{(i)} & \text{Leftmost derivation} \\\hline \text{(Q)} & \text{Top down pars...
32 votes
32 votes
1 answer
3
Kathleen asked Sep 22, 2014
7,840 views
Match all items in Group 1 with the correct options from those given in Group 2.Syntax analysis$$\begin{array}{|ll|ll|}\hline \rlap{\textbf{Group 1}} & & \rlap{\textbf{Gr...
34 votes
34 votes
5 answers
4