Skip to content

Commit e3753d3

Browse files
Merge pull request #77 from opensourcecobol/develop
v1.0.7
2 parents 2c149c8 + ba07a00 commit e3753d3

File tree

584 files changed

+338352
-5320
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

584 files changed

+338352
-5320
lines changed

.github/workflows/cicd.yml

Lines changed: 31 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,19 @@ jobs:
88
run-tests:
99
strategy:
1010
matrix:
11-
os: ["ubuntu:22.04", "almalinux:9"]
11+
#os: ["ubuntu:22.04", "almalinux:9"]
12+
os: ["almalinux:9"]
1213
runs-on: ubuntu-latest
1314
container:
1415
image: ${{ matrix.os }}
1516
steps:
1617

1718
- name: Install dependencies on Ubuntu 22.04
18-
if: matrix.os == 'ubuntu:22.04'
19+
if: matrix.os == 'ubuntu:20.04'
1920
run: |
20-
apt-get update -y
21-
apt-get install -y default-jdk
22-
apt-get install -y build-essential bison flex gettext texinfo automake autoconf libtool
21+
apt update -y
22+
apt install -y default-jdk
23+
apt install -y build-essential bison flex gettext texinfo
2324
2425
- name: Install dependencies on AlmaLinux 9
2526
if: matrix.os == 'almalinux:9'
@@ -38,13 +39,7 @@ jobs:
3839
./configure --prefix=/usr/
3940
make
4041
make install
41-
export CLASSPATH=":/usr/lib/opensourcecobol4j/libcobj.jar:$HOME/.java_lib/sqlite.jar"
42-
43-
- name: Make test scripts
44-
run: |
45-
cd tests/
46-
make
47-
cd ../
42+
export CLASSPATH=":/usr/lib/opensourcecobol4j/libcobj.jar:$HOME/.java_lib/sqlite.jar"
4843
4944
- name: Run tests "command-line-options"
5045
run: |
@@ -64,34 +59,34 @@ jobs:
6459
run: |
6560
export CLASSPATH=":/usr/lib/opensourcecobol4j/libcobj.jar:$HOME/.java_lib/sqlite.jar"
6661
cd tests/
67-
./data-rep || true
62+
./data-rep
6863
cd ../
6964
7065
- name: Run tests "i18n_sjis"
7166
run: |
7267
export CLASSPATH=":/usr/lib/opensourcecobol4j/libcobj.jar:$HOME/.java_lib/sqlite.jar"
7368
cd tests/
74-
./i18n_sjis || true
69+
./i18n_sjis
7570
7671
- name: Run tests "jp-compat"
7772
run: |
7873
export CLASSPATH=":/usr/lib/opensourcecobol4j/libcobj.jar:$HOME/.java_lib/sqlite.jar"
7974
cd tests/
80-
./jp-compat || true
75+
./jp-compat
8176
cd ../
8277
83-
#- name: Run tests "run"
84-
# run: |
85-
# export CLASSPATH=":/usr/lib/opensourcecobol4j/libcobj.jar:$HOME/.java_lib/sqlite.jar"
86-
# cd tests/
87-
# ./run || true
88-
# cd ../
78+
- name: Run tests "run"
79+
run: |
80+
export CLASSPATH=":/usr/lib/opensourcecobol4j/libcobj.jar:$HOME/.java_lib/sqlite.jar"
81+
cd tests/
82+
./run
83+
cd ../
8984
9085
- name: Run tests "syntax"
9186
run: |
9287
export CLASSPATH=":/usr/lib/opensourcecobol4j/libcobj.jar:$HOME/.java_lib/sqlite.jar"
9388
cd tests/
94-
./syntax || true
89+
./syntax
9590
cd ../
9691
9792
- name: Run NIST test
@@ -100,26 +95,27 @@ jobs:
10095
cd tests/cobol85/
10196
make test
10297
103-
- name: Run tests "i18n_utf8"
104-
run: |
105-
export CLASSPATH=":$HOME/.java_lib/sqlite.jar"
106-
./configure --prefix=/usr/ --with-vbisam --enable-utf8
107-
make
108-
make install
109-
export CLASSPATH=":/usr/lib/opensourcecobol4j/libcobj.jar:$HOME/.java_lib/sqlite.jar"
110-
./i18n_utf8 || true
111-
cd ../
98+
#- name: Run tests "i18n_utf8"
99+
# run: |
100+
# export CLASSPATH=":$HOME/.java_lib/sqlite.jar"
101+
# ./configure --prefix=/usr/ --with-vbisam --enable-utf8
102+
# make
103+
# make install
104+
# export CLASSPATH=":/usr/lib/opensourcecobol4j/libcobj.jar:$HOME/.java_lib/sqlite.jar"
105+
# ./i18n_utf8 || true
106+
# cd ../
112107
113108
static_analysis:
114109
runs-on: ubuntu-latest
115110
steps:
116111
# Checkout opensource COBOL
117112
- name: Checkout opensource COBOL 4j
118113
uses: actions/checkout@v2
119-
120-
- name: Install dependencies
121-
run: |
122-
sudo apt-get install default-jdk
114+
115+
- uses: actions/setup-java@v3
116+
with:
117+
distribution: 'temurin'
118+
java-version: '17'
123119

