%{
#include <stdio.h>
%}
%%
"if" *"(".*")" *"{" { printf("Valid 'if' syntax\n"); }
"else if" *"(".*")" *"{" { printf("Valid 'else if' syntax\n"); }
"else" *"{" { printf("Valid 'else' syntax\n"); }
"switch" *"(".*")" *"{" { printf("Valid 'switch' syntax\n"); }
"case" .*":" { printf("Valid 'case' syntax\n"); }
"default" *":" { printf("Valid 'default' syntax\n"); }
. { /* Ignore other characters */ }
%%
int main() {
yylex();
return 0;
}
int yywrap() {
return 1;
}
JXsKI2luY2x1ZGUgPHN0ZGlvLmg+CiV9CgolJQoiaWYiICoiKCIuKiIpIiAqInsiICAgICB7IHByaW50ZigiVmFsaWQgJ2lmJyBzeW50YXhcbiIpOyB9CiJlbHNlIGlmIiAqIigiLioiKSIgKiJ7IiB7IHByaW50ZigiVmFsaWQgJ2Vsc2UgaWYnIHN5bnRheFxuIik7IH0KImVsc2UiICoieyIgICAgICAgICAgICAgIHsgcHJpbnRmKCJWYWxpZCAnZWxzZScgc3ludGF4XG4iKTsgfQoKInN3aXRjaCIgKiIoIi4qIikiICoieyIgIHsgcHJpbnRmKCJWYWxpZCAnc3dpdGNoJyBzeW50YXhcbiIpOyB9CiJjYXNlIiAuKiI6IiAgICAgICAgICAgICB7IHByaW50ZigiVmFsaWQgJ2Nhc2UnIHN5bnRheFxuIik7IH0KImRlZmF1bHQiICoiOiIgICAgICAgICAgIHsgcHJpbnRmKCJWYWxpZCAnZGVmYXVsdCcgc3ludGF4XG4iKTsgfQouICAgICAgICAgICAgICAgICAgICAgICAgeyAvKiBJZ25vcmUgb3RoZXIgY2hhcmFjdGVycyAqLyB9CiUlCgppbnQgbWFpbigpIHsKICAgIHl5bGV4KCk7CiAgICByZXR1cm4gMDsKfQoKaW50IHl5d3JhcCgpIHsKICAgIHJldHVybiAxOwp9