summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorAkim Demaille <akim.demaille@gmail.com>2020-12-26 08:21:50 +0100
committerAkim Demaille <akim.demaille@gmail.com>2020-12-26 09:05:45 +0100
commit2157ced3dd1bc77764d06222f2b82b59ef807207 (patch)
tree7783535503ab91bdfccbc15b1466fca27b66e5d8 /examples
parent59653c8efd894b1190e31cc6eea56862316afe0d (diff)
downloadbison-2157ced3dd1bc77764d06222f2b82b59ef807207.tar.gz
c++: rename semantic_type as value_type
We always refer to the triplet "kind, value, location". All of them are nouns, and we support api.value.type and api.location.type. On this regard, "semantic_type" was a poor choice. Make it "value_type". The test suite was not updated to use value_type, on purpose, to enforce backward compatibility. * data/skeletons/c++.m4, data/skeletons/glr.cc, data/skeletons/glr2.cc, * data/skeletons/variant.hh, doc/bison.texi: Define value_type rather than semantic_type. Add a backward compatibility typedef. * examples/c++/glr/c++-types.yy: Migrate.
Diffstat (limited to 'examples')
-rw-r--r--examples/c++/glr/c++-types.yy12
1 files changed, 6 insertions, 6 deletions
diff --git a/examples/c++/glr/c++-types.yy b/examples/c++/glr/c++-types.yy
index 1fc26166..ce6ae4f1 100644
--- a/examples/c++/glr/c++-types.yy
+++ b/examples/c++/glr/c++-types.yy
@@ -46,11 +46,11 @@
# define nullptr 0
#endif
- static yy::parser::semantic_type
- stmtMerge (const yy::parser::semantic_type& x0, const yy::parser::semantic_type& x1);
+ static yy::parser::value_type
+ stmtMerge (const yy::parser::value_type& x0, const yy::parser::value_type& x1);
static int
- yylex (yy::parser::semantic_type* val, yy::parser::location_type* loc);
+ yylex (yy::parser::value_type* val, yy::parser::location_type* loc);
}
%expect-rr 1
@@ -103,7 +103,7 @@ yy::parser::error (const location_type& l, const std::string& m)
}
static int
-yylex (yy::parser::semantic_type* lvalp, yy::parser::location_type* llocp)
+yylex (yy::parser::value_type* lvalp, yy::parser::location_type* llocp)
{
static int lineNum = 1;
static int colNum = 0;
@@ -162,8 +162,8 @@ yylex (yy::parser::semantic_type* lvalp, yy::parser::location_type* llocp)
}
}
-static yy::parser::semantic_type
-stmtMerge (const yy::parser::semantic_type& x0, const yy::parser::semantic_type& x1)
+static yy::parser::value_type
+stmtMerge (const yy::parser::value_type& x0, const yy::parser::value_type& x1)
{
return Nterm ("<OR>", x0, x1);
}