error in chapter7

47 views
Skip to first unread message

TianTian

unread,
Sep 16, 2012, 2:35:50 AM9/16/12
to ppp-p...@googlegroups.com
Hi everyone,
In my book chapter7.5 there is a set of code like this:

case '%':
{
int i1 = narrow_cast<int>(left);
int i2 = narrow_cast<int>(term());
if(i2==0) error("%: divide by zero");
left = i1%i2;
t = ts.get();
break;
}

I think in the line " int i2 = narrow_cast<int>(term());" the
"term()" may be wrong. According the grammar offered by chapter 6 it
should be Term % Primary. So it must be "primary()" here.
Tian Tian
Reply all
Reply to author
Forward
0 new messages