summaryrefslogtreecommitdiff
path: root/lex/identifiers.l
blob: 414e53117544518a9a284ea2a2b8e27289584900 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
%option noyywrap
digit	[0-9]
letter	[A-Za-z]
%{
	int count;
%}
%%
{letter}({letter}|{digit})*	{fwrite(yytext, yyleng, 1, yyout); ++count;};
.
%%
int main(void) {
	yylex();
	printf("%d\n", count);
	return 0;
}