Exemple #1
0
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);
    }
}
Exemple #2
0
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;
    }
}
Exemple #3
0
int test_weed_returning_void_function(void)
{
    FUNCTION *f = makeFUNCTION(makeTYPEvoid(), "f", NULL, makeSTATEMENTblock(
        makeSTATEMENTreturn(makeEXPintconst(1)),NULL));
    return !weedFUNCTION(f);
}