# Precedence Table Construction Algorithm for CFGs Regardless of Being OPGs
## 5 Examples
### Example 3
#### 5.3.2. Left
\begin{table}
\begin{tabular}{l l l l} \hline \hline Left(C) & & & \\ \hline For \(C\longrightarrow CDc\) & & & \\ \hline \multirow{3}{*}{1. Evaluating the **first** conditional of Algorithm 2.} & \(A=C\) & & \(A=C\) \\  & \(\beta=\varepsilon\) & 2. Evaluating the **first** & \(\beta=C\) \\  & \(B=C\) & conditional of Algorithm 2. & \(B=D\) \\  & \(\gamma=Dc\) & & \(\gamma=c\) \\  & \(\mathcal{L}(C)\supseteq\mathcal{L}(C)\) & & \(\mathcal{L}(C)\supseteq\mathcal{L}(D)\) \\ \hline \multirow{3}{*}{3. Evaluating the **second** conditional of Algorithm 2.} & \(A=C\) & & \\  & \(\beta=CD\) & & \\  & \(a=c\) & & \\  & \(\gamma=\varepsilon\) & & \\  & \(\mathcal{L}(C)\supseteq\mathcal{L}(D)\cup\{c\}\) & & \\ \hline \multicolumn{3}{l}{For \(C\longrightarrow c\)} & & \\ \hline \multirow{3}{*}{4. Evaluating the **second** conditional of Algorithm 2.} & \(A=C\) & & \\  & \(\beta=\varepsilon\) & & \\  & \(a=c\) & & \\  & \(\gamma=\varepsilon\) & & \\  & \(\mathcal{L}(C)=\mathcal{L}(D)\cup\{c\}\) & & \\ \hline \multicolumn{3}{l}{Left(D)} & & \\ \hline \multicolumn{3}{l}{For \(D\longrightarrow d\)} & & \\ \hline \multirow{3}{*}{1. Evaluating the **second** conditional of Algorithm 2.} & \(A=D\) & & \\  & \(\beta=\varepsilon\) & & \\  & \(a=d\) & & \\  & \(\gamma=\varepsilon\) & & \\  & \(\mathcal{L}(D)=\{d\}\) & & \\ \hline \hline \end{tabular} Summary of Left sets of non-terminals:  
\begin{tabular}{l l} \hline \hline Left(S) & \(=\mathcal{L}(A)\cup\mathcal{L}(B)\cup\mathcal{L}(C)\). \\  & \(\mathcal{L}(A)=\{a\}\). \\  & \(\mathcal{L}(B)=\{b\}\). \\  & \(\mathcal{L}(C)=\mathcal{L}(D)\cup\{c\}\). \\  & \(\mathcal{L}(D)=\{d\}\). \\ \hline \end{tabular} Substituting the sets:  
\begin{tabular}{l l} \hline \hline Left(S) & \(=\{a,b,d,c\}\). \\  & \(\mathcal{L}(A)=\{a\}\). \\  & \(\mathcal{L}(B)=\{b\}\). \\  & \(\mathcal{L}(C)=\{d,c\}\). \\  & \(\mathcal{L}(D)=\{d\}\). \\ \hline \end{tabular}
\end{table} 
Table 13: _Cont._ \begin{table}
\begin{tabular}{l l l l} \hline Right(\(S\)) & & & \\ \hline For \(S\longrightarrow ABC\) & & & \\ \hline \multirow{3}{*}{1. Evaluating the **first**} & \(A=S\) & & \\  & \(\gamma=AB\) & & \\  & \(B=C\) & & \\  & \(\beta=\varepsilon\) & & \\  & \(\mathcal{R}(S)=\mathcal{R}(C)\) & & \\ \hline \multicolumn{4}{l}{\(\mathtt{Right}(A)\)} \\ \hline For \(A\longrightarrow aA\) & & & \\ \hline \multirow{3}{*}{1. Evaluating the **first**} & \(A=A\) & & \(A=A\) \\  & \(\gamma=a\) & & \(\gamma=\varepsilon\) \\  & \(B=A\) & & \(a=a\) \\  & \(\beta=\varepsilon\) & & \\  & \(\mathcal{R}(A)\supseteq\mathcal{R}(A)\) & & \(\mathcal{R}(A)\supseteq\{a\}\) \\ \hline \multicolumn{4}{l}{For \(A\longrightarrow a\)} \\ \hline \multirow{3}{*}{3. Evaluating the **second**} & \(A=A\) & & \\  & \(\gamma=\varepsilon\) & & \\  & \(a=a\) & & \\  & \(\beta=\varepsilon\) & & \\  & \(\mathcal{R}(A)=\{a\}\) & & \\ \hline \multicolumn{4}{l}{\(\mathtt{Right}(B)\)} \\ \hline For \(B\longrightarrow bB\) & & & \\ \hline \multirow{3}{*}{1. Evaluating the **first**} & \(A=B\) & & \(A=B\) \\  & \(\gamma=b\) & & \(\gamma=\varepsilon\) \\  & \(B=B\) & & \(a=b\) \\  & \(\beta=\varepsilon\) & & \(\beta=B\) \\  & \(\mathcal{R}(B)\supseteq\mathcal{R}(B)\) & & \(\mathcal{R}(B)\supseteq\{b\}\) \\ \hline \multicolumn{4}{l}{For \(B\longrightarrow b\)} \\ \hline \multicolumn{4}{l}{\(\mathtt{3. Evaluating the **second**}\) conditional of Algorithm 4.} & \(A=B\) & & \\ \cline{1-1}  & \(A=C\) & & \\ \cline{1-1}  & \(\gamma=CD\) & & \(A=C\) \\  & \(\gamma=CD\) & & \(\gamma=\varepsilon\) \\  & \(a=c\) & & \(a=c\) \\  & \(\beta=\varepsilon\) & & \(\beta=\varepsilon\) \\  & \(\mathcal{R}(C)\supseteq\{c\}\) & & \(\mathcal{R}(C)=\{c\}\) \\ \hline \end{tabular}
\end{table} 
Table 14: Right Sets calculation for the CFG in Example 3.