Consider the below statement
if(i==2)
The lexical analyzer reads the source program one character at a time.So if we divide the statement into characters it would divide if into i&f and it would say that i is an identifier.But it doesn't do this.So is there any look ahead mechanism which tells it that i is followed by f and if is classified as a keyword.