Skip to content

Commit

Permalink
Adding reproducible test for issue 69
Browse files Browse the repository at this point in the history
  • Loading branch information
avishek-sen-gupta committed Dec 1, 2024
1 parent 78b2779 commit 5eb306f
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 0 deletions.
16 changes: 16 additions & 0 deletions smojol-test-code/exec-cics-issue-69.cbl
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
00100 IDENTIFICATION DIVISION.
00200 PROGRAM-ID. MyCOBOLProgram.
00300 ENVIRONMENT DIVISION.
00400 CONFIGURATION SECTION.
00500 SOURCE-COMPUTER. IBM-PC.
00600 OBJECT-COMPUTER. IBM-PC.
00700 DATA DIVISION.
00800 WORKING-STORAGE SECTION.
01000 01 WS-SAVE-PACKAGE PIC X(10).
01200 PROCEDURE DIVISION.
01500 MAIN-PROCEDURE.
01600 EXEC SQL
01610 SET :WS-SAVE-PACKAGE = CURRENT PACKAGESET
01620 END-EXEC.
01621 DISPLAY 'Current Package set: ' WS-SAVE-PACKAGE.
01800 STOP RUN.
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package org.smojol.toolkit.examples;

import com.google.common.collect.ImmutableList;
import org.smojol.common.dialect.LanguageDialect;
import org.smojol.common.flowchart.FlowchartOutputFormat;
import org.smojol.common.id.UUIDProvider;
import org.smojol.common.resource.LocalFilesystemOperations;
import org.smojol.toolkit.analysis.pipeline.BaseAnalysisModel;
import org.smojol.toolkit.analysis.pipeline.ProgramSearch;
import org.smojol.toolkit.analysis.task.analysis.CodeTaskRunner;
import org.smojol.toolkit.interpreter.FullProgram;
import org.smojol.toolkit.interpreter.structure.OccursIgnoringFormat1DataStructureBuilder;
import org.smojol.toolkit.task.AnalysisTaskResult;
import org.smojol.toolkit.task.AnalysisTaskResultOK;

import java.io.File;
import java.io.IOException;
import java.util.List;
import java.util.Map;

import static org.smojol.toolkit.task.CommandLineAnalysisTask.BUILD_BASE_ANALYSIS;

public class ExecCicsBuildMain_Issue69 {
public static void main(String[] args) throws IOException, InterruptedException {
Map<String, List<AnalysisTaskResult>> result = new CodeTaskRunner("/Users/asgupta/code/smojol/smojol-test-code",
"/Users/asgupta/code/smojol/out/report",
ImmutableList.of(new File("/Users/asgupta/code/smojol/smojol-test-code")),
"/Users/asgupta/code/smojol/che-che4z-lsp-for-cobol-integration/server/dialect-idms/target/dialect-idms.jar",
LanguageDialect.COBOL, new FullProgram(FlowchartOutputFormat.PNG, new UUIDProvider()),
new UUIDProvider(),
new OccursIgnoringFormat1DataStructureBuilder(),
new ProgramSearch(),
new LocalFilesystemOperations())
.runForPrograms(ImmutableList.of(BUILD_BASE_ANALYSIS), ImmutableList.of("exec-cics-issue-69.cbl"));
AnalysisTaskResultOK ok = (AnalysisTaskResultOK) result.values().stream().toList().getFirst().getFirst();
BaseAnalysisModel base = ok.getDetail();
System.out.println("DONE");
}
}

0 comments on commit 5eb306f

Please sign in to comment.