Here
http://software.intel.com/en-us/forums/showpost.php?p=152354
Rama said "right to left" as the default operator order. Did he really mean "left to right"? Right-to-left is terribly non-standard and unintuitive, but if that's the spec, then that's the spec. For example consider:
15 + 15 / 3
l-t-r = 10
r-t-l = 20
Hi, I agree left toright might be sensible and easy to implement if it may. But given that we are 12 days to the closing of problem set 3 (June 27), I would want to do minimal changes to the problem statement unless really required.
Let me help. This is not that hard, at least for recursive-descent:
LTR:
ParseExpr() {
expr = ParseAtomic();
while (token is binaryop) {
expr = MakeBinaryExpr(token, expr, ParseAtomic());
}
}
RTL:
ParseExpr() {
expr = ParseAtomic();
if (token is binaryop) {
expr = MakeBinaryExpr(token, expr, ParseExpr());
}
}
Please clarify: Right-to-left or left-to-right?
Here http://software.intel.com/en-us/forums/showpost.php?p=152354
Rama said "right to left" as the default operator order. Did he really mean "left to right"? Right-to-left is terribly non-standard and unintuitive, but if that's the spec, then that's the spec. For example consider: 15 + 15 / 3 l-t-r = 10 r-t-l = 20