Please clarify: Right-to-left or left-to-right?

Please clarify: Right-to-left or left-to-right?

Herehttp://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 / 3l-t-r = 10r-t-l = 20

8 Beiträge / 0 neu
Letzter Beitrag
Nähere Informationen zur Compiler-Optimierung finden Sie in unserem Optimierungshinweis.

I think, left to right More reasonable.

写字楼里写字间,写字间里程序员
程序人员写程序,又拿程序换酒钱
酒醒只在网上坐,酒醉还来网下眠
酒醉酒醒日复日,网上网下年复年

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.

Thanks
-Rama

thans Rama

If the definition of priority * /" > " - + ".

then the Right-to-left Poland expression can be more easily .

Now my output is: 20.0000000000

写字楼里写字间,写字间里程序员
程序人员写程序,又拿程序换酒钱
酒醒只在网上坐,酒醉还来网下眠
酒醉酒醒日复日,网上网下年复年

Rama,Please, just say which it is. I thinkyou mean that we'll stick with the original "right to left" statement.john

Hi,
Yes, I mean that we will stick with the original "right to left".

Thanks
-Rama

that's my head exploding :-DThanks for the clarification.

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()); }}

Kommentar hinterlassen

Bitte anmelden, um einen Kommentar hinzuzufügen. Sie sind noch nicht Mitglied? Jetzt teilnehmen