]> git.uio.no Git - ifi-stolz-refaktor.git/commitdiff
Thesis: adding to AST tree
authorErlend Kristiansen <erlenkr@ifi.uio.no>
Fri, 14 Mar 2014 14:27:38 +0000 (15:27 +0100)
committerErlend Kristiansen <erlenkr@ifi.uio.no>
Fri, 14 Mar 2014 14:27:38 +0000 (15:27 +0100)
thesis/master-thesis-erlenkr.tex

index 267ff52e647355f05800b99fad8d126ed30c6533..2245eecdded5b10e0aa1cee9d42d917f61acb8f4 100644 (file)
@@ -8,7 +8,7 @@
 \usepackage{tabularx}
 \usepackage{tikz}
 \usepackage{tikz-qtree}
-\usetikzlibrary{shapes,snakes,trees}
+\usetikzlibrary{shapes,snakes,trees,arrows,shadows,positioning}
 \usepackage{babel,textcomp,csquotes,ifimasterforside,varioref}
 \usepackage[hidelinks]{hyperref}
 \usepackage{cleveref}
@@ -1821,17 +1821,35 @@ and such.
 
 \begin{figure}[h]
   \centering
-  \begin{tikzpicture}[scale=0.6]
-  \tikzset{level distance=40pt}
+  \begin{tikzpicture}[scale=0.8,text centered]
+  \tikzset{level distance=50pt}
+  \tikzset{sibling distance=5pt}
   \tikzset{edge from parent/.append style={thick}}
   \tikzset{every tree node/.style={align=center}}
-  \tikzset{every internal node/.style={ellipse,draw,fill=lightgray}}
+  \tikzset{every internal node/.style={rectangle,rounded 
+  corners,draw,fill=lightgray,drop shadow}}
   \tikzset{every leaf node/.style={draw=none,fill=none}}
 
   \Tree [.\type{CompilationUnit} [.\type{[ PackageDeclaration ]} ]
     [.\type{\{ ImportDeclaration \}*} ]
-    [.\type{\{ AbstractTypeDeclaration \}+} ]
+    [.\type{\{ AbstractTypeDeclaration \}+} [.\node(site){\type{\{ 
+    BodyDeclaration \}*}}; ] ]
   ]
+  \begin{scope}[shift={(0,-5)}]
+    \Tree [.\node[xshift=-1cm](root){\type{MethodDeclaration}};
+      [.\node[yshift=-1.3cm]{\type{\{ IExtendedModifier \}*} \\ {\footnotesize 
+      (Of type \type{Modifier} or \type{Annotation})}}; ]
+      [.\node[xshift=-1cm]{\type{\{ TypeParameter \}*}}; ]
+      [.\node[yshift=-1.3cm]{\type{\{ SingleVariableDeclaration \}*} \\ 
+    {\footnotesize (Parameters)}}; ]
+      [.{\type{\{ Name \}*} \\ {\footnotesize (Exceptions)}} ]
+      [.{\type{Type} \\ {\footnotesize (Return type)}} ]
+      [.{\type{[ Block ]} \\ {\footnotesize (Body)}} ]
+    ]
+  \end{scope}
+  \draw[->,>=triangle 45,shorten >=1pt](root.100)..controls +(north:1) and 
+  +(west:5)..(site);
+
   \end{tikzpicture}
   \caption{The format of the abstract syntax tree in Eclipse.}
   \label{fig:astEclipse}