To solve this optimization problem, we first need to define the decision variables, objective function, and constraints.

Let's denote:
- \(x\) as the number of pancakes made,
- \(y\) as the number of waffles made.

The objective is to maximize profit. Given that each pancake yields a profit of $5 and each waffle yields a profit of $7, the objective function can be written as:
\[ \text{Maximize} \quad 5x + 7y \]

Now, let's consider the constraints:
1. **Flour Constraint**: Each pancake requires 30 grams of flour, and each waffle requires 50 grams of flour. The diner has 5000 grams of flour available.
\[ 30x + 50y \leq 5000 \]
2. **Butter Constraint**: Each pancake requires 10 grams of butter, and each waffle requires 15 grams of butter. The diner has 2000 grams of butter available.
\[ 10x + 15y \leq 2000 \]
3. **Non-Negativity Constraints**: Since the number of pancakes and waffles cannot be negative,
\[ x \geq 0, y \geq 0 \]

This problem can now be represented in Gurobi code as follows:

```python
from gurobipy import *

# Create a new model
model = Model("Breakfast_Diner_Optimization")

# Define the decision variables
x = model.addVar(lb=0, vtype=GRB.CONTINUOUS, name="pancakes")
y = model.addVar(lb=0, vtype=GRB.CONTINUOUS, name="waffles")

# Define the objective function: Maximize profit
model.setObjective(5*x + 7*y, GRB.MAXIMIZE)

# Add constraints
model.addConstr(30*x + 50*y <= 5000, "flour_constraint")
model.addConstr(10*x + 15*y <= 2000, "butter_constraint")

# Optimize the model
model.optimize()

# Print the results
if model.status == GRB.OPTIMAL:
    print(f"Optimal solution: {x.varName} = {x.x}, {y.varName} = {y.x}")
    print(f"Maximum profit: ${model.objVal:.2f}")
else:
    print("No optimal solution found")
```