Skip to content

Improve the readability of generated source code which contains GetAbstractCobolField. #327

@yutaro-sakamoto

Description

@yutaro-sakamoto

cobj convert some cobol source code to Java source code which uses a class GetAbstractCobolField.
The source code related to GetAbstractCobolField are a little difficult to read.

The followings are reproduction code and a compilation command.

a.cbl

       IDENTIFICATION    DIVISION.
       PROGRAM-ID.       a.
       DATA              DIVISION.
       WORKING-STORAGE   SECTION.
       01  XX         PIC N(5).
       PROCEDURE         DIVISION.
           DISPLAY XX(2:3).
           GOBACK.

the compilation command

cobj -debug a.cbl

a.java

          CobolTerminal.display (0, 1, 1, (new GetAbstractCobolField(){ public AbstractCobolField run() throws CobolStopRunException {           CobolUtil.cobCheckRefModNational (((b_I.getNumdisp(2) * 2) - 1), (b_J.getNumdisp(1) * 2), 10, str_1_X);
return CobolFieldFactory.makeCobolField((b_J.getNumdisp(1) * 2), b_588d8096da.getSubDataStorage((((b_I.getNumdisp(2) * 2) - 1) - 1)), a_1);}}).run());

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions