Austin Group Defect Tracker

Aardvark Mark IV


Viewing Issue Simple Details Jump to Notes ] Issue History ] Print ]
ID Category Severity Type Date Submitted Last Update
0000977 [1003.1(2013)/Issue7+TC1] Shell and Utilities Editorial Omission 2015-08-18 14:30 2019-06-10 08:54
Reporter kaz View Status public  
Assigned To ajosey
Priority normal Resolution Accepted As Marked  
Status Closed  
Name Kaz Kylheku
Organization
User Reference
Section yacc
Page Number 3415,3417
Line Number 114993-114995,115059-115063
Interp Status ---
Final Accepted Text Note: 0002795
Summary 0000977: Content of y.tab.h insufficiently described.
Description What goes into y.tab.h? This is described under the -d option:

-d Write the header file; by default only the code file is written. The #define
    statements associate the token codes assigned by yacc with the user-declared
    token names. This allows source files other than y.tab.c to access the token
    codes.

(Firstly, the wording could use improvement: "The #define statements" is the subject of a well-formed sentence, but there is no clear requirement that these statements are to be generated in y.tab.h.)

My main reason for this report is that this is incomplete. The y.tab.h file must contain not only the preprocessor symbol definitions for the Yacc terminal symbols, but also the declaration of the YYSTYPE union, which is used to declare the yylval variable, similar to:

   extern YYSTYPE yylval;

This is because y.tab.h is traditionally included by lexers, which need to provide the function:

   int yylex()
   {
      /* store some values into a member of yylval */
      return /* one of the tokens from y.tab.h */;
   }
Desired Action Please codify content of y.tab.h more completely, if possible.

Also, there are problems if Yacc implementations deposit unnecessary material in y.tab.h which isn't confined to the implemenation namespaces; it would be good to have a proscription against such.

Tags tc2-2008
Attached Files

- Relationships

-  Notes
(0002792)
Don Cragun (manager)
2015-08-20 04:45

It looks like the text under the heading Header File in the OUTPUT FILES section specifies most of what is wanted.
(0002795)
geoffclare (manager)
2015-08-20 16:06

On P3415 Line 114993 - 114995 Change:

-d Write the header file; by default only the code file is written. The #define statements associate the token codes assigned by yacc with the user-declared token names. This allows source files other than y.tab.c to access the token codes.

to:

-d Write the header file; by default only the code file is written. See the OUTPUT FILES section.

- Issue History
Date Modified Username Field Change
2015-08-18 14:30 kaz New Issue
2015-08-18 14:30 kaz Status New => Under Review
2015-08-18 14:30 kaz Assigned To => ajosey
2015-08-18 14:30 kaz Name => Kaz Kylheku
2015-08-18 14:30 kaz Section => http://pubs.opengroup.org/onlinepubs/9699919799/utilities/yacc.html [^]
2015-08-18 14:30 kaz Page Number => n/a
2015-08-18 14:30 kaz Line Number => n/a
2015-08-20 03:58 kaz Description Updated
2015-08-20 03:59 kaz Description Updated
2015-08-20 04:38 Don Cragun Project 1003.1(2008)/Issue 7 => 1003.1(2013)/Issue7+TC1
2015-08-20 04:41 Don Cragun Section http://pubs.opengroup.org/onlinepubs/9699919799/utilities/yacc.html [^] => yacc
2015-08-20 04:41 Don Cragun Page Number n/a => 3415,3417
2015-08-20 04:41 Don Cragun Line Number n/a => 114993-114995,115059-115063
2015-08-20 04:41 Don Cragun Interp Status => ---
2015-08-20 04:45 Don Cragun Note Added: 0002792
2015-08-20 16:06 geoffclare Note Added: 0002795
2015-08-20 16:07 geoffclare Final Accepted Text => Note: 0002795
2015-08-20 16:07 geoffclare Status Under Review => Resolved
2015-08-20 16:07 geoffclare Resolution Open => Accepted As Marked
2015-08-20 16:07 geoffclare Tag Attached: tc2-2008
2019-06-10 08:54 agadmin Status Resolved => Closed


Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker