Patent ID: 8352926
Filing Date: 2013-01-08
Classification: G06F

Abstract:
1. A method for translating input source code in one logically distinct object oriented language on one platform into another object oriented language on another platform, comprising the steps of: providing an input source parse tree corresponding to each input source code type definition or module definition and a symbol table about all type definitions and other names defined in the input source code; performing, in a first type inference phase, a type dependency analysis on the input source parse tree, in which it is noted which objects of unknown type share a type; performing, in a second type inference phase, type inference analysis on the input source parse tree, in which members of classes whose definition is not available in the input source code have their types and signatures inferred from their use, and propagating inferred types to any objects of unknown type which share the inferred type; determining from the characteristics of the use of undeclared names, what kind of names they are; analyzing the types of the source and target operands in expressions and recording the inferred subtyping relationship in the supertype set; performing, in a third type inference phase, a type hierarchy analysis on all types referenced in the input source code whose definition is not available, in which a hierarchy for those types is detected and defined; performing, in a fourth type inference phase, a final type inference analysis on the input source parse tree, in which the results of the type hierarchy analysis is used to refine the inferred types; performing, in a translate phase, a tree traversal on the input source parse tree and generating the translated code for the classes and statements in the input source code; and generating the translation interfaces directory and its contents for platform references and types whose definition is unavailable in the original source, wherein the results of all phases of type inference are reflected in the contents of the translation interfaces directory.