Chapter 9: Invoking Bisonc++

9.1: Bisonc++ options

Where available, single letter options are listed between parentheses beyond their associated long-option variants. Single letter options require arguments if their associated long options require arguments. Options affecting the class header or implementation header file are ignored if these files already exist. Options accepting a `filename' do not accept path names, i.e., they cannot contain directory separators (/); options accepting a 'pathname' may contain directory separators.

Some options may generate errors. This happens when an option conflicts with the contents of a file which bisonc++ cannot modify (e.g., a parser class header file exists, but doesn't define a name space, but a --namespace option was provided).

To solve the error the offending option could be omitted, the existing file could be removed, or the existing file could be hand-edited according to the option's specification. Note that bisonc++ currently does not handle the opposite error condition: if a previously used option is omitted, then bisonc++ does not detect the inconsistency. In those cases compilation errors may be generated.

9.2: Bisonc++ usage

When bisonc++ is called without any arguments it generates the following usage information:

bisonc++ by Frank B. Brokken (f.b.brokken@rug.nl)

LALR(1) Parser Generator V 4.10.01
Copyright (c) GPL 2005-2015. NO WARRANTY.
Designed after `bison++' (1.21.9-1) by Alain Coetmeur <coetmeur@icdc.fr>

Usage: bisonc++ [OPTIONS] file
Where:
  [OPTIONS] - zero or more optional arguments (int options between
              parentheses. Short options require arguments if their
              long option variants do too):
   --analyze-only (-A): only analyze the grammar; except for possibly
           the verbose grammar description file no files are written.
   --baseclass-preinclude=<header> (-H):
           preinclude header in the base-class header file.
           Use [header] to include <header>, otherwise "header"
           will be included.
   --baseclass-header=<header> (-b):
           filename holding the base class definition.
   --baseclass-skeleton=<skeleton> (-B):
           location of the baseclass header skeleton.
   --class-header=<header> (-c):
           filename holding the parser class definition.
   --class-skeleton=<skeleton> (-C):
           location of the class header skeleton.
   --construction: write details about the grammar analysis to stdout.
   --debug: generates debug output statements in the generated parse
           function's source.
   --error-verbose: the parse function will dump the parser's state
           stack to stdout when a syntactic error is reported
   --filenames=<filename> (-f):
           filename of output files (overruling the default filename).
   --help (-h): produce this information (and terminate).
   --implementation-header=<header> (-i):
           filename holding the implementation header.
   --implementation-skeleton=<skeleton> (-I):
           location of the implementation header skeleton.
   --include-only: catenate all grammar files in their order of
           processing to the standard output stream and terminate.
   --insert-stype: show selected semantic values in the output generated
           by --debug. Ignored unless --debug was specified.
   --max-inclusion-depth=<value>:
           sets the maximum number of nested grammar files (default: 10).
   --namespace=<namespace> (-n):
           define the parser in the mentioned namespace.
   --no-baseclass-header: don't create the parser's base class header.
   --no-decoration (-D): do not include the user-defined actions when
           generating the parser's tt(parse) member.
   --no-lines: don't put #line directives in generated output,
           overruling the %lines directive.
   --no-parse-member: don't create the member parse().
   --own-debug:
           bisonc++ displays the actions of its parser while processing
           its input file(s) (implies --verbose).
   --own-tokens (-t):
           bisonc++ displays the tokens and their corresponding
           matched text it received from its lexcial scanner.
   --parser-skeleton=<parserskel> (-P):
           location of the parse function's skeleton.
   --parsefun-source=<source> (-p):
           filename holding the parse function's source.
   --polymorphic-inline-skeleton=<skeleton> (-m):
           location of the polymorphic inline functions skeleton.
   --polymorphic-skeleton=<skeleton> (-M):
           location of the polymorphic semantic values skeleton.
   --print-tokens (-t):
           the print() member of the generated parser class displays
           the tokens and their corresponding matched text.
   --required-tokens=<value>:
           minimum number of successfully processed tokens between
           errors (default: 0).
   --scanner=<header-file> (-s):
           include `header-file' declaring the class Scanner, and call
           d_scanner.yylex() from Parser::lex().
   --scanner-class-name=<scanner class name>:
           specifies the name of the scanner class: this option is
           only interpreted if --scanner (or %scanner) is also used.
   --scanner-debug: extensive display of the actions of bisonc++'s scanner
   --scanner-token-function=<scanner token function>:
           define the function called from lex() returning the next
           token returned (by default d_scanner.yylex() when --scanner
           is used)
   --show-filenames: show the names of the used/generated files on
           the standard error stream.
   --skeleton-directory=<skeleton-directory> (-S):
           location of the skeleton directory.
   --thread-safe: no static data are modified, making bisonc++'s
           generated code thread-safe.
   --usage: produce this information (and terminate).
   --verbose (-V):
           generate verbose description of the analyzed grammar.
   --version (-v):
           display bisonc++'s version and terminate.