/* */
/* */
/* */
-/* (C) 2000 Ullrich von Bassewitz */
-/* Wacholderweg 14 */
-/* D-70597 Stuttgart */
-/* EMail: uz@musoftware.de */
+/* (C) 2000-2009, Ullrich von Bassewitz */
+/* Roemerstrasse 52 */
+/* D-70794 Filderstadt */
+/* EMail: uz@cc65.org */
/* */
/* */
/* This software is provided 'as-is', without any expressed or implied */
/* Forwards */
struct FuncDesc;
+/* Predefined lexical levels */
+#define LEX_LEVEL_GLOBAL 1U
+#define LEX_LEVEL_FUNCTION 2U
+
/*****************************************************************************/
+unsigned GetLexicalLevel (void);
+/* Return the current lexical level */
+
void EnterGlobalLevel (void);
/* Enter the program global lexical level */
SymEntry* FindSym (const char* Name);
/* Find the symbol with the given name */
+SymEntry* FindGlobalSym (const char* Name);
+/* Find the symbol with the given name in the global symbol table only */
+
SymEntry* FindLocalSym (const char* Name);
/* Find the symbol with the given name in the current symbol table only */
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 */
SymEntry* AddStructSym (const char* Name, unsigned Size, SymTable* Tab);
/* Add a struct/union entry and return it */
-SymEntry* AddEnumSym (const char* Name, int Val);
-/* Add an enum symbol to the symbol table and return it */
+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, 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, 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 */
SymTable* GetSymTab (void);
/* Return the current symbol table */
+SymTable* GetGlobalSymTab (void);
+/* Return the global symbol table */
+
int SymIsLocal (SymEntry* Sym);
/* Return true if the symbol is defined in the highest lexical level */
-int EqualTypes (const type* t1, const type* t2);
-/* Recursively compare two types. Return 1 if the types match, return 0
- * otherwise.
- */
-
void MakeZPSym (const char* Name);
/* Mark the given symbol as zero page symbol */
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 */
-
-
-