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

Public Types | |
| enum | mode_type { NORMAL, DIRECTIVE, FILE_END } |
| The modes of input. More... | |
Public Member Functions | |
| ptr< token_sequence > | read_line (void) |
| Reads line from input. | |
| ptr< token_sequence > | read_expanded (void) |
| Reads expanded line from input. | |
| mode_type | mode_get (void) |
| Returns input mode. | |
Static Public Member Functions | |
| static ptr< expander > | create (const ptr< pp_filter > &a_input, const ptr< macro_storage > &a_macros) |
| Returns new expander. | |
Protected Member Functions | |
| expander (const ptr< pp_filter > &a_input, const ptr< macro_storage > &a_macros) | |
| Creates new expander. | |
| virtual void | gc_mark (void) |
| Marks the object. | |
Private Attributes | |
| srp< macro_storage > | macros |
| The macro storage for expansion. | |
| srp< token_stream > | stream |
| The stream connected to input. | |
Performs reading of possibly expanded lines of tokens.
Definition at line 54 of file expander.hh.
| lestes::lang::cplus::lex::expander::expander | ( | const ptr< pp_filter > & | a_input, | |
| const ptr< macro_storage > & | a_macros | |||
| ) | [protected] |
Creates new expander.
Creates new expander.
a_macros != NULL
Definition at line 54 of file expander.cc.
Referenced by create().
00054 : 00055 macros(checked(a_macros)), 00056 stream(token_stream::create(checked(a_input))) 00057 { 00058 }
| ptr< token_sequence > lestes::lang::cplus::lex::expander::read_line | ( | void | ) |
Reads line from input.
Returns the next line without expansion.
Definition at line 83 of file expander.cc.
References stream.
00084 { 00085 return stream->read_line(); 00086 }
| ptr< token_sequence > lestes::lang::cplus::lex::expander::read_expanded | ( | void | ) |
| expander::mode_type lestes::lang::cplus::lex::expander::mode_get | ( | void | ) |
Returns input mode.
Returns current mode of the input.
Definition at line 64 of file expander.cc.
References DIRECTIVE, FILE_END, NORMAL, stream, lestes::lang::cplus::lex::pp_token::TOK_HASH, and lestes::lang::cplus::lex::pp_token::TOK_TERMINATOR.
00065 { 00066 ptr<pp_token> tok = stream->peek_front(); 00067 00068 switch (tok->type_get()) { 00069 case pp_token::TOK_HASH: 00070 return DIRECTIVE; 00071 case pp_token::TOK_TERMINATOR: 00072 return FILE_END; 00073 default: 00074 break; 00075 } 00076 return NORMAL; 00077 }
| ptr< expander > lestes::lang::cplus::lex::expander::create | ( | const ptr< pp_filter > & | a_input, | |
| const ptr< macro_storage > & | a_macros | |||
| ) | [static] |
Returns new expander.
Returns new expander.
a_macros != NULL
Definition at line 105 of file expander.cc.
References expander().
00106 { 00107 return new expander(a_input,a_macros); 00108 }
| void lestes::lang::cplus::lex::expander::gc_mark | ( | void | ) | [protected, virtual] |
Marks the object.
Marks the object.
Reimplemented from lestes::std::mem::keystone.
Definition at line 113 of file expander.cc.
References macros, and stream.
srp<macro_storage> lestes::lang::cplus::lex::expander::macros [private] |
The macro storage for expansion.
Definition at line 80 of file expander.hh.
Referenced by gc_mark(), and read_expanded().
srp<token_stream> lestes::lang::cplus::lex::expander::stream [private] |
The stream connected to input.
Definition at line 82 of file expander.hh.
Referenced by gc_mark(), mode_get(), read_expanded(), and read_line().
1.5.1-20070107