Clone Digger and gccxml

24 views
Skip to first unread message

matthieu...@gmail.com

unread,
Oct 22, 2008, 4:27:12 PM10/22/08
to Clone Digger general
Hi,

I just read about this module in Python Magazine, and I was wondering
if there were plans to support gccxml, or perhaps more interestingly
pygccxml ?

Matthieu Brucher

Peter Bulychev

unread,
Oct 22, 2008, 7:52:55 PM10/22/08
to clonedigg...@googlegroups.com
Hello.

As I understand you recommend me to use pygccxml in order to find clones in C++ programs.

I think that it's a good idea, but there is one reason for me not to implement this feature. I made Clone Digger in multi-platform fashion and it runs from the box (no special environment is needed).
If the pygccxml feature is implemented, Clone Digger will depend on the gcc (which is not always presented) and maybe it will also depend on some other environment.

If you need this feature, you can implement it by yourself, I'll be happy to help you by answering your questions (if any).




--
Best regards,
  Peter Bulychev.

Matthieu Brucher

unread,
Oct 23, 2008, 1:36:15 AM10/23/08
to clonedigg...@googlegroups.com
Hi,

2008/10/23 Peter Bulychev <peter.b...@gmail.com>:


> Hello.
>
> As I understand you recommend me to use pygccxml in order to find clones in
> C++ programs.

More or less, yes ;) Easier than implementing a whole C++ parser.

> I think that it's a good idea, but there is one reason for me not to
> implement this feature. I made Clone Digger in multi-platform fashion and it
> runs from the box (no special environment is needed).
> If the pygccxml feature is implemented, Clone Digger will depend on the gcc
> (which is not always presented) and maybe it will also depend on some other
> environment.

I can understand that ;)

> If you need this feature, you can implement it by yourself, I'll be happy to
> help you by answering your questions (if any).

Cool ;)
I'll try to reuse the Java or Lua scripts. Is it easy to modify the
Eclipse plugin ?

Thanks,

Matthieu

> 2008/10/23 matthieu...@gmail.com <matthieu...@gmail.com>
>>
>> Hi,
>>
>> I just read about this module in Python Magazine, and I was wondering
>> if there were plans to support gccxml, or perhaps more interestingly
>> pygccxml ?
>>
>> Matthieu Brucher
>>
>
>
>
> --
> Best regards,
> Peter Bulychev.
>
> >
>

--
Information System Engineer, Ph.D.
Website: http://matthieu-brucher.developpez.com/
Blogs: http://matt.eifelle.com and http://blog.developpez.com/?blog=92
LinkedIn: http://www.linkedin.com/in/matthieubrucher

Peter Bulychev

unread,
Oct 23, 2008, 4:19:05 AM10/23/08
to clonedigg...@googlegroups.com
Hello.

> As I understand you recommend me to use pygccxml in order to find clones in
> C++ programs.

More or less, yes ;) Easier than implementing a whole C++ parser.
Yes, implementing C++ parser from scratch is not a good idea because C++ is a very complicated and unstrict language, and different compilers support different dialects of it. So, even there are some C++ grammars (for instance, grammars for ANTLR), it is very unlikely that using this grammar you'll be able to parse real-life projects without errors.

Cool ;)
I'll try to reuse the Java or Lua scripts. Is it easy to modify the
Eclipse plugin ?
Yes, reusing Java and Lua scripts is a good choice cause they also interpret XML representations of parse trees (and AST for Java), produced by the ANTLR parser generator.
I hope, modifying Eclipse is an easy task, but it was developed not by me but by the Google Summer of Code student.

I think that for obtaining better results you should use abstract syntax trees (not parse trees), but parse tree-based solution will also work (maybe a little bit slowly, depending on the redundancy of parse trees) :)
Reply all
Reply to author
Forward
0 new messages