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
1,2,5
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).
http://digital.cs.usu.edu/~allan/Compilers/Slides/Lexical.pdf
All these tasks are performed by lexical analyzer
Pages