/*****************************************************************************/
+
/* Pointer to current function */
Function* CurrentFunc = 0;
/* Need a starting curly brace */
ConsumeLCurly ();
- CollAppend (&CurrentFunc->LocalsBlockStack, (void *)CurrentFunc->LocalsBlockCount);
+ CollAppend (&CurrentFunc->LocalsBlockStack, 0);
/* Parse local variable declarations if any */
DeclareLocals ();
Collection LocalsBlockStack; /* Stack of blocks with local vars */
};
-
-
/* Structure that holds all data needed for function activation */
typedef struct Function Function;
/* Be sure to allocate any reserved space for locals */
F_AllocLocalSpace (CurrentFunc);
- if (InitialStack != StackPtr)
- {
+ if (InitialStack != StackPtr) {
++CurrentFunc->LocalsBlockCount;
/* Is it ok to abuse Collection in this way? */
CollAppend (&CurrentFunc->LocalsBlockStack, (void *)CurrentFunc->LocalsBlockCount);
g_space (StackPtr - OldStack);
}
- if (OldStack != StackPtr)
+ if (OldStack != StackPtr) {
CollPop (&CurrentFunc->LocalsBlockStack);
+ }
StackPtr = OldStack;
-/* Symbol table entry */
+/* Label definition or reference */
typedef struct DefOrRef DefOrRef;
-
struct DefOrRef {
unsigned Line;
long LocalsBlockNum;
unsigned Flags;
};
+/* Symbol table entry */
typedef struct SymEntry SymEntry;
-
struct SymEntry {
SymEntry* NextHash; /* Next entry in hash list */
SymEntry* PrevSym; /* Previous symbol in dl list */