📄 wc.l
字号:
/*
* word count, WC - the program. simple standalone PCLEX application.
*/
%{
#include <stdlib.h>
static unsigned nchar = 0; /* # of characters in file */
static unsigned nword = 0; /* # of words in file */
static unsigned nline = 1; /* # of lines in file */
%}
%%
\n nchar += 2, ++nline; /* line boundary in MS-DOS is CR LF */
[^ \t\n]+ ++nword, nchar += yyleng;
. ++nchar;
%%
main()
{
yylex();
printf( "%d\t%d\t%d\n", nchar, nword, nline );
exit(0);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -