# Precedence Table Construction Algorithm for CFGs Regardless of Being OPGs
## 5 Examples
### Example 1
#### 5.1.2 Left  
The Left sets are calculated as detailed in Table 3. \begin{table}
\begin{tabular}{l l l l} \hline \hline Left(E) & & & & \\ \hline \multicolumn{4}{l}{For \(E\longrightarrow E+T\)} \\ \hline \multirow{4}{*}{1. Evaluating the **first**} & \(A=E\) & & & \(A=E\) \\  & \(\beta=e\) & & & \(\beta=E\) \\  & \(B=E\) & 2. Evaluating the **second** & & \(a=+\) \\  & \(\gamma=+T\) & conditional of Algorithm 2. & & \(\gamma=T\) \\  & \(\mathcal{L}(E)\supseteq\mathcal{L}(E)\) & & & \(\mathcal{L}(E)\supseteq\{+\}\) \\ \hline \multicolumn{4}{l}{For \(E\longrightarrow T\)} \\ \hline \multirow{4}{*}{3. Evaluating the **first**} & \(A=E\) & & & \\  & \(\beta=e\) & & & \\  & \(B=T\) & & & \\  & \(\gamma=e\) & & & \\  & \(\mathcal{L}(E)=\{+\}\cup\mathcal{L}(T)\) & & & \\ \hline \hline \multicolumn{4}{l}{Left(T)} \\ \hline \multicolumn{4}{l}{For \(T\longrightarrow T*F\)} \\ \hline \multirow{4}{*}{1. Evaluating the **first**} & \(A=T\) & & & \(A=T\) \\  & \(\beta=e\) & & & \(\beta=T\) \\  & \(B=T\) & & & \(a=*\) \\  & \(\gamma=*F\) & conditional of Algorithm 2. & & \(\gamma=F\) \\  & \(\mathcal{L}(T)\supseteq\mathcal{L}(T)\) & & & \(\mathcal{L}(T)\supseteq\{*\}\) \\ \hline \multicolumn{4}{l}{For \(T\longrightarrow F\)} \\ \hline \multirow{4}{*}{3. Evaluating the **first**} & \(A=T\) & & & \\  & \(\beta=e\) & & & \\  & \(B=F\) & & & \\  & \(\gamma=e\) & & & \\  & \(\mathcal{L}(T)=\{*\}\cup\mathcal{L}(F)\) & & & \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Left Sets calculation for the CFG in Example 1. \begin{table}
\begin{tabular}{l l l l} \hline \hline Right(\(E\)) & & & \\ \hline For \(E\longrightarrow E+T\) & & & \\ \hline \multirow{4}{*}{1. Evaluating the **first**} & \(A=E\) & & \(A=E\) \\  & \(\gamma=E+\) & & \(\gamma=E\) \\  & \(B=T\) & 2. Evaluating the **second** & \(\gamma=E\) \\  & conditional of Algorithm 4. & \(a=+\) \\  & \(\beta=\varepsilon\) & conditional of Algorithm 4. & \(\beta=T\) \\  & \(\mathcal{R}(E)\supseteq\mathcal{R}(T)\) & & \(\mathcal{R}(E)\supseteq\mathcal{R}(T)\cup\{+\}\) \\ \hline \multirow{4}{*}{3. Evaluating the **first**} & \(A=E\) & & \\  & \(\gamma=\varepsilon\) & & \\  & \(B=T\) & & \\  & \(\beta=\varepsilon\) & & \\  & \(\mathcal{R}(E)=\mathcal{R}(T)\cup\{+\}\) & & \\ \hline \hline Right(\(T\)) & & & \\ \hline For \(T\longrightarrow T*F\) & & & \\ \hline \multirow{4}{*}{1. Evaluating the **first**} & \(A=T\) & & \(A=T\) \\  & \(\gamma=T*\) & & \(\gamma=T\) \\  & \(\mathcal{B}=F\) & & \(a=*\) \\  & \(\beta=\varepsilon\) & & \(\beta=F\) \\  & \(\mathcal{R}(T)\supseteq\mathcal{R}(F)\) & & \(\mathcal{R}(T)\supseteq\mathcal{R}(F)\cup\{*\}\) \\ \hline For \(T\longrightarrow F\) & & & \\ \hline \multirow{4}{*}{3. Evaluating the **first**} & \(A=T\) & & \\  & \(\gamma=\varepsilon\) & & \\  & \(B=F\) & & \\ \cline{1-1}  & \(\beta=\varepsilon\) & & \\ \cline{1-1}  & \(\mathcal{R}(E)=\mathcal{R}(T)\cup\{+\}\) & & \\ \hline Right(\(T\)) & & & \\ \hline For \(T\longrightarrow T*F\) & & & \\ \hline \multirow{4}{*}{1. Evaluating the **first**} & \(A=T\) & & \(A=T\) \\  & \(\gamma=T*\) & & \(\gamma=T\) \\  & \(\mathcal{B}=F\) & & \(a=*\) \\ \cline{1-1}  & \(\beta=\varepsilon\) & & \(\beta=F\) \\ \cline{1-1}  & \(\mathcal{R}(T)\supseteq\mathcal{R}(F)\) & & \(\mathcal{R}(T)\supseteq\mathcal{R}(F)\cup\{*\}\) \\ \hline For \(T\longrightarrow F\) & & & \\ \hline \multirow{4}{*}{3. Evaluating the **first**} & \(A=T\) & & \\  & \(\gamma=\varepsilon\) & & \\ \cline{1-1}  & \(B=F\) & & \\ \cline{1-1}  & \(\beta=\varepsilon\) & & \\ \cline{1-1}  & \(\mathcal{R}(T)=\mathcal{R}(F)\cup\{*\}\) & & \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Right Sets calculation for the CFG in Example 1.