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

Input Buffering in Compiler Design
View
With an algorithm, explain pass1 of a linking loader
View
How Program linking is possible in loaders?
View
Structure of a Compiler Design - Phases of Compiler
View
Write note on MASM assembler
View
How object program can be processed using linkage editor?
View
Explain Lexical analysis with a block diagram
View