πŸŽ“ Computer Science & Engineering Portal

Master Engineering Disciplines with Structured Notes

Comprehensive academic lecture notes, exam-oriented unit summaries, laboratory manuals, and previous year question papers designed strictly for university students.

πŸ“‘

University Syllabi

AKTU & AICTE aligned semester guidelines.

πŸ“

Exam Question Papers

Previous 5 years solved university papers.

πŸ’‘

Lab Manuals & Viva

Practical codes with outputs & interview Qs.

Core Subjects & Units Hub

Click on any specific unit to immediately view its lecture notes below

Viewing All Lectures

Lexical Error

Lexical Error

During the lexical analysis phase this type of error can be detected.

Lexical error is a sequence of characters that does not match the pattern of any token. Lexical phase error is found during the execution of the program.

Lexical phase error can be:

  • Spelling error.
  • Exceeding length of identifier or numeric constants.
  • Appearance of illegal characters.
  • To remove the character that should be present.
  • To replace a character with an incorrect character.
  • Transposition of two characters.

Example:

  1. Void main()  
  2. {  
  3.      int x=10, y=20;  
  4.      char * a;  
  5.      a= &x;  
  6.      x= 1xab;  
  7. }  

In this code, 1xab is neither a number nor an identifier. So this code will show the lexical error.

Labels: ,

Discussion & Queries (<$I18NNumComments$>):

<$CommentPager$>
<$I18NAtCommentTimeWithPermalink$>, <$I18NCommentAuthorSaid$>

<$BlogCommentBody$>

<$BlogCommentDeleteIcon$>
<$CommentPager$>