Skip to content

Embed COBOL variable names into Java variable names #38

@yutaro-sakamoto

Description

@yutaro-sakamoto

opensource COBOL 4j translates COBOL variables into Java variable names that consists of the common prefix and serial number.
For example, the compiler converts COBOL variables HELLO and WORLD in the following programs to Java variables f_5 and f_6.

       IDENTIFICATION              DIVISION.
       PROGRAM-ID.                 a.
       DATA                        DIVISION.
       WORKING-STORAGE             SECTION.
       01 HELLO PIC X(5) VALUE "Hello".
       01 WORLD PIC X(5) VALUE "World".
       PROCEDURE                   DIVISION.
           DISPLAY HELLO.
           DISPLAY WORLD.
           STOP RUN.
      /* a.cbl:8: DISPLAY */
      {
        CobolTerminal.display (0, 1, 1, f_5);
      }
      /* a.cbl:9: DISPLAY */
      {
        CobolTerminal.display (0, 1, 1, f_6);
      }

In order to improve the readability, the compiler should convert HELLO and WORLD to Java variables f_HELLO and f_WORLD respectively.

Metadata

Metadata

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions