The main job of lexical analyzer is/are

The main job of lexical analyzer is/are:

(i) Return a token to syntax analyzer.
(ii) Strips white space.
(iii) Keeps track of line number.
(iv) Generates output listing with error marked.
(v) Delete comments

Which of the following is TRUE ?

(A) Only (i), (ii), (v)
(B) Only (iii), (iv), (v)
(C) Only (i), (ii), (iii), (v)
(D) All of them

3Comments
Parimal Andhalkar @parimal_andhalkar 7 Jan 2016 06:38 pm

1,2,5

Arvind Rawat @arvind.rawat 8 Jan 2016 06:13 pm

I am sure about 1, 2, 3 and 5. Not sure about 4 because in general, when an error is found, the lexical analyzer stops (but other actions are also possible).

neenu @[email protected] 11 Jan 2016 05:14 pm

http://digital.cs.usu.edu/~allan/Compilers/Slides/Lexical.pdf

All these tasks are performed by lexical analyzer