Lexical Analysis
It is the first step of compiler design, it takes the input as a stream of characters and gives the output as tokens also known as tokenization. The tokens can be classified into identifiers, Sperators, Keywords, Operators, Constant and Special Characters.
It has three phases:
- Tokenization: It takes the stream of characters and converts it into tokens.
- Error Messages: It gives errors related to lexical analysis such as exceeding length, unmatched string, etc.
- Eliminate Comments: Eliminates all the spaces, blank spaces, new lines, and indentations.
What is LEX in Compiler Design?
In this article, we will understand what is Lex in Compiler Design but before understanding Lex we have to understand what is Lexical Analysis.
Contact Us