|
202 | 202 | \newcommand{\CodeStyle}{\ttfamily}
|
203 | 203 | \newcommand{\CodeStylex}[1]{\texttt{#1}}
|
204 | 204 |
|
| 205 | +\definecolor{grammar-gray}{gray}{0.2} |
| 206 | + |
205 | 207 | % General grammar style
|
206 |
| -\newcommand{\GrammarStyle}{\itfamily} |
207 |
| -\newcommand{\GrammarStylex}[1]{\textit{#1}} |
| 208 | +\newcommand{\GrammarStylex}[1]{\textcolor{grammar-gray}{\textsf{\textit{#1}}}} |
208 | 209 |
|
209 | 210 | % Code and definitions embedded in text.
|
210 | 211 | \newcommand{\tcode}[1]{\CodeStylex{#1}}
|
|
214 | 215 | \newcommand{\keyword}[1]{\tcode{#1}\indextext{\idxcode{#1}}}
|
215 | 216 | \newcommand{\grammarterm}[1]{\indexgram{\idxgram{#1}}\gterm{#1}}
|
216 | 217 | \newcommand{\grammartermnc}[1]{\indexgram{\idxgram{#1}}\gterm{#1\nocorr}}
|
217 |
| -\newcommand{\regrammarterm}[1]{\gterm{#1}} |
| 218 | +\newcommand{\regrammarterm}[1]{\textit{#1}} |
218 | 219 | \newcommand{\placeholder}[1]{\textit{#1}}
|
219 | 220 | \newcommand{\placeholdernc}[1]{\textit{#1\nocorr}}
|
220 | 221 | \newcommand{\exposid}[1]{\tcode{\placeholder{#1}}}
|
|
240 | 241 | \newcommand{\CppXI}{\Cpp{} 2011}
|
241 | 242 | \newcommand{\CppXIV}{\Cpp{} 2014}
|
242 | 243 | \newcommand{\CppXVII}{\Cpp{} 2017}
|
243 |
| -\newcommand{\opt}[1]{#1\ensuremath{_\mathit{opt}}} |
| 244 | +\newcommand{\opt}[1]{#1\ensuremath{_\mathit{\color{black}opt}}} |
244 | 245 | \newcommand{\dcr}{-{-}}
|
245 | 246 | \newcommand{\bigoh}[1]{\ensuremath{\mathscr{O}(#1)}}
|
246 | 247 |
|
|
524 | 525 | \setlength{\BnfInc}{\BnfIndent}
|
525 | 526 | \newlength{\BnfRest}
|
526 | 527 | \setlength{\BnfRest}{2\BnfIndent}
|
527 |
| -\newcommand{\BnfNontermshape}{\small\rmfamily\itshape} |
| 528 | +\newcommand{\BnfNontermshape}{\small\color{grammar-gray}\sffamily\itshape} |
| 529 | +\newcommand{\BnfReNontermshape}{\small\rmfamily\itshape} |
528 | 530 | \newcommand{\BnfTermshape}{\small\ttfamily\upshape}
|
529 | 531 |
|
530 | 532 | \newenvironment{bnfbase}
|
531 | 533 | {
|
532 | 534 | \newcommand{\nontermdef}[1]{{\BnfNontermshape##1\itcorr}\indexgrammar{\idxgram{##1}}\textnormal{:}}
|
533 |
| - \newcommand{\renontermdef}[1]{{\BnfNontermshape##1\itcorr}\,\textnormal{::}} |
534 | 535 | \newcommand{\terminal}[1]{{\BnfTermshape ##1}}
|
535 | 536 | \renewcommand{\keyword}[1]{\terminal{##1}\indextext{\idxcode{##1}}}
|
536 |
| - \renewcommand{\exposid}[1]{\terminal{\placeholder{##1}}} |
| 537 | + \renewcommand{\exposid}[1]{\terminal{\textit{##1}}} |
| 538 | + \renewcommand{\placeholder}[1]{\textrm{\textit{##1}}} |
537 | 539 | \newcommand{\descr}[1]{\textnormal{##1}}
|
538 | 540 | \newcommand{\bnfindent}{\hspace*{\bnfindentfirst}}
|
539 | 541 | \newcommand{\bnfindentfirst}{\BnfIndent}
|
|
570 | 572 | \end{bnfbase}
|
571 | 573 | }
|
572 | 574 |
|
| 575 | +\newenvironment{ncrebnf} |
| 576 | +{ |
| 577 | + \begin{bnfbase} |
| 578 | + \newcommand{\renontermdef}[1]{{\BnfReNontermshape##1\itcorr}\,\textnormal{::}} |
| 579 | + \begin{bnflist} |
| 580 | + \BnfReNontermshape |
| 581 | + \item\relax |
| 582 | +} |
| 583 | +{ |
| 584 | + \end{bnflist} |
| 585 | + \end{bnfbase} |
| 586 | +} |
| 587 | + |
573 | 588 | % non-copied versions of bnf environments
|
574 | 589 | \let\ncsimplebnf\simplebnf
|
575 | 590 | \let\endncsimplebnf\endsimplebnf
|
|
0 commit comments