Site icon i2tutorials

Compiler Design-Lexical Analyzer

Lexical Analyzer

 

Lexical Analysis is the first phase in the designing of a compiler. It first groups the source program into lexemes and gives a sequence into tokens. It also collects information about tokens into associated attributes. 

 

Lexical Analysis has two stages

What is a Lexeme?

It is a sequence of tokens present in the source program. In other terms, it is an instance of a token.

 

What is a Token?

A token is a sequence of characters that shows a unit of information in the source program.

 

Reference Link

Lexical Analyzer

Exit mobile version