Christophe Weblog Wiki Code Publications Music
figures
[paper-els-specializers.git] / figures / dispatch-relationships.tikz
1 \documentclass{standalone}
2
3 \usepackage{tikz}
4 \usetikzlibrary{shapes.geometric}
5 \usetikzlibrary{arrows}
6
7 \begin{document}
8
9 \begin{tikzpicture}
10   \begin{scope}[minimum width=8em,minimum height=3ex]
11   \node[draw,rectangle] (eql) at (0,0) {\texttt{eql-specializer}};
12   \node[draw,rectangle] (class) at (1,2) {\texttt{class}};
13   \node[draw,rectangle] (specializer) at (0.5,6) {\texttt{specializer}};
14   \node[draw,ellipse] (argument) at (7,2) {\textit{argument}};
15
16   \node[draw,red,ellipse] (generalizer) at (7,4) {\textit{\color{red}generalizer}};
17   \node[draw,red,rectangle] (genspec) at (2,4) {\texttt{\color{red}gen.-spec.}};
18   \end{scope}
19
20   \draw[->,>=open triangle 60] (eql.168) |- (specializer);
21   \draw[->,>=open triangle 60] (class.160) -- (class.160 |- specializer.south);
22   \draw[->,>=open triangle 60,red] (genspec.150) -- (genspec.150 |- specializer.south);
23
24   \draw[dashed] (argument.south) |- node[right,near start] {\texttt{eql}} node[below,near end] {\texttt{eql-specializer-object}} (eql.east);
25   \draw[dashed] (argument.west) -- node[below] {\texttt{subtypep}} node[above] {\texttt{class-of}} (class.east);
26   \draw[red] (argument.north) -- node[right] {\texttt{\color{red}generalizer-of}} (generalizer.south);
27   \draw[red] (generalizer.west) -- node[above] (sagp) {\texttt{\color{red}s-a-g-p}} (genspec.east);
28   \node (specaccgenp) at (6,5.5) {\texttt{\footnotesize{\color{red}specializer-accepts-generalizer-p}}};
29   \draw[red,dotted] (sagp) -- (specaccgenp);
30
31 \end{tikzpicture}
32
33 \end{document}