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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started