%{
#include ;;
%}
%%
"//"([a-z]|[0-9]|[A-Z]|" ")* {}
"/*"([a-z]|[0-9]|[A-Z]|" "\""\n")+"*/" {}
%%
main()
{
yylex();
return 0;
}
int yywrap()
{
}
Sample output
single line comment //testing
single line comment
test line /*multi*/
test line
Copyright secured by Digiprove © 2018 Humble Chirammal 2 thoughts on “lex program to eliminate single and multiline comments”
Comments are closed.
Wrong code fir comments
Plzz give me the right code for comments