Commit b78897a6 authored by Sven-Bodo Scholz's avatar Sven-Bodo Scholz
Browse files

started cleaning out the new new_types.c

parent 1db3840c
......@@ -12,40 +12,18 @@
* TC_simple, TC_symbol, TC_user, TC_aks, TC_akd, ...
*/
#ifndef TCITypeConstr
#define TCITypeConstr(typeconstr)
#endif
TCI (TC_simple, 0, "Simple", 0, simple, a_simple)
TCI (TC_symbol, 0, "Symbol", 0, attr_symbol, a_symbol)
TCI (TC_user, 0, "User", 0, usertype, a_user)
TCI (TC_akv, 1, "AKV", 0, constant *, a_akv) /* Known value */
TCI (TC_aks, 1, "AKS", 0, shape *, a_aks) /* Known shape */
TCI (TC_akd, 1, "AKD", 0, attr_akd, a_akd) /* Known dimension */
TCI (TC_aud, 1, "AUD", 0, char, dummy_aud) /* Unknown dimension */
TCI (TC_audgz, 1, "AUDGZ", 0, char, dummy_audgz) /* Unknown dimension, greater zero */
TCI (TC_prod, 0, "PROD", 1, char, dummy_prod)
TCI (TC_union, 2, "UNION", 1, char, dummy_union)
TCI (TC_alpha, 0, "ALPHA", 0, tvar *, a_alpha)
TCI (TC_bottom, 0, "BOTTOM", 0, char *, a_bottom)
TCI (TC_poly, 0, "POLY", 0, char *, a_poly)
TCI (TC_polyuser, 0, "POLYUSER", 0, attr_polyuser, a_polyuser)
#ifndef TCIArity
#define TCIArity(arity)
#endif
#ifndef TCIDbugString
#define TCIDbugString(dbug_str)
#endif
#ifndef TCIVariableArity
#define TCIVariableArity(variable_arity)
#endif
#define TCI(typeconstr, default_arity, dbug_str, variable_arity) \
TCITypeConstr (typeconstr) TCIArity (default_arity) TCIDbugString (dbug_str) \
TCIVariableArity (variable_arity)
TCI (TC_simple, 0, "Simple", 0), TCI (TC_symbol, 0, "Symbol", 0),
TCI (TC_user, 0, "User", 0), TCI (TC_akv, 1, "AKV", 0), /* Known value */
TCI (TC_aks, 1, "AKS", 0), /* Known shape */
TCI (TC_akd, 1, "AKD", 0), /* Known dimension */
TCI (TC_aud, 1, "AUD", 0), /* Unknown dimension */
TCI (TC_audgz, 1, "AUDGZ", 0), /* Unknown dimension, greater zero */
TCI (TC_prod, 0, "PROD", 1), TCI (TC_union, 2, "UNION", 1), TCI (TC_fun, 1, "FUN", 1),
TCI (TC_ibase, 3, "IBASE", 0), TCI (TC_iarr, 1, "IARR", 1), TCI (TC_idim, 1, "IDIM", 1),
TCI (TC_ishape, 1, "ISHAPE", 0), TCI (TC_ires, 1, "IRES", 0),
TCI (TC_alpha, 0, "ALPHA", 0), TCI (TC_bottom, 0, "BOTTOM", 0),
TCI (TC_poly, 0, "POLY", 0), TCI (TC_polyuser, 0, "POLYUSER", 0),
TCI (TC_dummy, 0, "LastTCI", 0)
#undef TCITypeConstr
#undef TCIArity
#undef TCIDbugString
#undef TCIVariableArity
......@@ -12,40 +12,10 @@
* TC_simple, TC_symbol, TC_user, TC_aks, TC_akd, ...
*/
#ifndef TCITypeConstr
#define TCITypeConstr(typeconstr)
#endif
TCI (TC_fun, 1, "FUN", 1, char, dummy_fun)
TCI (TC_ibase, 3, "IBASE", 0, struct NTYPE *, a_ibase)
TCI (TC_iarr, 1, "IARR", 1, char, dummy_iarr)
TCI (TC_idim, 1, "IDIM", 1, size_t, a_idim)
TCI (TC_ishape, 1, "ISHAPE", 0, shape *, a_ishape)
TCI (TC_ires, 1, "IRES", 0, attr_ires, a_ires)
#ifndef TCIArity
#define TCIArity(arity)
#endif
#ifndef TCIDbugString
#define TCIDbugString(dbug_str)
#endif
#ifndef TCIVariableArity
#define TCIVariableArity(variable_arity)
#endif
#define TCI(typeconstr, default_arity, dbug_str, variable_arity) \
TCITypeConstr (typeconstr) TCIArity (default_arity) TCIDbugString (dbug_str) \
TCIVariableArity (variable_arity)
TCI (TC_simple, 0, "Simple", 0), TCI (TC_symbol, 0, "Symbol", 0),
TCI (TC_user, 0, "User", 0), TCI (TC_akv, 1, "AKV", 0), /* Known value */
TCI (TC_aks, 1, "AKS", 0), /* Known shape */
TCI (TC_akd, 1, "AKD", 0), /* Known dimension */
TCI (TC_aud, 1, "AUD", 0), /* Unknown dimension */
TCI (TC_audgz, 1, "AUDGZ", 0), /* Unknown dimension, greater zero */
TCI (TC_prod, 0, "PROD", 1), TCI (TC_union, 2, "UNION", 1), TCI (TC_fun, 1, "FUN", 1),
TCI (TC_ibase, 3, "IBASE", 0), TCI (TC_iarr, 1, "IARR", 1), TCI (TC_idim, 1, "IDIM", 1),
TCI (TC_ishape, 1, "ISHAPE", 0), TCI (TC_ires, 1, "IRES", 0),
TCI (TC_alpha, 0, "ALPHA", 0), TCI (TC_bottom, 0, "BOTTOM", 0),
TCI (TC_poly, 0, "POLY", 0), TCI (TC_polyuser, 0, "POLYUSER", 0),
TCI (TC_dummy, 0, "LastTCI", 0)
#undef TCITypeConstr
#undef TCIArity
#undef TCIDbugString
#undef TCIVariableArity
......@@ -61,6 +61,7 @@
#include <limits.h>
#include "new_local.h"
#include "new_types.h"
#define DBUG_PREFIX "NTY"
......@@ -262,12 +263,12 @@ struct NTYPE {
*/
static char *dbug_str[] = {
#define TCIDbugString(a) a
#define TCIDbugString(a) a,
#include "type_constructor_info.mac"
};
static int variable_arity[] = {
#define TCIVariableArity(a) a
#define TCIVariableArity(a) a,
#include "type_constructor_info.mac"
};
......
......@@ -139,9 +139,6 @@
#include "types.h"
typeconstr TYgetConstr (ntype *type);
mutcScope TYgetMutcScope (ntype *type);
mutcUsage TYgetMutcUsage (ntype *type);
/*
* Scalar Types: Simple / User / Symbol
*/
......@@ -153,10 +150,6 @@ extern ntype *TYmakeSymbType (char *name, namespace_t *mod);
extern ntype *TYsetSimpleType (ntype *simple, simpletype base);
extern ntype *TYsetHiddenUserType (ntype *simple, usertype udt);
extern ntype *TYsetMutcUsage (ntype *type, mutcUsage usage);
extern ntype *TYsetMutcScope (ntype *type, mutcScope scope);
extern ntype *TYsetUnique (ntype *type, bool val);
extern ntype *TYsetDistributed (ntype *type, distmem_dis val);
extern simpletype TYgetSimpleType (ntype *simple);
extern usertype TYgetHiddenUserType (ntype *simple);
......@@ -284,7 +277,6 @@ extern bool TYisProdOfAKVafter (ntype *, size_t);
extern bool TYisProdContainingAKV (ntype *);
extern bool TYgetUnique (ntype *type);
extern distmem_dis TYgetDistributed (ntype *type);
extern int TYcountNonFixedAlpha (ntype *);
extern int TYcountNoMinAlpha (ntype *);
......
......@@ -263,12 +263,12 @@ struct NTYPE {
*/
static char *dbug_str[] = {
#define TCIDbugString(a) a
#define TCIDbugString(a) a,
#include "type_constructor_info.mac"
};
static int variable_arity[] = {
#define TCIVariableArity(a) a
#define TCIVariableArity(a) a,
#include "type_constructor_info.mac"
};
......
......@@ -141,9 +141,6 @@
#if 0 //CHARL
typeconstr TYgetConstr (ntype *type);
mutcScope TYgetMutcScope (ntype *type);
mutcUsage TYgetMutcUsage (ntype *type);
/*
* Scalar Types: Simple / User / Symbol
*/
......@@ -155,10 +152,6 @@ extern ntype *TYmakeSymbType (char *name, namespace_t *mod);
extern ntype *TYsetSimpleType (ntype *simple, simpletype base);
extern ntype *TYsetHiddenUserType (ntype *simple, usertype udt);
extern ntype *TYsetMutcUsage (ntype *type, mutcUsage usage);
extern ntype *TYsetMutcScope (ntype *type, mutcScope scope);
extern ntype *TYsetUnique (ntype *type, bool val);
extern ntype *TYsetDistributed (ntype *type, distmem_dis val);
extern simpletype TYgetSimpleType (ntype *simple);
extern usertype TYgetHiddenUserType (ntype *simple);
......@@ -286,7 +279,6 @@ extern bool TYisProdOfAKVafter (ntype *, size_t);
extern bool TYisProdContainingAKV (ntype *);
extern bool TYgetUnique (ntype *type);
extern distmem_dis TYgetDistributed (ntype *type);
extern int TYcountNonFixedAlpha (ntype *);
extern int TYcountNoMinAlpha (ntype *);
......
This diff is collapsed.
......@@ -7,6 +7,18 @@
* over the following files:
*/
extern typeconstr TYgetConstr (ntype *type);
extern mutcScope TYgetMutcScope (ntype *type);
extern mutcUsage TYgetMutcUsage (ntype *type);
extern bool TYisUnique (ntype *type);
extern distmem_dis TYgetDistributed (ntype *type);
extern ntype * TYsetMutcUsage (ntype *type, mutcUsage usage);
extern ntype * TYsetUnique (ntype *type, bool val);
extern ntype * TYsetDistributed (ntype *type, distmem_dis val);
extern ntype * TYsetMutcScope (ntype *type, mutcScope scope);
extern ntype *TYfreeTypeConstructor (ntype *type);
extern ntype *TYfreeType (ntype *type);
#include "new_array_types.h"
#include "new_fun_types.h"
......
#ifndef _SAC_NEW_TYPES_LOCAL_H_
#define _SAC_NEW_TYPES_LOCAL_H_
/*
* This header provides a convenient handle for all ntype structures.
* While these initially lived in one (this) file, they are now distributed
* over the following files:
*/
extern ntype * MakeNtype (typeconstr con, size_t arity);
extern ntype * MakeNewSon (ntype *father, ntype *son);
extern ntype * DeleteSon (ntype *father, size_t son);
extern ntype * IncreaseArity (ntype *type, size_t amount);
#define NTYPE_CON(n) (n->mtypeconstr)
#define NTYPE_ARITY(n) (n->arity)
#define NTYPE_SONS(n) (n->sons)
#define NTYPE_SON(n, i) (n->sons[i])
#define NTYPE_MUTC_SCOPE(n) (n->mutcscope)
#define NTYPE_MUTC_USAGE(n) (n->mutcusage)
#define NTYPE_UNIQUE(n) (n->unique)
#define NTYPE_DISTRIBUTED(n) (n->distributed)
#endif /* _SAC_NEW_TYPES_LOCAL_H_ */
/*
* This file keeps all type constructors and related info.
* Similar to all other .mac-files it is included several times!
* The idea is to include this file with one of the "selector macros"
* e.g. "TCITypeConstr" being defined as:
*
* #define TCITypeConstr( typeconstr) typeconstr
*
* this will extract the desired column of the table down below!
* For the given example, including this file yields:
*
* TC_simple, TC_symbol, TC_user, TC_aks, TC_akd, ...
*/
#ifndef TCITypeConstr
#define TCITypeConstr(typeconstr)
#endif
#ifndef TCIArity
#define TCIArity(arity)
#endif
#ifndef TCIDbugString
#define TCIDbugString(dbug_str)
#endif
#ifndef TCIVariableArity
#define TCIVariableArity(variable_arity)
#endif
#ifndef TCIAttrType
#define TCIAttrType(t_attr)
#endif
#ifndef TCIAttrName
#define TCIAttrName(t_attr)
#endif
#define TCI(typeconstr, default_arity, dbug_str, variable_arity, attr_t, attr_nm) \
TCITypeConstr (typeconstr) \
TCIArity (default_arity) \
TCIDbugString (dbug_str) \
TCIVariableArity (variable_arity) \
TCIAttrType (attr_t) \
TCIAttrName (attr_nm)
#include "array_type_constructor_info.mac"
#include "fun_type_constructor_info.mac"
TCI (TC_dummy, 0, "LastTCI", 0)
#undef TCITypeConstr
#undef TCIArity
#undef TCIDbugString
#undef TCIVariableArity
#undef TCIAttrType
#undef TCIAttrName
......@@ -608,7 +608,7 @@ typedef enum { NTC_not_checked, NTC_checking, NTC_checked } NTC_stat;
*/
typedef enum {
#define TCITypeConstr(a) a
#define TCITypeConstr(a) a,
#include "type_constructor_info.mac"
#undef TCITypeConstr
} typeconstr;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment