Methods and apparatus for automatic translation of a computer program language code
First Claim
1. A method, executed by electronic computer hardware in combination with software, for automatic translation of a computer program language code, comprising:
- tokenizing one or more characters of a source programming language code to generate a list of tokens;
parsing the list of tokens to generate a grammatical data structure, wherein the grammatical data structure comprises one or more data nodes;
processing the one or more data nodes of the grammatical data, structure to generate a document object model, wherein the document object model comprises one or more portable data nodes; and
analyzing the one or more portable data nodes in the document object model to generate one or more characters of a target programming language code;
normalizing the source programming language, wherein one or more features of the source programming language are managed based on one or more features of the target programming language, comprising;
identifying one or more non-equivalent and one or more equivalent features from the one or more features in the source programming language, wherein the one or more non-equivalent features and the one or more equivalent features are identified based on the one or more features of the target programming language; and
removing the one or more non-equivalent features of the source programming language;
wherein equivalent features are features that are configured to be mapped the source programming language and the target programming language.
5 Assignments
0 Petitions
Accused Products
Abstract
Embodiments of the methods and apparatus for automatic cross language program code translation are provided. One or more characters of a source programming language code are tokenized to generate a list of tokens. Thereafter, the list of tokens is parsed to generate a grammatical data structure comprising one or more data nodes. The grammatical data structure may be an abstract syntax tree. The one or more data nodes of the grammatical data structure are processed to generate a document object model comprising one or more portable data nodes. Subsequently, the one or more portable data nodes in the document object model are analyzed to generate one or more characters of a target programming language code.
53 Citations
51 Claims
-
1. A method, executed by electronic computer hardware in combination with software, for automatic translation of a computer program language code, comprising:
-
tokenizing one or more characters of a source programming language code to generate a list of tokens; parsing the list of tokens to generate a grammatical data structure, wherein the grammatical data structure comprises one or more data nodes; processing the one or more data nodes of the grammatical data, structure to generate a document object model, wherein the document object model comprises one or more portable data nodes; and analyzing the one or more portable data nodes in the document object model to generate one or more characters of a target programming language code; normalizing the source programming language, wherein one or more features of the source programming language are managed based on one or more features of the target programming language, comprising; identifying one or more non-equivalent and one or more equivalent features from the one or more features in the source programming language, wherein the one or more non-equivalent features and the one or more equivalent features are identified based on the one or more features of the target programming language; and removing the one or more non-equivalent features of the source programming language; wherein equivalent features are features that are configured to be mapped the source programming language and the target programming language. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 13, 14, 44, 45, 49)
-
-
10. A method, executed by electronic computer hardware in combination with software, for automatic translation of a computer program language code, comprising:
-
tokenizing one or more characters of a source programming language code to generate a list of tokens; parsing the list of tokens to generate a grammatical data structure, wherein the grammatical data structure comprises one or more data nodes; processing the one or more data nodes of the grammatical data structure to generate a document object model, wherein the document object model comprises one or more portable data nodes; and analyzing the one or more portable data nodes in the document object model to generate one or more characters of a target programming language code; wherein processing the one or more data nodes of the grammatical data structure comprises; scanning the one or more data nodes in the grammatical data structure to identify one or more metadata nodes having a metadata structure that can be deduced from at least one declaration node; and removing the one or more metadata nodes to generate the one or more portable data nodes, wherein the portable data nodes have a metadata structure that cannot be deduced from at least one declaration node.
-
-
15. An apparatus including electronic computer hardware in combination with software, for automatic translation of a computer program language code, the apparatus comprising:
-
a tokenizer configured to tokenize one or more characters of a source programming language code to generate a list of tokens; a parser configured to parse the list of tokens to generate a grammatical data structure, wherein the grammatical data structure comprises one or more data nodes; a generator configured to process the one or more data nodes of the grammatical data structure to generate a document object model, wherein the document object model comprises one or more portable data nodes; and an analyzer configured to process the one or more portable data nodes in the document object model to generate one or more characters of a target programming language code wherein the generator is further configured to; scan the one or more data nodes in the abstract syntax tree to identify one or more metadata nodes having a metadata structure that can be deduced from at least one declaration node; and remove the one or more metadata nodes to generate the one or more portable data nodes having a metadata structure that cannot be deduced from at least one declaration node. - View Dependent Claims (16, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 46)
-
-
17. An apparatus including electronic computer hardware in combination with software, for automatic translation of a computer program language code, the apparatus comprising:
-
a tokenizer configured to tokenize one or more characters of a source programming language code to generate a list of tokens; a parser configured to parse the list of tokens to generate a grammatical data structure, wherein the grammatical data structure comprises one or more data nodes; a generator configured to process the one or more data nodes of the grammatical data structure to generate a document object model, wherein the document object model comprises one or more portable data nodes; and an analyzer configured to process the one or more portable data nodes in the document object model to generate one or more characters of a target programming language code; a normalizer configured to; identify one or more non-equivalent and one or more equivalent features from the one or more features in the source programming language, wherein the one or more non-equivalent features and the one or more equivalent features are identified based on the one or more features of the target programming language; and remove the one or more non-equivalent features of the source programming language; wherein equivalent features are features that can be mapped between the source programming language and the target programming language. - View Dependent Claims (18)
-
-
29. A non-transitory computer-readable medium having computer-executable instructions for performing a method for language translation of a computer program code, said method comprising:
-
tokenizing one or more characters of a source programming language code to generate a list of tokens based on a set of expression rules; parsing the list of tokens to generate a grammatical data structure based on a set of grammar rule, wherein the grammatical data structure comprises one or more data nodes; processing the one or more data nodes of the grammatical data structure to generate a document object model, wherein the document object model comprises one or more portable nodes; and analyzing the one or more portable nodes of the document object model to generate one or more characters of a target programming language code; wherein processing the one or more data nodes of the grammatical data structure comprises; scanning the one or more data nodes in the grammatical data structure to identify one or more metadata nodes having a metadata structure that can be deduced from at least one declaration node; and removing the one or more metadata nodes to generate the one or more portable data nodes having a metadata structure that cannot be deduced from at least one declaration node. - View Dependent Claims (30, 31, 32, 33, 34, 48)
-
-
35. A system including electronic computer hardware in combination with software, for automatic translation of a computer program language code, comprising:
-
means for tokenizing one or more characters of a source programming language code to generate a list of tokens; means for parsing the list of tokens to generate a grammatical data structure, wherein the grammatical data structure comprises one or more data nodes; means for processing the one or more data nodes of the grammatical data structure to generate a document object model, wherein the document object model comprises one or more portable data nodes; and means for analyzing the one or more portable data nodes in the document object model to generate one or more characters of a target programming language code; wherein the means for processing the grammatical data structure comprises; means for scanning the one or more data nodes in the grammatical data structure to identify one or more metadata nodes having metadata structure that can be deduced from at least one declaration node; and means for removing the one or more metadata nodes to generate the one or more portable data nodes having a metadata structure that cannot be deduced from at least one declaration node. - View Dependent Claims (36, 37, 38, 39, 40, 41, 42, 43, 50, 51)
-
-
47. The apparatus of 15, wherein the grammar rules applied by the parser to generate the grammatical data structure can be context-free grammar or attribute grammar.
Specification