TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: ALL
from: JARI LAAKSONEN
date: 1997-03-28 21:58:00
subject: 11/11 Comment utilities for Java

========== CSplit: Version 2.0 ==========
========== CSplit: Begin part 11/11 ==========
        if (! nl && theEvent == CPEvent.FOUND_NL)
        {
            rc = true;
        }
        if (rc)
            printChar();
    }
}
public class Remover
{
    public static void main (String args[])
    {
        CommentRemover obj = new CommentRemover();
        int argc = args.length;
        if (! obj.init (argc, args))
        {
            System.err.println ("USAGE: Remover InFile [OutFile]");
        }
        else
        {
            obj.run();
            obj.unInit();
            System.err.println (
                "\nOK! " +
                obj.getLines() +
                " lines processed. Last state = " +
                obj.getLastStateStr()
            );
        }
    }
}
========== CSplit: End file Remover.java ==========
========== CSplit: Begin file cmttests.c ==========
/* +++Date last modified: 02-Aug-1996 */
/*
 * Test file for Comment Utilities.
 *   This file should be compilable before AND after comment
 *   conversion or removal.
 *
 *   Jari Laaksonen
 *   Arkkitehdinkatu 30 A 2
 *   FIN-33720 Tampere
 *   FINLAND
 *   Fidonet:  2:221/360.20
 *   Internet: jla@to.icl.fi
 */
#include 
int main()
{
/*
  comment */ int a; /* comment continues in same line
*/
/* C comment */ int b; // C++ comment
/*
   C comment
*/ int c; // C++ comment
  /**** comment ****/
  //*** comment ****/
  char ch = '\"'; /* double quote but not a start of a string */
  char x1[]       // here we...
    = "";
  char x2[] = ""; /* ...have some... */
  char x3[] = ""  /* ...empty... */ ;
  char x4[] = ""; // ...strings.
  printf ("this is a string");          /* C comment */
  printf ("this is \" another string"); // C++ comment
  printf ("this is \' another string"); // C++ comment
  printf ("yet another \\ string");     // C++ comment
/* C comment in one line */
// C++ comment in one line
/* C comment
   in several
   lines
   printf ("// not a comment");
*/
/* C comment
   in several lines */
// C comment in C++ comment: /* comment */
/* C++ comment in C comment: // comment */
/*
   C++ comment in C comment: // comment
*/
  printf ("this /* is not // a comment * * ! ");
  printf ("this /* is not a comment * * ! ");
  printf ("this // is not a comment * * ! ");
  printf ("this */ is not a comment * * ! ");
// C++ comment
// C++ comment /
// C++ comment in \
   several        \
   lines
/\
/ C++ comment
  a = 0; /\
* C comment */
  /* C       *\
   *         *
  \* comment */
/* C comment \
   C comment */
// char s[] = "string \
               string";
// not a multiline C++ \comment
  b = 0;
// not a multiline C++ \ comment
  c = 0;
  return 0;
}
// end file
========== CSplit: End file cmttests.c ==========
========== CSplit: End part 11/11 crc: 5b44 ==========
        // Albert                      email: jla@to.icl.fi
--- GoldED/2 2.50+
---------------
* Origin: Albert's Point/2 in Finland, Europe (2:221/360.20)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.