%option nounput noinput %{ int level = 0; %} %% "/*" level++; "*/" if (level>=0) level--; .|\n if(level==0) ECHO; %% int yywrap(void) { return 1; } int main(int argc, char *argv[]) { while (yylex()!=0) ; return 0; }