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

全部博文(61)

文章存档

2009年(2)

2008年(59)

我的朋友

分类:

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;
}




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

上一篇:自动机

下一篇:调试 文法 很痛苦!

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