]> git.draconx.ca Git - cdecl99.git/commitdiff
Identify nonterminals in the manual's grammar in an alternate way.
authorNick Bowler <nbowler@draconx.ca>
Tue, 4 Oct 2011 02:02:28 +0000 (22:02 -0400)
committerNick Bowler <nbowler@draconx.ca>
Sun, 23 Oct 2011 00:20:58 +0000 (20:20 -0400)
Some output devices won't render .Va text differently from .Li text when
displaying the man page.  This unfortunately means that nonterminals
look exactly the same as terminals in the grammar.  Add brackets
around nonterminals (which are otherwise unused in the grammar) so
that it is readable on these devices, too.

doc/man/cdecl99.1

index e217c26d730591c8ae10aab3088ceb995e714b84..662858b7a7f8f37bf601619873921ffa7695b256 100644 (file)
@@ -100,37 +100,38 @@ format is based on the one used in
 and is described by the following context-free grammar.  This grammar is for
 illustrative purposes only: it is ambiguous and doesn't capture all the nuances
 of the C language.  In this grammar, nonterminals are represented
-.Va thusly ,
+.Va [ thusly ] ,
 \[*e] represents the empty string, and both
 .Li |
 and successive \[->] under the same nonterminal indicate alternation.  All
 other symbols are terminals.  The nonterminals
-.Va identifier , type-specifier , type-qualifier , storage-class-specifier
+.Va [ identifier ] , [ type-specifier ] ,
+.Va [ type-qualifier ] , [ storage-class-specifier ]
 and
-.Va function-specifier
+.Va [ function-specifier ]
 are defined as in C.
 .Bl -column -offset indent ".Va english-decl" ""
-.It Va english      Ta \[->] Ta Li declare Va identifier Li as Va english-decl
-.It                 Ta \[->] Ta Li type Va english-decl
-.It Va english-decl Ta \[->] Ta Va sf-specs declarator
-.It Va declarator   Ta \[->] Ta Va qualifiers Li pointer to Va declarator
-.It                 Ta \[->] Ta Li array Va size Li of Va declarator
-.It                 Ta \[->] Ta Li function Va parameters Li returning Va declarator
-.It                 Ta \[->] Ta Va tq-specs
-.It Va qualifiers   Ta \[->] Ta Va type-qualifier qualifiers | No \[*e]
-.It Va tq-specs     Ta \[->] Ta Va type-qualifier tq-specs
-.It                 Ta \[->] Ta Va type-specifier tq-specs
+.It Va english      Ta \[->] Ta Li declare Va [ identifier ] Li as Va [ english-decl ]
+.It                 Ta \[->] Ta Li type Va [ english-decl ]
+.It Va english-decl Ta \[->] Ta Va [ sf-specs ] [ declarator ]
+.It Va declarator   Ta \[->] Ta Va [ qualifiers ] Li pointer to Va [ declarator ]
+.It                 Ta \[->] Ta Li array Va [ size ] Li of Va [ declarator ]
+.It                 Ta \[->] Ta Li function Va [ parameters ] Li returning Va [ declarator ]
+.It                 Ta \[->] Ta Va [ tq-specs ]
+.It Va qualifiers   Ta \[->] Ta Va [ type-qualifier ] [ qualifiers ] | No \[*e]
+.It Va tq-specs     Ta \[->] Ta Va [ type-qualifier ] [ tq-specs ]
+.It                 Ta \[->] Ta Va [ type-specifier ] [ tq-specs ]
 .It                 Ta \[->] Ta \[*e]
-.It Va sf-specs     Ta \[->] Ta Va storage-class-specifier sf-specs
-.It                 Ta \[->] Ta Va function-specifier sf-specs
+.It Va sf-specs     Ta \[->] Ta Va [ storage-class-specifier ] [ sf-specs ]
+.It                 Ta \[->] Ta Va [ function-specifier ] [ sf-specs ]
 .It                 Ta \[->] Ta \[*e]
-.It Va size         Ta \[->] Ta Va integer | Va identifier | Li * | No \[*e]
-.It Va parameters   Ta \[->] Ta Po Va param-list Pc
-.It                 Ta \[->] Ta Po Va param-list Li , ... Pc
+.It Va size         Ta \[->] Ta Va [ integer ] | Va [ identifier ] | Li * | No \[*e]
+.It Va parameters   Ta \[->] Ta Po Va [ param-list ] Pc
+.It                 Ta \[->] Ta Po Va [ param-list ] Li , ... Pc
 .It                 Ta \[->] Ta \[*e]
-.It Va param-list   Ta \[->] Ta Va parameter | Va parameter Li , Va param-list
-.It Va parameter    Ta \[->] Ta Va identifier Li as Va english-decl
-.It                 Ta \[->] Ta Va english-decl
+.It Va param-list   Ta \[->] Ta Va [ parameter ] | Va [ parameter ] Li , Va [ param-list ]
+.It Va parameter    Ta \[->] Ta Va [ identifier ] Li as Va [ english-decl ]
+.It                 Ta \[->] Ta Va [ english-decl ]
 .El
 .Sh RESOLVING AMBIGUITIES
 The C context-free grammar has many ambiguities regarding declarations.