sa_statements.g.hh

Go to the documentation of this file.
00001 // This file is automatically generated, do not edit.
00002 
00003 /*!
00004         \file
00005         \brief AS to SS statements transformation
00006         \author egg
00007 */
00008 
00009 #ifndef lestes__lang__cplus__sem__sa_statements_g_hh__included
00010 #define lestes__lang__cplus__sem__sa_statements_g_hh__included
00011 
00012 #include <lestes/common.hh>
00013 #include <lestes/lang/cplus/sem/as_decl.g.hh>
00014 #include <lestes/lang/cplus/sem/as_statements.g.hh>
00015 #include <lestes/lang/cplus/sem/as_visitor.v.g.hh>
00016 #include <lestes/lang/cplus/sem/sa_context.g.hh>
00017 #include <lestes/lang/cplus/sem/declaration_broadcasting.hh>
00018 #include <lestes/lang/cplus/sem/ss_declaration.g.hh>
00019 #include <lestes/lang/cplus/sem/ss_declaration_visitor.v.g.hh>
00020 #include <lestes/lang/cplus/sem/ss_expression.g.hh>
00021 #include <lestes/lang/cplus/sem/ss_misc.g.hh>
00022 #include <lestes/lang/cplus/sem/visitor.v.g.hh>
00023 
00024 #include <lestes/std/objectize_macros.hh>
00025 package(lestes);
00026 package(std);
00027 class source_location;
00028 end_package(std);
00029 end_package(lestes);
00030 
00031 package(lestes);
00032 package(std);
00033 class object;
00034 end_package(std);
00035 end_package(lestes);
00036 
00037 package(lestes);
00038 package(lang);
00039 package(cplus);
00040 package(sem);
00041 
00042 
00043 
00044                 typedef ::lestes::std::list < srp < ss_expression > > expr_list;
00045         
00046 
00047 
00048 
00049 class as_compound_statement;
00050 class as_condition;
00051 class as_expression;
00052 class as_expression_list;
00053 class as_expression_statement;
00054 class as_function_definition;
00055 class as_initializer_clause;
00056 class as_return_statement;
00057 class as_statement;
00058 class ss_compound_stmt;
00059 class ss_declaration;
00060 class ss_decl_seq;
00061 class ss_expression;
00062 class ss_function_declaration;
00063 class ss_type;
00064 class ss_sp;
00065 class sa_statements;
00066 class decl_stmt_listener;
00067 class last_declaration_memorizer;
00068 class initializer_clause_converter;
00069 class condition_to_expression;
00070 class sa_expression_converter;
00071 class get_real_declaration;
00072 
00073 
00074 //! Main visitor for statements SA
00075 class sa_statements : public ::lestes::std::object {
00076 public:
00077         //! The method current_function_get returns the value of the field sa_statements::current_function.
00078         ptr< ss_function_declaration > current_function_get() const;
00079 
00080         //! The method current_function_set sets the field sa_statements::current_function to the given value.
00081         void current_function_set(const ptr< ss_function_declaration > &);
00082 
00083         //! The method last_declaration_get returns the value of the field sa_statements::last_declaration.
00084         ptr< ss_declaration > last_declaration_get() const;
00085 
00086         //! The method last_declaration_set sets the field sa_statements::last_declaration to the given value.
00087         void last_declaration_set(const ptr< ss_declaration > &);
00088 
00089         void declarator_simple(ptr< ::lestes::std::source_location > loc);
00090 
00091         void declarator_init(ptr< ::lestes::std::source_location > loc, ptr< as_initializer_clause > inizer);
00092 
00093         void declarator_ctor(ptr< ::lestes::std::source_location > loc, ptr< as_expression_list > inizer);
00094 
00095         //! Create new function scope, switch context into it.
00096         void enter_function(ptr< ::lestes::std::source_location > loc, ptr< as_function_definition > as_func);
00097 
00098         //! Leave function created using enter_function.
00099         void leave_function();
00100 
00101         //! Create new ss_compound_stmt with all the stuff and switch context into it.
00102         void enter_scope(ptr< ::lestes::std::source_location > loc);
00103 
00104         //! Leave scope created using enter_scope.
00105         void leave_scope();
00106 
00107         //! Given declaration should have a fake in current scope.
00108         void insert_fake_declaration(ptr< ss_declaration > decl);
00109 
00110         //! Make ss_expr_stmt from as_expression_statement.
00111         void expression_stmt(ptr< as_expression > as);
00112 
00113         //! Make ss_return from as_return_statement.
00114         void return_stmt(ptr< as_return_statement > as);
00115 
00116         void if_head(ptr< ::lestes::std::source_location > loc, ptr< as_condition > cond);
00117 
00118         void while_head(ptr< ::lestes::std::source_location > loc, ptr< as_condition > cond);
00119 
00120         void for_head(ptr< ::lestes::std::source_location > loc, ptr< as_condition > cond, ptr< as_expression > iter);
00121 
00122         void for_inner_action(ptr< ::lestes::std::source_location > loc);
00123 
00124         void condition_decl(ptr< ::lestes::std::source_location > loc, ptr< as_expression > inizer);
00125 
00126         //! Switch context into given subscope and optionally insert a fake declaration.
00127         void enter_subcompound(ptr< ss_compound_stmt > scope);
00128 
00129         void enter_else();
00130 
00131         ptr< ss_compound_stmt > new_compound(ptr< ::lestes::std::source_location > loc);
00132 
00133         
00134         //! Generated instance() method for singleton class sa_statements.
00135         static ptr< sa_statements > instance ();
00136 
00137         
00138 
00139         //! for purposes of dumping
00140         virtual ptr<reflection_list> reflection_get() const;
00141         //! for purposes of dumping
00142         virtual ptr<field_list_list> field_values_get() const;
00143         
00144 protected:
00145         //! Generated constructor for class sa_statements.
00146         sa_statements (
00147                 ptr< ss_function_declaration > a__sa_statements__current_function,
00148                 ptr< ss_declaration > a__sa_statements__last_declaration);
00149 
00150         //! Marking routine for class sa_statements. 
00151         virtual void gc_mark();
00152 
00153 private:
00154         srp< ss_function_declaration > current_function;
00155         srp< ss_declaration > last_declaration;
00156         static ptr<reflection_list> reflection;
00157         static ptr<sa_statements> the_instance;
00158         
00159 }; // sa_statements
00160 
00161 
00162 class decl_stmt_listener : public declaration_broadcast_listener {
00163 public:
00164         void run(ptr< ss_declaration > decl);
00165 
00166         
00167         //! Generated instance() method for singleton class decl_stmt_listener.
00168         static ptr< decl_stmt_listener > instance ();
00169 
00170         
00171 
00172         //! for purposes of dumping
00173         virtual ptr<reflection_list> reflection_get() const;
00174         //! for purposes of dumping
00175         virtual ptr<field_list_list> field_values_get() const;
00176         
00177 protected:
00178         //! Generated constructor for class decl_stmt_listener.
00179         decl_stmt_listener (
00180                 );
00181 
00182         //! Marking routine for class decl_stmt_listener. 
00183         virtual void gc_mark();
00184 
00185 private:
00186         static ptr<reflection_list> reflection;
00187         static ptr<decl_stmt_listener> the_instance;
00188         
00189 }; // decl_stmt_listener
00190 
00191 
00192 class last_declaration_memorizer : public ss_declaration_default_visitor {
00193 public:
00194         virtual void visit_ss_object_declaration(ptr< ::lestes::lang::cplus::sem::ss_object_declaration > );
00195 
00196         virtual void default_action(ptr< ::lestes::lang::cplus::sem::ss_declaration > );
00197 
00198         
00199         //! Generated instance() method for singleton class last_declaration_memorizer.
00200         static ptr< last_declaration_memorizer > instance ();
00201 
00202         
00203 
00204         //! for purposes of dumping
00205         virtual ptr<reflection_list> reflection_get() const;
00206         //! for purposes of dumping
00207         virtual ptr<field_list_list> field_values_get() const;
00208         
00209 protected:
00210         //! Generated constructor for class last_declaration_memorizer.
00211         last_declaration_memorizer (
00212                 );
00213 
00214         //! Marking routine for class last_declaration_memorizer. 
00215         virtual void gc_mark();
00216 
00217 private:
00218         static ptr<reflection_list> reflection;
00219         static ptr<last_declaration_memorizer> the_instance;
00220         
00221 }; // last_declaration_memorizer
00222 
00223 
00224 class initializer_clause_converter : public as_initializer_clause_visitor {
00225 public:
00226         //! The method psp_get returns the value of the field initializer_clause_converter::psp.
00227         ptr< ss_sp > psp_get() const;
00228 
00229         //! The method psp_set sets the field initializer_clause_converter::psp to the given value.
00230         void psp_set(const ptr< ss_sp > &);
00231 
00232         //! The method nsp_get returns the value of the field initializer_clause_converter::nsp.
00233         ptr< ss_sp > nsp_get() const;
00234 
00235         //! The method nsp_set sets the field initializer_clause_converter::nsp to the given value.
00236         void nsp_set(const ptr< ss_sp > &);
00237 
00238         //! The method sps_get returns the value of the field initializer_clause_converter::sps.
00239         ptr< ::lestes::std::list< srp< ss_sp > > > sps_get() const;
00240 
00241         //! The method sps_set sets the field initializer_clause_converter::sps to the given value.
00242         void sps_set(const ptr< ::lestes::std::list< srp< ss_sp > > > & );
00243 
00244         //! The method type_get returns the value of the field initializer_clause_converter::type.
00245         ptr< ss_type > type_get() const;
00246 
00247         //! The method type_set sets the field initializer_clause_converter::type to the given value.
00248         void type_set(const ptr< ss_type > &);
00249 
00250         //! The method result_get returns the value of the field initializer_clause_converter::result.
00251         ptr< expr_list > result_get() const;
00252 
00253         //! The method result_set sets the field initializer_clause_converter::result to the given value.
00254         void result_set(const ptr< expr_list > &);
00255 
00256         virtual void visit_as_initializer_clause_expression(ptr< ::lestes::lang::cplus::sem::as_initializer_clause_expression > );
00257 
00258         virtual void visit_as_initializer_clause_braced(ptr< ::lestes::lang::cplus::sem::as_initializer_clause_braced > );
00259 
00260         
00261         //! First generated factory method for class initializer_clause_converter.
00262         static ptr< initializer_clause_converter > create (
00263                 ptr< ss_sp > a__initializer_clause_converter__psp,
00264                 ptr< ss_sp > a__initializer_clause_converter__nsp,
00265                 ptr< ::lestes::std::list< srp< ss_sp > > > a__initializer_clause_converter__sps,
00266                 ptr< ss_type > a__initializer_clause_converter__type,
00267                 ptr< expr_list > a__initializer_clause_converter__result);
00268 
00269         //! Second generated factory method for class initializer_clause_converter.
00270         static ptr< initializer_clause_converter > create (
00271                 ptr< ss_sp > a__initializer_clause_converter__psp,
00272                 ptr< ss_sp > a__initializer_clause_converter__nsp,
00273                 ptr< ::lestes::std::list< srp< ss_sp > > > a__initializer_clause_converter__sps,
00274                 ptr< ss_type > a__initializer_clause_converter__type);
00275 
00276         
00277         //! "visit-return" method
00278         ptr< expr_list > process( const ptr< ::lestes::lang::cplus::sem::as_initializer_clause > & );
00279 
00280         //! for purposes of dumping
00281         virtual ptr<reflection_list> reflection_get() const;
00282         //! for purposes of dumping
00283         virtual ptr<field_list_list> field_values_get() const;
00284         
00285 protected:
00286         //! Generated constructor for class initializer_clause_converter.
00287         initializer_clause_converter (
00288                 ptr< ss_sp > a__initializer_clause_converter__psp,
00289                 ptr< ss_sp > a__initializer_clause_converter__nsp,
00290                 ptr< ::lestes::std::list< srp< ss_sp > > > a__initializer_clause_converter__sps,
00291                 ptr< ss_type > a__initializer_clause_converter__type,
00292                 ptr< expr_list > a__initializer_clause_converter__result);
00293 
00294         //! Marking routine for class initializer_clause_converter. 
00295         virtual void gc_mark();
00296 
00297 private:
00298         srp< ss_sp > psp;
00299         srp< ss_sp > nsp;
00300         srp< ::lestes::std::list< srp< ss_sp > > >  sps;
00301         srp< ss_type > type;
00302         srp< expr_list > result;
00303         static ptr<reflection_list> reflection;
00304         
00305 }; // initializer_clause_converter
00306 
00307 
00308 class condition_to_expression : public as_condition_visitor {
00309 public:
00310         //! The method psp_get returns the value of the field condition_to_expression::psp.
00311         ptr< ss_sp > psp_get() const;
00312 
00313         //! The method psp_set sets the field condition_to_expression::psp to the given value.
00314         void psp_set(const ptr< ss_sp > &);
00315 
00316         //! The method nsp_get returns the value of the field condition_to_expression::nsp.
00317         ptr< ss_sp > nsp_get() const;
00318 
00319         //! The method nsp_set sets the field condition_to_expression::nsp to the given value.
00320         void nsp_set(const ptr< ss_sp > &);
00321 
00322         //! The method sps_get returns the value of the field condition_to_expression::sps.
00323         ptr< ::lestes::std::list< srp< ss_sp > > > sps_get() const;
00324 
00325         //! The method sps_set sets the field condition_to_expression::sps to the given value.
00326         void sps_set(const ptr< ::lestes::std::list< srp< ss_sp > > > & );
00327 
00328         //! The method result_get returns the value of the field condition_to_expression::result.
00329         ptr< ss_expression > result_get() const;
00330 
00331         //! The method result_set sets the field condition_to_expression::result to the given value.
00332         void result_set(const ptr< ss_expression > &);
00333 
00334         virtual void visit_as_empty_condition(ptr< ::lestes::lang::cplus::sem::as_empty_condition > );
00335 
00336         virtual void visit_as_condition_expression(ptr< ::lestes::lang::cplus::sem::as_condition_expression > );
00337 
00338         virtual void visit_as_condition_declaration(ptr< ::lestes::lang::cplus::sem::as_condition_declaration > );
00339 
00340         
00341         //! First generated factory method for class condition_to_expression.
00342         static ptr< condition_to_expression > create (
00343                 ptr< ss_sp > a__condition_to_expression__psp,
00344                 ptr< ss_sp > a__condition_to_expression__nsp,
00345                 ptr< ::lestes::std::list< srp< ss_sp > > > a__condition_to_expression__sps,
00346                 ptr< ss_expression > a__condition_to_expression__result);
00347 
00348         //! Second generated factory method for class condition_to_expression.
00349         static ptr< condition_to_expression > create (
00350                 ptr< ss_sp > a__condition_to_expression__psp,
00351                 ptr< ss_sp > a__condition_to_expression__nsp,
00352                 ptr< ::lestes::std::list< srp< ss_sp > > > a__condition_to_expression__sps);
00353 
00354         
00355         //! "visit-return" method
00356         ptr< ss_expression > process( const ptr< ::lestes::lang::cplus::sem::as_condition > & );
00357 
00358         //! for purposes of dumping
00359         virtual ptr<reflection_list> reflection_get() const;
00360         //! for purposes of dumping
00361         virtual ptr<field_list_list> field_values_get() const;
00362         
00363 protected:
00364         //! Generated constructor for class condition_to_expression.
00365         condition_to_expression (
00366                 ptr< ss_sp > a__condition_to_expression__psp,
00367                 ptr< ss_sp > a__condition_to_expression__nsp,
00368                 ptr< ::lestes::std::list< srp< ss_sp > > > a__condition_to_expression__sps,
00369                 ptr< ss_expression > a__condition_to_expression__result);
00370 
00371         //! Marking routine for class condition_to_expression. 
00372         virtual void gc_mark();
00373 
00374 private:
00375         srp< ss_sp > psp;
00376         srp< ss_sp > nsp;
00377         srp< ::lestes::std::list< srp< ss_sp > > >  sps;
00378         srp< ss_expression > result;
00379         static ptr<reflection_list> reflection;
00380         
00381 }; // condition_to_expression
00382 
00383 
00384 //! Visitor to transform AS expressions to SS and convert them to given type.
00385 class sa_expression_converter : public abstract_sa_expression_converter {
00386 public:
00387         //! The method alpha_get returns the value of the field sa_expression_converter::alpha.
00388         ptr< ss_sp > alpha_get() const;
00389 
00390         //! The method alpha_set sets the field sa_expression_converter::alpha to the given value.
00391         void alpha_set(const ptr< ss_sp > &);
00392 
00393         //! The method beta_get returns the value of the field sa_expression_converter::beta.
00394         ptr< ss_sp > beta_get() const;
00395 
00396         //! The method beta_set sets the field sa_expression_converter::beta to the given value.
00397         void beta_set(const ptr< ss_sp > &);
00398 
00399         //! The method sps_get returns the value of the field sa_expression_converter::sps.
00400         ptr< ::lestes::std::list< srp< ss_sp > > > sps_get() const;
00401 
00402         //! The method sps_set sets the field sa_expression_converter::sps to the given value.
00403         void sps_set(const ptr< ::lestes::std::list< srp< ss_sp > > > & );
00404 
00405         //! The method type_get returns the value of the field sa_expression_converter::type.
00406         ptr< ss_type > type_get() const;
00407 
00408         //! The method type_set sets the field sa_expression_converter::type to the given value.
00409         void type_set(const ptr< ss_type > &);
00410 
00411         //! The method result_get returns the value of the field sa_expression_converter::result.
00412         ptr< ss_expression > result_get() const;
00413 
00414         //! The method result_set sets the field sa_expression_converter::result to the given value.
00415         void result_set(const ptr< ss_expression > &);
00416 
00417         virtual void visit_as_empty_expression(ptr< ::lestes::lang::cplus::sem::as_empty_expression > );
00418 
00419         virtual void convert(ptr< ::lestes::lang::cplus::sem::as_expression > );
00420 
00421         
00422         //! First generated factory method for class sa_expression_converter.
00423         static ptr< sa_expression_converter > create (
00424                 ptr< ss_sp > a__sa_expression_converter__alpha,
00425                 ptr< ss_sp > a__sa_expression_converter__beta,
00426                 ptr< ::lestes::std::list< srp< ss_sp > > > a__sa_expression_converter__sps,
00427                 ptr< ss_type > a__sa_expression_converter__type,
00428                 ptr< ss_expression > a__sa_expression_converter__result);
00429 
00430         //! Second generated factory method for class sa_expression_converter.
00431         static ptr< sa_expression_converter > create (
00432                 ptr< ss_sp > a__sa_expression_converter__alpha,
00433                 ptr< ss_sp > a__sa_expression_converter__beta,
00434                 ptr< ::lestes::std::list< srp< ss_sp > > > a__sa_expression_converter__sps);
00435 
00436         
00437         //! "visit-return" method
00438         ptr< ss_expression > process( const ptr< ::lestes::lang::cplus::sem::as_expression > & );
00439 
00440         //! for purposes of dumping
00441         virtual ptr<reflection_list> reflection_get() const;
00442         //! for purposes of dumping
00443         virtual ptr<field_list_list> field_values_get() const;
00444         
00445 protected:
00446         //! Generated constructor for class sa_expression_converter.
00447         sa_expression_converter (
00448                 ptr< ss_sp > a__sa_expression_converter__alpha,
00449                 ptr< ss_sp > a__sa_expression_converter__beta,
00450                 ptr< ::lestes::std::list< srp< ss_sp > > > a__sa_expression_converter__sps,
00451                 ptr< ss_type > a__sa_expression_converter__type,
00452                 ptr< ss_expression > a__sa_expression_converter__result);
00453 
00454         //! Marking routine for class sa_expression_converter. 
00455         virtual void gc_mark();
00456 
00457 private:
00458         srp< ss_sp > alpha;
00459         srp< ss_sp > beta;
00460         srp< ::lestes::std::list< srp< ss_sp > > >  sps;
00461         srp< ss_type > type;
00462         srp< ss_expression > result;
00463         static ptr<reflection_list> reflection;
00464         
00465 }; // sa_expression_converter
00466 
00467 
00468 //! If the declaration is a fake declaration, this visitor gets a real declaration from it. Otherwise it returns its input.
00469 class get_real_declaration : public ss_declaration_default_visitor {
00470 public:
00471         //! The method result_get returns the value of the field get_real_declaration::result.
00472         ptr< ss_declaration > result_get() const;
00473 
00474         //! The method result_set sets the field get_real_declaration::result to the given value.
00475         void result_set(const ptr< ss_declaration > &);
00476 
00477         virtual void visit_ss_fake_declaration(ptr< ::lestes::lang::cplus::sem::ss_fake_declaration > );
00478 
00479         virtual void default_action(ptr< ::lestes::lang::cplus::sem::ss_declaration > );
00480 
00481         
00482         //! Generated instance() method for singleton class get_real_declaration.
00483         static ptr< get_real_declaration > instance ();
00484 
00485         
00486         //! "visit-return" method
00487         ptr< ss_declaration > process( const ptr< ::lestes::lang::cplus::sem::ss_declaration > & );
00488 
00489         //! for purposes of dumping
00490         virtual ptr<reflection_list> reflection_get() const;
00491         //! for purposes of dumping
00492         virtual ptr<field_list_list> field_values_get() const;
00493         
00494 protected:
00495         //! Generated constructor for class get_real_declaration.
00496         get_real_declaration (
00497                 ptr< ss_declaration > a__get_real_declaration__result);
00498 
00499         //! Marking routine for class get_real_declaration. 
00500         virtual void gc_mark();
00501 
00502 private:
00503         srp< ss_declaration > result;
00504         static ptr<reflection_list> reflection;
00505         static ptr<get_real_declaration> the_instance;
00506         
00507 }; // get_real_declaration
00508 
00509 
00510 end_package(sem);
00511 end_package(cplus);
00512 end_package(lang);
00513 end_package(lestes);
00514 
00515 #endif // lestes__lang__cplus__sem__sa_statements_g_hh__included

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