3.1.2 Prologue Alternatives, pg. 50 “and the new YYLTYPE definition before the Bison-generated YYSTYPE and YYLTYPE definitions in both the parser implementation file and the parser header file”.
This position causes, in this case, YYLTYPE to be doubly defined in the same scope. 1. Is this exclusive to YYLTYPE or to all declarations? 2. Doesn't this cause a doubly defined error in C? 3. In C++ and Java, doesn't this cause two different declarations with the same name because of scoping rules? That means that, for example, a function referencing the declaration in the same class sees one definition, and a function referencing a declaration in a different class sees another. Suppose that a function defined in a separate class than yyparse() is located in passes a parameter defined with this declaration, what happens if the variable passed is located in the yyparse() class or in a different class. Although the declaration names are the same, scoping makes them different. Is this a bug? thanks; art