С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.