flex/tests/Sanity/smoke-check-flex-runs/count_chars_and_lines.l
2021-02-01 11:12:11 +00:00

22 lines
244 B
Plaintext

%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;
}