#include <unit_part.hh>
Inheritance diagram for lestes::lang::cplus::lex::unit_part:

Public Member Functions | |
| void | start_of_line (void) |
| Sets start of line flag. | |
| ptr< condition_stack > | conditions_get (void) const |
| Returns associated condition stack. | |
| ptr< expander > | expander_get (void) const |
| Returs associated expander. | |
| ptr< line_control > | line_control_get (void) const |
| Returs the line control. | |
| ptr< pp_token > | read (void) |
| Reads next token. | |
Static Public Member Functions | |
| static ptr< unit_part > | create (const ptr< file_info > &a_file, const ptr< data_source > &a_data, const ptr< encoder > &a_encoder, const ptr< macro_storage > &a_macros) |
| Returns new unit, initializes with file information, data source and encoder. | |
Protected Member Functions | |
| unit_part (const ptr< file_info > &a_file, const ptr< data_source > &a_data, const ptr< encoder > &a_encoder, const ptr< macro_storage > &a_macros) | |
| Creates new unit, initializes with file information, data source and encoding. | |
| virtual void | gc_mark (void) |
| Marks the object. | |
Private Member Functions | |
| unit_part (const unit_part &) | |
| Hides copy constructor. | |
| unit_part & | operator= (const unit_part &) |
| Hides assignment operator. | |
Private Attributes | |
| bool | start |
| Start of line flag. | |
| srp< condition_stack > | conditions |
| Conditions stack. | |
| srp< encoder > | enc |
| Character set encoder. | |
| srp< data_source > | ds |
| Data source. | |
| srp< pre_lex > | plx |
| Operations prior to lexical analysis. | |
| srp< line_control > | lic |
| Line control. | |
| srp< pp_lex > | ppl |
| Flex wrapper. | |
| srp< expander > | exp |
| Expander. | |
Represents a part of translation unit, which is either the original source file itself, or any file included by the source file.
Definition at line 69 of file unit_part.hh.
| lestes::lang::cplus::lex::unit_part::unit_part | ( | const ptr< file_info > & | a_file, | |
| const ptr< data_source > & | a_data, | |||
| const ptr< encoder > & | a_encoder, | |||
| const ptr< macro_storage > & | a_macros | |||
| ) | [protected] |
Creates new unit, initializes with file information, data source and encoding.
Creates the object.
a_data != NULL
a_encoder != NULL
a_macros != NULL
| a_file | The file information. | |
| a_data | The data source. | |
| a_encoder | The encoder for the source. | |
| a_macros | The defined macros. |
Definition at line 65 of file unit_part.cc.
Referenced by create().
00066 : 00067 start(false), 00068 conditions(condition_stack::create()), 00069 enc(checked(a_encoder)), 00070 ds(checked(a_data)), 00071 plx(pre_lex::create(ds,enc)), 00072 lic(line_control::create(checked(a_file))), 00073 ppl(pp_lex::create(plx,lic)), 00074 exp(expander::create(this,checked(a_macros))) 00075 { 00076 }
| lestes::lang::cplus::lex::unit_part::unit_part | ( | const unit_part & | ) | [private] |
Hides copy constructor.
| void lestes::lang::cplus::lex::unit_part::start_of_line | ( | void | ) |
| ptr< condition_stack > lestes::lang::cplus::lex::unit_part::conditions_get | ( | void | ) | const |
Returns associated condition stack.
Returns associated condition stack.
Definition at line 99 of file unit_part.cc.
References conditions.
00100 { 00101 return conditions; 00102 }
| ptr< expander > lestes::lang::cplus::lex::unit_part::expander_get | ( | void | ) | const |
| ptr< line_control > lestes::lang::cplus::lex::unit_part::line_control_get | ( | void | ) | const |
Returs the line control.
Returns the associated line control.
Definition at line 118 of file unit_part.cc.
References lic.
00119 { 00120 return lic; 00121 }
| ptr< pp_token > lestes::lang::cplus::lex::unit_part::read | ( | void | ) | [virtual] |
Reads next token.
Reads next token from the unit part. Updates token location by the relative location.
Implements lestes::lang::cplus::lex::pp_filter.
Definition at line 144 of file unit_part.cc.
00145 { 00146 // TODO pt check and emit errors, with changed locations 00147 // if (ppl->has_errors()) { 00148 // ppl->errors_get(); 00149 // process 00150 // } 00151 00152 ptr<pp_token> tok = ppl->read(start); 00153 start = false; 00154 00155 // TODO pt update location 00156 // what the hell ??? 00157 // this is obsolete 00158 00159 return tok; 00160 }
| ptr< unit_part > lestes::lang::cplus::lex::unit_part::create | ( | const ptr< file_info > & | a_file, | |
| const ptr< data_source > & | a_data, | |||
| const ptr< encoder > & | a_encoder, | |||
| const ptr< macro_storage > & | a_macros | |||
| ) | [static] |
Returns new unit, initializes with file information, data source and encoder.
Returns new instance, initializes with file information, stream and encoding.
| a_file | The file information for the unit part. | |
| a_data | The data source. | |
| a_encoder | The encoder for the source. | |
| a_macros | The defined macros. |
Definition at line 185 of file unit_part.cc.
References unit_part().
Referenced by lestes::lang::cplus::lex::evaluator::push_stream().
00188 { 00189 return new unit_part(a_file,a_data,a_encoder,a_macros); 00190 }
| void lestes::lang::cplus::lex::unit_part::gc_mark | ( | void | ) | [protected, virtual] |
Marks the object.
Marks the object.
Reimplemented from lestes::lang::cplus::lex::pp_filter.
Definition at line 165 of file unit_part.cc.
References conditions, ds, enc, exp, lestes::lang::cplus::lex::pp_filter::gc_mark(), lic, plx, and ppl.
00166 { 00167 conditions.gc_mark(); 00168 enc.gc_mark(); 00169 ds.gc_mark(); 00170 plx.gc_mark(); 00171 lic.gc_mark(); 00172 ppl.gc_mark(); 00173 exp.gc_mark(); 00174 pp_filter::gc_mark(); 00175 }
Hides assignment operator.
bool lestes::lang::cplus::lex::unit_part::start [private] |
Start of line flag.
Definition at line 105 of file unit_part.hh.
Referenced by read(), and start_of_line().
srp<condition_stack> lestes::lang::cplus::lex::unit_part::conditions [private] |
Conditions stack.
Definition at line 107 of file unit_part.hh.
Referenced by conditions_get(), and gc_mark().
srp<encoder> lestes::lang::cplus::lex::unit_part::enc [private] |
srp<data_source> lestes::lang::cplus::lex::unit_part::ds [private] |
srp<pre_lex> lestes::lang::cplus::lex::unit_part::plx [private] |
Operations prior to lexical analysis.
Definition at line 113 of file unit_part.hh.
Referenced by gc_mark().
srp<line_control> lestes::lang::cplus::lex::unit_part::lic [private] |
Line control.
Definition at line 115 of file unit_part.hh.
Referenced by gc_mark(), and line_control_get().
srp<pp_lex> lestes::lang::cplus::lex::unit_part::ppl [private] |
srp<expander> lestes::lang::cplus::lex::unit_part::exp [private] |
1.5.1-20070107