An example of this would be:
Expression = Expression Arithmetic Expression | number
Arithmetic = + | - | * | /
Through just breaking down 1+2*3+4, it was easy to find that the answer was 5 trees.
But doing it in this brute force manner wouldn't work on larger more complex BNFs.
I have tried using CYK to get 5 but haven't figured out how, even through they do seem similar enough. Any advice on using any algorithms or strategies to break down larger BNFs to see how many syntax trees they can make would be much appreciated.