#include "cddefs.h"
#include "coll.h"
#include "intstack.h"
+#include "scopedefs.h"
#include "symdefs.h"
#include "tgttrans.h"
#include "xmalloc.h"
static void DoEndProc (void)
/* Leave a lexical level */
{
- if (GetCurrentSymTabType () != ST_PROC) {
+ if (CurrentScope->Type != SCOPE_SCOPE || CurrentScope->Label == 0) {
/* No local scope */
ErrorSkip ("No open .PROC");
} else {
static void DoEndScope (void)
/* Leave a lexical level */
{
- if ( GetCurrentSymTabType () != ST_SCOPE) {
+ if (CurrentScope->Type != SCOPE_SCOPE || CurrentScope->Label != 0) {
/* No local scope */
ErrorSkip ("No open .SCOPE");
} else {
{
StrBuf Name = STATIC_STRBUF_INITIALIZER;
unsigned char AddrSize;
+ SymEntry* Sym = 0;
- if (CurTok.Tok == TOK_IDENT) {
- SymEntry* Sym;
+ if (CurTok.Tok == TOK_IDENT) {
- /* The new scope has a name. Remember it. */
+ /* The new scope has a name. Remember it. */
SB_Copy (&Name, &CurTok.SVal);
/* Search for the symbol, generate a new one if needed */
}
/* Enter a new scope */
- SymEnterLevel (&Name, ST_PROC, AddrSize);
+ SymEnterLevel (&Name, SCOPE_SCOPE, AddrSize, Sym);
/* Free memory for Name */
SB_Done (&Name);
AddrSize = OptionalAddrSize ();
/* Enter the new scope */
- SymEnterLevel (&Name, ST_SCOPE, AddrSize);
+ SymEnterLevel (&Name, SCOPE_SCOPE, AddrSize, 0);
/* Free memory for Name */
SB_Done (&Name);
ErrorSkip ("Unknown struct");
return;
}
- if (GetSymTabType (Struct) != ST_STRUCT) {
+ if (GetSymTabType (Struct) != SCOPE_STRUCT) {
ErrorSkip ("Not a struct");
return;
}