Chinaunix首页 | 论坛 | 博客
  • 博客访问: 724064
  • 博文数量: 251
  • 博客积分: 10367
  • 博客等级: 上将
  • 技术积分: 2750
  • 用 户 组: 普通用户
  • 注册时间: 2007-05-10 14:43
文章分类

全部博文(251)

文章存档

2009年(2)

2008年(86)

2007年(163)

分类:

2008-03-22 23:42:16

  发现学英语的好处了,用中文搜到%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;
}




阅读(1942) | 评论(0) | 转发(0) |
0

上一篇:生活的另一面

下一篇:Makefile 小技巧

给主人留下些什么吧!~~