home *** CD-ROM | disk | FTP | other *** search
- Path: mail2news.demon.co.uk!beachyhd.demon.co.uk
- From: Adam@beachyhd.demon.co.uk
- Newsgroups: comp.sys.amiga.programmer
- Subject: Converting comments
- Date: 10 Mar 96 17:13:09 GMT
- Organization: Beachy Head - UK
- Message-ID: <314361c3@beachyhd.demon.co.uk>
- X-NNTP-Posting-Host: beachyhd.demon.co.uk
- MIME-Version: 1.0
- Content-Type: text/plain; charset=iso-8859-1
- Content-Transfer-Encoding: 8bit
- X-GateSoftware: AmiGate 1.6 (13.11.95)
- MMDF-Warning: Parse error in original version of preceding line at relay-2.mail.demon.net
- X-Mail2News-Path: disperse.demon.co.uk!post.demon.co.uk!beachyhd.demon.co.uk
-
- Hi all,
-
- Does anyone know of a program that will (reliably!) switch C/C++ style
- comments?
-
- So if I have some sourcecode as follows:
-
-
- // Test program
- void main()
- {
- printf("Test\n"); // print some text
- }
-
-
- ..it'll convert it to:
-
-
- /* Test program */
- void main()
- {
- printf("Test\n"); /* print some text */
- }
-
-
- ..(or alternatively you could run it over the second piece of code and it'd
- produce the first).
-
- It must be able to handle:
-
- . Multiple line /**/-style comments
-
- . Comment symbols that aren't actually comments
- for example:
- printf("This /* is */ a test\n");
- should *not* be converted
-
-
- Another complication will be:
-
- /* this comment
- ** is going to be
- ** irritating */ printf("test\n");
-
- ..that will need to be converted to:
-
- // this comment
- // is going to be
- //
- printf("test\n");
-
-
- If no one knows of such a program then I'll write one, I just wondered if such
- a thing exists already.
-
- Thanks!
-
- .\dam. [Team AMIGA] //\ ad32@brighton.ac.uk \\/
-
-