|
| 1 | +\begin{tikzpicture}[> = stealth,node distance=3.25cm, on grid, scale=0.8, every node/.style={scale=0.8}] |
| 2 | + \node[draw=none, fill=none] at (-1.4, 1.2) {0}; |
| 3 | + \node[draw=none, fill=none] at (3.1, 0.55) {3}; |
| 4 | + \node[draw=none, fill=none] at (-1.4, -1.3) {1}; |
| 5 | + \node[draw=none, fill=none] at (-1.4, -3.8) {2}; |
| 6 | + \node[draw=none, fill=none] at (2.9, -1.95) {4}; |
| 7 | + \node[draw=none, fill=none] at (2.9, -4.45) {5}; |
| 8 | + \node[draw=none, fill=none] at (6.7, -1.3) {6}; |
| 9 | + \node[draw=none, fill=none] at (6.7, -3.8) {7}; |
| 10 | + \node[draw=none, fill=none] at (11, -1.95) {8}; |
| 11 | + \node[draw=none, fill=none] at (11, -4.45) {9}; |
| 12 | + \node[r_state] (s_0) |
| 13 | + { |
| 14 | + $ |
| 15 | + \begin{aligned} |
| 16 | + S' &\to \cdot S, \{\$\} \\ |
| 17 | + S &\to \cdot a S b S, \{\$\} \\ |
| 18 | + S &\to \cdot, \{\$\} |
| 19 | + \end{aligned} |
| 20 | + $ |
| 21 | + }; |
| 22 | + \node[r_state] (s_1) [below=2cm of s_0] |
| 23 | + { |
| 24 | + $ |
| 25 | + \begin{aligned} |
| 26 | + S &\to a \cdot S b S, \{\$\} \\ |
| 27 | + S &\to \cdot a S b S, \{b\} \\ |
| 28 | + S &\to \cdot, \{b\} |
| 29 | + \end{aligned} |
| 30 | + $ |
| 31 | + }; |
| 32 | + \node[r_state] (s_2) [below=2cm of s_1] |
| 33 | + { |
| 34 | + $ |
| 35 | + \begin{aligned} |
| 36 | + S &\to a \cdot S b S, \{b\} \\ |
| 37 | + S &\to \cdot a S b S, \{b\} \\ |
| 38 | + S &\to \cdot, \{b\} |
| 39 | + \end{aligned} |
| 40 | + $ |
| 41 | + }; |
| 42 | + \node[r_state] (s_3) [right=of s_0] |
| 43 | + { |
| 44 | + $ S' \to S \cdot, \{\$\} $ |
| 45 | + }; |
| 46 | + \node[r_state] (s_4) [right=of s_1] |
| 47 | + { |
| 48 | + $ S \to a S \cdot b S, \{\$\} $ |
| 49 | + }; |
| 50 | + \node[r_state] (s_5) [right=of s_2] |
| 51 | + { |
| 52 | + $ S \to a S \cdot b S, \{b\} $ |
| 53 | + }; |
| 54 | + \node[r_state] (s_6) [right=of s_4] |
| 55 | + { |
| 56 | + $ |
| 57 | + \begin{aligned} |
| 58 | + S &\to a S b \cdot S, \{\$\} \\ |
| 59 | + S &\to \cdot a S b S, \{\$\} \\ |
| 60 | + S &\to \cdot, \{\$\} |
| 61 | + \end{aligned} |
| 62 | + $ |
| 63 | + }; |
| 64 | + \node[r_state] (s_7) [right=of s_5] |
| 65 | + { |
| 66 | + $ |
| 67 | + \begin{aligned} |
| 68 | + S &\to a S b \cdot S, \{b\} \\ |
| 69 | + S &\to \cdot a S b S, \{b\} \\ |
| 70 | + S &\to \cdot , \{b\} |
| 71 | + \end{aligned} |
| 72 | + $ |
| 73 | + }; |
| 74 | + \node[r_state] (s_8) [right=of s_6] |
| 75 | + { |
| 76 | + $ S \to a S b S \cdot, \{\$\} $ |
| 77 | + }; |
| 78 | + \node[r_state] (s_9) [right=of s_7] |
| 79 | + { |
| 80 | + $ S \to a S b S \cdot, \{b\} $ |
| 81 | + }; |
| 82 | + |
| 83 | + \path[->] |
| 84 | + (s_0) edge [left] node {$a$} (s_1) |
| 85 | + edge [above] node {$S$} (s_3) |
| 86 | + (s_1) edge [left] node {$a$} (s_2) |
| 87 | + edge [above] node {$S$} (s_4) |
| 88 | + (s_2) edge [loop below] node {$a$} () |
| 89 | + edge [above] node {$S$} (s_5) |
| 90 | + (s_4) edge [above] node {$b$} (s_6) |
| 91 | + (s_5) edge [above] node {$b$} (s_7) |
| 92 | + (s_6) edge [above] node {$S$} (s_8) |
| 93 | + edge [above, bend right=20] node {$a$} (s_1) |
| 94 | + (s_7) edge [above] node {$S$} (s_9) |
| 95 | + edge [below, bend left=20] node {$a$} (s_2) |
| 96 | + ; |
| 97 | +\end{tikzpicture} |
0 commit comments