From c1e4df931cdbf1f64889e61226b4aeb46e85091f Mon Sep 17 00:00:00 2001 From: Yutaro Sakamoto Date: Thu, 15 Jul 2021 07:36:19 +0000 Subject: [PATCH 1/8] =?UTF-8?q?INDEXED=E3=81=AE=E3=83=90=E3=82=B0(IX213)?= =?UTF-8?q?=E3=81=8C1=E3=81=A4=E7=9B=B4=E3=81=A3=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../libcobj/file/CobolIndexedFile.java | 88 +++++++++++++------ tests/cobol85/report.pl | 8 +- 2 files changed, 65 insertions(+), 31 deletions(-) diff --git a/libcobj/src/jp/osscons/opensourcecobol/libcobj/file/CobolIndexedFile.java b/libcobj/src/jp/osscons/opensourcecobol/libcobj/file/CobolIndexedFile.java index 788fcfbd..06bf706a 100644 --- a/libcobj/src/jp/osscons/opensourcecobol/libcobj/file/CobolIndexedFile.java +++ b/libcobj/src/jp/osscons/opensourcecobol/libcobj/file/CobolIndexedFile.java @@ -43,6 +43,7 @@ import com.sleepycat.je.OperationStatus; import com.sleepycat.je.Put; import com.sleepycat.je.ReadOptions; +import com.sleepycat.je.Transaction; import jp.osscons.opensourcecobol.libcobj.data.AbstractCobolField; import jp.osscons.opensourcecobol.libcobj.data.CobolDataStorage; @@ -59,6 +60,7 @@ public class CobolIndexedFile extends CobolFile { private final static int COB_NE = 6; private Environment env;// bdb_env + private Transaction txn; public CobolIndexedFile(String select_name, byte[] file_status, AbstractCobolField assign, AbstractCobolField record, AbstractCobolField record_size, int record_min, int record_max, int nkeys, @@ -137,6 +139,7 @@ public int open_(String filename, int mode, int sharing) { Properties prop = new Properties(); prop.setProperty("je.freeDisk", "104857600"); EnvironmentConfig envConf = new EnvironmentConfig(prop); + envConf.setTransactional(true); if (mode == COB_OPEN_INPUT) { envConf.setReadOnly(true); @@ -194,6 +197,7 @@ public int open_(String filename, int mode, int sharing) { }*/ //dbConf.setSortedDuplicates(this.keys[i].getFlag() != 0); dbConf.setSortedDuplicates(true); + dbConf.setTransactional(true); if (mode == COB_OPEN_OUTPUT) { try { @@ -322,6 +326,7 @@ public int indexed_start_internal(int cond, AbstractCobolField key, int read_opt p.cursor[p.key_index] = p.db[p.key_index].openCursor(null, cursorConfig); try { OperationResult result = p.cursor[p.key_index].get(p.key, p.data, Get.SEARCH_GTE, readOptions); + //dbg primary key = AAA060 int ret = result != null ? 0 : 1; switch (cond) { @@ -681,13 +686,15 @@ private int indexed_write_internal(boolean rewrite, int opt) { IndexedFile p = this.filei; boolean close_cursor; - if (p.write_cursor_open) { - close_cursor = false; - } else { - p.cursor[0] = p.db[0].openCursor(null, null); + //if (p.write_cursor_open) { + //close_cursor = false; + //} else { + this.txn = env.beginTransaction(null, null); + p.cursor[0] = p.db[0].openCursor(this.txn, null); p.write_cursor_open = true; close_cursor = true; - } + //} + if (this.nkeys > 1 && !rewrite) { if (this.check_alt_keys(false)) { if (close_cursor) { @@ -695,6 +702,7 @@ private int indexed_write_internal(boolean rewrite, int opt) { p.cursor[0] = null; p.write_cursor_open = false; } + this.txn.abort(); return COB_STATUS_22_KEY_EXISTS; } p.key = DBT_SET(this.keys[0].getField()); @@ -706,6 +714,7 @@ private int indexed_write_internal(boolean rewrite, int opt) { p.cursor[0] = null; p.write_cursor_open = false; } + this.txn.abort(); return COB_STATUS_22_KEY_EXISTS; } @@ -713,6 +722,12 @@ private int indexed_write_internal(boolean rewrite, int opt) { try { p.cursor[0].put(p.key, p.data); } catch (LockConflictException e) { + if (close_cursor) { + p.cursor[0].close(); + p.cursor[0] = null; + p.write_cursor_open = false; + } + this.txn.abort(); return COB_STATUS_51_RECORD_LOCKED; } @@ -732,13 +747,21 @@ private int indexed_write_internal(boolean rewrite, int opt) { p.key = DBT_SET(this.keys[i].getField()); try { DatabaseEntry subData = DBT_SET(this.keys[i].getField()); - if(p.db[i].put(null, p.key, p.data, flags, null) == null || - p.sub_db[i-1].put(null, subKey, subData, Put.NO_OVERWRITE, null) == null) { + boolean writeFail = p.db[i].put(this.txn, p.key, p.data, flags, null) == null; + //System.out.println("[" + i + "] subkey: " + subKey + ", subData: " + subData); + byte[] b = subKey.getData(); + if(b[0] == 65 && b[1] == 65 && b[2] == 65 && b[3] == 48 && b[4] == 54 && b[5] == 48) { + //System.out.println("[" + i + "] subkey: " + new String(subKey.getData()) + ", subData: " + new String(subData.getData())); + } + OperationResult result = p.sub_db[i-1].put(this.txn, subKey, subData, Put.OVERWRITE, null); + writeFail |= result == null; + if(writeFail) { if (close_cursor) { p.cursor[0].close(); p.cursor[0] = null; p.write_cursor_open = false; } + this.txn.abort(); return COB_STATUS_22_KEY_EXISTS; } } catch (LockConflictException e) { @@ -746,7 +769,8 @@ private int indexed_write_internal(boolean rewrite, int opt) { p.cursor[0].close(); p.cursor[0] = null; p.write_cursor_open = false; - } + } + this.txn.abort(); return COB_STATUS_51_RECORD_LOCKED; } catch (OperationFailureException e) { if (close_cursor) { @@ -754,10 +778,10 @@ private int indexed_write_internal(boolean rewrite, int opt) { p.cursor[0] = null; p.write_cursor_open = false; } + this.txn.abort(); return COB_STATUS_22_KEY_EXISTS; } } - //TODO 注意ロック処理を削除した if (close_cursor) { @@ -765,6 +789,7 @@ private int indexed_write_internal(boolean rewrite, int opt) { p.cursor[0] = null; p.write_cursor_open = false; } + this.txn.commit(); return COB_STATUS_00_SUCCESS; } @@ -872,15 +897,15 @@ private int get_dupno(int i) { public int rewrite_(int opt) { IndexedFile p = this.filei; - p.cursor[0] = p.db[0].openCursor(null, null); + //p.cursor[0] = p.db[0].openCursor(null, null); p.write_cursor_open = true; if (env != null) { this.unlock_record(); } if (this.check_alt_keys(true)) { - p.cursor[0].close(); - p.cursor[0] = null; + //p.cursor[0].close(); + //p.cursor[0] = null; p.write_cursor_open = false; return COB_STATUS_22_KEY_EXISTS; } @@ -888,8 +913,8 @@ public int rewrite_(int opt) { int ret = this.indexed_delete_internal(true); if (ret != COB_STATUS_00_SUCCESS) { - p.cursor[0].close(); - p.cursor[0] = null; + //p.cursor[0].close(); + //p.cursor[0] = null; p.write_cursor_open = false; return ret; } @@ -897,9 +922,9 @@ public int rewrite_(int opt) { p.key = DBT_SET(this.keys[0].getField()); ret = this.indexed_write_internal(true, opt); - p.cursor[0].close(); - p.cursor[0] = null; - p.write_cursor_open = false; + //p.cursor[0].close(); + //p.cursor[0] = null; + //p.write_cursor_open = false; return ret; } @@ -913,13 +938,14 @@ private int indexed_delete_internal(boolean rewrite) { IndexedFile p = this.filei; boolean close_cursor; - if (p.write_cursor_open) { - close_cursor = false; - } else { - p.cursor[0] = p.db[0].openCursor(null, null); + //if (p.write_cursor_open) { + //close_cursor = false; + //} else { + this.txn = this.env.beginTransaction(null, null); + p.cursor[0] = p.db[0].openCursor(this.txn, null); p.write_cursor_open = true; close_cursor = true; - } + //} if (env != null) { this.unlock_record(); @@ -937,6 +963,7 @@ private int indexed_delete_internal(boolean rewrite) { p.cursor[0] = null; p.write_cursor_open = false; } + this.txn.abort(); return COB_STATUS_23_KEY_NOT_EXISTS; } //TODO 注意ロック処理を削除した @@ -948,21 +975,25 @@ private int indexed_delete_internal(boolean rewrite) { try { DatabaseEntry subKey = DBT_SET(this.keys[0].getField()); DatabaseEntry subData = new DatabaseEntry(); - Cursor subCursor = p.sub_db[i-1].openCursor(null, null); + Cursor subCursor = p.sub_db[i-1].openCursor(this.txn, null); + //System.out.println(String.format("[delete %d] subkey %s", i, new String(subKey.getData()))); if(subCursor.get(subKey, subData, Get.SEARCH, null) != null) { do { - p.cursor[i] = p.db[i].openCursor(null, null); - if(p.cursor[i].get(subData, p.data, Get.SEARCH_GTE, null) != null) { + p.cursor[i] = p.db[i].openCursor(this.txn, null); + byte[] alternateKey = subData.getData(); + if(p.cursor[i].get(subData, p.data, Get.SEARCH, null) != null) { do { if(this.keys[0].getField().getDataStorage().memcmp(p.data.getData(), prim_key.getSize()) == 0) { p.cursor[i].delete(); } - } while(p.cursor[i].get(subData, p.data, Get.NEXT, null) != null); + } while(p.cursor[i].get(subData, p.data, Get.NEXT, null) != null + && Arrays.equals(subData.getData(), alternateKey)); } p.cursor[i].close(); p.cursor[i] = null; subCursor.delete(); - } while(subCursor.get(subKey, subData, Get.NEXT, null) != null); + } while(subCursor.get(subKey, subData, Get.NEXT, null) != null && + this.keys[0].getField().getDataStorage().memcmp(subKey.getData(), this.keys[0].getField().getSize()) == 0); } subCursor.close(); } catch (LockConflictException e) { @@ -970,6 +1001,7 @@ private int indexed_delete_internal(boolean rewrite) { p.cursor[i].close(); p.cursor[i] = null; } + this.txn.abort(); return COB_STATUS_51_RECORD_LOCKED; } } @@ -982,6 +1014,7 @@ private int indexed_delete_internal(boolean rewrite) { p.cursor[0] = null; p.write_cursor_open = false; } + this.txn.abort(); return COB_STATUS_51_RECORD_LOCKED; } if(close_cursor) { @@ -989,6 +1022,7 @@ private int indexed_delete_internal(boolean rewrite) { p.cursor[0] = null; p.write_cursor_open = false; } + this.txn.commit(); return COB_STATUS_00_SUCCESS; } diff --git a/tests/cobol85/report.pl b/tests/cobol85/report.pl index 9c8a5910..d6f7cbe8 100644 --- a/tests/cobol85/report.pl +++ b/tests/cobol85/report.pl @@ -101,12 +101,12 @@ $skip{IX210A}=1; $skip{IX211A}=1; $skip{IX212A}=1; -$skip{IX213A}=1; +#$skip{IX213A}=1; $skip{IX214A}=1; -$skip{IX215A}=1; +#$skip{IX215A}=1; $skip{IX216A}=1; -#$skip{IX217A}=1; -#$skip{IX218A}=1; +$skip{IX217A}=1; +$skip{IX218A}=1; open (LOG, "> report.txt") or die; From 1fe1c9d2c8aa66dcecb3895fbc780c925647e9d9 Mon Sep 17 00:00:00 2001 From: Yutaro Sakamoto Date: Tue, 20 Jul 2021 06:31:40 +0000 Subject: [PATCH 2/8] =?UTF-8?q?INDEXED=E3=81=AEOPEN=20EXTEND=E3=81=97?= =?UTF-8?q?=E3=81=9F=E3=81=A8=E3=81=8D=E3=81=AB,=E6=96=B0=E8=A6=8F?= =?UTF-8?q?=E3=81=AB=E3=83=87=E3=82=A3=E3=83=AC=E3=82=AF=E3=83=88=E3=83=AA?= =?UTF-8?q?=E3=82=92=E4=BD=9C=E6=88=90=E3=81=99=E3=82=8B=E3=82=88=E3=81=86?= =?UTF-8?q?=E3=81=AB=E5=A4=89=E6=9B=B4.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../opensourcecobol/libcobj/file/CobolIndexedFile.java | 2 +- tests/cobol85/report.pl | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/libcobj/src/jp/osscons/opensourcecobol/libcobj/file/CobolIndexedFile.java b/libcobj/src/jp/osscons/opensourcecobol/libcobj/file/CobolIndexedFile.java index 06bf706a..ba8f6b04 100644 --- a/libcobj/src/jp/osscons/opensourcecobol/libcobj/file/CobolIndexedFile.java +++ b/libcobj/src/jp/osscons/opensourcecobol/libcobj/file/CobolIndexedFile.java @@ -162,7 +162,7 @@ public int open_(String filename, int mode, int sharing) { } } - if (mode == COB_OPEN_OUTPUT || mode == COB_OPEN_I_O) { + if (mode == COB_OPEN_OUTPUT || mode == COB_OPEN_I_O || mode == COB_OPEN_EXTEND) { File dir = new File(filename); if (!dir.exists()) { dir.mkdir(); diff --git a/tests/cobol85/report.pl b/tests/cobol85/report.pl index d6f7cbe8..51db7b1f 100644 --- a/tests/cobol85/report.pl +++ b/tests/cobol85/report.pl @@ -101,12 +101,12 @@ $skip{IX210A}=1; $skip{IX211A}=1; $skip{IX212A}=1; -#$skip{IX213A}=1; +$skip{IX213A}=1; $skip{IX214A}=1; -#$skip{IX215A}=1; -$skip{IX216A}=1; -$skip{IX217A}=1; -$skip{IX218A}=1; +$skip{IX215A}=1; +#$skip{IX216A}=1; +#$skip{IX217A}=1; +#$skip{IX218A}=1; open (LOG, "> report.txt") or die; From 4ff538cc9de3f218ae683ddbbc1da15cd7bf17d8 Mon Sep 17 00:00:00 2001 From: Yutaro Sakamoto Date: Tue, 20 Jul 2021 07:36:55 +0000 Subject: [PATCH 3/8] =?UTF-8?q?=E5=AD=98=E5=9C=A8=E3=81=97=E3=81=AA?= =?UTF-8?q?=E3=81=84INDEXED=E3=83=95=E3=82=A1=E3=82=A4=E3=83=AB=E3=82=92?= =?UTF-8?q?=E3=82=AA=E3=83=BC=E3=83=97=E3=83=B3=E3=81=97=E3=81=9F=E3=81=A8?= =?UTF-8?q?=E3=81=8D=E3=81=AE=E5=87=A6=E7=90=86=E3=82=92=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../libcobj/file/CobolIndexedFile.java | 13 +++- tests/cobol85/report.pl | 72 +++++++++---------- 2 files changed, 47 insertions(+), 38 deletions(-) diff --git a/libcobj/src/jp/osscons/opensourcecobol/libcobj/file/CobolIndexedFile.java b/libcobj/src/jp/osscons/opensourcecobol/libcobj/file/CobolIndexedFile.java index ba8f6b04..320c4e33 100644 --- a/libcobj/src/jp/osscons/opensourcecobol/libcobj/file/CobolIndexedFile.java +++ b/libcobj/src/jp/osscons/opensourcecobol/libcobj/file/CobolIndexedFile.java @@ -135,6 +135,15 @@ private int lock_record(DatabaseEntry key) { @Override public int open_(String filename, int mode, int sharing) { IndexedFile p = new IndexedFile(); + + File dir = new File(filename); + if(!dir.exists()) { + if (mode == COB_OPEN_OUTPUT || mode == COB_OPEN_I_O || mode == COB_OPEN_EXTEND) { + dir.mkdir(); + } else { + return ENOENT; + } + } Properties prop = new Properties(); prop.setProperty("je.freeDisk", "104857600"); @@ -162,12 +171,12 @@ public int open_(String filename, int mode, int sharing) { } } - if (mode == COB_OPEN_OUTPUT || mode == COB_OPEN_I_O || mode == COB_OPEN_EXTEND) { + /*if (mode == COB_OPEN_OUTPUT || mode == COB_OPEN_I_O || mode == COB_OPEN_EXTEND) { File dir = new File(filename); if (!dir.exists()) { dir.mkdir(); } - } + }*/ try { env = new Environment(new File(filename), envConf); diff --git a/tests/cobol85/report.pl b/tests/cobol85/report.pl index 51db7b1f..54f3e924 100644 --- a/tests/cobol85/report.pl +++ b/tests/cobol85/report.pl @@ -68,42 +68,42 @@ $skip{OBNC2M} = 1; -$skip{IX101A}=1; -$skip{IX102A}=1; -$skip{IX103A}=1; -$skip{IX104A}=1; -$skip{IX105A}=1; -$skip{IX106A}=1; -$skip{IX107A}=1; -$skip{IX108A}=1; -$skip{IX109A}=1; -$skip{IX110A}=1; -$skip{IX111A}=1; -$skip{IX112A}=1; -$skip{IX113A}=1; -$skip{IX114A}=1; -$skip{IX115A}=1; -$skip{IX116A}=1; -$skip{IX117A}=1; -$skip{IX118A}=1; -$skip{IX119A}=1; -$skip{IX120A}=1; -$skip{IX121A}=1; -$skip{IX201A}=1; -$skip{IX202A}=1; -$skip{IX203A}=1; -$skip{IX204A}=1; -$skip{IX205A}=1; -$skip{IX206A}=1; -$skip{IX207A}=1; -$skip{IX208A}=1; -$skip{IX209A}=1; -$skip{IX210A}=1; -$skip{IX211A}=1; -$skip{IX212A}=1; -$skip{IX213A}=1; -$skip{IX214A}=1; -$skip{IX215A}=1; +#$skip{IX101A}=1; +#$skip{IX102A}=1; +#$skip{IX103A}=1; +#$skip{IX104A}=1; +#$skip{IX105A}=1; +#$skip{IX106A}=1; +#$skip{IX107A}=1; +#$skip{IX108A}=1; +#$skip{IX109A}=1; +#$skip{IX110A}=1; +#$skip{IX111A}=1; +#$skip{IX112A}=1; +#$skip{IX113A}=1; +#$skip{IX114A}=1; +#$skip{IX115A}=1; +#$skip{IX116A}=1; +#$skip{IX117A}=1; +#$skip{IX118A}=1; +#$skip{IX119A}=1; +#$skip{IX120A}=1; +#$skip{IX121A}=1; +#$skip{IX201A}=1; +#$skip{IX202A}=1; +#$skip{IX203A}=1; +#$skip{IX204A}=1; +#$skip{IX205A}=1; +#$skip{IX206A}=1; +#$skip{IX207A}=1; +#$skip{IX208A}=1; +#$skip{IX209A}=1; +#$skip{IX210A}=1; +#$skip{IX211A}=1; +#$skip{IX212A}=1; +#$skip{IX213A}=1; +#$skip{IX214A}=1; +#$skip{IX215A}=1; #$skip{IX216A}=1; #$skip{IX217A}=1; #$skip{IX218A}=1; From 9f14b67d656c3e74be2e16f442b0aef20c8b2205 Mon Sep 17 00:00:00 2001 From: Yutaro Sakamoto Date: Sat, 31 Jul 2021 16:33:27 +0000 Subject: [PATCH 4/8] =?UTF-8?q?Java=E3=83=95=E3=82=A1=E3=82=A4=E3=83=AB?= =?UTF-8?q?=E3=81=8B=E3=82=89=E4=B8=8D=E8=A6=81=E3=81=AA=E3=82=B3=E3=83=A1?= =?UTF-8?q?=E3=83=B3=E3=83=88=E3=82=92=E5=89=8A=E9=99=A4=E3=81=97=E3=81=9F?= =?UTF-8?q?.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- libcobj/src/Cobjrun.java | 19 ---- .../libcobj/call/CobolResolve.java | 19 ---- .../libcobj/call/CobolRunnable.java | 19 ---- .../libcobj/common/CobolCallParams.java | 19 ---- .../libcobj/common/CobolCheck.java | 19 ---- .../libcobj/common/CobolFrame.java | 19 ---- .../libcobj/common/CobolIntrinsic.java | 3 - .../libcobj/common/CobolModule.java | 19 ---- .../libcobj/common/CobolUtil.java | 19 ---- .../libcobj/data/AbstractCobolField.java | 24 ---- .../libcobj/data/CobolAlphanumericField.java | 19 ---- .../libcobj/data/CobolDecimal.java | 1 - .../libcobj/data/CobolFieldAttribute.java | 20 ---- .../libcobj/data/CobolFieldFactory.java | 20 ---- .../libcobj/data/CobolGroupField.java | 35 ------ .../data/CobolNationalEditedField.java | 12 -- .../libcobj/data/CobolNationalField.java | 42 ------- .../libcobj/data/CobolNumericBinaryField.java | 33 ------ .../libcobj/data/CobolNumericDoubleField.java | 7 -- .../libcobj/data/CobolNumericEditedField.java | 12 -- .../libcobj/data/CobolNumericField.java | 29 ----- .../libcobj/data/CobolNumericPackedField.java | 39 ------- .../exceptions/CobolCallException.java | 20 ---- .../libcobj/exceptions/CobolException.java | 19 ---- .../libcobj/exceptions/CobolExceptionId.java | 19 ---- .../exceptions/CobolExceptionTabCode.java | 19 ---- .../exceptions/CobolGoBackException.java | 19 ---- .../exceptions/CobolRuntimeException.java | 19 ---- .../exceptions/CobolStopRunException.java | 19 ---- .../exceptions/CobolUndefinedException.java | 19 ---- .../libcobj/file/CobolFile.java | 20 ---- .../libcobj/file/CobolFileFactory.java | 19 ---- .../libcobj/file/CobolFileKey.java | 19 ---- .../libcobj/file/CobolFileSort.java | 19 ---- .../libcobj/file/CobolIndexedFile.java | 107 ++---------------- .../libcobj/file/CobolItem.java | 20 ---- .../libcobj/file/CobolLineSequentialFile.java | 20 ---- .../libcobj/file/CobolRelativeFile.java | 20 ---- .../libcobj/file/CobolSequentialFile.java | 19 ---- .../libcobj/file/CobolSort.java | 19 ---- .../opensourcecobol/libcobj/file/FileIO.java | 19 ---- .../libcobj/file/FileStruct.java | 19 ---- .../libcobj/file/IndexedFile.java | 19 ---- .../libcobj/file/KeyComponent.java | 19 ---- .../opensourcecobol/libcobj/file/Linage.java | 19 ---- .../libcobj/file/MemoryStruct.java | 19 ---- .../libcobj/termio/CobolTerminal.java | 20 ---- tests/cobol85/report.pl | 59 +--------- 48 files changed, 12 insertions(+), 1064 deletions(-) diff --git a/libcobj/src/Cobjrun.java b/libcobj/src/Cobjrun.java index 4bcd4419..b97b43bd 100644 --- a/libcobj/src/Cobjrun.java +++ b/libcobj/src/Cobjrun.java @@ -1,22 +1,3 @@ -/* - * Copyright (C) 2020 TOKYO SYSTEM HOUSE Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this software; see the file COPYING. If not, write to - * the Free Software Foundation, 51 Franklin Street, Fifth Floor - * Boston, MA 02110-1301 USA - */ - import jp.osscons.opensourcecobol.libcobj.call.CobolResolve; import jp.osscons.opensourcecobol.libcobj.call.CobolRunnable; import jp.osscons.opensourcecobol.libcobj.exceptions.CobolCallException; diff --git a/libcobj/src/jp/osscons/opensourcecobol/libcobj/call/CobolResolve.java b/libcobj/src/jp/osscons/opensourcecobol/libcobj/call/CobolResolve.java index 94b24004..3419d2f0 100644 --- a/libcobj/src/jp/osscons/opensourcecobol/libcobj/call/CobolResolve.java +++ b/libcobj/src/jp/osscons/opensourcecobol/libcobj/call/CobolResolve.java @@ -1,22 +1,3 @@ -/* - * Copyright (C) 2020 TOKYO SYSTEM HOUSE Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this software; see the file COPYING. If not, write to - * the Free Software Foundation, 51 Franklin Street, Fifth Floor - * Boston, MA 02110-1301 USA - */ - package jp.osscons.opensourcecobol.libcobj.call; import java.lang.reflect.Constructor; diff --git a/libcobj/src/jp/osscons/opensourcecobol/libcobj/call/CobolRunnable.java b/libcobj/src/jp/osscons/opensourcecobol/libcobj/call/CobolRunnable.java index 0a844e16..3ffacf22 100644 --- a/libcobj/src/jp/osscons/opensourcecobol/libcobj/call/CobolRunnable.java +++ b/libcobj/src/jp/osscons/opensourcecobol/libcobj/call/CobolRunnable.java @@ -1,22 +1,3 @@ -/* - * Copyright (C) 2020 TOKYO SYSTEM HOUSE Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this software; see the file COPYING. If not, write to - * the Free Software Foundation, 51 Franklin Street, Fifth Floor - * Boston, MA 02110-1301 USA - */ - package jp.osscons.opensourcecobol.libcobj.call; import jp.osscons.opensourcecobol.libcobj.data.AbstractCobolField; diff --git a/libcobj/src/jp/osscons/opensourcecobol/libcobj/common/CobolCallParams.java b/libcobj/src/jp/osscons/opensourcecobol/libcobj/common/CobolCallParams.java index d1729a70..f9978610 100644 --- a/libcobj/src/jp/osscons/opensourcecobol/libcobj/common/CobolCallParams.java +++ b/libcobj/src/jp/osscons/opensourcecobol/libcobj/common/CobolCallParams.java @@ -1,22 +1,3 @@ -/* - * Copyright (C) 2020 TOKYO SYSTEM HOUSE Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this software; see the file COPYING. If not, write to - * the Free Software Foundation, 51 Franklin Street, Fifth Floor - * Boston, MA 02110-1301 USA - */ - package jp.osscons.opensourcecobol.libcobj.common; public class CobolCallParams { diff --git a/libcobj/src/jp/osscons/opensourcecobol/libcobj/common/CobolCheck.java b/libcobj/src/jp/osscons/opensourcecobol/libcobj/common/CobolCheck.java index 17c932ce..847a4c45 100644 --- a/libcobj/src/jp/osscons/opensourcecobol/libcobj/common/CobolCheck.java +++ b/libcobj/src/jp/osscons/opensourcecobol/libcobj/common/CobolCheck.java @@ -1,22 +1,3 @@ -/* - * Copyright (C) 2020 TOKYO SYSTEM HOUSE Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this software; see the file COPYING. If not, write to - * the Free Software Foundation, 51 Franklin Street, Fifth Floor - * Boston, MA 02110-1301 USA - */ - package jp.osscons.opensourcecobol.libcobj.common; import jp.osscons.opensourcecobol.libcobj.data.CobolDataStorage; diff --git a/libcobj/src/jp/osscons/opensourcecobol/libcobj/common/CobolFrame.java b/libcobj/src/jp/osscons/opensourcecobol/libcobj/common/CobolFrame.java index 05ebc429..81ba6097 100644 --- a/libcobj/src/jp/osscons/opensourcecobol/libcobj/common/CobolFrame.java +++ b/libcobj/src/jp/osscons/opensourcecobol/libcobj/common/CobolFrame.java @@ -1,22 +1,3 @@ -/* - * Copyright (C) 2020 TOKYO SYSTEM HOUSE Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this software; see the file COPYING. If not, write to - * the Free Software Foundation, 51 Franklin Street, Fifth Floor - * Boston, MA 02110-1301 USA - */ - package jp.osscons.opensourcecobol.libcobj.common; import jp.osscons.opensourcecobol.libcobj.file.CobolFile; diff --git a/libcobj/src/jp/osscons/opensourcecobol/libcobj/common/CobolIntrinsic.java b/libcobj/src/jp/osscons/opensourcecobol/libcobj/common/CobolIntrinsic.java index 1623c48c..f4642355 100644 --- a/libcobj/src/jp/osscons/opensourcecobol/libcobj/common/CobolIntrinsic.java +++ b/libcobj/src/jp/osscons/opensourcecobol/libcobj/common/CobolIntrinsic.java @@ -96,8 +96,6 @@ public static void init() { private static double intrGetDouble(CobolDecimal d) { double v = d.getValue().doubleValue(); int n = d.getScale(); - /*for(; n>0; --n) v /= 10; - for(; n<0; ++n) v *= 10;*/ for(int i=0; i 0) { v /= 10; @@ -163,7 +161,6 @@ public static AbstractCobolField intrBinop(AbstractCobolField f1, int op, Abstra sign = 0; } - // BigDecimalに対するlog2を計算することをあきらめたため実装を変えた int size = sizeInBase10(d1.getValue()); if(d1.getScale() > size) { size = d1.getScale(); diff --git a/libcobj/src/jp/osscons/opensourcecobol/libcobj/common/CobolModule.java b/libcobj/src/jp/osscons/opensourcecobol/libcobj/common/CobolModule.java index 3a4715e8..ea49cc80 100644 --- a/libcobj/src/jp/osscons/opensourcecobol/libcobj/common/CobolModule.java +++ b/libcobj/src/jp/osscons/opensourcecobol/libcobj/common/CobolModule.java @@ -1,22 +1,3 @@ -/* - * Copyright (C) 2020 TOKYO SYSTEM HOUSE Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this software; see the file COPYING. If not, write to - * the Free Software Foundation, 51 Franklin Street, Fifth Floor - * Boston, MA 02110-1301 USA - */ - package jp.osscons.opensourcecobol.libcobj.common; import java.util.ArrayList; import java.util.Deque; diff --git a/libcobj/src/jp/osscons/opensourcecobol/libcobj/common/CobolUtil.java b/libcobj/src/jp/osscons/opensourcecobol/libcobj/common/CobolUtil.java index a8d46aa0..8437c0b1 100644 --- a/libcobj/src/jp/osscons/opensourcecobol/libcobj/common/CobolUtil.java +++ b/libcobj/src/jp/osscons/opensourcecobol/libcobj/common/CobolUtil.java @@ -1,22 +1,3 @@ -/* - * Copyright (C) 2020 TOKYO SYSTEM HOUSE Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this software; see the file COPYING. If not, write to - * the Free Software Foundation, 51 Franklin Street, Fifth Floor - * Boston, MA 02110-1301 USA - */ - package jp.osscons.opensourcecobol.libcobj.common; import java.time.DateTimeException; diff --git a/libcobj/src/jp/osscons/opensourcecobol/libcobj/data/AbstractCobolField.java b/libcobj/src/jp/osscons/opensourcecobol/libcobj/data/AbstractCobolField.java index 3f58a4d2..173283fd 100644 --- a/libcobj/src/jp/osscons/opensourcecobol/libcobj/data/AbstractCobolField.java +++ b/libcobj/src/jp/osscons/opensourcecobol/libcobj/data/AbstractCobolField.java @@ -1,22 +1,3 @@ -/* - * Copyright (C) 2020 TOKYO SYSTEM HOUSE Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this software; see the file COPYING. If not, write to - * the Free Software Foundation, 51 Franklin Street, Fifth Floor - * Boston, MA 02110-1301 USA - */ - package jp.osscons.opensourcecobol.libcobj.data; import java.math.BigDecimal; @@ -1317,12 +1298,7 @@ public void realPutSign(int sign) { } else if(CobolModule.getCurrentModule().display_sign != 0) { CobolUtil.putSignEbcdic(p, sign); } else if(sign < 0) { - //TODO マクロの分岐に関して調査 - //#ifdef COB_EBCDIC_MACHINE - //CobolUtil.getSignAscii(p); - //#else p.setByte(0, (byte)(b + 0x40)); - //#endif } case CobolFieldAttribute.COB_TYPE_NUMERIC_PACKED: p = this.getDataStorage().getSubDataStorage(this.size - 1); diff --git a/libcobj/src/jp/osscons/opensourcecobol/libcobj/data/CobolAlphanumericField.java b/libcobj/src/jp/osscons/opensourcecobol/libcobj/data/CobolAlphanumericField.java index f0607396..cdb935eb 100644 --- a/libcobj/src/jp/osscons/opensourcecobol/libcobj/data/CobolAlphanumericField.java +++ b/libcobj/src/jp/osscons/opensourcecobol/libcobj/data/CobolAlphanumericField.java @@ -1,22 +1,3 @@ -/* - * Copyright (C) 2020 TOKYO SYSTEM HOUSE Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this software; see the file COPYING. If not, write to - * the Free Software Foundation, 51 Franklin Street, Fifth Floor - * Boston, MA 02110-1301 USA - */ - package jp.osscons.opensourcecobol.libcobj.data; import java.io.UnsupportedEncodingException; diff --git a/libcobj/src/jp/osscons/opensourcecobol/libcobj/data/CobolDecimal.java b/libcobj/src/jp/osscons/opensourcecobol/libcobj/data/CobolDecimal.java index d696405b..c054de23 100644 --- a/libcobj/src/jp/osscons/opensourcecobol/libcobj/data/CobolDecimal.java +++ b/libcobj/src/jp/osscons/opensourcecobol/libcobj/data/CobolDecimal.java @@ -444,7 +444,6 @@ private double decimalGetDouble() { */ public int getField(AbstractCobolField f, int opt) throws CobolStopRunException { if(this.getScale() == CobolDecimal.DECIMAL_NAN) { - //throw new CobolRuntimeException(0, "getFieldのエラー"); CobolRuntimeException.setException(CobolExceptionId.COB_EC_SIZE_OVERFLOW); return CobolRuntimeException.code; } diff --git a/libcobj/src/jp/osscons/opensourcecobol/libcobj/data/CobolFieldAttribute.java b/libcobj/src/jp/osscons/opensourcecobol/libcobj/data/CobolFieldAttribute.java index fbd8f918..69226e02 100644 --- a/libcobj/src/jp/osscons/opensourcecobol/libcobj/data/CobolFieldAttribute.java +++ b/libcobj/src/jp/osscons/opensourcecobol/libcobj/data/CobolFieldAttribute.java @@ -1,22 +1,3 @@ -/* - * Copyright (C) 2020 TOKYO SYSTEM HOUSE Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this software; see the file COPYING. If not, write to - * the Free Software Foundation, 51 Franklin Street, Fifth Floor - * Boston, MA 02110-1301 USA - */ - package jp.osscons.opensourcecobol.libcobj.data; /** @@ -24,7 +5,6 @@ * */ public class CobolFieldAttribute { - //libcob/common.hに定義されている定数群 /* field types */ diff --git a/libcobj/src/jp/osscons/opensourcecobol/libcobj/data/CobolFieldFactory.java b/libcobj/src/jp/osscons/opensourcecobol/libcobj/data/CobolFieldFactory.java index 86ec5ec8..351e60bd 100644 --- a/libcobj/src/jp/osscons/opensourcecobol/libcobj/data/CobolFieldFactory.java +++ b/libcobj/src/jp/osscons/opensourcecobol/libcobj/data/CobolFieldFactory.java @@ -1,22 +1,3 @@ -/* - * Copyright (C) 2020 TOKYO SYSTEM HOUSE Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this software; see the file COPYING. If not, write to - * the Free Software Foundation, 51 Franklin Street, Fifth Floor - * Boston, MA 02110-1301 USA - */ - package jp.osscons.opensourcecobol.libcobj.data; import java.io.UnsupportedEncodingException; @@ -104,7 +85,6 @@ public static AbstractCobolField makeCobolField(String str) { * @return nの値を保持するCobolNumericFieldのインスタンス */ public static AbstractCobolField makeCobolField(int n) { - //対数にて数値の桁数を検出する int size = (int) (Math.log10(n) + 1); byte[] bytes = new byte[size]; CobolFieldAttribute attr = diff --git a/libcobj/src/jp/osscons/opensourcecobol/libcobj/data/CobolGroupField.java b/libcobj/src/jp/osscons/opensourcecobol/libcobj/data/CobolGroupField.java index 04bd580e..4becd56d 100644 --- a/libcobj/src/jp/osscons/opensourcecobol/libcobj/data/CobolGroupField.java +++ b/libcobj/src/jp/osscons/opensourcecobol/libcobj/data/CobolGroupField.java @@ -1,22 +1,3 @@ -/* - * Copyright (C) 2020 TOKYO SYSTEM HOUSE Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this software; see the file COPYING. If not, write to - * the Free Software Foundation, 51 Franklin Street, Fifth Floor - * Boston, MA 02110-1301 USA - */ - package jp.osscons.opensourcecobol.libcobj.data; import java.io.UnsupportedEncodingException; @@ -38,7 +19,6 @@ public class CobolGroupField extends AbstractCobolField { */ public CobolGroupField(int size, CobolDataStorage dataStorage, CobolFieldAttribute attribute) { super(size, dataStorage, attribute); - // TODO 自動生成されたコンストラクター・スタブ } /** @@ -55,12 +35,9 @@ public byte[] getBytes() { */ @Override public String getString() { - // TODO 自動生成されたメソッ:/ド・スタブ try { return new String (dataStorage.getData(), "SJIS"); } catch (UnsupportedEncodingException e) { - // TODO 自動生成された catch ブロック - // TODO ログの対応 e.printStackTrace(); throw new CobolRuntimeException(CobolRuntimeException.COBOL_FITAL_ERROR, "エンコードエラー"); } @@ -71,7 +48,6 @@ public String getString() { */ @Override public int getInt() { - // TODO 自動生成されたメソッド・スタブ return 0; } @@ -80,7 +56,6 @@ public int getInt() { */ @Override public double getDouble() { - // TODO 自動生成されたメソッド・スタブ return 0; } @@ -89,7 +64,6 @@ public double getDouble() { */ @Override public CobolDecimal getDecimal() { - // TODO 自動生成されたメソッド・スタブ return null; } @@ -98,7 +72,6 @@ public CobolDecimal getDecimal() { */ @Override public void setDecimal(BigDecimal decimal) { - // TODO 自動生成されたメソッド・スタブ } @@ -122,7 +95,6 @@ public void moveFrom(AbstractCobolField src) { */ @Override public void moveFrom(CobolDataStorage dataStrage) { - // TODO 自動生成されたメソッド・スタブ } @@ -146,14 +118,10 @@ public void moveFrom(byte[] bytes) { */ @Override public void moveFrom(String string) { - // TODO 自動生成されたメソッド・スタブ byte[] bytes; - // TODO 自動生成されたメソッ:/ド・スタブ try { bytes = string.getBytes("SJIS"); } catch (UnsupportedEncodingException e) { - // TODO 自動生成された catch ブロック - // TODO ログの対応 e.printStackTrace(); throw new CobolRuntimeException(CobolRuntimeException.COBOL_FITAL_ERROR, "エンコードエラー"); } @@ -167,7 +135,6 @@ public void moveFrom(String string) { */ @Override public void moveFrom(int number) { - // TODO 自動生成されたメソッド・スタブ } @@ -177,7 +144,6 @@ public void moveFrom(int number) { */ @Override public void moveFrom(double number) { - // TODO 自動生成されたメソッド・スタブ } @@ -187,7 +153,6 @@ public void moveFrom(double number) { */ @Override public void moveFrom(BigDecimal number) { - // TODO 自動生成されたメソッド・スタブ } diff --git a/libcobj/src/jp/osscons/opensourcecobol/libcobj/data/CobolNationalEditedField.java b/libcobj/src/jp/osscons/opensourcecobol/libcobj/data/CobolNationalEditedField.java index a978a83b..38efdf82 100644 --- a/libcobj/src/jp/osscons/opensourcecobol/libcobj/data/CobolNationalEditedField.java +++ b/libcobj/src/jp/osscons/opensourcecobol/libcobj/data/CobolNationalEditedField.java @@ -19,37 +19,31 @@ public CobolNationalEditedField(int size, CobolDataStorage dataStorage, CobolFie @Override public byte[] getBytes() { - // TODO Auto-generated method stub return null; } @Override public String getString() { - // TODO Auto-generated method stub return null; } @Override public double getDouble() { - // TODO Auto-generated method stub return 0; } @Override public CobolDecimal getDecimal() { - // TODO Auto-generated method stub return null; } @Override public void setDecimal(BigDecimal decimal) { - // TODO Auto-generated method stub } @Override public int addPackedInt(int n) { - // TODO Auto-generated method stub return 0; } @@ -127,37 +121,31 @@ private void moveAlphanumToNationalEdited(AbstractCobolField src) { @Override public void moveFrom(CobolDataStorage dataStrage) { - // TODO Auto-generated method stub } @Override public void moveFrom(byte[] bytes) { - // TODO Auto-generated method stub } @Override public void moveFrom(String string) { - // TODO Auto-generated method stub } @Override public void moveFrom(int number) { - // TODO Auto-generated method stub } @Override public void moveFrom(double number) { - // TODO Auto-generated method stub } @Override public void moveFrom(BigDecimal number) { - // TODO Auto-generated method stub } diff --git a/libcobj/src/jp/osscons/opensourcecobol/libcobj/data/CobolNationalField.java b/libcobj/src/jp/osscons/opensourcecobol/libcobj/data/CobolNationalField.java index 76fdd40a..f6654429 100644 --- a/libcobj/src/jp/osscons/opensourcecobol/libcobj/data/CobolNationalField.java +++ b/libcobj/src/jp/osscons/opensourcecobol/libcobj/data/CobolNationalField.java @@ -1,22 +1,3 @@ -/* - * Copyright (C) 2020 TOKYO SYSTEM HOUSE Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this software; see the file COPYING. If not, write to - * the Free Software Foundation, 51 Franklin Street, Fifth Floor - * Boston, MA 02110-1301 USA - */ - package jp.osscons.opensourcecobol.libcobj.data; import java.io.UnsupportedEncodingException; @@ -58,8 +39,6 @@ public String getString() { try { return new String(dataStorage.getData(), "SJIS"); } catch (UnsupportedEncodingException e) { - // TODO 自動生成された catch ブロック - // TODO ログの対応 e.printStackTrace(); throw new CobolRuntimeException(CobolRuntimeException.COBOL_FITAL_ERROR, "エンコードエラー"); } @@ -67,19 +46,16 @@ public String getString() { @Override public int getInt() { - // TODO 自動生成されたメソッド・スタブ return 0; } @Override public double getDouble() { - // TODO 自動生成されたメソッド・スタブ return 0; } @Override public CobolDecimal getDecimal() { - // TODO 自動生成されたメソッド・スタブ return null; } @@ -213,14 +189,6 @@ public static byte[] han2zen(byte[] str, int size) { int d = (byte) 0x00; int i, buf_index; - //?? -// for (i = size - 1; str[0] != (byte) 0x00 && i >= 0; i--) -// ; -// -// if (i >= 0) { -// size = i; -// } - buf = new byte[size * 2 + 1]; for (i = 0, buf_index = 0; i < size; i++) { @@ -1070,8 +1038,6 @@ public static byte[] han2zen(byte[] str, int size) { */ @Override public void moveFrom(CobolDataStorage dataStrage) { - // TODO 自動生成されたメソッド・スタブ - } /** @@ -1096,7 +1062,6 @@ public void moveFrom(String string) { CobolAlphanumericField f = new CobolAlphanumericField(bytes.length, data, a); this.moveFrom(f); } catch (UnsupportedEncodingException e) { - // TODO ログの対応 e.printStackTrace(); throw new CobolRuntimeException(CobolRuntimeException.COBOL_FITAL_ERROR, "エンコードエラー"); } @@ -1108,7 +1073,6 @@ public void moveFrom(String string) { */ @Override public void moveFrom(int number) { - // TODO 自動生成されたメソッド・スタブ } /** @@ -1117,7 +1081,6 @@ public void moveFrom(int number) { */ @Override public void moveFrom(double number) { - // TODO 自動生成されたメソッド・スタブ } @@ -1127,7 +1090,6 @@ public void moveFrom(double number) { */ @Override public void moveFrom(BigDecimal number) { - // TODO 自動生成されたメソッド・スタブ } @@ -1137,7 +1099,6 @@ public void moveFrom(BigDecimal number) { */ @Override public void setDecimal(BigDecimal decimal) { - // TODO 自動生成されたメソッド・スタブ } /** @@ -1147,9 +1108,6 @@ public void setDecimal(BigDecimal decimal) { */ @Override public CobolNumericField getNumericField() { - // TODO 自動生成されたメソッド・スタブ - //throw new CobolRuntimeException(CobolRuntimeException.COBOL_FITAL_ERROR, "使用不可"); - //int size = this.getAttribute().getDigits(); int size = this.getSize() / 2; int scale = this.getAttribute().getScale(); CobolFieldAttribute attr = new CobolFieldAttribute( diff --git a/libcobj/src/jp/osscons/opensourcecobol/libcobj/data/CobolNumericBinaryField.java b/libcobj/src/jp/osscons/opensourcecobol/libcobj/data/CobolNumericBinaryField.java index c03d713b..296dff7a 100644 --- a/libcobj/src/jp/osscons/opensourcecobol/libcobj/data/CobolNumericBinaryField.java +++ b/libcobj/src/jp/osscons/opensourcecobol/libcobj/data/CobolNumericBinaryField.java @@ -1,22 +1,3 @@ -/* - * Copyright (C) 2020 TOKYO SYSTEM HOUSE Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this software; see the file COPYING. If not, write to - * the Free Software Foundation, 51 Franklin Street, Fifth Floor - * Boston, MA 02110-1301 USA - */ - package jp.osscons.opensourcecobol.libcobj.data; import java.math.BigDecimal; @@ -43,7 +24,6 @@ public CobolNumericBinaryField(int size, CobolDataStorage dataStorage, CobolFiel */ @Override public byte[] getBytes() { - // TODO 自動生成されたメソッド・スタブ return null; } @@ -132,7 +112,6 @@ public int getSign() { */ @Override public double getDouble() { - // TODO 自動生成されたメソッド・スタブ return 0; } @@ -141,7 +120,6 @@ public double getDouble() { */ @Override public void setDecimal(BigDecimal decimal) { - // TODO 自動生成されたメソッド・スタブ } @@ -207,9 +185,6 @@ private void moveDisplayToBinary(AbstractCobolField field) { long val = 0; for(int i=0; i < size; ++i) { if(i < size1) { - //TODO 確認 - //バグを修正するためにopensource COBOLにはない処理を書き加えた - //なぜopensource COBOLはこの処理を書き加えずに正しく動作しているか不明 byte x = data1.getByte(data1Index + i); x = (byte) (x >= (byte)0x70 ? x - (byte)0x70 : x - (byte)0x30); val = val * 10 + x; @@ -235,8 +210,6 @@ private void moveDisplayToBinary(AbstractCobolField field) { * @param n */ public void binaryMsetInt64(long n) { - //TODO Javaの内部エンディアンの調査 - //JavaはBIG ENDIANのためopensource COBOLにある条件分岐は削除した byte bytes[] = new byte[8]; for(int i=0; i<8; ++i) { bytes[i] = (byte) ((byte) (n >> ((7 - i) * 8)) & 0x00000000000000FFL); @@ -251,7 +224,6 @@ public void binaryMsetInt64(long n) { */ @Override public void moveFrom(CobolDataStorage dataStrage) { - // TODO 自動生成されたメソッド・スタブ } @@ -261,7 +233,6 @@ public void moveFrom(CobolDataStorage dataStrage) { */ @Override public void moveFrom(byte[] bytes) { - // TODO 自動生成されたメソッド・スタブ } @@ -271,7 +242,6 @@ public void moveFrom(byte[] bytes) { */ @Override public void moveFrom(String string) { - // TODO 自動生成されたメソッド・スタブ } @@ -290,7 +260,6 @@ public void moveFrom(int number) { */ @Override public void moveFrom(double number) { - // TODO 自動生成されたメソッド・スタブ } @@ -300,7 +269,6 @@ public void moveFrom(double number) { */ @Override public void moveFrom(BigDecimal number) { - // TODO 自動生成されたメソッド・スタブ } @@ -349,7 +317,6 @@ private long binaryGetInt64() { if(this.getAttribute().isFlagHaveSign()) { CobolDecimal.numByteMemcpy(nStorage, 0, this.getDataStorage(), 0, this.getSize()); n = ByteBuffer.wrap(nStorage.getByteArray(0, 8)).getLong(); - //TODO ビット演算に誤りがいないか確認 n >>>= 8 * fsiz; } else { CobolDecimal.numByteMemcpy(nStorage, fsiz, this.getDataStorage(), 0, this.getSize()); diff --git a/libcobj/src/jp/osscons/opensourcecobol/libcobj/data/CobolNumericDoubleField.java b/libcobj/src/jp/osscons/opensourcecobol/libcobj/data/CobolNumericDoubleField.java index 6877f084..0e047033 100644 --- a/libcobj/src/jp/osscons/opensourcecobol/libcobj/data/CobolNumericDoubleField.java +++ b/libcobj/src/jp/osscons/opensourcecobol/libcobj/data/CobolNumericDoubleField.java @@ -22,7 +22,6 @@ private void setBinaryValue(double value) { @Override public byte[] getBytes() { - // TODO Auto-generated method stub return null; } @@ -150,36 +149,30 @@ public CobolDecimal getDecimal() { @Override public void moveFrom(byte[] bytes) { - // TODO Auto-generated method stub } @Override public void moveFrom(String string) { - // TODO Auto-generated method stub } @Override public void moveFrom(int number) { - // TODO Auto-generated method stub } @Override public void moveFrom(double number) { - // TODO Auto-generated method stub } @Override public void moveFrom(BigDecimal number) { - // TODO Auto-generated method stub } @Override public void moveFrom(CobolDataStorage dataStrage) { - // TODO Auto-generated method stub } diff --git a/libcobj/src/jp/osscons/opensourcecobol/libcobj/data/CobolNumericEditedField.java b/libcobj/src/jp/osscons/opensourcecobol/libcobj/data/CobolNumericEditedField.java index 1fab47cd..4823ed49 100644 --- a/libcobj/src/jp/osscons/opensourcecobol/libcobj/data/CobolNumericEditedField.java +++ b/libcobj/src/jp/osscons/opensourcecobol/libcobj/data/CobolNumericEditedField.java @@ -20,37 +20,31 @@ public CobolNumericEditedField(int size, CobolDataStorage dataStorage, CobolFiel @Override public byte[] getBytes() { - // TODO Auto-generated method stub return null; } @Override public String getString() { - // TODO Auto-generated method stub return null; } @Override public double getDouble() { - // TODO Auto-generated method stub return 0; } @Override public CobolDecimal getDecimal() { - // TODO Auto-generated method stub return null; } @Override public void setDecimal(BigDecimal decimal) { - // TODO Auto-generated method stub } @Override public int addPackedInt(int n) { - // TODO Auto-generated method stub return 0; } @@ -342,37 +336,31 @@ private static void moveDisplayToEdited(AbstractCobolField dst, AbstractCobolFie @Override public void moveFrom(CobolDataStorage dataStrage) { - // TODO Auto-generated method stub } @Override public void moveFrom(byte[] bytes) { - // TODO Auto-generated method stub } @Override public void moveFrom(String string) { - // TODO Auto-generated method stub } @Override public void moveFrom(int number) { - // TODO Auto-generated method stub } @Override public void moveFrom(double number) { - // TODO Auto-generated method stub } @Override public void moveFrom(BigDecimal number) { - // TODO Auto-generated method stub } diff --git a/libcobj/src/jp/osscons/opensourcecobol/libcobj/data/CobolNumericField.java b/libcobj/src/jp/osscons/opensourcecobol/libcobj/data/CobolNumericField.java index bef36e52..069936a3 100644 --- a/libcobj/src/jp/osscons/opensourcecobol/libcobj/data/CobolNumericField.java +++ b/libcobj/src/jp/osscons/opensourcecobol/libcobj/data/CobolNumericField.java @@ -1,22 +1,3 @@ -/* - * Copyright (C) 2020 TOKYO SYSTEM HOUSE Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this software; see the file COPYING. If not, write to - * the Free Software Foundation, 51 Franklin Street, Fifth Floor - * Boston, MA 02110-1301 USA - */ - package jp.osscons.opensourcecobol.libcobj.data; import java.io.UnsupportedEncodingException; @@ -48,7 +29,6 @@ public CobolNumericField(int size, CobolDataStorage dataStorage, CobolFieldAttri * TODO実装 */ public void checkNumeric(String s) { - //TODO 実装 } /** @@ -59,7 +39,6 @@ public byte[] getBytes() { return dataStorage.getData(); } - //削除予定 private char removeSign(byte v) { return (char) (v >= 0x70 ? v - 0x40 : v); @@ -168,7 +147,6 @@ public void setDecimal(BigDecimal decimal) { byte[] decimalBytes = decimal.toPlainString().getBytes(); int length = Math.min(this.size, decimalBytes.length); - //末尾からコピー for(int i=0; i rlo_size) { - record_lock_object = new byte[len]; - rlo_size = len; - } - //System.arraycopy(p.filename.getBytes(), 0, record_lock_object, 0, p.filenamelen + 1); - //System.arraycopy(p.key.getData(), 0, record_lock_object, p.filenamelen + 1, keylen); - DatabaseEntry dbt = new DatabaseEntry(record_lock_object); - OperationResult ret = null;/// lock獲得 - if(ret == null) { - // ロック解放 - }*/ return 0; } @@ -114,18 +81,6 @@ private int test_record_lock(DatabaseEntry key) { * @return */ private int lock_record(DatabaseEntry key) { - /*IndexedFile p = this.filei; - int keylen = key.getSize(); - int len = keylen + p.filenamelen + 1; - if(len > rlo_size) { - record_lock_object = new byte[len]; - rlo_size = len; - } - - OperationResult ret = null;//lock獲得 - if(ret == null) { - //ロック解放 - }*/ return 0; } @@ -171,19 +126,11 @@ public int open_(String filename, int mode, int sharing) { } } - /*if (mode == COB_OPEN_OUTPUT || mode == COB_OPEN_I_O || mode == COB_OPEN_EXTEND) { - File dir = new File(filename); - if (!dir.exists()) { - dir.mkdir(); - } - }*/ - try { env = new Environment(new File(filename), envConf); } catch (EnvironmentLockedException e) { return COB_STATUS_61_FILE_SHARING; } catch (Exception e) { - //TODO 一般的なエラーに対してどういう処理にするか考える. return COB_STATUS_30_PERMANENT_ERROR; } @@ -201,10 +148,6 @@ public int open_(String filename, int mode, int sharing) { } else { dbConf.setAllowCreate(true); } - /*if(this.keys[i].getFlag() != 0) { - dbConf.setSortedDuplicates(true); - }*/ - //dbConf.setSortedDuplicates(this.keys[i].getFlag() != 0); dbConf.setSortedDuplicates(true); dbConf.setTransactional(true); @@ -215,8 +158,6 @@ public int open_(String filename, int mode, int sharing) { env.removeDatabase(null, subDbName); } } catch (DatabaseNotFoundException e) { - //存在しないDBを削除しようとしたときの例外 - //これはエラーとして扱わない } } @@ -335,7 +276,6 @@ public int indexed_start_internal(int cond, AbstractCobolField key, int read_opt p.cursor[p.key_index] = p.db[p.key_index].openCursor(null, cursorConfig); try { OperationResult result = p.cursor[p.key_index].get(p.key, p.data, Get.SEARCH_GTE, readOptions); - //dbg primary key = AAA060 int ret = result != null ? 0 : 1; switch (cond) { @@ -545,7 +485,6 @@ public int readNext(int readOpts) { } } file_changed = ret; - //TODO ロック処理を削除した } if (this.flag_first_read == 0 || file_changed != 0) { if (nextprev == Get.FIRST || nextprev == Get.LAST) { @@ -695,14 +634,10 @@ private int indexed_write_internal(boolean rewrite, int opt) { IndexedFile p = this.filei; boolean close_cursor; - //if (p.write_cursor_open) { - //close_cursor = false; - //} else { - this.txn = env.beginTransaction(null, null); - p.cursor[0] = p.db[0].openCursor(this.txn, null); - p.write_cursor_open = true; - close_cursor = true; - //} + this.txn = env.beginTransaction(null, null); + p.cursor[0] = p.db[0].openCursor(this.txn, null); + p.write_cursor_open = true; + close_cursor = true; if (this.nkeys > 1 && !rewrite) { if (this.check_alt_keys(false)) { @@ -757,11 +692,7 @@ private int indexed_write_internal(boolean rewrite, int opt) { try { DatabaseEntry subData = DBT_SET(this.keys[i].getField()); boolean writeFail = p.db[i].put(this.txn, p.key, p.data, flags, null) == null; - //System.out.println("[" + i + "] subkey: " + subKey + ", subData: " + subData); byte[] b = subKey.getData(); - if(b[0] == 65 && b[1] == 65 && b[2] == 65 && b[3] == 48 && b[4] == 54 && b[5] == 48) { - //System.out.println("[" + i + "] subkey: " + new String(subKey.getData()) + ", subData: " + new String(subData.getData())); - } OperationResult result = p.sub_db[i-1].put(this.txn, subKey, subData, Put.OVERWRITE, null); writeFail |= result == null; if(writeFail) { @@ -791,7 +722,6 @@ private int indexed_write_internal(boolean rewrite, int opt) { return COB_STATUS_22_KEY_EXISTS; } } - //TODO 注意ロック処理を削除した if (close_cursor) { p.cursor[0].close(); @@ -877,13 +807,8 @@ private int get_dupno(int i) { p.key = DBT_SET(this.keys[i].getField()); p.temp_key.memcpy(p.key.getData()); p.cursor[i] = p.db[i].openCursor(null, null); - //TODO! 元々はこう書いてあったが修正した。要検討。 - //OperationResult ret = p.cursor[i].get(p.key, p.data, Get.FIRST, null); OperationResult ret = p.cursor[i].get(p.key, p.data, Get.SEARCH, null); - //TODO! 検討 - //berkley dbの重複スキーに対するデータは新しいものほど先頭に格納されるが - //java editionでは挿入位置が自動で設定されるため,以下の実装を変えた. int dupno = 0; while (ret != null && p.temp_key.memcmp(p.key.getData(), p.key.getSize()) == 0) { int tempdupno = ByteBuffer.wrap(p.data.getData(), this.keys[0].getField().getSize(), 4).getInt(); @@ -906,15 +831,12 @@ private int get_dupno(int i) { public int rewrite_(int opt) { IndexedFile p = this.filei; - //p.cursor[0] = p.db[0].openCursor(null, null); p.write_cursor_open = true; if (env != null) { this.unlock_record(); } if (this.check_alt_keys(true)) { - //p.cursor[0].close(); - //p.cursor[0] = null; p.write_cursor_open = false; return COB_STATUS_22_KEY_EXISTS; } @@ -922,8 +844,6 @@ public int rewrite_(int opt) { int ret = this.indexed_delete_internal(true); if (ret != COB_STATUS_00_SUCCESS) { - //p.cursor[0].close(); - //p.cursor[0] = null; p.write_cursor_open = false; return ret; } @@ -931,10 +851,6 @@ public int rewrite_(int opt) { p.key = DBT_SET(this.keys[0].getField()); ret = this.indexed_write_internal(true, opt); - //p.cursor[0].close(); - //p.cursor[0] = null; - //p.write_cursor_open = false; - return ret; } @@ -947,14 +863,10 @@ private int indexed_delete_internal(boolean rewrite) { IndexedFile p = this.filei; boolean close_cursor; - //if (p.write_cursor_open) { - //close_cursor = false; - //} else { - this.txn = this.env.beginTransaction(null, null); - p.cursor[0] = p.db[0].openCursor(this.txn, null); - p.write_cursor_open = true; - close_cursor = true; - //} + this.txn = this.env.beginTransaction(null, null); + p.cursor[0] = p.db[0].openCursor(this.txn, null); + p.write_cursor_open = true; + close_cursor = true; if (env != null) { this.unlock_record(); @@ -975,7 +887,6 @@ private int indexed_delete_internal(boolean rewrite) { this.txn.abort(); return COB_STATUS_23_KEY_NOT_EXISTS; } - //TODO 注意ロック処理を削除した DatabaseEntry prim_key = p.key; @@ -985,7 +896,6 @@ private int indexed_delete_internal(boolean rewrite) { DatabaseEntry subKey = DBT_SET(this.keys[0].getField()); DatabaseEntry subData = new DatabaseEntry(); Cursor subCursor = p.sub_db[i-1].openCursor(this.txn, null); - //System.out.println(String.format("[delete %d] subkey %s", i, new String(subKey.getData()))); if(subCursor.get(subKey, subData, Get.SEARCH, null) != null) { do { p.cursor[i] = p.db[i].openCursor(this.txn, null); @@ -1061,7 +971,6 @@ public void unlock_() { if (env != null) { this.unlock_record(); - //ロック解放 } } } diff --git a/libcobj/src/jp/osscons/opensourcecobol/libcobj/file/CobolItem.java b/libcobj/src/jp/osscons/opensourcecobol/libcobj/file/CobolItem.java index 4a3031f0..b095f7ee 100644 --- a/libcobj/src/jp/osscons/opensourcecobol/libcobj/file/CobolItem.java +++ b/libcobj/src/jp/osscons/opensourcecobol/libcobj/file/CobolItem.java @@ -1,22 +1,3 @@ -/* - * Copyright (C) 2020 TOKYO SYSTEM HOUSE Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this software; see the file COPYING. If not, write to - * the Free Software Foundation, 51 Franklin Street, Fifth Floor - * Boston, MA 02110-1301 USA - */ - package jp.osscons.opensourcecobol.libcobj.file; import jp.osscons.opensourcecobol.libcobj.data.CobolDataStorage; @@ -26,7 +7,6 @@ public class CobolItem { private int endOfBlock; private int recordSize; private byte blockByte = 0; - //private byte[] unique = new byte[(sizeof(size_t)]; private CobolDataStorage unique = new CobolDataStorage(new byte[8]); private CobolDataStorage item; diff --git a/libcobj/src/jp/osscons/opensourcecobol/libcobj/file/CobolLineSequentialFile.java b/libcobj/src/jp/osscons/opensourcecobol/libcobj/file/CobolLineSequentialFile.java index f688212b..0ea4e955 100644 --- a/libcobj/src/jp/osscons/opensourcecobol/libcobj/file/CobolLineSequentialFile.java +++ b/libcobj/src/jp/osscons/opensourcecobol/libcobj/file/CobolLineSequentialFile.java @@ -1,22 +1,3 @@ -/* - * Copyright (C) 2020 TOKYO SYSTEM HOUSE Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this software; see the file COPYING. If not, write to - * the Free Software Foundation, 51 Franklin Street, Fifth Floor - * Boston, MA 02110-1301 USA - */ - package jp.osscons.opensourcecobol.libcobj.file; import jp.osscons.opensourcecobol.libcobj.data.AbstractCobolField; @@ -36,7 +17,6 @@ public CobolLineSequentialFile(String select_name, byte[] file_status, AbstractC access_mode, lock_mode, open_mode, flag_optional, last_open_mode, special, flag_nonexistent, flag_end_of_file, flag_begin_of_file, flag_first_read, flag_read_done, flag_select_features, flag_needs_nl, flag_needs_top, file_version); - // TODO 自動生成されたコンストラクター・スタブ } @Override diff --git a/libcobj/src/jp/osscons/opensourcecobol/libcobj/file/CobolRelativeFile.java b/libcobj/src/jp/osscons/opensourcecobol/libcobj/file/CobolRelativeFile.java index a0f3a039..838a3584 100644 --- a/libcobj/src/jp/osscons/opensourcecobol/libcobj/file/CobolRelativeFile.java +++ b/libcobj/src/jp/osscons/opensourcecobol/libcobj/file/CobolRelativeFile.java @@ -1,22 +1,3 @@ -/* - * Copyright (C) 2020 TOKYO SYSTEM HOUSE Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this software; see the file COPYING. If not, write to - * the Free Software Foundation, 51 Franklin Street, Fifth Floor - * Boston, MA 02110-1301 USA - */ - package jp.osscons.opensourcecobol.libcobj.file; import jp.osscons.opensourcecobol.libcobj.data.AbstractCobolField; @@ -33,7 +14,6 @@ public CobolRelativeFile(String select_name, byte[] file_status, AbstractCobolFi access_mode, lock_mode, open_mode, flag_optional, last_open_mode, special, flag_nonexistent, flag_end_of_file, flag_begin_of_file, flag_first_read, flag_read_done, flag_select_features, flag_needs_nl, flag_needs_top, file_version); - // TODO 自動生成されたコンストラクター・スタブ } @Override diff --git a/libcobj/src/jp/osscons/opensourcecobol/libcobj/file/CobolSequentialFile.java b/libcobj/src/jp/osscons/opensourcecobol/libcobj/file/CobolSequentialFile.java index c93f3723..e05b315c 100644 --- a/libcobj/src/jp/osscons/opensourcecobol/libcobj/file/CobolSequentialFile.java +++ b/libcobj/src/jp/osscons/opensourcecobol/libcobj/file/CobolSequentialFile.java @@ -1,22 +1,3 @@ -/* - * Copyright (C) 2020 TOKYO SYSTEM HOUSE Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this software; see the file COPYING. If not, write to - * the Free Software Foundation, 51 Franklin Street, Fifth Floor - * Boston, MA 02110-1301 USA - */ - package jp.osscons.opensourcecobol.libcobj.file; import java.io.IOException; diff --git a/libcobj/src/jp/osscons/opensourcecobol/libcobj/file/CobolSort.java b/libcobj/src/jp/osscons/opensourcecobol/libcobj/file/CobolSort.java index 3048d807..b6b0cad8 100644 --- a/libcobj/src/jp/osscons/opensourcecobol/libcobj/file/CobolSort.java +++ b/libcobj/src/jp/osscons/opensourcecobol/libcobj/file/CobolSort.java @@ -1,22 +1,3 @@ -/* - * Copyright (C) 2020 TOKYO SYSTEM HOUSE Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this software; see the file COPYING. If not, write to - * the Free Software Foundation, 51 Franklin Street, Fifth Floor - * Boston, MA 02110-1301 USA - */ - package jp.osscons.opensourcecobol.libcobj.file; import jp.osscons.opensourcecobol.libcobj.data.AbstractCobolField; diff --git a/libcobj/src/jp/osscons/opensourcecobol/libcobj/file/FileIO.java b/libcobj/src/jp/osscons/opensourcecobol/libcobj/file/FileIO.java index df018f82..e6aef9c9 100644 --- a/libcobj/src/jp/osscons/opensourcecobol/libcobj/file/FileIO.java +++ b/libcobj/src/jp/osscons/opensourcecobol/libcobj/file/FileIO.java @@ -1,22 +1,3 @@ -/* - * Copyright (C) 2020 TOKYO SYSTEM HOUSE Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this software; see the file COPYING. If not, write to - * the Free Software Foundation, 51 Franklin Street, Fifth Floor - * Boston, MA 02110-1301 USA - */ - package jp.osscons.opensourcecobol.libcobj.file; import java.io.BufferedInputStream; diff --git a/libcobj/src/jp/osscons/opensourcecobol/libcobj/file/FileStruct.java b/libcobj/src/jp/osscons/opensourcecobol/libcobj/file/FileStruct.java index 20afcc33..c89de999 100644 --- a/libcobj/src/jp/osscons/opensourcecobol/libcobj/file/FileStruct.java +++ b/libcobj/src/jp/osscons/opensourcecobol/libcobj/file/FileStruct.java @@ -1,22 +1,3 @@ -/* - * Copyright (C) 2020 TOKYO SYSTEM HOUSE Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this software; see the file COPYING. If not, write to - * the Free Software Foundation, 51 Franklin Street, Fifth Floor - * Boston, MA 02110-1301 USA - */ - package jp.osscons.opensourcecobol.libcobj.file; public class FileStruct { diff --git a/libcobj/src/jp/osscons/opensourcecobol/libcobj/file/IndexedFile.java b/libcobj/src/jp/osscons/opensourcecobol/libcobj/file/IndexedFile.java index 702cfd08..81d40f7d 100644 --- a/libcobj/src/jp/osscons/opensourcecobol/libcobj/file/IndexedFile.java +++ b/libcobj/src/jp/osscons/opensourcecobol/libcobj/file/IndexedFile.java @@ -1,22 +1,3 @@ -/* - * Copyright (C) 2020 TOKYO SYSTEM HOUSE Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this software; see the file COPYING. If not, write to - * the Free Software Foundation, 51 Franklin Street, Fifth Floor - * Boston, MA 02110-1301 USA - */ - package jp.osscons.opensourcecobol.libcobj.file; import com.sleepycat.je.Cursor; diff --git a/libcobj/src/jp/osscons/opensourcecobol/libcobj/file/KeyComponent.java b/libcobj/src/jp/osscons/opensourcecobol/libcobj/file/KeyComponent.java index 46c3d281..f3b83041 100644 --- a/libcobj/src/jp/osscons/opensourcecobol/libcobj/file/KeyComponent.java +++ b/libcobj/src/jp/osscons/opensourcecobol/libcobj/file/KeyComponent.java @@ -1,22 +1,3 @@ -/* - * Copyright (C) 2020 TOKYO SYSTEM HOUSE Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this software; see the file COPYING. If not, write to - * the Free Software Foundation, 51 Franklin Street, Fifth Floor - * Boston, MA 02110-1301 USA - */ - package jp.osscons.opensourcecobol.libcobj.file; import jp.osscons.opensourcecobol.libcobj.data.AbstractCobolField; diff --git a/libcobj/src/jp/osscons/opensourcecobol/libcobj/file/Linage.java b/libcobj/src/jp/osscons/opensourcecobol/libcobj/file/Linage.java index c2162ccc..1008bea0 100644 --- a/libcobj/src/jp/osscons/opensourcecobol/libcobj/file/Linage.java +++ b/libcobj/src/jp/osscons/opensourcecobol/libcobj/file/Linage.java @@ -1,22 +1,3 @@ -/* - * Copyright (C) 2020 TOKYO SYSTEM HOUSE Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this software; see the file COPYING. If not, write to - * the Free Software Foundation, 51 Franklin Street, Fifth Floor - * Boston, MA 02110-1301 USA - */ - package jp.osscons.opensourcecobol.libcobj.file; import jp.osscons.opensourcecobol.libcobj.data.AbstractCobolField; diff --git a/libcobj/src/jp/osscons/opensourcecobol/libcobj/file/MemoryStruct.java b/libcobj/src/jp/osscons/opensourcecobol/libcobj/file/MemoryStruct.java index 463c60c7..b39a34b5 100644 --- a/libcobj/src/jp/osscons/opensourcecobol/libcobj/file/MemoryStruct.java +++ b/libcobj/src/jp/osscons/opensourcecobol/libcobj/file/MemoryStruct.java @@ -1,22 +1,3 @@ -/* - * Copyright (C) 2020 TOKYO SYSTEM HOUSE Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this software; see the file COPYING. If not, write to - * the Free Software Foundation, 51 Franklin Street, Fifth Floor - * Boston, MA 02110-1301 USA - */ - package jp.osscons.opensourcecobol.libcobj.file; public class MemoryStruct { diff --git a/libcobj/src/jp/osscons/opensourcecobol/libcobj/termio/CobolTerminal.java b/libcobj/src/jp/osscons/opensourcecobol/libcobj/termio/CobolTerminal.java index 1ac6fdb5..467dcf10 100644 --- a/libcobj/src/jp/osscons/opensourcecobol/libcobj/termio/CobolTerminal.java +++ b/libcobj/src/jp/osscons/opensourcecobol/libcobj/termio/CobolTerminal.java @@ -1,22 +1,3 @@ -/* - * Copyright (C) 2020 TOKYO SYSTEM HOUSE Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this software; see the file COPYING. If not, write to - * the Free Software Foundation, 51 Franklin Street, Fifth Floor - * Boston, MA 02110-1301 USA - */ - package jp.osscons.opensourcecobol.libcobj.termio; import java.io.BufferedOutputStream; @@ -240,7 +221,6 @@ public static void acceptEnvironment(AbstractCobolField f) { f.hankakuMoveFrom(src); } - //CommandLine Arguments /** * libcob/common.c cob_display_command_line diff --git a/tests/cobol85/report.pl b/tests/cobol85/report.pl index 54f3e924..658b19f5 100644 --- a/tests/cobol85/report.pl +++ b/tests/cobol85/report.pl @@ -25,21 +25,11 @@ $enable_c = 0; if ($opt) { - if($enable_c == 1) { - $compile = "ocobc --save-temp=csrc -std=cobol85 -x $opt"; - $compile_module = "ocobc --save-temp=csrc -std=cobol85 -m $opt"; - } else { - $compile = "cobc -std=cobol85 -x $opt"; - $compile_module = "cobc -std=cobol85 -m $opt"; - } + $compile = "cobc -std=cobol85 -x $opt"; + $compile_module = "cobc -std=cobol85 -m $opt"; } else { - if($enable_c == 1) { - $compile = "ocobc --save-temp=csrc -std=cobol85 -x"; - $compile_module = "ocobc --save-temp=csrc -std=cobol85 -m"; - } else { - $compile = "cobc -std=cobol85 -x"; - $compile_module = "cobc -std=cobol85 -m"; - } + $compile = "cobc -std=cobol85 -x"; + $compile_module = "cobc -std=cobol85 -m"; } my $num_progs = 0; @@ -68,47 +58,6 @@ $skip{OBNC2M} = 1; -#$skip{IX101A}=1; -#$skip{IX102A}=1; -#$skip{IX103A}=1; -#$skip{IX104A}=1; -#$skip{IX105A}=1; -#$skip{IX106A}=1; -#$skip{IX107A}=1; -#$skip{IX108A}=1; -#$skip{IX109A}=1; -#$skip{IX110A}=1; -#$skip{IX111A}=1; -#$skip{IX112A}=1; -#$skip{IX113A}=1; -#$skip{IX114A}=1; -#$skip{IX115A}=1; -#$skip{IX116A}=1; -#$skip{IX117A}=1; -#$skip{IX118A}=1; -#$skip{IX119A}=1; -#$skip{IX120A}=1; -#$skip{IX121A}=1; -#$skip{IX201A}=1; -#$skip{IX202A}=1; -#$skip{IX203A}=1; -#$skip{IX204A}=1; -#$skip{IX205A}=1; -#$skip{IX206A}=1; -#$skip{IX207A}=1; -#$skip{IX208A}=1; -#$skip{IX209A}=1; -#$skip{IX210A}=1; -#$skip{IX211A}=1; -#$skip{IX212A}=1; -#$skip{IX213A}=1; -#$skip{IX214A}=1; -#$skip{IX215A}=1; -#$skip{IX216A}=1; -#$skip{IX217A}=1; -#$skip{IX218A}=1; - - open (LOG, "> report.txt") or die; print LOG "Filename total pass fail deleted inspect\n"; print LOG "-------- ----- ---- ---- ------- -------\n"; From 354c70fa18e4f2b87a1a8e79138196b321c870ae Mon Sep 17 00:00:00 2001 From: Yutaro Sakamoto Date: Sat, 31 Jul 2021 17:29:26 +0000 Subject: [PATCH 5/8] =?UTF-8?q?C=E8=A8=80=E8=AA=9E=E3=82=BD=E3=83=BC?= =?UTF-8?q?=E3=82=B9=E3=82=B3=E3=83=BC=E3=83=89=E3=82=92=E3=83=AA=E3=83=95?= =?UTF-8?q?=E3=82=A1=E3=82=AF=E3=82=BF=E3=83=AA=E3=83=B3=E3=82=B0=E3=81=97?= =?UTF-8?q?=E3=81=9F.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cobc/codegen.c | 153 +++++++++++++++++++++++-------------------------- cobc/typeck.c | 4 +- 2 files changed, 74 insertions(+), 83 deletions(-) diff --git a/cobc/codegen.c b/cobc/codegen.c index 8fe76586..7caa8fb0 100644 --- a/cobc/codegen.c +++ b/cobc/codegen.c @@ -1208,8 +1208,6 @@ joutput_param (cb_tree x, int id) if (CB_FILE_P (r->value)) { joutput ("%s%s", CB_PREFIX_FILE, CB_FILE (r->value)->cname); - //TODO SORT実装時にコメントアウトした. - //joutput (";}}).run()"); if (r->check) { #ifdef __GNUC__ #else @@ -1309,12 +1307,11 @@ joutput_param (cb_tree x, int id) joutput_target = savetarget; } if (f->flag_local) { - //TODO any_length関連の影響調査 if (f->flag_any_length && f->flag_anylen_done) { joutput ("%s%d", CB_PREFIX_FIELD, f->id); } else { joutput ("new GetAbstractCobolField() { "); - joutput ("public AbstractCobolField run() { %s%d.setDataStorage(", CB_PREFIX_FIELD, f->id); + joutput ("public AbstractCobolField run() { %s%d.setDataStorage(", CB_PREFIX_FIELD, f->id); joutput_data (x); joutput ("); return %s%d; }}.run()", CB_PREFIX_FIELD, f->id); if (f->flag_any_length) { @@ -1446,10 +1443,10 @@ joutput_funcall (cb_tree x) break; case 'F': /* Move of one character */ - save_flag = param_wrap_string_flag; - param_wrap_string_flag = 1; + save_flag = param_wrap_string_flag; + param_wrap_string_flag = 1; joutput_data (p->argv[0]); - param_wrap_string_flag = save_flag; + param_wrap_string_flag = save_flag; joutput (".setByte("); joutput_data (p->argv[1]); @@ -1457,14 +1454,14 @@ joutput_funcall (cb_tree x) break; case 'G': /* Test of one character */ - joutput ("(((int)"); + joutput ("(((int)"); - save_flag = param_wrap_string_flag; - param_wrap_string_flag = 1; + save_flag = param_wrap_string_flag; + param_wrap_string_flag = 1; joutput_data (p->argv[0]); - param_wrap_string_flag = save_flag; + param_wrap_string_flag = save_flag; - joutput (".getByte(0))"); + joutput (".getByte(0))"); if (p->argv[1] == cb_space) { joutput (" - (int)' ')"); } else if (p->argv[1] == cb_zero) { @@ -1490,10 +1487,10 @@ joutput_funcall (cb_tree x) if(CB_CALL_METHOD_P(p)) { screenptr = p->screenptr; - int tmp_flag = param_wrap_string_flag; - param_wrap_string_flag = 1; + int tmp_flag = param_wrap_string_flag; + param_wrap_string_flag = 1; joutput_param(p->argv[0], 0); - param_wrap_string_flag = tmp_flag; + param_wrap_string_flag = tmp_flag; joutput (".%s (", p->name); for (i = 1; i < p->argc; i++) { @@ -1935,7 +1932,6 @@ joutput_initialize_uniform (cb_tree x, int c, int size) } if (size == 1) { joutput_data (x); - //もともとはsetChar joutput (".setByte((byte)%d);\n", c); } else { @@ -2064,7 +2060,7 @@ joutput_initialize_one (struct cb_initialize *p, cb_tree x) joutput_prefix (); if (f->size == 1) { joutput_data (x); - joutput(".setByte(0, (byte)%d);", *(unsigned char *)buff); + joutput(".setByte(0, (byte)%d);", *(unsigned char *)buff); } else { buffchar = *buff; for (i = 0; i < f->size; i++) { @@ -2085,15 +2081,15 @@ joutput_initialize_one (struct cb_initialize *p, cb_tree x) } } if (n > 2) { - joutput_data (x); - joutput (".memcpy("); + joutput_data (x); + joutput (".memcpy("); joutput_string ((ucharptr) buff, f->size - n); - joutput (", %d);\n", f->size - n); - joutput_prefix (); - joutput_data (x); - joutput (".getSubDataStorage(%d)", f->size - n); - joutput (".memset(%d, %d);", buffchar, n); + joutput (", %d);\n", f->size - n); + joutput_prefix (); + joutput_data (x); + joutput (".getSubDataStorage(%d)", f->size - n); + joutput (".memset(%d, %d);", buffchar, n); return; } } @@ -2331,14 +2327,14 @@ joutput_search_whens (cb_tree table, cb_tree var, cb_tree stmt, cb_tree whens) joutput_indent (" {"); joutput_prefix (); - int tmp_flag = integer_reference_flag; - integer_reference_flag = 1; + int tmp_flag = integer_reference_flag; + integer_reference_flag = 1; joutput_integer (idx); - integer_reference_flag = tmp_flag; + integer_reference_flag = tmp_flag; joutput(".set("); joutput_integer(idx); - joutput_line(" + 1);"); + joutput_line(" + 1);"); if (var && var != idx) { joutput_move (idx, var); @@ -2381,10 +2377,10 @@ joutput_search_all (cb_tree table, cb_tree stmt, cb_tree cond, cb_tree when) /* Next index */ joutput_prefix (); - int tmp_flag = integer_reference_flag; - integer_reference_flag = 1; + int tmp_flag = integer_reference_flag; + integer_reference_flag = 1; joutput_integer (idx); - integer_reference_flag = tmp_flag; + integer_reference_flag = tmp_flag; joutput (".set((head + tail) / 2);\n"); /* WHEN test */ @@ -2401,12 +2397,12 @@ joutput_search_all (cb_tree table, cb_tree stmt, cb_tree cond, cb_tree when) joutput_prefix (); joutput (" head = "); joutput_integer (idx); - joutput(";\n"); + joutput(";\n"); joutput_line ("else"); joutput_prefix (); joutput (" tail = "); joutput_integer (idx); - joutput(";\n"); + joutput(";\n"); joutput_line ("continue;"); joutput_indent (" }"); joutput_line ("break;"); @@ -3004,7 +3000,7 @@ joutput_perform_call (struct cb_label *lb, struct cb_label *le) #endif cb_id++; //joutput_line ("frame_ptr--;"); - joutput_line ("this.frameIndex--;"); + joutput_line ("this.frameIndex--;"); //joutput_line ("throw new CobolRuntimeException(0, \"\");"); } @@ -3249,7 +3245,7 @@ joutput_sort_proc (struct cb_sort_proc *p) //cb_id++; //joutput_line ("frame_ptr--;"); cb_id++; - joutput_line ("this.frameIndex--;"); + joutput_line ("this.frameIndex--;"); } static void @@ -3407,7 +3403,7 @@ joutput_stmt (cb_tree x) struct cb_cast *cp; #endif int code; - struct cb_field *f; + struct cb_field *f; stack_id = 0; if (x == NULL) { @@ -3725,23 +3721,18 @@ joutput_stmt (cb_tree x) joutput_perform (CB_PERFORM (x)); break; case CB_TAG_SORT_INIT: - //TODO joutput_sort_init (CB_SORT_INIT (x)); break; case CB_TAG_SORT_PROC: - //TODO joutput_sort_proc (CB_SORT_PROC (x)); break; case CB_TAG_RETURN: - //TODO joutput_file_return (CB_RETURN (x)); break; case CB_TAG_RELEASE: - //TODO joutput_file_release (CB_RELEASE (x)); break; case CB_TAG_SORT_FINISH: - //TODO joutput_sort_finish (CB_SORT_FINISH (x)); break; case CB_TAG_CONTINUE: @@ -3820,8 +3811,8 @@ joutput_file_initialization (struct cb_file *f) joutput_indent ("{"); joutput_line ("%s%s = new CobolFileKey[%d];", CB_PREFIX_KEYS, f->cname, nkeys); - joutput_line ("for (int i=0; i<%d; ++i)", nkeys); - joutput_line (" %s%s[i] = new CobolFileKey();", CB_PREFIX_KEYS, f->cname); + joutput_line ("for (int i=0; i<%d; ++i)", nkeys); + joutput_line (" %s%s[i] = new CobolFileKey();", CB_PREFIX_KEYS, f->cname); joutput_indent ("}"); nkeys = 1; joutput_prefix (); @@ -4013,7 +4004,7 @@ joutput_file_initialization (struct cb_file *f) joutput_line ("lingptr.setLinTop(0);"); joutput_line ("lingptr.setLinBot(0);"); } - if (f->external) { + if (f->external) { joutput_indent ("}"); } @@ -4061,10 +4052,10 @@ joutput_initial_values (struct cb_field *p) if (p->flag_no_init && !p->count) { continue; } - int tmp_flag = integer_reference_flag; - integer_reference_flag = 1; + int tmp_flag = integer_reference_flag; + integer_reference_flag = 1; joutput_stmt (cb_build_initialize (x, cb_true, NULL, def, 0)); - integer_reference_flag = tmp_flag; + integer_reference_flag = tmp_flag; } } @@ -4105,12 +4096,12 @@ joutput_internal_function (struct cb_program *prog, cb_tree parameter_list) joutput_line ("int %s_ (int entry, CobolDataStorage ...argStorages) {", prog->program_id); joutput_indent_level += 2; - joutput_line("this.entry = entry;"); + joutput_line("this.entry = entry;"); if (!prog->flag_chained) { - int k; + int k; for (k =0, l = parameter_list; l; l = CB_CHAIN (l), ++k) { - joutput_line("this.%s%d = %d < argStorages.length ? argStorages[%d] : null;", - CB_PREFIX_BASE, cb_field (CB_VALUE (l))->id, k, k); + joutput_line("this.%s%d = %d < argStorages.length ? argStorages[%d] : null;", + CB_PREFIX_BASE, cb_field (CB_VALUE (l))->id, k, k); parmnum++; } } @@ -4347,7 +4338,7 @@ joutput_internal_function (struct cb_program *prog, cb_tree parameter_list) //} joutput_line("/* Initialize frame stack */"); - joutput_line("this.frameIndex = 0;"); + joutput_line("this.frameIndex = 0;"); joutput_line("this.frameStack = new CobolFrame[255];"); joutput_line("for(int i=0; iworking_storage); @@ -4428,11 +4419,11 @@ joutput_internal_function (struct cb_program *prog, cb_tree parameter_list) CB_FILE (CB_VALUE (l))->record_max); } } - joutput_initial_values (prog->working_storage); + joutput_initial_values (prog->working_storage); if (has_external) { - joutput_line ("/* init_extern */"); - joutput_line ("LABEL_%d();", L_initextern_addr); + joutput_line ("/* init_extern */"); + joutput_line ("LABEL_%d();", L_initextern_addr); } if (prog->file_list) { joutput_newline (); @@ -4634,7 +4625,7 @@ joutput_internal_function (struct cb_program *prog, cb_tree parameter_list) joutput_newline (); } else { l = prog->entry_list; - joutput_line ("entryFunc(%d);", CB_LABEL (CB_PURPOSE (l))->id); + joutput_line ("entryFunc(%d);", CB_LABEL (CB_PURPOSE (l))->id); joutput_newline (); } @@ -4780,7 +4771,7 @@ joutput_internal_function (struct cb_program *prog, cb_tree parameter_list) joutput_newline (); joutput_line ("/* EXTERNAL data initialization */"); //joutput_line ("L_initextern: ;"); - joutput_buffered = 1; + joutput_buffered = 1; joutput_next_buffer(L_initextern_addr); for (k = field_cache; k; k = k->next) { if (k->f->flag_item_external) { @@ -4790,7 +4781,7 @@ joutput_internal_function (struct cb_program *prog, cb_tree parameter_list) joutput (");\n"); } } - joutput_buffered = 0; + joutput_buffered = 0; //joutput_line ("\tgoto LRET_initextern;/*1*/"); } @@ -4977,11 +4968,11 @@ void joutput_init_method(struct cb_program *prog) { if (!k->f->flag_local && !k->f->flag_item_external) { joutput_field (k->x); } else { - joutput ("CobolFieldFactory.makeCobolField("); - joutput_size (k->x); - joutput (", (CobolDataStorage)null, "); - joutput_attr (k->x); - joutput (")"); + joutput ("CobolFieldFactory.makeCobolField("); + joutput_size (k->x); + joutput (", (CobolDataStorage)null, "); + joutput_attr (k->x); + joutput (")"); } joutput (";\t/* %s */\n", k->f->name); } @@ -5013,11 +5004,11 @@ void joutput_init_method(struct cb_program *prog) { } - if(gen_native) { - int index = lookup_attr (COB_TYPE_ALPHANUMERIC, 0, 0, 0, NULL, 0); - joutput_line("f_native = CobolFieldFactory.makeCobolField(256, new CobolDataStorage(cob_native), %s%d);\n", - CB_PREFIX_ATTR, index); - } + if(gen_native) { + int index = lookup_attr (COB_TYPE_ALPHANUMERIC, 0, 0, 0, NULL, 0); + joutput_line("f_native = CobolFieldFactory.makeCobolField(256, new CobolDataStorage(cob_native), %s%d);\n", + CB_PREFIX_ATTR, index); + } joutput_indent_level -= 2; joutput_line("} catch(Exception e) {"); @@ -5318,8 +5309,8 @@ void joutput_declare_member_variables(struct cb_program *prog, cb_tree parameter joutput_line("/* Call parameters */"); for (l = parameter_list; l; l = CB_CHAIN (l)) { - joutput_line("private CobolDataStorage %s%d;", - CB_PREFIX_BASE, cb_field (CB_VALUE (l))->id); + joutput_line("private CobolDataStorage %s%d;", + CB_PREFIX_BASE, cb_field (CB_VALUE (l))->id); } /* External items */ @@ -5707,7 +5698,7 @@ codegen (struct cb_program *prog, const int nested, char** program_id_list) joutput_line ("CobolDecimal.cobInitNumeric();"); joutput_line ("new %s().%s_(0);", prog->program_id, prog->program_id); - joutput_line ("CobolStopRunException.stopRun();"); + joutput_line ("CobolStopRunException.stopRun();"); joutput_indent_level -= 2; joutput_line ("}\n"); @@ -5801,10 +5792,10 @@ codegen (struct cb_program *prog, const int nested, char** program_id_list) /* Skip to next nested program */ if (prog->next_program) { - joutput_indent_level -= 2; - joutput_line("}"); - fclose(joutput_target); - ++program_id_list; + joutput_indent_level -= 2; + joutput_line("}"); + fclose(joutput_target); + ++program_id_list; codegen (prog->next_program, 1, program_id_list); return; } @@ -5813,7 +5804,7 @@ codegen (struct cb_program *prog, const int nested, char** program_id_list) if (gen_ebcdic) { joutput_indent ("\n/* ASCII to EBCDIC translate table (restricted) */\n"); joutput_indent ("private static final byte[] cob_a2e = {\n"); - joutput_indent_level += 2; + joutput_indent_level += 2; if (alt_ebcdic) { joutput_indent ("(byte)0x00, (byte)0x01, (byte)0x02, (byte)0x03, (byte)0x37, (byte)0x2D, (byte)0x2E, (byte)0x2F,"); joutput_indent ("(byte)0x16, (byte)0x05, (byte)0x25, (byte)0x0B, (byte)0x0C, (byte)0x0D, (byte)0x0E, (byte)0x0F,"); @@ -5883,14 +5874,14 @@ codegen (struct cb_program *prog, const int nested, char** program_id_list) joutput_indent ("(byte)0xF8, (byte)0xF9, (byte)0xFA, (byte)0xFB, (byte)0xFC, (byte)0xFD, (byte)0xFE, (byte)0xFF"); } - joutput_indent_level -= 2; + joutput_indent_level -= 2; joutput_indent ("};\n"); joutput ("\n"); } if (gen_full_ebcdic) { joutput_indent ("\n/* ASCII to EBCDIC table */\n"); joutput_indent ("private static final byte[] cob_ebcdic = {"); - joutput_indent_level += 2; + joutput_indent_level += 2; joutput_indent ("(byte)0x00, (byte)0x01, (byte)0x02, (byte)0x03, (byte)0x37, (byte)0x2D, (byte)0x2E, (byte)0x2F,"); joutput_indent ("(byte)0x16, (byte)0x05, (byte)0x25, (byte)0x0B, (byte)0x0C, (byte)0x0D, (byte)0x0E, (byte)0x0F,"); joutput_indent ("(byte)0x10, (byte)0x11, (byte)0x12, (byte)0x13, (byte)0x3C, (byte)0x3D, (byte)0x32, (byte)0x26,"); @@ -6018,11 +6009,11 @@ codegen (struct cb_program *prog, const int nested, char** program_id_list) joutput_indent ("(byte)240, (byte)241, (byte)242, (byte)243, (byte)244, (byte)245, (byte)246, (byte)247,"); joutput_indent ("(byte)248, (byte)249, (byte)250, (byte)251, (byte)252, (byte)253, (byte)254, (byte)255"); - joutput_indent_level -= 2; + joutput_indent_level -= 2; joutput_indent ("};\n"); //i = lookup_attr (COB_TYPE_ALPHANUMERIC, 0, 0, 0, NULL, 0); - //joutput(" "); + //joutput(" "); //joutput // ("private static AbstractCobolField f_native = CobolFieldFactory.makeField(256, new CobolDataStorage(cob_native), %s%d);\n", // CB_PREFIX_ATTR, i); diff --git a/cobc/typeck.c b/cobc/typeck.c index 63223cfa..6382229c 100644 --- a/cobc/typeck.c +++ b/cobc/typeck.c @@ -143,7 +143,7 @@ static const char *const bin_compare_funcs[] = { "cmpSwpU56Binary", "cmpSwpU64Binary", "cmpS8Binary", - "cmpSwpS16Binary", + "cmpSwpS16Binary", "cmpSwpS24Binary", "cmpSwpS32Binary", "cmpSwpS40Binary", @@ -178,7 +178,7 @@ static const char *const bin_add_funcs[] = { "addSwpU56Binary", "addSwpU64Binary", "addS8Binary", - "addSwpS16Binary", + "addSwpS16Binary", "addSwpS24Binary", "addSwpS32Binary", "addSwpS40Binary", From 472347400eade070d51b0f81d928ad2b01be845c Mon Sep 17 00:00:00 2001 From: Yutaro Sakamoto Date: Sat, 31 Jul 2021 17:35:01 +0000 Subject: [PATCH 6/8] =?UTF-8?q?README=E3=82=92=E6=9B=B4=E6=96=B0=E3=81=97?= =?UTF-8?q?=E3=81=9F.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 6 ++---- README_JP.md | 8 +++----- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 2458f28a..d536f439 100644 --- a/README.md +++ b/README.md @@ -6,8 +6,6 @@ This compiler is deeply inspired by ["opensource COBOL"](https://github.com/opensourcecobol/opensource-cobol) which translates COBOL programs to C programs. (In fact, this repository contains a lot of source files of ["opensource COBOL"](https://github.com/opensourcecobol/opensource-cobol)) -**NOTE**: This package is the Developers Edition. - ## Requirements and Installation See [Installation page](https://github.com/opensourcecobol/opensourcecobol4j/wiki/Installation). @@ -28,7 +26,7 @@ java [PROGRAM-ID] ## The progress of the development The functions in the following "implemented" list are tested using [NIST COBOL85 test suite](https://www.itl.nist.gov/div897/ctg/cobol_form.htm) -and **96%** of the test cases are passed. +and **99%** of the test cases are passed. Implemented. @@ -48,4 +46,4 @@ Not Implemented. Known bugs * Cannot call inline programs. -* Rewrite wrong data to indexed files with alternate keys in some cases. +* Read wrong data from indexed files with alternate duplicate keys in some cases. diff --git a/README_JP.md b/README_JP.md index 16971a86..9bfafb0e 100644 --- a/README_JP.md +++ b/README_JP.md @@ -1,12 +1,10 @@ # opensource COBOL 4j -gEnglish version README](https://github.com/opensourcecobol/opensourcecobol4j/blob/develop/README.md) +[English version README](https://github.com/opensourcecobol/opensourcecobol4j/blob/develop/README.md) opensource COBOL 4jはCOBOLソースコードをJavaソースコードに変換するCOBOLコンパイラです. opensource COBOL 4jはCOBOLからCに変換するCOBOLコンパイラ["opensource COBOL"](https://github.com/opensourcecobol/opensource-cobol)をもとに開発されています. -**注意**: 現在は開発者バージョンです - ## インストール [インストールページ](https://github.com/opensourcecobol/opensourcecobol4j/wiki/Installation_JP)をご覧ください. @@ -26,7 +24,7 @@ java [PROGRAM-ID] ## The progress of the development -下記の実装済みリストにある機能は[NIST COBOL85 test suite](https://www.itl.nist.gov/div897/ctg/cobol_form.htm)でテストされており,**96%** のテストケースをパスしています. +下記の実装済みリストにある機能は[NIST COBOL85 test suite](https://www.itl.nist.gov/div897/ctg/cobol_form.htm)でテストされており,**969** のテストケースをパスしています. 実装済み @@ -46,4 +44,4 @@ java [PROGRAM-ID] 既知の不具合 * 同一ソースコード内の別プログラムのCALLができない. -* ALTERNATE KEYが指定されたINDEXEDファイルに対するREWRITE文の不具合. +* DUPLICATE指定されたALTERNATE KEY付きのINDEXEDファイルに対するREAD文の不具合. From 349429f2ca1e26dad92eda62234419e44b26a2cb Mon Sep 17 00:00:00 2001 From: Yutaro Sakamoto Date: Sat, 31 Jul 2021 18:54:19 +0000 Subject: [PATCH 7/8] =?UTF-8?q?compile=5Flibcobj.sh=E3=82=92=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E3=81=97=E3=81=9F.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- compile_libcobj.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/compile_libcobj.sh b/compile_libcobj.sh index 33710088..46438f73 100644 --- a/compile_libcobj.sh +++ b/compile_libcobj.sh @@ -3,6 +3,7 @@ BASE_DIR=$(pwd) javac -encoding UTF-8 \ + -classpath $1 \ ${BASE_DIR}/libcobj/src/jp/osscons/opensourcecobol/libcobj/*.java \ ${BASE_DIR}/libcobj/src/jp/osscons/opensourcecobol/libcobj/data/*.java \ ${BASE_DIR}/libcobj/src/jp/osscons/opensourcecobol/libcobj/common/*.java \ From 829588cfcce86669e6c99cd818504b0d6fc893c2 Mon Sep 17 00:00:00 2001 From: Yutaro Sakamoto Date: Thu, 26 Aug 2021 02:01:28 +0000 Subject: [PATCH 8/8] =?UTF-8?q?CALL=E5=91=BC=E3=81=B3=E5=87=BA=E3=81=97?= =?UTF-8?q?=E3=81=AE=E5=BC=95=E6=95=B0=E3=81=AE=E5=A4=89=E6=8F=9B=E5=87=A6?= =?UTF-8?q?=E7=90=86=E3=82=92=E8=BF=BD=E5=8A=A0=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cobc/codegen.c | 4 ++-- .../libcobj/data/CobolDataStorage.java | 11 +++++++++++ tests/i18n_sjis.at | 16 ++++++++-------- 3 files changed, 21 insertions(+), 10 deletions(-) diff --git a/cobc/codegen.c b/cobc/codegen.c index 7caa8fb0..992aeb1d 100644 --- a/cobc/codegen.c +++ b/cobc/codegen.c @@ -2739,9 +2739,9 @@ joutput_call (struct cb_call *p) break; case CB_TAG_LITERAL: if (CB_TREE_CLASS (x) == CB_CLASS_NUMERIC) { - joutput ("%d", cb_get_int (x)); + joutput ("CobolDataStorage.primitiveToDataStorage(%d)", cb_get_int (x)); } else { - joutput ("%d", CB_LITERAL (x)->data[0]); + joutput ("CobolDataStroage.primitiveToDataStorage(%d)", CB_LITERAL (x)->data[0]); } break; default: diff --git a/libcobj/src/jp/osscons/opensourcecobol/libcobj/data/CobolDataStorage.java b/libcobj/src/jp/osscons/opensourcecobol/libcobj/data/CobolDataStorage.java index 32f48c2c..24418749 100644 --- a/libcobj/src/jp/osscons/opensourcecobol/libcobj/data/CobolDataStorage.java +++ b/libcobj/src/jp/osscons/opensourcecobol/libcobj/data/CobolDataStorage.java @@ -89,6 +89,17 @@ public ByteBuffer getByteBuffer(int size) { public void addIndex(int n) { this.index += n; } + + static public CobolDataStorage primitiveToDataStorage(int n) { + byte[] bytes = new byte[4]; + ByteBuffer buffer = ByteBuffer.wrap(bytes); + buffer.putInt(n); + return new CobolDataStorage(bytes); + } + + static public CobolDataStorage primitiveToDataStorage(String s) { + return new CobolDataStorage(s); + } /** * コンストラクタ.文字列からバイト配列を構成する. diff --git a/tests/i18n_sjis.at b/tests/i18n_sjis.at index a2025d68..380e8c41 100644 --- a/tests/i18n_sjis.at +++ b/tests/i18n_sjis.at @@ -22,11 +22,11 @@ AT_INIT([I18n Shift_JIS Tests]) AT_TESTED([cobc]) -#m4_include([user-defined-word.at]) -m4_include([pic-x.at]) -m4_include([pic-n.at]) -#m4_include([program-id.at]) -#m4_include([error-print.at]) -#m4_include([limits.at]) -m4_include([national.at]) -#m4_include([mb-space.at]) +m4_include([user-defined-word.at]) +#m4_include([pic-x.at]) +#m4_include([pic-n.at]) +m4_include([program-id.at]) +m4_include([error-print.at]) +m4_include([limits.at]) +#m4_include([national.at]) +m4_include([mb-space.at])