GNU Info

Info Node: (bison.info)Rpcalc Compile

(bison.info)Rpcalc Compile


Prev: Rpcalc Gen Up: RPN Calc
Enter node , (file) or (file)node

Compiling the Parser File
-------------------------

   Here is how to compile and run the parser file:

     # List files in current directory.
     $ ls
     rpcalc.tab.c  rpcalc.y
     
     # Compile the Bison parser.
     # `-lm' tells compiler to search math library for `pow'.
     $ cc rpcalc.tab.c -lm -o rpcalc
     
     # List files again.
     $ ls
     rpcalc  rpcalc.tab.c  rpcalc.y

   The file `rpcalc' now contains the executable code.  Here is an
example session using `rpcalc'.

     $ rpcalc
     4 9 +
     13
     3 7 + 3 4 5 *+-
     -13
     3 7 + 3 4 5 * + - n              Note the unary minus, `n'
     13
     5 6 / 4 n +
     -3.166666667
     3 4 ^                            Exponentiation
     81
     ^D                               End-of-file indicator
     $


automatically generated by info2www version 1.2.2.9