Forums before death by AOL, social media and spammers... "We can't have nice things"
|    comp.compilers    |    Compiler construction, theory, etc. (Mod    |    2,753 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 1,008 of 2,753    |
|    Steve Horne to drewpvo...@gmail.com    |
|    Re: Help with bison    |
|    27 Jul 07 02:13:11    |
   
   From: stephenhorne100@aol.com   
      
   drewpvo...@gmail.com wrote:   
      
   > The pertinent portion of Simple.y is:   
   > %union semrec /* The Semantic   
      
   I think that's your problem. You are only supposed to have one %union,   
   and Bison gives that the name YYSTYPE automatically. You have tried to   
   give it a name yourself, and so it ends up with two names.   
      
   A typical %union declaration might look like...   
      
   %union {   
   int m_Int_Result;   
   float m_Float_Result;   
   }   
      
   If you want to define other unions, just use the normal C syntax in   
   the %{ ... %} section.   
      
   For more complex parsers, it is more normal to define YYSTYPE as   
   either a base-class pointer or a simple integer (a key to access some   
   external data structure).   
      
   I don't think there's any way to give YYSTYPE another name. Section   
   3.8 of the manual (version 2.3) claims there's never any need.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca