avishek-sen-gupta / cobol-rekt

An evolving toolkit of capabilities helpful for reverse engineering legacy Cobol code
MIT License
89 stars 9 forks source link

NPE in building flowchart for AWS CardDemo CBACT01C.cbl #1

Closed svenrtw closed 3 months ago

svenrtw commented 3 months ago

FlowchartBuildMain.main() implementation:

public static void main(String[] args) throws IOException, InterruptedException {
        String ccRootDir = "/Users/asdf/dev/CodeConcise";
        String cardDemoDir = ccRootDir + "/aws-mainframe-modernization-carddemo";
        String sourceDir = cardDemoDir + "/app/cbl";
        File[] copyBookPaths = new File[]{new File(cardDemoDir + "/app/cpy")};
        String dialectJarPath = ccRootDir + "/che-che4z-lsp-for-cobol-integration/server/dialect-idms/target/dialect-idms.jar";
        String reportRootDir = cardDemoDir + "/out/report";

        List<String> programNames = ImmutableList.of("CBACT01C.cbl");
        new FlowchartTasks(sourceDir, reportRootDir, copyBookPaths, dialectJarPath).generateForPrograms(programNames, FlowchartGenerationStrategy.FULL_PROGRAM, LanguageDialect.COBOL);
    }

Log and stack trace:

/opt/homebrew/Cellar/openjdk/22.0.1/libexec/openjdk.jdk/Contents/Home/bin/java -javaagent:/Applications/IntelliJ IDEA CE.app/Contents/lib/idea_rt.jar=60107:/Applications/IntelliJ IDEA CE.app/Contents/bin -Dfile.encoding=UTF-8 -Dsun.stdout.encoding=UTF-8 -Dsun.stderr.encoding=UTF-8 -classpath /Users/sven.deridder/dev/CodeConcise/cobol-rekt/smojol-toolkit/target/classes:/Users/sven.deridder/.m2/repository/org/jgrapht/jgrapht-core/1.5.2/jgrapht-core-1.5.2.jar:/Users/sven.deridder/.m2/repository/org/jheaps/jheaps/0.14/jheaps-0.14.jar:/Users/sven.deridder/.m2/repository/org/apfloat/apfloat/1.10.1/apfloat-1.10.1.jar:/Users/sven.deridder/.m2/repository/org/jgrapht/jgrapht-ext/1.5.2/jgrapht-ext-1.5.2.jar:/Users/sven.deridder/.m2/repository/com/github/vlsi/mxgraph/jgraphx/4.2.2/jgraphx-4.2.2.jar:/Users/sven.deridder/.m2/repository/org/jgrapht/jgrapht-io/1.5.2/jgrapht-io-1.5.2.jar:/Users/sven.deridder/.m2/repository/org/apache/commons/commons-text/1.10.0/commons-text-1.10.0.jar:/Users/sven.deridder/dev/CodeConcise/cobol-rekt/woof/target/classes:/Users/sven.deridder/.m2/repository/org/neo4j/driver/neo4j-java-driver/5.22.0/neo4j-java-driver-5.22.0.jar:/Users/sven.deridder/.m2/repository/org/reactivestreams/reactive-streams/1.0.4/reactive-streams-1.0.4.jar:/Users/sven.deridder/.m2/repository/io/netty/netty-handler/4.1.111.Final/netty-handler-4.1.111.Final.jar:/Users/sven.deridder/.m2/repository/io/netty/netty-common/4.1.111.Final/netty-common-4.1.111.Final.jar:/Users/sven.deridder/.m2/repository/io/netty/netty-resolver/4.1.111.Final/netty-resolver-4.1.111.Final.jar:/Users/sven.deridder/.m2/repository/io/netty/netty-buffer/4.1.111.Final/netty-buffer-4.1.111.Final.jar:/Users/sven.deridder/.m2/repository/io/netty/netty-transport/4.1.111.Final/netty-transport-4.1.111.Final.jar:/Users/sven.deridder/.m2/repository/io/netty/netty-transport-native-unix-common/4.1.111.Final/netty-transport-native-unix-common-4.1.111.Final.jar:/Users/sven.deridder/.m2/repository/io/netty/netty-codec/4.1.111.Final/netty-codec-4.1.111.Final.jar:/Users/sven.deridder/.m2/repository/io/netty/netty-tcnative-classes/2.0.65.Final/netty-tcnative-classes-2.0.65.Final.jar:/Users/sven.deridder/.m2/repository/io/projectreactor/reactor-core/3.6.7/reactor-core-3.6.7.jar:/Users/sven.deridder/.m2/repository/com/azure/azure-ai-openai/1.0.0-beta.3/azure-ai-openai-1.0.0-beta.3.jar:/Users/sven.deridder/.m2/repository/com/azure/azure-core/1.41.0/azure-core-1.41.0.jar:/Users/sven.deridder/.m2/repository/com/azure/azure-json/1.0.1/azure-json-1.0.1.jar:/Users/sven.deridder/.m2/repository/com/fasterxml/jackson/core/jackson-annotations/2.13.5/jackson-annotations-2.13.5.jar:/Users/sven.deridder/.m2/repository/com/fasterxml/jackson/core/jackson-core/2.13.5/jackson-core-2.13.5.jar:/Users/sven.deridder/.m2/repository/com/fasterxml/jackson/core/jackson-databind/2.13.5/jackson-databind-2.13.5.jar:/Users/sven.deridder/.m2/repository/com/fasterxml/jackson/datatype/jackson-datatype-jsr310/2.13.5/jackson-datatype-jsr310-2.13.5.jar:/Users/sven.deridder/.m2/repository/com/azure/azure-core-http-netty/1.13.5/azure-core-http-netty-1.13.5.jar:/Users/sven.deridder/.m2/repository/io/netty/netty-handler-proxy/4.1.94.Final/netty-handler-proxy-4.1.94.Final.jar:/Users/sven.deridder/.m2/repository/io/netty/netty-codec-socks/4.1.94.Final/netty-codec-socks-4.1.94.Final.jar:/Users/sven.deridder/.m2/repository/io/netty/netty-codec-http/4.1.94.Final/netty-codec-http-4.1.94.Final.jar:/Users/sven.deridder/.m2/repository/io/netty/netty-codec-http2/4.1.94.Final/netty-codec-http2-4.1.94.Final.jar:/Users/sven.deridder/.m2/repository/io/netty/netty-transport-native-epoll/4.1.94.Final/netty-transport-native-epoll-4.1.94.Final-linux-x86_64.jar:/Users/sven.deridder/.m2/repository/io/netty/netty-transport-classes-epoll/4.1.94.Final/netty-transport-classes-epoll-4.1.94.Final.jar:/Users/sven.deridder/.m2/repository/io/netty/netty-transport-native-kqueue/4.1.94.Final/netty-transport-native-kqueue-4.1.94.Final-osx-x86_64.jar:/Users/sven.deridder/.m2/repository/io/netty/netty-transport-classes-kqueue/4.1.94.Final/netty-transport-classes-kqueue-4.1.94.Final.jar:/Users/sven.deridder/.m2/repository/io/netty/netty-tcnative-boringssl-static/2.0.61.Final/netty-tcnative-boringssl-static-2.0.61.Final.jar:/Users/sven.deridder/.m2/repository/io/netty/netty-tcnative-boringssl-static/2.0.61.Final/netty-tcnative-boringssl-static-2.0.61.Final-linux-x86_64.jar:/Users/sven.deridder/.m2/repository/io/netty/netty-tcnative-boringssl-static/2.0.61.Final/netty-tcnative-boringssl-static-2.0.61.Final-linux-aarch_64.jar:/Users/sven.deridder/.m2/repository/io/netty/netty-tcnative-boringssl-static/2.0.61.Final/netty-tcnative-boringssl-static-2.0.61.Final-osx-x86_64.jar:/Users/sven.deridder/.m2/repository/io/netty/netty-tcnative-boringssl-static/2.0.61.Final/netty-tcnative-boringssl-static-2.0.61.Final-osx-aarch_64.jar:/Users/sven.deridder/.m2/repository/io/netty/netty-tcnative-boringssl-static/2.0.61.Final/netty-tcnative-boringssl-static-2.0.61.Final-windows-x86_64.jar:/Users/sven.deridder/.m2/repository/io/projectreactor/netty/reactor-netty-http/1.0.33/reactor-netty-http-1.0.33.jar:/Users/sven.deridder/.m2/repository/io/netty/netty-resolver-dns/4.1.93.Final/netty-resolver-dns-4.1.93.Final.jar:/Users/sven.deridder/.m2/repository/io/netty/netty-codec-dns/4.1.93.Final/netty-codec-dns-4.1.93.Final.jar:/Users/sven.deridder/.m2/repository/io/netty/netty-resolver-dns-native-macos/4.1.93.Final/netty-resolver-dns-native-macos-4.1.93.Final-osx-x86_64.jar:/Users/sven.deridder/.m2/repository/io/netty/netty-resolver-dns-classes-macos/4.1.93.Final/netty-resolver-dns-classes-macos-4.1.93.Final.jar:/Users/sven.deridder/.m2/repository/io/projectreactor/netty/reactor-netty-core/1.0.33/reactor-netty-core-1.0.33.jar:/Users/sven.deridder/.m2/repository/com/azure/azure-core-experimental/1.0.0-beta.41/azure-core-experimental-1.0.0-beta.41.jar:/Users/sven.deridder/.m2/repository/org/jline/jline/3.26.1/jline-3.26.1.jar:/Users/sven.deridder/.m2/repository/org/slf4j/slf4j-api/1.6.2/slf4j-api-1.6.2.jar:/Users/sven.deridder/.m2/repository/org/slf4j/slf4j-simple/1.6.2/slf4j-simple-1.6.2.jar:/Users/sven.deridder/.m2/repository/guru/nidi/graphviz-java/0.18.1/graphviz-java-0.18.1.jar:/Users/sven.deridder/.m2/repository/org/webjars/npm/viz.js-graphviz-java/2.1.3/viz.js-graphviz-java-2.1.3.jar:/Users/sven.deridder/.m2/repository/guru/nidi/com/kitfox/svgSalamander/1.1.3/svgSalamander-1.1.3.jar:/Users/sven.deridder/.m2/repository/net/arnx/nashorn-promise/0.1.1/nashorn-promise-0.1.1.jar:/Users/sven.deridder/.m2/repository/org/apache/commons/commons-exec/1.3/commons-exec-1.3.jar:/Users/sven.deridder/.m2/repository/com/google/code/findbugs/jsr305/3.0.2/jsr305-3.0.2.jar:/Users/sven.deridder/.m2/repository/org/slf4j/jcl-over-slf4j/1.7.30/jcl-over-slf4j-1.7.30.jar:/Users/sven.deridder/.m2/repository/org/slf4j/jul-to-slf4j/1.7.30/jul-to-slf4j-1.7.30.jar:/Users/sven.deridder/.m2/repository/guru/nidi/com/eclipsesource/j2v8/j2v8_macosx_x86_64/4.6.0/j2v8_macosx_x86_64-4.6.0.jar:/Users/sven.deridder/dev/CodeConcise/cobol-rekt/che-che4z-lsp-for-cobol-integration/server/engine/target/classes:/Users/sven.deridder/dev/CodeConcise/cobol-rekt/che-che4z-lsp-for-cobol-integration/server/common/target/classes:/Users/sven.deridder/.m2/repository/org/eclipse/lsp4j/org.eclipse.lsp4j.jsonrpc/0.14.0/org.eclipse.lsp4j.jsonrpc-0.14.0.jar:/Users/sven.deridder/.m2/repository/com/google/code/gson/gson/2.8.9/gson-2.8.9.jar:/Users/sven.deridder/.m2/repository/commons-io/commons-io/2.10.0/commons-io-2.10.0.jar:/Users/sven.deridder/.m2/repository/info/picocli/picocli-codegen/4.7.5/picocli-codegen-4.7.5.jar:/Users/sven.deridder/dev/CodeConcise/cobol-rekt/che-che4z-lsp-for-cobol-integration/server/dialect-idms/target/classes:/Users/sven.deridder/dev/CodeConcise/cobol-rekt/smojol-core/target/classes:/Users/sven.deridder/.m2/repository/commons-codec/commons-codec/1.17.0/commons-codec-1.17.0.jar:/Users/sven.deridder/dev/CodeConcise/cobol-rekt/che-che4z-lsp-for-cobol-integration/server/parser/target/classes:/Users/sven.deridder/.m2/repository/info/picocli/picocli/4.7.5/picocli-4.7.5.jar:/Users/sven.deridder/.m2/repository/com/google/inject/guice/4.2.2/guice-4.2.2-no_aop.jar:/Users/sven.deridder/.m2/repository/javax/inject/javax.inject/1/javax.inject-1.jar:/Users/sven.deridder/.m2/repository/com/google/inject/extensions/guice-assistedinject/4.2.2/guice-assistedinject-4.2.2.jar:/Users/sven.deridder/.m2/repository/com/google/inject/guice/4.2.2/guice-4.2.2.jar:/Users/sven.deridder/.m2/repository/com/google/guava/guava/32.0.1-jre/guava-32.0.1-jre.jar:/Users/sven.deridder/.m2/repository/com/google/guava/failureaccess/1.0.1/failureaccess-1.0.1.jar:/Users/sven.deridder/.m2/repository/com/google/guava/listenablefuture/9999.0-empty-to-avoid-conflict-with-guava/listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar:/Users/sven.deridder/.m2/repository/com/google/errorprone/error_prone_annotations/2.18.0/error_prone_annotations-2.18.0.jar:/Users/sven.deridder/.m2/repository/com/google/j2objc/j2objc-annotations/2.8/j2objc-annotations-2.8.jar:/Users/sven.deridder/.m2/repository/org/antlr/antlr4-runtime/4.7.1/antlr4-runtime-4.7.1.jar:/Users/sven.deridder/.m2/repository/org/projectlombok/lombok/1.18.30/lombok-1.18.30.jar:/Users/sven.deridder/.m2/repository/ch/qos/logback/logback-classic/1.3.14/logback-classic-1.3.14.jar:/Users/sven.deridder/.m2/repository/ch/qos/logback/logback-core/1.3.14/logback-core-1.3.14.jar:/Users/sven.deridder/.m2/repository/org/eclipse/lsp4j/org.eclipse.lsp4j/0.14.0/org.eclipse.lsp4j-0.14.0.jar:/Users/sven.deridder/.m2/repository/org/eclipse/lsp4j/org.eclipse.lsp4j.generator/0.14.0/org.eclipse.lsp4j.generator-0.14.0.jar:/Users/sven.deridder/.m2/repository/org/eclipse/xtend/org.eclipse.xtend.lib/2.24.0/org.eclipse.xtend.lib-2.24.0.jar:/Users/sven.deridder/.m2/repository/org/eclipse/xtext/org.eclipse.xtext.xbase.lib/2.24.0/org.eclipse.xtext.xbase.lib-2.24.0.jar:/Users/sven.deridder/.m2/repository/org/eclipse/xtend/org.eclipse.xtend.lib.macro/2.24.0/org.eclipse.xtend.lib.macro-2.24.0.jar:/Users/sven.deridder/.m2/repository/org/apache/commons/commons-lang3/3.12.0/commons-lang3-3.12.0.jar:/Users/sven.deridder/.m2/repository/hu/webarticum/tree-printer/2.2.0/tree-printer-2.2.0.jar org.smojol.analysis.visualisation.FlowchartBuildMain
[INFO] Restored 0 nodes.
Building tree...
Built tree
Setting value for 01ACCOUNT-RECORD.
Setting value for 05ACCT-IDPIC9(11).
Setting value for 05ACCT-ACTIVE-STATUSPICX(01).
Setting value for 05ACCT-CURR-BALPICS9(10)V99.
Setting value for 05ACCT-CREDIT-LIMITPICS9(10)V99.
Setting value for 05ACCT-CASH-CREDIT-LIMITPICS9(10)V99.
Setting value for 05ACCT-OPEN-DATEPICX(10).
Setting value for 05ACCT-EXPIRAION-DATEPICX(10).
Setting value for 05ACCT-REISSUE-DATEPICX(10).
Setting value for 05ACCT-CURR-CYC-CREDITPICS9(10)V99.
Setting value for 05ACCT-CURR-CYC-DEBITPICS9(10)V99.
Setting value for 05ACCT-ADDR-ZIPPICX(10).
Setting value for 05ACCT-GROUP-IDPICX(10).
Setting value for 05FILLERPICX(178).
Setting value for 01ACCTFILE-STATUS.
Setting value for 05ACCTFILE-STAT1PICX.
Setting value for 05ACCTFILE-STAT2PICX.
Setting value for 01IO-STATUS.
Setting value for 05IO-STAT1PICX.
Setting value for 05IO-STAT2PICX.
Setting value for 01TWO-BYTES-BINARYPIC9(4)BINARY.
Setting value for 01TWO-BYTES-ALPHAREDEFINESTWO-BYTES-BINARY.
Setting value for 05TWO-BYTES-LEFTPICX.
Setting value for 05TWO-BYTES-RIGHTPICX.
Setting value for 01IO-STATUS-04.
Setting value for 05IO-STATUS-0401PIC9VALUE0.
Setting value for 05IO-STATUS-0403PIC999VALUE0.
Setting value for 01APPL-RESULTPICS9(9)COMP.
Setting value for 01END-OF-FILEPICX(01)VALUE'N'.
Setting value for 01ABCODEPICS9(9)BINARY.
Setting value for 01TIMINGPICS9(9)BINARY.
{
  "timings": {
    "Compiler Directives processing": 5.58791E-4,
    "Preprocessing": 0.081512416,
    "Dialects processing": 0.013493541,
    "pipeline.parser": 0.621020917,
    "dialects compiler directives processing": 0.800904,
    "Implicit dialects processing": 0.966714875,
    "Parsing stage": 0.621148875,
    "total": 3.105353415
  }
}
3002 [main] INFO guru.nidi.graphviz.engine.AbstractGraphvizEngine - Could not initialize guru.nidi.graphviz.engine.GraphvizCmdLineEngine
guru.nidi.graphviz.engine.GraphvizException: [dot] command not found
Building flow for ProcedureDivisionBodyContext/e3e1b104-ea0f-4770-803e-9cb1e6c10662
Building internal flow for ProcedureDivisionBodyContext/e3e1b104-ea0f-4770-803e-9cb1e6c10662
Looking at ProcedureDivisionBodyContext/e3e1b104-ea0f-4770-803e-9cb1e6c10662
Building flow for para-group:
Building internal flow for para-group:
Looking at para-group:
Building flow for DISPLAY'START O
Building internal flow for DISPLAY'START O
Looking at DISPLAY'START O
Building flow for DISPLAY'START O
Building flow for PERFORM0000-ACC
Building internal flow for PERFORM0000-ACC
Looking at PERFORM0000-ACC
Building flow for PERFORM0000-ACC
Building flow for PERFORMUNTILEND
Building internal flow for PERFORMUNTILEND
Looking at PERFORMUNTILEND
Building flow for PERFORMUNTILEND
Building internal flow for PERFORMUNTILEND
Looking at PERFORMUNTILEND
Building flow for IFEND-OF-FILE='N'PERFORM1000-ACCTFILE-GET-NEXTIFEND-OF-FILE='N'DISPLAYACCOUNT-RECORDEND-IFEND-IF
Building internal flow for IFEND-OF-FILE='N'PERFORM1000-ACCTFILE-GET-NEXTIFEND-OF-FILE='N'DISPLAYACCOUNT-RECORDEND-IFEND-IF
Looking at IFEND-OF-FILE='N'PERFORM1000-ACCTFILE-GET-NEXTIFEND-OF-FILE='N'DISPLAYACCOUNT-RECORDEND-IFEND-IF
Building flow for IS 
END-OF-FILE = 'N'?

Building flow for Yes
Building internal flow for Yes
Looking at Yes
Building flow for PERFORM1000-ACCTFILE-GET-NEXT
Building internal flow for PERFORM1000-ACCTFILE-GET-NEXT
Looking at PERFORM1000-ACCTFILE-GET-NEXT
Building flow for PERFORM1000-ACC
Building flow for IFEND-OF-FILE='N'DISPLAYACCOUNT-RECORDEND-IF
Building internal flow for IFEND-OF-FILE='N'DISPLAYACCOUNT-RECORDEND-IF
Looking at IFEND-OF-FILE='N'DISPLAYACCOUNT-RECORDEND-IF
Building flow for IS 
END-OF-FILE = 'N'?

Building flow for Yes
Building internal flow for Yes
Looking at Yes
Building flow for DISPLAYACCOUNT-RECORD
Building internal flow for DISPLAYACCOUNT-RECORD
Looking at DISPLAYACCOUNT-RECORD
Building flow for DISPLAYACCOUNT-
Building flow for PERFORM9000-ACC
Building internal flow for PERFORM9000-ACC
Looking at PERFORM9000-ACC
Building flow for PERFORM9000-ACC
Building flow for DISPLAY'END OF 
Building internal flow for DISPLAY'END OF 
Looking at DISPLAY'END OF 
Building flow for DISPLAY'END OF 
Building flow for GOBACK.
Building internal flow for GOBACK.
Looking at GOBACK.
Building flow for GOBACK
Building flow for 1000-ACCTFILE-GET-NEXT
Building internal flow for 1000-ACCTFILE-GET-NEXT
Looking at 1000-ACCTFILE-GET-NEXT
Building flow for NAME: 1000-ACCTFILE-GET-NEXT
Building flow for READACCTFILE-FI
Building internal flow for READACCTFILE-FI
Looking at READACCTFILE-FI
Building flow for READACCTFILE-FI
Building flow for IFACCTFILE-STAT
Building internal flow for IFACCTFILE-STAT
Looking at IFACCTFILE-STAT
Building flow for IS 
ACCTFILE-STATUS = '00'?

Building flow for Yes
Building internal flow for Yes
Looking at Yes
Building flow for MOVE0TOAPPL-RESULT
Building internal flow for MOVE0TOAPPL-RESULT
Looking at MOVE0TOAPPL-RESULT
Building flow for MOVE0TOAPPL-RES
Building flow for PERFORM1100-DISPLAY-ACCT-RECORD
Building internal flow for PERFORM1100-DISPLAY-ACCT-RECORD
Looking at PERFORM1100-DISPLAY-ACCT-RECORD
Building flow for PERFORM1100-DIS
Building flow for No
Building internal flow for No
Looking at No
Building flow for ELSE
Building flow for IFACCTFILE-STATUS='10'MOVE16TOAPPL-RESULTELSEMOVE12TOAPPL-RESULTEND-IF
Building internal flow for IFACCTFILE-STATUS='10'MOVE16TOAPPL-RESULTELSEMOVE12TOAPPL-RESULTEND-IF
Looking at IFACCTFILE-STATUS='10'MOVE16TOAPPL-RESULTELSEMOVE12TOAPPL-RESULTEND-IF
Building flow for IS 
ACCTFILE-STATUS = '10'?

Building flow for Yes
Building internal flow for Yes
Looking at Yes
Building flow for MOVE16TOAPPL-RESULT
Building internal flow for MOVE16TOAPPL-RESULT
Looking at MOVE16TOAPPL-RESULT
Building flow for MOVE16TOAPPL-RE
Building flow for No
Building internal flow for No
Looking at No
Building flow for ELSE
Building flow for MOVE12TOAPPL-RESULT
Building internal flow for MOVE12TOAPPL-RESULT
Looking at MOVE12TOAPPL-RESULT
Building flow for MOVE12TOAPPL-RE
Building flow for IS 
APPL-AOK?

Building flow for Yes
Building internal flow for Yes
Looking at Yes
Building flow for CONTINUE
Building internal flow for CONTINUE
Looking at CONTINUE
Building flow for CONTINUE
Building flow for No
Building internal flow for No
Looking at No
Building flow for ELSE
Building flow for IFAPPL-EOFMOVE'Y'TOEND-OF-FILEELSEDISPLAY'ERROR READING ACCOUNT FILE'MOVEACCTFILE-STATUSTOIO-STATUSPERFORM9910-DISPLAY-IO-STATUSPERFORM9999-ABEND-PROGRAMEND-IF
Building internal flow for IFAPPL-EOFMOVE'Y'TOEND-OF-FILEELSEDISPLAY'ERROR READING ACCOUNT FILE'MOVEACCTFILE-STATUSTOIO-STATUSPERFORM9910-DISPLAY-IO-STATUSPERFORM9999-ABEND-PROGRAMEND-IF
Looking at IFAPPL-EOFMOVE'Y'TOEND-OF-FILEELSEDISPLAY'ERROR READING ACCOUNT FILE'MOVEACCTFILE-STATUSTOIO-STATUSPERFORM9910-DISPLAY-IO-STATUSPERFORM9999-ABEND-PROGRAMEND-IF
Building flow for IS 
APPL-EOF?

