/* $Header$ */
/* L E X I C A L A N A L Y Z E R */
+#include <alloc.h>
#include "nofloat.h"
#include "idfsize.h"
#include "numsize.h"
#include "strsize.h"
#include "nopp.h"
#include "input.h"
-#include "alloc.h"
#include "arith.h"
#include "def.h"
#include "idf.h"
/* $Header$ */
/* PARSER ERROR ADMINISTRATION */
+#include <alloc.h>
#include "nofloat.h"
#include "idf.h"
-#include "alloc.h"
#include "arith.h"
#include "LLlex.h"
#include "Lpars.h"
LLmessage(tk) {
err_occurred = 1;
- if (tk < 0)
- fatal("parser administration overflow");
- if (tk) {
+ if (tk < 0) {
+ error("end of file expected");
+ }
+ else if (tk) {
error("%s missing", symbol2str(tk));
insert_token(tk);
}
PRTLIB = $(EMHOME)/modules/lib/libprint.a
EMMESLIB = $(EMHOME)/modules/lib/libem_mes.a
INPLIB = $(EMHOME)/modules/lib/libinput.a
+ALLOCLIB = $(EMHOME)/modules/lib/liballoc.a
+MALLOC = $(EMHOME)/modules/lib/malloc.o
#CH3LIB = $(EMHOME)/modules/lib/libch3.a
CH3LIB =
LIBS = $(INPLIB) $(CH3LIB) $(EMMESLIB) $(EMKLIB) \
- $(PRTLIB) $(STRLIB) $(SYSLIB)
+ $(PRTLIB) $(STRLIB) $(ALLOCLIB) $(MALLOC) $(SYSLIB)
ELIBS = $(INPLIB) $(CH3LIB) $(EMMESLIB) $(EMELIB) \
- $(PRTLIB) $(STRLIB) $(SYSLIB)
+ $(PRTLIB) $(STRLIB) $(ALLOCLIB) $(MALLOC) $(SYSLIB)
LIB_INCLUDES = -I$(EMHOME)/modules/h -I$(EMHOME)/modules/pkg
EM_INCLUDES = -I$(EMHOME)/h
SYSLLIB = $(EMHOME)/modules/lib/llib-lsys.ln
EMMESLLIB = $(EMHOME)/modules/lib/llib-lmes.ln
INPLLIB = $(EMHOME)/modules/lib/llib-linput.ln
CH3LLIB = $(EMHOME)/modules/lib/llib-lch3.ln
+ALLOCLLIB = $(EMHOME)/modules/lib/llib-alloc.ln
LINTLIBS =
#LINTLIBS = $(CH3LLIB) $(INPLLIB) $(EMMESLLIB) $(EMKLLIB) \
-# $(PRTLLIB) $(STRLLIB) $(SYSLLIB)
+# $(PRTLLIB) $(STRLLIB) $(SYSLLIB) $(ALLOCLLIB)
# Where to install the compiler and its driver
CEMCOM = $(DESTINATION)/cemcom
# Grammar files and their objects
LSRC = tokenfile.g declar.g statement.g expression.g program.g
+GLCSRC = tokenfile.c declar.c statement.c expression.c program.c
LOBJ = tokenfile.o declar.o statement.o expression.o program.o Lpars.o
# Objects of hand-written C files
COBJ = main.o idf.o declarator.o decspecs.o struct.o \
expr.o ch7.o ch7bin.o cstoper.o arith.o \
- alloc.o asm.o code.o dumpidf.o error.o field.o\
+ asm.o code.o dumpidf.o error.o field.o\
tokenname.o LLlex.o LLmessage.o \
input.o domacro.o replace.o init.o options.o \
scan.o skip.o stack.o type.o ch7mon.o label.o eval.o \
- switch.o storage.o ival.o conversion.o \
+ switch.o ival.o conversion.o \
blocks.o dataflow.o
# Objects of other generated C files
# .h files generated by `make hfiles'; PLEASE KEEP THIS UP-TO-DATE!
GHSRC = botch_free.h dataflow.h debug.h density.h errout.h \
idepth.h idfsize.h ifdepth.h inputtype.h inumlength.h lapbuf.h \
- maxincl.h myalloc.h nobitfield.h nofloat.h nopp.h \
+ maxincl.h nobitfield.h nofloat.h nopp.h \
nparams.h numsize.h parbufsize.h pathlength.h \
strsize.h target_sizes.h textsize.h use_tmp.h spec_arith.h static.h
# Other generated files, for 'make clean' only
GENERATED = tab tokenfile.g Lpars.h LLfiles LL.output lint.out \
- print Xref lxref hfiles cfiles
+ print Xref lxref hfiles cfiles $(GLCSRC)
# include files containing ALLOCDEF specifications
NEXTFILES = code.str declar.str decspecs.str def.str expr.str field.str \
$(SIM) $(SIMFLAGS) `sources $(COBJ)` $(GSRC) $(LSRC)
#AUTOAUTOAUTOAUTOAUTOAUTOAUTOAUTOAUTOAUTO
-main.o: LLlex.h Lpars.h alloc.h arith.h debug.h declar.h file_info.h idf.h input.h inputtype.h level.h maxincl.h myalloc.h nobitfield.h nofloat.h nopp.h spec_arith.h specials.h target_sizes.h tokenname.h type.h use_tmp.h
-idf.o: LLlex.h Lpars.h align.h alloc.h arith.h assert.h botch_free.h debug.h declar.h decspecs.h def.h file_info.h idf.h idfsize.h label.h level.h nobitfield.h nofloat.h nopp.h sizes.h spec_arith.h specials.h stack.h storage.h struct.h type.h
-declarator.o: Lpars.h alloc.h arith.h botch_free.h declar.h expr.h idf.h label.h nobitfield.h nofloat.h nopp.h sizes.h spec_arith.h storage.h type.h
+main.o: LLlex.h Lpars.h arith.h debug.h declar.h file_info.h idf.h input.h inputtype.h level.h maxincl.h nobitfield.h nofloat.h nopp.h spec_arith.h specials.h target_sizes.h tokenname.h type.h use_tmp.h
+idf.o: LLlex.h Lpars.h align.h arith.h assert.h botch_free.h debug.h declar.h decspecs.h def.h file_info.h idf.h idfsize.h label.h level.h nobitfield.h nofloat.h nopp.h sizes.h spec_arith.h specials.h stack.h struct.h type.h
+declarator.o: Lpars.h arith.h botch_free.h declar.h expr.h idf.h label.h nobitfield.h nofloat.h nopp.h sizes.h spec_arith.h type.h
decspecs.o: Lpars.h arith.h decspecs.h def.h level.h nobitfield.h nofloat.h spec_arith.h type.h
-struct.o: LLlex.h Lpars.h align.h arith.h assert.h botch_free.h debug.h def.h field.h file_info.h idf.h level.h nobitfield.h nofloat.h nopp.h sizes.h spec_arith.h stack.h storage.h struct.h type.h
-expr.o: LLlex.h Lpars.h alloc.h arith.h botch_free.h declar.h decspecs.h def.h expr.h file_info.h idf.h label.h level.h nobitfield.h nofloat.h nopp.h sizes.h spec_arith.h storage.h type.h
+struct.o: LLlex.h Lpars.h align.h arith.h assert.h botch_free.h debug.h def.h field.h file_info.h idf.h level.h nobitfield.h nofloat.h nopp.h sizes.h spec_arith.h stack.h struct.h type.h
+expr.o: LLlex.h Lpars.h arith.h botch_free.h declar.h decspecs.h def.h expr.h file_info.h idf.h label.h level.h nobitfield.h nofloat.h nopp.h sizes.h spec_arith.h type.h
ch7.o: Lpars.h arith.h assert.h debug.h def.h expr.h idf.h label.h nobitfield.h nofloat.h nopp.h spec_arith.h struct.h type.h
-ch7bin.o: Lpars.h arith.h botch_free.h expr.h idf.h label.h nobitfield.h nofloat.h nopp.h spec_arith.h storage.h struct.h type.h
+ch7bin.o: Lpars.h arith.h botch_free.h expr.h idf.h label.h nobitfield.h nofloat.h nopp.h spec_arith.h struct.h type.h
cstoper.o: Lpars.h arith.h assert.h debug.h expr.h idf.h label.h nobitfield.h nofloat.h nopp.h sizes.h spec_arith.h target_sizes.h type.h
-arith.o: Lpars.h alloc.h arith.h botch_free.h expr.h field.h idf.h label.h mes.h nobitfield.h nofloat.h nopp.h spec_arith.h storage.h type.h
-alloc.o: alloc.h assert.h debug.h myalloc.h
-code.o: LLlex.h Lpars.h alloc.h arith.h assert.h atw.h botch_free.h code.h dataflow.h debug.h declar.h decspecs.h def.h expr.h file_info.h idf.h label.h level.h mes.h nobitfield.h nofloat.h nopp.h sizes.h spec_arith.h specials.h stack.h stmt.h storage.h type.h use_tmp.h
+arith.o: Lpars.h arith.h botch_free.h expr.h field.h idf.h label.h mes.h nobitfield.h nofloat.h nopp.h spec_arith.h type.h
+code.o: LLlex.h Lpars.h arith.h assert.h atw.h botch_free.h code.h dataflow.h debug.h declar.h decspecs.h def.h expr.h file_info.h idf.h label.h level.h mes.h nobitfield.h nofloat.h nopp.h sizes.h spec_arith.h specials.h stack.h stmt.h type.h use_tmp.h
dumpidf.o: Lpars.h arith.h debug.h def.h expr.h field.h idf.h label.h nobitfield.h nofloat.h nopp.h spec_arith.h stack.h static.h struct.h type.h
error.o: LLlex.h arith.h debug.h errout.h expr.h file_info.h label.h nofloat.h nopp.h spec_arith.h tokenname.h use_tmp.h
field.o: Lpars.h arith.h assert.h code.h debug.h expr.h field.h idf.h label.h nobitfield.h nofloat.h nopp.h sizes.h spec_arith.h type.h
tokenname.o: LLlex.h Lpars.h arith.h file_info.h idf.h nofloat.h nopp.h spec_arith.h tokenname.h
-LLlex.o: LLlex.h Lpars.h alloc.h arith.h assert.h class.h debug.h def.h file_info.h idf.h idfsize.h input.h nofloat.h nopp.h numsize.h sizes.h spec_arith.h strsize.h
-LLmessage.o: LLlex.h Lpars.h alloc.h arith.h file_info.h idf.h nofloat.h nopp.h spec_arith.h
+LLlex.o: LLlex.h Lpars.h arith.h assert.h class.h debug.h def.h file_info.h idf.h idfsize.h input.h nofloat.h nopp.h numsize.h sizes.h spec_arith.h strsize.h
+LLmessage.o: LLlex.h Lpars.h arith.h file_info.h idf.h nofloat.h nopp.h spec_arith.h
input.o: file_info.h input.h inputtype.h nopp.h
-domacro.o: LLlex.h Lpars.h alloc.h arith.h assert.h botch_free.h class.h debug.h file_info.h idf.h idfsize.h ifdepth.h input.h interface.h macro.h nofloat.h nopp.h nparams.h parbufsize.h spec_arith.h storage.h textsize.h
-replace.o: LLlex.h alloc.h arith.h assert.h class.h debug.h file_info.h idf.h input.h interface.h macro.h nofloat.h nopp.h pathlength.h spec_arith.h static.h strsize.h
-init.o: alloc.h class.h idf.h interface.h macro.h nopp.h
-options.o: align.h arith.h class.h idf.h idfsize.h macro.h maxincl.h nobitfield.h nofloat.h nopp.h sizes.h spec_arith.h storage.h use_tmp.h
+domacro.o: LLlex.h Lpars.h arith.h assert.h botch_free.h class.h debug.h file_info.h idf.h idfsize.h ifdepth.h input.h interface.h macro.h nofloat.h nopp.h nparams.h parbufsize.h spec_arith.h textsize.h
+replace.o: LLlex.h arith.h assert.h class.h debug.h file_info.h idf.h input.h interface.h macro.h nofloat.h nopp.h pathlength.h spec_arith.h static.h strsize.h
+init.o: class.h idf.h interface.h macro.h nopp.h
+options.o: align.h arith.h botch_free.h class.h idf.h idfsize.h macro.h maxincl.h nobitfield.h nofloat.h nopp.h sizes.h spec_arith.h use_tmp.h
scan.o: class.h idf.h input.h interface.h lapbuf.h macro.h nopp.h nparams.h
skip.o: LLlex.h arith.h class.h file_info.h input.h interface.h nofloat.h nopp.h spec_arith.h
-stack.o: Lpars.h alloc.h arith.h botch_free.h debug.h def.h idf.h level.h mes.h nobitfield.h nofloat.h nopp.h spec_arith.h stack.h storage.h struct.h type.h use_tmp.h
-type.o: Lpars.h align.h alloc.h arith.h def.h idf.h nobitfield.h nofloat.h nopp.h sizes.h spec_arith.h storage.h type.h
-ch7mon.o: Lpars.h arith.h botch_free.h def.h expr.h idf.h label.h nobitfield.h nofloat.h nopp.h spec_arith.h storage.h type.h
+stack.o: Lpars.h arith.h botch_free.h debug.h def.h idf.h level.h mes.h nobitfield.h nofloat.h nopp.h spec_arith.h stack.h struct.h type.h use_tmp.h
+type.o: Lpars.h align.h arith.h botch_free.h def.h idf.h nobitfield.h nofloat.h nopp.h sizes.h spec_arith.h type.h
+ch7mon.o: Lpars.h arith.h botch_free.h def.h expr.h idf.h label.h nobitfield.h nofloat.h nopp.h spec_arith.h type.h
label.o: Lpars.h arith.h def.h idf.h label.h level.h nobitfield.h nofloat.h nopp.h spec_arith.h type.h
eval.o: Lpars.h align.h arith.h assert.h atw.h code.h dataflow.h debug.h def.h expr.h idf.h label.h level.h mes.h nobitfield.h nofloat.h nopp.h sizes.h spec_arith.h stack.h type.h
-switch.o: Lpars.h arith.h assert.h botch_free.h code.h debug.h density.h expr.h idf.h label.h nobitfield.h nofloat.h nopp.h spec_arith.h storage.h switch.h type.h
-storage.o: alloc.h assert.h botch_free.h debug.h storage.h
+switch.o: Lpars.h arith.h assert.h botch_free.h code.h debug.h density.h expr.h idf.h label.h nobitfield.h nofloat.h nopp.h spec_arith.h switch.h type.h
ival.o: Lpars.h align.h arith.h assert.h class.h debug.h def.h expr.h field.h idf.h label.h level.h nobitfield.h nofloat.h nopp.h sizes.h spec_arith.h struct.h type.h
conversion.o: Lpars.h arith.h nobitfield.h nofloat.h sizes.h spec_arith.h type.h
blocks.o: arith.h atw.h label.h nofloat.h sizes.h spec_arith.h stack.h
dataflow.o: dataflow.h
tokenfile.o: Lpars.h
-declar.o: LLlex.h Lpars.h arith.h debug.h declar.h decspecs.h def.h expr.h field.h file_info.h idf.h label.h nobitfield.h nofloat.h nopp.h sizes.h spec_arith.h storage.h struct.h type.h
-statement.o: LLlex.h Lpars.h arith.h botch_free.h code.h debug.h def.h expr.h file_info.h idf.h label.h nobitfield.h nofloat.h nopp.h spec_arith.h stack.h storage.h type.h
+declar.o: LLlex.h Lpars.h arith.h debug.h declar.h decspecs.h def.h expr.h field.h file_info.h idf.h label.h nobitfield.h nofloat.h nopp.h sizes.h spec_arith.h struct.h type.h
+statement.o: LLlex.h Lpars.h arith.h botch_free.h code.h debug.h def.h expr.h file_info.h idf.h label.h nobitfield.h nofloat.h nopp.h spec_arith.h stack.h type.h
expression.o: LLlex.h Lpars.h arith.h expr.h file_info.h idf.h label.h nobitfield.h nofloat.h nopp.h spec_arith.h type.h
-program.o: LLlex.h Lpars.h alloc.h arith.h code.h declar.h decspecs.h def.h expr.h file_info.h idf.h label.h nobitfield.h nofloat.h nopp.h spec_arith.h type.h
+program.o: LLlex.h Lpars.h arith.h code.h declar.h decspecs.h def.h expr.h file_info.h idf.h label.h nobitfield.h nofloat.h nopp.h spec_arith.h type.h
Lpars.o: Lpars.h
char.o: class.h
symbol2str.o: Lpars.h
-!File: myalloc.h
-#define OWNALLOC 1 /* use own superfast allocation */
-#define ALLOCSIZ 4096 /* allocate pieces of 4K */
-#define ALIGNSIZE 8 /* needed for alloc.c */
-
-
!File: pathlength.h
#define PATHLENGTH 1024 /* max. length of path to file */
!File: maxincl.h
-#define MAXINCL 8 /* maximum number of #include directories */
+#define MAXINCL 12 /* maximum number of #include directories */
!File: density.h
semantics of C is a mess.
*/
-#include "nofloat.h"
#include "botch_free.h"
+#include <alloc.h>
+#include "nofloat.h"
#include "nobitfield.h"
-#include "alloc.h"
#include "idf.h"
#include "arith.h"
#include "type.h"
#include "label.h"
#include "expr.h"
#include "Lpars.h"
-#include "storage.h"
#include "field.h"
#include "mes.h"
*/
register struct expr *new = new_expr();
- clear((char *)new, sizeof(struct expr));
new->ex_file = expr->ex_file;
new->ex_line = expr->ex_line;
new->ex_type = tp;
/* $Header$ */
/* SEMANTIC ANALYSIS (CHAPTER 7RM) -- BINARY OPERATORS */
-#include "nofloat.h"
#include "botch_free.h"
+#include <alloc.h>
+#include "nofloat.h"
#include "idf.h"
#include "arith.h"
#include "type.h"
#include "label.h"
#include "expr.h"
#include "Lpars.h"
-#include "storage.h"
extern char options[];
extern char *symbol2str();
/* $Header$ */
/* SEMANTIC ANALYSIS (CHAPTER 7RM) -- MONADIC OPERATORS */
+#include "botch_free.h"
+#include <alloc.h>
#include "nofloat.h"
#include "nobitfield.h"
-#include "botch_free.h"
#include "Lpars.h"
#include "arith.h"
#include "type.h"
#include "label.h"
#include "expr.h"
-#include "storage.h"
#include "idf.h"
#include "def.h"
/* $Header$ */
/* C O D E - G E N E R A T I N G R O U T I N E S */
-#include "nofloat.h"
#include <em.h>
+#include "botch_free.h"
+#include <alloc.h>
+#include "nofloat.h"
#include "dataflow.h"
#include "use_tmp.h"
-#include "botch_free.h"
#include "arith.h"
#include "type.h"
#include "idf.h"
#include "label.h"
#include "code.h"
#include "stmt.h"
-#include "alloc.h"
#include "def.h"
#include "expr.h"
#include "sizes.h"
#include "mes.h"
#include "LLlex.h"
#include "specials.h"
-#include "storage.h"
#include "atw.h"
#include "assert.h"
C_init(word_size, pointer_size); /* initialise EM module */
if (C_open(dst_file) == 0)
fatal("cannot write to %s\n", dst_file);
-#ifndef USE_TMP
- famous_first_words();
+#ifdef USE_TMP
+ if (options['N'])
#endif USE_TMP
+ famous_first_words();
}
famous_first_words()
arith size;
register struct type *tp = def->df_type;
-#ifndef USE_TMP
+#ifdef USE_TMP
+ if (options['N']) code_scope(name,def);
+#else USE_TMP
code_scope(name, def);
#endif USE_TMP
#ifdef DATAFLOW
)
def->df_alloc = ALLOC_SEEN;
if (expr) { /* code only if initialized */
-#ifndef USE_TMP
+#ifdef USE_TMP
+ if (options['N'])
+#endif USE_TMP
code_scope(text, def);
-#endif USE_TMP
def->df_alloc = ALLOC_DONE;
C_df_dnam(text);
do_ival(&(def->df_type), expr);
case GLOBAL:
case IMPLICIT:
/* we are sure there is no expression */
-#ifndef USE_TMP
- code_scope(text, def);
+#ifdef USE_TMP
+ if (options['N'])
#endif USE_TMP
+ code_scope(text, def);
break;
case AUTO:
case REGISTER:
*/
arith size = idf->id_def->df_type->tp_size;
-#ifndef USE_TMP
- code_scope(idf->id_text, idf->id_def);
+#ifdef USE_TMP
+ if (options['N'])
#endif USE_TMP
+ code_scope(idf->id_text, idf->id_def);
/* Since bss() is only called if df_alloc is non-zero, and
since df_alloc is only non-zero if size >= 0, we have:
*/
label sc_dlb;
};
-/* ALLOCDEF "string_cst" */
+/* ALLOCDEF "string_cst" 10 */
#define LVAL 0
#define RVAL 1
/* DECLARATION SYNTAX PARSER */
{
+#include <alloc.h>
#include "nobitfield.h"
#include "debug.h"
#include "arith.h"
#include "label.h"
#include "expr.h"
#include "sizes.h"
-#include "storage.h"
extern char options[];
}
struct formal *dc_formal; /* params for function */
};
-/* ALLOCDEF "declarator" */
+/* ALLOCDEF "declarator" 50 */
struct formal { /* list of formals */
struct idf *fm_idf;
};
-/* ALLOCDEF "formal" */
+/* ALLOCDEF "formal" 5 */
#define NO_PARAMS ((struct formal *) 0)
arith du_count; /* for ARRAYs only */
};
-/* ALLOCDEF "decl_unary" */
+/* ALLOCDEF "decl_unary" 10 */
extern struct type *declare_type();
extern struct declarator null_declarator;
/* D E C L A R A T O R M A N I P U L A T I O N */
#include "botch_free.h"
-#include "alloc.h"
+#include <alloc.h>
#include "arith.h"
#include "type.h"
#include "Lpars.h"
#include "declar.h"
-#include "storage.h"
#include "idf.h"
#include "label.h"
#include "expr.h"
*/
register struct decl_unary *new = new_decl_unary();
- clear((char *)new, sizeof(struct decl_unary));
new->next = dc->dc_decl_unary;
new->du_fund = fund;
new->du_count = count;
int ds_unsigned; /* 0 or 1 */
};
-/* ALLOCDEF "decspecs" */
+/* ALLOCDEF "decspecs" 50 */
extern struct decspecs null_decspecs;
#define REG_DEFAULT 1 /* register candidate, not declared as such */
#define REG_BONUS 10 /* register candidate, declared as such */
-/* ALLOCDEF "def" */
+/* ALLOCDEF "def" 50 */
#include "textsize.h"
#include "idfsize.h"
#include "assert.h"
-#include "alloc.h"
+#include <alloc.h>
#include "class.h"
#include "macro.h"
-#include "storage.h"
IMPORT char *inctable[]; /* list of include directories */
IMPORT char *getwdir();
#include "nofloat.h"
#include "botch_free.h"
-#include "alloc.h"
+#include <alloc.h>
#include "idf.h"
#include "arith.h"
#include "def.h"
#include "Lpars.h"
#include "decspecs.h"
#include "declar.h"
-#include "storage.h"
#include "sizes.h"
#include "level.h"
pointer to which is stored in *expp.
*/
*expp = new_expr();
- clear((char *)*expp, sizeof(struct expr));
(*expp)->ex_file = dot.tk_file;
(*expp)->ex_line = dot.tk_line;
switch (DOT) {
*/
register struct expr *expr = new_expr();
- clear((char *)expr, sizeof(struct expr));
expr->ex_file = dot.tk_file;
expr->ex_line = dot.tk_line;
fill_int_expr(expr, ivalue, fund);
register struct expr *expr = new_expr();
register struct oper *op;
- clear((char *)expr, sizeof(struct expr));
if (e2) {
register struct expr *e = e2;
extern struct expr *intexpr(), *new_oper();
-/* ALLOCDEF "expr" */
+/* ALLOCDEF "expr" 50 */
#define ISCOMMA(e) ((e)->ex_class == Oper && (e)->OP_OPER == INITCOMMA)
struct sdef *fd_sdef; /* upward pointer */
};
-/* ALLOCDEF "field" */
+/* ALLOCDEF "field" 50 */
#include "idfsize.h"
#include "botch_free.h"
#include "nopp.h"
-#include "alloc.h"
+#include <alloc.h>
#include "arith.h"
#include "align.h"
#include "LLlex.h"
#include "Lpars.h"
#include "assert.h"
#include "specials.h" /* registration of special identifiers */
-#include "storage.h"
int idfsize = IDFSIZE;
extern char options[];
}
/* a new struct idf must be inserted at the hook */
notch = new_idf();
- clear((char *)notch, sizeof(struct idf));
notch->next = *hook;
*hook = notch; /* hooked in */
notch->id_text = Salloc(tg, size);
else { /* fill in the def block */
register struct def *newdef = new_def();
- clear((char *)newdef, sizeof(struct def));
newdef->next = def;
newdef->df_level = lvl;
newdef->df_type = type;
int id_special; /* special action needed at occurrence */
};
-/* ALLOCDEF "idf" */
+/* ALLOCDEF "idf" 50 */
extern struct idf *str2idf(), *idf_hashed();
#ifndef NOPP
#include <system.h>
-#include "alloc.h"
+#include <alloc.h>
#include "class.h"
#include "macro.h"
#include "idf.h"
char mc_flag; /* marking this macro */
};
-/* ALLOCDEF "macro" */
+/* ALLOCDEF "macro" 20 */
/* `token' numbers of keywords of command-line processor
*/
#include "nopp.h"
#include "target_sizes.h"
#include "debug.h"
-#include "myalloc.h"
#include "use_tmp.h"
#include "maxincl.h"
#include "inputtype.h"
#include "tokenname.h"
#include "Lpars.h"
#include "LLlex.h"
-#include "alloc.h"
+#include <alloc.h>
#include "specials.h"
extern struct tokenname tkidf[], tkother[];
/* parse and interpret the command line options */
prog_name = argv[0];
-#ifdef OWNALLOC
- init_mem();
-#endif OWNALLOC
-
init_hmask();
#ifndef NOPP
}
compile(argc - 1, &argv[1]);
-#ifdef OWNALLOC
-#ifdef DEBUG
- mem_stat();
-#endif DEBUG
-#endif OWNALLOC
-
#ifdef DEBUG
hash_stat();
#endif DEBUG
source = strcmp(argv[0], "-") ? argv[0] : 0;
#ifdef USE_TMP
- strcpy(tmpf, tmpfdir);
- strcat(tmpf, tmpfname);
- tmpfile = mktemp(tmpf);
+ if (! options['N']) {
+ strcpy(tmpf, tmpfdir);
+ strcat(tmpf, tmpfname);
+ tmpfile = mktemp(tmpf);
+ }
#endif USE_TMP
if (destination && strcmp(destination, "-") == 0)
#endif NOPP
#ifdef USE_TMP
- init_code(tmpfile);
+ if (!options['N']) {
+ init_code(tmpfile);
+ }
+ else
+ init_code(destination);
#else USE_TMP
init_code(destination);
#endif USE_TMP
end_code();
#ifdef USE_TMP
- prepend_scopes(destination);
- AppendFile(tmpfile, destination);
- sys_remove(tmpfile);
+ if (! options['N']) {
+ prepend_scopes(destination);
+ AppendFile(tmpfile, destination);
+ sys_remove(tmpfile);
+ }
#endif USE_TMP
#ifdef DEBUG
-sed '
-s:^.*ALLOCDEF.*"\(.*\)".*$:\
+sed -e '
+s:^.*[ ]ALLOCDEF[ ].*"\(.*\)"[ ]*\([0-9][0-9]*\).*$:\
/* allocation definitions of struct \1 */\
+extern char *st_alloc();\
extern struct \1 *h_\1;\
-#define new_\1() ((struct \1 *) \\\
- st_alloc((char **)\&h_\1, sizeof(struct \1)))\
-#define free_\1(p) st_free(p, h_\1, sizeof(struct \1))\
+#define new_\1() ((struct \1 *) st_alloc((char **)\&h_\1, sizeof(struct \1), \2))\
+#define free_\1(p) st_free(p, \&h_\1, sizeof(struct \1))\
:'
/* $Header$ */
/* U S E R O P T I O N - H A N D L I N G */
+#include "botch_free.h"
+#include <alloc.h>
#include "nofloat.h"
#include "nopp.h"
#include "idfsize.h"
#include "arith.h"
#include "sizes.h"
#include "align.h"
-#include "storage.h"
#include "use_tmp.h"
#ifndef NOPP
fatal("maximum identifier length is %d", IDFSIZE);
break;
+ case 'N' :
+#ifdef USE_TMP
+ options['N'] = 1;
+#else USE_TMP
+ warning("-N option ignored");
+#endif USE_TMP
+ break;
+
case 'P' : /* run preprocessor stand-alone, without #'s */
#ifndef NOPP
options['E'] = 1;
{
#include "nopp.h"
-#include "alloc.h"
#include "arith.h"
#include "LLlex.h"
#include "idf.h"
#include "debug.h" /* UF */
#include "pathlength.h" /* UF */
#include "strsize.h" /* UF */
-#include "alloc.h"
+#include <alloc.h>
#include "idf.h"
#include "input.h"
#include "macro.h"
#include <em.h>
#include <em_reg.h>
#include "debug.h"
-#include "use_tmp.h"
#include "botch_free.h"
-#include "alloc.h"
+#include <alloc.h>
#include "Lpars.h"
#include "arith.h"
#include "stack.h"
#include "idf.h"
#include "def.h"
#include "struct.h"
-#include "storage.h"
#include "level.h"
#include "mes.h"
*/
register struct stack_level *stl = new_stack_level();
- clear((char *)stl, sizeof(struct stack_level));
local_level->sl_next = stl;
stl->sl_previous = local_level;
stl->sl_level = ++level;
*/
register struct stack_entry *se = new_stack_entry();
- clear((char *)se, sizeof(struct stack_entry));
/* link it into the stack level */
se->next = stl->sl_entry;
se->se_idf = idf;
int sl_level;
};
-/* ALLOCDEF "stack_level" */
+/* ALLOCDEF "stack_level" 5 */
struct stack_entry {
struct stack_entry *next;
struct idf *se_idf;
};
-/* ALLOCDEF "stack_entry" */
+/* ALLOCDEF "stack_entry" 5 */
extern struct stack_level *local_level;
extern struct stack_level *stack_level_of();
#include "label.h"
#include "expr.h"
#include "code.h"
-#include "storage.h"
#include "stack.h"
#include "def.h"
label st_continue;
};
-/* ALLOCDEF "stmt_block" */
+/* ALLOCDEF "stmt_block" 5 */
#include "nobitfield.h"
#include "debug.h"
#include "botch_free.h"
+#include <alloc.h>
#include "arith.h"
#include "stack.h"
#include "idf.h"
#include "Lpars.h"
#include "align.h"
#include "level.h"
-#include "storage.h"
#include "assert.h"
#include "sizes.h"
if (!is_anon_idf(idf))
error("unknown selector %s", idf->id_text);
*sdefp = sdef = new_sdef();
- clear((char *)sdef, sizeof(struct sdef));
sdef->sd_idf = idf;
sdef->sd_stype = sdef->sd_type = error_type;
return sdef;
arith sd_offset;
};
-/* ALLOCDEF "sdef" */
+/* ALLOCDEF "sdef" 50 */
struct tag { /* for struct-, union- and enum tags */
struct tag *next;
};
-/* ALLOCDEF "tag" */
+/* ALLOCDEF "tag" 50 */
struct sdef *idf2sdef();
#include <em.h>
#include "debug.h"
#include "botch_free.h"
+#include <alloc.h>
#include "density.h"
#include "Lpars.h"
#include "idf.h"
#include "arith.h"
#include "switch.h"
#include "code.h"
-#include "storage.h"
#include "assert.h"
#include "expr.h"
#include "type.h"
struct case_entry *sh_entries;
};
-/* ALLOCDEF "switch_hdr" */
+/* ALLOCDEF "switch_hdr" 2 */
struct case_entry {
struct case_entry *next;
arith ce_value;
};
-/* ALLOCDEF "case_entry" */
+/* ALLOCDEF "case_entry" 40 */
#include "nofloat.h"
#include "nobitfield.h"
-#include "alloc.h"
+#include "botch_free.h"
+#include <alloc.h>
#include "Lpars.h"
#include "arith.h"
#include "type.h"
#include "def.h"
#include "sizes.h"
#include "align.h"
-#include "storage.h"
struct type *function_of(), *array_of();
#ifndef NOBITFIELD
*/
register struct type *ntp = new_type();
- clear((char *)ntp, sizeof(struct type));
ntp->tp_fund = fund;
ntp->tp_size = (arith)-1;
extern arith size_of_type(), align();
-/* ALLOCDEF "type" */
+/* ALLOCDEF "type" 50 */