2019-03-01 17:39:25 +00:00
|
|
|
/* Copyright (c) 2019 ACK Project.
|
|
|
|
* See the copyright notice in the ACK home directory,
|
|
|
|
* in the file "Copyright".
|
|
|
|
*
|
|
|
|
* Created on: 2019-02-27
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
#ifndef ENTER_H_
|
|
|
|
#define ENTER_H_
|
|
|
|
|
|
|
|
/* Forward declarations. */
|
2019-05-10 17:09:03 +00:00
|
|
|
struct type;
|
|
|
|
struct node;
|
|
|
|
struct scope;
|
|
|
|
struct paramlist;
|
|
|
|
struct def;
|
2019-03-01 17:39:25 +00:00
|
|
|
|
|
|
|
|
2019-05-10 17:09:03 +00:00
|
|
|
struct def *Enter(char *name, int kind, struct type *type, int pnam);
|
|
|
|
struct def *EnterType(char *name, struct type *type);
|
|
|
|
void EnterEnumList(struct node *Idlist, register struct type *type);
|
|
|
|
void EnterFieldList(struct node *Idlist, register struct type *type, struct scope *scope,
|
2019-03-01 17:39:25 +00:00
|
|
|
arith *addr);
|
|
|
|
/* Enter a list of identifiers representing variables into the
|
|
|
|
name list. "type" represents the type of the variables.
|
|
|
|
"local" is set if the variables are declared local to a
|
|
|
|
procedure.
|
|
|
|
*/
|
2019-05-10 17:09:03 +00:00
|
|
|
void EnterVarList(struct node *Idlist, struct type *type, int local);
|
2019-03-01 17:39:25 +00:00
|
|
|
/* Create (part of) a parameterlist of a procedure.
|
|
|
|
"ids" indicates the list of identifiers, "tp" their type, and
|
|
|
|
"VARp" indicates D_VARPAR or D_VALPAR.
|
|
|
|
*/
|
2019-05-10 17:09:03 +00:00
|
|
|
void EnterParamList(struct paramlist **ppr, struct node *Idlist, struct type *type,
|
2019-03-01 17:39:25 +00:00
|
|
|
int VARp, arith *off);
|
|
|
|
/* From the current scope, the list of identifiers "ids" is
|
|
|
|
exported. Note this fact. If the export is not qualified, make
|
|
|
|
all the "ids" visible in the enclosing scope by defining them
|
|
|
|
in this scope as "imported".
|
|
|
|
*/
|
2019-05-10 17:09:03 +00:00
|
|
|
void EnterExportList(struct node *Idlist, int qualified);
|
|
|
|
void CheckForImports(struct def *df);
|
|
|
|
void EnterFromImportList(struct node *idlist, struct def *FromDef, struct node *FromId);
|
|
|
|
void EnterImportList(struct node *idlist, int local, struct scope *sc);
|
2019-03-01 17:39:25 +00:00
|
|
|
|
|
|
|
#endif /* ENTER_H_ */
|