2 Commits

Author SHA1 Message Date
David Given
3f09da5045 Rename branch.
--HG--
branch : dtrg-experimental-powerpc-branch
2015-06-18 23:39:26 +02:00
David Given
33b4873932 Readjust after merge to default.
--HG--
branch : dtrg-experimental-powerpc
2013-05-09 18:15:49 +01:00
422 changed files with 6768 additions and 8535 deletions

17
.distr
View File

@@ -1,7 +1,9 @@
README
CHANGES
Copyright
Makefile
pm
pmfile
config.pm
h
modules/h
@@ -11,7 +13,7 @@ util/data
util/LLgen
modules/src/alloc
#modules/src/assert
modules/src/assert
modules/src/system
modules/src/string
modules/src/read_em
@@ -29,7 +31,7 @@ util/ack
lib/descr/fe
util/arch
#util/cpp
#util/cgg
util/cgg
util/ncgg
util/misc
util/opt
@@ -41,22 +43,15 @@ lang/cem
lang/pc
lang/m2
#lang/occam
lang/basic
#lang/basic
mach/proto
mach/i80
mach/i86
mach/i386
mach/m68020
mach/vc4
plat
plat/cpm
plat/pc86
plat/linux
plat/linux386
plat/linux68k
plat/rpi
examples
man

146
Makefile
View File

@@ -1,146 +0,0 @@
# ======================================================================= #
# ACK CONFIGURATION #
# (Edit this before building) #
# ======================================================================= #
# What platform to build for by default?
DEFAULT_PLATFORM = pc86
# Where should the ACK put its temporary files?
ACK_TEMP_DIR = /tmp
# Where is the ACK going to be installed, eventually?
PREFIX = /usr/local
# Where do you want to put the object files used when building?
BUILDDIR = $(ACK_TEMP_DIR)/ack-build
# What build flags do you want to use?
CFLAGS = -g
LDFLAGS = -s
# ======================================================================= #
# END OF CONFIGURATION #
# ======================================================================= #
#
# You shouldn't need to change anything below this point unless you are
# actually developing ACK.
OBJDIR = $(BUILDDIR)/obj
BINDIR = $(BUILDDIR)/bin
LIBDIR = $(BUILDDIR)/lib
INCDIR = $(BUILDDIR)/include
INSDIR = $(BUILDDIR)/staging
PLATIND = $(INSDIR)/share/ack
PLATDEP = $(INSDIR)/lib/ack
CC = gcc
AR = ar
RM = rm -f
CP = cp
hide = @
CFLAGS += \
-I$(INCDIR) \
-Imodules/h \
-Ih
LDFLAGS +=
ACKFLAGS = -Ih
all: installables
.DELETE_ON_ERROR:
include first/core.mk
include modules/src/object/build.mk
include modules/src/alloc/build.mk
include modules/src/input/build.mk
include modules/src/idf/build.mk
include modules/src/system/build.mk
include modules/src/string/build.mk
include modules/src/print/build.mk
include modules/src/flt_arith/build.mk
include modules/src/em_code/build.mk
include modules/src/em_mes/build.mk
include modules/src/read_em/build.mk
include util/amisc/build.mk
include util/cmisc/build.mk
include util/ack/build.mk
include util/LLgen/build.mk
include util/data/build.mk
include util/opt/build.mk
include util/ncgg/build.mk
include util/arch/build.mk
include util/misc/build.mk
include util/led/build.mk
include util/topgen/build.mk
include util/ego/build.mk
include lang/cem/build.mk
include lang/basic/build.mk
include lang/pc/build.mk
include lang/m2/build.mk
include mach/proto/as/build.mk
include mach/proto/ncg/build.mk
include mach/proto/top/build.mk
include plat/linux/liblinux/build.mk
include mach/i80/build.mk
include mach/i386/build.mk
include mach/i86/build.mk
include mach/m68020/build.mk
# include mach/powerpc/build.mk
include mach/vc4/build.mk
include plat/build.mk
include plat/pc86/build.mk
include plat/cpm/build.mk
include plat/linux386/build.mk
include plat/linux68k/build.mk
# include plat/linuxppc/build.mk
include plat/rpi/build.mk
.PHONY: installables
installables: $(INSTALLABLES)
@echo ""
@echo "Build completed successfully."
.PHONY: install
install: installables
@echo INSTALLING into $(PREFIX)
$(hide) tar cf - -C $(INSDIR) . | tar xvf - -C $(PREFIX)
.PHONY: clean
clean:
@echo CLEAN
$(hide) $(RM) $(CLEANABLES)
$(INCDIR)/local.h:
@echo LOCAL
@mkdir -p $(dir $@)
$(hide) echo '#define VERSION 3' > $@
$(hide) echo '#define ACKM "$(DEFAULT_PLATFORM)"' >> $@
$(hide) echo '#define BIGMACHINE 1' >> $@
$(hide) echo '#define SYS_5' >> $@
$(INCDIR)/em_path.h:
@echo EM_PATH
@mkdir -p $(dir $@)
$(hide) echo '#define TMP_DIR "$(ACK_TEMP_DIR)"' > $@
$(hide) echo '#define EM_DIR "$(PREFIX)"' >> $@
$(hide) echo '#define ACK_PATH "share/ack/descr"' >> $@
-include $(DEPENDS)

79
README
View File

@@ -1,8 +1,8 @@
THE AMSTERDAM COMPILER KIT V6.0pre5
THE AMSTERDAM COMPILER KIT V6.0pre4
===================================
© 1987-2005 Vrije Universiteit, Amsterdam
2013-05-15
2010-08-08
INTRODUCTION
@@ -24,63 +24,59 @@ SUPPORT
Languages:
ANSI C, Pascal, Modula 2, Basic. K&R is supported via the ANSI C compiler.
ANSI C, Pascal, Modula 2. K&R is supported via the ANSI C compiler.
Platforms:
pc86 produces bootable floppy disk images for 8086 PCs
linux386 produces ELF executables for PC Linux systems
linux68k produces ELF executables for m68020 Linux systems
cpm produces i80 CP/M .COM files
rpi produces Raspberry Pi GPU binaries
INSTALLATION
============
The version 5.0 build mechanism has been completely rewritten. Installation
ought to be fairly straightforward.
The version 6.0 build mechanism has been completely rewritten and is based
around the Prime Mover build tool (see http://primemover.sf.net for more
information). Installation ought to be fairly straightforward.
Requirements:
- an ANSI C compiler. This defaults to gcc. You can change this by setting
the CC make variable.
- flex and yacc.
- GNU make.
- about 40MB free in /tmp (or some other temporary directory).
- an ANSI C compiler. Currently, I'm afraid, it's hard-coded to use gcc.
To change, try changing the variable definitions in first/c.pm. This also
needs to be available as 'cc' from the shell.
- about 20MB free in /tmp (or some other temporary directory).
- about 6MB in the target directory.
Instructions:
- edit the Makefile. There's a small section at the top where you can change
the configuration. Probably the only one you may want to edit is PREFIX,
which changes where the ACK installs to.
- edit config.pm. There's a small section at the top containing some editable
variables. Probably the only one you may want to edit is PREFIX, which
changes where the ACK installs to.
- Run:
make # or gmake
...from the command line. This will do the build.
The make system is fully parallelisable. If you have a multicore system,
you probably want to do:
make -j8 # or gmake -j8
...instead (substituting the right number of cores, of course). You can
also shave a few seconds of the build time by using the -r flag.
./pm configure
...from the command line. This will write out a configuration file.
- Run:
sudo make install
...from the command line. This will install the ACK in your PREFIX
directory (by default, /usr/local).
./pm
...from the command line. This will actually do the build. This takes
about two minutes on my 1.6GHz Athlon Linux machine and about 30 on my
166MHz Pentium OpenBSD machine.
- Run:
./pm install
...from the command line (possibly with sudo). This will install the built
ACK into whatever directory you nominated in PREFIX.
The ACK should now be ready to use.
@@ -98,9 +94,8 @@ Some useful options include:
-o <file> specifies the output file
-c produce a .o file
-c.s produce a .s assembly file
-O enable optimisation (optimisation levels go up to 6)
-O enable optimisation
-ansi compile ANSI C (when using the C compiler)
-v be more verbose (repeatable)
<file> build file
ack figures out which language to use from the file extension:
@@ -112,7 +107,6 @@ ack figures out which language to use from the file extension:
.p Pascal
.o object files
.s assembly files
.e ACK intermediate code assembly files
For further information, see the man page (which actually does get
installed, but is rather out of date).
@@ -123,13 +117,12 @@ A sample command line is:
ack -mlinux386 -O examples/paranoia.c
GOTCHAS
=======
There are some things you should be aware of.
- Look at plat/<PLATFORMNAME>/README for information about the supported
- Look at plat/<PLATFORMNAME>/README for information about the two supported
platforms.
- The library support is fairly limited; for C, it's at roughly the ANSI C
@@ -170,4 +163,8 @@ Please enjoy.
David Given (dtrg on Sourceforge)
dg@cowlark.com
2013-05-13
2010-08-08
# $Source$
# $State$
# $Revision$