Building flow for Yes
Building internal flow for Yes
Looking at Yes
Building flow for MOVE'Y'TOEND-OF-FILE
Building internal flow for MOVE'Y'TOEND-OF-FILE
Looking at MOVE'Y'TOEND-OF-FILE
Building flow for MOVE'Y'TOEND-OF
Building flow for No
Building internal flow for No
Looking at No
Building flow for ELSE
Building flow for DISPLAY'ERROR READING ACCOUNT FILE'
Building internal flow for DISPLAY'ERROR READING ACCOUNT FILE'
Looking at DISPLAY'ERROR READING ACCOUNT FILE'
Building flow for DISPLAY'ERROR R
Building flow for MOVEACCTFILE-STATUSTOIO-STATUS
Building internal flow for MOVEACCTFILE-STATUSTOIO-STATUS
Looking at MOVEACCTFILE-STATUSTOIO-STATUS
Building flow for MOVEACCTFILE-ST
Building flow for PERFORM9910-DISPLAY-IO-STATUS
Building internal flow for PERFORM9910-DISPLAY-IO-STATUS
Looking at PERFORM9910-DISPLAY-IO-STATUS
Building flow for PERFORM9910-DIS
Building flow for PERFORM9999-ABEND-PROGRAM
Building internal flow for PERFORM9999-ABEND-PROGRAM
Looking at PERFORM9999-ABEND-PROGRAM
Building flow for PERFORM9999-ABE
Building flow for EXIT
Building flow for 1100-DISPLAY-ACCT-RECORD
Building internal flow for 1100-DISPLAY-ACCT-RECORD
Looking at 1100-DISPLAY-ACCT-RECORD
Building flow for NAME: 1100-DISPLAY-ACCT-RECORD
Building flow for DISPLAY'ACCT-ID
Building internal flow for DISPLAY'ACCT-ID
Looking at DISPLAY'ACCT-ID
Building flow for DISPLAY'ACCT-ID
Building flow for DISPLAY'ACCT-AC
Building flow for DISPLAY'ACCT-CU
Building flow for DISPLAY'ACCT-CR
Building flow for DISPLAY'ACCT-CA
Building flow for DISPLAY'ACCT-OP
Building flow for DISPLAY'ACCT-EX
Building flow for DISPLAY'ACCT-RE
Building flow for DISPLAY'ACCT-CU
Building flow for DISPLAY'ACCT-CU
Building flow for DISPLAY'ACCT-GR
Building flow for DISPLAY'-------
Building flow for EXIT
Building flow for 0000-ACCTFILE-OPEN
Building internal flow for 0000-ACCTFILE-OPEN
Looking at 0000-ACCTFILE-OPEN
Building flow for NAME: 0000-ACCTFILE-OPEN
Building flow for MOVE8TOAPPL-RES
Building internal flow for MOVE8TOAPPL-RES
Looking at MOVE8TOAPPL-RES
Building flow for MOVE8TOAPPL-RES
Building flow for OPENINPUTACCTFI
Building internal flow for OPENINPUTACCTFI
Looking at OPENINPUTACCTFI
Building flow for OPENINPUTACCTFI
Building flow for IS 
ACCTFILE-STATUS = '00'?

