Buy the book!
|[ < ]||[ > ]||[ << ]||[ Up ]||[ >> ]||[Top]||[Contents]||[Index]||[ ? ]|
Before running Bison to produce a parser, we need to decide how to
arrange all the source code in one or more source files. For such a
simple example, the easiest thing is to put everything in one file. The
main go at the
end, in the epilogue of the file
(see section The Overall Layout of a Bison Grammar).
For a large project, you would probably have several source files, and use
make to arrange to recompile them.
With all the source in a single file, you use the following command to convert it into a parser file:
In this example the file was called `rpcalc.y' (for "Reverse Polish
CALCulator"). Bison produces a file named `file_name.tab.c',
removing the `.y' from the original file name. The file output by
Bison contains the source code for
yyparse. The additional
functions in the input file (
are copied verbatim to the output.
|webmaster||delorie software privacy|
|Copyright © 2003 by The Free Software Foundation||Updated Jun 2003|