+/*
+ * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
+ * See the copyright notice in the ACK home directory, in the file "Copyright".
+ */
/* $Header$ */
/* L E X I C A L A N A L Y Z E R */
int UnknownIdIsZero = 0; /* interpret unknown id as integer 0 */
int SkipEscNewline = 0; /* how to interpret backslash-newline */
int Unstacked = 0; /* an unstack is done */
+int File_Inserted = 0; /* a file has just been inserted */
#define MAX_LL_DEPTH 2
char buf[(IDFSIZE > NUMSIZE ? IDFSIZE : NUMSIZE) + 1];
register int ch, nch;
- if (! LineNumber) goto firstline;
+ if (File_Inserted) {
+ File_Inserted = 0;
+ goto firstline;
+ }
again: /* rescan the input after an error or replacement */
#ifndef NOPP
if (Unstacked) EnableMacros();
return ptok->tk_symb = EOI;
while (LoadChar(ch), ch == '#') { /* a control line follows */
domacro();
- if (!LineNumber) goto firstline;
+ if (File_Inserted) {
+ File_Inserted = 0;
+ goto firstline;
+ }
}
/* We have to loop here, because in
`domacro' the nl, vt or ff is read. The
+/*
+ * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
+ * See the copyright notice in the ACK home directory, in the file "Copyright".
+ */
/* $Header$ */
/* D E F I N I T I O N S F O R T H E L E X I C A L A N A L Y Z E R */
extern int UnknownIdIsZero; /* "LLlex.c" */
extern int SkipEscNewline; /* "LLlex.c" */
extern int Unstacked; /* "LLlex.c" */
+extern int File_Inserted; /* "LLlex.c" */
extern int NoUnstack; /* buffer.c */
+/*
+ * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
+ * See the copyright notice in the ACK home directory, in the file "Copyright".
+ */
/* $Header$ */
/* PARSER ERROR ADMINISTRATION */
+/* $Header$ */
+/*
+ * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
+ * See the copyright notice in the ACK home directory, in the file "Copyright".
+ */
static char Version[] = "ACK CEM compiler Version 3.1";
+/*
+ * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
+ * See the copyright notice in the ACK home directory, in the file "Copyright".
+ */
/* $Header$ */
/* A L I G N M E N T D E F I N I T I O N S */
+/*
+ * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
+ * See the copyright notice in the ACK home directory, in the file "Copyright".
+ */
/* $Header$ */
/* A R I T H M E T I C C O N V E R S I O N S */
+/*
+ * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
+ * See the copyright notice in the ACK home directory, in the file "Copyright".
+ */
/* $Header$ */
/* COMPILER ARITHMETIC */
+/*
+ * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
+ * See the copyright notice in the ACK home directory, in the file "Copyright".
+ */
/* $Header$ */
/* A S M */
+/*
+ * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
+ * See the copyright notice in the ACK home directory, in the file "Copyright".
+ */
/* $Header$ */
/* A S S E R T I O N M A C R O D E F I N I T I O N */
+/*
+ * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
+ * See the copyright notice in the ACK home directory, in the file "Copyright".
+ */
/* $Header$ */
/* Align To Word boundary Definition */
+/*
+ * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
+ * See the copyright notice in the ACK home directory, in the file "Copyright".
+ */
/* $Header$ */
/* B L O C K S T O R I N G A N D L O A D I N G */
+/*
+ * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
+ * See the copyright notice in the ACK home directory, in the file "Copyright".
+ */
/* $Header$ */
/*
Driver for the CEMCOM compiler: works like /bin/cc and accepts
+/*
+ * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
+ * See the copyright notice in the ACK home directory, in the file "Copyright".
+ */
/* $Header$ */
/* S E M A N T I C A N A L Y S I S -- C H A P T E R 7 RM */
+/*
+ * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
+ * See the copyright notice in the ACK home directory, in the file "Copyright".
+ */
/* $Header$ */
/* SEMANTIC ANALYSIS (CHAPTER 7RM) -- BINARY OPERATORS */
+/*
+ * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
+ * See the copyright notice in the ACK home directory, in the file "Copyright".
+ */
/* $Header$ */
/* SEMANTIC ANALYSIS (CHAPTER 7RM) -- MONADIC OPERATORS */
+/*
+ * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
+ * See the copyright notice in the ACK home directory, in the file "Copyright".
+ */
/* $Header$ */
/* U S E O F C H A R A C T E R C L A S S E S */
+/*
+ * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
+ * See the copyright notice in the ACK home directory, in the file "Copyright".
+ */
/* $Header$ */
/* C O D E - G E N E R A T I N G R O U T I N E S */
+/*
+ * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
+ * See the copyright notice in the ACK home directory, in the file "Copyright".
+ */
/* $Header$ */
/* C O N V E R S I O N - C O D E G E N E R A T O R */
+/*
+ * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
+ * See the copyright notice in the ACK home directory, in the file "Copyright".
+ */
/* $Header$ */
/* 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 */
+/*
+ * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
+ * See the copyright notice in the ACK home directory, in the file "Copyright".
+ */
/* $Header$ */
/* DATAFLOW ANALYSIS ON C PROGRAMS */
+/*
+ * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
+ * See the copyright notice in the ACK home directory, in the file "Copyright".
+ */
/* $Header$ */
/* DECLARATION SYNTAX PARSER */
+/*
+ * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
+ * See the copyright notice in the ACK home directory, in the file "Copyright".
+ */
/* $Header$ */
/* D E C L A R A T O R M A N I P U L A T I O N */
+/*
+ * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
+ * See the copyright notice in the ACK home directory, in the file "Copyright".
+ */
/* $Header$ */
/* D E C L A R A T I O N S P E C I F I E R C H E C K I N G */
+/*
+ * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
+ * See the copyright notice in the ACK home directory, in the file "Copyright".
+ */
/* $Header$ */
/* PREPROCESSOR: CONTROLLINE INTERPRETER */
}
else {
WorkingDir = getwdir(result);
+ File_Inserted = 1;
FileName = result;
LineNumber = 0;
}
SkipRestOfLine();
}
-PRIVATE
-do_line(l)
- unsigned int l;
-{
- struct token tk;
-
- LineNumber = l - 1; /* the number of the next input line */
- if (GetToken(&tk) == STRING) /* is there a filespecifier? */
- FileName = tk.tk_bts;
- SkipRestOfLine();
-}
-
PRIVATE int
getparams(buf, parbuf)
char *buf[];
SkipRestOfLine();
return;
}
- LineNumber = tk.tk_ival - 1; /* number of the next line */
- if ((tok = GetToken(&tk)) == STRING)
- FileName = tk.tk_bts;
- else
- if (tok != EOI) {
- error("illegal # line");
- SkipRestOfLine();
- }
+ do_line(tk.tk_ival);
EoiForNewline = 0;
SkipEscNewline = 0;
}
PushBack();
skipline();
}
+
+PRIVATE
+do_line(l)
+ unsigned int l;
+{
+ struct token tk;
+
+ LineNumber = l - 1; /* the number of the next input line */
+ if (GetToken(&tk) == STRING) /* is there a filespecifier? */
+ FileName = tk.tk_bts;
+ SkipRestOfLine();
+}
+/*
+ * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
+ * See the copyright notice in the ACK home directory, in the file "Copyright".
+ */
/* $Header$ */
/* DUMP ROUTINES */
+/*
+ * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
+ * See the copyright notice in the ACK home directory, in the file "Copyright".
+ */
/* $Header$ */
/* 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 */
+/*
+ * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
+ * See the copyright notice in the ACK home directory, in the file "Copyright".
+ */
/* $Header$ */
/* EXPRESSION-CODE GENERATOR */
+/*
+ * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
+ * See the copyright notice in the ACK home directory, in the file "Copyright".
+ */
/* $Header$ */
/* EXPRESSION TREE HANDLING */
+/*
+ * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
+ * See the copyright notice in the ACK home directory, in the file "Copyright".
+ */
/* $Header$ */
/* EXPRESSION SYNTAX PARSER */
+/*
+ * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
+ * See the copyright notice in the ACK home directory, in the file "Copyright".
+ */
/* $Header$ */
/* FAULTY DEFINITIONS */
+/*
+ * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
+ * See the copyright notice in the ACK home directory, in the file "Copyright".
+ */
/* $Header$ */
/* BITFIELD EXPRESSION EVALUATOR */
+/*
+ * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
+ * See the copyright notice in the ACK home directory, in the file "Copyright".
+ */
/* $Header$ */
/* F I L E I N F O R M A T I O N S T R U C T U R E */
+/*
+ * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
+ * See the copyright notice in the ACK home directory, in the file "Copyright".
+ */
/* $Header$ */
/* IDENTIFIER FIDDLING & SYMBOL TABLE HANDLING */
+/*
+ * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
+ * See the copyright notice in the ACK home directory, in the file "Copyright".
+ */
/* $Header$ */
/* PREPROCESSOR: INITIALIZATION ROUTINES */
+/*
+ * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
+ * See the copyright notice in the ACK home directory, in the file "Copyright".
+ */
/* $Header$ */
#include "inputtype.h"
+/*
+ * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
+ * See the copyright notice in the ACK home directory, in the file "Copyright".
+ */
/* $Header$ */
#include <inp_pkg.spec>
+/* $Header$ */
+/*
+ * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
+ * See the copyright notice in the ACK home directory, in the file "Copyright".
+ */
#define PRIVATE
#define IMPORT extern
#define EXPORT
+/*
+ * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
+ * See the copyright notice in the ACK home directory, in the file "Copyright".
+ */
/* $Header$ */
/* CODE FOR THE INITIALISATION OF GLOBAL VARIABLES */
+/*
+ * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
+ * See the copyright notice in the ACK home directory, in the file "Copyright".
+ */
/* $Header$ */
/* L A B E L H A N D L I N G */
+/*
+ * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
+ * See the copyright notice in the ACK home directory, in the file "Copyright".
+ */
/* $Header$ */
/* L A B E L D E F I N I T I O N */
+/*
+ * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
+ * See the copyright notice in the ACK home directory, in the file "Copyright".
+ */
/* $Header$ */
/* LEVEL DEFINITIONS */
+/*
+ * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
+ * See the copyright notice in the ACK home directory, in the file "Copyright".
+ */
/* $Header$ */
/* MAIN PROGRAM */
if (!InsertFile(source, (char **) 0, &result)) /* read the source file */
fatal("%s: no source file %s\n", prog_name,
source ? source : "stdin");
+ File_Inserted = 1;
init();
FileName = source;
LineNumber = 0;
+/* $Header$ */
+/*
+ * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
+ * See the copyright notice in the ACK home directory, in the file "Copyright".
+ */
/* mcomm.c -- change ".lcomm name" into ".comm name" where "name"
is specified in a list.
*/
+/*
+ * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
+ * See the copyright notice in the ACK home directory, in the file "Copyright".
+ */
/* $Header$ */
/* MESSAGE ADMINISTRATION */
+/*
+ * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
+ * See the copyright notice in the ACK home directory, in the file "Copyright".
+ */
/* $Header$ */
/* U S E R O P T I O N - H A N D L I N G */
+/*
+ * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
+ * See the copyright notice in the ACK home directory, in the file "Copyright".
+ */
/* $Header$ */
/* PROGRAM PARSER */
+/*
+ * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
+ * See the copyright notice in the ACK home directory, in the file "Copyright".
+ */
/* $Header$ */
/* PREPROCESSOR: MACRO-TEXT REPLACEMENT ROUTINES */
+/*
+ * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
+ * See the copyright notice in the ACK home directory, in the file "Copyright".
+ */
/* $Header$ */
/* PREPROCESSOR: SCANNER FOR THE ACTUAL PARAMETERS OF MACROS */
+/*
+ * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
+ * See the copyright notice in the ACK home directory, in the file "Copyright".
+ */
/* $Header$ */
/* VARIOUS TARGET MACHINE SIZE DESCRIPTORS */
+/*
+ * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
+ * See the copyright notice in the ACK home directory, in the file "Copyright".
+ */
/* $Header$ */
/* PREPROCESSOR: INPUT SKIP FUNCTIONS */
+/*
+ * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
+ * See the copyright notice in the ACK home directory, in the file "Copyright".
+ */
/* $Header$ */
/* OCCURANCES OF SPECIAL IDENTIFIERS */
+/*
+ * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
+ * See the copyright notice in the ACK home directory, in the file "Copyright".
+ */
/* $Header$ */
/* S T A C K / U N S T A C K R O U T I N E S */
+/*
+ * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
+ * See the copyright notice in the ACK home directory, in the file "Copyright".
+ */
/* $Header$ */
/* STATEMENT SYNTAX PARSER */
+/*
+ * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
+ * See the copyright notice in the ACK home directory, in the file "Copyright".
+ */
/* $Header$ */
/* library routine for copying structs */
+/*
+ * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
+ * See the copyright notice in the ACK home directory, in the file "Copyright".
+ */
/* $Header$ */
/* ADMINISTRATION OF STRUCT AND UNION DECLARATIONS */
+/*
+ * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
+ * See the copyright notice in the ACK home directory, in the file "Copyright".
+ */
/* $Header$ */
/* 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 */
+/*
+ * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
+ * See the copyright notice in the ACK home directory, in the file "Copyright".
+ */
/* $Header$ */
/* @cc tab.c -o $INSTALLDIR/tab@
tab - table generator
+/*
+ * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
+ * See the copyright notice in the ACK home directory, in the file "Copyright".
+ */
/* $Header$ */
/* TOKEN NAME DEFINITIONS */
+/*
+ * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
+ * See the copyright notice in the ACK home directory, in the file "Copyright".
+ */
/* $Header$ */
/* TOKENNAME DEFINITION */
+/*
+ * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
+ * See the copyright notice in the ACK home directory, in the file "Copyright".
+ */
/* $Header$ */
/* T Y P E D E F I N I T I O N M E C H A N I S M */
dtp = pointer_to(tp);
break;
case ARRAY:
- if (tp->tp_size < 0) {
+ if (count >= 0 && tp->tp_size < 0) {
error("cannot construct array of unknown type");
count = (arith)-1;
}