Files
gcc-reflection/Makefile.tpl
Jose E. Marchesi 2515b13700 a68: support for Algol 68 code in libga68 and initial transput
Most of the standard prelude is implemented in a combination of code
lowered by the front-end (standard operators, contants, etc) and
functions provided by the libga68 run-time library, to which the
former libcalls.  Until now, all the support routines in libga68 were
written in C.  However, many of the transput facilities are better
implemented in Algol 68.

The Revised Report includes a reference implementation (code listing)
of many of the standard routines.  This implementation, however, makes
use of an "extended" program notation in order to denote certain
notions to avoid repetitive code.  Therefore this commit includes
sppp, a build-time pre-processor written in awk that is only intended
to be used internally by the libga68 run-time library.  This
preprocessor allows us to write code like:

    proc subwhole = (Number v, int width) string:
       case v in
          {iter L {short short} {short} {} {long}    {long long}}
          {iter S {LENG LENG}   {LENG}  {} {SHORTEN} {SHORTEN SHORTEN}}
          ({L} int x):
             begin string s, {L} int n := x;
                   while dig_char ({S} (n MOD {L} 10)) +=: s;
                         n %:= {L} 10; n /= {L} 0
                   do ~ od;
                   (UPB s > width | width * errorchar | s)
             end
          {reti {,}}
       esac;

Resulting in cases for short short int, short int, int, long int and
long long int being macro-expanded in the routine's conformance
clause.

This commit also adds the necessary infrastructure for writing Algol
68 code in the libga68 library, including the ability of having
modules exported by libga68.  An implementation of some of the
transput routines is also provided in standard.a68: whole, fixed,
float, string_to_L_real, char_in_string, L_int_width, L_real_width and
L_exp_with.

The build system changes include the backport of the Automake Algol 68
support, which is in a released version of Automake but not in the
version used for GCC, to libga68/m4/autoconf.m4.

Signed-off-by: Jose E. Marchesi <jemarch@gnu.org>

ChangeLog

	* Makefile.def (flags_to_pass): Rename GA68, GA68FLAGS,
	GA68_FOR_TARGET, GA68FLAGS_FOR_TARGET to A68, A68FLAGS,
	A68_FOR_TARGET and A68FLAGS_FOR_TARGET.
	* Makefile.tpl: Use A68, A68FLAGS, A68_FOR_BUILD and
	A68_FOR_TARGET rather than GA68, GA68FLAGS, GA68_FOR_BUILD and
	GA68_FOR_TARGET.
	* Makefile.in: Regenerate.
	* configure.ac: Set A68_FOR_BUILD rather than GA68_FOR_BUILD, and
	invoke ACX_PROG_A68 rather than ACX_PROG_GA68.
	Subst A68_FOR_BUILD rather than GA68_FOR_BUILD.
	Subst A68 and A68FLAGS rather than GA68 and GA68FLAGS.
	Set A68_FOR_TARGET rather than GA68_FOR_TARGET.
	* configure: Regenerate.
	* config-ml.in: Handle A68FLAGS and define A68 in sub-configures.

config/ChangeLog

	* acx.m4: Define ACX_PROG_A68 rather than ACX_PROG_GA68.
	(ACX_PROG_A68): Set A68 rather than GA68.

gcc/algol68/ChangeLog

	* a68-lang.cc (a68_init_options): Add an entry to A68_MODULE_FILES
	to map module Transput to the basename ga68.

gcc/testsuite/ChangeLog

	* algol68/execute/char-in-string-1.a68: New test.

libga68/ChangeLog

	* m4/autoconf.m4: New file.
	* configure.ac: Expand AC_PROG_A68.
	* configure: Regenerate.
	* Makefile.am: Add rules to build Algol 68 sources and to
	build the transput module.
	* Makefile.in: Regenerate.
	* acinclude.m4: Include m4/autoconf.m4.
	* sppp.awk: New file.
	* transput.a68.in: Likewise.
2025-12-30 22:45:51 +01:00

79 KiB