Ada support for Clone Digger through Avatox

45 views
Skip to first unread message

Manuel Gomez

unread,
Feb 29, 2012, 3:49:30 PM2/29/12
to Clone Digger general
Quoting from the documentation:
'The support of other programming languages can be added feasibly:
internal compiler information or parser generator (ANTLR, JavaCC, etc)
can be used to produce XML of AST, the rest is simple. '

I was wondering whether it would be possible to add Ada support for
Clone Digger via another tool (Avatox http://www.mckae.com/avatox.html)
that parses Ada and transforms it to an XML format.

Does CD expect a specific XML format or could the direct output of
Avatox be used as input for CD? If CD expects a specific XML format,
where it is defined? Are there schemas or DTDs? In that case I suppose
that a stylesheet could be developed for converting between both
formats. Am I right?

Thanks for any insight that you could provide.

Regards,
Manuel

Peter Bulychev

unread,
Mar 1, 2012, 12:23:01 PM3/1/12
to clonedigg...@googlegroups.com
Dear Manuel,

As I understand, the Avatox tool produces a kind of Abstract Syntax Tree for the Ada programs.
If I'm right, there is nothing difficult in adding Ada support to Clone Digger.

You can just duplicate the code to handle Java programs (java_antlr.py), and then modify it to handle the Avatox output.

The current XML handling code in Clone Digger assumes, that the XML of an AST is given in a very simple form (see example attached)
The only one important thing is to distinguish the statement nodes from all other nodes (node vs statement_node).

You can either change the output of the Avatox tool, so it will be compatible with Clone Digger.
Or, you can change the Clone Digger (i.e. your duplicated version of java_antlr.py), so it will handle the output of Avatox.

2012/2/29 Manuel Gomez <mgr...@gmail.com>

--
You received this message because you are subscribed to the Google Groups "Clone Digger general" group.
To post to this group, send email to clonedigg...@googlegroups.com.
To unsubscribe from this group, send email to clonedigger_gen...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/clonedigger_general?hl=en.




--
Best regards,
   Peter Bulychev.
temporary_ast.xml
Reply all
Reply to author
Forward
0 new messages