========== 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)
|