mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-16 07:43:03 +00:00
glr2.cc: simplify semantic_option
* data/skeletons/glr2.cc (semantic_option): Simplify the rule-based constructor. This shows that it should be easy to use a symbol_kind, instead of the kind/value/location triple.
This commit is contained in:
@@ -1177,11 +1177,11 @@ namespace
|
|||||||
, magic_ (MAGIC)]])[
|
, magic_ (MAGIC)]])[
|
||||||
{}
|
{}
|
||||||
|
|
||||||
semantic_option (rule_num rule, symbol_kind_type token)
|
semantic_option (rule_num rule)
|
||||||
: yyrule (rule)
|
: yyrule (rule)
|
||||||
, yystate (0)
|
, yystate (0)
|
||||||
, yynext (0)
|
, yynext (0)
|
||||||
, yytoken (token)
|
, yytoken (]b4_symbol(empty, kind)[)
|
||||||
, yyval ()]b4_locations_if([[
|
, yyval ()]b4_locations_if([[
|
||||||
, yyloc ()]])[]b4_parse_assert_if([[
|
, yyloc ()]])[]b4_parse_assert_if([[
|
||||||
, magic_ (MAGIC)]])[
|
, magic_ (MAGIC)]])[
|
||||||
@@ -2340,7 +2340,7 @@ b4_dollar_popdef])[]dnl
|
|||||||
glr_state* yyrhs, rule_num yyrule)
|
glr_state* yyrhs, rule_num yyrule)
|
||||||
{
|
{
|
||||||
semantic_option& yynewOption =
|
semantic_option& yynewOption =
|
||||||
yystateStack.yynewSemanticOption(semantic_option(yyrule, ]b4_symbol(empty, kind)[));
|
yystateStack.yynewSemanticOption (semantic_option (yyrule));
|
||||||
yynewOption.setState(yyrhs);
|
yynewOption.setState(yyrhs);
|
||||||
yynewOption.setNext(yystate->firstVal());
|
yynewOption.setNext(yystate->firstVal());
|
||||||
if (yystateStack.yytops.lookaheadNeeds(yyk))
|
if (yystateStack.yytops.lookaheadNeeds(yyk))
|
||||||
|
|||||||
Reference in New Issue
Block a user