View File

@@ -13,7 +13,7 @@ ACK_TEMP_DIR = "/tmp"
-- Where is the ACK going to be installed, eventually?
PREFIX = "/tmp/ack-temp/staging"
PREFIX = "/usr/local"
-- ======================================================================= --
-- BROKEN ACK CONFIGURATION --

View File

@@ -143,7 +143,7 @@ echo ""
if [ -e $destdir ]; then
if [ "$delete" = "yes" ]; then
echo "Press RETURN to erase $destdir and its contents, or CTRL+C to abort."
read _ _
read
echo "Erasing..."
rm -rf "$destdir"
else

View File

@@ -1,4 +1,9 @@
core.mk
ack.pm
ack-custom.pm
c.pm
llgen.pm
yacc.pm
#create_dir
#cp_dir
#em_path.h.src

View File

@@ -1,199 +0,0 @@
define reset
$(eval q :=)
$(eval o :=)
$(eval s :=)
$(eval cflags :=)
$(eval ackflags :=)
$(eval ldflags :=)
$(eval objdir :=)
endef
# --- Host compiler
define cfile-rule
$o: $s
@echo CC $o
@mkdir -p $(dir $o)
@$(CC) $(CFLAGS) $(cflags) -MM -MQ $o -o $d $s
$(hide) $(CC) $(CFLAGS) $(cflags) -c -o $o $s
endef
define cfile
$(eval s := $1)
$(eval o := $(OBJDIR)/$(objdir)/$(1:.c=.o))
$(eval d := $(OBJDIR)/$(objdir)/$(1:.c=.d))
$(eval DEPENDS += $d)
$(eval CLEANABLES += $o $d)
$(eval q += $o)
$(eval $(cfile-rule))
endef
# --- ACK compiler
define ackfile-rule
$o: $s $(ACK) \
$(CCOMPILER) \
$(PLATFORM_$(PLATFORM)) \
$(ACK_CORE_TOOLS)
@echo ACK $o
@mkdir -p $(dir $o)
$(hide) ACKDIR=$(INSDIR) $(ACK) $(ACKFLAGS) $(ackflags) -m$(PLATFORM) -c -o $o $s
endef
define ackfile
$(eval s := $1)
$(eval o := $(OBJDIR)/$(objdir)/$(basename $1).o)
$(eval d := $(OBJDIR)/$(objdir)/$(basename $1).d)
$(eval DEPENDS += $d)
$(eval CLEANABLES += $o $d)
$(eval q += $o)
$(eval $(ackfile-rule))
endef
# --- Add a raw to the queue
define file
$(eval q += $1)
endef
# --- Host compiler linking
define cprogram-rule
$o: $s
@echo CPROGRAM $o
@mkdir -p $(dir $o)
$(hide) $(CC) $(CFLAGS) $(cflags) $(LDFLAGS) $(ldflags) -o $o $s
endef
define cprogram
$(eval o := $1)
$(eval s := $q)
$(eval CLEANABLES += $o)
$(eval q := $o)
$(eval $(cprogram-rule))
endef
# --- Host library linking
define clibrary-rule
$o: $s
@echo CLIBRARY $o
@mkdir -p $(dir $o)
@$(RM) $o
$(hide) $(AR) qsc $o $s
endef
define clibrary
$(eval o := $1)
$(eval s := $q)
$(eval CLEANABLES += $o)
$(eval q := $o)
$(eval $(clibrary-rule))
endef
# --- ACK library linking
define acklibrary-rule
$o: $s $(AAL)
@echo ACKLIBRARY $o
@mkdir -p $(dir $o)
@$(RM) $o
$(hide) $(AAL) q $o $s
endef
define acklibrary
$(eval o := $1)
$(eval s := $q)
$(eval CLEANABLES += $o)
$(eval q := $o)
$(eval $(acklibrary-rule))
endef
# --- Copies a file.
define copyto-rule
$o: $s
@echo CP $o
@mkdir -p $(dir $o)
$(hide) $(CP) $s $o
endef
define copyto
$(eval o := $1)
$(eval s := $q)
$(eval CLEANABLES += $o)
$(eval q := $o)
$(eval $(copyto-rule))
endef
# --- Installs a file (copies it and adds it to INSTALLABLES).
define installto-rule
$o: $s
@echo INSTALL $o
@mkdir -p $(dir $o)
$(hide) $(CP) $s $o
endef
define installto
$(eval o := $1)
$(eval s := $q)
$(eval CLEANABLES += $o)
$(eval INSTALLABLES += $o)
$(eval q := $o)
$(eval $(installto-rule))
endef
# --- Adds a dependency for the last object file
define dependson
$(eval $o: $1)
endef
# --- Runs yacc.
# $1: directory to put output files
# $2: input files
#
# Output files are compiled via cfile and queued.
define yacc-impl
$(eval o := $1/y.tab.c)
$(eval CLEANABLES += $o $1/y.tab.h)
$o: $2
@echo YACC $o
@mkdir -p $(dir $o)
$(hide) yacc -t -b $1/y -d $2
$(call cfile, $o)
$1/y.tab.h: $o
endef
yacc = $(eval $(call yacc-impl,$1,$2))
# --- Runs flex.
# $1: directory to put output files
# $2: input files
#
# Output files are compiled via cfile and queued.
define flex-impl
$(eval o := $1/lex.yy.c)
$(eval CLEANABLES += $o)
$o: $2
@echo FLEX $o
@mkdir -p $(dir $o)
$(hide) flex -s -t $2 > $o
$(call cfile, $o)
endef
flex = $(eval $(call flex-impl,$1,$2))

View File

