skeletons: better comments for some tables

And also, remove the incorrect indentation of these comments:

    -  /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN.  */
    +/* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM.  */
     static const yytype_int8 yyr2[] =
     {
            0,     2,     4,     0,     2,     1,     1,     1,     3,     2,

I don't remember why this indentation was added (in
0991e29b75), but it seems wrong,
at least for yacc.c.  I suspect this was done with lalr1.cc (where
this is embeded in the class definition, so it should be indented),
but today lalr1.cc uses other routines to output these comments.

* data/skeletons/bison.m4 (b4_integral_parser_tables_map): Improve the
wording of the comments of some tables.
* data/skeletons/c.m4 (b4_integral_parser_table_define): Remove
indentation.
This commit is contained in:
Akim Demaille
2020-12-20 07:53:45 +01:00
parent 0a6c2e6400
commit 03d33fd3a4
4 changed files with 23 additions and 23 deletions

View File

@@ -332,14 +332,14 @@ number is the opposite. If YYTABLE_NINF, syntax error.]])
$1([check], [b4_check]) $1([check], [b4_check])
$1([stos], [b4_stos], $1([stos], [b4_stos],
[[YYSTOS[STATE-NUM] -- The (internal number of the) accessing [[YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of
symbol of state STATE-NUM.]]) state STATE-NUM.]])
$1([r1], [b4_r1], $1([r1], [b4_r1],
[[YYR1[YYN] -- Symbol number of symbol that rule YYN derives.]]) [[YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM.]])
$1([r2], [b4_r2], $1([r2], [b4_r2],
[[YYR2[YYN] -- Number of symbols on the right hand side of rule YYN.]]) [[YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM.]])
]) ])

View File

@@ -485,7 +485,7 @@ m4_define([b4_null], [YY_NULLPTR])
# ------------------------------------------------------------- # -------------------------------------------------------------
# Define "yy<TABLE-NAME>" whose contents is CONTENT. # Define "yy<TABLE-NAME>" whose contents is CONTENT.
m4_define([b4_integral_parser_table_define], m4_define([b4_integral_parser_table_define],
[m4_ifvaln([$3], [b4_comment([$3], [ ])])dnl [m4_ifvaln([$3], [b4_comment([$3])])dnl
static const b4_int_type_for([$2]) yy$1[[]] = static const b4_int_type_for([$2]) yy$1[[]] =
{ {
$2 $2

View File

@@ -1,4 +1,4 @@
/* A Bison parser, made by GNU Bison 3.7.4.133-f40c-dirty. */ /* A Bison parser, made by GNU Bison 3.7.4.169-6482. */
/* Bison implementation for Yacc-like parsers in C /* Bison implementation for Yacc-like parsers in C
@@ -49,7 +49,7 @@
#define YYBISON 30704 #define YYBISON 30704
/* Bison version string. */ /* Bison version string. */
#define YYBISON_VERSION "3.7.4.133-f40c-dirty" #define YYBISON_VERSION "3.7.4.169-6482"
/* Skeleton name. */ /* Skeleton name. */
#define YYSKELETON_NAME "yacc.c" #define YYSKELETON_NAME "yacc.c"
@@ -869,8 +869,8 @@ static const yytype_int16 yycheck[] =
60 60
}; };
/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing /* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of
symbol of state STATE-NUM. */ state STATE-NUM. */
static const yytype_int8 yystos[] = static const yytype_int8 yystos[] =
{ {
0, 62, 63, 0, 1, 5, 6, 7, 8, 9, 0, 62, 63, 0, 1, 5, 6, 7, 8, 9,
@@ -892,7 +892,7 @@ static const yytype_int8 yystos[] =
96, 102, 57, 54, 57, 57, 41, 97, 97 96, 102, 57, 54, 57, 57, 41, 97, 97
}; };
/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ /* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */
static const yytype_int8 yyr1[] = static const yytype_int8 yyr1[] =
{ {
0, 61, 62, 63, 63, 64, 64, 64, 64, 64, 0, 61, 62, 63, 63, 64, 64, 64, 64, 64,
@@ -910,7 +910,7 @@ static const yytype_int8 yyr1[] =
101, 102, 102, 103, 104, 104 101, 102, 102, 103, 104, 104
}; };
/* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ /* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */
static const yytype_int8 yyr2[] = static const yytype_int8 yyr2[] =
{ {
0, 2, 4, 0, 2, 1, 1, 1, 3, 2, 0, 2, 4, 0, 2, 1, 1, 1, 3, 2,

View File

@@ -1,4 +1,4 @@
/* A Bison parser, made by GNU Bison 3.7.4.133-f40c-dirty. */ /* A Bison parser, made by GNU Bison 3.7.4.169-6482. */
/* Bison interface for Yacc-like parsers in C /* Bison interface for Yacc-like parsers in C