From 7538d8dc1a0a1d3313add2b31b47a0ea02ca8a74 Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Sun, 12 Sep 2021 17:46:35 +0200 Subject: [PATCH] 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. --- data/skeletons/glr2.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/data/skeletons/glr2.cc b/data/skeletons/glr2.cc index 4dee6690..bce8db9f 100644 --- a/data/skeletons/glr2.cc +++ b/data/skeletons/glr2.cc @@ -1177,11 +1177,11 @@ namespace , magic_ (MAGIC)]])[ {} - semantic_option (rule_num rule, symbol_kind_type token) + semantic_option (rule_num rule) : yyrule (rule) , yystate (0) , yynext (0) - , yytoken (token) + , yytoken (]b4_symbol(empty, kind)[) , yyval ()]b4_locations_if([[ , yyloc ()]])[]b4_parse_assert_if([[ , magic_ (MAGIC)]])[ @@ -2340,7 +2340,7 @@ b4_dollar_popdef])[]dnl glr_state* yyrhs, rule_num yyrule) { semantic_option& yynewOption = - yystateStack.yynewSemanticOption(semantic_option(yyrule, ]b4_symbol(empty, kind)[)); + yystateStack.yynewSemanticOption (semantic_option (yyrule)); yynewOption.setState(yyrhs); yynewOption.setNext(yystate->firstVal()); if (yystateStack.yytops.lookaheadNeeds(yyk))