Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
22febeb
Added funcDateToYyyymmdd and funcDayToYyyyddd in CobolIntrinsic.java …
kio-watanabe Aug 31, 2023
879d078
Added FUNCTION EXCEPTION-FILE and FUNCTION EXCEPTION-FILE.
Sep 4, 2023
7afa9fb
Fixed format
Sep 4, 2023
d4ddd2f
Fixed CobolFile.java
Sep 4, 2023
4cbcf6a
Fixed format
Sep 4, 2023
4f406f6
Fixed variable definitions.
Sep 4, 2023
8fc0911
Formatted.
Sep 4, 2023
b9509d7
Fixed CobolFile.java
Sep 4, 2023
4ae91c9
Fixed variable declaration.
Sep 5, 2023
9050b49
Formatted
Sep 5, 2023
49aa7ae
Fixed CobolFile.java
Sep 5, 2023
6c35232
Fixed variable definition.
Sep 5, 2023
c238e73
Added FUNCTION EXCEPTION-FILE and FUNCTION EXCEPTION-FILE.
Sep 5, 2023
c1eb164
Minor corrections were made.
Sep 6, 2023
c684ecb
Revert "Added FUNCTION EXCEPTION-FILE and FUNCTION EXCEPTION-FILE."
Sep 6, 2023
2591f50
Minor corrections were made.
Sep 6, 2023
366c677
Minor corrections were made.
Sep 7, 2023
921c770
Add EXCEPTION-FILE and EXCEPTION-LOCATION (#218)
kio-watanabe Sep 8, 2023
187cd74
Add FUNCTION EXCEPTION-STATEMENT and FUNCTION EXCEPTION-STATUS
Sep 13, 2023
9a063e3
Fix CobolResolve.java
Sep 13, 2023
adff64b
Merge branch 'develop' into test-functions7
kio-watanabe Sep 13, 2023
6a14aa6
Update CobolRuntimeException.java
kio-watanabe Sep 13, 2023
f38dd61
Minor corrections were made.
Sep 14, 2023
dd314ed
update: improve CobolIntrinsic.java and fix the formating scirpt
yutaro-sakamoto Sep 20, 2023
1c8557c
Merge branch 'kio-watanabe-test-functions7' into develop
yutaro-sakamoto Sep 20, 2023
5161b59
Implement `FD IS EXTERNAL` for sequential files (#222)
yutaro-sakamoto Sep 23, 2023
8d90965
[Add]: Implement `-Wredefinition` option and a test for it (#223)
yutaro-sakamoto Sep 24, 2023
8b06340
Fixed compile error (#225)
n-isaka Sep 28, 2023
d193cb3
Add FUNCTION FRACTION-PART and fix about double value (#224)
kio-watanabe Sep 28, 2023
df1a408
V1.0.15 (#226)
yutaro-sakamoto Sep 29, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,19 @@
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
## [1.0.15] - 2023-09-29
### Added
- Add new intrinsic functions
- EXCEPTION-FILE (#218)
- EXCEPTION-LOCATION (218)
- EXCEPTION-STATEMENT (#221)
- EXCEPTION-STATUS (#221)
- FRACTION-PART (#224)
- Add `-Wredefinition` option (#223)
- Implement `FD` with `EXTERNAL` clause (#222)
- Add a guideline for contributing (#226)
### Fixed
- Fix a build error on some platforms (#225)

## [1.0.14] - 2023-08-31
### Added
Expand Down
51 changes: 51 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
Thank you for your interest in contributing to opensource COBOL 4J.
A summary of how to contribute is below.

# Issues

Although any topics related to opensource COBOL 4J can be posted in [Issues](https://github.com/opensourcecobol/opensourcecobol4j/issues), please submit ones written in English or Japanese.

# Pull Requests

We will check pull requests that passed all CI checks running both tests and static code analysis.
The static analysis checks whether C and Java source files are formatted using [clang-format](https://clang.llvm.org/docs/ClangFormat.html) and [google-java-format](https://github.com/google/google-java-format) respectively, and whether [PMD](https://pmd.github.io/) finds no error and warning in Java source files.

The below sections describe how to setup and run static code analysis.

## Setup static analysis tools

### clang-format

Run `sudo apt install clang-format` in Ubuntu to install `clang-format`.

### google-java-format

Run the following command to download `google-java-format`:
```sh
curl -L -o google-java-format.jar https://github.com/google/google-java-format/releases/download/v1.15.0/google-java-format-1.15.0-all-deps.jar
```
Then set the environment variable `PATH_GOOGLE_JAVA_FORMAT` to the file path of the jar file.

### PMD

Run the following commands to install `PMD`:
```sh
curl -L -o pmd-bin-6.52.0.zip https://github.com/pmd/pmd/releases/download/pmd_releases%2F6.52.0/pmd-bin-6.52.0.zip
unzip pmd-bin-6.52.0.zip
mv pmd-bin-6.52 /usr/local/bin/
rm pmd-bin-6.52.0.zip
```

## Run static analysis

### clang-format and google-java-format

Run `./format` in the top directory of opensource COBOL 4J.
If you want to make sure all files are formatted, run `./check-format` in the top directory of opensource COBOL 4J.

### PMD

Run the following command in the top directory of opensource COBOL 4J:
```
/usr/local/bin/pmd-bin-6.52.0/bin/run.sh -d libcobj/src -R .github/ruleset.xml -f text
```
51 changes: 51 additions & 0 deletions CONTRIBUTING_JP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
opensource COBOL 4Jへのコントリビュートを検討頂きありがとうございます。
下記にコントリビュートの手順を示します。

# Issues

opensource COBOL 4Jに関するトピックを投稿してください。ただし、英語か日本語での記載をお願いします。

# Pull Requests
CIはテストとコードの静的解析を実行します。
CIの静的解析はCとJavaのソースコードがそれぞれ[clang-format](https://clang.llvm.org/docs/ClangFormat.html) and [google-java-format](https://github.com/google/google-java-format)で整形されているか、
[PMD](https://pmd.github.io/)によるJavaソースコードの静的解析でエラーや警告が表示されないかをチェックします。

下記にそれぞれのツールのセットアップと使用方法を説明します。

## セットアップ

### clang-format

Ubuntuでは`sudo apt install clang-format`コマンドを実行すれば`clang-format`をインストールできます。

### google-java-format

下記のコマンドを実行して`google-java-format`をダウンロードしてください。
```sh
curl -L -o google-java-format.jar https://github.com/google/google-java-format/releases/download/v1.15.0/google-java-format-1.15.0-all-deps.jar
```
さらに環境変数`PATH_GOOGLE_JAVA_FORMAT`に上記のjarファイルのファイルパスを設定してください。

### PMD

下記のコマンドを実行して`PMD`をインストールしてください。
```sh
curl -L -o pmd-bin-6.52.0.zip https://github.com/pmd/pmd/releases/download/pmd_releases%2F6.52.0/pmd-bin-6.52.0.zip
unzip pmd-bin-6.52.0.zip
mv pmd-bin-6.52 /usr/local/bin/
rm pmd-bin-6.52.0.zip
```

## 静的解析の実行

### clang-formatとgoogle-java-format

opensource COBOL 4Jのトップディレクトリで`./format`を実行してください。
`./check-format`を実行することで、フォーマットが完了したかを確認できます。

### PMD

opensource COBOL 4Jのトップディレクトリで下記のコマンドを実行してください。
```
/usr/local/bin/pmd-bin-6.52.0/bin/run.sh -d libcobj/src -R .github/ruleset.xml -f text
```
4 changes: 4 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2023-09-29 OSS Consortium <ws-opensource-cobol-contact@osscons.jp>

* opensource COBOL 4J v1.0.15 released.

2023-08-31 OSS Consortium <ws-opensource-cobol-contact@osscons.jp>

* opensource COBOL 4J v1.0.14 released.
Expand Down
20 changes: 20 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,26 @@ NEWS - user visible changes -*- outline -*-

-----------------------------------------------------------------------

* opensource COBOL 4J 1.0.15

** New Features
(1) Add new intrinsic functions
(a) EXCEPTION-FILE
(b) EXCEPTION-LOCATION
(c) EXCEPTION-STATEMENT
(d) EXCEPTION-STATUS
(e) FRACTION-PART
(2) Add -Wredefinition option
(3) Implement FD with EXTERNAL clause

** Bug fixes
(1) Fix a build error on some platforms

** Miscellaneous
(1) Add a guidelines for contributing

-----------------------------------------------------------------------

* opensource COBOL 4J 1.0.14

** New Features
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ rw 4 0 4 0 0 0 0 0 0 REPORT
total 21 0 21 0 0 0 0 0 0
```

# Contributors
# Contributing

See https://github.com/opensourcecobol/opensourcecobol4j/graphs/contributors
Guidelines for contributing to opensource COBOL 4J can be found in [CONTRIBUTING.md](./CONTRIBUTING.md).
Contributors are listed in https://github.com/opensourcecobol/opensourcecobol4j/graphs/contributors
5 changes: 3 additions & 2 deletions README_JP.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ rw 4 0 4 0 0 0 0 0 0 REPORT
total 21 0 21 0 0 0 0 0 0
```

# コントリビュータ
# コントリビューㇳ

https://github.com/opensourcecobol/opensourcecobol4j/graphs/contributors を参照してください.
コントリビュータの一覧は https://github.com/opensourcecobol/opensourcecobol4j/graphs/contributors に掲載されています。
コントリビュータ向けのガイドラインは[CONTRIBUTING_JP.md](./CONTRIBUTING_JP.md)を参照してください。
42 changes: 18 additions & 24 deletions cobj/codegen.c
Original file line number Diff line number Diff line change
Expand Up @@ -1408,6 +1408,7 @@ static void joutput_param(cb_tree x, int id) {
struct cb_alphabet_name *abp;
struct cb_alphabet_name *rbp;
cb_tree l;
struct literal_list *ll;
int n;
int extrefs;
int sav_stack_id;
Expand Down Expand Up @@ -1490,8 +1491,8 @@ static void joutput_param(cb_tree x, int id) {
joutput("%s%s", CB_PREFIX_FILE, CB_FILE(x)->cname);
break;
case CB_TAG_LITERAL:
struct literal_list *l = lookup_literal(x);
joutput_const_identifier(l);
ll = lookup_literal(x);
joutput_const_identifier(ll);
break;
case CB_TAG_FIELD:
/* TODO: remove me */
Expand Down Expand Up @@ -4012,13 +4013,20 @@ static void joutput_file_initialization(struct cb_file *f) {
joutput_line (" byte_%s%s[i] = '0;'");
joutput_line ("}");
}*/
if (f->external) {
joutput_line("%s%s = CobolFile.getExternalFile(\"%s\");", CB_PREFIX_FILE,
f->cname, f->cname);
joutput_line("if(%s%s == null) {", CB_PREFIX_FILE, f->cname);
joutput_indent_level += 2;
}

joutput_line("%s%s = CobolFileFactory.makeCobolFileInstance(", CB_PREFIX_FILE,
f->cname);
joutput_line("/* select_name = */ \"%s\",", f->name);
if (f->external && !f->file_status) {
joutput_line("/* file_status = */ cob_external_addr (\"%s%s_status\", 4),",
CB_PREFIX_FILE, f->cname);
joutput_line("/* file_status = */ CobolFile.getExternalFileStatus "
"(\"%s\"),",
f->cname);
} else {
joutput_line("/* file_status = */ %s%s_status,", CB_PREFIX_FILE, f->cname);
}
Expand Down Expand Up @@ -4076,26 +4084,15 @@ static void joutput_file_initialization(struct cb_file *f) {
joutput_line(");");

if (f->external) {
// joutput_line ("%s%s = CobolExternal.getFileAddress (\"%s\");",
// CB_PREFIX_FILE, f->cname, f->cname);
joutput_line("if (CobolExternal.initialExternal)");
joutput_indent("{");
if (f->linage) {
joutput_line("%s%s.setLinorkeyptr(new Linage());", CB_PREFIX_FILE,
f->cname);
}
} else {
// joutput_line ("if (%s%s == null)", CB_PREFIX_FILE, f->cname);
// joutput_indent ("{");
// joutput_line ("%s%s = new CobolFile();", CB_PREFIX_FILE, f->cname);
if (f->linage) {
joutput_line("%s%s.setLinorkeyptr(new Linage());", CB_PREFIX_FILE,
f->cname);
}
// joutput_indent ("}");
joutput_line("CobolFile.putExternalFile(\"%s\", %s%s);", f->cname,
CB_PREFIX_FILE, f->cname);
joutput_indent_level -= 2;
joutput_line("}");
}

if (f->linage) {
joutput_line("%s%s.setLinorkeyptr(new Linage());", CB_PREFIX_FILE,
f->cname);
joutput_line("lingptr = (Linage)(%s%s.getLinorkeyptr());", CB_PREFIX_FILE,
f->cname);
joutput_prefix();
Expand Down Expand Up @@ -4135,9 +4132,6 @@ static void joutput_file_initialization(struct cb_file *f) {
joutput_line("lingptr.setLinTop(0);");
joutput_line("lingptr.setLinBot(0);");
}
if (f->external) {
joutput_indent("}");
}
}

/*
Expand Down
3 changes: 3 additions & 0 deletions cobj/warning-help.def
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@

/* CB_WARNDEF (var, name, wall, doc) */

CB_WARNDEF (cb_warn_redefinition, "redefinition", 1,
N_("Warn incompatible redefinition of data items"))

CB_WARNDEF (cb_warn_parentheses, "parentheses", 1,
N_("Warn lack of parentheses around AND within OR"))

Expand Down
26 changes: 13 additions & 13 deletions configure
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.71 for opensource COBOL 4J 1.0.14.
# Generated by GNU Autoconf 2.71 for opensource COBOL 4J 1.0.15.
#
# Report bugs to <ws-opensource-cobol-contact@osscons.jp>.
#
Expand Down Expand Up @@ -620,9 +620,9 @@ MAKEFLAGS=

# Identity of this package.
PACKAGE_NAME='opensource COBOL 4J'
PACKAGE_TARNAME='opensource-cobol-4j-1.0.14'
PACKAGE_VERSION='1.0.14'
PACKAGE_STRING='opensource COBOL 4J 1.0.14'
PACKAGE_TARNAME='opensource-cobol-4j-1.0.15'
PACKAGE_VERSION='1.0.15'
PACKAGE_STRING='opensource COBOL 4J 1.0.15'
PACKAGE_BUGREPORT='ws-opensource-cobol-contact@osscons.jp'
PACKAGE_URL=''

Expand Down Expand Up @@ -1414,7 +1414,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures opensource COBOL 4J 1.0.14 to adapt to many kinds of systems.
\`configure' configures opensource COBOL 4J 1.0.15 to adapt to many kinds of systems.

Usage: $0 [OPTION]... [VAR=VALUE]...

Expand Down Expand Up @@ -1464,7 +1464,7 @@ Fine tuning of the installation directories:
--localedir=DIR locale-dependent data [DATAROOTDIR/locale]
--mandir=DIR man documentation [DATAROOTDIR/man]
--docdir=DIR documentation root
[DATAROOTDIR/doc/opensource-cobol-4j-1.0.14]
[DATAROOTDIR/doc/opensource-cobol-4j-1.0.15]
--htmldir=DIR html documentation [DOCDIR]
--dvidir=DIR dvi documentation [DOCDIR]
--pdfdir=DIR pdf documentation [DOCDIR]
Expand All @@ -1486,7 +1486,7 @@ fi

if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of opensource COBOL 4J 1.0.14:";;
short | recursive ) echo "Configuration of opensource COBOL 4J 1.0.15:";;
esac
cat <<\_ACEOF

Expand Down Expand Up @@ -1617,7 +1617,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
opensource COBOL 4J configure 1.0.14
opensource COBOL 4J configure 1.0.15
generated by GNU Autoconf 2.71

Copyright (C) 2021 Free Software Foundation, Inc.
Expand Down Expand Up @@ -2105,7 +2105,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by opensource COBOL 4J $as_me 1.0.14, which was
It was created by opensource COBOL 4J $as_me 1.0.15, which was
generated by GNU Autoconf 2.71. Invocation command line was

$ $0$ac_configure_args_raw
Expand Down Expand Up @@ -3403,8 +3403,8 @@ fi


# Define the identity of the package.
PACKAGE='opensource-cobol-4j-1.0.14'
VERSION='1.0.14'
PACKAGE='opensource-cobol-4j-1.0.15'
VERSION='1.0.15'


printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h
Expand Down Expand Up @@ -25367,7 +25367,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by opensource COBOL 4J $as_me 1.0.14, which was
This file was extended by opensource COBOL 4J $as_me 1.0.15, which was
generated by GNU Autoconf 2.71. Invocation command line was

CONFIG_FILES = $CONFIG_FILES
Expand Down Expand Up @@ -25435,7 +25435,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config='$ac_cs_config_escaped'
ac_cs_version="\\
opensource COBOL 4J config.status 1.0.14
opensource COBOL 4J config.status 1.0.15
configured by $0, generated by GNU Autoconf 2.71,
with options \\"\$ac_cs_config\\"

Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

AC_PREREQ(2.59)

AC_INIT([opensource COBOL 4J],[1.0.14],[ws-opensource-cobol-contact@osscons.jp],[opensource-cobol-4j-1.0.14])
AC_INIT([opensource COBOL 4J],[1.0.15],[ws-opensource-cobol-contact@osscons.jp],[opensource-cobol-4j-1.0.15])
AC_CONFIG_SRCDIR([libcobj.h])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_TESTDIR([tests])
Expand Down
2 changes: 1 addition & 1 deletion format
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash
cd libcobj && ./format
cd cobj && ./format
cd ../cobj && ./format
Loading