My grammar is long and thin. I'd like to space it out horizontally, as two columns.
\newenvironment{BNF}
{\captionsetup{type=lstlisting}}
{}
\begin{BNF}
\caption{My Grammar}
\label{grammar:my-grammar}
\begin{grammar}
<f> ::= "p"
\alt "true"
\alt "false"
\alt <f> <binop> <f>
<binop> ::= "U" (strong until)
\alt "&&" (logical and)
\alt $\rightarrow$ (implication)
\alt $\leftrightarrow$ (equivalence)
\end{grammar}
\end{BNF}
I'd like it to be one Listing, with one caption. But I'd like <f>
to be in the first column, and <binop
to be in the second. Is this possible?