hws/hw07.tex
changeset 681 7b7736bea3ca
parent 393 494b44b439bf
child 897 904de68a27a4
--- a/hws/hw07.tex	Wed Nov 06 15:04:40 2019 +0000
+++ b/hws/hw07.tex	Wed Nov 06 17:09:58 2019 +0000
@@ -1,5 +1,6 @@
 \documentclass{article}
 \usepackage{../style}
+\usepackage{../grammar}
 
 \begin{document}
 
@@ -26,17 +27,16 @@
 
 \item Consider the following grammar 
 
-\begin{center}
-\begin{tabular}{l}
-$S \rightarrow N\cdot P$\\
-$P \rightarrow V\cdot N$\\
-$N \rightarrow N\cdot N$\\
-$N \rightarrow A \cdot N$\\
-$N \rightarrow \texttt{student} \;|\; \texttt{trainer} \;|\; \texttt{team} \;|\; \texttt{trains}$\\
-$V \rightarrow \texttt{trains} \;|\; \texttt{team}$\\
-$A \rightarrow \texttt{The} \;|\; \texttt{the}$\\
-\end{tabular}
-\end{center}
+\begin{plstx}[margin=1cm]
+  : \meta{S\/} ::= \meta{N\/}\cdot \meta{P\/}\\
+  : \meta{P\/} ::= \meta{V\/}\cdot \meta{N\/}\\
+  : \meta{N\/} ::= \meta{N\/}\cdot \meta{N\/}\\
+  : \meta{N\/} ::= \meta{A\/}\cdot \meta{N\/}\\
+  : \meta{N\/} ::= \texttt{student} \mid \texttt{trainer} \mid \texttt{team} \mid \texttt{trains}\\
+  : \meta{V\/} ::= \texttt{trains} \mid \texttt{team}\\
+  : \meta{A\/} ::= \texttt{The} \mid \texttt{the}\\
+\end{plstx}
+
 
 where $S$ is the start symbol and $S$, $P$, $N$, $V$ and $A$ are non-terminals.
 Using the CYK-algorithm, check whether or not the following string can be parsed