static void DoEndProc (void)
/* Leave a lexical level */
{
- if (GetCurrentSymTabType () != SCOPE_PROC) {
+ if (CurrentScope->Type != SCOPE_SCOPE || CurrentScope->OwnerSym == 0) {
/* No local scope */
ErrorSkip ("No open .PROC");
} else {
static void DoEndScope (void)
/* Leave a lexical level */
{
- if ( GetCurrentSymTabType () != SCOPE_SCOPE) {
+ if (CurrentScope->Type != SCOPE_SCOPE || CurrentScope->OwnerSym != 0) {
/* No local scope */
ErrorSkip ("No open .SCOPE");
} else {
}
/* Enter a new scope */
- SymEnterLevel (&Name, SCOPE_PROC, AddrSize, Sym);
+ SymEnterLevel (&Name, SCOPE_SCOPE, AddrSize, Sym);
/* Free memory for Name */
SB_Done (&Name);
-unsigned char GetCurrentSymTabType ()
-/* Return the type of the current symbol table */
-{
- CHECK (CurrentScope != 0);
- return CurrentScope->Type;
-}
-
-
-
static void SymCheckUndefined (SymEntry* S)
/* Handle an undefined symbol */
{
# define GetSymTabType(S) ((S)->Type)
#endif
-unsigned char GetCurrentSymTabType ();
-/* Return the type of the current symbol table */
-
void SymCheck (void);
/* Run through all symbols and check for anomalies and errors */
enum {
SCOPE_GLOBAL, /* Global level */
SCOPE_FILE, /* File level */
- SCOPE_PROC, /* .PROC */
- SCOPE_SCOPE, /* .SCOPE */
+ SCOPE_SCOPE, /* .SCOPE/.PROC */
SCOPE_HAS_DATA = SCOPE_SCOPE, /* Last scope that contains data */
SCOPE_STRUCT, /* .STRUCT/.UNION */
SCOPE_ENUM, /* .ENUM */