help-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Why isn't YYSTYPE created?


From: Arthur Schwarz
Subject: Why isn't YYSTYPE created?
Date: Wed, 20 Nov 2013 07:45:06 -0800 (PST)


Win7
cygwin cygcheck (cygwin) 1.7.25

bison (GNU Bison) 2.7.1

The typedef for YYSTYPE is not created in the parser output file (in my case) 
Slip.bison.cpp nor in any file imported by flex. Is there any reason, e.g., am 
I doing something wrong or not using a bison option correctly?

The indication seems to be that if I use %union then YYSTYPE is not defined. Is 
my reading accurate?

The input from the grammar definition file (Slip.y) is:


 %file-prefix "Slip.bison"
 %language "C++"
 %name-prefix "Slip"
 %output "Slip.Bison.cpp"
 
 %union {
   int   everything;
 }


The generated parser fragment (without #lines) is:


namespace Slip {

  /// A Bison parser.
  class parser
  {
  public:
    /// Symbol semantic values.
#ifndef YYSTYPE
    union semantic_type
    {

   int   everything;
    };
#else
    typedef YYSTYPE semantic_type;
#endif



reply via email to

[Prev in Thread] Current Thread [Next in Thread]