in Compiler Design edited by
13,821 views
46 votes
46 votes

Type checking is normally done during

  1. lexical analysis
  2. syntax analysis
  3. syntax directed translation
  4. code optimization
in Compiler Design edited by
13.8k views

2 Answers

83 votes
83 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
edited by

4 Comments

This is what I got: Combining $7^{th}$ and $8^{th}$ point

In intermediate code generation there are 2 forms:

1. Linear form which includes postfix and 3-address code

2. Tree form which includes syntax tree and DAG

So now we can say that SDT is helping in making Syntax tree which is a part of ICG.

0
0
is syntax directed translation is done semantic analyser phase?

third phase of compiler.
0
0

Yes. @Nirmalbbll . But not only semantic phase. It used during Intermediate code generation also.

0
0
0 votes
0 votes
right ans is C.
Answer:

Related questions