marking4/postfix_test7.scala
author Christian Urban <christian.urban@kcl.ac.uk>
Thu, 13 Jan 2022 12:34:43 +0000
changeset 422 217bbd700594
parent 288 65731df141a5
permissions -rw-r--r--
updated

import CW9a._


assert(syard(split("3 + 4 * ( 2 - 1 )")) == List("3", "4", "2", "1", "-", "*", "+"))
assert(syard(split("( ( ( 3 ) ) + ( ( 4 + ( 5 ) ) ) )")) == List("3", "4", "5", "+", "+"))
assert(syard(split("5 + 7 / 2")) == List("5", "7", "2", "/", "+"))
assert(syard(split("5 * 7 / 2")) == List("5", "7", "*", "2", "/"))