使用C ++样式注释替换C样式注释 [英] replace C style comments by C++ style comments

查看:130
本文介绍了使用C ++样式注释替换C样式注释的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何自动替换所有C风格的评论(/ *评论* /)的C ++风格的评论(//评论)?这必须在几个文件中自动完成。

How can I automatically replace all C style comments (/* comment */) by C++ style comments (// comment)? This has to be done automatically in several files. Any solution is ok, as long as it works.

推荐答案

此工具执行的工作:
http://people.sc.fsu.edu/~burkardt/cpp_src/recomment/recomment.html


RECOMMENT是一个C ++程序,
将C样式注释转换为C ++样式
注释。

RECOMMENT is a C++ program which converts C style comments to C++ style comments.

它还处理其他人提及的所有非平凡情况:

It also handles all the non-trivial cases mentioned by other people:


此代码包含由2005年4月28日由JDB Uniphase的Steven Martin提供的建议和
编码,
墨尔本佛罗里达。这些建议
允许程序忽略字符串的
内部内容(其中
可能以其他方式似乎开始或结束
注释),以处理代码行
带有尾部注释,并处理带有结尾代码的
注释。

This code incorporates suggestions and coding provided on 28 April 2005 by Steven Martin of JDS Uniphase, Melbourne Florida. These suggestions allow the program to ignore the internal contents of strings, (which might otherwise seem to begin or end comments), to handle lines of code with trailing comments, and to handle comments with trailing bits of code.

这篇关于使用C ++样式注释替换C样式注释的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