title: Grammar involving braces
body: <p>I'm trying to solve DCG grammar in prolog and succeeded upto a point, i'm stuck in evaluating the expressions involving braces like these. 
  <code>expr( T, [’(’, 5, +, 4, ’)’, *, 7], []),</code></p>
  
  <pre><code>expr(Z) --&gt; num(Z).
  expr(Z) --&gt; num(X), [+], expr(Y), {Z is X+Y}.
  expr(Z) --&gt; num(X), [-], expr(Y), {Z is X-Y}.
  expr(Z) --&gt; num(X), [*], expr(Y), {Z is X*Y}.
  num(D) --&gt; [D], {number(D)}.
  
  eval(L, V, []) :- expr(V, L, []).
  </code></pre>