590 |
590 |
591 \end{frame}} |
591 \end{frame}} |
592 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
592 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
593 |
593 |
594 |
594 |
595 \newcommand{\qq}{\mbox{\texttt{"}}} |
|
596 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
597 \mode<presentation>{ |
|
598 \begin{frame}[c] |
|
599 \frametitle{\begin{tabular}{c}Grammars\end{tabular}} |
|
600 |
|
601 \begin{center} |
|
602 \bl{\begin{tabular}{lcl} |
|
603 $E$ & $\rightarrow$ & $F + (F \cdot \qq*\qq \cdot F) + (F \cdot \qq\backslash\qq \cdot F)$\\ |
|
604 $F$ & $\rightarrow$ & $T + (T \cdot \qq\texttt{+}\qq \cdot T) + (T \cdot \qq\texttt{-}\qq \cdot T)$\\ |
|
605 $T$ & $\rightarrow$ & $num + (\qq\texttt{(}\qq \cdot E \cdot \qq\texttt{)}\qq)$\\ |
|
606 \end{tabular}} |
|
607 \end{center} |
|
608 |
|
609 \bl{$E$}, \bl{$F$} and \bl{$T$} are non-terminals\\ |
|
610 \bl{$E$} is start symbol\\ |
|
611 \bl{$num$}, \bl{(}, \bl{)}, \bl{+} \ldots are terminals\bigskip\\ |
|
612 |
|
613 |
|
614 \bl{\texttt{(2*3)+(3+4)}} |
|
615 |
|
616 \end{frame}} |
|
617 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
618 |
|
619 |
|
620 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
621 \mode<presentation>{ |
|
622 \begin{frame}[c] |
|
623 |
|
624 \begin{center} |
|
625 \bl{\begin{tabular}{lcl} |
|
626 $E$ & $\rightarrow$ & $F + (F \cdot \qq*\qq \cdot F) + (F \cdot \qq\backslash\qq \cdot F)$\\ |
|
627 $F$ & $\rightarrow$ & $T + (T \cdot \qq\texttt{+}\qq \cdot T) + (T \cdot \qq\texttt{-}\qq \cdot T)$\\ |
|
628 $T$ & $\rightarrow$ & $num + (\qq\texttt{(}\qq \cdot E \cdot \qq\texttt{)}\qq)$\\ |
|
629 \end{tabular}} |
|
630 \end{center} |
|
631 |
|
632 \begin{center} |
|
633 \begin{tikzpicture}[level distance=8mm, blue] |
|
634 \node {E} |
|
635 child {node {F} |
|
636 child {node {T} |
|
637 child {node {\qq(\qq\,E\,\qq)\qq} |
|
638 child {node{F \qq*\qq{} F} |
|
639 child {node {T} child {node {2}}} |
|
640 child {node {T} child {node {3}}} |
|
641 } |
|
642 } |
|
643 } |
|
644 child {node {\qq+\qq}} |
|
645 child {node {T} |
|
646 child {node {\qq(\qq\,E\,\qq)\qq} |
|
647 child {node {F} |
|
648 child {node {T \qq+\qq{} T} |
|
649 child {node {3}} |
|
650 child {node {4}} |
|
651 } |
|
652 }} |
|
653 }}; |
|
654 \end{tikzpicture} |
|
655 \end{center} |
|
656 |
|
657 \begin{textblock}{5}(1, 5) |
|
658 \bl{\texttt{(2*3)+(3+4)}} |
|
659 \end{textblock} |
|
660 |
|
661 \end{frame}} |
|
662 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
663 |
|
664 \end{document} |
595 \end{document} |
665 |
596 |
666 %%% Local Variables: |
597 %%% Local Variables: |
667 %%% mode: latex |
598 %%% mode: latex |
668 %%% TeX-master: t |
599 %%% TeX-master: t |