diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2009-09-20 18:47:48 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2009-09-20 18:47:48 +0200 |
commit | 0804aa8543136f3e1585e0e59a14f9c331c0c448 (patch) | |
tree | 7ffaaf06f0627b13fe3f14868d19bdd277d98399 /cli/context.hxx | |
parent | ddb77e1407eeaf0f18390cb49d915ca50ac2b528 (diff) | |
download | cli-0804aa8543136f3e1585e0e59a14f9c331c0c448.tar.gz cli-0804aa8543136f3e1585e0e59a14f9c331c0c448.tar.xz cli-0804aa8543136f3e1585e0e59a14f9c331c0c448.zip |
Add name processor
Name processor is a separate pass over the semantics graph that assigns
names to various constructs while making sure there are no name clashes.
Diffstat (limited to 'cli/context.hxx')
-rw-r--r-- | cli/context.hxx | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/cli/context.hxx b/cli/context.hxx index 4d88fe9..eb2e412 100644 --- a/cli/context.hxx +++ b/cli/context.hxx @@ -9,6 +9,7 @@ #include <map> #include <string> #include <ostream> +#include <cstddef> // std::size_t #include <cutl/shared-ptr.hxx> @@ -20,6 +21,7 @@ using std::endl; class context { public: + typedef std::size_t size_t; typedef std::string string; private: @@ -46,6 +48,19 @@ public: escape (string const&) const; public: + static string const& + ename (semantics::nameable& n) + { + return n.context ().get<string> ("name"); + } + + static string const& + emember (semantics::nameable& n) + { + return n.context ().get<string> ("member"); + } + +public: context (std::ostream&, semantics::cli_unit&); |