repo.or.cz
/
minix3.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
tools/llvm: Do not build with symbols
[minix3.git]
/
external
/
bsd
/
flex
/
dist
/
examples
/
fastwc
/
wc1.l
blob
976aa31b7bec0ba609a4266ff72e296c34603b0b
1
/* $NetBSD: wc1.l,v 1.1.1.1 2009/10/26 00:28:34 christos Exp $ */
2
3
/* First cut at a flex-based "wc" tool. */
4
5
ws [ \t]
6
nonws [^ \t\n]
7
8
%option main noyywrap
9
%%
10
int cc = 0, wc = 0, lc = 0;
11
12
{nonws}+ cc += yyleng; ++wc;
13
14
{ws}+ cc += yyleng;
15
16
\n ++lc; ++cc;
17
18
<<EOF>> {
19
printf( "%8d %8d %8d\n", lc, wc, cc );
20
yyterminate();
21
}