CD P3.1

vowel and consonant
mail@pastecode.io avatar
unknown
c_cpp
3 years ago
280 B
2
Indexable
Never
%{
    #include<stdio.h>
    #include<string.h>
%}

%%
^[^a-zA-Z_] {
    printf("INVALID : %s",yytext);
}
^[a-zA-Z_][a-zA-Z0-9_]* {
    printf("VALID : %s",yytext);
}
%%

int yywrap(){
    return 1;
} 

int main() { 
    yyin=fopen("input.txt", "r");
    yylex();
    return 0; 
}