Question: The following is a Flex input files, which is a part of project printing all recognized tokens of a source program. Assume we compile the

The following is a Flex input files, which is a part of project printing all recognized tokens of a source program. Assume we compile the project successfully, and run it against different source programs. (2 points each. Total: 8 points) ALPHA DIGIT
INT
IDENTIFIER
[A-Za-z]
[0-9]
(0-91+
(ALPHA)(((ALPHA)|(DIGIT)|"")*)
fle
one
m- Hipt un
near the tap
""
INT for (IDENTIFIER)
loop
-
{
cout << "white space" << endi; ) cout << "INT" << endl; return INT; } cout << "key word for" << endl; return FOR; } cout << "identifier" < endl; return ID; ) cout "key word loop" < endl; return LOOP; } cout "dot" endi; ) If the source program is for loop (two spaces between for and loop), what's the output when yylex is called the second time?

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 Programming Questions!