35 \subsection*{Reference Implementation} |
35 \subsection*{Reference Implementation} |
36 |
36 |
37 This Scala assignment comes with two reference implementations in |
37 This Scala assignment comes with two reference implementations in |
38 form of \texttt{jar}-files. This allows |
38 form of \texttt{jar}-files. This allows |
39 you to run any test cases on your own computer. For example you can |
39 you to run any test cases on your own computer. For example you can |
40 call Scala on the command line with the option \texttt{-cp |
40 call scala-cli on the command line with the option \texttt{--extra-jars |
41 postfix.jar} and then query any function from the |
41 postfix.jar} and then query any function from the |
42 \texttt{postfix.scala} file (similarly for file \texttt{postfix2.scala}). As |
42 \texttt{postfix.scala} file (similarly for file \texttt{postfix2.scala}). As |
43 usual you have to prefix the calls with \texttt{C3a} and |
43 usual you have to prefix the calls with \texttt{C3a} and |
44 \texttt{C3b}, respectively. |
44 \texttt{C3b}, respectively. |
45 |
45 |
46 |
46 |
47 \begin{lstlisting}[xleftmargin=1mm,numbers=none,basicstyle=\ttfamily\small] |
47 \begin{lstlisting}[xleftmargin=1mm,numbers=none,basicstyle=\ttfamily\small] |
48 $ scala -cp postfix.jar |
48 $ scala-cli --extra-jars postfix.jar |
49 |
49 |
50 scala> C3a.syard(C3a.split("( 5 + 7 ) * 2")) |
50 scala> C3a.syard(C3a.split("( 5 + 7 ) * 2")) |
51 val res0: C3a.Toks = List(5, 7, +, 2, *) |
51 val res0: C3a.Toks = List(5, 7, +, 2, *) |
52 \end{lstlisting}%$ |
52 \end{lstlisting}%$ |
53 |
53 |