Transformation in Zwischensprache
This commit is contained in:
parent
18fb7c8c67
commit
0259fd2643
BIN
verfahren.pdf
BIN
verfahren.pdf
Binary file not shown.
@ -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}
|
||||
|
Loading…
Reference in New Issue
Block a user