/*
 *  type.h
 *
 *  Created September 15, 1990 by Raymie Stata
 *  (c) 1990 Raymie Stata, All Rights Reserved
 */

#ifndef RSTYPE
#define RSTYPE

typedef struct typestruct *Type;

extern Type tc_any, tc_bool, tc_char, tc_int, tc_null, tc_none, tc_string;

/* Symbol numbers for reserved identifiers. */
extern int rid_any, rid_bool, rid_char, rid_int, rid_null, rid_string;
extern int rid_true, rid_false, rid_nil;

#define T_ANY    1
#define T_BOOL   2
#define T_CHAR   3
#define T_ENUM   4
#define T_INT    5
#define T_NULL   6
#define T_STRING 7
#define T_ISPRIM(TC) ((TC) >= T_ANY && (TC) <= T_STRING)

#define T_RECORD 20
#define T_SET    22
#define T_SEQ    23
#define T_TUPLE  24
#define T_UNION  25
#define T_ISCOMP(TC) ((TC) >= T_RECORD && (TC) <= T_UNION)

#define T_APROC  40
#define T_FUNC   41
#define T_PROC   42
#define T_ISPROC(TC) ((TC) >= T_APROC && (TC) <= T_PROC)

#define T_EQU    50
#define T_NONE   60

extern Type t_create();
extern Type t_setmethods();
extern int t_eq();
extern char *t_unparse();

#endif RSTYPE
