def _get_expr_indices(expr_dag, expr_code):
    """
    Get indices of all read/write expression in the expression dag which is represented as a list.
    :param expr_dag: The expression dag to search for read/write expressions.
    :param expr_code: The expression code.
    :return: A list of indices with all expressions that match the expression code.
    """
    expr_indices = []
    for iExp, expr in enumerate(expr_dag.expressions):
        if expr.code == expr_code:
            expr_indices.append(iExp)
    return expr_indices
