Discussion
An unterminated string literal is normally reported by
Answer: D
Correct answer: the lexical analyser
A string literal is a single token, and the scanner is the phase that assembles it from characters. Reaching the end of the line or the file with the closing quote still missing means the token cannot be completed, which the scanner discovers immediately.
The parser never sees a token at all in this case, so it cannot be the reporter. The contrast with the missing semicolon is instructive: one is a malformed token, the other a malformed sequence of good tokens.
No comment is present. Be the first to comment.
Loading…
Post your comment
Please log in or register to post a comment.
Examination Categories
- SSC Exams
- Banking Exams
- Teaching Exams
- Civil Services Exams
- Railways Exams
- Engineering Recruitment Exams
- Defence Exams
- State Government Exams
- Police Exams
- Insurance Exams
- Nursing Exams
- Other Government Exams
- NRA CET
- PG Entrance Exams
- Campus Placement
- MBA Entrance Exams
- CUET and UG Entrance
- Judiciary Exams
- Regulatory Body Exams
- Software Development