Skip to content

liyuntao/JavaCommentRemover

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#JavaCommentRemover

##What is JavaCommentRemover?

JavaCommentRemover is a simple tool which can remove all comments in .java file. Inspired by Finite State Machine(FSM).

JavaCommentRemover是一个去除Java文件中所有注释的工具。使用简单的有限状态机(Finite State Machine)实现。

StateChart

Done:

  • remove multi-line comments like /* xxx */
  • remove single-line comments like // xxx
  • symbol which could trigger the state shift will not has any effect in char and String. Such as String s = "abc/*part of Str/def"
  • escape character in char or String will not affect the judgement of comments. Such as " or \\

  • 去除/* xxx */ 形式的多行注释
  • 去除以//开头的单行注释
  • char, String中可触发状态转换的特殊字符/* xxx*/ 不会影响状态转移 如 String s = "abc/**part of Str */def"
  • char, String中的转义字符与被转义字符不会影响注释的判断与去除 如 " or \\

TODO:

  • adjust the f*king stupid StateChart.png
  • 把状态转移图美化一下

About

A simple tool of removing all comments in .java file. Inspired by Finite State Machine(FSM)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages