Question: lexical analyzers are divided into a cascade of two processes: a) Scanning consists of the simple processes that do not require tokenization of the input,
lexical analyzers are divided into a cascade of two processes: a) Scanning consists of the simple processes that do not require tokenization of the input, such as deletion of comments and compaction of consecutive whitespace characters into one. b) Lexical analysis proper is the more complex portion, where the scanner produces the sequence of tokens as output.
implement lexical analyzer, by using Lex tool
-
Read source program from file
-
Delete all comments (you need to define RE for C style comments).
-
Replace consecutive whitespace characters by a single blank.
-
Write resulting content to a separate file.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
