lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Greetings to the Lua users!

I'm the initial author of the tool Clone Digger, the tool for finding duplicate code in Python and Java.

I devised to apply it to the Lua language, cause I thought it would be good to be able to detect clones in such kind of embedded language.

So, I spent some time and have coded it. You'll need Python interpreter and Java to run the tool. To detect clones in your project type:

svn co https://clonedigger.svn.sourceforge.net/svnroot/clonedigger/trunk/clonedigger clonedigger
cd clonedigger
python ./clonedigger.py --lang=lua PATH_TO_SOURCE_TREE

, and you'll get output.html with list of detected clone candidates. The example report for the stdlib project (http://luaforge.net/projects/stdlib/) is here: http://clonedigger.sourceforge.net/lua_stdlib_output.html (hope, authors of stdlib will not mind :) )

Сurrent realization is not very efficient and smart and probably it can fail (I didn't tested it too much on Lua).

I'm looking for feedback from you (if any :) ).

p.s. The tool works on the AST level, but for Lua it uses parse trees instead of it (I didn't found any AST-generating grammar for Lua). I used the ANTLR grammar by Nicola Mainiero.

--
Best regards,
Peter Bulychev.