// file : CCF/IDL2/SemanticAction/Impl/Factory.cpp // author : Boris Kolpackov // cvs-id : $Id$ #include "CCF/IDL2/SemanticGraph/Fundamental.hpp" #include "CCF/IDL2/SemanticAction/Impl/Factory.hpp" namespace CCF { namespace IDL2 { namespace SemanticAction { namespace Impl { using namespace SemanticGraph; template void Factory:: define_fund_type (Root& root, SimpleName const& name) { ctx_.tu ().template new_edge ( root, ctx_.tu ().template new_node ("fundamental-types", 0), name); } Factory:: Factory (CompilerElements::Context& parsing_context, Diagnostic::Stream&, SemanticGraph::TranslationUnit& tu) : ctx_ (parsing_context.get ("trace-semantic-action", false), tu, parsing_context), attribute_ (ctx_), const__ (ctx_), enum__ (ctx_), exception_ (ctx_), include_ (ctx_), interface_ (ctx_), member_ (ctx_), module_ (ctx_), native_ (ctx_), numeric_expression_ (ctx_), operation_ (ctx_), struct__ (ctx_), typedef__ (ctx_), type_id_ (ctx_), type_prefix_ (ctx_), union__ (ctx_), value_type_ (ctx_), value_type_factory_ (ctx_), value_type_member_ (ctx_) { // Implied translation region with fundamental types. // TranslationRegion& ftr ( tu.new_node ( "fundamental-type", 0)); tu.new_edge (tu, ftr, "fundamental-type"); Root& fr (tu.new_node ("fundamental-types", 0)); tu.new_edge (ftr, fr); define_fund_type (fr, "Object"); define_fund_type (fr, "ValueBase"); define_fund_type (fr, "any"); define_fund_type (fr, "boolean"); define_fund_type (fr, "char"); define_fund_type (fr, "double"); define_fund_type (fr, "float"); define_fund_type (fr, "long"); define_fund_type (fr, "long double"); define_fund_type (fr, "long long"); define_fund_type (fr, "octet"); define_fund_type (fr, "short"); define_fund_type (fr, "string"); define_fund_type (fr, "unsigned long"); define_fund_type (fr, "unsigned long long"); define_fund_type (fr, "unsigned short"); define_fund_type (fr, "void"); define_fund_type (fr, "wchar"); define_fund_type (fr, "wstring"); TranslationRegion& principal ( tu.new_node (ctx_.file (), 0)); tu.new_edge (tu, principal); Root& root (tu.new_node (ctx_.file (), 0)); tu.new_edge (principal, root); ctx_.region (principal); ctx_.scope (root); } } } } }