Yes, you can identify a LL(0) grammar by looking at the parse table, as follows:
- Every non-terminal is associated with only one right-hand side.
- There is no use of the EBNF operators
?
,*
, or+
.
Many would state an additional rule that recursion is not allowed. However, this is trivially implied by the previous rules due to the fact that any recursion would result in an infinite loop.
Your example grammar is not LL(0) because there are 2 productions defined for the non-terminal s
.