www.delorie.com/gnu/docs/bison/bison_49.html   search  
Buy the book!

Bison 1.875

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.5.1 Data Types of Semantic Values

In a simple program it may be sufficient to use the same data type for the semantic values of all language constructs. This was true in the RPN and infix calculator examples (see section Reverse Polish Notation Calculator).

Bison's default is to use type int for all semantic values. To specify some other type, define YYSTYPE as a macro, like this:

#define YYSTYPE double

This macro definition must go in the prologue of the grammar file (see section Outline of a Bison Grammar).

  webmaster   donations   bookstore     delorie software   privacy  
  Copyright 2003   by The Free Software Foundation     Updated Jun 2003