\begin{frame} \frametitle{Component Extensions} Extend via extra \emph{filter nodes} \begin{center} \begin{tikzpicture} [ nd/.style={circle, minimum size=9mm, very thick, draw=blue!50!black!50, top color=white, bottom color=blue!50!black!20,font=\scriptsize} , nd2/.style={circle, minimum size=9mm, very thick, draw=red!50!black!50, top color=white, bottom color=red!50!black!20,font=\scriptsize} , nd3/.style={circle, minimum size=6mm, very thick, draw=green!50!black!50, top color=white, bottom color=green!50!black!20,font=\scriptsize} , nd4/.style={circle, minimum size=6mm, very thick, draw=purple!50!black!50, top color=purple!50!white!50, bottom color=purple!50,font=\scriptsize} , attr/.style={rectangle, minimum size=4mm, node distance=6mm, very thick, draw=black!50, top color=white, bottom color=black!20,font=\scriptsize} , inh/.style={attr} , syn/.style={attr} , leftfirst/.style={xshift=-4mm} , rightfirst/.style={xshift=4mm} , arr/.style={->,dashed, very thick} ] \node[nd2](n1){} [sibling distance=40mm] child { node[nd4](n2){} child { node[nd2](n3){} child { node{} } child { node{} } } } child { node{} }; \node[inh,leftfirst](a11) [left of=n1] {}; \node[syn,rightfirst](a12) [right of=n1] {}; \node[syn] (n2syn2)(a13) [right of=a12] {}; \node[inh,leftfirst](a21) [left of=n2] {}; \node[syn,rightfirst](a22) [right of=n2] {}; \node[syn] (n2syn2)(a23) [right of=a22] {}; \node[inh,leftfirst](a31) [left of=n3] {}; \node[syn,rightfirst](a32) [right of=n3] {}; \node[syn] (n2syn2)(a33) [right of=a32] {}; \end{tikzpicture} \end{center} \end{frame} \begin{frame} \frametitle{Example: let-bound polymorphism} \begin{center} \begin{tikzpicture} [ nd/.style={circle, minimum size=9mm, very thick, draw=blue!50!black!50, top color=white, bottom color=blue!50!black!20,font=\scriptsize} , nd2/.style={circle, minimum size=9mm, very thick, draw=red!50!black!50, top color=white, bottom color=red!50!black!20,font=\scriptsize} , nd3/.style={circle, minimum size=6mm, very thick, draw=green!50!black!50, top color=white, bottom color=green!50!black!20,font=\scriptsize} , nd4/.style={circle, minimum size=6mm, very thick, draw=purple!50!black!50, top color=purple!50!white!50, bottom color=purple!50,font=\scriptsize} , tr/.style={isosceles triangle,rotate=90, minimum size=12mm, very thick, draw=blue!50!black!50, top color=white, bottom color=blue!50!black!20,font=\footnotesize} , attr/.style={rectangle, minimum size=4mm, node distance=6mm, very thick, draw=black!50, top color=white, bottom color=black!20,font=\scriptsize} , inh/.style={attr} , syn/.style={attr} , leftfirst/.style={xshift=-4mm} , rightfirst/.style={xshift=4mm} , arr/.style={->,dashed, very thick} ] \node[nd4](e1){} child { node[nd2](n1){|sc|} child { node[nd2](n2){|split|} [sibling distance=40mm] child { node[tr](n3){|decls|} } child { node[nd4](e2){} child { node[tr](n4){|body|} } } } }; \pause \node[nd, right of=e1, xshift=30mm](x1){|let|}; \pause \node[nd3,left of=x1, xshift=6mm](e3){}; \node[nd3,below of=x1, yshift=6mm](e4){}; \draw[-,dashed](e1) to (e3); \draw[-,dashed](e2) to (e4); \end{tikzpicture} \end{center} \end{frame} \begin{frame} \frametitle{Example: let-bound polymorphism - code} \begin{code} sem_Expr_Let ds b = sem :: Expr lhs.nmTree = loc.semTop $ sem_Name_Scope $ sem_Name_Split decls.nmTree $ loc.semBody body.nmTree loc.semTop t = sem :: Name Ty child body :: Name Ty = t loc.parentEnv = lhs.finEnv loc.semBody t = sem :: Name Ty child body :: Name Ty = t body.finEnv = generalize lhs.finEnv loc.parentEnv \end{code} \end{frame} \begin{frame} \frametitle{AG convenience} \begin{itemize} \item Override one or two attributes with filter nodes \item Copy rules take care of the rest \end{itemize} \end{frame} \begin{frame} \frametitle{Limitations} \begin{center} \begin{tikzpicture} [ nd/.style={circle, minimum size=9mm, very thick, draw=blue!50!black!50, top color=white, bottom color=blue!50!black!20,font=\scriptsize} , nd2/.style={circle, minimum size=9mm, very thick, draw=red!50!black!50, top color=white, bottom color=red!50!black!20,font=\scriptsize} , nd3/.style={circle, minimum size=6mm, very thick, draw=green!50!black!50, top color=white, bottom color=green!50!black!20,font=\scriptsize} , attr/.style={rectangle, minimum size=4mm, node distance=6mm, very thick, draw=black!50, top color=white, bottom color=black!20,font=\scriptsize} , inh/.style={attr} , syn/.style={attr} , leftfirst/.style={xshift=-4mm} , rightfirst/.style={xshift=4mm} , arr/.style={->,dashed, very thick} ] \node[nd](n1){} child { node[nd](n2){} child { node[nd](n3){} child { node[nd](n4){} child { node[nd](n5){} } } } }; \node[nd2, right of=n1, xshift=40mm, yshift=5mm](r1){} child { node[nd2](r2){} child { node[nd2](r3){} child { node[nd2](r4){} child { node[nd2](r5){} } } } }; \node[nd3, right of=n1, xshift=-4mm](e1){}; \node[nd3, right of=n2, xshift=-4mm](e2){}; \node[nd3, right of=n3, xshift=-4mm](e3){}; \node[nd3, right of=n4, xshift=-4mm](e4){}; \node[nd3, right of=n5, xshift=-4mm](e5){}; \draw[-](e1) to (r1); \draw[-](e2) to (r2); \draw[-](e3) to (r3); \draw[-](e4) to (r4); \draw[-](e5) to (r5); \end{tikzpicture} \end{center} \end{frame}