Monday, June 18, 2012

Role of the Lexical analyzier

The main  task is to read the input character and procedure as output sequence of tokens that the parser user for syntax analysis upon receiving a"get next token" Command from the parser, the lexical analysis reads input characters until it can identify the next token.
It's secondary tasks  are 
1. one  task is stripping out from the source program comments and white space in the form of blank,tab,new line character.
2. Another task is correlating error message from the compiler with the source program.
sometimes, lexical analysis are divided into  a cascade of  two phases
  • scanniing
  • Lexical analysis
The scanner is responsible for doing simple tasks while the lexical analysis proper does not more complx operations

1 comment: