marking4/postfix2.scala
changeset 288 65731df141a5
parent 257 ba4d976ca88d
equal deleted inserted replaced
287:c493eaba6018 288:65731df141a5
     1 // Shunting Yard Algorithm 
     1 // Shunting Yard Algorithm 
     2 // including Associativity for Operators 
     2 // including Associativity for Operators 
     3 // =====================================
     3 // =====================================
     4 
     4 
     5 //object CW9c { // just for generating a jar file
     5 object CW9b { 
     6 
     6 
     7 // type of tokens
     7 // type of tokens
     8 type Toks = List[String]
     8 type Toks = List[String]
     9 
     9 
    10 // helper function for splitting strings into tokens
    10 // helper function for splitting strings into tokens
    95 
    95 
    96 //compute(syard(split("( 3 + 1 ) ^ 2 ^ 3")))   // 65536
    96 //compute(syard(split("( 3 + 1 ) ^ 2 ^ 3")))   // 65536
    97 
    97 
    98 
    98 
    99 
    99 
   100 //}
   100 }