The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
+27 votes

Type checking is normally done during

  1. lexical analysis
  2. syntax analysis
  3. syntax directed translation
  4. code optimization
in Compiler Design by Veteran (52.1k points)
edited by | 6.4k views

3 Answers

+46 votes
Best answer

The answer is c .

The use of syntax analyser is used to create parse Tree. But along with Grammar as input to Syntax Analyser we add even semantic rules which form the basis of Syntax Directed Translation That help us in Evaluation of Expression .Remember that

Syntax Directed Translation is used in following cases

  1. Conversion of infix to Postfix
  2. Calculation of infix expression
  3. For creating a Acyclic graph
  4. Type Checking
  5. Conversion of Binary number to Decimal
  6. Counting the numbers of bits (0 or 1 ) in a binary number
  7. Creation of syntax tree
  8. To generate Intermediate code
  9. Storing the data into Symbol table
by Active (1.8k points)
edited by
Can u plz elaborate last 9 th point ,storing data into symbol table is done during syntax directed translation .
@radha gogia

Yes, we may manipulate symbol table during SDT.
7th point ?? i think it is work of syntax analyzer??plz correct me!!

@Rajesh Syntax Analysis create Parse Tree, not Syntax Tree. Both are different. Syntax Trees are abstract representation of Parse Trees.

Which phase creates syntax tree then?
Syntax tree is created in syntax analysis phase only and it is created using SDT.
0 votes
right ans is C.
by (149 points)
–5 votes
answer - B
by Loyal (8.7k points)

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
50,092 questions
55,320 answers
86,204 users