1988-10-26 15:21:11 +00:00
|
|
|
/* E X P R E S S I O N C H E C K I N G */
|
|
|
|
|
2019-02-23 16:44:50 +00:00
|
|
|
struct node;
|
|
|
|
|
2019-03-01 17:41:01 +00:00
|
|
|
extern int (*ExprChkTable[])(struct node*); /* table of expression checking
|
1988-10-26 15:21:11 +00:00
|
|
|
functions, indexed by node class
|
|
|
|
*/
|
|
|
|
|
2019-03-01 17:41:01 +00:00
|
|
|
extern int (*VarAccChkTable[])(struct node*); /* table of variable-access checking
|
1988-10-26 15:21:11 +00:00
|
|
|
functions, indexed by node class
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define ChkExpression(expp) ((*ExprChkTable[(expp)->nd_class])(expp))
|
|
|
|
#define ChkVarAccess(expp) ((*VarAccChkTable[(expp)->nd_class])(expp))
|
2019-02-23 16:44:50 +00:00
|
|
|
|
|
|
|
int ChkConstant(register struct node *expp);
|
|
|
|
int ChkVariable(register struct node *expp);
|
|
|
|
/* Check that "expp" indicates an item that can be the lhs
|
|
|
|
of an assignment, return 1 if possible, on return 0.
|
|
|
|
*/
|
|
|
|
int ChkLhs(register struct node *expp);
|
|
|
|
int ChkLinkOrName(register struct node *expp);
|
|
|
|
char *ChkAllowedVar(register struct node *nd, int reading);
|
|
|
|
int ChkCall(register struct node *expp);
|
|
|
|
void MarkUsed(register struct node *nd);
|