lexical analyzer

what is lexical analyzer?what does it do?

Posted Answers

the first part of a compiler is called a lexical analyzer.This looks at the sequence of characters that make up the program and breaks them up into tokens .A token is a sequence of one or more characters that have a uniform meaning in the language being compiled.for example ,consider the statement:if (x > big) big=x;
Each non-blank character in this statement is a separate token,except for the keyword if and the two instances of the identifier big.


Answer by: anonymous