style: rename semanticVal as value

* data/skeletons/README-D.txt: Remove, now useless and obsolete.
* data/skeletons/glr2.cc, examples/d/calc/calc.y,
* tests/calc.at, tests/d.at, tests/scanner.at (semanticVal): Replace
with...
(value): this.
This commit is contained in:
Akim Demaille
2020-12-26 11:24:57 +01:00
parent 3e6826aff1
commit 94701b4e5e
8 changed files with 24 additions and 87 deletions

View File

@@ -563,7 +563,7 @@ class CalcLexer(R) : Lexer
]AT_YYERROR_DEFINE[
Value semanticVal_;]AT_LOCATION_IF([[
Value value_;]AT_LOCATION_IF([[
Location location;
]])[
int parseInt ()
@@ -600,8 +600,8 @@ class CalcLexer(R) : Lexer
// Numbers.
if (input.front.isNumber)
{
semanticVal_.ival = parseInt;
return Symbol(TokenKind.]AT_TOKEN_PREFIX[NUM, semanticVal_.ival]AT_LOCATION_IF([[, location]])[);
value_.ival = parseInt;
return Symbol(TokenKind.]AT_TOKEN_PREFIX[NUM, value_.ival]AT_LOCATION_IF([[, location]])[);
}
// Individual characters

View File

@@ -78,8 +78,6 @@ class CalcLexer(R) : Lexer
void yyerror(string s) {}
Value semanticVal_;
Symbol yylex()
{
$2

View File

@@ -115,7 +115,7 @@ class YYLexer(R) : Lexer
]AT_YYERROR_DEFINE[
Value semanticVal_;
Value value_;
Symbol yylex ()
{
@@ -131,8 +131,8 @@ class YYLexer(R) : Lexer
switch (c)
{
case '0', '1', '2', '3', '4', '5', '6', '7', '8', '9':
semanticVal_.val = c - '0';
return Symbol(TokenKind.NUM, semanticVal_.val);
value_.val = c - '0';
return Symbol(TokenKind.NUM, value_.val);
case '+': return Symbol(TokenKind.PLUS);
case '-': return Symbol(TokenKind.MINUS);
case '*': return Symbol(TokenKind.STAR);