Main Page | Class List | Directories | File List | Class Members | File Members

cc_symtab.h File Reference

CKPM C compiler symbol table definitions. More...


Classes

struct  _object
 This structure contains one object description. More...
struct  _type
 This structure contains one type description. More...
struct  _item
 This structure contains one item description. More...
struct  _symtab
 This structure contains the symbol table. More...

Defines

#define class_t   int
#define CLASS_HEAD   0
#define CLASS_VAR   1
#define CLASS_PARAM   2
#define CLASS_CONST   3
#define CLASS_FIELD   4
#define CLASS_TYPE   5
#define CLASS_FUNC   6
#define CLASS_SFUNC   7
#define CLASS_FUNC_PR   8
#define CLASS_IND   9
#define CLASS_IND_DATA   10
#define CLASS_STACK   11
#define CLASS_COND   12
#define CLASS_VOID   13
#define CLASS_LINK   14
#define type_t   int
#define TYPE_UNKNOWN   0
#define TYPE_INT   1
#define TYPE_CHAR   2
#define TYPE_VOID   3
#define form_t   int
#define FORM_UNKNOWN   0
#define FORM_VOID   1
#define FORM_BOOLEAN   2
#define FORM_CHAR   3
#define FORM_INTEGER   4
#define FORM_ARRAY   5
#define FORM_STRUCTURE   6
#define FORM_POINTER   7
#define reg_t   int
#define REG_UNKNOWN   0
#define REG_ABSOLUTE   1
#define REG_FRAME   2
#define REG_STACK   3
#define STACK_NONE   0
#define STACK_DUP   4
#define STACK_ONLY   5

Functions

char * ClassToString (class_t cls)
 convert class numbers to strings
char * FormToString (form_t f)
 convert form numbers to strings
char * TypeToString (type_t t)
 convert type numbers to strings
_objectObject_Create (char *name, class_t cls, int lev, struct _type *type, int val, struct _object *next, struct _object *dsc)
 create an Object description
void Object_Destroy (struct _object *o)
 destroy an Object description
void Object_Dump (struct _object *o, int lev, int fd, struct _object *en)
 dump an Object description
void Type_Destroy (struct _type *t)
 destroy a Type description
void Type_Dump (struct _type *t, int lev, int fd, struct _object *en)
 dump a Type description
_itemItem_Create ()
 create an Item description
void Item_Destroy (struct _item *i)
 destroy an Item description
void Item_Copy (struct _item *d, struct _item *s)
 copy an Item description
void Item_Dump (struct _item *i, int fd)
 dump an Item description
_symtabSymTab_Create ()
 create a symbol table
void SymTab_Destroy (struct _symtab *st)
 destroy a symbol table
void OpenScope (struct _symtab *st)
 open a new scope
void CloseScope (struct _symtab *st)
 close a the topmost scope
void SymTab_Dump (struct _symtab *st, int lev, int fd)
 dump the content of a symbol table


Detailed Description

CKPM C compiler symbol table definitions.


Define Documentation

#define CLASS_COND   12
 

conditional

#define CLASS_CONST   3
 

constant

#define CLASS_FIELD   4
 

field

#define CLASS_FUNC   6
 

function with implementation

#define CLASS_FUNC_PR   8
 

function prototype

#define CLASS_HEAD   0
 

head class

#define CLASS_IND   9
 

indirect addressing (pointers)

#define CLASS_IND_DATA   10
 

indirect addressing (pointers) to data area

#define CLASS_LINK   14
 

fixup links

#define CLASS_PARAM   2
 

parameter

#define CLASS_SFUNC   7
 

predefined function

#define CLASS_STACK   11
 

stack

#define class_t   int
 

object type class

#define CLASS_TYPE   5
 

type

#define CLASS_VAR   1
 

variable

#define CLASS_VOID   13
 

void

#define FORM_ARRAY   5
 

array form

#define FORM_BOOLEAN   2
 

boolean form

#define FORM_CHAR   3
 

character form

#define FORM_INTEGER   4
 

integer form

#define FORM_POINTER   7
 

pointer form

#define FORM_STRUCTURE   6
 

structure form

#define form_t   int
 

form

#define FORM_UNKNOWN   0
 

unknown form

#define FORM_VOID   1
 

void form

#define REG_ABSOLUTE   1
 

direct addressing via program counter

#define REG_FRAME   2
 

indirect addressing via frame pointer

#define REG_STACK   3
 

indirect addressing via stack pointer

#define reg_t   int
 

register / addressing mode

#define REG_UNKNOWN   0
 

unknown addressing mode

#define STACK_DUP   4
 

leave the result also on the stack

#define STACK_NONE   0
 

leave no values left on the stack

#define STACK_ONLY   5
 

leave the result on the stack only

#define TYPE_CHAR   2
 

character

#define TYPE_INT   1
 

integer

#define type_t   int
 

object type

#define TYPE_UNKNOWN   0
 

unknown type

#define TYPE_VOID   3
 

void


Function Documentation

char* ClassToString class_t  cls  ) 
 

convert class numbers to strings

Parameters:
cls the class number
Returns:
the class name as a string

void CloseScope struct _symtab st  ) 
 

close a the topmost scope

Parameters:
st pointer to a symbol table

char* FormToString form_t  f  ) 
 

convert form numbers to strings

Parameters:
f the form number
Returns:
the form name as a string

void Item_Copy struct _item d,
struct _item s
 

copy an Item description

Parameters:
d a pointer to the destination Item
s a pointer to the source Item

struct _item* Item_Create  ) 
 

create an Item description

Returns:
a pointer to a newly created and initialized Item description

void Item_Destroy struct _item i  ) 
 

destroy an Item description

Parameters:
i a pointer to a Item desription

void Item_Dump struct _item i,
int  fd
 

dump an Item description

Parameters:
i a pointer to an Item description
fd the filedesciptor index of the output file

struct _object* Object_Create char *  name,
class_t  cls,
int  lev,
struct _type type,
int  val,
struct _object next,
struct _object dsc
 

create an Object description

Parameters:
name the name of the object
cls the object type class
lev declaration level
type the object's type
val constants: value
next the next object entry
dsc 
Returns:
a pointer to a newly created and initialized Object description

void Object_Destroy struct _object o  ) 
 

destroy an Object description

Parameters:
o a ointer to an Object description

void Object_Dump struct _object o,
int  lev,
int  fd,
struct _object en
 

dump an Object description

Parameters:
o a pointer to an Object description
lev level of indentation
fd the filedesciptor index of the output file
en the pointer to the end of the list, i.e. guard object

void OpenScope struct _symtab st  ) 
 

open a new scope

Parameters:
st pointer to a symbol table

struct _symtab* SymTab_Create  ) 
 

create a symbol table

Returns:
a pointer to a newly created and initialized symbol table

void SymTab_Destroy struct _symtab st  ) 
 

destroy a symbol table

Parameters:
st pointer to a symbol table

void SymTab_Dump struct _symtab st,
int  lev,
int  fd
 

dump the content of a symbol table

Parameters:
st pointer to a symbol table
lev level of indentation
fd the filedesciptor index of the output file

void Type_Destroy struct _type t  ) 
 

destroy a Type description

Parameters:
t a pointer to a Type desription

void Type_Dump struct _type t,
int  lev,
int  fd,
struct _object en
 

dump a Type description

Parameters:
t a pointer to an Type description
lev level of indentation
fd the filedesciptor index of the output file
en the pointer to the end of the list, i.e. guard object

char* TypeToString type_t  t  ) 
 

convert type numbers to strings

Parameters:
t the type number
Returns:
the type name as a string


Generated on Thu Jul 13 03:56:36 2006 for CKPMcc by  doxygen 1.4.4