博客首页 注册 建议与交流 排行榜 加入友情链接
推荐 投诉 搜索: 帮助

hope_process

I think ,therefore I am.
  heixia108.cublog.cn

关于作者
    既然目标是地平线

   留给世界的只能是背影
   
|| << >> ||
我的分类


flex %s %x
  发现学英语的好处了,用中文搜到%s,%x的区别是相当的困难!
 


  The former (%s) declares inclusive start

  the latter (%x) declares exclusive start
 

  
  具体区别看pdf
文件:data.pdf
大小:37KB
下载:下载

  又了现了一个对C语言注释进行处理的方法
 

%x comment
%%
    int line_num = 1;
"/*" BEGIN(comment);
<comment>[^*\n] ;
<comment>"*"+[^*/\n]* ;/*Perhaps you could wonder if it contains the kind "***" or more "*".The myths is that it match one "*" every time*/
<comment>\n ++line_num;
<comment>"*/" {printf("%d lines\n",line_num); BEGIN(INITIAL); }
%%

int main()
{
    yylex();

    return 0;
}

int yywrap()
{
    return 1;
}




发表于: 2008-03-22,修改于: 2008-03-22 23:42,已浏览186次,有评论0条 推荐 投诉


网友评论
 发表评论