%{
#include <stdio.h>
%}
%option noyywrap
%%
[0-9]+ { printf
("
Number: %s\n", yytext); } [+\-*/] { printf("Operator: %s\n", yytext); }
[a-zA-Z][a-zA-Z0-9]* { printf("Identifier: %s\n", yytext); }
[ \t\n] ; /* Ignore whitespace */
. { printf("Invalid character: %s\n", yytext); }
%%
int main() {
printf("Enter an arithmetic expression: ");
yylex(); // Process the input
return 0;
}
int yywrap() {
return 1;
}
JXsKI2luY2x1ZGUgPHN0ZGlvLmg+CiV9Cgolb3B0aW9uIG5veXl3cmFwCgolJQpbMC05XSsgICAgICAgICAgeyBwcmludGYoIk51bWJlcjogJXNcbiIsIHl5dGV4dCk7IH0KWytcLSovXSAgICAgICAgIHsgcHJpbnRmKCJPcGVyYXRvcjogJXNcbiIsIHl5dGV4dCk7IH0KW2EtekEtWl1bYS16QS1aMC05XSogeyBwcmludGYoIklkZW50aWZpZXI6ICVzXG4iLCB5eXRleHQpOyB9ClsgXHRcbl0gICAgICAgICA7IC8qIElnbm9yZSB3aGl0ZXNwYWNlICovCi4gICAgICAgICAgICAgICB7IHByaW50ZigiSW52YWxpZCBjaGFyYWN0ZXI6ICVzXG4iLCB5eXRleHQpOyB9CiUlCgppbnQgbWFpbigpIHsKICAgIHByaW50ZigiRW50ZXIgYW4gYXJpdGhtZXRpYyBleHByZXNzaW9uOiAiKTsKICAgIHl5bGV4KCk7IC8vIFByb2Nlc3MgdGhlIGlucHV0CiAgICByZXR1cm4gMDsKfQoKaW50IHl5d3JhcCgpIHsKICAgIHJldHVybiAxOwp9Cg==