home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 5162 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.6 KB  |  75 lines

  1. Path: mail2news.demon.co.uk!beachyhd.demon.co.uk
  2. From: Adam@beachyhd.demon.co.uk
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Converting comments
  5. Date: 10 Mar 96 17:13:09 GMT
  6. Organization: Beachy Head - UK
  7. Message-ID: <314361c3@beachyhd.demon.co.uk>
  8. X-NNTP-Posting-Host: beachyhd.demon.co.uk
  9. MIME-Version: 1.0
  10. Content-Type: text/plain; charset=iso-8859-1
  11. Content-Transfer-Encoding: 8bit
  12. X-GateSoftware: AmiGate 1.6 (13.11.95)
  13. MMDF-Warning:  Parse error in original version of preceding line at relay-2.mail.demon.net
  14. X-Mail2News-Path: disperse.demon.co.uk!post.demon.co.uk!beachyhd.demon.co.uk
  15.  
  16. Hi all,
  17.  
  18. Does anyone know of a program that will (reliably!) switch C/C++ style
  19. comments?
  20.  
  21. So if I have some sourcecode as follows:
  22.  
  23.  
  24.  // Test program
  25.  void main()
  26.  {
  27.     printf("Test\n");  // print some text
  28.  }
  29.  
  30.  
  31. ..it'll convert it to:
  32.  
  33.  
  34.  /* Test program */
  35.  void main()
  36.  {
  37.     printf("Test\n");  /* print some text */
  38.  }
  39.  
  40.  
  41. ..(or alternatively you could run it over the second piece of code and it'd
  42. produce the first).
  43.  
  44. It must be able to handle:
  45.  
  46.  . Multiple line /**/-style comments
  47.  
  48.  . Comment symbols that aren't actually comments
  49.      for example:
  50.         printf("This /* is */ a test\n");
  51.      should *not* be converted
  52.  
  53.  
  54. Another complication will be:
  55.  
  56.  /* this comment
  57.  ** is going to be
  58.  ** irritating */ printf("test\n");
  59.  
  60. ..that will need to be converted to:
  61.  
  62.  // this comment
  63.  // is going to be
  64.  //
  65.  printf("test\n");
  66.  
  67.  
  68. If no one knows of such a program then I'll write one, I just wondered if such
  69. a thing exists already.
  70.  
  71. Thanks!
  72.  
  73. .\dam.          [Team AMIGA]          //\ ad32@brighton.ac.uk \\/
  74.  
  75.