Lines Matching refs:sw
306 register Switch_t* sw = expr.swstate;
308 $$ = exnewnode(expr.program, $1->index, 1, INTEGER, $3, exnewnode(expr.program, DEFAULT, 1, 0, sw->defcase, sw->firstcase));
310 if (sw->base)
311 free(sw->base);
312 if (sw != &swstate)
313 free(sw);
346 register Switch_t* sw;
351 if (!(sw = newof(0, Switch_t, 1, 0)))
354 sw = &swstate;
356 sw->prev = expr.swstate;
359 sw = &swstate;
360 expr.swstate = sw;
361 sw->type = expr.declare;
362 sw->firstcase = 0;
363 sw->lastcase = 0;
364 sw->defcase = 0;
365 sw->def = 0;
367 if (!(sw->base = newof(0, Extype_t*, n, 0)))
372 sw->cur = sw->base;
373 sw->last = sw->base + n;
380 register Switch_t* sw = expr.swstate;
384 if (sw->cur > sw->base)
386 if (sw->lastcase)
387 sw->lastcase->data.select.next = $$;
389 sw->firstcase = $$;
390 sw->lastcase = $$;
391 n = sw->cur - sw->base;
392 sw->cur = sw->base;
394 memcpy($$->data.select.constant, sw->base, n * sizeof(Extype_t*));
399 if (sw->def)
401 sw->def = 0;
402 if (sw->defcase)
405 sw->defcase = $2;