View Issue Details

IDProjectCategoryView StatusLast Update
00009771003.1(2013)/Issue7+TC1Shell and Utilitiespublic2019-06-10 08:54
Reporterkaz Assigned Toajosey  
PrioritynormalSeverityEditorialTypeOmission
Status ClosedResolutionAccepted As Marked 
NameKaz Kylheku
Organization
User Reference
Sectionyacc
Page Number3415,3417
Line Number114993-114995,115059-115063
Interp Status---
Final Accepted Text0000977:0002795
Summary0000977: Content of y.tab.h insufficiently described.
DescriptionWhat 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 ActionPlease 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.

Tagstc2-2008

Activities

Don Cragun

2015-08-20 04:45

manager   bugnote:0002792

It looks like the text under the heading Header File in the OUTPUT FILES section specifies most of what is wanted.

geoffclare

2015-08-20 16:06

manager   bugnote:0002795

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 => 0000977: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