(bison.info)RPN Calc


Next: Infix Calc Up: Examples

Reverse Polish Notation Calculator
==================================

   The first example is that of a simple double-precision "reverse
polish notation" calculator (a calculator using postfix operators).
This example provides a good starting point, since operator precedence
is not an issue.  The second example will illustrate how operator
precedence is handled.

   The source code for this calculator is named `rpcalc.y'.  The `.y'
extension is a convention used for Bison input files.

* Decls
Rpcalc DeclsBison and C declarations for rpcalc.
* Rules
Rpcalc RulesGrammar Rules for rpcalc, with explanation.
* Lexer
Rpcalc LexerThe lexical analyzer.
* Main
Rpcalc MainThe controlling function.
* Error
Rpcalc ErrorThe error reporting function.
* Gen
Rpcalc GenRunning Bison on the grammar file.
* Comp
Rpcalc CompileRun the C compiler on the output code.

automatically generated by info2www