Esempio n. 1
0
/*
 * NewScope()
 *
 */
Scope *NewScopeInPool(MemoryPool *pool)
{
    Scope *lScope;

    lScope = mem_Alloc(pool, sizeof(Scope));
    lScope->pool = pool;
    lScope->parent = NULL;
    lScope->funScope = NULL;
    lScope->symbols = NULL;
    lScope->tags = NULL;
    lScope->params = NULL;
    lScope->returnType = NULL;
    lScope->level = 0;
    lScope->funindex = 0;
    lScope->InFormalParameters = 0;
    lScope->HasVoidParameter = 0;
    lScope->HasReturnStmt = 0;
    lScope->IsStructScope = 0;
    lScope->HasSemantics = 0;
    lScope->pid = PID_NONE_ID;
    lScope->programs = NULL;
    lScope->initStmts = NULL;
    if ((lScope->next = ScopeList))
        ScopeList->prev = lScope;
    lScope->prev = 0;
    ScopeList = lScope;
    mem_AddCleanup(pool, unlinkScope, lScope);
    return lScope;
} // NewScope
Esempio n. 2
0
/*
 * NewScope()
 *
 */
Scope *NewScopeInPool(MemoryPool *pool)
{
    Scope *lScope;

    lScope = (Scope *)mem_Alloc(pool, sizeof(Scope));
    lScope->pool = pool;
    lScope->parent = NULL;
    lScope->funScope = NULL;
    lScope->symbols = NULL;
    
    lScope->level = 0;

    lScope->programs = NULL;
    if ((lScope->next = ScopeList))
        ScopeList->prev = lScope;
    lScope->prev = 0;
    ScopeList = lScope;
    mem_AddCleanup(pool, unlinkScope, lScope);
    return lScope;
} // NewScope