00001 /* 00002 The lestes compiler suite 00003 Copyright (C) 2002, 2003, 2004, 2005 Miroslav Tichy 00004 Copyright (C) 2002, 2003, 2004, 2005 Petr Zika 00005 Copyright (C) 2002, 2003, 2004, 2005 Vojtech Hala 00006 Copyright (C) 2002, 2003, 2004, 2005 Jiri Kosina 00007 Copyright (C) 2002, 2003, 2004, 2005 Pavel Sanda 00008 Copyright (C) 2002, 2003, 2004, 2005 Jan Zouhar 00009 Copyright (C) 2002, 2003, 2004, 2005 Rudolf Thomas 00010 00011 This program is free software; you can redistribute it and/or modify 00012 it under the terms of the GNU General Public License as published by 00013 the Free Software Foundation; version 2 of the License. 00014 00015 This program is distributed in the hope that it will be useful, 00016 but WITHOUT ANY WARRANTY; without even the implied warranty of 00017 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00018 GNU General Public License for more details. 00019 00020 See the full text of the GNU General Public License version 2, and 00021 the limitations in the file doc/LICENSE. 00022 00023 By accepting the license the licensee waives any and all claims 00024 against the copyright holder(s) related in whole or in part to the 00025 work, its use, and/or the inability to use it. 00026 00027 */ 00028 /*! \file 00029 \brief Lookup for object declaration purpose. 00030 00031 Looks up entities, which come into account when dealing with object 00032 declarations. 00033 00034 \author pt 00035 */ 00036 #include <lestes/lang/cplus/sem/lu_filter.g.hh> 00037 #include <lestes/lang/cplus/sem/li_non_secu_by_name_in_single_scope.g.hh> 00038 #include <lestes/lang/cplus/sem/lu_lu.g.hh> 00039 #include <lestes/lang/cplus/sem/ss_decl_name.g.hh> 00040 #include <lestes/lang/cplus/sem/ss_declaration.g.hh> 00041 #include <lestes/lang/cplus/sem/ss_misc.g.hh> 00042 #include <lestes/std/source_location.hh> 00043 #include <lestes/std/set.hh> 00044 #include <lestes/msg/logger.hh> 00045 #include <lestes/msg/logger_util.hh> 00046 00047 package(lestes); 00048 package(lang); 00049 package(cplus); 00050 package(sem); 00051 00052 //! Defines set with ss_structure declaration. 00053 typedef set< srp<ss_declaration> > ss_structure_declaration_set_type; 00054 00055 /*! 00056 Looks up non-struct, enum, class, union name in single scope. 00057 \param name The name to find. 00058 \param scope The scope to search in. 00059 \return Set of declarations, excluding class-like and enums. 00060 */ 00061 ptr< set< srp<ss_declaration> > > li_non_secu_by_name_in_single_scope::process( 00062 ptr<ss_decl_name> name, ptr <ss_decl_seq> scope) 00063 { 00064 lassert(name); 00065 lassert(scope); 00066 00067 ptr<lu_name_filter> nf = lu_name_filter::create(name); 00068 ptr<lu_inversion_filter> yf = lu_inversion_filter::create(lu_secu_filter::instance()); 00069 ptr<lu_multi_filter> mf = lu_multi_filter::create(); 00070 mf->add_filter(nf); 00071 mf->add_filter(yf); 00072 00073 ptr<lu_params> params = lu_params::create(lu_params::UDIR_IGNORE, lu_params::UDECL_IGNORE, lu_params::SKIP_PARENTS, 00074 ss_declaration_time::create(name->location_get()->order_get()), mf); 00075 ptr<ss_structure_declaration_set_type> res = lu_lookup::instance()->main(scope, params); 00076 00077 return res; 00078 } 00079 00080 end_package(sem); 00081 end_package(cplus); 00082 end_package(lang); 00083 end_package(lestes); 00084 00085
1.5.1-20070107