Apologies to BUU and others who didn't understand the syntax of my grammar.
It's not actually Prolog, though I did borrow the :- operator; it's roughly based on the module Parse::RecDescent, but I have taken a few liberties - this is pseudocode.
I'll have a go at putting this into into English:
- We are looking for an expr followed by an end of string
- An expr is a list of comby separated by '|'
- A comby is a list of terms separated by '&'
- A term is either a '(' followed by an expr followed by a ')', or it is a word.
Hope this helps | [reply] |