Explain Lexical analysis with a block diagram


► Reads characters in the source program and groups them into meaningful sequences called lexemes.

► Produces as output a token of the form <token_name, attribute_value> and passes it to the next phase syntax analysis.

► Token class - The symbol for this token to be used during syntax analysis.

► Attribute points to symbol table entry for this token.

► Role of lexical analyzer

-Remove comments & white spaces

-Macros expansion

-Read input characters from source program & group them into lexemes.

-Produce as output a source of tokens, interact with symbol table.



Share to whatsapp

More Questions from System Software and Compiler Design Module 2

How Program linking is possible in loaders?
View
Difference Between Linking Loader vs Linkage Editor
View
Write note on MASM assembler
View
How object program can be processed using linkage editor?
View
What is Lexical Analysis?
(or)
Lexical Analysis in Compiler Design with Example
View
Structure of a Compiler Design - Phases of Compiler
View
The linkage editor
View