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

22 lines
244 B
Plaintext
Raw Normal View History

2021-01-18 21:11:55 +00:00
%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;
}