Tool for Cross-Referencing Ported Code

B

brandon.e.taylor

I am looking for a tool capable of producing HTML pages from source
files written in different languages, where the source written in one
language is a port of the source written in another language.
Primarily,
I need to be able to create hyperlinks - e.g. through the use of
tagged
comments in the source - linking corresponding code, all the way down
to
the statement level, between the original source codebase and the
ported
codebase. Ideally, I would like the tool to support the typical
complement of interesting source-to-html features (e.g. syntax
highlighting, line numbering, symbol cross-referencing, etc.) as
well.

My current need is to map from C to ASM (and vice-versa), but I would
like to find a tool that supports and/or is extensible to other
languages.

I would appreciate any pointers to open source tools that already
meet
my described need or open source tools that could be relatively easily
modified to meet my described need.

Thanks.
 
J

Joe

I am looking for a tool capable of producing HTML pages from source
files written in different languages, where the source written in
one language is a port of the source written in another language.
Primarily, I need to be able to create hyperlinks - e.g. through the
use of tagged comments in the source - linking corresponding code,
all the way down to the statement level, between the original source
codebase and the ported codebase. Ideally, I would like the tool to
support the typical complement of interesting source-to-html
features (e.g. syntax highlighting, line numbering, symbol
cross-referencing, etc.) as well.

My current need is to map from C to ASM (and vice-versa), but I would
like to find a tool that supports and/or is extensible to other
languages.

I would appreciate any pointers to open source tools that already
meet my described need or open source tools that could be relatively
easily modified to meet my described need.

Javadoc might work for you. http://java.sun.com/j2se/javadoc/ I know
that people use it successfully in C/C++.

Joe
 
C

CBFalconer

I am looking for a tool capable of producing HTML pages from source
files written in different languages, where the source written in
one language is a port of the source written in another language.
.... snip ...

My current need is to map from C to ASM (and vice-versa), but I
would like to find a tool that supports and/or is extensible to
other languages.

I would appreciate any pointers to open source tools that already
meet my described need or open source tools that could be
relatively easily modified to meet my described need.

This seems fairly nice, but I don't know if it meets your
requirements. However, it is open source, and is descended from
NVU, the Mozilla HTML editor.

<http://prdownloads.sourceforge.net/kompozer/>
 
K

Kenan Kalajdzic

In said:
I am looking for a tool capable of producing HTML pages from source
files written in different languages, where the source written in one
language is a port of the source written in another language.
Primarily,
I need to be able to create hyperlinks - e.g. through the use of
tagged
comments in the source - linking corresponding code, all the way down
to
the statement level, between the original source codebase and the
ported
codebase. Ideally, I would like the tool to support the typical
complement of interesting source-to-html features (e.g. syntax
highlighting, line numbering, symbol cross-referencing, etc.) as
well.

My current need is to map from C to ASM (and vice-versa), but I would
like to find a tool that supports and/or is extensible to other
languages.

I would appreciate any pointers to open source tools that already
meet
my described need or open source tools that could be relatively easily
modified to meet my described need.

Have a look at Linux Cross Reference project at http://lxr.linux.no/.
I am not sure to which extent it meets your needs, but I think it is
worth a look.
 
J

jacob navia

Kenan said:
Have a look at Linux Cross Reference project at http://lxr.linux.no/.
I am not sure to which extent it meets your needs, but I think it is
worth a look.

That project writes in their home page:

<quote>
The index generator is written in Perl and relies heavily on Perl's
regular expression facilities. The algorithm used is very brute force
and extremely sloppy.
<end quote>

This means:
<quote>
There are obvious disadvantages to this approach. No scope checking is
done, and the most annoying effect of this is mistaking local identifers
for references to global ones with the same name.
<end quote>


This type of work can be done only in the compiler.

jacob
 
L

Logan Shaw

This type of work can be done only in the compiler.

It's worse than that. The original poster's request was for something
that generates cross references between two implementations of the "same"
software in two different languages.

So the most obvious way to generate such a thing is to use a tool that
automatically ports a program from one language to another and generate
it at the time you are creating the second, ported code base. Some tools
to translate programs from one language to another exist[1], but they aren't
often used since they don't generate very good code.

The original poster didn't say how the ported code was generated. If
the port was done by hand, then a tool that automatically finds the
sections that correspond to each other is a tall order indeed. It's
particularly tough since most languages have different sets of semantics
and different library functions available. So for example, if you ported
some Java code to C, you might replace some code that uses collections with
code that uses arrays. In fact, you might even change the logic slightly
in the process. For example, if I need to return a list of something in C
and I don't know in advance how big the list is, I sometimes generate the
list once and throw away the elements but count them, then malloc() enough
space for the list and generate it again, filling the elements into the
allocated memory. That wastes CPU time but solves other problems. One
would never do something like that in Java. I'd be impressed by a tool
that could build cross references between the two bits of code in a case
like that. It wouldn't be anything like a 1-to-1 mapping.

- Logan
 
B

brandon.e.taylor

It's worse than that. The original poster's request was for something
that generates cross references between two implementations of the "same"
software in two different languages.

Sorry. I should have been more clear. The tool need not automatically
generate
the cross-references. I am simply looking for a tool that will
automatically
generate HTML for the code with hyperlinks for cross-references that
are manually
determined and identified (e.g. using specially formatted comments) by
the
developer(s) performing the port. This should not be terribly
difficult so I am
expecting to find a tool (Doxygen, perhaps?) that can already do this
or one that
will do this with a bit of modification/coaxing. :)

<SNIP>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,982
Messages
2,570,186
Members
46,744
Latest member
CortneyMcK

Latest Threads

Top