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 IDF_H_
|
|
|
|
#define IDF_H_
|
|
|
|
|
|
|
|
|
1994-06-27 08:03:14 +00:00
|
|
|
/* $Id$ */
|
1989-02-07 11:04:05 +00:00
|
|
|
/* IDENTIFIER DESCRIPTOR */
|
|
|
|
|
2013-05-12 19:45:55 +00:00
|
|
|
#include "parameters.h"
|
2019-02-18 16:42:15 +00:00
|
|
|
#include "arith.h"
|
1989-02-07 11:04:05 +00:00
|
|
|
|
1991-06-19 16:12:56 +00:00
|
|
|
struct id_u {
|
|
|
|
int idd_reserved; /* non-zero for reserved words */
|
|
|
|
char *idd_file; /* file containing the occurrence */
|
|
|
|
unsigned int idd_line; /* line number of the occurrence */
|
|
|
|
struct def *idd_label; /* labels */
|
|
|
|
struct def *idd_def; /* variables, typedefs, enum-constants */
|
|
|
|
struct sdef *idd_sdef; /* selector tags */
|
1991-07-08 16:49:04 +00:00
|
|
|
struct tag *idd_tag; /* struct, union, and enum tags */
|
1991-06-19 16:12:56 +00:00
|
|
|
int idd_special; /* special action needed at occurrence */
|
1989-02-07 11:04:05 +00:00
|
|
|
};
|
|
|
|
|
1991-06-19 16:12:56 +00:00
|
|
|
#define IDF_TYPE struct id_u
|
|
|
|
#define id_macro id_user.idd_macro
|
|
|
|
#define id_resmac id_user.idd_resmac
|
|
|
|
#define id_reserved id_user.idd_reserved
|
|
|
|
#define id_file id_user.idd_file
|
|
|
|
#define id_line id_user.idd_line
|
|
|
|
#define id_label id_user.idd_label
|
|
|
|
#define id_def id_user.idd_def
|
|
|
|
#define id_sdef id_user.idd_sdef
|
1991-07-08 16:49:04 +00:00
|
|
|
#define id_tag id_user.idd_tag
|
1991-06-19 16:12:56 +00:00
|
|
|
#define id_special id_user.idd_special
|
|
|
|
|
|
|
|
#include <idf_pkg.spec>
|
1989-02-07 11:04:05 +00:00
|
|
|
|
|
|
|
extern int level;
|
2019-02-18 16:42:15 +00:00
|
|
|
|
|
|
|
struct decspecs;
|
|
|
|
struct declarator;
|
|
|
|
struct type;
|
|
|
|
struct formal;
|
|
|
|
|
|
|
|
|
|
|
|
struct idf *gen_idf(void);
|
|
|
|
int is_anon_idf(struct idf *idf);
|
|
|
|
void declare_idf(struct decspecs *ds, struct declarator *dc, int lvl);
|
|
|
|
int actual_declaration(int sc, struct type *tp);
|
|
|
|
void global_redecl(register struct idf *idf, int new_sc, struct type *tp);
|
|
|
|
int good_formal(register struct def *def, register struct idf *idf);
|
|
|
|
void declare_params(struct declarator *dc);
|
|
|
|
void idf_initialized(register struct idf *idf);
|
|
|
|
void declare_parameter(struct idf *idf);
|
|
|
|
void declare_enum(struct type *tp, struct idf *idf, arith l);
|
|
|
|
void check_formals(struct idf *idf, struct declarator *dc);
|
|
|
|
void declare_formals(struct idf *idf, arith *fp);
|
|
|
|
int regtype(struct type *tp);
|
|
|
|
void add_def(struct idf *idf, int sc, struct type *tp, int lvl);
|
|
|
|
void update_ahead(register struct idf *idf);
|
|
|
|
void free_formals(register struct formal *fm);
|
|
|
|
|
|
|
|
#endif
|