bottom prev next

Precedence

AecImpl.java:

In this step we develop the existing method AecImpl.java:processItem() further by introducing a new one:

private boolean addOperator()

which handles properly only the operators of differing precedences:

java -Dae="9-4*2" -jar aec.jar prefix queue, 5 item(s): [-{1.2}][9{1.1}][*{1.4}][4{1.3}][2{1.5}] 0 java -Don=postfix -Dae="9*4-2" -jar aec.jar postfix queue, 5 item(s): [9{1.1}][4{1.3}][*{1.2}][2{1.5}][-{1.4}] 0


Files

Modified: AecImpl.java

Makefile

Aec.java AecImpl.java Postfix.java Prefix.java AeNotation.java AeItem.java IReader.java

\(\blacksquare\)

top prev next