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

Type checking is normally done during

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

3 Answers

+41 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
answered by Active (2k 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.
answered by (141 points)
–4 votes
answer - B
answered by Loyal (8.9k 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

44,200 questions
49,671 answers
65,819 users