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 CV qualification. 00030 00031 Definition of visitor adding CV qualifiers to ss_type. 00032 */ 00033 #include <lestes/common.hh> 00034 #include <lestes/lang/cplus/sem/as_decl.g.hh> 00035 #include <lestes/lang/cplus/sem/ss_type.g.hh> 00036 #include <lestes/lang/cplus/sem/as_cv_qualifier2ss_type.g.hh> 00037 00038 package(lestes); 00039 package(lang); 00040 package(cplus); 00041 package(sem); 00042 00043 /*! 00044 Adds the qualifier to the current type. 00045 \pre qualifier != NULL 00046 \param qualifier The qualifier to add. 00047 */ 00048 void as_cv_qualifier2ss_type::process(ptr<as_cv_qualifier> qualifier) 00049 { 00050 lassert(qualifier); 00051 qualifier->accept_as_cv_qualifier_visitor(this); 00052 } 00053 00054 /*! 00055 Adds const qualifier to the current type. 00056 \pre qualifier != NULL 00057 \param qualifier The const qualifier. 00058 */ 00059 void as_cv_qualifier2ss_type::visit_as_cv_qualifier_const( 00060 ptr<as_cv_qualifier_const> qualifier) 00061 { 00062 lassert(qualifier); 00063 type = ss_const::instance(type); 00064 } 00065 00066 /*! 00067 Adds volatile qualifier to the current type. 00068 \pre qualifier != NULL 00069 \param qualifier The volatile qualifier. 00070 */ 00071 void as_cv_qualifier2ss_type::visit_as_cv_qualifier_volatile( 00072 ptr<as_cv_qualifier_volatile> qualifier) 00073 { 00074 lassert(qualifier); 00075 type = ss_volatile::instance(type); 00076 } 00077 00078 /*! 00079 Visits restrict qualifier. 00080 \pre qualifier != NULL 00081 \param qualifier The restrict qualifier. 00082 */ 00083 void as_cv_qualifier2ss_type::visit_as_cv_qualifier_restrict( 00084 ptr<as_cv_qualifier_restrict> qualifier) 00085 { 00086 lassert(qualifier); 00087 lassert2(false,"restrict is not C++"); 00088 } 00089 00090 end_package(sem); 00091 end_package(cplus); 00092 end_package(lang); 00093 end_package(lestes);
1.5.1-20070107