The present invention relates to a method for program transformation and an apparatus for COBOL to Java program transformation. The method consists of: (1) a new approach for statement-to-statement program transformation, facilitated by a predefined target language library, which keeps original comments, program control flow, functionality, and time complexity; (2) a new approach for goto statement elimination, which uses existing exception handling mechanism in target language and its implementation is hidden in a super class in a library; (3) a new extended BNF to distinguish different occurrences of the same term in a BNF production; (4) a new approach for embedded statement as a special marker statement and a comment, (5) in the description of the above, a program transformation specification language is defined to describe relationship between comments in two languages. (6) an apparatus, as the preferred embodiment of the method, is a COBOL to Java program transformation system Cobol2Java; a sample COBOL application and its Cobol2Java translation are given.