Documenting bison files

Next: Documenting flex files  Prev: Documenting ``C++''

d4c&b can document bison declaration, bison rules and ``C++'' elements in the C section.

Auto comments are in ``C++'' style (`///' and `//').

See src/d4cab/libccp/cpp.y for an example of d4c&b output for a grammar file.

Bison special considerations:

  1. Rule auto comments

    Unlike any other d4c&b auto comment, a rule comment may appear anywhere inside a rule component. For example,

    ///
    type_definition:
        class_definition
        
      | KW_FRIEND class_definition
        /// nested friend class
      ;
    
    Is the same as

    ///
    type_definition:
        class_definition
        
      | /// nested friend class
        KW_FRIEND class_definition
      ;
    
  2. Although bison is able to parse rules without a terminating `;', omitting it will confuse d4c&b.