Skip to main content
deleted 7 characters in body
Source Link

Is the following a valid $LL(1)$ grammar:

$ \begin{align} S &\rightarrow L \\\$ \\ L &\rightarrow M L_2 \\ L_2 &\rightarrow \underline{::} L \\ L_2 &\rightarrow \epsilon \\ M &\rightarrow \underline{id} R \\ R &\rightarrow \underline{(} R_2 \\ R_2 &\rightarrow M \underline{)} \\ R_2 &\rightarrow \underline{)} \end{align} $

valid? I am not sure because of $R_2$ since there are two rules I could apply to reach $\\\$$ (bottom of stack) or do I understand something wrong here?

So in the parsing table for $R_2$ under $\\\$$ I have the options $R_2 \rightarrow M \underline{)}$ and $R_2 \rightarrow \underline{)}$

Could somebody clarify?

Is the following a valid $LL(1)$ grammar:

$ \begin{align} S &\rightarrow L \\\$ \\ L &\rightarrow M L_2 \\ L_2 &\rightarrow \underline{::} L \\ L_2 &\rightarrow \epsilon \\ M &\rightarrow \underline{id} R \\ R &\rightarrow \underline{(} R_2 \\ R_2 &\rightarrow M \underline{)} \\ R_2 &\rightarrow \underline{)} \end{align} $

valid? I am not sure because of $R_2$ since there are two rules I could apply to reach $\\\$$ (bottom of stack) or do I understand something wrong here?

So in the parsing table for $R_2$ under $\\\$$ I have the options $R_2 \rightarrow M \underline{)}$ and $R_2 \rightarrow \underline{)}$

Could somebody clarify?

Is the following a valid $LL(1)$ grammar:

$ \begin{align} S &\rightarrow L \\\$ \\ L &\rightarrow M L_2 \\ L_2 &\rightarrow \underline{::} L \\ L_2 &\rightarrow \epsilon \\ M &\rightarrow \underline{id} R \\ R &\rightarrow \underline{(} R_2 \\ R_2 &\rightarrow M \underline{)} \\ R_2 &\rightarrow \underline{)} \end{align} $

I am not sure because of $R_2$ since there are two rules I could apply to reach $\\\$$ (bottom of stack) or do I understand something wrong here?

So in the parsing table for $R_2$ under $\\\$$ I have the options $R_2 \rightarrow M \underline{)}$ and $R_2 \rightarrow \underline{)}$

Could somebody clarify?

Source Link

Is this $LL(1)$ grammar valid?

Is the following a valid $LL(1)$ grammar:

$ \begin{align} S &\rightarrow L \\\$ \\ L &\rightarrow M L_2 \\ L_2 &\rightarrow \underline{::} L \\ L_2 &\rightarrow \epsilon \\ M &\rightarrow \underline{id} R \\ R &\rightarrow \underline{(} R_2 \\ R_2 &\rightarrow M \underline{)} \\ R_2 &\rightarrow \underline{)} \end{align} $

valid? I am not sure because of $R_2$ since there are two rules I could apply to reach $\\\$$ (bottom of stack) or do I understand something wrong here?

So in the parsing table for $R_2$ under $\\\$$ I have the options $R_2 \rightarrow M \underline{)}$ and $R_2 \rightarrow \underline{)}$

Could somebody clarify?