parser: deprecate %nterm

It has several weaknesses.
Reported by Rici Lake.
http://lists.gnu.org/archive/html/bug-bison/2018-10/msg00000.html

* src/scan-gram.l: here.
This commit is contained in:
Akim Demaille
2018-11-11 19:16:56 +01:00
parent 8d454b843c
commit 7928c3e6fb
5 changed files with 30 additions and 32 deletions

View File

@@ -210,7 +210,7 @@ AT_DATA_GRAMMAR([input.yy],
[[%skeleton "lalr1.cc"
%define api.value.automove
%token <int> NUMBER "number"
%nterm <int> exp
%type <int> exp
%%
exp:
"number" { $$ = $1; $$; }
@@ -576,7 +576,7 @@ AT_DATA_GRAMMAR([[input.y]],
}
%token <int> NUMBER;
%nterm <int> expr;
%type <int> expr;
%token EOI 0;
%printer { yyo << $$; } <int>;
%destructor { std::cerr << "destroy: " << $$ << '\n'; } <int>