% \subsection{Das Paket \texttt{syntaxdi}} % Die ausführliche Beschreibung des Pakets ist in der % Paketbeschreibung (\ref{paket:syntaxdi}) zu finden. % % Beginn der Definition, Voraussetzung der \LaTeXe{} Version und die % eigene Identifizierung % \begin{macrocode} \NeedsTeXFormat{LaTeX2e}[1995/12/01] \ProvidesPackage{syntaxdi}[2014/11/18 v0.5 % Syntaxdiagramme mit TikZ] % \end{macrocode} % Einbinden der benötigten Pakete % \begin{macrocode} \RequirePackage{tikz} \usetikzlibrary{chains} \usetikzlibrary{arrows,shadows,shapes.misc,scopes} % \end{macrocode} % % \subsubsection{TikZ-Definitionen} % % Definition für nicht terminale Symbole für Syntaxdiagramme in TikZ % \begin{macrocode} \tikzset{ fnonterminal/.style={ rectangle, minimum size=6mm, text height=1.5ex,text depth=.25ex, very thick, draw=red!50!black!50, % 50% red und 50% black, top color=white, % oben: weisser Schatten ... bottom color=red!50!black!20, % unten: anderer Schatten font=\itshape } } \tikzset{ nonterminal/.style={ % Die Form: rectangle, % Die Größe: minimum size=6mm, text height=1.5ex,text depth=.25ex, % Der Rand: very thick, draw=red!50!black!50, % 50% red und 50% black, % gemischt mit 50% white % Füllfarbe: top color=white, % oben: weisser Schatten ... bottom color=red!50!black!20, % unten: anderer Schatten % Font font=\itshape } } % \end{macrocode} % % Definitionen für terminale Symbole im Syntaxdiagramm in TikZ % \begin{macrocode} \tikzset{ fterminal/.style={ rounded rectangle, minimum size=6mm, very thick,draw=black!50, text height=1.5ex,text depth=.25ex, top color=white,bottom color=black!20, font=\ttfamily } } \tikzset{ terminal/.style={ % Die Form: rounded rectangle, minimum size=6mm, % Der Rest ... very thick,draw=black!50, text height=1.5ex,text depth=.25ex, top color=white,bottom color=black!20, font=\ttfamily } } % \end{macrocode} % % Definitionen eines Punktes für das Syntaxdiagramm in TikZ % \begin{macrocode} \tikzset{ point/.style={ circle, inner sep=0pt, minimum size=0pt } } % \end{macrocode} % % Definition eines Endpunktes für das Syntaxdiagramm in TikZ % \begin{macrocode} \tikzset{ endpoint/.style={ circle, inner sep=0pt, minimum size=0pt } } % \end{macrocode} % % Definition der Syntaxdiagramme in TikZ % \begin{macrocode} \tikzset{ syntaxdiagramm/.style={ start chain, node distance=7mm and 5mm, every node/.style={on chain}, nonterminal/.append style={join=by ->}, terminal/.append style={join=by ->}, endpoint/.append style={join=by ->}, point/.append style={join=by -}, skip loop/.style={to path={-- ++(0,-.5) -| (\tikztotarget)}} } } % \end{macrocode} % % Ende des Pakets \texttt{syntaxdi}