예제 #1
0
void InitSegNames (void)
/* Initialize the segment names */
{
    SS_Push (&SegmentNames[SEG_BSS], SEGNAME_BSS);
    SS_Push (&SegmentNames[SEG_CODE], SEGNAME_CODE);
    SS_Push (&SegmentNames[SEG_DATA], SEGNAME_DATA);
    SS_Push (&SegmentNames[SEG_RODATA], SEGNAME_RODATA);
}
예제 #2
0
void PushSegName (segment_t Seg, const char* Name)
/* Push the current segment name and set a new name for a segment */
{
    if (SS_IsFull (&SegmentNames[Seg])) {
        Error ("Segment name stack overflow");
    } else {
        SS_Push (&SegmentNames[Seg], Name);
    }
}
예제 #3
0
파일: STStack.c 프로젝트: angelhunt/CCLAB
bool ST_Push(STStack stack, SymbolTable SymbolTable)
{
    if(stack->stacktop == stack->stacksize - 1)
        return false;
    stack->stacktop++;
    //stack->sts[stack->stacktop] = SymbolTable;
    if(stack->stacktop == 0)
        stack->sts[stack->stacktop] = SymbolTable;
    else
    {
        SS_Push(stack->sts[0]->ss, NewScope());
        stack->sts[stack->stacktop] = stack->sts[0];
        stack->sts[stack->stacktop]->type = SymbolTable->type;
    }
    return true;
}