gcc/libgcobol
Robert Dubner 85750fb8c2 cobol: Implement ENTRY statement; finish removing ascii/ebcdic dichotomy.
The prior set of changes largely eliminated the assumption that the
internal codeset was either ascii or ebcdic.  These changes remove the
last vestiges of that assumption.

These changes also implement the COBOL ENTRY statement, which allows a
program-id to have more than one externally callable entry point. Since
GCC assumes the existence of an ABI that is not, repeat *not* capable of
that, it is implemented here by creating a separate function with the
name specified by the ENTRY statement.  That function sets up global
variables which cause control to be transferred to the ENTRY point when
the parent function is called re-entrantly, and then executes that call.

gcc/cobol/ChangeLog:

	* genapi.cc (move_tree): Formatting.
	(parser_enter_file): Incorporate global __gg__entry_label.
	(enter_program_common): Remove calls to alphabet overrides.
	(parser_alphabet): Change cbl_alphabet_e handling.
	(parser_alphabet_use): Likewise.
	(initialize_the_data): Likewise.
	(establish_using): Process passed parameters in a subroutine.
	(parser_division): Remove in-line parameter processing;
	call establish_using() instead. Check for __gg__entry_label.
	(parser_file_add): Temporary workaround for charset encoding.
	(parser_file_open): Likewise.
	(create_and_call): Push/pop program state around call to external.
	(parser_entry): Implement new ENTRY statement feature.
	(mh_source_is_literalN): Formatting.
	* genapi.h (parser_entry): New ENTRY statement.
	* gengen.cc (gg_create_goto_pair): Formatting.
	(gg_goto_label_decl): Remove.
	* gengen.h (gg_goto_label_decl): Remove.
	* genutil.cc (internal_codeset_is_ebcdic): Remove.
	* genutil.h (internal_codeset_is_ebcdic): Remove.
	* symbols.cc (symbols_alphabet_set): Restrict alphabet scan to
	program.
	* symbols.h (is_elementary): Use defined constants instead of
	explicit 'A'and 'N'

libgcobol/ChangeLog:

	* charmaps.cc (__gg__set_internal_codeset): Eliminate ascii/ebcdic.
	(__gg__text_conversion_override): Remove.
	* charmaps.h (enum text_device_t):  Eliminate ascii/ebcdic.
	(enum text_codeset_t): Remove.
	(__gg__set_internal_codeset): Remove.
	(__gg__text_conversion_override): Remove.
	* gfileio.cc: Anticipate cbl_encoding_t fixes.
	* libgcobol.cc (struct program_state): Incorporate
	__gg__entry_label.
	(__gg__pop_program_state): Eliminate unused defines.
	(__gg__alphabet_use): Eliminate ascii/ebcdic dichotomy.
	* valconv.cc (__gg__alphabet_create): Likewise.
2025-10-18 20:49:21 -04:00
..
ChangeLog Daily bump. 2025-10-11 00:21:09 +00:00
LICENSE libgcobol: Add license. 2025-06-20 10:18:37 -04:00
Makefile.am cobol: Improve binary-to-string conversion. 2025-08-07 16:12:32 -04:00
Makefile.in *: regenerate autotools 2025-10-05 17:14:49 +01:00
README
acinclude.m4 libgcobol: Handle long double as an alternate IEEE754 quad [PR119244] 2025-04-15 07:55:55 +02:00
aclocal.m4 *: regenerate autotools 2025-10-05 17:14:49 +01:00
charmaps.cc cobol: Implement ENTRY statement; finish removing ascii/ebcdic dichotomy. 2025-10-18 20:49:21 -04:00
charmaps.h cobol: Implement ENTRY statement; finish removing ascii/ebcdic dichotomy. 2025-10-18 20:49:21 -04:00
common-defs.h cobol: Convert to individual variable character-set encoding. 2025-10-10 13:19:34 -04:00
config.h.in cobol: Guard clock_gettime(). [PR119975] 2025-06-05 12:30:55 -04:00
configure *: regenerate autotools 2025-10-05 17:14:49 +01:00
configure.ac cobol: Guard clock_gettime(). [PR119975] 2025-06-05 12:30:55 -04:00
configure.tgt libgcobol: mark riscv64-*-linux* as supported target 2025-04-15 16:59:03 +02:00
constants.cc cobol: Convert to individual variable character-set encoding. 2025-10-10 13:19:34 -04:00
ec.h cobol: Multiple PRs; formatting; exception processing. 2025-05-20 14:24:30 -04:00
encodings.h cobol: Convert to individual variable character-set encoding. 2025-10-10 13:19:34 -04:00
exceptl.h cobol: Rewrite exception handling. Partially refactor subscript/refmod calculations. 2025-05-04 21:38:57 -04:00
gcobolio.h cobol: Convert to individual variable character-set encoding. 2025-10-10 13:19:34 -04:00
gfileio.cc cobol: Implement ENTRY statement; finish removing ascii/ebcdic dichotomy. 2025-10-18 20:49:21 -04:00
gfileio.h cobol: Confine all __int128/_Float128 references to libgcobol. 2025-03-28 12:21:05 -04:00
gmath.cc cobol: Eliminate cppcheck warnings for libgcobol [PR119323] 2025-06-04 11:31:51 -04:00
gmath.h
intrinsic.cc cobol: Convert to individual variable character-set encoding. 2025-10-10 13:19:34 -04:00
io.cc cobol: Multiple PRs; formatting; exception processing. 2025-05-20 14:24:30 -04:00
io.h
libgcobol-fp.h libgcobol: Handle long double as an alternate IEEE754 quad [PR119244] 2025-04-15 07:55:55 +02:00
libgcobol.cc cobol: Implement ENTRY statement; finish removing ascii/ebcdic dichotomy. 2025-10-18 20:49:21 -04:00
libgcobol.h cobol: Convert to individual variable character-set encoding. 2025-10-10 13:19:34 -04:00
libgcobol.spec.in libgcobol: Allow libgcobol to use libquadmath [PR119244]. 2025-04-10 11:05:07 +01:00
stringbin.cc cobol: Convert to individual variable character-set encoding. 2025-10-10 13:19:34 -04:00
stringbin.h cobol: Convert to individual variable character-set encoding. 2025-10-10 13:19:34 -04:00
valconv.cc cobol: Implement ENTRY statement; finish removing ascii/ebcdic dichotomy. 2025-10-18 20:49:21 -04:00
valconv.h cobol: Convert to individual variable character-set encoding. 2025-10-10 13:19:34 -04:00

README

The libgcobol is intended for use entirely and solely by executables created
from COBOL source code by the GCOBOL "COBOL for GCC" front end.

libgcobol.a can be staticly linked in, but it makes for very large binaries. We
tend to use that for debugging the GCOBOL compiler, and not much else

Many of the functions in the library are called by the executable code generated
by the GCOBOL compiler through GIMPLE tags, and thus prototypes -- which are 
part of the C/C++ programming paradigm -- are not used.  Both the calling
program and the called program use the extern "C" construction so that the
linker can find the functions, and they need to agree ahead of time about the
meaning of passed parameters.