1989-02-07 11:04:05 +00:00
|
|
|
/*
|
|
|
|
* (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
|
|
|
|
* See the copyright notice in the ACK home directory, in the file "Copyright".
|
|
|
|
*/
|
2019-02-18 16:42:15 +00:00
|
|
|
#ifndef CODE_H_
|
|
|
|
#define CODE_H_
|
1994-06-27 08:03:14 +00:00
|
|
|
/* $Id$ */
|
1989-02-07 11:04:05 +00:00
|
|
|
/* C O D E - G E N E R A T O R D E F I N I T I O N S */
|
|
|
|
|
2019-02-18 16:42:15 +00:00
|
|
|
#include "arith.h"
|
|
|
|
#include "label.h"
|
|
|
|
|
|
|
|
|
1989-02-07 11:04:05 +00:00
|
|
|
struct string_cst { /* storing string constants */
|
|
|
|
struct string_cst *next;
|
|
|
|
char *sc_value;
|
|
|
|
int sc_len;
|
|
|
|
label sc_dlb;
|
|
|
|
};
|
|
|
|
|
|
|
|
extern struct string_cst *str_list;
|
|
|
|
|
1990-01-16 15:21:15 +00:00
|
|
|
/* ALLOCDEF "string_cst" 5 */
|
1989-02-07 11:04:05 +00:00
|
|
|
|
|
|
|
#define LVAL 0
|
|
|
|
#define RVAL 1
|
|
|
|
#define FALSE 0
|
|
|
|
#define TRUE 1
|
2019-02-18 16:42:15 +00:00
|
|
|
|
|
|
|
|
|
|
|
#ifndef LINT
|
|
|
|
void init_code(char *dst_file);
|
|
|
|
void end_code(void);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
struct expr;
|
|
|
|
struct def;
|
|
|
|
struct idf;
|
2019-02-23 16:46:05 +00:00
|
|
|
struct decspecs;
|
2019-02-18 16:42:15 +00:00
|
|
|
|
|
|
|
label code_string(char* val, int len);
|
|
|
|
void def_strings(register struct string_cst *sc);
|
|
|
|
void flush_strings(void);
|
|
|
|
void code_scope(char* text, register struct def *def);
|
|
|
|
void begin_proc(struct decspecs *ds, struct idf *idf);
|
|
|
|
void end_proc(arith fbytes);
|
|
|
|
void do_return(void);
|
|
|
|
void do_return_expr(struct expr *expr);
|
|
|
|
void code_declaration(register struct idf *idf, struct expr *expr,
|
|
|
|
int lvl, int sc);
|
|
|
|
void loc_init(struct expr *expr, struct idf *id);
|
|
|
|
void bss(register struct idf *idf);
|
|
|
|
void formal_cvt(int hasproto, register struct def *df);
|
|
|
|
void code_expr(struct expr *expr, int val, int code, label tlbl, label flbl);
|
|
|
|
void code_break(void);
|
|
|
|
void code_continue(void);
|
|
|
|
void stack_stmt(label break_label, label cont_label);
|
|
|
|
void unstack_stmt(void);
|
|
|
|
void prc_entry(char* name);
|
|
|
|
void prc_exit(void);
|
|
|
|
|
|
|
|
#ifdef PREPEND_SCOPES
|
|
|
|
void prepend_scopes(void);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef DBSYMTAB
|
|
|
|
void db_line(char *file, unsigned int line);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|