This section demonstrates the use of a C++ parser with a simple but complete example. This example should be available on your system, ready to compile, in the directory .../share/doc/bison/examples/calc++. It focuses on the use of Bison, therefore the design of the various C++ classes is very naive: no accessors, no encapsulation of members etc. We will use a Lex scanner, and more precisely, a Flex scanner, to demonstrate the various interactions. A hand-written scanner is actually easier to interface with.
|• Calc++ --- C++ Calculator:||The specifications|
|• Calc++ Parsing Driver:||An active parsing context|
|• Calc++ Parser:||A parser class|
|• Calc++ Scanner:||A pure C++ Flex scanner|
|• Calc++ Top Level:||Conducting the band|