Question: Develop a lexical analyzer for Java. It reads a Java file sequentially, removes the com ments, tokenizes the input data, and sends the resulting token

Develop a lexical analyzer for Java. It reads a Java file sequentially, removes the com ments, tokenizes the input data, and sends the resulting token sequence to standard output. Example: test.java has the content as below index = 2 * count + 17; Your lexical analyzer should generate output as below Lexemes Index Token:s identifier equal Sign int literal 2 *mult op count identifier plus_op int_literal semicolon 17 Develop a lexical analyzer for Java. It reads a Java file sequentially, removes the com ments, tokenizes the input data, and sends the resulting token sequence to standard output. Example: test.java has the content as below index = 2 * count + 17; Your lexical analyzer should generate output as below Lexemes Index Token:s identifier equal Sign int literal 2 *mult op count identifier plus_op int_literal semicolon 17
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
