Please take this question with a grain of salt. I was trying to write a very simple layout engine and I wanted to formally create a grammar to parse the entries. I stayed awake all night looking for LL (k) parsers, mostly articles from different colleges. They tend to use the same examples and I have never been a supporter of abstraction by scoring. I am almost certain that the syntax is incorrect.
The entry is very trivial:
header> lines> h-line> a | b main> rows> m-row> qs | d qs> qs-row> qa | that footer> rows> row-f> a | b
And here is the definition of grammar:
S -> aBC B -> op C -> a
S: [a] B: [>, |, /] C: [a]
S: $ C: $ B: C | S