1987-04-29 10:22:07 +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".
|
|
|
|
*
|
|
|
|
* Author: Ceriel J.H. Jacobs
|
|
|
|
*/
|
2019-03-01 17:39:25 +00:00
|
|
|
#ifndef CHK_EXPR_H_
|
|
|
|
#define CHK_EXPR_H_
|
1987-04-29 10:22:07 +00:00
|
|
|
|
1986-06-17 12:04:05 +00:00
|
|
|
/* E X P R E S S I O N C H E C K I N G */
|
|
|
|
|
1994-06-24 14:02:31 +00:00
|
|
|
/* $Id$ */
|
1987-04-29 10:22:07 +00:00
|
|
|
|
2019-03-01 17:39:25 +00:00
|
|
|
extern int (*ExprChkTable[])(t_node **, int); /* table of expression checking
|
1986-06-26 09:39:36 +00:00
|
|
|
functions, indexed by node class
|
|
|
|
*/
|
2019-03-01 17:39:25 +00:00
|
|
|
extern int (*DesigChkTable[])(t_node **, int); /* table of designator checking
|
1986-06-17 12:04:05 +00:00
|
|
|
functions, indexed by node class
|
|
|
|
*/
|
|
|
|
|
2019-03-01 17:39:25 +00:00
|
|
|
#define ChkExpression(expp) ((*ExprChkTable[(unsigned int)((*expp)->nd_class)])(expp,D_USED))
|
|
|
|
#define ChkDesig(expp, flags) ((*DesigChkTable[(unsigned int)((*expp)->nd_class)])(expp,flags))
|
1987-09-23 16:39:43 +00:00
|
|
|
|
1988-03-22 17:54:01 +00:00
|
|
|
/* handle reference counts for sets */
|
|
|
|
#define inc_refcount(s) (*((int *)(s) - 1) += 1)
|
|
|
|
#define dec_refcount(s) (*((int *)(s) - 1) -= 1)
|
|
|
|
#define refcount(s) (*((int *)(s) - 1))
|
2019-03-01 17:39:25 +00:00
|
|
|
|
|
|
|
void MkCoercion(t_node **pnd, register t_type *tp);
|
|
|
|
int ChkVariable(register t_node **expp, int flags);
|
|
|
|
int ChkCall(t_node **expp);
|
|
|
|
void TryToString(register t_node *nd, t_type *tp);
|
|
|
|
|
|
|
|
/* Generates a set of "size" bytes and increments its reference count. */
|
|
|
|
arith *MkSet(unsigned int size);
|
|
|
|
/* Decrements the reference counter of set "s" and if reference count
|
|
|
|
* is zero, then it frees the memory associated with the set.
|
|
|
|
*/
|
|
|
|
void FreeSet(register arith *s);
|
|
|
|
|
|
|
|
#endif /* CHK_EXPR_H_ */
|