equal
deleted
inserted
replaced
77 |
77 |
78 \end{frame} |
78 \end{frame} |
79 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
79 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
80 |
80 |
81 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
81 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
82 \begin{frame}[t] |
|
83 \frametitle{Palindromes} |
|
84 |
|
85 A grammar for palindromes over the alphabet~\bl{$\{a,b\}$}: |
|
86 |
|
87 \only<1>{% |
|
88 \bl{\begin{plstx}[margin=1cm] |
|
89 : \meta{S} ::= a\cdot \meta{S}\cdot a | b\cdot \meta{S}\cdot b | a | b | \epsilon\\ |
|
90 \end{plstx}}} |
|
91 |
|
92 %\small |
|
93 %Can you find the grammar rules for matched parentheses? |
|
94 |
|
95 \end{frame} |
|
96 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
97 |
|
98 |
|
99 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
82 \begin{frame}[c] |
100 \begin{frame}[c] |
83 \frametitle{Parser Combinators} |
101 \frametitle{Parser Combinators} |
84 |
102 |
85 Parser combinators: \bigskip |
103 Parser combinators: \bigskip |
86 |
104 |
98 \item semantic action (map-parser) |
116 \item semantic action (map-parser) |
99 \end{itemize} |
117 \end{itemize} |
100 |
118 |
101 \end{frame} |
119 \end{frame} |
102 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
120 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
121 |
|
122 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
123 \begin{frame}[c] |
|
124 \frametitle{Abstract Parser Class} |
|
125 |
|
126 \small |
|
127 \lstinputlisting[language=Scala,xleftmargin=1mm] |
|
128 {../progs/app7.scala} |
|
129 \end{frame} |
|
130 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
131 |
103 |
132 |
104 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
133 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
105 \begin{frame}[c] |
134 \begin{frame}[c] |
106 |
135 |
107 Atomic parsers, for example, number tokens |
136 Atomic parsers, for example, number tokens |