flex/tests/Sanity/smoke-check-flex-runs/count_chars_and_lines.l

22 lines
244 B
Plaintext
Raw Normal View History

%option noyywrap
%{
#include <stdio.h>
int chars = 0;
int lines = 0;
%}
%%
\n { lines++; chars++; }
. { chars++; }
%%
int main(int argc, char ** argv) {
yylex();
printf("chars: %d\n", chars);
printf("lines: %d\n", lines);
return 0;
}