The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

bisonpre - Bison wrapper with pre and post processing

SYNOPSIS

  bisonpre --yacc bison --debug --verbose --defines X.h -k $< -pX -o X.c

DESCRIPTION

Bisonpre is a wrapper for the Bison YACC replacement. Input to Bison is preprocessed with substitution as described below under EXTENSIONS. Output from Bison is checked for additional errors, and corrected to work around various compile warnings.

EXTENSIONS

//BISONPRE_TYPES

This is expanded into %type declarations.

~[a-z]+~

Any text matching ~[a-z]+~ is removed. This allows optional text to be used only when the rule containing the ~~ is used in a BISONPRE_COPY.

rule_label<type>:

This allows the label declaring a rule to also specify the type of the rule. The type will be inserted where /*BISONPRE_TYPES*/ is encountered.

BISONPRE_COPY(rule, {code})

Copy the rules and productions from the specified rule, filter through the Perl code provided in the {} and insert here into the output file.

BISONPRE_NOT(token[, token...])

Create a rule that matches every token except for those specified.

ARGUMENTS

-b file-prefix =item --file-prefix=file-prefix

Passed to bison.

Specify a prefix to use for all bison output file names. The names are chosen as if the input file were named file-prefix.c.

-d

Passed to bison.

Write an extra output file containing macro definitions for the token type names defined in the grammar and the semantic value type YYSTYPE, as well as a few extern variable declarations. If the parser output file is named name.c then this file is named name.h. This output file is essential if you wish to put the definition of yylex in a separate source file, because yylex needs to be able to refer to token type codes and the variable yylval.

--help

Displays this message and program version and exits.

-k =item --token-table

Passed to bison.

This switch causes the name.tab.c output to include a list of token names in order by their token numbers; this is defined in the array yytname. Also generated are #defines for YYNTOKENS, YYNNTS, YYNRULES, and YYNSTATES.

==item -t ==item --debug

Passed to bison.

In the parser file, define the macro YYDEBUG to 1 if it is not already defined, so that the debugging facilities are compiled.

==item -v ==item --verbose

Passed to bison.

Write an extra output file containing verbose descriptions of the parser states and what is done for each type of look-ahead token in that state. This file also describes all the conflicts, both those resolved by operator precedence and the unresolved ones. The file's name is made by removing .tab.c or .c from the parser output file name, and adding .output instead. Therefore, if the input file is foo.y, then the parser file is called foo.tab.c by default. As a consequence, the verbose output file is called foo.output.

--version

Print the version number and exit.

--yacc

Specify the name of the bison executable, defaults to "bison."

DISTRIBUTION

This is part of the http://www.veripool.org/ free Verilog EDA software tool suite. The latest version is available from CPAN and from http://www.veripool.org/.

Copyright 2008-2009 by Wilson Snyder. This package is free software; you can redistribute it and/or modify it under the terms of either the GNU Lesser General Public License Version 3 or the Perl Artistic License Version 2.0.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

AUTHORS

Wilson Snyder <wsnyder@wsnyder.org>

SEE ALSO

bison