Canola
0.8.D001
|
#include <lexer.h>
Classes | |
class | source |
Public Member Functions | |
virtual | ~lexer () |
lexer (const std::string &filename, calculator &subject) | |
bool | read_and_execute (void) |
bool | read_binary_and_execute (void) |
void | test_mode_set (bool state=true) |
Static Public Member Functions | |
static void | search_path_append (const std::string &dir) |
Private Types | |
typedef boost::shared_ptr < lexer_functor > | functor_pointer |
typedef std::map< std::string, functor_pointer > | names_t |
Private Member Functions | |
void | close (void) |
bool | next_is (char c) |
bool | next_is (const char *s) |
int | getch (void) |
void | ungetch (int c) |
void | error (const char *fmt,...) |
void | open_include_file (const std::string &filename) |
void | load_names (void) |
location::pointer | get_location (void) const |
location::pointer | get_location (const location::pointer &start) const |
void | process_comment (const std::string &text) |
lexer () | |
lexer (const lexer &) | |
lexer & | operator= (const lexer &) |
Private Attributes | |
calculator & | subject |
std::list< source::pointer > | src |
bool | test_mode |
names_t | names |
bool | card_properties_active |
bool | ok |
Static Private Attributes | |
static search_path | include_search_path |
The lexer class is used to represent the processing required to read and understand a script file. This file contains mnem,onics for each of the keys, and passes them to a calculator instance to execute.
typedef boost::shared_ptr<lexer_functor> lexer::functor_pointer [private] |
typedef std::map<std::string, functor_pointer> lexer::names_t [private] |
lexer::~lexer | ( | ) | [virtual] |
lexer::lexer | ( | const std::string & | filename, |
calculator & | subject | ||
) |
lexer::lexer | ( | ) | [private] |
The default constructor. Do not use.
lexer::lexer | ( | const lexer & | ) | [private] |
The copy constructor. Do not use.
void lexer::close | ( | void | ) | [private] |
void lexer::error | ( | const char * | fmt, |
... | |||
) | [private] |
location::pointer lexer::get_location | ( | void | ) | const [private] |
location::pointer lexer::get_location | ( | const location::pointer & | start | ) | const [private] |
int lexer::getch | ( | void | ) | [private] |
void lexer::load_names | ( | void | ) | [private] |
bool lexer::next_is | ( | char | c | ) | [private] |
bool lexer::next_is | ( | const char * | s | ) | [private] |
void lexer::open_include_file | ( | const std::string & | filename | ) | [private] |
void lexer::process_comment | ( | const std::string & | text | ) | [private] |
bool lexer::read_and_execute | ( | void | ) |
bool lexer::read_binary_and_execute | ( | void | ) |
void lexer::search_path_append | ( | const std::string & | dir | ) | [static] |
void lexer::test_mode_set | ( | bool | state = true | ) |
The test_mode_set method is used to force the lexer into "test mode" where you can enter more things to drive the calculator state. Must be called before the read_and_execute method to have any effect.
state | The state of test_mode to set |
void lexer::ungetch | ( | int | c | ) | [private] |
bool lexer::card_properties_active [private] |
search_path lexer::include_search_path [static, private] |
names_t lexer::names [private] |
bool lexer::ok [private] |
std::list<source::pointer> lexer::src [private] |
calculator& lexer::subject [private] |
bool lexer::test_mode [private] |