diff options
Diffstat (limited to 'Master/texmf-dist/doc/latex/schule/doc/schule-syntaxPython.tex')
-rw-r--r-- | Master/texmf-dist/doc/latex/schule/doc/schule-syntaxPython.tex | 96 |
1 files changed, 96 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/latex/schule/doc/schule-syntaxPython.tex b/Master/texmf-dist/doc/latex/schule/doc/schule-syntaxPython.tex new file mode 100644 index 00000000000..0852ce9db90 --- /dev/null +++ b/Master/texmf-dist/doc/latex/schule/doc/schule-syntaxPython.tex @@ -0,0 +1,96 @@ +\documentclass[a4paper]{scrartcl} +\usepackage[utf8]{inputenc} +\input{etc.tex} +\begin{document} + \section*{Darstellung der Syntax von \texttt{if-then-else} in Python} + \begin{lstlisting}[gobble=2,basicstyle=\footnotesize,multicols=2,caption={}] + \node [] {}; + \node [terminal] {if}; + \node [nonterminal] {Bedingung}; + \node [terminal] {:}; + \node [nonterminal] + {Anweisungsblock}; + \node (ersteReiheEnde) [point] {}; + \node (ersteReiheEndeUnten) + [point, below=of + ersteReiheEnde] {}; + \node (zweiteReiheStartOben) + [point, left=of + ersteReiheEndeUnten, + xshift=-75mm] {}; + \node (zweiteReiheStart) + [point, below=of + zweiteReiheStartOben] {}; + { + [start chain=elif going right] + \chainin (zweiteReiheStart); + \node [terminal] {elif}; + \node [nonterminal] + {Bedingung}; + \node [terminal] {:}; + \node [nonterminal] + {Anweisungsblock}; + \node (elifEnde) [point] {}; + \node (elifEndeOben) [point, + above=of elifEnde] {}; + \draw[->,left] (elifEndeOben) + -- (ersteReiheEndeUnten); + } + \node (dritteReiheStart) [point, + below=of zweiteReiheStart, + yshift=-5mm] {}; + \node (vierteReiheStart) [point, + below=of dritteReiheStart, + yshift=-5mm] {}; + \node (vierteReiheEnde) [point, + xshift=84mm] {}; + { + [start chain=else going right] + \chainin (dritteReiheStart); + \node [terminal] {else}; + \node [terminal] {:}; + \node (elseEnde) [nonterminal] + {Anweisungsblock}; + \draw[->] (elseEnde) + -| (vierteReiheEnde); + } + \node (ende) [endpoint] {}; + \end{lstlisting} + \vspace{0.6cm} + \hrule width \textwidth + \vspace{1cm} + \begin{tikzpicture}[syntaxdiagramm] + \node [] {}; + \node [terminal] {if}; + \node [nonterminal] {Bedingung}; + \node [terminal] {:}; + \node [nonterminal] {Anweisungsblock}; + \node (ersteReiheEnde) [point] {}; + \node (ersteReiheEndeUnten) [point, below=of ersteReiheEnde] {}; + \node (zweiteReiheStartOben) [point, left=of ersteReiheEndeUnten, xshift=-75mm] {}; + \node (zweiteReiheStart) [point, below=of zweiteReiheStartOben] {}; + { + [start chain=elif going right] + \chainin (zweiteReiheStart); + \node [terminal] {elif}; + \node [nonterminal] {Bedingung}; + \node [terminal] {:}; + \node [nonterminal] {Anweisungsblock}; + \node (elifEnde) [point] {}; + \node (elifEndeOben) [point, above=of elifEnde] {}; + \draw[->,left] (elifEndeOben) -- (ersteReiheEndeUnten); + } + \node (dritteReiheStart) [point, below=of zweiteReiheStart, yshift=-5mm] {}; + \node (vierteReiheStart) [point, below=of dritteReiheStart, yshift=-5mm] {}; + \node (vierteReiheEnde) [point, xshift=84mm] {}; + { + [start chain=else going right] + \chainin (dritteReiheStart); + \node [terminal] {else}; + \node [terminal] {:}; + \node (elseEnde) [nonterminal] {Anweisungsblock}; + \draw[->] (elseEnde) -| (vierteReiheEnde); + } + \node (ende) [endpoint] {}; + \end{tikzpicture} +\end{document} |