(bison.info)Ltcalc Decls


Next: Ltcalc Rules Up: Location Tracking Calc

Declarations for `ltcalc'
-------------------------

   The C and Bison declarations for the location tracking calculator are
the same as the declarations for the infix notation calculator.

     /* Location tracking calculator.  */
     
     %{
     #define YYSTYPE int
     #include <math.h>
     %}
     
     /* Bison declarations.  */
     %token NUM
     
     %left '-' '+'
     %left '*' '/'
     %left NEG
     %right '^'
     
     %% /* Grammar follows */

Note there are no declarations specific to locations.  Defining a data
type for storing locations is not needed: we will use the type provided
by default (Note: Data Types of Locations.), which is a
four member structure with the following integer fields: `first_line',
`first_column', `last_line' and `last_column'.


automatically generated by info version 1.5

Dirfile and infopages generated Sat Dec 3 02:07:54 2005