@@ -39,6 +39,7 @@
#define DO_TOSTACK 23
#define DO_KILLREG 24
#define DO_LABDEF 25
#define DO_STACKADJUST 26
#ifndef MAXATT
#define MAXATT TOKENSIZE
@@ -133,6 +134,7 @@ typedef struct exprnode *node_p;
#define EX_ISROM 44
#define EX_TOPELTSIZE 45
#define EX_FALLTHROUGH 46
#define EX_STACKOFFSET 47
typedef struct { /* to stack coercions */

View File

@@ -64,7 +64,6 @@ struct outname {
#define RELO4 3 /* 4 bytes */
#define RELOPPC 4 /* PowerPC 26-bit address */
#define RELOH2 5 /* write top 2 bytes of 4 byte word */
#define RELOVC4 6 /* VideoCore IV address in 32-bit instruction */
#define RELPC 0x08 /* pc relative */
#define RELBR 0x10 /* High order byte lowest address. */
@@ -101,19 +100,13 @@ struct outname {
/*
* structure format strings
*/
#if 0
/* The following strings only make sense on 32-bit platforms, so we're going
* to try and deprecate them. */
#define SF_HEAD "22222244"
#define SF_SECT "44444"
#define SF_RELO "1124"
#define SF_NAME "4224"
#endif
/*
* structure sizes on disk (bytes in file; add digits in SF_*)
* Note! These are NOT the sizes in memory (64-bit architectures will have
* a different layout).
* structure sizes (bytes in file; add digits in SF_*)
*/
#define SZ_HEAD 20
#define SZ_SECT 20

View File

@@ -1,3 +1,3 @@
build.mk
pmfile
src
lib

View File

@@ -1,3 +0,0 @@
include lang/basic/lib/build.mk
include lang/basic/src/build.mk

View File

@@ -1,4 +1,4 @@
build.mk
pmfile
abs.c
asc.c
asrt.c

View File

@@ -7,7 +7,62 @@
/* $Id$ */
#define __NO_DEFS
#include <math.h>
double _atn(double x) { return atan(x); }
double
_atn(x)
double x;
{
/* Algorithm and coefficients from:
"Software manual for the elementary functions"
by W.J. Cody and W. Waite, Prentice-Hall, 1980
*/
static double p[] = {
-0.13688768894191926929e+2,
-0.20505855195861651981e+2,
-0.84946240351320683534e+1,
-0.83758299368150059274e+0
};
static double q[] = {
0.41066306682575781263e+2,
0.86157349597130242515e+2,
0.59578436142597344465e+2,
0.15024001160028576121e+2,
1.0
};
static double a[] = {
0.0,
0.52359877559829887307710723554658381, /* pi/6 */
M_PI_2,
1.04719755119659774615421446109316763 /* pi/3 */
};
int neg = x < 0;
int n;
double g;
if (neg) {
x = -x;
}
if (x > 1.0) {
x = 1.0/x;
n = 2;
}
else n = 0;
if (x > 0.26794919243112270647) { /* 2-sqtr(3) */
n = n + 1;
x = (((0.73205080756887729353*x-0.5)-0.5)+x)/
(1.73205080756887729353+x);
}
/* ??? avoid underflow ??? */
g = x * x;
x += x * g * POLYNOM3(g, p) / POLYNOM4(g, q);
if (n > 1) x = -x;
x += a[n];
return neg ? -x : x;
}

View File

@@ -1,48 +0,0 @@
define build-runtime-libbasic-impl
$(call reset)
$(eval objdir := $(PLATFORM))
$(call ackfile, lang/basic/lib/fif.e)
$(call ackfile, lang/basic/lib/fef.e)
$(call ackfile, lang/basic/lib/setline.e)
$(call ackfile, lang/basic/lib/abs.c)
$(call ackfile, lang/basic/lib/asc.c)
$(call ackfile, lang/basic/lib/asrt.c)
$(call ackfile, lang/basic/lib/atn.c)
$(call ackfile, lang/basic/lib/chr.c)
$(call ackfile, lang/basic/lib/conversion.c)
$(call ackfile, lang/basic/lib/error.c)
$(call ackfile, lang/basic/lib/exp.c)
$(call ackfile, lang/basic/lib/file.c)
$(call ackfile, lang/basic/lib/hlt.c)
$(call ackfile, lang/basic/lib/io.c)
$(call ackfile, lang/basic/lib/log.c)
$(call ackfile, lang/basic/lib/mki.c)
$(call ackfile, lang/basic/lib/oct.c)
$(call ackfile, lang/basic/lib/peek.c)
$(call ackfile, lang/basic/lib/power.c)
$(call ackfile, lang/basic/lib/print.c)
$(call ackfile, lang/basic/lib/random.c)
$(call ackfile, lang/basic/lib/read.c)
$(call ackfile, lang/basic/lib/return.c)
$(call ackfile, lang/basic/lib/salloc.c)
$(call ackfile, lang/basic/lib/sgn.c)
$(call ackfile, lang/basic/lib/sin.c)
$(call ackfile, lang/basic/lib/sqt.c)
$(call ackfile, lang/basic/lib/stop.c)
$(call ackfile, lang/basic/lib/string.c)
$(call ackfile, lang/basic/lib/swap.c)
$(call ackfile, lang/basic/lib/trace.c)
$(call ackfile, lang/basic/lib/trap.c)
$(call ackfile, lang/basic/lib/write.c)
$(call acklibrary, $(LIBDIR)/$(PLATFORM)/libbasic.a)
$(call installto, $(PLATIND)/$(PLATFORM)/libbasic.a)
endef
build-runtime-libbasic = $(eval $(build-runtime-libbasic-impl))
$(eval RUNTIMES += libbasic)

View File

@@ -1,5 +1,4 @@
#include <stdlib.h>
#include <stdio.h>
/* $Id$ */
/* error takes an error value in the range of 0-255 */
/* and generates a trap */

View File

@@ -10,7 +10,88 @@
#define __NO_DEFS
#include <math.h>
double _exp(double x)
static double
ldexp(fl,exp)
double fl;
int exp;
{
return exp(x);
extern double _fef();
int sign = 1;
int currexp;
if (fl<0) {
fl = -fl;
sign = -1;
}
fl = _fef(fl,&currexp);
exp += currexp;
if (exp > 0) {
while (exp>30) {
fl *= (double) (1L << 30);
exp -= 30;
}
fl *= (double) (1L << exp);
}
else {
while (exp<-30) {
fl /= (double) (1L << 30);
exp += 30;
}
fl /= (double) (1L << -exp);
}
return sign * fl;
}
double
_exp(x)
double x;
{
/* Algorithm and coefficients from:
"Software manual for the elementary functions"
by W.J. Cody and W. Waite, Prentice-Hall, 1980
*/
static double p[] = {
0.25000000000000000000e+0,
0.75753180159422776666e-2,
0.31555192765684646356e-4
};
static double q[] = {
0.50000000000000000000e+0,
0.56817302698551221787e-1,
0.63121894374398503557e-3,
0.75104028399870046114e-6
};
double xn, g;
int n;
int negative = x < 0;
if (x <= M_LN_MIN_D) {
return M_MIN_D;
}
if (x >= M_LN_MAX_D) {
if (x > M_LN_MAX_D) error(3);
return M_MAX_D;
}
if (negative) x = -x;
/* ??? avoid underflow ??? */
n = x * M_LOG2E + 0.5; /* 1/ln(2) = log2(e), 0.5 added for rounding */
xn = n;
{
double x1 = (long) x;
double x2 = x - x1;
g = ((x1-xn*0.693359375)+x2) - xn*(-2.1219444005469058277e-4);
}
if (negative) {
g = -g;
n = -n;
}
xn = g * g;
x = g * POLYNOM2(xn, p);
n += 1;
return (ldexp(0.5 + x/(POLYNOM3(xn, q) - x), n));
}

View File

@@ -1,4 +1,4 @@
#include <stdlib.h>
/* $Id$ */
_hlt(nr)
int nr;

View File

@@ -1,8 +1,9 @@
#include "bc_io.h"
#include <sgtty.h>
/* dtrg --- this originally used sgtty.h to do clever tty manipulation.
* Strictly this should be converted to use termios, but for simplicity
* we're going to stick with plain stdio for now. */
/* $Id$ */
struct sgttyb _ttydef;
/* BASIC has some nasty io characteristics */
@@ -64,6 +65,9 @@ char *buf;
if( _chann == -1)
{
pos= _pos;
gtty(0,_ttydef);
_ttydef.sg_flags &= ~ECHO;
stty(0,_ttydef);
}else pos= _fdtable[_chann].pos;
c= buf;
while( (holder = fgetc(_chanrd)) != EOF && holder != '\n'){
@@ -75,6 +79,8 @@ char *buf;
if( _chann== -1)
{
_pos=pos;
_ttydef.sg_flags |= ECHO;
stty(0,_ttydef);
} else _fdtable[_chann].pos= pos;
}
_tab(x)

View File

@@ -10,7 +10,48 @@
#define __NO_DEFS
#include <math.h>
double _log(double x)
double
_log(x)
double x;
{
return log(x);
/* Algorithm and coefficients from:
"Software manual for the elementary functions"
by W.J. Cody and W. Waite, Prentice-Hall, 1980
*/
static double a[] = {
-0.64124943423745581147e2,
0.16383943563021534222e2,
-0.78956112887491257267e0
};
static double b[] = {
-0.76949932108494879777e3,
0.31203222091924532844e3,
-0.35667977739034646171e2,
1.0
};
extern double _fef();
double znum, zden, z, w;
int exponent;
if (x <= 0) {
error(3);
return -HUGE;
}
x = _fef(x, &exponent);
if (x > M_1_SQRT2) {
znum = (x - 0.5) - 0.5;
zden = x * 0.5 + 0.5;
}
else {
znum = x - 0.5;
zden = znum * 0.5 + 0.5;
exponent--;
}
z = znum/zden; w = z * z;
x = z + z * w * (POLYNOM2(w,a)/POLYNOM3(w,b));
z = exponent;
x += z * (-2.121944400546905827679e-4);
return x + z * 0.693359375;
}

View File

@@ -1,5 +1,3 @@
#include <stdlib.h>
#include <stdio.h>
#include "bc_string.h"
/* $Id$ */

View File

@@ -1,4 +1,32 @@
#include <math.h>
/* $Id$ */
double _power(double x, double y) { return pow(x, y); }
/*
computes a^b.
uses log and exp
*/
double _log(), _exp();
double
_power(base,pownr)
double pownr, base;
{
double temp;
long l;
if(pownr <= 0.0) {
if(pownr == 0.0) {
if(base <= 0.0)
error(3);
return(0.0);
}
l = base;
if(l != base)
error(3);
temp = _exp(base * _log(-pownr));
if(l & 1)
temp = -temp;
return(temp);
}
return(_exp(base * _log(pownr)));
}

View File

@@ -1,5 +1,3 @@
#include <stdlib.h>
#include <stdio.h>
#include "bc_string.h"
#include "bc_io.h"

View File

@@ -1,5 +1,4 @@
#include <stdlib.h>
#include <stdio.h>
/* $Id$ */
#if !defined(EM_WSIZE)
#define EM_WSIZE _EM_WSIZE

View File

@@ -1,4 +1,6 @@
#include <stdlib.h>
/* $Id$ */
extern char *malloc() ;
char * salloc(length)
unsigned length;

View File

@@ -10,7 +10,96 @@
#define __NO_DEFS
#include <math.h>
double _sin(double x) { return sin(x); }
double _cos(double x) { return cos(x); }
double _tan(double x) { return tan(x); }
static double
sinus(x, cos_flag)
double x;
{
/* Algorithm and coefficients from:
"Software manual for the elementary functions"
by W.J. Cody and W. Waite, Prentice-Hall, 1980
*/
static double r[] = {
-0.16666666666666665052e+0,
0.83333333333331650314e-2,
-0.19841269841201840457e-3,
0.27557319210152756119e-5,
-0.25052106798274584544e-7,
0.16058936490371589114e-9,
-0.76429178068910467734e-12,
0.27204790957888846175e-14
};
double xsqr;
double y;
int neg = 0;
if (x < 0) {
x = -x;
neg = 1;
}
if (cos_flag) {
neg = 0;
y = M_PI_2 + x;
}
else y = x;
/* ??? avoid loss of significance, if y is too large, error ??? */
y = y * M_1_PI + 0.5;
/* Use extended precision to calculate reduced argument.
Here we used 12 bits of the mantissa for a1.
Also split x in integer part x1 and fraction part x2.
*/
#define A1 3.1416015625
#define A2 -8.908910206761537356617e-6
{
double x1, x2;
extern double _fif();
_fif(y, 1.0, &y);
if (_fif(y, 0.5, &x1)) neg = !neg;
if (cos_flag) y -= 0.5;
x2 = _fif(x, 1.0, &x1);
x = x1 - y * A1;
x += x2;
x -= y * A2;
#undef A1
#undef A2
}
if (x < 0) {
neg = !neg;
x = -x;
}
/* ??? avoid underflow ??? */
y = x * x;
x += x * y * POLYNOM7(y, r);
return neg ? -x : x;
}
double
_sin(x)
double x;
{
return sinus(x, 0);
}
double
_cos(x)
double x;
{
if (x < 0) x = -x;
return sinus(x, 1);
}
/* EXTENSION */
double
_tan(x)
double x;
{
return _sin(x)/_cos(x);
}

View File

@@ -10,5 +10,62 @@
#define __NO_DEFS
#include <math.h>
double _sqt(double x) { return sqrt(x); }
#define NITER 5
static double
ldexp(fl,exp)
double fl;
int exp;
{
extern double _fef();
int sign = 1;
int currexp;
if (fl<0) {
fl = -fl;
sign = -1;
}
fl = _fef(fl,&currexp);
exp += currexp;
if (exp > 0) {
while (exp>30) {
fl *= (double) (1L << 30);
exp -= 30;
}
fl *= (double) (1L << exp);
}
else {
while (exp<-30) {
fl /= (double) (1L << 30);
exp += 30;
}
fl /= (double) (1L << -exp);
}
return sign * fl;
}
double
_sqt(x)
double x;
{
extern double _fef();
int exponent;
double val;
if (x <= 0) {
if (x < 0) error(3);
return 0;
}
val = _fef(x, &exponent);
if (exponent & 1) {
exponent--;
val *= 2;
}
val = ldexp(val + 1.0, exponent/2 - 1);
/* was: val = (val + 1.0)/2.0; val = ldexp(val, exponent/2); */
for (exponent = NITER - 1; exponent >= 0; exponent--) {
val = (val + x / val) / 2.0;
}
return val;
}

View File

@@ -1,5 +1,4 @@
#include <stdlib.h>
#include <stdio.h>
/* $Id$ */
_stop()
{

View File

@@ -1,5 +1,3 @@
#include <stdlib.h>
#include <string.h>
#include "bc_string.h"
/* $Id$ */

View File

@@ -1,5 +1,3 @@
#include <stdlib.h>
#include <stdio.h>
#include <signal.h>
#include <setjmp.h>

View File

@@ -1,4 +1,4 @@
build.mk
pmfile
basic.g
basic.lex
bem.c

View File

@@ -237,7 +237,7 @@ File *stream;
extern char *strchr();
getinputline()
getline()
{
/* get next input line */

View File

@@ -1,44 +0,0 @@
D := lang/basic/src
define build-bem-impl
$(call reset)
$(eval cflags += -I$(OBJDIR)/$D -I$D)
$(call cfile, $D/bem.c)
$(call cfile, $D/symbols.c)
$(call cfile, $D/initialize.c)
$(call cfile, $D/compile.c)
$(call cfile, $D/parsepar.c)
$(call cfile, $D/gencode.c)
$(call cfile, $D/util.c)
$(call cfile, $D/graph.c)
$(call cfile, $D/eval.c)
$(call cfile, $D/func.c)
$(call llgen, $(OBJDIR)/$D, $D/basic.g)
$(eval g := $(OBJDIR)/$D/tokentab.h)
$(eval $q: $g)
$(eval CLEANABLES += $g)
$g: $D/maketokentab $(OBJDIR)/$D/Lpars.h
@echo TOKENTAB $$@
@mkdir -p $$(dir $$@)
$(hide) cd $(OBJDIR)/$D && $(abspath $$^)
$(eval $q: $(OBJDIR)/$D/Lpars.h)
$(eval $q: $(INCDIR)/print.h)
$(call file, $(LIBEM_MES))
$(call file, $(LIBEMK))
$(call file, $(LIBEM_DATA))
$(call file, $(LIBALLOC))
$(call file, $(LIBPRINT))
$(call file, $(LIBSTRING))
$(call file, $(LIBSYSTEM))
$(call cprogram, $(BINDIR)/em_bem)
$(call installto, $(PLATDEP)/em_bem)
endef
$(eval $(build-bem-impl))

View File

@@ -23,7 +23,7 @@ compileprogram()
prolog2(); /* Some statements are moved from prolog2 to
epilogcode in the new version of the compiler */
while( basicline = 0, getinputline())
while( basicline = 0, getline())
(void) LLparse();
epilogcode();
sys_close(yyin);

View File

@@ -644,7 +644,7 @@ prolog2()
C_loi((arith) BEMPTRSIZE);
C_exa_dnam("trpbuf");
C_lae_dnam("trpbuf",(arith)0);
C_cal("__setjmp");
C_cal("setjmp");
C_df_ilb(l);
C_asp((arith)(BEMPTRSIZE+BEMPTRSIZE));
C_lfr((arith)BEMINTSIZE);

View File

@@ -1,4 +1,4 @@
build.mk
pmfile
cemcom.ansi
cpp.ansi
libcc.ansi

View File

@@ -1,6 +0,0 @@
include lang/cem/cpp.ansi/build.mk
include lang/cem/cemcom.ansi/build.mk
include lang/cem/libcc.ansi/build.mk
$(eval CCOMPILER := $(CPPANSI) $(CEMCOMANSI) $(LIBCCANSIHEADERS))

View File

@@ -1,4 +1,4 @@
build.mk
pmfile
LLlex.c
LLlex.h
LLmessage.c

View File

@@ -5,8 +5,13 @@
/* $Id$ */
/* L E X I C A L A N A L Y Z E R */
#include "debug.h"
#include "lint.h"
#include <alloc.h>
#include "parameters.h"
#include "idfsize.h"
#include "numsize.h"
#include "strsize.h"
#include "nopp.h"
#include "input.h"
#include "arith.h"
#include "def.h"

View File

@@ -11,6 +11,7 @@
*/
#include "file_info.h"
#include "nopp.h"
/* the structure of a token: */
struct token {

View File

@@ -5,7 +5,8 @@
/* $Id$ */
/* A L I G N M E N T D E F I N I T I O N S */
#include "parameters.h"
#include "nocross.h"
#include "trgt_sizes.h"
#ifndef NOCROSS
extern int

View File

@@ -11,8 +11,11 @@
semantics of C is a mess.
*/
#include "parameters.h"
#include <alloc.h>
#include "debug.h"
#include "lint.h"
#include "nobitfield.h"
#include "idf.h"
#include <flt_arith.h>
#include "arith.h"
#include "sizes.h"

View File

@@ -13,7 +13,7 @@
be handy.
*/
#include "parameters.h"
#include "spec_arith.h"
#ifndef SPECIAL_ARITHMETICS

View File

@@ -1,6 +1,5 @@
/*
* (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
* See the copyright notice in the ACK home directory, in the file "Copyright".
*/
/* $Id$ */
@@ -11,8 +10,7 @@
there is no reasonable method to prove that a program is 100%
correct, these assertions are needed in some places.
*/
#include "parameters.h"
#include "debug.h" /* UF */
#ifdef DEBUG
/* Note: this macro uses parameter substitution inside strings */

View File

@@ -5,7 +5,7 @@
/* $Id$ */
/* B L O C K S T O R I N G A N D L O A D I N G */
#include "parameters.h"
#include "lint.h"
#ifndef LINT
#include <em.h>

View File

@@ -1,156 +0,0 @@
D := lang/cem/cemcom.ansi
define build-cemcom-ansi-allocd-header
$(eval g := $(OBJDIR)/$D/$(strip $1).h)
$g: $D/$(strip $1).str $D/make.allocd
@echo ALLOCD $$@
@mkdir -p $$(dir $$@)
$(hide) $D/make.allocd < $$^ > $$@
$(eval CLEANABLES += $g)
$(eval $q: $g)
endef
define build-cemcom-ansi-next
$(eval CLEANABLES += $(OBJDIR)/$D/next.c)
$(OBJDIR)/$D/next.c: $D/make.next $1
@echo NEXT $$@
@mkdir -p $$(dir $$@)
$(hide) $$^ > $$@
$(call cfile, $(OBJDIR)/$D/next.c)
$(foreach f, $1, $(call build-cemcom-ansi-allocd-header, \
$(basename $(notdir $f))))
endef
define build-cemcom-ansi-impl
$(call reset)
$(eval cflags += -I$(OBJDIR)/$D -I$D)
$(call cfile, $D/arith.c)
$(call dependson, $(INCDIR)/flt_arith.h)
$(call cfile, $D/blocks.c)
$(call dependson, $(INCDIR)/em_codeEK.h)
$(call cfile, $D/LLlex.c)
$(call cfile, $D/LLmessage.c)
$(call cfile, $D/ch3.c)
$(call cfile, $D/ch3bin.c)
$(call cfile, $D/ch3mon.c)
$(call cfile, $D/code.c)
$(call cfile, $D/conversion.c)
$(call cfile, $D/cstoper.c)
$(call cfile, $D/dataflow.c)
$(call cfile, $D/declarator.c)
$(call cfile, $D/decspecs.c)
$(call cfile, $D/domacro.c)
$(call cfile, $D/dumpidf.c)
$(call cfile, $D/error.c)
$(call cfile, $D/eval.c)
$(call cfile, $D/expr.c)
$(call cfile, $D/field.c)
$(call cfile, $D/fltcstoper.c)
$(call cfile, $D/idf.c)
$(call cfile, $D/init.c)
$(call cfile, $D/input.c)
$(call cfile, $D/l_comment.c)
$(call cfile, $D/l_ev_ord.c)
$(call cfile, $D/l_lint.c)
$(call cfile, $D/l_misc.c)
$(call cfile, $D/l_outdef.c)
$(call cfile, $D/l_states.c)
$(call cfile, $D/label.c)
$(call cfile, $D/main.c)
$(call cfile, $D/options.c)
$(call cfile, $D/pragma.c)
$(call cfile, $D/proto.c)
$(call cfile, $D/replace.c)
$(call cfile, $D/skip.c)
$(call cfile, $D/stab.c)
$(call cfile, $D/stack.c)
$(call cfile, $D/struct.c)
$(call cfile, $D/switch.c)
$(call cfile, $D/tokenname.c)
$(call cfile, $D/type.c)
$(call cfile, $D/util.c)
$(call llgen, $(OBJDIR)/$D, \
$(OBJDIR)/$D/tokenfile.g \
$D/program.g \
$D/declar.g \
$D/expression.g \
$D/statement.g \
$D/ival.g)
$(eval CLEANABLES += $(OBJDIR)/$D/tokenfile.g)
$(OBJDIR)/$D/tokenfile.g: $D/make.tokfile $D/tokenname.c
@echo TOKENFILE $$@
@mkdir -p $$(dir $$@)
$(hide) sh $D/make.tokfile < $D/tokenname.c > $$@
$(call tabgen, $D/char.tab)
$(eval $q: $(OBJDIR)/$D/parameters.h)
$(eval CLEANABLES += $(OBJDIR)/$D/parameters.h)
$(OBJDIR)/$D/parameters.h: $D/BigPars
@echo PARAMETERS $$@
@mkdir -p $$(dir $$@)
$(hide) echo '#ifndef PARAMETERS_H' > $$@
$(hide) echo '#define PARAMETERS_H' >> $$@
$(hide) grep -v '^!' < $D/BigPars >> $$@
$(hide) echo '#endif' >> $$@
$(eval CLEANABLES += $(OBJDIR)/$D/symbol2str.c)
$(OBJDIR)/$D/symbol2str.c: $D/make.tokcase $D/tokenname.c
@echo TOKCASE $$@
@mkdir -p $$(dir $$@)
$(hide) $D/make.tokcase < $D/tokenname.c > $$@
$(call cfile, $(OBJDIR)/$D/symbol2str.c)
$(call build-cemcom-ansi-next, \
$D/code.str \
$D/declar.str \
$D/def.str \
$D/expr.str \
$D/field.str \
$D/estack.str \
$D/util.str \
$D/proto.str \
$D/replace.str \
$D/idf.str \
$D/macro.str \
$D/stack.str \
$D/stmt.str \
$D/struct.str \
$D/switch.str \
$D/type.str \
$D/l_brace.str \
$D/l_state.str \
$D/l_outdef.str)
$(eval $q: $(OBJDIR)/$D/Lpars.h)
$(call file, $(LIBEM_MES))
$(call file, $(LIBEMK))
$(call file, $(LIBEM_DATA))
$(call file, $(LIBINPUT))
$(call file, $(LIBASSERT))
$(call file, $(LIBALLOC))
$(call file, $(LIBFLT_ARITH))
$(call file, $(LIBPRINT))
$(call file, $(LIBSYSTEM))
$(call file, $(LIBSTRING))
$(call cprogram, $(BINDIR)/cemcom.ansi)
$(call installto, $(PLATDEP)/em_cemcom.ansi)
$(eval CEMCOMANSI := $o)
$(call reset)
$(eval q := $D/cemcom.ansi.1)
$(call installto, $(INSDIR)/share/man/man1/cemcom.6)
endef
$(eval $(build-cemcom-ansi-impl))

View File

@@ -5,10 +5,12 @@
/* $Id$ */
/* S E M A N T I C A N A L Y S I S -- C H A P T E R 3.3 */
#include "parameters.h"
#include "debug.h"
#include "lint.h"
#include "nobitfield.h"
#include "idf.h"
#include <flt_arith.h>
#include "arith.h"
#include "idf.h"
#include "proto.h"
#include "type.h"
#include "struct.h"

View File

@@ -5,8 +5,11 @@
/* $Id$ */
/* SEMANTIC ANALYSIS (CHAPTER 3.3) -- BINARY OPERATORS */
#include "parameters.h"
#include "botch_free.h"
#include "debug.h"
#include <alloc.h>
#include "lint.h"
#include "idf.h"
#include <flt_arith.h>
#include "arith.h"
#include "type.h"

View File

@@ -5,15 +5,17 @@
/* $Id$ */
/* SEMANTIC ANALYSIS (CHAPTER 3.3) -- MONADIC OPERATORS */
#include "parameters.h"
#include "botch_free.h"
#include "debug.h"
#include <alloc.h>
#include "nobitfield.h"
#include "Lpars.h"
#include <flt_arith.h>
#include "idf.h"
#include "arith.h"
#include "type.h"
#include "label.h"
#include "expr.h"
#include "idf.h"
#include "def.h"
#include "sizes.h"

View File

@@ -7,18 +7,23 @@
#include <stdlib.h>
#include <string.h>
#include "parameters.h"
#include "lint.h"
#include "debug.h"
#include "dbsymtab.h"
#ifndef LINT
#include <em.h>
#else
#include "l_em.h"
#include "l_lint.h"
#endif /* LINT */
#include "botch_free.h"
#include <alloc.h>
#include "dataflow.h"
#include "use_tmp.h"
#include <flt_arith.h>
#include "idf.h"
#include "arith.h"
#include "type.h"
#include "idf.h"
#include "label.h"
#include "code.h"
#include "stmt.h"

View File

@@ -5,7 +5,7 @@
/* $Id$ */
/* C O N V E R S I O N - C O D E G E N E R A T O R */
#include "parameters.h"
#include "lint.h"
#ifndef LINT
#include <em.h>

View File

@@ -5,7 +5,8 @@
/* $Id$ */
/* C O N S T A N T E X P R E S S I O N H A N D L I N G */
#include "parameters.h"
#include "trgt_sizes.h"
#include "idf.h"
#include <flt_arith.h>
#include "arith.h"
#include "type.h"

View File

@@ -9,7 +9,7 @@
Use the compiler option --d.
*/
#include "parameters.h" /* UF */
#include "dataflow.h" /* UF */
#ifdef DATAFLOW
char *CurrentFunction = 0;

View File

@@ -6,14 +6,17 @@
/* DECLARATION SYNTAX PARSER */
{
#include "parameters.h"
#include "lint.h"
#include "dbsymtab.h"
#include <alloc.h>
#include "nobitfield.h"
#include "debug.h"
#include <flt_arith.h>
#include "idf.h"
#include "arith.h"
#include "LLlex.h"
#include "label.h"
#include "code.h"
#include "idf.h"
#include "type.h"
#include "proto.h"
#include "struct.h"

View File

@@ -5,7 +5,8 @@
/* $Id$ */
/* D E C L A R A T O R M A N I P U L A T I O N */
#include "parameters.h"
#include "debug.h"
#include "botch_free.h"
#include <alloc.h>
#include <flt_arith.h>
#include "arith.h"
@@ -14,6 +15,7 @@
#include "Lpars.h"
#include "declar.h"
#include "def.h"
#include "idf.h"
#include "label.h"
#include "expr.h"
#include "sizes.h"

View File

@@ -5,7 +5,7 @@
/* $Id$ */
/* IDENTIFIER DEFINITION DESCRIPTOR */
#include "parameters.h"
#include "lint.h"
struct def { /* for ordinary tags */
struct def *next;

View File

@@ -5,20 +5,29 @@
/* $Id$ */
/* PREPROCESSOR: CONTROLLINE INTERPRETER */
#include <stdlib.h>
#include "parameters.h"
#include "idf.h"
#include "debug.h"
#include "arith.h"
#include "LLlex.h"
#include "Lpars.h"
#include "idf.h"
#include "input.h"
#include "replace.h"
#include "nopp.h"
#include "lint.h"
#ifndef NOPP
#include "ifdepth.h"
#include "botch_free.h"
#include "nparams.h"
#include "parbufsize.h"
#include "textsize.h"
#include "idfsize.h"
#include "assert.h"
#include <alloc.h>
#include "class.h"
#include "macro.h"
#include "macbuf.h"
#include "replace.h"
#include "dbsymtab.h"
#ifdef DBSYMTAB
#include <stb.h>
#include <em.h>

View File

@@ -5,13 +5,16 @@
/* $Id$ */
/* DUMP ROUTINES */
#include "debug.h"
#ifdef DEBUG
#include "parameters.h"
#include <alloc.h>
#include "nopp.h"
#include "nobitfield.h"
#include <flt_arith.h>
#include "arith.h"
#include "stack.h"
#include "idf.h"
#include "def.h"
#include "type.h"
#include "proto.h"

View File

@@ -5,7 +5,7 @@
/* $Id$ */
/* E R R O R A N D D I A G N O S T I C R O U T I N E S */
#include "parameters.h"
#include "lint.h"
#if __STDC__
#include <stdarg.h>
#else
@@ -18,6 +18,11 @@
#include "l_em.h"
#endif /* LINT */
#include "debug.h"
#include "lint.h"
#include "nopp.h"
#include "errout.h"
#include "tokenname.h"
#include <flt_arith.h>
#include "arith.h"

View File

@@ -5,16 +5,19 @@
/* $Id$ */
/* EXPRESSION-CODE GENERATOR */
#include "parameters.h"
#include "lint.h"
#ifndef LINT
#include <em.h>
#include <em_reg.h>
#include <alloc.h>
#include "debug.h"
#include "nobitfield.h"
#include "dataflow.h"
#include <flt_arith.h>
#include "idf.h"
#include "arith.h"
#include "type.h"
#include "idf.h"
#include "label.h"
#include "code.h"
#include "assert.h"
@@ -38,7 +41,7 @@ arith NewLocal(); /* util.c */
extern int err_occurred; /* error.c */
/* EVAL() is the main expression-tree evaluator, which turns
any legal expression tree into EM code. parameters.h:
any legal expression tree into EM code. Parameters:
struct expr *expr
pointer to root of the expression tree to be evaluated

View File

@@ -5,12 +5,13 @@
/* $Id$ */
/* EXPRESSION TREE HANDLING */
#include <stdlib.h>
#include "parameters.h"
#include "lint.h"
#include "debug.h"
#include "assert.h"
#include "botch_free.h"
#include <alloc.h>
#include "idf.h"
#include <flt_arith.h>
#include "idf.h"
#include "arith.h"
#include "def.h"
#include "type.h"
@@ -22,6 +23,7 @@
#include "declar.h"
#include "sizes.h"
#include "level.h"
#include "use_tmp.h"
extern char *symbol2str();
extern char options[];

View File

@@ -7,11 +7,13 @@
{
#include <alloc.h>
#include "parameters.h"
#include "lint.h"
#include "debug.h"
#include <flt_arith.h>
#include "arith.h"
#include "LLlex.h"
#include "type.h"
#include "idf.h"
#include "label.h"
#include "expr.h"
#include "code.h"

View File

@@ -5,16 +5,19 @@
/* $Id$ */
/* BITFIELD EXPRESSION EVALUATOR */
#include "parameters.h"
#include "lint.h"
#ifndef LINT
#include "nobitfield.h"
#ifndef NOBITFIELD
#include <em.h>
#include <em_reg.h>
#include "debug.h"
#include <flt_arith.h>
#include "arith.h"
#include "type.h"
#include "idf.h"
#include "label.h"
#include "code.h"
#include "assert.h"

View File

@@ -6,9 +6,11 @@
/* C O N S T A N T E X P R E S S I O N H A N D L I N G */
/* F O R F L O A T I N G P O I N T N U M B E R S */
#include "parameters.h"
#include "debug.h"
#include "assert.h"
#include <alloc.h>
#include "trgt_sizes.h"
#include "idf.h"
#include <flt_arith.h>
#include "arith.h"
#include "type.h"

View File

@@ -7,15 +7,20 @@
#include <stdlib.h>
#include <string.h>
#include "parameters.h"
#include "lint.h"
#include <em_reg.h>
#include "debug.h"
#include "idfsize.h"
#include "botch_free.h"
#include "nopp.h"
#include "nparams.h"
#include <alloc.h>
#include "idf.h"
#include "arith.h"
#include "align.h"
#include "LLlex.h"
#include "level.h"
#include "stack.h"
#include "idf.h"
#include "label.h"
#include "def.h"
#include "type.h"

View File

@@ -5,7 +5,7 @@
/* $Id$ */
/* IDENTIFIER DESCRIPTOR */
#include "parameters.h"
#include "nopp.h"
struct id_u {
#ifndef NOPP

View File

@@ -7,15 +7,15 @@
#include <stdlib.h>
#include <string.h>
#include "parameters.h"
#include "nopp.h"
#ifndef NOPP
#include <system.h>
#include <alloc.h>
#include <time.h>
#include "idf.h"
#include "class.h"
#include "macro.h"
#include "idf.h"
extern char *sprint();

View File

@@ -4,10 +4,10 @@
*/
/* $Id$ */
#include "parameters.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "inputtype.h"
#include "file_info.h"
#include "input.h"
@@ -15,9 +15,12 @@
#define INP_TYPE struct file_info
#define INP_VAR finfo
struct file_info finfo;
#include "nopp.h"
#include <inp_pkg.body>
#include <alloc.h>
#include "dbsymtab.h"
#include "lint.h"
#ifndef NOPP
#ifdef DBSYMTAB
#include <stb.h>

View File

@@ -6,18 +6,18 @@
/* CODE FOR THE INITIALISATION OF GLOBAL VARIABLES */
{
#include <stdlib.h>
#include "parameters.h"
#include "lint.h"
#ifndef LINT
#include <em.h>
#else
#include "l_em.h"
#include "l_lint.h"
#endif /* LINT */
#include "debug.h"
#include <alloc.h>
#include <assert.h>
#include "nobitfield.h"
#include <flt_arith.h>
#include "idf.h"
#include "arith.h"
#include "label.h"
#include "expr.h"
@@ -29,11 +29,11 @@
#include "Lpars.h"
#include "sizes.h"
#include "align.h"
#include "idf.h"
#include "level.h"
#include "def.h"
#include "LLlex.h"
#include "estack.h"
#include "stack.h"
#define con_nullbyte() C_con_ucon("0", (arith)1)
#define aggregate_type(tp) ((tp)->tp_fund == ARRAY || (tp)->tp_fund == STRUCT)

View File

@@ -5,9 +5,10 @@
/* $Id$ */
/* Lint-specific comment handling */
#include "parameters.h"
#include <ctype.h>
#include "lint.h"
#ifdef LINT
#include <alloc.h>

View File

@@ -5,7 +5,7 @@
/* $Id$ */
/* Lint evaluation order checking */
#include "parameters.h"
#include "lint.h"
#ifdef LINT
@@ -18,6 +18,7 @@
#include "arith.h" /* definition arith */
#include "label.h" /* definition label */
#include "expr.h"
#include "idf.h"
#include "def.h"
#include "code.h" /* RVAL etc */
#include "LLlex.h"

View File

@@ -5,11 +5,12 @@
/* $Id$ */
/* Lint main routines */
#include "parameters.h"
#include "lint.h"
#ifdef LINT
#include <alloc.h> /* for st_free */
#include "debug.h"
#include "interface.h"
#include "assert.h"
#ifdef ANSI
@@ -18,6 +19,7 @@
#include "arith.h" /* definition arith */
#include "label.h" /* definition label */
#include "expr.h"
#include "idf.h"
#include "def.h"
#include "code.h" /* RVAL etc */
#include "LLlex.h"

View File

@@ -5,7 +5,7 @@
/* $Id$ */
/* Lint miscellaneous routines */
#include "parameters.h"
#include "lint.h"
#ifdef LINT
@@ -17,6 +17,7 @@
#include "arith.h" /* definition arith */
#include "label.h" /* definition label */
#include "expr.h"
#include "idf.h"
#include "def.h"
#include "code.h" /* RVAL etc */
#include "LLlex.h"

View File

@@ -5,7 +5,7 @@
/* $Id$ */
/* Lint outdef construction */
#include "parameters.h"
#include "lint.h"
#ifdef LINT
@@ -26,6 +26,7 @@
#include "def.h"
#include "struct.h"
#include "field.h"
#include "idf.h"
#include "level.h"
#include "label.h"
#include "code.h"

View File

@@ -5,19 +5,21 @@
/* $Id$ */
/* Lint status checking */
#include "parameters.h"
#include "lint.h"
#ifdef LINT
#include <alloc.h> /* for st_free */
#include "interface.h"
#include "assert.h"
#include "debug.h"
#ifdef ANSI
#include <flt_arith.h>
#endif /* ANSI */
#include "arith.h"
#include "label.h"
#include "expr.h"
#include "idf.h"
#include "def.h"
#include "code.h" /* RVAL etc */
#include "LLlex.h"

View File

@@ -5,10 +5,9 @@
/* $Id$ */
/* L A B E L H A N D L I N G */
#include "parameters.h"
#include "idf.h"
#include "Lpars.h"
#include "level.h"
#include "idf.h"
#include "label.h"
#include "arith.h"
#include "def.h"

View File

@@ -5,7 +5,7 @@
/* $Id$ */
/* PREPROCESSOR: DEFINITION OF MACRO DESCRIPTOR */
#include "parameters.h"
#include "nopp.h"
#ifndef NOPP
/* The flags of the mc_flag field of the macro structure. Note that

View File

@@ -5,11 +5,16 @@
/* $Id$ */
/* MAIN PROGRAM */
#include "parameters.h"
#include "lint.h"
#include <system.h>
#include "idf.h"
#include "debug.h"
#include "nopp.h"
#include "trgt_sizes.h"
#include "use_tmp.h"
#include "inputtype.h"
#include "input.h"
#include "level.h"
#include "idf.h"
#include "arith.h"
#include "type.h"
#include "proto.h"
@@ -19,6 +24,7 @@
#include "LLlex.h"
#include <alloc.h>
#include "specials.h"
#include "nocross.h"
#include "sizes.h"
#include "align.h"
#include "macro.h"

View File

@@ -1,6 +1,6 @@
#!/bin/sh
echo '#include "parameters.h"'
echo '#include "debug.h"'
sed -n '
s:^.*ALLOCDEF.*"\(.*\)".*$:struct \1 *h_\1 = 0;\
#ifdef DEBUG\

View File

@@ -5,16 +5,23 @@
/* $Id$ */
/* U S E R O P T I O N - H A N D L I N G */
#include "parameters.h"
#include <stdlib.h>
#include <string.h>
#include "lint.h"
#include "botch_free.h"
#include <alloc.h>
#include "nopp.h"
#include "idfsize.h"
#include "nobitfield.h"
#include "class.h"
#include "macro.h"
#include "idf.h"
#include "arith.h"
#include "sizes.h"
#include "align.h"
#include "use_tmp.h"
#include "dataflow.h"
#include "dbsymtab.h"
#ifndef NOPP
extern char **inctable;

View File

@@ -5,7 +5,8 @@
/* $Id$ */
/* PREPROCESSOR: PRAGMA INTERPRETER */
#include "parameters.h"
#include "debug.h"
#include "idf.h"
#define P_UNKNOWN 0
#define NR_PRAGMAS 0

View File

@@ -45,10 +45,13 @@
%start If_expr, control_if_expression;
{
#include "parameters.h"
#include "lint.h"
#include "nopp.h"
#include "debug.h"
#include <flt_arith.h>
#include "arith.h"
#include "LLlex.h"
#include "idf.h"
#include "label.h"
#include "type.h"
#include "declar.h"
@@ -56,7 +59,6 @@
#include "code.h"
#include "expr.h"
#include "def.h"
#include "stack.h"
#ifdef LINT
#include "l_lint.h"
#endif /* LINT */

View File

@@ -5,15 +5,19 @@
/* $Id$ */
/* P R O T O T Y P E F I D D L I N G */
#include "parameters.h"
#include "lint.h"
#include "debug.h"
#include "idfsize.h"
#include "nparams.h"
#include "botch_free.h"
#include <alloc.h>
#include "idf.h"
#include "Lpars.h"
#include "level.h"
#include <flt_arith.h>
#include "arith.h"
#include "align.h"
#include "stack.h"
#include "idf.h"
#include "def.h"
#include "type.h"
#include "struct.h"

View File

@@ -7,18 +7,26 @@
#include <stdlib.h>
#include <string.h>
#include "parameters.h"
#include "nopp.h"
#ifndef NOPP
#include "debug.h"
#include "pathlength.h"
#include "strsize.h"
#include "nparams.h"
#include "idfsize.h"
#include "numsize.h"
#include <alloc.h>
#include "idf.h"
#include "idf.h"
#include "input.h"
#include "macro.h"
#include "arith.h"
#include "LLlex.h"
#include "class.h"
#include "assert.h"
#include "static.h"
#include "macbuf.h"
#include "replace.h"
extern struct idf *GetIdentifier();

View File

@@ -5,7 +5,8 @@
/* $Id$ */
/* VARIOUS TARGET MACHINE SIZE DESCRIPTORS */
#include "parameters.h"
#include "nocross.h"
#include "trgt_sizes.h"
#ifndef NOCROSS
extern arith

View File

@@ -5,7 +5,7 @@
/* $Id$ */
/* PREPROCESSOR: INPUT SKIP FUNCTIONS */
#include "parameters.h"
#include "nopp.h"
#include "arith.h"
#include "LLlex.h"
#include "class.h"

View File

@@ -9,7 +9,7 @@
/* $Id$ */
#include "parameters.h"
#include "dbsymtab.h"
#ifdef DBSYMTAB
@@ -20,13 +20,13 @@
#include <flt_arith.h>
#include <stb.h>
#include "idf.h"
#include "LLlex.h"
#include "stack.h"
#include "def.h"
#include "type.h"
#include "struct.h"
#include "field.h"
#include "idf.h"
#include "Lpars.h"
#include "level.h"

View File

@@ -5,19 +5,21 @@
/* $Id$ */
/* S T A C K / U N S T A C K R O U T I N E S */
#include "parameters.h"
#include "lint.h"
#include <system.h>
#ifndef LINT
#include <em.h>
#else
#include "l_em.h"
#endif /* LINT */
#include "debug.h"
#include "botch_free.h"
#include <alloc.h>
#include "idf.h"
#include "Lpars.h"
#include "arith.h"
#include "stack.h"
#include "type.h"
#include "idf.h"
#include "def.h"
#include "struct.h"
#include "level.h"

View File

@@ -6,7 +6,7 @@
/* STATEMENT SYNTAX PARSER */
{
#include "parameters.h"
#include "lint.h"
#ifndef LINT
#include <em.h>
#else
@@ -14,11 +14,15 @@
#include "l_lint.h"
#endif /* LINT */
#include "debug.h"
#include "botch_free.h"
#include "dbsymtab.h"
#include <flt_arith.h>
#include "idf.h"
#include "arith.h"
#include "LLlex.h"
#include "type.h"
#include "idf.h"
#include "label.h"
#include "expr.h"
#include "code.h"

View File

@@ -5,11 +5,13 @@
/* $Id$ */
/* ADMINISTRATION OF STRUCT AND UNION DECLARATIONS */
#include "parameters.h"
#include "nobitfield.h"
#include "debug.h"
#include "botch_free.h"
#include <alloc.h>
#include "idf.h"
#include "arith.h"
#include "stack.h"
#include "idf.h"
#include "def.h"
#include "type.h"
#include "proto.h"

View File

@@ -5,14 +5,18 @@
/* $Id$ */
/* S W I T C H - S T A T E M E N T A D M I N I S T R A T I O N */
#include "parameters.h"
#include "lint.h"
#ifndef LINT
#include <em.h>
#else
#include "l_em.h"
#endif /* LINT */
#include "debug.h"
#include "botch_free.h"
#include <alloc.h>
#include "density.h"
#include "Lpars.h"
#include "idf.h"
#include "label.h"
#include <flt_arith.h>
#include "arith.h"

View File

@@ -5,8 +5,7 @@
/* $Id$ */
/* TOKEN NAME DEFINITIONS */
#include "parameters.h"
#include "idf.h"
#include "idf.h"
#include "arith.h"
#include "LLlex.h"
#include "tokenname.h"

View File

@@ -5,12 +5,14 @@
/* $Id$ */
/* T Y P E D E F I N I T I O N M E C H A N I S M */
#include "parameters.h"
#include "nobitfield.h"
#include "debug.h"
#include "botch_free.h"
#include <alloc.h>
#include "idf.h"
#include "Lpars.h"
#include "arith.h"
#include "type.h"
#include "idf.h"
#include "def.h"
#include "proto.h"
#include "sizes.h"

View File

@@ -5,7 +5,8 @@
/* $Id$ */
/* TYPE DESCRIPTOR */
#include "parameters.h"
#include "nobitfield.h"
#include "dbsymtab.h"
struct type {
struct type *next; /* used for ARRAY and for qualifiers */

View File

@@ -11,7 +11,7 @@
allowing re-use.
*/
#include "parameters.h"
#include "lint.h"
#ifndef LINT
#include <em.h>
#else
@@ -22,7 +22,10 @@
#include <alloc.h>
#include <em_mes.h>
#include "debug.h"
#include "util.h"
#include "use_tmp.h"
#include "regcount.h"
#include "sizes.h"
#include "align.h"
#include "stack.h"

View File

@@ -1,4 +1,4 @@
build.mk
pmfile
LLlex.c
LLlex.h
LLmessage.c

View File

@@ -39,7 +39,7 @@ arith NewLocal(); /* util.c */
#define LocalPtrVar() NewLocal(pointer_size, pointer_align, reg_pointer, REGISTER)
/* EVAL() is the main expression-tree evaluator, which turns
any legal expression tree into EM code. parameters.h:
any legal expression tree into EM code. Parameters:
struct expr *expr
pointer to root of the expression tree to be evaluated

View File

@@ -70,7 +70,7 @@ replace(idef)
return 0;
}
if (++mac->mc_count > 100) {
/* 100 must be some number in parameters.h */
/* 100 must be some number in Parameters */
lexwarning("macro %s is assumed recursive",
idef->id_text);
return 0;

View File

@@ -1,8 +1,8 @@
build.mk
pmfile
LLlex.c
LLlex.h
LLmessage.c
parameters.h
Parameters
arith.h
bits.h
ch3bin.c
@@ -22,6 +22,7 @@ input.h
macro.str
main.c
make.allocd
make.hfiles
make.next
make.tokcase
make.tokfile

View File

@@ -5,7 +5,9 @@
/* $Id$ */
/* L E X I C A L A N A L Y Z E R */
#include "parameters.h"
#include "idfsize.h"
#include "numsize.h"
#include "strsize.h"
#include <alloc.h>
#include "input.h"

View File

@@ -1,67 +1,72 @@
#ifndef PARAMETERS_H
#define PARAMETERS_H
!File: pathlength.h
#define PATHLENGTH 1024 /* max. length of path to file */
!File: errout.h
#define ERROUT STDERR /* file pointer for writing messages */
#define MAXERR_LINE 5 /* maximum number of error messages given
on the same input line. */
!File: idfsize.h
#define IDFSIZE 64 /* maximum significant length of an identifier */
!File: numsize.h
#define NUMSIZE 256 /* maximum length of a numeric constant */
!File: nparams.h
#define NPARAMS 32 /* maximum number of parameters of macros */
#define STDC_NPARAMS 31 /* ANSI limit on number of parameters */
!File: ifdepth.h
#define IFDEPTH 256 /* maximum number of nested if-constructions */
!File: macbuf.h
#define LAPBUF 128 /* initial size of macro replacement buffer */
#define ARGBUF 128 /* initial size of macro parameter buffer(s) */
!File: strsize.h
#define ISTRSIZE 16 /* minimum number of bytes allocated for
storing a string */
#if 0
#define BOTCH_FREE 1 /* botch freed memory, as a check */
#endif
!File: botch_free.h
/*#define BOTCH_FREE 1 /* botch freed memory, as a check */
#if 0
#define DEBUG 1 /* perform various self-tests */
#endif
!File: debug.h
/*#define DEBUG 1 /* perform various self-tests */
#define NDEBUG 1 /* disable assertions */
!File: parbufsize.h
#define PARBUFSIZE 1024
!File: textsize.h
#define ITEXTSIZE 16 /* 1st piece of memory for repl. text */
#if 0
#define INP_READ_IN_ONE 1 /* read input file in one. */
!File: inputtype.h
/*#define INP_READ_IN_ONE 1 /* read input file in one. */
/* If defined, we cannot read from a pipe */
#endif
!File: obufsize.h
#define OBUFSIZE 8192 /* output buffer size */
!File: dobits.h
#define DOBITS 1 /* use trick to reduce symboltable accesses */
!File: ln_prefix.h
#define LINE_PREFIX "#" /* prefix for generated line directives,
either "#" or "#line"
*/
#endif

Some files were not shown because too many files have changed in this diff Show More