i really do not understand, based on what you want to establish the relationships between the objects.
debasisdas
Posting Genius
6,872 posts since Feb 2007
Reputation Points: 666
Solved Threads: 434
If you really want to achieve this kind of translation you need a higher level representation of the statements to be translated. On which level does the PHP "for" statement match the JAVA "if" statement and vice versa? If it does, it will be on the level of program flow logic. For that you will have to find an abstraction which matches both languages. There is no guarantee that for each language construct element in one language there will be a matching element in the other one. Consider the empty parameter loop "for (;;)" which is perfectly valid in C but not elsewhere.
If there were an equivalent for each language element in the other language, they would only differ in keywords and their order (and things like statement delimiters and brackets).
Beyond "Gödel, Escher, Bach" I recommend reading about Compiler construction which has to tackle this kind of problems.
I pretty much doubt that a relational database will help you much here. A formal representation in XML/XSLT might be easier.
smantscheff
Nearly a Posting Virtuoso
1,233 posts since Oct 2010
Reputation Points: 300
Solved Threads: 254