diff options
author | Karl Berry <karl@freefriends.org> | 2015-05-08 21:28:31 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2015-05-08 21:28:31 +0000 |
commit | 0c2bb1a3f4ead43fc8928b06efe420c099c46a67 (patch) | |
tree | c79c3ebbf31019ed03632e8d5796e5371608fc66 /Master/texmf-dist/doc/latex/schule/doc/syntaxPython.tex | |
parent | ffc1247a8082e1fbdd07c9e43979da46e5330ac0 (diff) |
schule (8may15)
git-svn-id: svn://tug.org/texlive/trunk@37277 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/latex/schule/doc/syntaxPython.tex')
-rw-r--r-- | Master/texmf-dist/doc/latex/schule/doc/syntaxPython.tex | 96 |
1 files changed, 96 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/latex/schule/doc/syntaxPython.tex b/Master/texmf-dist/doc/latex/schule/doc/syntaxPython.tex new file mode 100644 index 00000000000..0852ce9db90 --- /dev/null +++ b/Master/texmf-dist/doc/latex/schule/doc/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} |