史荣久 2009年08月07日 星期五 20:35 | 1508次浏览 | 4条评论
不知道社区各位,是否知道这样一个工具.
统计一个工程的源代码,对类库中方法/类的使用情况进行统计.
比如 java项目,
java.util.LinkedList 类, #### 次/千行代码
java.util.LinkedList.removeFirst() 方法, ####次/千行代码
最好能识别借口,父类,多态.
如果没有以上工具的话,打算用java做一个.
思路是使用正则表达式和语法分析(
JavaCC)
这个代码统计的目的,主要是找出实际项目中最常用的20%的知识.
(评论内容太长,须在1024个汉字以内。)
ProGuard is a free Java class file shrinker, optimizer, obfuscator, and preverifier. It detects and removes unused classes, fields, methods, and attributes. It optimizes bytecode and removes unused instructions. It renames the remaining classes, fields, and methods using short meaningless names. Finally, it preverifies the processed code for Java 6 or for Java Micro Edition.
http://proguard.sourceforge.net/
Java Gems are general purpose utilities for Java. Yes, Java Gems are those simple code snippets copied again and again from one project to another, often from your private project to several work projects, those small things you cannot find in java.util and its subpackages, but you cannot live without them.
http://code.google.com/p/javagems/
ANTLR, ANother Tool for Language Recognition, is a language tool that provides a framework for constructing recognizers, interpreters, compilers, and translators from grammatical descriptions containing actions in a variety of target languages. ANTLR provides excellent support for tree construction, tree walking, translation, error recovery, and error reporting. There are currently about 5,000 ANTLR source downloads a month.
http://www.antlr.org/
JFlex is a lexical analyzer generator (also known as scanner generator)
http://www.jflex.de/
This is the homepage of the Code Analysis Plugin (CAP).
CAP is a plugin for the eclipse platform and analysis the dependencies of your Java project. It opens a own perspective and displays the results in an clear way using different diagrams.
http://cap.xore.de/
CodePro products assist Eclipse developers in reducing errors in software as code is being written. The ability to make immediate corrections to code can dramatically reduce developments costs and improve product delivery times.
http://www.instantiations.com/codepro/
SJPT is a parsing toolkit that supports both top-down (LL(1) and Simple Precedence) and bottom-up parsing (LR(0), SLR(1), LR(1) and LALR(1)).
http://sjpt.sourceforge.net/
A parser/lexer generator written in Java. This is a development fork of the well known JavaCC parser generator originally developed at Sun Microsystems.
http://code.google.com/p/freecc/
Zeuux © 2024
京ICP备05028076号
回复 苏业钦 2009年08月07日 星期五 21:28
回复 史荣久 2009年08月07日 星期五 21:54
回复 苏业钦 2009年08月07日 星期五 22:01