Consider the following statements:

1. Reads the input characters of the source program, groups them into lexemes, and produces as output a sequence of tokens for each lexeme in the source program. 

2. Stripping out comments and whitespaces.

3. Report any syntax errors in an intelligible fashion and to recover from commonly occurring errors to continue processing the remainder of the program. 

4. Correlating error messages generated by the compiler with the source program. 

5. Verifies that the string of token names can be generated by the grammar for the source language. 

Which of the above statements are functions of the lexical analyzer?

1
3 and 5
2
1, 2 and 4
3
1, 2 and 3
4
1 and 2

Sponsored

hivanix.in

Visit

This quiz is brought to you by hivanix.in

🌐 Web App Development

Quick Navigation