style: rename user_token_number as code

This should have been done in 3.6, but I wanted to avoid introducing
conflicts into Vincent's work on counterexamples.  It turns out it's
completely orthogonal.

* data/README.md, data/skeletons/bison.m4, data/skeletons/c++.m4,
* data/skeletons/c.m4, data/skeletons/glr.c, data/skeletons/java.m4,
* data/skeletons/lalr1.d, data/skeletons/lalr1.java,
* data/skeletons/variant.hh, data/skeletons/yacc.c, src/conflicts.c,
* src/derives.c, src/gram.c, src/gram.h, src/output.c,
* src/parse-gram.c, src/parse-gram.y, src/print-xml.c, src/print.c,
* src/reader.c, src/symtab.c, src/symtab.h, tests/input.at,
* tests/types.at:
s/user_token_number/code/g.
Plus minor changes.
This commit is contained in:
Akim Demaille
2020-05-22 20:12:03 +02:00
parent 339d11badf
commit e7aff57122
25 changed files with 88 additions and 95 deletions

View File

@@ -397,12 +397,12 @@ m4@&t@_define([b4_symbol_dump],
b4_symbol_if([$1], [is_token], [Token], [Nonterminal]), d@&t@nl
b4_symbol([$1], [tag]), d@&t@nl
b4_symbol([$1], [id]), d@&t@nl
b4_symbol([$1], [user_number]), d@&t@nl
b4_symbol([$1], [code]), d@&t@nl
b4_symbol([$1], [type]),
])
b4_output_begin([symbols.csv])
number, class, tag, id, user_number, type,
number, class, tag, id, code, type,
b4_symbol_foreach([b4_symbol_dump])d@&t@nl
b4_output_end
]])
@@ -429,7 +429,7 @@ exp:;
AT_BISON_CHECK([-Wno-other -S./dump-symbols.m4 input.y])
AT_CHECK([cat symbols.csv], [],
[[number, class, tag, id, user_number, type,
[[number, class, tag, id, code, type,
0, Token, "end of file", YYEOF, 0, ,
1, Token, error, YYerror, 256, ,
2, Token, "invalid token", YYUNDEF, 257, ,

View File

@@ -235,8 +235,8 @@ m4_foreach([b4_skel], [[yacc.c], [glr.c], [lalr1.cc], [glr.cc]],
[10 0.2])])
# A Bison-defined union.
# The tokens names are not available directly in C++, we use their
# user number to keep it simple between C and C++.
# The token names are not available directly in C++, we use their
# codes to keep it simple between C and C++.
AT_TEST([%skeleton "]b4_skel["
%define api.value.type union],
[%token <int> ONE 101;