* data/lalr1.cc, data/yacc.c: Fix the description of the
yytranslate and yytoknum tables.
+2008-11-13 Akim Demaille <demaille@gostai.com>
+
+ Comment changes.
+ * data/lalr1.cc, data/yacc.c: Fix the description of the
+ yytranslate and yytoknum tables.
+
2008-11-13 Akim Demaille <demaille@gostai.com>
Define make_symbol in the header.
2008-11-13 Akim Demaille <demaille@gostai.com>
Define make_symbol in the header.
# Define yytranslate_. Sometimes we want it in the header file,
# sometimes the cc file suffices.
m4_define([b4_yytranslate_definition],
# Define yytranslate_. Sometimes we want it in the header file,
# sometimes the cc file suffices.
m4_define([b4_yytranslate_definition],
-[[ // YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.
+[[ // Symbol number corresponding to token number t.
]b4_parser_class_name[::token_number_type
]b4_parser_class_name[::yytranslate_ (]b4_lex_symbol_if([token_type],
[int])[ t)
]b4_parser_class_name[::token_number_type
]b4_parser_class_name[::yytranslate_ (]b4_lex_symbol_if([token_type],
[int])[ t)
#if YYDEBUG
/// For each rule, its source line number.
static const ]b4_int_type_for([b4_rline])[ yyrline_[];
#if YYDEBUG
/// For each rule, its source line number.
static const ]b4_int_type_for([b4_rline])[ yyrline_[];
- /// For each scanner token number, its symbol number.
+ /// (External) token number corresponding to the (internal) symbol
+ /// number (which must be that of a token).
static const ]b4_int_type_for([b4_toknum])[ yytoken_number_[];
/// Report on the debug stream that the rule \a r is going to be reduced.
virtual void yy_reduce_print_ (int r);
static const ]b4_int_type_for([b4_toknum])[ yytoken_number_[];
/// Report on the debug stream that the rule \a r is going to be reduced.
virtual void yy_reduce_print_ (int r);
]b4_table_define([stos], [b4_stos])[;
#if YYDEBUG
]b4_table_define([stos], [b4_stos])[;
#if YYDEBUG
- /* TOKEN_NUMBER_[YYLEX-NUM] -- Internal symbol number corresponding
- to YYLEX-NUM. */
+ /* YYTOKNUM[NUM] -- (External) token number corresponding to the
+ (internal) symbol number NUM (which must be that of a token). */
]b4_table_define([token_number], [b4_toknum])[;
#endif
]b4_table_define([token_number], [b4_toknum])[;
#endif
/* YYNSTATES -- Number of states. */
#define YYNSTATES ]b4_states_number[
/* YYNSTATES -- Number of states. */
#define YYNSTATES ]b4_states_number[
-/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
+/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
+ by yylex, with out-of-bounds checking. */
#define YYUNDEFTOK ]b4_undef_token_number[
#define YYMAXUTOK ]b4_user_token_number_max[
#define YYTRANSLATE(YYX) \
((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
#define YYUNDEFTOK ]b4_undef_token_number[
#define YYMAXUTOK ]b4_user_token_number_max[
#define YYTRANSLATE(YYX) \
((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
-/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
+/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
+ as returned by yylex, without out-of-bounds checking. */
static const ]b4_int_type_for([b4_translate])[ yytranslate[] =
{
]b4_translate[
static const ]b4_int_type_for([b4_translate])[ yytranslate[] =
{
]b4_translate[
-/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
- token YYLEX-NUM. */
+/* YYTOKNUM[NUM] -- (External) token number corresponding to the
+ (internal) symbol number NUM (which must be that of a token). */
static const ]b4_int_type_for([b4_toknum])[ yytoknum[] =
{
]b4_toknum[
static const ]b4_int_type_for([b4_toknum])[ yytoknum[] =
{
]b4_toknum[