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

Public Types | |
| typedef lstring | string_type |
| Type of string. | |
| typedef string_type::size_type | index_type |
| Type of index into the string. | |
Public Member Functions | |
| ptr< ucn_token > | read (void) |
| Reads one token from string. | |
Static Public Member Functions | |
| static ptr< string_source > | create (const string_type &a_str) |
| Returns new instance, initializes with string. | |
Protected Member Functions | |
| string_source (const string_type &a_str) | |
| Creates the object, initializes with string. | |
Private Member Functions | |
| string_source (const string_source &) | |
| Hides copy constructor. | |
| string_source & | operator= (const string_source &) |
| Hides assignment operator. | |
Private Attributes | |
| string_type | str |
| String to read from. | |
| index_type | idx |
| Position in string. | |
Represents data source reading from host character string.
Definition at line 51 of file string_source.hh.
| typedef lstring lestes::lang::cplus::lex::string_source::string_type |
| typedef string_type::size_type lestes::lang::cplus::lex::string_source::index_type |
| lestes::lang::cplus::lex::string_source::string_source | ( | const string_type & | a_str | ) | [protected] |
| lestes::lang::cplus::lex::string_source::string_source | ( | const string_source & | ) | [private] |
Hides copy constructor.
| ptr< ucn_token > lestes::lang::cplus::lex::string_source::read | ( | void | ) | [virtual] |
Reads one token from string.
Reads next token from string.
Implements lestes::lang::cplus::lex::ucn_filter.
Definition at line 59 of file string_source.cc.
References lestes::lang::cplus::lex::ucn_token::create(), idx, str, lestes::lang::cplus::lex::ucn_token::TOK_EOF, and lestes::lang::cplus::lex::ucn_token::TOK_NOT_EOF.
00060 { 00061 ptr<ucn_token> t; 00062 00063 if (idx >= str.length()) { 00064 t = ucn_token::create(ucn_token::TOK_EOF,character::create_external(0)); 00065 } else { 00066 // note that the meaning of real types is not clear at this stage 00067 hchar c = str.at(idx); 00068 idx++; 00069 // do not interpret the encoding yet 00070 t = ucn_token::create(ucn_token::TOK_NOT_EOF,character::create_external(static_cast<unsigned char>(c))); 00071 } 00072 00073 return t; 00074 }
| ptr< string_source > lestes::lang::cplus::lex::string_source::create | ( | const string_type & | a_str | ) | [static] |
Returns new instance, initializes with string.
Returns new instance, initializes with string.
| a_str | The source string. |
Definition at line 81 of file string_source.cc.
References string_source().
00082 { 00083 return new string_source(a_str); 00084 }
| string_source& lestes::lang::cplus::lex::string_source::operator= | ( | const string_source & | ) | [private] |
Hides assignment operator.
1.5.1-20070107