X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/64b3612ab183b8f000d3d6b2c8eb957865081d37..11aef5e95b890364474c49c7d4529de2bec3544e:/data/lalr1.cc?ds=inline diff --git a/data/lalr1.cc b/data/lalr1.cc index 91f5c27d..91cb5cf0 100644 --- a/data/lalr1.cc +++ b/data/lalr1.cc @@ -20,7 +20,7 @@ m4_include(b4_pkgdatadir/[c++.m4]) # b4_integral_parser_table_declare(TABLE-NAME, CONTENT, COMMENT) # -------------------------------------------------------------- -# Declare "parser::yy_" which contents is CONTENT. +# Declare "parser::yy_" whose contents is CONTENT. m4_define([b4_integral_parser_table_declare], [m4_ifval([$3], [b4_comment([$3], [ ]) ])dnl @@ -29,7 +29,7 @@ m4_define([b4_integral_parser_table_declare], # b4_integral_parser_table_define(TABLE-NAME, CONTENT, COMMENT) # ------------------------------------------------------------- -# Define "parser::yy_" which contents is CONTENT. +# Define "parser::yy_" whose contents is CONTENT. m4_define([b4_integral_parser_table_define], [ const b4_int_type_for([$2]) b4_parser_class_name::yy$1_[[]] = @@ -227,6 +227,9 @@ b4_location_define])])[ static const ]b4_int_type(b4_pact_ninf, b4_pact_ninf)[ yypact_ninf_; static const ]b4_int_type(b4_table_ninf, b4_table_ninf)[ yytable_ninf_; + /// Convert a scanner token number \a t to a symbol number. + static inline token_number_type yytranslate_ (]b4_token_ctor_if([token_type], [int])[ t); + // Tables. ]b4_parser_tables_declare[]b4_error_verbose_if([ @@ -238,7 +241,7 @@ b4_location_define])])[ static const char* const yytname_[]; ]b4_token_table_if([[#if ]b4_api_PREFIX[DEBUG]])[ ]b4_integral_parser_table_declare([rline], [b4_rline], - [YYRLINE[YYN] -- Source line where rule number YYN was defined.])[ + [[YYRLINE[YYN] -- Source line where rule number YYN was defined.]])[ /// Report on the debug stream that the rule \a r is going to be reduced. virtual void yy_reduce_print_ (int r); /// Print the state stack on the debug stream. @@ -247,12 +250,7 @@ b4_location_define])])[ // Debugging. int yydebug_; std::ostream* yycdebug_; -#endif // ]b4_api_PREFIX[DEBUG - /// Convert a scanner token number \a t to a symbol number. - static inline token_number_type yytranslate_ (]b4_token_ctor_if([token_type], [int])[ t); - -#if ]b4_api_PREFIX[DEBUG /// \brief Display a symbol type, value and location. /// \param yyo The output stream. /// \param yysym The symbol. @@ -269,7 +267,6 @@ b4_location_define])])[ inline void yy_destroy_ (const char* yymsg, symbol_base_type& yysym) const; - private: /// Element of the stack: a state and its attributes. struct stack_symbol_type : symbol_base_type { @@ -830,7 +827,7 @@ b4_dollar_popdef])[]dnl ]b4_variant_if([[ // Destroy the rhs symbols. for (int i = 0; i < yylen; ++i) - // Destroy a variant which value may have been swapped with + // Destroy a variant whose value may have been swapped with // yylhs.value (for instance if the action was "std::swap($$, // $1)"). The value of yylhs.value (hence possibly one of these // rhs symbols) depends on the default construction for this @@ -897,7 +894,7 @@ b4_dollar_popdef])[]dnl yyerror_range[1].location = yystack_[yylen - 1].location;]])b4_variant_if([[ /* $$ was initialized before running the user action. */ yy_destroy_ ("Error: discarding", yylhs);]])[ - /* Do not reclaim the symbols of the rule which action triggered + /* Do not reclaim the symbols of the rule whose action triggered this YYERROR. */ yypop_ (yylen); yylen = 0; @@ -957,7 +954,7 @@ b4_dollar_popdef])[]dnl if (!yyempty) yy_destroy_ ("Cleanup: discarding lookahead", yyla); - /* Do not reclaim the symbols of the rule which action triggered + /* Do not reclaim the symbols of the rule whose action triggered this YYABORT or YYACCEPT. */ yypop_ (yylen); while (1 < yystack_.size ())