type fixes and bindings + notes on subtyping
This commit is contained in:
parent
7e3c7c88ea
commit
c18f56f7be
28 changed files with 2253 additions and 783 deletions
54
include/spho/bind.h
Normal file
54
include/spho/bind.h
Normal file
|
@ -0,0 +1,54 @@
|
|||
#ifndef _SPHO_BIND_H
|
||||
#define _SPHO_BIND_H
|
||||
|
||||
#include <sys/queue.h>
|
||||
|
||||
#include "spho/scope.h"
|
||||
|
||||
#define SPHO_BIND_UNDECLARED 0x0
|
||||
#define SPHO_BIND_UNDEFINED 0x01
|
||||
#define SPHO_BIND_TP 0x11
|
||||
#define SPHO_BIND_TP_OP 0x12
|
||||
#define SPHO_BIND_MEMB_TP 0x13
|
||||
|
||||
union spho_prebind_val {
|
||||
const void *undef;
|
||||
const struct spho_tp *tp;
|
||||
const struct spho_tp_op *op;
|
||||
};
|
||||
|
||||
struct spho_prebind_pair {
|
||||
const struct spho_nom *nom;
|
||||
|
||||
int kind;
|
||||
union spho_prebind_val val;
|
||||
};
|
||||
|
||||
struct spho_prebind {
|
||||
struct spho_scope *sc;
|
||||
|
||||
size_t sz;
|
||||
struct spho_prebind_pair *binds;
|
||||
};
|
||||
|
||||
struct spho_prebind *spho_prebind_create(struct spho_scope *);
|
||||
|
||||
int spho_prebind_undef(struct spho_prebind *, const struct spho_nom *);
|
||||
int spho_prebind_tp(struct spho_prebind *, const struct spho_nom *,
|
||||
const struct spho_tp *);
|
||||
int spho_prebind_tp_op(struct spho_prebind *, const struct spho_nom *,
|
||||
const struct spho_tp_op *);
|
||||
int spho_prebind_member_tp(struct spho_prebind *, const struct spho_nom *,
|
||||
const struct spho_tp *);
|
||||
|
||||
struct spho_prebind *spho_prebind_dupl(const struct spho_prebind *);
|
||||
|
||||
void spho_prebind_free(struct spho_prebind *);
|
||||
|
||||
|
||||
struct spho_bind {
|
||||
struct spho_prebind *loc;
|
||||
struct spho_bind *parent;
|
||||
};
|
||||
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue