%{
#include <stdio.h>
%}
%%
[01]+ { printf
("Binary
Number: %s\n", yytext); } [^
01\n
]+ { printf
("Not a Binary
Number: %s\n", yytext); } \n { /* Ignore newline characters */ }
%%
int main() {
printf("Enter input to identify binary numbers (Ctrl+D to stop):\n");
yylex();
return 0;
}
int yywrap() {
return 1;
}
JXsKI2luY2x1ZGUgPHN0ZGlvLmg+CiV9CgolJQoKWzAxXSsgICAgICB7IHByaW50ZigiQmluYXJ5IE51bWJlcjogJXNcbiIsIHl5dGV4dCk7IH0KW14wMVxuXSsgICB7IHByaW50ZigiTm90IGEgQmluYXJ5IE51bWJlcjogJXNcbiIsIHl5dGV4dCk7IH0KXG4gICAgICAgICB7IC8qIElnbm9yZSBuZXdsaW5lIGNoYXJhY3RlcnMgKi8gfQoKJSUKCmludCBtYWluKCkgewogICAgcHJpbnRmKCJFbnRlciBpbnB1dCB0byBpZGVudGlmeSBiaW5hcnkgbnVtYmVycyAoQ3RybCtEIHRvIHN0b3ApOlxuIik7CiAgICB5eWxleCgpOwogICAgcmV0dXJuIDA7Cn0KCmludCB5eXdyYXAoKSB7CsKgwqDCoMKgcmV0dXJuwqAxOwp9