Skip to content

Commit 917f1b4

Browse files
committed
New ll-lr diagram
1 parent 8810ae8 commit 917f1b4

File tree

5 files changed

+24
-202
lines changed

5 files changed

+24
-202
lines changed
Binary file not shown.

tex/GLR-based_CFPQ.tex

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -376,9 +376,10 @@ \subsection{Примеры}
376376

377377
\subsection{Сравнение классов LL и LR}
378378

379-
Иерархию языков, распознаваемых различными классами алгоритмов, можно представить следующим образом.
379+
Иерархию языков, распознаваемых различными классами алгоритмов, можно представить следующим образом.
380+
380381
\begin{center}
381-
\includegraphics[width=0.6\textwidth]{pics/LL_LR.pdf}
382+
\input{figures/GLR/LL_LR.tex}
382383
\end{center}
383384

384385
Из диаграммы видно, что класс языков, распознаваемых LL(k) алгоритмом уже, чем класс языков, распознаваемый LR(k) алгоритмом, при любом конечном $k$. Приведём несколько примеров.

tex/figures/GLR/LL_LR.tex

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
\begin{tikzpicture}
2+
\node at (0,0) (ll0) {LL(0)};
3+
\node at (0,3.5) (ll1) {LL(1)};
4+
\node at (0,4.5) (llk) {LL(k)};
5+
\node at (3,0) (lr0) {LR(0)};
6+
\node at (3,1.5) (slr) {SLR(1)};
7+
\node at (3,2.5) (lalr) {LALR(1)};
8+
\node at (3,3.5) (clr) {CLR(1)};
9+
\node at (3,4.5) (lrk) {LR(k)};
10+
11+
\node[r_state,violet,fit=(ll0)] (a) {};
12+
\node[draw=none,fit=(a)] (a1) {};
13+
\node[draw=none,fit=(a1)] (a2) {};
14+
\node[r_state,violet,fit=(ll0) (ll1) (a)] (b) {};
15+
\node[r_state,violet,fit=(ll0) (llk) (b)] (c) {};
16+
\node[r_state,fit=(a2) (lr0)] (d) {};
17+
\node[r_state,fit=(slr) (d)] (e) {};
18+
\node[r_state,fit=(lalr) (e)] (f) {};
19+
\node[r_state,fit=(lalr) (clr) (f) (b)] (g) {};
20+
\node[r_state,fit=(g) (lalr) (lrk) (c)] (h) {};
21+
\end{tikzpicture}

tex/pics/LL_LR.pdf

-5.8 KB
Binary file not shown.

tex/pics/LL_LR.svg

Lines changed: 0 additions & 200 deletions
This file was deleted.

0 commit comments

Comments
 (0)