A NOTE has been added to this issue. ====================================================================== http://austingroupbugs.net/view.php?id=1269 ====================================================================== Reported By: Clausecker Assigned To: ====================================================================== Project: 1003.1(2016)/Issue7+TC2 Issue ID: 1269 Category: Shell and Utilities Type: Omission Severity: Objection Priority: normal Status: New Name: Robert Clausecker Organization: Zuse Institute Berlin User Reference: Section: yacc Page Number: 3415, 3425–3426 Line Number: 15000–15006, 115422–115425, 115447–115452 Interp Status: --- Final Accepted Text: ====================================================================== Date Submitted: 2019-07-10 21:23 UTC Last Modified: 2019-08-14 14:06 UTC ====================================================================== Summary: yacc: yychar is mentioned but not further specified ======================================================================
---------------------------------------------------------------------- (0004519) geoffclare (manager) - 2019-08-14 14:06 http://austingroupbugs.net/view.php?id=1269#c4519 ---------------------------------------------------------------------- I used searchcode.com to look for open source projects that use yychar in .y files: https://searchcode.com/?q=yychar&lan=56 (NB pay attention to the line numbers in the search results; the juxtaposition of lines from different parts of a file can be misleading). The most common code that looks for special values of yychar seems to be to fetch a token when there isn't one. This is either done without using macros: <pre> if (yychar < 0) yychar = yylex(); </pre> or with them: <pre> if (yychar == YYEMPTY) yychar = YYLEX; </pre> Not using the macros is currently more portable, but code that uses YYEMPTY is more easily understandable, so I believe we should add at least that one. If we add YYEMPTY we might as well also add YYEOF. (I assume YYLEX is locally defined by the applications that use it, as I don't see it in the online bison manual.) I noticed quite a lot of code that assumed yychar is zero at end of input, so I think we should also consider requiring this (currently we allow the end-of-input token number to be zero or negative). Issue History Date Modified Username Field Change ====================================================================== 2019-07-10 21:23 Clausecker New Issue 2019-07-10 21:23 Clausecker Name => Robert Clausecker 2019-07-10 21:23 Clausecker Organization => Zuse Institute Berlin 2019-07-10 21:23 Clausecker Section => yacc 2019-07-10 21:23 Clausecker Page Number => 3415, 3425–3426 2019-07-10 21:23 Clausecker Line Number => 15000–15006, 115422–115425, 115447–115452 2019-07-11 08:21 joerg Note Added: 0004479 2019-07-11 09:33 Clausecker Note Added: 0004480 2019-08-01 21:23 shware_systems Note Added: 0004505 2019-08-05 15:00 shware_systems Note Edited: 0004505 2019-08-14 10:03 Clausecker Note Added: 0004518 2019-08-14 14:06 geoffclare Note Added: 0004519 ======================================================================