Raj Kumar
Computer Science And Engineering

Explain Lexical analysis with a block diagram

System Software and Compiler Design

Explanation

1468    0

► 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:   
   Raj Kumar
Computer Science And Engineering

More Questions from System Software and Compiler Design Module 2