IITB FDP101x Lab Activity-1

1)Youtube URL of NPTEL video on overview of compilers in the domain of computer science and engineering.

URL : https://nptel.ac.in/courses/106108052/

2) Reflection Spot Question

Q)Is the compiler just a Language Translator? or Does it check for syntax and do any optimization to the source code?

3) At time, 0:31/55:53 mins, the above reflection spot question should be asked.

4) LearningbyDoing(LbD) practise questions.

Q1) Which of the following is not a phase in compilation?

i) Syntax Analysis.

ii) Code generation.

iii) Lexical Analysis.

iv) Spelling Analysis

Answer : option (iv)

Justification: Remaining three options are the phases involved in the compiler translation process. Phases in compilation are Lexical analysis, Syntax analysis, semantic analysis, Intermediate code generation, source code optimization, target code generation.

Q2) Which of the following is the default C filename that is generated by LEX compiler?

i) yy.lex.c

ii) lex.yy.c

iii) yacc.lex.c

iv) lex.yacc.c

Answer: option (ii)

Justification : When we compile a lex file using lex compiler LEX, a C file will be generated with a default name “lex.yy.c”. So remaining options are incorrect.