diff options
author | jai <jai@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2007-01-29 21:15:18 +0000 |
---|---|---|
committer | jai <jai@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2007-01-29 21:15:18 +0000 |
commit | b71531b42b3325fd6079a7039aae8641262c8adf (patch) | |
tree | a5b9aa16924c541fcb424ee9460b1ac7f5a89352 /modules/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Include.hpp | |
parent | a0f67cc97c0050d907145e312135b60c0125e56e (diff) | |
download | ATCD-DS-main.tar.gz |
branching/taggingDS-main
Diffstat (limited to 'modules/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Include.hpp')
-rw-r--r-- | modules/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Include.hpp | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/modules/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Include.hpp b/modules/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Include.hpp new file mode 100644 index 00000000000..9c699fe20ba --- /dev/null +++ b/modules/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Include.hpp @@ -0,0 +1,84 @@ +// file : CCF/IDL3/SemanticAction/Impl/Include.hpp +// author : Boris Kolpackov <boris@dre.vanderbilt.edu> +// cvs-id : $Id$ + +#ifndef CCF_IDL3_SEMANTIC_ACTION_IMPL_INCLUDE_HPP +#define CCF_IDL3_SEMANTIC_ACTION_IMPL_INCLUDE_HPP + +#include <set> +#include <stack> + +#include "CCF/CompilerElements/Context.hpp" +#include "CCF/CompilerElements/Diagnostic.hpp" + +#include "CCF/IDL2/SemanticGraph/Translation.hpp" +#include "CCF/IDL3/SemanticGraph/Elements.hpp" + +#include "CCF/IDL2/SemanticAction/Include.hpp" +#include "CCF/IDL3/SemanticAction/Factory.hpp" + +#include "CCF/IDL3/SemanticAction/Impl/Elements.hpp" + +namespace CCF +{ + namespace IDL3 + { + namespace SemanticAction + { + namespace Impl + { + // Note: overriding IDL2 include to allow inclusion of IDL3 files. + // + // + struct Include : IDL2::SemanticAction::Include, Base + { + public: + Include (Context& c, + Diagnostic::Stream& dout, + SemanticAction::Factory& action_factory); + + virtual void + quote (StringLiteralPtr const& sl); + + virtual void + bracket (StringLiteralPtr const& sl); + + virtual void + end (); + + private: + enum Type_ + { + quote_, + bracket_ + }; + + virtual void + impl (StringLiteralPtr const& sl, Type_ type); + + bool + handle_already_included (fs::path const& path, + StringLiteralPtr const& sl); + private: + Diagnostic::Stream& dout_; + SemanticAction::Factory& action_factory_; + + std::stack<SemanticGraph::TranslationRegion*> stack_; + std::stack<fs::path> abs_path_stack_, rel_path_stack_; + + struct FilePathComparator + { + bool operator () (fs::path const& x, fs::path const& y) const + { + return x.string () < y.string (); + } + }; + + std::set<fs::path, FilePathComparator> include_file_set_; + }; + } + } + } +} + +#endif // CCF_IDL3_SEMANTIC_ACTION_IMPL_INCLUDE_HPP |