symbols.c
Symbol *AddGlobal(ParseContext *c, const char *name, StorageClass storageClass, Type *type, VMVALUE value)
{
    size_t size = sizeof(Symbol) + strlen(name);
    Symbol *sym;
    
    /* allocate the symbol structure */
    sym = (Symbol *)AllocateLowMemory(c->sys, size);
    strcpy(sym->name, name);
    sym->placed = VMFALSE;
    sym->storageClass = storageClass;
    sym->value = value;
    sym->next = NULL;

    /* add it to the symbol table */
    *c->globals.pTail = sym;
    c->globals.pTail = &sym->next;
    ++c->globals.count;
    
    /* return the symbol */
    return sym;
}
/* AddGlobal - add a global symbol to the symbol table */
add a global symbol to the symbol table
add a global symbol to the symbol table
Symbol *AddGlobal(ParseContext *c, const char *name, StorageClass storageClass, Type *type, VMVALUE value)
{
    size_t size = sizeof(Symbol) + strlen(name);
    Symbol *sym;
    sym = (Symbol *)AllocateLowMemory(c->sys, size);
    strcpy(sym->name, name);
    sym->placed = VMFALSE;
    sym->storageClass = storageClass;
    sym->value = value;
    sym->next = NULL;
    *c->globals.pTail = sym;
    c->globals.pTail = &sym->next;
    ++c->globals.count;
    return sym;
}
Symbol * AddGlobal ( ParseContext * c , const char * name , StorageClass storageClass , Type * type , VMVALUE value ) { size_t size = sizeof ( Symbol ) + strlen ( name ) ; Symbol * sym ; sym = ( Symbol * ) AllocateLowMemory ( c -> sys , size ) ; strcpy ( sym -> name , name ) ; sym -> placed = VMFALSE ; sym -> storageClass = storageClass ; sym -> value = value ; sym -> next = NULL ; * c -> globals . pTail = sym ; c -> globals . pTail = & sym -> next ; ++ c -> globals . count ; return sym ; }
AddGlobal - add a global symbol to the symbol table
AddGlobal - add a global symbol to the symbol table
/* allocate the symbol structure */ /* add it to the symbol table */ /* return the symbol */