Ejemplo n.º 1
0
// makeSelector(5,2) => "!,!,_,!,!"
static Tree makeSelector(int n, int i)
{
    Tree op = (i==0) ? boxWire() : boxCut();
    return (n==1) ? op : boxPar(op, makeSelector(n-1, i-1));
}
Ejemplo n.º 2
0
/**
 * repeat n times a wire
 */
static Tree nwires(int n)
{
	Tree l = gGlobal->nil;
	while (n--) { l = cons(boxWire(), l); }
	return l;
}
Ejemplo n.º 3
0
// makeBus(3) => "_,_,_"
static Tree makeBus(int n)
{
    return (n<=1) ? boxWire() : boxPar(boxWire(), makeBus(n-1));
}