[Top][All Lists]

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

Section 3.1.2 has what appears to be a bug

From: slipbits
Subject: Section 3.1.2 has what appears to be a bug
Date: Fri, 17 Jun 2022 10:26:06 -0700
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0

   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 

    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?


reply via email to

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