def binary_construct(tokens):
    """
    Construct proper instructions for binary expressions from a
    sequence of tokens at the same precedence level.  For instance, if
    the tokens represent "1 + 2 + 3", this will return the instruction
    array "1 2 add_op 3 add_op".

    :param tokens: The sequence of tokens.

    :returns: An instance of ``Instructions`` containing the list of
              instructions.
    """

    # Initialize the list of instructions we will return with the
    # left-most element
    instructions = [tokens[0]]

    # Now process all the remaining tokens, building up the array we
    # will return
    for i in range(1, len(tokens), 2):
        op, rhs = tokens[i:i + 2]

        # Add the right-hand side
        instructions.append(rhs)

        # Now apply constant folding
        instructions[-2:] = op.fold(instructions[-2:])

    return instructions
Construct proper instructions for binary expressions from a
    sequence of tokens at the same precedence level.  For instance, if
    the tokens represent "1 + 2 + 3", this will return the instruction
    array "1 2 add_op 3 add_op".

    :param tokens: The sequence of tokens.

    :returns: An instance of ``Instructions`` containing the list of
              instructions.