Data processing: structural design – modeling – simulation – and em – Emulation – Compatibility emulation
Reexamination Certificate
1999-07-02
2002-05-14
Teska, Kevin J. (Department: 2123)
Data processing: structural design, modeling, simulation, and em
Emulation
Compatibility emulation
C717S152000, C704S007000
Reexamination Certificate
active
06389385
ABSTRACT:
BACKGROUND OF THE INVENTION
1. Technical Field of the Invention
This invention pertains to source code translation. More particularly, it relates to a safe system and method for reversibly translating source code between unlike character sets.
2. Background Art
More and more often companies are using workstation tools to change or maintain mainframe software source code. However, the mainframes use the IBM EBCDIC character encoding system while workstations use the ASCII system. For the most used characters, there are safe and reversible mappings between the two encoding systems. Unfortunately, this is not true for all possible characters, because there are no equivalents in both systems, because of varying locations of characters within variations of the same system, and because some characters have special control meanings in each system.
Generally, each programming language uses a set of characters for its operational syntax. By ensuring these characters are mapped reversibly, a translated program can be made to compile on both the mainframe and the workstation. However, mainframe software source code may contain any of the 256 possible characters in program comments and program text literals. Although the usual frequency of occurrence of unsafe characters is very small, if any of those characters are translated to workstation control characters, the program may not compile or be editable or even viewable. If any of those characters are not mapped in a reversible way, they will be different when the program is returned to the mainframe. At best, this may make a comment less understandable; at worst it will change the data in a program literal with unpredictable and possibly disastrous results if not corrected.
Generally, the upload and download character translation mapping tables are synchronized as much as possible for the most used characters. This often fails because it is not always possible to use the same tool or synchronized tables for both the upload and download. It also doesn't allow all 256 possible values to be safely translated. Usually, separate fix-up work is required to detect and correct translation errors.
Consequently, there is a need in the art for a translation system and method which eliminates the need for maintaining synchronized translation mapping tables and the need for separate fix-up work.
Another solution is to use a special escape character before an untranslated value and then convert the untranslated value to a two character value in hexadecimal format. This solution does not work with source code because it changes the length of certain records and, more importantly, it changes the length of program literals, which could make the program not compile.
Consequently, there is a need in the art for a translation system and method which does not change the length of source code records or program text literals.
It is an object of the invention to provide an improved system and method for translating source code.
It is a further object of the invention to provide a system and method for translating source code such that it is possible to move mainframe software source code to a workstation, operate on the code, and move it back to the mainframe, knowing that the character translations are safe and reversible.
It is a further object of the invention to provide a system and method for translating source code which eliminates errors due to unsafe and un-reversible translations both on the workstation and on the mainframe.
SUMMARY OF THE INVENTION
A system and method is provide for translating source code. A mapping table of syntactically necessary characters is provided for translating source characters from a first format to a second format. A marker character is used to replace other characters in the source code while translating and preserving the original, replaced source character in a comment file. Upon reverse translating, syntactically necessary characters are translated back into the first format using the mapping table, and marker characters are replaced by reverse translated original source characters from the comment file.
In accordance with a more specific embodiment of the invention, original characters replaced by the marker character are translated into a two-character hexadecimal representation, and then reverse translated from that two-character hexadecimal representation back into original source characters, in order to keep the original characters replaced by the marker character from preventing compilation or editing.
In accordance with an aspect of the invention, there is provided a computer program product configured to be operable to translate source code using a mapping table, a marker character, and a comment file of source code characters replaced by the marker character.
Other features and advantages of this invention will become apparent from the following detailed description of the presently preferred embodiment of the invention, taken in conjunction with the accompanying drawings.
REFERENCES:
patent: 4729096 (1988-03-01), Larson
patent: 5201042 (1993-04-01), Weisner et al.
patent: 5564113 (1996-10-01), Bergen et al.
patent: 5694601 (1997-12-01), White
patent: 5701423 (1997-12-01), Crozier
patent: 5754845 (1998-05-01), White
patent: 5831560 (1998-11-01), Gelfenbain
patent: 5838980 (1998-11-01), Guillen et al.
patent: 5898874 (1999-04-01), Gelfenbain
“Model for Building and Running AS/400 RPG Program in a Java Virtual Machine”,Research Disclosure, No. 40789, Mar. 1998, pp. 303-305.
“Automatic Retrieval of Program Design Information from Source Code”,IBM Technical Disclosure Bulletin, vol. 30, No. 12, May 1988, pp. 120-123.
“Assignment Scheme for Round Trip Integrity”,IBM Technical Disclosure Bulletin, vol. 30, No. 10, Mar. 1998, pp. 93-95.
“Maintain Design and Program Source Together as One Entity”,IBM Technical Disclosure Bulletin, vol. 38, No. 3, Mar. 1995, pp. 21-28.
Beckstrand Shelly M
International Business Machines - Corporation
Teska Kevin J.
Thangavelu Kandasamy
LandOfFree
System and method for translating source code does not yet have a rating. At this time, there are no reviews or comments for this patent.
If you have personal experience with System and method for translating source code, we encourage you to share that experience with our LandOfFree.com community. Your opinion is very important and System and method for translating source code will most certainly appreciate the feedback.
Profile ID: LFUS-PAI-O-2911144