BIL 222 – PROGRAMMING LANGUAGES
1998-99 SPRING SEMESTER

PROGRAMMING ASSIGNMENT #3 (March 11, 1999)

Due: March 18, 1999 Thursday (by 5:00pm).

Write a program in your favorite programming language that would have the same functionality with a program that would be generated from the Lex program generator given the below input specifications:

D [0-9]
%%
if printf("IF statement\n");
[a-z]+ printf("tag, value %s\n", yytext);
{D}+ printf("decimal number %s\n",yytext);
"++" printf("unary operator\n");
"+" printf("binary operator\n");

Your program should accept strings typed by the user and take the above specified actions until the program is terminated with a Ctrl-Z.

Last revised on July 28, 2001 22:59:16 +0300 .