please can anyone explain with out the use of any programming language tool, what is the rule for converting a code segment,(not an expression) to postfix notation....Thank you I appreciate in advance of your responses
-
What do you mean by postfix notation if you're not talking about expressions? – sepp2k Jul 11 '19 at 09:16
2 Answers
Intermediate Code, and Final Code uses prefixed notation, not posfixed Notation.
Example (Prefixed Notation) :
Sum B, Mem[6455];
Example (Posfixed Notation) :
B, Mem[6455], Sum
Let's suppose you mean "prefixed notation".
There are two groups of instructions that can be converted into a prefixed notation.
The first are expressions like:
somevar <- (x + y);
Second, non return functions also know as "procedures" or "subroutines".
GotoXY(Column, Row);
In the second, the I'd of the function becomes the prefixed Id. of the instruction, followed by the parameters.
GotoXY Column, Row
Usually the Id. Indicates an address:
Load RegisterA, Column;
Load RegisterB, Row;
Load RegisterC, GotoXY
Call RegisterC
This may differ from one intermediate code to another.
It's common, to have both expressions and instructions combined.
GotoXY (Sum(Delta, W), B - Z);
So, you may have to transform the inner expressions and inner functions calls first.

- 4,091
- 3
- 19
- 29
Assuming you are trying to convert infix notation to postfix, Shunting-yard Algorithm might be what you are looking for.