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: 07/11 Comment utilities for Java

========== CSplit: Version 2.0 ==========
========== CSplit: Begin part 7/11 ==========
            //     becomes: "/* /*comment* / */"
            case CPEvent.FOUND_SLASH:
                print (' ');
                break;
            case CPEvent.FOUND_NL:      // End of C++ comment...
                print (" */");          // ...put ending C-comment mark.
                break;
            }
            break;
        }
        printChar();
    }
}
public class Converter
{
    public static void main (String args[])
    {
        CommentConverter obj = new CommentConverter();
        int argc = args.length;
        if (! obj.init (argc, args))
        {
            System.err.println ("USAGE: Converter InFile [OutFile]");
        }
        else
        {
            obj.run();
            obj.unInit();
        }
    }
}
========== CSplit: End file Converter.java ==========
========== CSplit: Begin file Counter.java ==========
/**
 * Counter.java
 * Implementation of comment counter.
 *
 * ver 1.0, 23 Mar 1997
 *
 * Public domain by:
 *   Jari Laaksonen
 *   Arkkitehdinkatu 30 A 2
 *   FIN-33720 Tampere
 *   FINLAND
 *
 *   Fidonet : 2:221/360.20
 *   Internet: jla@to.icl.fi
 */
class CommentCounter extends CommentParser
{
    private long   code_lines = 0;
    private long   cpp_comments = 0;
    private long   cmt_lines = 0;
    private int    open_comment = 0;
    private int    close_comment = 0;
    private long   tot_cpp_comments = 0;
    private long   tot_cmt_lines = 0;
    private long   tot_lines = 0;
    private long   tot_code_lines = 0;
    private int    chars = 0;
    //==================================================================
    /**
     *
     */
    public CommentCounter()
    {
        reset();
    }
    //==================================================================
    /**
     * @return the number of code lines.
     */
    public long getCodeLines()
    {
        return code_lines;
    }
    //==================================================================
    /**
     * @return the number of C++ style comments.
     */
    public long getCppComments()
    {
        return cpp_comments;
    }
    //==================================================================
    /**
     * @return the number of comment lines.
     */
    public long getCommentLines()
    {
        return cmt_lines;
    }
    //==================================================================
    /**
     * @return the number of open comments.
     */
    public int getOpenComment()
    {
        return open_comment;
    }
    //==================================================================
    /**
     * @return the number of close comments.
     */
    public int getCloseComment()
    {
        return close_comment;
    }
    //==================================================================
    /**
     * @return the total number of C++ style comments.
     */
    public long getTotCppComments()
    {
        return tot_cpp_comments;
    }
    //==================================================================
    /**
     * @return the total number of comment lines.
     */
    public long getTotCommentLines()
    {
        return tot_cmt_lines;
    }
    //==================================================================
    /**
     * @return the total number of lines.
     */
    public long getTotLines()
    {
========== CSplit: End part 7/11 crc: dd05 ==========
        // 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™.