openMSX
|
#include <Interpreter.hh>
Public Member Functions | |
Interpreter (const Interpreter &)=delete | |
Interpreter & | operator= (const Interpreter &)=delete |
Interpreter () | |
~Interpreter () | |
void | setOutput (InterpreterOutput *output_) |
void | init (const char *programName) |
bool | hasCommand (zstring_view name) const |
void | registerCommand (zstring_view name, Command &command) |
void | unregisterCommand (Command &command) |
TclObject | getCommandNames () |
bool | isComplete (zstring_view command) const |
TclObject | execute (zstring_view command) |
TclObject | executeFile (zstring_view filename) |
void | setVariable (const TclObject &name, const TclObject &value) |
void | unsetVariable (const char *name) |
void | registerSetting (BaseSetting &variable) |
void | unregisterSetting (BaseSetting &variable) |
void | createNamespace (const std::string &name) |
Create the global namespace with given name. More... | |
void | deleteNamespace (const std::string &name) |
Delete the global namespace with given name. More... | |
TclParser | parse (std::string_view command) |
void | poll () |
void | wrongNumArgs (unsigned argc, std::span< const TclObject > tokens, const char *message) |
Friends | |
class | TclObject |
Definition at line 18 of file Interpreter.hh.
|
delete |
openmsx::Interpreter::Interpreter | ( | ) |
Definition at line 77 of file Interpreter.cc.
References openmsx::FileOperations::getSystemDataDir(), openmsx::FileOperations::getUserDataDir(), setVariable(), and TclObject.
openmsx::Interpreter::~Interpreter | ( | ) |
Definition at line 110 of file Interpreter.cc.
References openmsx::MSXCPUInterface::cleanup().
void openmsx::Interpreter::createNamespace | ( | const std::string & | name | ) |
Create the global namespace with given name.
name | Name of the namespace, should not include '::' prefix. |
Definition at line 440 of file Interpreter.cc.
References execute(), and tmpStrCat().
Referenced by openmsx::MSXCommandController::MSXCommandController().
void openmsx::Interpreter::deleteNamespace | ( | const std::string & | name | ) |
Delete the global namespace with given name.
name | Name of the namespace, should not include '::' prefix. |
Definition at line 445 of file Interpreter.cc.
References execute(), and tmpStrCat().
Referenced by openmsx::MSXCommandController::~MSXCommandController().
TclObject openmsx::Interpreter::execute | ( | zstring_view | command | ) |
Definition at line 217 of file Interpreter.cc.
References zstring_view::c_str(), and TclObject.
Referenced by createNamespace(), deleteNamespace(), openmsx::GlobalCommandController::executeCommand(), and getCommandNames().
TclObject openmsx::Interpreter::executeFile | ( | zstring_view | filename | ) |
Definition at line 226 of file Interpreter.cc.
References zstring_view::c_str(), and TclObject.
Referenced by openmsx::GlobalCommandController::source().
TclObject openmsx::Interpreter::getCommandNames | ( | ) |
Definition at line 207 of file Interpreter.cc.
References execute().
bool openmsx::Interpreter::hasCommand | ( | zstring_view | name | ) | const |
Definition at line 149 of file Interpreter.cc.
References zstring_view::c_str().
Referenced by openmsx::CassettePlayerCLI::parseFileType(), openmsx::LaserdiscPlayerCLI::parseFileType(), and openmsx::CDImageCLI::parseOption().
void openmsx::Interpreter::init | ( | const char * | programName | ) |
Definition at line 72 of file Interpreter.cc.
Referenced by openmsx::CommandLineParser::parse().
bool openmsx::Interpreter::isComplete | ( | zstring_view | command | ) | const |
Definition at line 212 of file Interpreter.cc.
References zstring_view::c_str().
Referenced by openmsx::GlobalCommandController::isComplete().
|
delete |
TclParser openmsx::Interpreter::parse | ( | std::string_view | command | ) |
Definition at line 456 of file Interpreter.cc.
Referenced by openmsx::GlobalCommandController::tabCompletion().
void openmsx::Interpreter::poll | ( | ) |
Definition at line 450 of file Interpreter.cc.
Referenced by openmsx::EventDistributor::deliverEvents().
void openmsx::Interpreter::registerCommand | ( | zstring_view | name, |
Command & | command | ||
) |
Definition at line 156 of file Interpreter.cc.
References zstring_view::c_str(), and openmsx::Command::setToken().
Referenced by openmsx::GlobalCommandController::registerCommand().
void openmsx::Interpreter::registerSetting | ( | BaseSetting & | variable | ) |
Definition at line 271 of file Interpreter.cc.
References zstring_view::data(), openmsx::BaseSetting::getFullNameObj(), openmsx::TclObject::getString(), openmsx::BaseSetting::setValueDirect(), setVariable(), and TclObject.
Referenced by openmsx::GlobalCommandController::registerProxySetting(), openmsx::GlobalCommandController::registerSetting(), and openmsx::MSXCommandController::registerSetting().
|
inline |
Definition at line 27 of file Interpreter.hh.
Referenced by openmsx::CommandConsole::CommandConsole(), and openmsx::CommandConsole::~CommandConsole().
Definition at line 250 of file Interpreter.cc.
References openmsx::TclObject::getTclObjectNonConst().
Referenced by Interpreter(), registerSetting(), openmsx::Setting::setValue(), openmsx::Setting::setValueDirect(), and openmsx::MSXCommandController::transferSettings().
void openmsx::Interpreter::unregisterCommand | ( | Command & | command | ) |
Definition at line 164 of file Interpreter.cc.
References openmsx::Command::getToken().
Referenced by openmsx::GlobalCommandController::unregisterCommand().
void openmsx::Interpreter::unregisterSetting | ( | BaseSetting & | variable | ) |
Definition at line 323 of file Interpreter.cc.
References openmsx::BaseSetting::getFullName(), rfind_unguarded(), setting, and unsetVariable().
Referenced by openmsx::GlobalCommandController::unregisterProxySetting(), openmsx::GlobalCommandController::unregisterSetting(), and openmsx::MSXCommandController::unregisterSetting().
void openmsx::Interpreter::unsetVariable | ( | const char * | name | ) |
Definition at line 259 of file Interpreter.cc.
Referenced by unregisterSetting().
void openmsx::Interpreter::wrongNumArgs | ( | unsigned | argc, |
std::span< const TclObject > | tokens, | ||
const char * | message | ||
) |
Definition at line 461 of file Interpreter.cc.
Referenced by openmsx::Completer::checkNumArgs().
|
friend |
Definition at line 71 of file Interpreter.hh.
Referenced by execute(), executeFile(), Interpreter(), and registerSetting().