private static int captureMessage(final List<Token> tokens, final int index, final Ir ir)
    {
        final List<Token> messageTokens = new ArrayList<>();

        int i = index;
        Token token = tokens.get(i);
        messageTokens.add(token);
        do
        {
            token = tokens.get(++i);
            messageTokens.add(token);
        }
        while (Signal.END_MESSAGE != token.signal());

        ir.addMessage(tokens.get(i).id(), messageTokens);

        return i;
    }
Decode the serialised {@link Ir} and return the decoded instance.

@return the decoded serialised {@link Ir} instance.
sbe-tool/src/main/java/uk/co/real_logic/sbe/ir/IrDecoder.java