Is this a proper LL(1) Grammar? Please take this question with a grain of salt. I'm trying to write a very simple layout engine and wanted to formally create a grammar to parse the input. I stayed up all night researching LL(k) parsers - mostly from papers from different colleges. They tend to use the same examples and I've never been a fan of abstracting through notation, so I'm almost positive I have the syntax incorrect. 

The input is very trivial: 

header&gt;rows&gt;h-row&gt;a|b

main&gt;rows&gt;m-row&gt;qs|d
qs&gt;qs-row&gt;qa|qu

footer&gt;rows&gt;f-row&gt;a|b


And this is the grammar definition:

S -&gt; aBC
B -&gt; op
C -&gt; a


First:

S: [a]
B: [&gt;, |, /]
C: [a]


Follow:

S: $
C: $
B: C | S
It's a perfectly valid grammar, and it's certainly LL(1). But since it only generates three sentences, it's probably not what you are looking for.

The three sentences:

a &lt; a
a | a
a / a


For precision: As written, it's not quite correct. In order to achieve what I imagine you meant by the FIRST sets, you'd actually need to he a bit more precise. Instead of using $op$, you write:

$$\begin{align}B&amp; \to \mathbb{&lt;}\\
B&amp;\to\text{|}\\
B&amp;\to\text{/}
\end{align}$$

Alternatively, you could define $op$ as the three possible operators, as above, and leave $B\to op$.

Also: $FOLLOW$ sets (like $FIRST$ sets) are sets of terminals. So $S$ and $C$ are not going to be found in any $FOLLOW$ set. $FOLLOW(B)$ is $\{a\}$.