예제 #1
0
파일: weeder.c 프로젝트: mojingliu/520proj
void weedSERVICE(SERVICE* s)
{
    if(s == NULL) return;
    weedError = 0;
    if(s->html != NULL)
    {
        weedHTML(s->html);
    }
    if(s->schema != NULL)
    {
        weedSCHEMA(s->schema);
    }
    if(s->variable != NULL)
    {
        weedVARIABLE(s->variable);
    }
    if(s->function != NULL)
    {
        weedFUNCTION(s->function);
    }
    if(s->session != NULL)
    {
        weedSESSION(s->session);
    }
}
예제 #2
0
파일: weeder.c 프로젝트: mojingliu/520proj
void weedFUNCTION(FUNCTION* f)
{
    if(f == NULL) return;
    if(f->next != NULL)
    {
        weedFUNCTION(f->next);
    }
    weedTYPE(f->type);
    weedID(f->id);
    weedARGUMENT(f->argument);
    weedCOMPOUNDSTM(f->compoundstm);
    if(hasShowSTM(f->compoundstm->stm) == 1)
    {
        printf("\nLine %d: Weeder Error - show statements are only allowed in sessions\n", f->lineno);
        weedError = 1;
        return;
    }
    if(hasExitSTM(f->compoundstm->stm) == 1)
    {
        printf("\nLine %d: Weeder Error - exit statements are only allowed in sessions\n", f->lineno);
        weedError = 1;
        return;
    }
}
예제 #3
0
int test_weed_returning_void_function(void)
{
    FUNCTION *f = makeFUNCTION(makeTYPEvoid(), "f", NULL, makeSTATEMENTblock(
        makeSTATEMENTreturn(makeEXPintconst(1)),NULL));
    return !weedFUNCTION(f);
}