%{
#include <stdio.h>
%}
%%
[a-zA-Z_][a-zA-Z0-9_]* { printf("Identifier: %s\n", yytext); }
[0-9]+ { printf
("
Number: %s\n", yytext); } "+" { printf("Plus operator\n"); }
"-" { printf("Minus operator\n"); }
"*" { printf("Multiplication operator\n"); }
"/" { printf("Division operator\n"); }
[ \t\n]+ { /* Ignore whitespace */ }
. { printf("Unknown character: %s\n", yytext); }
%%
int main() {
yylex
(); // Call lexical analyzer
return 0;
}
int yywrap() {
return 1;
}
JXsKI2luY2x1ZGUgPHN0ZGlvLmg+CiV9CgolJQoKW2EtekEtWl9dW2EtekEtWjAtOV9dKiAgICAgIHsgcHJpbnRmKCJJZGVudGlmaWVyOiAlc1xuIiwgeXl0ZXh0KTsgfQpbMC05XSsgICAgICAgICAgICAgICAgICAgICAgIHsgcHJpbnRmKCJOdW1iZXI6ICVzXG4iLCB5eXRleHQpOyB9CiIrIiAgICAgICAgICAgICAgICAgICAgICAgICAgeyBwcmludGYoIlBsdXMgb3BlcmF0b3JcbiIpOyB9CiItIiAgICAgICAgICAgICAgICAgICAgICAgICAgeyBwcmludGYoIk1pbnVzIG9wZXJhdG9yXG4iKTsgfQoiKiIgICAgICAgICAgICAgICAgICAgICAgICAgIHsgcHJpbnRmKCJNdWx0aXBsaWNhdGlvbiBvcGVyYXRvclxuIik7IH0KIi8iICAgICAgICAgICAgICAgICAgICAgICAgICB7IHByaW50ZigiRGl2aXNpb24gb3BlcmF0b3JcbiIpOyB9ClsgXHRcbl0rICAgICAgICAgICAgICAgICAgICAgeyAvKiBJZ25vcmUgd2hpdGVzcGFjZSAqLyB9Ci4gICAgICAgICAgICAgICAgICAgICAgICAgICAgeyBwcmludGYoIlVua25vd24gY2hhcmFjdGVyOiAlc1xuIiwgeXl0ZXh0KTsgfQoKJSUKCmludCBtYWluKCkgewogICAgeXlsZXgoKTsgICAgLy8gQ2FsbCBsZXhpY2FsIGFuYWx5emVyCiAgICByZXR1cm4gMDsKfQoKaW50IHl5d3JhcCgpIHsKICAgIHJldHVybiAxOwp9Cgo=