sa_decl_seq_compound_pair_creator.cc

Go to the documentation of this file.
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 #include <lestes/lang/cplus/sem/ss_type.g.hh>
00029 #include <lestes/lang/cplus/sem/ss_misc.g.hh>
00030 #include <lestes/lang/cplus/sem/ss_expression.g.hh>
00031 #include <lestes/lang/cplus/sem/ss_decl_name.g.hh>
00032 #include <lestes/lang/cplus/sem/ss_declaration.g.hh>
00033 #include <lestes/lang/cplus/sem/ss_statement.g.hh>
00034 #include <lestes/lang/cplus/sem/ss_enums.g.hh>
00035 #include <lestes/lang/cplus/sem/sa_decl_seq_compound_pair_creator.g.hh>
00036 #include <lestes/std/pair.hh>
00037 
00038 #include <lestes/std/dumper.hh>
00039 #include <fstream>
00040 
00041 /*! \file
00042   \author TMA
00043   \author jikos
00044  */
00045 
00046 package(lestes);
00047 package(lang);
00048 package(cplus);
00049 package(sem);
00050 
00051 typedef list < srp < ss_sp > > sp_list;
00052 
00053 ptr < pair < srp < ss_decl_seq >, srp < ss_compound_stmt > > >sa_decl_seq_compound_pair_creator::process (ptr < source_location > loc, ptr < ss_decl_seq > parent_scope, ptr < ss_compound_stmt > parent_stmt)
00054 {
00055         /* create some sequence points */
00056         ptr < ss_sp > psp = ss_sp::create(loc, NULL, NULL, 0);
00057         ptr < ss_sp > nsp = ss_sp::create(loc, NULL, NULL, 0);
00058         ptr < ss_sp > dsp = ss_sp::create(loc, NULL, NULL, 0);
00059         /* link them together */
00060         psp->nsp_set(dsp);
00061         dsp->nsp_set(nsp);
00062         dsp->psp_set(psp);
00063         nsp->psp_set(dsp);
00064 
00065         ptr<sp_list> sps = sp_list::create();
00066         sps->push_back(psp);
00067         sps->push_back(dsp);
00068         sps->push_back(nsp);
00069 
00070         ptr < ss_decl_seq > decl_seq = ss_decl_seq::create(
00071                         loc,
00072                         list< srp<ss_declaration> >::create(), /* contents */
00073                         parent_scope, /* parent */
00074                         NULL, /* compound */
00075                         list< srp<ss_using_directive> >::create(), /* using directives */
00076                         NULL /* declared by */);
00077 
00078         ptr < ss_compound_stmt > stmt = ss_compound_stmt::create(
00079                         loc, list < srp < ss_label > >::create(),
00080                         parent_stmt, psp, nsp, sps,
00081                         decl_seq,
00082                         list < srp < ss_statement > >::create(), dsp);
00083 
00084         decl_seq->compound_stmt_set(stmt);
00085 
00086         return pair < srp < ss_decl_seq >, srp < ss_compound_stmt > >::create(decl_seq, stmt);
00087 }
00088 
00089 end_package(sem);
00090 end_package(cplus);
00091 end_package(lang);
00092 end_package(lestes);
00093 

Generated on Mon Feb 12 18:23:12 2007 for lestes by doxygen 1.5.1-20070107