%AST for if, source code Laure Gonnord for MIF08 2016/17
\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{positioning,shapes.geometric}
\usetikzlibrary{hobby,backgrounds,calc,fit}

\begin{document}
  \begin{tikzpicture}[%
    ->,
    shorten >=2pt,
    >=stealth,
    node distance=5mm,
    noname/.style={%
      ellipse,
      minimum width=2em,
      minimum height=1em,
      draw
    }
  ]


\begin{scope}
    \node[noname] (1)  {;};
    \node[noname] (2) [below left=5mm and 1cm  of 1]                           {:=};
    \node[noname] (4) [below left=5mm of 2] {$x$};
    \node[noname] (5) [below right=5mm of 2] {$3$};

    \node[noname] (6) [below right=5mm and 2cm  of 1]                           {if};
    \node[noname] (7) [below left=5mm and 1 cm of 6] {$x<5$};
    \node[noname] (8) [below=of 6] {:=};
    \node[noname] (10) [below left=5mm of 8] {$y$};
    \node[noname] (11) [below right=5mm of 8] {$x+1$};

    \node[noname] (9) [below right=5mm and 1 cm of 6] {skip};


    \path (1) edge                   node {} (2)
    (2) edge                   node {} (4)
    (2) edge                   node {} (5)
    (1) edge                   node {} (6)
    (6) edge                   node {} (7)
    (6) edge                   node {} (8)
    (6) edge                   node {} (9)
    (8) edge                   node {} (10)
    (8) edge                   node {} (11)
;

\end{scope}

  \end{tikzpicture}



\end{document}
