\documentclass[tikz,convert={outfile=\jobname.svg}]{standalone}

\usetikzlibrary{automata}
\usetikzlibrary{decorations.pathmorphing}
\usetikzlibrary{fit}
\usetikzlibrary{positioning}
\usetikzlibrary{calc}

\newcommand{\machinebox}[2][]{
  \node[fit=#2,draw,rectangle,label={above:}] {};
}


\begin{document}

\begin{tikzpicture}
\node[matrix,row sep=2em, column sep=2em] {

\node{$r = \emptyset$}; &
\node[state,initial] (q0) at (0,0) {};
\\

\node{$r = \epsilon$}; &
\node[state,initial,accepting] {};
\\

\node{$r = a$}; &
\node[state,initial] (q0) {};
\node[state,accepting] (q1) at (2,0) {};
\draw[->,>=stealth] (q0) --  (q1);
\node[above] at (1,0) {$a$};
\\

\node{$r = r_1r_2$}; &

\node[state,initial] (q00) {$q_{1s}$};
\node[state] (q01) at (2,0) {$q_{1f}$};
\draw (q00) edge[decorate,decoration={snake},->,>=stealth] (q01);
\machinebox{(q00) (q01)}{};

\node[state] (q10) at (4,0) {$q_{2s}$};
\node[state,accepting] (q11) at (6,0) {$q_{2f}$};
\draw (q10) edge[decorate,decoration={snake},->,>=stealth] (q11);
\machinebox{(q10) (q11)}{};

\draw[->,>=stealth] (q01) edge  (q10);
\node[above] at (3,0) {$\epsilon$};
\\

\node{$r = r_1 | r_2$}; &
\node[state] (q00) at (2,1) {$q_{1s}$};
\node[state,accepting] (q01) at (4,1) {$q_{1f}$};
\draw (q00) edge[decorate,decoration={snake},->,>=stealth] (q01);
\machinebox{(q00) (q01)}{};

\node[state] (q10) at (2,-1) {$q_{2s}$};
\node[state,accepting] (q11) at (4,-1) {$q_{2f}$};
\draw (q10) edge[decorate,decoration={snake},->,>=stealth] (q11);
\machinebox{(q10) (q11)}{};

\node[state,initial] at (0,0) {};

\draw[->,>=stealth] (q0) edge  (q00);
\draw[->,>=stealth] (q0) edge  (q10);
\node[above] at (1,.5) {$\epsilon$};
\node[above] at (1,-.5) {$\epsilon$};
\\

\node{$r = r_1^*$}; &
\node[state] (q00) at (2,0) {$q_{1s}$};
\node[state] (q01) at (4,0) {$q_{1f}$};
\draw (q00) edge[decorate,decoration={snake},->,>=stealth] (q01);
\machinebox{(q00) (q01)}{};

\node[state,initial,accepting] at (0,0) {};

\draw[->,>=stealth] (q0) edge  (q00);
\draw[->,>=stealth] (q01) edge[bend left] (q0);
\node[above] at (1,0) {$\epsilon$};
\node[below] at (2,-.8) {$\epsilon$};
\\
};
\end{tikzpicture}

\end{document}
Translation from regular expression $r$ to NFA.  $M_1$ and $M_2$ are machines
for $r_1$ and $r_2$, and the start state and final state of $M_1$ are $q_{1s}$ and
$q_{1f}$ respectively; similarly for $M_2$.

