#include <sa_statements.g.hh>
Inheritance diagram for lestes::lang::cplus::sem::sa_statements:

Public Member Functions | |
| ptr< ss_function_declaration > | current_function_get () const |
| The method current_function_get returns the value of the field sa_statements::current_function. | |
| void | current_function_set (const ptr< ss_function_declaration > &) |
| The method current_function_set sets the field sa_statements::current_function to the given value. | |
| ptr< ss_declaration > | last_declaration_get () const |
| The method last_declaration_get returns the value of the field sa_statements::last_declaration. | |
| void | last_declaration_set (const ptr< ss_declaration > &) |
| The method last_declaration_set sets the field sa_statements::last_declaration to the given value. | |
| void | declarator_simple (ptr< ::lestes::std::source_location > loc) |
| void | declarator_init (ptr< ::lestes::std::source_location > loc, ptr< as_initializer_clause > inizer) |
| void | declarator_ctor (ptr< ::lestes::std::source_location > loc, ptr< as_expression_list > inizer) |
| void | enter_function (ptr< ::lestes::std::source_location > loc, ptr< as_function_definition > as_func) |
| Create new function scope, switch context into it. | |
| void | leave_function () |
| Leave function created using enter_function. | |
| void | enter_scope (ptr< ::lestes::std::source_location > loc) |
| Create new ss_compound_stmt with all the stuff and switch context into it. | |
| void | leave_scope () |
| Leave scope created using enter_scope. | |
| void | insert_fake_declaration (ptr< ss_declaration > decl) |
| Given declaration should have a fake in current scope. | |
| void | expression_stmt (ptr< as_expression > as) |
| Make ss_expr_stmt from as_expression_statement. | |
| void | return_stmt (ptr< as_return_statement > as) |
| Make ss_return from as_return_statement. | |
| void | if_head (ptr< ::lestes::std::source_location > loc, ptr< as_condition > cond) |
| void | while_head (ptr< ::lestes::std::source_location > loc, ptr< as_condition > cond) |
| void | for_head (ptr< ::lestes::std::source_location > loc, ptr< as_condition > cond, ptr< as_expression > iter) |
| void | for_inner_action (ptr< ::lestes::std::source_location > loc) |
| void | condition_decl (ptr< ::lestes::std::source_location > loc, ptr< as_expression > inizer) |
| void | enter_subcompound (ptr< ss_compound_stmt > scope) |
| Switch context into given subscope and optionally insert a fake declaration. | |
| void | enter_else () |
| ptr< ss_compound_stmt > | new_compound (ptr< ::lestes::std::source_location > loc) |
| virtual ptr< reflection_list > | reflection_get () const |
| for purposes of dumping | |
| virtual ptr< field_list_list > | field_values_get () const |
| for purposes of dumping | |
Static Public Member Functions | |
| static ptr< sa_statements > | instance () |
| Generated instance() method for singleton class sa_statements. | |
Protected Member Functions | |
| sa_statements (ptr< ss_function_declaration > a__sa_statements__current_function, ptr< ss_declaration > a__sa_statements__last_declaration) | |
| Generated constructor for class sa_statements. | |
| virtual void | gc_mark () |
| Marking routine for class sa_statements. | |
Private Attributes | |
| srp< ss_function_declaration > | current_function |
| srp< ss_declaration > | last_declaration |
Static Private Attributes | |
| static ptr< reflection_list > | reflection = reflection |
| static ptr< sa_statements > | the_instance = the_instance |
Definition at line 75 of file sa_statements.g.hh.
| lestes::lang::cplus::sem::sa_statements::sa_statements | ( | ptr< ss_function_declaration > | a__sa_statements__current_function, | |
| ptr< ss_declaration > | a__sa_statements__last_declaration | |||
| ) | [protected] |
Generated constructor for class sa_statements.
Generated constructor for class sa_statements.
Definition at line 67 of file sa_statements.g.cc.
Referenced by instance().
00069 : object(), current_function(a__sa_statements__current_function), last_declaration(a__sa_statements__last_declaration) 00070 {}
| ptr< ss_function_declaration > lestes::lang::cplus::sem::sa_statements::current_function_get | ( | ) | const |
The method current_function_get returns the value of the field sa_statements::current_function.
Definition at line 31 of file sa_statements.g.cc.
References current_function.
00032 { 00033 return current_function; 00034 }
| void lestes::lang::cplus::sem::sa_statements::current_function_set | ( | const ptr< ss_function_declaration > & | x | ) |
The method current_function_set sets the field sa_statements::current_function to the given value.
| [in] | x | The new value to set sa_statements::current_function to. |
Definition at line 40 of file sa_statements.g.cc.
References current_function.
Referenced by leave_function().
00041 { 00042 sa_statements::current_function = x; 00043 }
| ptr< ss_declaration > lestes::lang::cplus::sem::sa_statements::last_declaration_get | ( | ) | const |
The method last_declaration_get returns the value of the field sa_statements::last_declaration.
Definition at line 49 of file sa_statements.g.cc.
References last_declaration.
00050 { 00051 return last_declaration; 00052 }
| void lestes::lang::cplus::sem::sa_statements::last_declaration_set | ( | const ptr< ss_declaration > & | x | ) |
The method last_declaration_set sets the field sa_statements::last_declaration to the given value.
| [in] | x | The new value to set sa_statements::last_declaration to. |
Definition at line 58 of file sa_statements.g.cc.
References last_declaration.
00059 { 00060 sa_statements::last_declaration = x; 00061 }
| void lestes::lang::cplus::sem::sa_statements::declarator_simple | ( | ptr< ::lestes::std::source_location > | loc | ) |
| void lestes::lang::cplus::sem::sa_statements::declarator_init | ( | ptr< ::lestes::std::source_location > | loc, | |
| ptr< as_initializer_clause > | inizer | |||
| ) |
| void lestes::lang::cplus::sem::sa_statements::declarator_ctor | ( | ptr< ::lestes::std::source_location > | loc, | |
| ptr< as_expression_list > | inizer | |||
| ) |
| void lestes::lang::cplus::sem::sa_statements::enter_function | ( | ptr< ::lestes::std::source_location > | loc, | |
| ptr< as_function_definition > | as_func | |||
| ) |
Create new function scope, switch context into it.
| void lestes::lang::cplus::sem::sa_statements::leave_function | ( | ) |
Leave function created using enter_function.
Definition at line 312 of file sa_statements.cc.
References current_function_set(), DISAMB, and lestes::lang::cplus::sem::sa_context_manager::instance().
00313 { 00314 DISAMB; 00315 sa_statements_logger << "leaving function\n" << msg::eolog; 00316 current_function_set(NULL); 00317 sa_context_manager::instance()->pop(); 00318 }
| void lestes::lang::cplus::sem::sa_statements::enter_scope | ( | ptr< ::lestes::std::source_location > | loc | ) |
Create new ss_compound_stmt with all the stuff and switch context into it.
| void lestes::lang::cplus::sem::sa_statements::leave_scope | ( | ) |
Leave scope created using enter_scope.
Definition at line 373 of file sa_statements.cc.
References current_compound, DISAMB, lestes::lang::cplus::sem::sa_context_manager::instance(), lestes::lang::cplus::sem::ss_compound_stmt::NO_LEAVE, and lestes::lang::cplus::sem::ss_compound_stmt::NORMAL.
00374 { 00375 DISAMB; 00376 if (current_compound->behavior_get() == ss_compound_stmt::NO_LEAVE ) { 00377 current_compound->behavior_set(ss_compound_stmt::NORMAL); 00378 sa_statements_logger << "not leaving scope\n" << msg::eolog; 00379 return; 00380 } 00381 sa_statements_logger << "leaving scope\n" << msg::eolog; 00382 sa_context_manager::instance()->pop(); 00383 }
| void lestes::lang::cplus::sem::sa_statements::insert_fake_declaration | ( | ptr< ss_declaration > | decl | ) |
Given declaration should have a fake in current scope.
Definition at line 385 of file sa_statements.cc.
References lestes::intercode::intercode::create(), current_decl_seq, and lestes::lang::cplus::sem::get_real_declaration::instance().
Referenced by enter_subcompound().
00386 { 00387 ptr<ss_declaration> decl = get_real_declaration::instance()->process(input_decl); 00388 // fake is a copy of the original declaration 00389 ptr<ss_fake_declaration> fake = ss_fake_declaration::create( 00390 decl->location_get(), 00391 decl->visible_since_get(), 00392 decl->decl_time_get(), 00393 decl->name_get(), 00394 decl->contained_in_get(), 00395 decl->type_get(), 00396 decl->linkage_get(), 00397 decl.dncast<ss_object_declaration>() 00398 ); 00399 current_decl_seq->contents_get()->push_back(fake); 00400 }
| void lestes::lang::cplus::sem::sa_statements::expression_stmt | ( | ptr< as_expression > | as | ) |
Make ss_expr_stmt from as_expression_statement.
| void lestes::lang::cplus::sem::sa_statements::return_stmt | ( | ptr< as_return_statement > | as | ) |
Make ss_return from as_return_statement.
| void lestes::lang::cplus::sem::sa_statements::if_head | ( | ptr< ::lestes::std::source_location > | loc, | |
| ptr< as_condition > | cond | |||
| ) |
| void lestes::lang::cplus::sem::sa_statements::while_head | ( | ptr< ::lestes::std::source_location > | loc, | |
| ptr< as_condition > | cond | |||
| ) |
| void lestes::lang::cplus::sem::sa_statements::for_head | ( | ptr< ::lestes::std::source_location > | loc, | |
| ptr< as_condition > | cond, | |||
| ptr< as_expression > | iter | |||
| ) |
| void lestes::lang::cplus::sem::sa_statements::for_inner_action | ( | ptr< ::lestes::std::source_location > | loc | ) |
| void lestes::lang::cplus::sem::sa_statements::condition_decl | ( | ptr< ::lestes::std::source_location > | loc, | |
| ptr< as_expression > | inizer | |||
| ) |
| void lestes::lang::cplus::sem::sa_statements::enter_subcompound | ( | ptr< ss_compound_stmt > | scope | ) |
Switch context into given subscope and optionally insert a fake declaration.
Definition at line 740 of file sa_statements.cc.
References lestes::lang::cplus::sem::sa_context::create(), lestes::lang::cplus::sem::sa_ss_context::create(), lestes::intercode::intercode::create(), lestes::lang::cplus::sem::sa_as_context::create(), current_as, current_sa, current_ss, insert_fake_declaration(), lestes::lang::cplus::sem::sa_context_manager::instance(), and lassert.
Referenced by enter_else().
00741 { 00742 lassert(scope); 00743 sa_statements_logger << "entering subcompound\n" << msg::eolog; 00744 00745 // remember the declarations, if there are some 00746 ptr<decl_list> decls = scope->parent_get()->decl_seq_get()->contents_get(); 00747 00748 // switch context to the given scope 00749 ptr<sa_as_context> as = sa_as_context::create( 00750 as_name::create( 00751 scope->location_get(), 00752 NULL, 00753 as_empty_id::create(scope->location_get()) 00754 ), // FIXME? is dummy name all right? 00755 current_as->access_specifier_get() 00756 ); // create the as part of the new context 00757 ptr<sa_ss_context> ss = sa_ss_context::create( 00758 scope->decl_seq_get(), 00759 current_ss->access_specifier_get() 00760 ); // create the ss part of the new context 00761 ptr<sa_context> ctx = sa_context::create(as,ss,current_sa); 00762 sa_context_manager::instance()->push(ctx); // push the new context on context stack 00763 00764 for( decl_list::iterator i = decls->begin(); i!=decls->end(); i++ ) { 00765 sa_statements_logger << "creating fake declaration\n" << msg::eolog; 00766 // fake is a copy of the original declaration 00767 insert_fake_declaration(*i); 00768 } 00769 }
| void lestes::lang::cplus::sem::sa_statements::enter_else | ( | ) |
Definition at line 771 of file sa_statements.cc.
References DISAMB, enter_subcompound(), and lestes::lang::cplus::sem::sa_context_manager::instance().
00772 { 00773 DISAMB; 00774 enter_subcompound( 00775 sa_context_manager::instance()->current()->ss_get()->scope_get() 00776 ->compound_stmt_get()->statements_get()->back().dncast<ss_compound_stmt>() 00777 ); 00778 }
| ptr< ss_compound_stmt > lestes::lang::cplus::sem::sa_statements::new_compound | ( | ptr< ::lestes::std::source_location > | loc | ) |
| ptr< sa_statements > lestes::lang::cplus::sem::sa_statements::instance | ( | ) | [static] |
Generated instance() method for singleton class sa_statements.
Definition at line 104 of file sa_statements.cc.
References lestes::lang::cplus::sem::declaration_finished, lestes::msg::eolog, lestes::lang::cplus::sem::decl_stmt_listener::instance(), sa_statements(), and the_instance.
Referenced by lestes::lang::cplus::syn::do_it(), and lestes::lang::cplus::sem::or_or_functional_this::operator()().
00105 { 00106 if (the_instance) return the_instance; 00107 sa_statements_logger << "creating sa_statements instance\n" << msg::eolog; 00108 declaration_finished->attach(decl_stmt_listener::instance()); 00109 return the_instance = new sa_statements(NULL,NULL); 00110 }
| ptr< object::reflection_list > lestes::lang::cplus::sem::sa_statements::reflection_get | ( | ) | const [virtual] |
for purposes of dumping
Reimplemented from lestes::std::object.
Definition at line 72 of file sa_statements.g.cc.
References lestes::std::list< T >::create(), reflection, and lestes::std::object::reflection_get().
00073 { 00074 if (!reflection) { 00075 typedef class_reflection::field_metadata md; 00076 typedef class_reflection::field_metadata_list mdlist; 00077 ptr<mdlist> mdl = mdlist::create(); 00078 mdl->push_back( md::create( "current_function", "ss_function_declaration" ) ); 00079 mdl->push_back( md::create( "last_declaration", "ss_declaration" ) ); 00080 reflection = reflection_list::create( ::lestes::std::object::reflection_get() ); 00081 reflection->push_back( class_reflection::create( "sa_statements", mdl ) ); 00082 } 00083 return reflection; 00084 }
| ptr< object::field_list_list > lestes::lang::cplus::sem::sa_statements::field_values_get | ( | ) | const [virtual] |
for purposes of dumping
Reimplemented from lestes::std::object.
Definition at line 86 of file sa_statements.g.cc.
References lestes::std::list< T >::create(), and lestes::std::object::field_values_get().
00087 { 00088 ptr < field_list_list > result = ::lestes::std::object::field_values_get(); 00089 result->push_back( value_list::create() ); 00090 result->back()->push_back( this->current_function ); 00091 result->push_back( value_list::create() ); 00092 result->back()->push_back( this->last_declaration ); 00093 return result; 00094 }
| void lestes::lang::cplus::sem::sa_statements::gc_mark | ( | void | ) | [protected, virtual] |
Marking routine for class sa_statements.
Marking routine is used for garbage collection.
Reimplemented from lestes::std::mem::keystone.
Definition at line 101 of file sa_statements.g.cc.
References lestes::std::mem::keystone::gc_mark().
00102 { 00103 ::lestes::std::object::gc_mark(); 00104 }
Definition at line 154 of file sa_statements.g.hh.
Referenced by current_function_get(), and current_function_set().
srp< ss_declaration > lestes::lang::cplus::sem::sa_statements::last_declaration [private] |
Definition at line 155 of file sa_statements.g.hh.
Referenced by last_declaration_get(), and last_declaration_set().
ptr< object::reflection_list > lestes::lang::cplus::sem::sa_statements::reflection = reflection [static, private] |
Reimplemented from lestes::std::object.
Definition at line 156 of file sa_statements.g.hh.
Referenced by reflection_get().
ptr< sa_statements > lestes::lang::cplus::sem::sa_statements::the_instance = the_instance [static, private] |
1.5.1-20070107