header (-b)header as the pathname of the file to contain the parser's
base class. This class defines, e.g., the parser's symbolic
tokens. Defaults to the name of the parser class plus the suffix
base.h. It is generated, unless otherwise indicated (see
--no-baseclass-header and --dont-rewrite-baseclass-header
below).
header (-H)header as the pathname to the file preincluded in the
parser's base-class header. This option is needed in situations
where the base class header file refers to types which might not
yet be known. E.g., with %polymorphic a std::string value
type might be used. Since the string header file is not by
default included in parserbase.h we need a way to inform the
compiler about this and possibly other headers. The suggested
procedure is to use a pre-include header file declaring the
required types. By default `header' is surrounded by double
quotes: #include "header" is used when the option -H
header is specified. When the argument is surrounded by pointed
brackets #include <header> is included. In the latter case,
quotes might be required to escape interpretation by the shell
(e.g., using -H '<header>').
skeleton (-B)skeleton as the pathname of the file containing the
skeleton of the parser's base class. Its filename defaults to
bisonc++base.h.
header (-c)header as the pathname of the file to contain the parser
class. Defaults to the name of the parser class plus the suffix
.h
className %class-name directory is
specified, then the default class name (Parser) is used.
skeleton (-C)skeleton as the pathname of the file containing the
skeleton of the parser class. Its filename defaults to
bisonc++.h.
--verbose option (i.e.,
<grammar>.output, where <grammar> is the input file read
by bisonc++. This information is primarily useful for developers. It
augments the information written to the verbose grammar output
file, generated by the --verbose option.
parse and its support functions with debugging code,
showing the actual parsing process on the standard output
stream. When included, the debugging output is active by default,
but its activity may be controlled using the setDebug(bool
on-off) member. An #ifdef DEBUG macro is not supported by
bisonc++. Rerun bisonc++ without the --debug option to remove the
debugging code.
filename (-f)
d_scanner.yylex() to obtain the
next lexical token, and calling d_scanner.YYText() for the
matched text, unless overruled by options or directives explicitly
defining these functions. By default, the interface defined by
flexc++(1) is used. This option is only interpreted if the
--scanner option or %scanner directive is also used.
header (-i)header as the pathname of the file to contain the
implementation header. Defaults to the name of the generated
parser class plus the suffix .ih. The implementation header
should contain all directives and declarations only used by
the implementations of the parser's member functions. It is the
only header file that is included by the source file containing
parse's implementation . User defined implementation of
other class members may use the same convention, thus
concentrating all directives and declarations that are required
for the compilation of other source files belonging to the parser
class in one header file.
skeleton (-I)skeleton as the pathname of the file containing the
skeleton of the implementation header. Its filename defaults to
bisonc++.ih.
debug option (or
%debug directive) has also been specified. When
insert-stype has been specified the parsing function's debug
output will also show selected semantic values. It should only be
used if objects or variables of the semantic value type
STYPE__ can be inserted into ostreams.
value
namespace (-n)namespace. By default
no namespace is defined. If this options is used the
implementation header will contain a commented out using
namespace declaration for the requested namespace.
#line preprocessor directives in the file containing
the parser's parse function. By default #line preprocessor
directives are placed in the file containing the parser's
parse function. This option allows the compiler and debuggers
to associate errors with lines in your grammar specification file,
rather than with the source file containing the parse function
itself.
parse member function is
(re)written each time bisonc++ is called. Note that this option
should normally be avoided, as this file contains parsing
tables which are altered whenever the grammar definition is
modified.
--verbose option.
This option does not result in the generated parsing function
displaying returned tokens and matched text. If that is what you
want, use the --print-tokens option.
skeleton (-P)skeleton as the pathname of the file containing the parsing
member function's skeleton. Its filename defaults to
bisonc++.cc.
source (-p)source as the name of the source file to contain the
parser member function parse. Defaults to parse.cc.
skeleton (-M)skeleton as the pathname of the file containing the
skeleton of the polymorphic template classes. Its filename
defaults to bisonc++polymorphic.
skeleton (-m)skeleton as the pathname of the file containing the
skeleton of the inline implementations of the members of the
polymorphic template classes. Its filename defaults to
bisonc++polymorphic.
print__
displaying (on the standard output stream) the tokens returned by
the parser's scanner as well as the corresponding matched
text. This implementation is suppressed when the parsing function
is generated without using this option. The member print__) is
called from Parser::print, which is defined in-line in the the
parser's class header. Calling Parser::print__, therefore, can
also easily be controlled by an option controlled by the program
using the parser generated by bisonc++.
This option does not show the tokens returned and text matched
by bisonc++ itself when reading its input s. If that is what
you want, use the --own-tokens option.
numbernumber
successfully processed tokens before another syntactic error can
be reported. By default number is zero.
header (-s)header as the pathname to the file defining a class
Scanner. When this option is used the parser's member int
lex() is predefined as
int lex()
{
return d_scanner.lex();
}
and an object Scanner d_scanner is composed into the
parser. The example shows the function that's called by
default. By specifying the --flex option (or %flex
directive) the function d_scanner.yylex() is called. Any other
function to call can be specified using the
--scanner-token-function option (or
%scanner-token-function directive).
By default header is surrounded by double quotes (using, e.g.,
#include "header"). When the argument is surrounded by
pointed brackets #include <header> is included.
--own-tokens
option.
function-calld_scanner.matched() call used
by default when the %scanner directive is specified, and it
overrules the d_scanner.YYText() call used when the %flex
directive is provided. Example:
--scanner-matched-text-function "myScanner.matchedText()"
function-calllex function. A complete function
call expression should be provided (including a scanner object, if
used). This option overrules the d_scanner.lex() call used
by default when the %scanner directive is specified, and it
overrules the d_scanner.yylex() call used when the %flex
directive is provided. Example:
--scanner-token-function "myScanner.nextToken()"
directory (-S)-B -C, -H, -I, -M and -m).
directory --target-directory option does not affect files that were
explicitly named (either as option or as directive).
<grammar>.output, where
<grammar> is the grammar specification file passed to bisonc++.
bisonc++ by Frank B. Brokken (f.b.brokken@rug.nl)
LALR(1) Parser Generator V 4.01.00
Copyright (c) GPL 2005-2012. 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).
--force-class-header: overwrite an existing class header file.
--force-implementation-header: overwrite an existing implementation
header file.
--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.
--no-lines: don't put #line directives in generated output.
--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-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-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.