diff --git a/verfahren.pdf b/verfahren.pdf index c6a38a4..d5cb7af 100644 Binary files a/verfahren.pdf and b/verfahren.pdf differ diff --git a/verfahren.tex b/verfahren.tex index ddb519b..982045e 100644 --- a/verfahren.tex +++ b/verfahren.tex @@ -69,6 +69,24 @@ \item Wenn Typparameter \texttt{A} einer Methode nicht aus den Argumenten ableitbar ist, Verwendung des abgeleiteten Typs \texttt{*}, der Untertyp aller Typen ist \end{enumerate} +\section{Transformation zu Zwischensprache} +\begin{itemize} + \item mehrdimensionale Arrays meistens zu eindimensionalen Array linearisiert + \item Operatorenabbildung in \enquote{Post-Order}-Reihenfolge + \item Kurzschlusssemantik: \begin{itemize} + \item code(\texttt{a \&\& b}, $\texttt{L}_\texttt{true}$, $\texttt{L}_\texttt{false}$) $\rightarrow$ code(\texttt{a}, $\texttt{L1}$, $\texttt{L}_\texttt{false}$); \texttt{L1:} code(\texttt{b}, $\texttt{L}_\texttt{true}$, $\texttt{L}_\texttt{false}$) + \item code(\texttt{a || b}, $\texttt{L}_\texttt{true}$, $\texttt{L}_\texttt{false}$) $\rightarrow$ code(\texttt{a}, $\texttt{L}_\texttt{true}$, $\texttt{L1}$); \texttt{L1:} code(\texttt{b}, $\texttt{L}_\texttt{true}$, $\texttt{L}_\texttt{false}$) + \item code(\texttt{!a}, $\texttt{L}_\texttt{true}$, $\texttt{L}_\texttt{false}$) $\rightarrow$ code(\texttt{a}, $\texttt{L}_\texttt{false}$, $\texttt{L}_\texttt{true}$ + \end{itemize} + \item code(\texttt{while e do st od}) $\rightarrow$ $\texttt{jmp L}_\texttt{cond}$; $\texttt{L}_\texttt{true}$: code(\texttt{st}); $\texttt{L}_\texttt{cond}$: code(\texttt{e}, $\texttt{L}_\texttt{true}$, $\texttt{L}_\texttt{false}$); $\texttt{L}_\texttt{false}$: + \item \texttt{switch-case}: \begin{itemize} + \item \texttt{if}-Kaskade + \item \texttt{lookupswitch}: Tabelle aus $(c_i, \texttt{L}_i)$-Tupel von Konstante $c_i$ und Sprungziel $\texttt{L}_i$ wird durchsucht + \item \texttt{tableswitch}: Konstante wird als Index in Tabelle mit Sprungzielen (\enquote{jump table}) gewählt + \end{itemize} +\end{itemize} + + \section{Geschachtelte Funktionen} \subsection{ohne Display}