Sign in
android
/
platform
/
external
/
webkit
/
8e35f3cfc7fba1d1c829dc557ebad6409cbe16a2
/
.
/
WebKitTools
/
android
/
flex-2.5.4a
/
MISC
/
fastwc
/
wc1.l
blob: d6696bcde696fd08565290a2c2ed991d888abe50 [
file
] [
log
] [
blame
]
/* First cut at a flex-based "wc" tool. */
ws
[
\t
]
nonws
[^
\t\n
]
%%
int
cc
=
0
,
wc
=
0
,
lc
=
0
;
{
nonws
}+
cc
+=
yyleng
;
++
wc
;
{
ws
}+
cc
+=
yyleng
;
\n
++
lc
;
++
cc
;
<<
EOF
>>
{
printf
(
"%8d %8d %8d\n"
,
lc
,
wc
,
cc
);
yyterminate
();
}