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

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

Imagen de john_e_lilley

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

publicaciones de 8 / 0 nuevos
Último envío
Para obtener más información sobre las optimizaciones del compilador, consulte el aviso sobre la optimización.
Imagen de 邓辉

I think, left to right More reasonable.

写字楼里写字间,写字间里程序员 程序人员写程序,又拿程序换酒钱 酒醒只在网上坐,酒醉还来网下眠 酒醉酒醒日复日,网上网下年复年
Imagen de Rama Kishan Malladi (Intel)

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

Imagen de 邓辉

thans Rama

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

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

Now my output is: 20.0000000000

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

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

Imagen de Rama Kishan Malladi (Intel)

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

Thanks
-Rama

Imagen de DweeberlyLoom

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

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

Inicie sesión para dejar un comentario.