Question: Create a lexical analyzer that validates a user - supplied string. the program must identify the next Token and assign it its corresponding category 0

Create a lexical analyzer that validates a user-supplied string.
the program must identify the next Token and assign it its corresponding category
0--- Data type 1--- Identifier 2--- constant 3--- ; 4---,
5---(6---)7---{8---}9---=
9--- if 10--- while 11--- returns 12--- else 13--- for
14--- opSum 15---opMultiplication 16--- opLogical 17--- opRelational 18-- $
Be:
opAdision +-
opMultiplication */<<>>
opLogic && ||
operational <>>=<===!=
constant any number #, and pi
data type int float char empty string
Remember to show at the end the number of tokens found in each category or if you found any errors.
It can be implemented in any language, as long as it meets the aforementioned requirements.
I share the codes seen in class in case you want to use them as a base or support.
Attached are the source codes, the activity development report and a short video demonstrating its operation.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!