Building flow for Yes
Building internal flow for Yes
Looking at Yes
Building flow for MOVE0TOAPPL-RESULT
Building internal flow for MOVE0TOAPPL-RESULT
Looking at MOVE0TOAPPL-RESULT
Building flow for MOVE0TOAPPL-RES
Building flow for No
Building internal flow for No
Looking at No
Building flow for ELSE
Building flow for MOVE12TOAPPL-RESULT
Building internal flow for MOVE12TOAPPL-RESULT
Looking at MOVE12TOAPPL-RESULT
Building flow for MOVE12TOAPPL-RE
Building flow for IS 
APPL-AOK?

Building flow for Yes
Building internal flow for Yes
Looking at Yes
Building flow for CONTINUE
Building internal flow for CONTINUE
Looking at CONTINUE
Building flow for CONTINUE
Building flow for No
Building internal flow for No
Looking at No
Building flow for ELSE
Building flow for DISPLAY'ERROR OPENING ACCTFILE'
Building internal flow for DISPLAY'ERROR OPENING ACCTFILE'
Looking at DISPLAY'ERROR OPENING ACCTFILE'
Building flow for DISPLAY'ERROR O
Building flow for MOVEACCTFILE-STATUSTOIO-STATUS
Building internal flow for MOVEACCTFILE-STATUSTOIO-STATUS
Looking at MOVEACCTFILE-STATUSTOIO-STATUS
Building flow for MOVEACCTFILE-ST
Building flow for PERFORM9910-DISPLAY-IO-STATUS
Building internal flow for PERFORM9910-DISPLAY-IO-STATUS
Looking at PERFORM9910-DISPLAY-IO-STATUS
Building flow for PERFORM9910-DIS
Building flow for PERFORM9999-ABEND-PROGRAM
Building internal flow for PERFORM9999-ABEND-PROGRAM
Looking at PERFORM9999-ABEND-PROGRAM
Building flow for PERFORM9999-ABE
Building flow for EXIT
Building flow for 9000-ACCTFILE-CLOSE
Building internal flow for 9000-ACCTFILE-CLOSE
Looking at 9000-ACCTFILE-CLOSE
Building flow for NAME: 9000-ACCTFILE-CLOSE
Building flow for ADD8TOZEROGIVIN
Building internal flow for ADD8TOZEROGIVIN
Looking at ADD8TOZEROGIVIN
Building flow for ADD8TOZEROGIVIN
Exception in thread "main" java.lang.NullPointerException: Cannot invoke "org.eclipse.lsp.cobol.core.CobolParser$AddToStatementContext.addFrom()" because the return value of "org.eclipse.lsp.cobol.core.CobolParser$AddStatementContext.addToStatement()" is null
    at org.smojol.ast.AddFlowNode.buildInternalFlow(AddFlowNode.java:29)
    at org.smojol.ast.CobolFlowNode.buildFlow(CobolFlowNode.java:41)
    at org.smojol.ast.CompositeCobolFlowNode.buildInternalFlow(CompositeCobolFlowNode.java:42)
    at org.smojol.ast.CobolFlowNode.buildFlow(CobolFlowNode.java:41)
    at java.base/java.util.ArrayList.forEach(ArrayList.java:1597)
    at org.smojol.ast.CobolFlowNode.buildOutgoingFlow(CobolFlowNode.java:47)
    at org.smojol.ast.CobolFlowNode.buildFlow(CobolFlowNode.java:42)
    at org.smojol.ast.CompositeCobolFlowNode.buildInternalFlow(CompositeCobolFlowNode.java:42)
    at org.smojol.ast.CobolFlowNode.buildFlow(CobolFlowNode.java:41)
    at java.base/java.util.ArrayList.forEach(ArrayList.java:1597)
    at org.smojol.ast.CobolFlowNode.buildOutgoingFlow(CobolFlowNode.java:47)
    at org.smojol.ast.CobolFlowNode.buildFlow(CobolFlowNode.java:42)
    at java.base/java.util.ArrayList.forEach(ArrayList.java:1597)
    at org.smojol.ast.CobolFlowNode.buildOutgoingFlow(CobolFlowNode.java:47)
    at org.smojol.ast.CobolFlowNode.buildFlow(CobolFlowNode.java:42)
    at java.base/java.util.ArrayList.forEach(ArrayList.java:1597)
    at org.smojol.ast.CobolFlowNode.buildOutgoingFlow(CobolFlowNode.java:47)
    at org.smojol.ast.CobolFlowNode.buildFlow(CobolFlowNode.java:42)
    at java.base/java.util.ArrayList.forEach(ArrayList.java:1597)
    at org.smojol.ast.CobolFlowNode.buildOutgoingFlow(CobolFlowNode.java:47)
    at org.smojol.ast.CobolFlowNode.buildFlow(CobolFlowNode.java:42)
    at java.base/java.util.ArrayList.forEach(ArrayList.java:1597)
    at org.smojol.ast.CobolFlowNode.buildOutgoingFlow(CobolFlowNode.java:47)
    at org.smojol.ast.CobolFlowNode.buildFlow(CobolFlowNode.java:42)
    at java.base/java.util.ArrayList.forEach(ArrayList.java:1597)
    at org.smojol.ast.CobolFlowNode.buildOutgoingFlow(CobolFlowNode.java:47)
    at org.smojol.ast.CobolFlowNode.buildFlow(CobolFlowNode.java:42)
    at java.base/java.util.ArrayList.forEach(ArrayList.java:1597)
    at org.smojol.ast.CobolFlowNode.buildOutgoingFlow(CobolFlowNode.java:47)
    at org.smojol.ast.CobolFlowNode.buildFlow(CobolFlowNode.java:42)
    at java.base/java.util.ArrayList.forEach(ArrayList.java:1597)
    at org.smojol.ast.CobolFlowNode.buildOutgoingFlow(CobolFlowNode.java:47)
    at org.smojol.ast.CobolFlowNode.buildFlow(CobolFlowNode.java:42)
    at java.base/java.util.ArrayList.forEach(ArrayList.java:1597)
    at org.smojol.ast.CobolFlowNode.buildOutgoingFlow(CobolFlowNode.java:47)
    at org.smojol.ast.CobolFlowNode.buildFlow(CobolFlowNode.java:42)
    at org.smojol.ast.CompositeCobolFlowNode.buildInternalFlow(CompositeCobolFlowNode.java:42)
    at org.smojol.ast.CobolFlowNode.buildFlow(CobolFlowNode.java:41)
    at org.smojol.ast.CompositeCobolFlowNode.buildInternalFlow(CompositeCobolFlowNode.java:42)
    at org.smojol.ast.CobolFlowNode.buildFlow(CobolFlowNode.java:41)
    at org.smojol.ast.FlowchartBuilderImpl.buildFlowAST(FlowchartBuilderImpl.java:52)
    at org.smojol.ast.FlowchartBuilderImpl.generateFlowchart(FlowchartBuilderImpl.java:122)
    at org.smojol.interpreter.FullProgram.draw(FlowchartGenerationStrategy.java:36)
    at org.smojol.flowchart.FlowchartTasks.generateForProgram(FlowchartTasks.java:67)
    at org.smojol.flowchart.FlowchartTasks.generateForPrograms(FlowchartTasks.java:41)
    at org.smojol.analysis.visualisation.FlowchartBuildMain.main(FlowchartBuildMain.java:24)

Process finished with exit code 1
avishek-sen-gupta commented 3 months ago

This should be fixed in https://github.com/avishek-sen-gupta/cobol-rekt/commit/726a7fe5a5cf7f3ccf8c813405d5f159cf38e2c4

The CFG builder wasn't handling the ADD TO GIVING variant. The evaluating interpreter will still need to handle it separately, so I will open a TODO for that. But flowchart generation will work with this fix.

avishek-sen-gupta commented 3 months ago

Closing this, as the flowchart issue is fixed.