Win7下lex_与_yacc的安装配置(3)

2021-01-20 15:16

delim [" "\n\t]

whitespace {delim}+

words {chars}+

%%

while {ECHO; printf("%s\n",yytext);}

{words} { wordCount++;

/* increase the word count by one*/ }

{whitespace} { /* do nothing*/ }

([0-9])+ { numcount++; /* one may want to add some processing here*/ }

%%

void main()

{

printf("ok1\n");

yylex(); /* start the analysis*/

printf("ok2\n");

printf(" No of words: %d\n number: %d\n", wordCount, numcount);

return 0;

}


Win7下lex_与_yacc的安装配置(3).doc 将本文的Word文档下载到电脑 下载失败或者文档不完整,请联系客服人员解决!

下一篇:食品卫生学复习题1

相关阅读
本类排行
× 注册会员免费下载(下载后可以自由复制和排版)

马上注册会员

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: