]> git.sur5r.net Git - cc65/blobdiff - src/cc65/symtab.h
Removed (pretty inconsistently used) tab chars from source code base.
[cc65] / src / cc65 / symtab.h
index 5321ac07b88ea5aecddbffa57a5fc902cc04be74..154dce55aa5be028bf2d50d9c0545c54e031fdd2 100644 (file)
@@ -1,15 +1,15 @@
 /*****************************************************************************/
 /*                                                                           */
-/*                                symtab.h                                  */
+/*                                 symtab.h                                  */
 /*                                                                           */
-/*             Symbol table management for the cc65 C compiler              */
+/*              Symbol table management for the cc65 C compiler              */
 /*                                                                           */
 /*                                                                           */
 /*                                                                           */
-/* (C) 2000     Ullrich von Bassewitz                                        */
-/*              Wacholderweg 14                                              */
-/*              D-70597 Stuttgart                                            */
-/* EMail:       uz@musoftware.de                                             */
+/* (C) 2000-2013, Ullrich von Bassewitz                                      */
+/*                Roemerstrasse 52                                           */
+/*                D-70794 Filderstadt                                        */
+/* EMail:         uz@cc65.org                                                */
 /*                                                                           */
 /*                                                                           */
 /* This software is provided 'as-is', without any expressed or implied       */
@@ -46,7 +46,7 @@
 
 
 /*****************************************************************************/
-/*                                  Data                                    */
+/*                                   Data                                    */
 /*****************************************************************************/
 
 
 /* Symbol table */
 typedef struct SymTable SymTable;
 struct SymTable {
-    SymTable*                  PrevTab;        /* Pointer to higher level symbol table */
-    SymEntry*                  SymHead;        /* Double linked list of symbols */
-    SymEntry*                  SymTail;        /* Double linked list of symbols */
-    unsigned                   SymCount;       /* Count of symbols in this table */
-    unsigned                   Size;           /* Size of table */
-    SymEntry*                  Tab[1];         /* Actual table, dynamically allocated */
+    SymTable*           PrevTab;        /* Pointer to higher level symbol table */
+    SymEntry*           SymHead;        /* Double linked list of symbols */
+    SymEntry*           SymTail;        /* Double linked list of symbols */
+    unsigned            SymCount;       /* Count of symbols in this table */
+    unsigned            Size;           /* Size of table */
+    SymEntry*           Tab[1];         /* Actual table, dynamically allocated */
 };
 
 /* An empty symbol table */
-extern SymTable                EmptySymTab;
+extern SymTable         EmptySymTab;
 
 /* Forwards */
 struct FuncDesc;
 
 /* Predefined lexical levels */
-#define LEX_LEVEL_GLOBAL       1U
+#define LEX_LEVEL_GLOBAL        1U
 #define LEX_LEVEL_FUNCTION      2U
 
 
 
 /*****************************************************************************/
-/*                       Handling of lexical levels                         */
+/*                        Handling of lexical levels                         */
 /*****************************************************************************/
 
 
@@ -116,7 +116,7 @@ void LeaveStructLevel (void);
 
 
 /*****************************************************************************/
-/*                             Find functions                               */
+/*                              Find functions                               */
 /*****************************************************************************/
 
 
@@ -133,36 +133,39 @@ SymEntry* FindLocalSym (const char* Name);
 SymEntry* FindTagSym (const char* Name);
 /* Find the symbol with the given name in the tag table */
 
-SymEntry* FindStructField (const type* TypeArray, const char* Name);
+SymEntry* FindStructField (const Type* TypeArray, const char* Name);
 /* Find a struct field in the fields list */
 
 
 
 /*****************************************************************************/
-/*                      Add stuff to the symbol table                       */
+/*                       Add stuff to the symbol table                       */
 /*****************************************************************************/
 
 
 
-SymEntry* AddStructSym (const char* Name, unsigned Size, SymTable* Tab);
+SymEntry* AddStructSym (const char* Name, unsigned Type, unsigned Size, SymTable* Tab);
 /* Add a struct/union entry and return it */
 
-SymEntry* AddConstSym (const char* Name, const type* Type, unsigned Flags, long Val);
+SymEntry* AddBitField (const char* Name, unsigned Offs, unsigned BitOffs, unsigned Width);
+/* Add a bit field to the local symbol table and return the symbol entry */
+
+SymEntry* AddConstSym (const char* Name, const Type* T, unsigned Flags, long Val);
 /* Add an constant symbol to the symbol table and return it */
 
 SymEntry* AddLabelSym (const char* Name, unsigned Flags);
 /* Add a goto label to the symbol table */
 
-SymEntry* AddLocalSym (const char* Name, const type* Type, unsigned Flags, int Offs);
+SymEntry* AddLocalSym (const char* Name, const Type* T, unsigned Flags, int Offs);
 /* Add a local symbol and return the symbol entry */
 
-SymEntry* AddGlobalSym (const char* Name, const type* Type, unsigned Flags);
+SymEntry* AddGlobalSym (const char* Name, const Type* T, unsigned Flags);
 /* Add an external or global symbol to the symbol table and return the entry */
 
 
 
 /*****************************************************************************/
-/*                                  Code                                    */
+/*                                   Code                                    */
 /*****************************************************************************/
 
 
@@ -185,6 +188,9 @@ void PrintSymTable (const SymTable* Tab, FILE* F, const char* Header, ...);
 void EmitExternals (void);
 /* Write import/export statements for external symbols */
 
+void EmitDebugInfo (void);
+/* Emit debug infos for the locals of the current scope */
+
 
 
 /* End of symtab.h */