Next: , Previous: , Up: C++ Parsers   [Contents][Index]


10.1.2 C++ Bison Interface

The C++ deterministic parser is selected using the skeleton directive, ‘%skeleton "lalr1.cc"’. See Bison Declaration Summary.

When run, bison will create several entities in the ‘yy’ namespace. Use the ‘%define api.namespace’ directive to change the namespace name, see %define Summary. The various classes are generated in the following files:

file.hh

(Assuming the extension of the grammar file was ‘.yy’.) The declaration of the C++ parser class and auxiliary types. By default, this file is not generated (see Bison Declaration Summary).

file.cc

The implementation of the C++ parser class. The basename and extension of these two files (file.hh and file.cc) follow the same rules as with regular C parsers (see Invoking Bison).

location.hh

Generated when both %header and %locations are enabled, this file contains the definition of the classes position and location, used for location tracking. It is not generated if ‘%define api.location.file none’ is specified, or if user defined locations are used. See C++ Location Values.

position.hh
stack.hh

Useless legacy files. To get rid of then, use ‘%require "3.2"’ or newer.

All these files are documented using Doxygen; run doxygen for a complete and accurate documentation.