18 \usetikzlibrary{shadows} |
15 \usetikzlibrary{shadows} |
19 \usetikzlibrary{positioning} |
16 \usetikzlibrary{positioning} |
20 \usetikzlibrary{calc} |
17 \usetikzlibrary{calc} |
21 \usetikzlibrary{plotmarks} |
18 \usetikzlibrary{plotmarks} |
22 \usepackage{graphicx} |
19 \usepackage{graphicx} |
23 \setmonofont{Consolas} |
20 \usepackage{../langs} |
24 |
21 \usepackage{../data} |
25 \definecolor{javared}{rgb}{0.6,0,0} % for strings |
22 |
26 \definecolor{javagreen}{rgb}{0.25,0.5,0.35} % comments |
|
27 \definecolor{javapurple}{rgb}{0.5,0,0.35} % keywords |
|
28 \definecolor{javadocblue}{rgb}{0.25,0.35,0.75} % javadoc |
|
29 |
23 |
30 \makeatletter |
24 \makeatletter |
31 \lst@CCPutMacro\lst@ProcessOther {"2D}{\lst@ttfamily{-{}}{-{}}} |
25 \lst@CCPutMacro\lst@ProcessOther {"2D}{\lst@ttfamily{-{}}{-{}}} |
32 \@empty\z@\@empty |
26 \@empty\z@\@empty |
33 \makeatother |
27 \makeatother |
34 |
28 |
35 |
29 |
36 \lstdefinelanguage{scala}{ |
|
37 morekeywords={abstract,case,catch,class,def,% |
|
38 do,else,extends,false,final,finally,% |
|
39 for,if,implicit,import,match,mixin,% |
|
40 new,null,object,override,package,% |
|
41 private,protected,requires,return,sealed,% |
|
42 super,this,throw,trait,true,try,% |
|
43 type,val,var,while,with,yield}, |
|
44 otherkeywords={=>,<-,<\%,<:,>:,\#,@}, |
|
45 sensitive=true, |
|
46 morecomment=[l]{//}, |
|
47 morecomment=[n]{/*}{*/}, |
|
48 morestring=[b]", |
|
49 morestring=[b]', |
|
50 morestring=[b]""" |
|
51 } |
|
52 |
|
53 \lstdefinelanguage{while}{ |
|
54 morekeywords={while, if, then. else, read, write}, |
|
55 otherkeywords={=>,<-,<\%,<:,>:,\#,@}, |
|
56 sensitive=true, |
|
57 morecomment=[l]{//}, |
|
58 morecomment=[n]{/*}{*/}, |
|
59 morestring=[b]", |
|
60 morestring=[b]', |
|
61 morestring=[b]""" |
|
62 } |
|
63 |
|
64 |
|
65 \lstset{language=Scala, |
|
66 basicstyle=\ttfamily, |
|
67 keywordstyle=\color{javapurple}\bfseries, |
|
68 stringstyle=\color{javagreen}, |
|
69 commentstyle=\color{javagreen}, |
|
70 morecomment=[s][\color{javadocblue}]{/**}{*/}, |
|
71 numbers=left, |
|
72 numberstyle=\tiny\color{black}, |
|
73 stepnumber=1, |
|
74 numbersep=10pt, |
|
75 tabsize=2, |
|
76 showspaces=false, |
|
77 showstringspaces=false} |
|
78 |
|
79 |
|
80 % beamer stuff |
30 % beamer stuff |
81 \renewcommand{\slidecaption}{AFL 06, King's College London, 30.~October 2013} |
31 \renewcommand{\slidecaption}{AFL 06, King's College London, 30.~October 2013} |
82 \newcommand{\bl}[1]{\textcolor{blue}{#1}} |
32 \newcommand{\bl}[1]{\textcolor{blue}{#1}} |
83 \newcommand{\dn}{\stackrel{\mbox{\scriptsize def}}{=}}% for definitions |
33 \newcommand{\dn}{\stackrel{\mbox{\scriptsize def}}{=}}% for definitions |
84 |
|
85 |
|
86 \begin{filecontents}{s-grammar1.data} |
|
87 1 0.01152 |
|
88 51 0.07973 |
|
89 101 0.09726 |
|
90 151 0.09320 |
|
91 201 0.10010 |
|
92 251 0.16997 |
|
93 301 0.26662 |
|
94 351 0.46118 |
|
95 401 0.62516 |
|
96 451 0.87247 |
|
97 501 1.16334 |
|
98 551 1.71152 |
|
99 601 2.10958 |
|
100 651 2.44360 |
|
101 701 2.98488 |
|
102 751 3.50326 |
|
103 801 4.11036 |
|
104 851 4.93394 |
|
105 901 5.77465 |
|
106 951 7.39123 |
|
107 \end{filecontents} |
|
108 |
|
109 \begin{filecontents}{s-grammar2.data} |
|
110 1 0.01280 |
|
111 2 0.00064 |
|
112 3 0.00173 |
|
113 4 0.00355 |
|
114 5 0.00965 |
|
115 6 0.02674 |
|
116 7 0.06953 |
|
117 8 0.11166 |
|
118 9 0.18707 |
|
119 10 0.09189 |
|
120 11 0.12724 |
|
121 12 0.24337 |
|
122 13 0.59304 |
|
123 14 1.53594 |
|
124 15 4.01195 |
|
125 16 10.73582 |
|
126 17 29.51587 |
|
127 #18 73.14163 |
|
128 \end{filecontents} |
|
129 |
|
130 |
34 |
131 \begin{document} |
35 \begin{document} |
132 |
36 |
133 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
37 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
134 \mode<presentation>{ |
38 \mode<presentation>{ |