blob: 4db33b6dfe35814b80a4510231002ec1802aef42 (
plain) (
tree)
|
|
#ifndef SEMANTICS_H
#define SEMANTICS_H
#include "const.h"
typedef struct CNode CNode;
typedef struct CTable *CTable_t;
typedef struct CType CType;
typedef CType *CType_t;
typedef struct CVar CVar;
typedef CVar *CVar_t;
typedef struct CSymbol CSymbol;
typedef CSymbol *CSymbol_t;
typedef struct CDef CDef;
typedef CDef *CDef_t;
typedef struct CTList CTList;
typedef CTList *CTList_t;
struct CTList {
CType_t type;
CTList_t next;
};
typedef struct CVList CVList;
typedef CVList *CVList_t;
struct CVList {
CVar_t var;
CVList_t next;
};
typedef struct CBList *CBList_t;
typedef struct COList *COList_t;
typedef struct CVList *CVList_t;
struct CVar {
char *name;
CVar_t next; /* next in the linked list */
CType_t type;
int start;
CNode *ast;
CBList_t defsite;
/* the following fields are used for renaming */
int cnt;
COList_t stack;
};
CVar_t cvar_create(char *name, CType_t type, CNode *ast);
void cvar_print(CVar_t cv);
struct CType {
enum {
CINT,
|