public static void init(GraphFlattener graphFlattener) { graphFlattener.top.accept(new FlatVisitor() {
public static void init(FlatNode top) { top.accept(new FlatVisitor() {
    public static void init(GraphFlattener graphFlattener) {        graphFlattener.top.accept(new FlatVisitor() {            public void visitNode(FlatNode node) {                CType input_t = null, output_t = null;                SIROperator operator = node.contents;            // get the input and output types of the operator                try {                    if (operator instanceof SIRJoiner) {                        input_t = CommonUtils.getBaseType(CommonUtils.getJoinerType(node));                        output_t = input_t;                    }                } catch (Exception ex) {}                try {                    if (operator instanceof SIRSplitter) {                        input_t = CommonUtils.getBaseType(CommonUtils.getOutputType(node));                        output_t = input_t;                    }                } catch (Exception ex) {}                if (operator instanceof SIRStream) {                    SIRStream stream = (SIRStream)operator;                    input_t = stream.getInputType();                    output_t = stream.getOutputType();                }            // create a vector of input tapes                int dest = NodeEnumerator.getFlatNodeId(node);                if (node.incoming != null && node.incoming.length > 0                        && dest != -1) {                    Tape[] incomings = new Tape[node.incoming.length];                    for (int i = 0; i < node.incoming.length; i++) {                        // don't track edges with no tapes                        if (node.incoming[i] == null                                || node.incomingWeights[i] == 0                                || input_t == CStdType.Void) {                            //System.err.print(node.contents.toString() +  " given null edge [" + i + "] because ");                            //if (node.incoming[i] == null) System.err.println("incoming == null");                            //else if (node.incomingWeights[i] == 0) System.err.println("weight == 0");                            //else if (input_t == CStdType.Void) System.err.println("void");                            incomings[i] = null;                        } else {                            int source = NodeEnumerator                                    .getFlatNodeId(node.incoming[i]);                            assert source >= 0; // if have incoming edge, it                                                // should have a number.                            incomings[i] = TapeBase.newTape(source, dest, input_t);                        }                    }                    filterInStreams                            .put(node.contents, Arrays.asList(incomings));                } else {                    List<Tape> l = Collections.emptyList();                    filterInStreams.put(node.contents, l);                }            // create a vector of output tapes                int source = NodeEnumerator.getFlatNodeId(node);                if (node.edges != null && node.edges.length > 0 && source != -1) {                    Tape[] outgoings = new Tape[node.edges.length];                    for (int i = 0; i < node.edges.length; i++) {                        // don't track edges with no tapes.                        if (node.edges[i] == null || node.weights[i] == 0                                || output_t == CStdType.Void) {                            outgoings[i] = null;                        } else {                            int ndest = NodeEnumerator.getFlatNodeId(node.edges[i]);                            assert ndest >= 0; // if have outgoing edge, it                                                // should have a number.                            outgoings[i] = TapeBase.newTape(source, ndest, output_t);                        }                    }                    filterOutStreams.put(node.contents, Arrays                            .asList(outgoings));                } else {                    List<Tape> l = Collections.emptyList();                    filterOutStreams.put(node.contents, l);                }            } } , new HashSet(), true);    }