octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #54698] Precedence of call/indexing operator o


From: anonymous
Subject: [Octave-bug-tracker] [bug #54698] Precedence of call/indexing operator over transpose operator
Date: Mon, 24 Sep 2018 11:20:40 -0400 (EDT)
User-agent: Mozilla/5.0 (Windows NT 5.1; rv:51.0) Gecko/20100101 Firefox/51.0

Follow-up Comment #17, bug #54698 (project octave):

It can be concluded from your comment that it is impossible to design a
language that only has multiple postfix operators with different level of
precedence and if precedence is defined for them it is completely useless and
meaningless because as you have noted all unitary operators , regardless of
their level of precedence , are applied to their operator from inside to
outside.
But I can refer you to papers (1)
<https://doi.org/10.1016/0304-3975(95)90680-J> that have designed algorithms
for parsing languages that have postfix,prefix and infix operators of
different level of precedence.

Here is the common definitions for precedence and associativity that can be
googled:

The operator precedence rules for expression evaluation define the order in
which “adjacent” operators of different precedence levels are evaluated.
The operator associativity rules for expression evaluation define the order in
which adjacent operators with the same precedence level are evaluated.

So the execution of unary operators from the inside to the outside is related
to associativity.


The ++ in the expression a++(3) is postfix and it works similar to languages
such as c++. In c++ the postfix operator and the call operator have the same
level of precedence.

(1) Aasa A. (1991) Precedences in specifications and implementations of
programming languages. In: Maluszyński J., Wirsing M. (eds) Programming
Language Implementation and Logic Programming. PLILP 1991. Lecture Notes in
Computer Science, vol 528. Springer, Berlin, Heidelberg

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?54698>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]