%{
%}
%s A DEAD
%%
<INITIAL>0 BEGIN A;
<INITIAL>1 BEGIN INITIAL;
<INITIAL>[^01\n] BEGIN DEAD;
<INITIAL>\n BEGIN INITIAL; {printf("Not Accepted\n");}
<A>0 BEGIN A;
<A>1 BEGIN INITIAL;
<A>[^01\n] BEGIN DEAD;
<A>\n BEGIN INITIAL; {printf("Accepted\n");}
<DEAD>[^\n] BEGIN DEAD;
<DEAD>\n BEGIN INITIAL; {printf("Invalid\n");}
%%
int main()
{
printf("Enter String\n");
yylex();
return 0;
}
JXsKJX0KICAKJXMgQSBERUFECiAgCiUlCjxJTklUSUFMPjAgQkVHSU4gQTsKPElOSVRJQUw+MSBCRUdJTiBJTklUSUFMOwo8SU5JVElBTD5bXjAxXG5dIEJFR0lOIERFQUQ7CjxJTklUSUFMPlxuIEJFR0lOIElOSVRJQUw7IHtwcmludGYoIk5vdCBBY2NlcHRlZFxuIik7fQogIAo8QT4wIEJFR0lOIEE7CjxBPjEgQkVHSU4gSU5JVElBTDsKPEE+W14wMVxuXSBCRUdJTiBERUFEOwo8QT5cbiBCRUdJTiBJTklUSUFMOyB7cHJpbnRmKCJBY2NlcHRlZFxuIik7fQogIAo8REVBRD5bXlxuXSBCRUdJTiBERUFEOwo8REVBRD5cbiBCRUdJTiBJTklUSUFMOyB7cHJpbnRmKCJJbnZhbGlkXG4iKTt9IAogIAolJQoKaW50IG1haW4oKQp7CiAgICBwcmludGYoIkVudGVyIFN0cmluZ1xuIik7CiAgICB5eWxleCgpOwpyZXR1cm4gMDsKfQ==