I ran into this problem too. I ended up writing a quick and dirty vim script to compress my entire grammar into a single production.
The problem with less granular railroad diagrams is that they lose some of the labeling given to them by the more granular ones.
For any regular (IE: sans recursion) subset of the EBNF you can just 'find-and-replace' the left hand side with the right hand side until it is in the desired form. For example I compressed:
Identifier ::= Letter AlphaNum*
Letter ::= [a-zA-Z]|[_]
NonZeroDigit ::= [1-9]
Digit ::= NonZeroDigit | [0]
AlphaNum ::= Letter|Digit
into:
Identifier ::= ([a-zA-Z]|[_]) (([a-zA-Z]|[_])|(([1-9])|[0]))*
which had the desired effect.
Process:
- Find a rule containing only terminals (EG:
Letter ::= [a-zA-Z]|[_]
) EDIT: If you can't find any, just pick any rule, it still works but leads to a slightly messier process - Replace all occurrences of the left hand side with the right hand side surrounded in brackets.
- Repeat until the desired granularity is achieved.
Hope this helps!