core_testing3/postfix_test1.scala
author Christian Urban <christian.urban@kcl.ac.uk>
Sun, 15 Sep 2024 12:57:59 +0100
changeset 493 244df77507c2
parent 474 b528d1d3d3c3
permissions -rw-r--r--
updated
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
474
b528d1d3d3c3 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 401
diff changeset
     1
b528d1d3d3c3 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 401
diff changeset
     2
def urbanmain() = {
b528d1d3d3c3 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 401
diff changeset
     3
  import C3a._
300
72688efdf17c updated testing files
Christian Urban <urbanc@in.tum.de>
parents: 249
diff changeset
     4
249
1997cfcd6334 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     5
474
b528d1d3d3c3 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 401
diff changeset
     6
  assert(syard(split("3 + 4 * ( 2 - 1 )")) == List("3", "4", "2", "1", "-", "*", "+"))
b528d1d3d3c3 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 401
diff changeset
     7
  assert(syard(split("( ( ( 3 ) ) + ( ( 4 + ( 5 ) ) ) )")) == List("3", "4", "5", "+", "+"))
b528d1d3d3c3 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 401
diff changeset
     8
  assert(syard(split("5 + 7 / 2")) == List("5", "7", "2", "/", "+"))
b528d1d3d3c3 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 401
diff changeset
     9
  assert(syard(split("5 * 7 / 2")) == List("5", "7", "*", "2", "/"))
b528d1d3d3c3 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 401
diff changeset
    10
}