124120
# Download google-java-format and PMD
125121
- name: Install dependencies

ChangeLog

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
2023-01-31 OSS Consortium <[email protected]>
2+
3+
* opensource COBOL 4J v1.0.7 released.
4+
15
2022-12-29 OSS Consortium <[email protected]>
26

37
* opensource COBOL 4J v1.0.6 released.

NEWS

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,24 @@
11
NEWS - user visible changes -*- outline -*-
22

3-
* opensource cobol 4j 1.0.6
3+
* opensource COBOL 4J 1.0.7
4+
5+
** New Features
6+
(1) Implement DELETE FILE statement of SEQUENTIAL files and LINE SEQUENTIAL files
7+
(2) Improve Java interface, much better way to call COBOL from Java
8+
(3) Add -java-package option
9+
(4) Implement SET ENVIRONMENT statement
10+
11+
** Bug fixes
12+
(1) Fix the bug involved with the environment variables COB_I_O_CREATE and COB_EXTEND_CREATE
13+
(2) Fix the comparison process of COMP-3
14+
(3) Fix EXIT PERFORM and EXIT PERFORM CYCLE
15+
16+
** Miscellaneous
17+
(1) Format all Java source code in libcobj/ using Google Java Format
18+
19+
-----------------------------------------------------------------------
20+
21+
* opensource COBOL 4J 1.0.6
422

523
** New Features
624
(1) Add -fshort-variable option
@@ -14,7 +32,7 @@ NEWS - user visible changes -*- outline -*-
1432

1533
-----------------------------------------------------------------------
1634

17-
* opensource cobol 4j 1.0.5
35+
* opensource COBOL 4J 1.0.5
1836

1937
** New Features
2038
(1) -m option and cobjrun command (an experimental feature)
@@ -44,7 +62,7 @@ NEWS - user visible changes -*- outline -*-
4462

4563
-----------------------------------------------------------------------
4664

47-
* opensource cobol 4j 1.0.4
65+
* opensource COBOL 4J 1.0.4
4866

4967
** New Features
5068
(1) Rename cobc, the compile command, to cobj.
@@ -73,14 +91,14 @@ NEWS - user visible changes -*- outline -*-
7391
-----------------------------------------------------------------------
7492

7593

76-
* opensource cobol 4j 1.0.3
94+
* opensource COBOL 4J 1.0.3
7795

7896
** New features
7997
(1) Change the storage library for indexed file to SQLite.
8098

8199
-----------------------------------------------------------------------
82100

83-
* opensource cobol 4j 1.0.2
101+
* opensource COBOL 4J 1.0.2
84102

85103
** New features
86104
(1) Upgrade the license to GPL3.
@@ -90,21 +108,21 @@ NEWS - user visible changes -*- outline -*-
90108

91109
-----------------------------------------------------------------------
92110

93-
* opensource cobol 4j 1.0.1
111+
* opensource COBOL 4J 1.0.1
94112

95113
** Bug fixes
96114
(1) Fix the transformation of call arguments
97115

98116
-----------------------------------------------------------------------
99117

100-
* opensource cobol 4j 1.0.0
118+
* opensource COBOL 4J 1.0.0
101119

102120
** Bug fixes
103121
(1) Fix the status code after opening indexed files.
104122
(2) Fix the behavior of delete and rewrite indexed files
105123

106124
-----------------------------------------------------------------------
107125

108-
* release opensource COBOL4J developers edition.
126+
* release opensource COBOL 4J developers edition.
109127

110128
-----------------------------------------------------------------------

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# opensource COBOL 4J
22

3-
[日本語版README](https://github.com/opensourcecobol/opensourcecobol4j/blob/main/README_JP.md)
3+
[日本語版README](./README_JP.md)
44

55
"opensource COBOL 4J" is a COBOL compiler that translates COBOL parograms to Java programs.
66
This compiler is deeply inspired by ["opensource COBOL"](https://github.com/opensourcecobol/opensource-cobol) which translates COBOL programs to C programs.

README_JP.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# opensource COBOL 4J
22

3-
[English version README](https://github.com/opensourcecobol/opensourcecobol4j/blob/main/README.md)
3+
[English version README](./README.md)
44

55
opensource COBOL 4JはCOBOLソースコードをJavaソースコードに変換するCOBOLコンパイラです.
66
opensource COBOL 4JはCOBOLからCに変換するCOBOLコンパイラ["opensource COBOL"](https://github.com/opensourcecobol/opensource-cobol)をもとに開発されています.

cobj/cobj.c

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ int cb_saveargc;
163163
char **cb_saveargv;
164164

165165
const char *cob_config_dir;
166+
extern char *cb_java_package_name = NULL;
166167

167168
#define PROGRAM_ID_LIST_MAX_LEN 1024
168169
char* program_id_list[PROGRAM_ID_LIST_MAX_LEN];
@@ -296,6 +297,7 @@ static const struct option long_options[] = {
296297
{"list-intrinsics", no_argument, NULL, '6'},
297298
{"list-mnemonics", no_argument, NULL, 'q'},
298299
{"save-temps", optional_argument, NULL, '_'},
300+
{"java-package", optional_argument, NULL, 'P'},
299301
{"std", required_argument, NULL, '$'},
300302
{"conf", required_argument, NULL, '&'},
301303
{"debug", no_argument, NULL, 'd'},
@@ -834,19 +836,20 @@ cobc_print_usage (void)
834836
{
835837
puts (_("Usage: cobj [options] file..."));
836838
puts (_("Options:"));
837-
puts (_(" --help Display this message"));
838-
puts (_(" --version, -V Display compiler version"));
839-
puts (_(" -m Create jar files instead of class files (an experimental feature)"));
840-
puts (_(" -free Use free source format"));
841-
puts (_(" -free_1col_aster Use free(1col_aster) source format"));
842-
puts (_(" -g Enable Java compiler debug"));
843-
puts (_(" -E Preprocess only; do not compile or link"));
844-
puts (_(" -C Translation only; convert COBOL to Java"));
845-
puts (_(" -t <file> Generate and place a program listing into <file>"));
846-
puts (_(" -I <directory> Add <directory> to copy files search path"));
847-
puts (_(" -B <options> Add <options> to the Java compiler"));
848-
puts (_(" --list-reserved Display reserved words"));
849-
puts (_(" -assign_external Set the file assign to external"));
839+
puts (_(" --help Display this message"));
840+
puts (_(" --version, -V Display compiler version"));
841+
puts (_(" -m Create jar files instead of class files (an experimental feature)"));
842+
puts (_(" -free Use free source format"));
843+
puts (_(" -free_1col_aster Use free(1col_aster) source format"));
844+
puts (_(" -g Enable Java compiler debug"));
845+
puts (_(" -E Preprocess only; do not compile or link"));
846+
puts (_(" -C Translation only; convert COBOL to Java"));
847+
puts (_(" -t <file> Generate and place a program listing into <file>"));
848+
puts (_(" -I <directory> Add <directory> to copy files search path"));
849+
puts (_(" -B <options> Add <options> to the Java compiler"));
850+
puts (_(" --list-reserved Display reserved words"));
851+
puts (_(" -assign_external Set the file assign to external"));
852+
puts (_(" -java-package(=<package name>) Specify the package name of the generated source code"));
850853
putchar ('\n');
851854

852855
#undef CB_WARNDEF
@@ -1036,6 +1039,11 @@ process_command_line (const int argc, char *argv[])
10361039
}
10371040
}
10381041
break;
1042+
case 'P':
1043+
/* --java-package : Java package name to be written in the head of generated source code */
1044+
if(optarg) {
1045+
cb_java_package_name = optarg;
1046+
}
10391047

10401048
case '3': /* --constant */
10411049
if (optarg) {
@@ -1723,7 +1731,7 @@ process_compile (struct filename *fn)
17231731
}
17241732

17251733
for(char** program_id = program_id_list; *program_id; ++program_id) {
1726-
sprintf(buff, "javac %s -encoding SJIS %s.java",
1734+
sprintf(buff, "javac %s -encoding SJIS -d . %s.java",
17271735
cob_java_flags,
17281736
*program_id);
17291737
ret = process (buff);

cobj/cobj.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,8 @@ extern int cb_source_line;
138138

139139
extern const char *cob_config_dir;
140140

141+
extern char *cb_java_package_name;
142+
141143
extern char *source_name;
142144
extern char *demangle_name;
143145
extern FILE *cb_storage_file;

0 commit comments

Comments
 (0)