* (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
* See the copyright notice in the ACK home directory, in the file "Copyright".
*/
+
+#include <stdlib.h>
#include <stdio.h>
+#include <string.h>
#include "gen.h"
#include "top.h"
#include "queue.h"
+/* Defined in the string module, which has no header file. FIXME. */
+
+extern char* strindex(char *s, int c);
+
/* STANDARD MACHINE-INDEPENT C CODE *************/
extern char *lstrip();
extern instr_p newinstr();
extern instr_p read_instr();
extern instr_p gen_instr();
-extern char * malloc();
-extern char *strcat();
-extern char *strcpy();
-extern char *strncpy();
struct variable var[NRVARS+1];
struct variable ANY; /* ANY symbol matching any instruction */
* maintains the the lists of hashed patterns
* Functions : addtohashtable() and printhashtable()
*/
-# include <stdio.h>
-# include "misc.h"
+
+#include <stdlib.h>
+#include <stdio.h>
+#include "misc.h"
struct hlist { /* linear list of pattern numbers */
int h_patno;
*/
unsigned hval;
register struct hlist *p;
- char *malloc();
hval = hash(s);
p = (struct hlist *) malloc(sizeof *p);
* Contains the main program, the error reporting routine, and a routine
* to check wether a constraint consists only of space
*/
-# include <stdio.h>
+
+#include <stdlib.h>
+#include <stdio.h>
extern int lineno, newline;
* it maintains a table of information about the patterns
* Functions : addpattern() and printpatterns()
*/
-# include <stdio.h>
-# include <ctype.h>
-# include "misc.h"
-# include "symtab.h"
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <ctype.h>
+#include "misc.h"
+#include "symtab.h"
struct pattern {
char *p_constraint; /* constraint of this pattern */
* "nr" is the number of instructions in the replacement
* Space is allocated in chunks of 50
*/
- char *malloc(), *realloc();
register struct pattern *p;
if (!pattable) { /* No space allocated yet */
* Contains the routine findident, which builds the symbol table and
* searches identifiers
*/
-# include "symtab.h"
+
+#include <stdlib.h>
+#include <string.h>
+#include "symtab.h"
struct symtab *idtable, *deftable;
* If mode = ENTERING, a new entry will be made if s is not in the
* table yet, otherwise an error results
*/
- char *malloc();
- char *strcpy();
register struct symtab *p;
register n;
%start LLparse, optim_description;
{
-# include <stdio.h>
-# include "token.h"
-# include "symtab.h"
-# include "misc.h"
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include "token.h"
+#include "symtab.h"
+#include "misc.h"
char idbuf[BUFSIZ], buf[BUFSIZ];
int countid; /* # of variables */
int countpat; /* # of patterns */
-char * malloc();
-char * strcpy();
static int patlen; /* Maximum number of instructions in pattern */
static int maxoperand; /* Maximum number of operands of instruction */
extern FILE *input; /* file descriptor of inputfile */