CompilerComputer Science & Information Technology

Lexical Analysis

  • As the first phase of compiler, the main task of the lexical analyzer is to read the input characters of the source program, group them into lexemes, and produce as output a sequence of token for each lexeme in the source program. The stream of tokens is sent to the parser for syntax analysis. The stream of tokens is sent to the parser for syntax analysis.
  • Lexical analyzer also interacts with symbol table. As when the lexical analyzer discover a lexeme constituting an identifier, it needs to enter that lexemes into the symbol table. This interaction is shown below:
    Token
  • Above interaction is implemented by having the parser call the lexical analyzer. The call, suggested by the get Net Token command, causes the lexical analyzer to read characters from its input until it can identify the next lexeme and produce for it the next token, which it returns to the parser.

Dear Aspirants,
Your preparation for GATE, ESE, PSUs, and AE/JE is now smarter than ever — thanks to the MADE EASY YouTube channel.
This is not just a channel, but a complete strategy for success, where you get toppers strategies, PYQ–GTQ discussions, current affairs updates, and important job-related information, all delivered by the country’s best teachers and industry experts.
If you also want to stay one step ahead in the race to success, subscribe to MADE EASY on YouTube and stay connected with us on social media.
MADE EASY — where preparation happens with confidence.

MADE EASY

MADE EASY is a well-organized institute, complete in all aspects, and provides quality guidance for both written and personality tests. MADE EASY has produced top-ranked students in ESE, GATE, and various public sector exams. The publishing team regularly writes exam-related blogs based on conversations with the faculty, helping students prepare effectively for their exams.

Leave a Reply

Your email address will not be published. Required fields are marked *