Question: write a C++ program that reads in a text file and reads each character or lexemes and states what token it is and writes to
write a C++ program that reads in a text file and reads each character or lexemes and states what token it is and writes to another file
for example:
while (fahr < upper) a = 23.00 whileend
Output:
token lexeme
--------------------------------
keyword while
separator (
identifier fahr
operator <
identifier upper
separator )
identifier a
operator =
real 23.00
keyword whileend
the program aslo reads in comments but does not add to the list. characters that are commented out or pseudocode is not counted
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
