openMSX
|
#include <Interpreter.hh>
Public Member Functions | |
Interpreter () | |
Interpreter (const Interpreter &)=delete | |
Interpreter (Interpreter &&)=delete | |
Interpreter & | operator= (const Interpreter &)=delete |
Interpreter & | operator= (Interpreter &&)=delete |
~Interpreter () | |
void | setOutput (InterpreterOutput *output_) |
void | init (const char *programName) const |
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 | setVariable (const TclObject &arrayName, const TclObject &arrayIndex, 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. | |
void | deleteNamespace (const std::string &name) |
Delete the global namespace with given name. | |
TclParser | parse (std::string_view command) |
bool | validCommand (std::string_view command) |
bool | validExpression (std::string_view expression) |
void | poll () const |
void | wrongNumArgs (unsigned argc, std::span< const TclObject > tokens, const char *message) |
Friends | |
class | TclObject |
Definition at line 18 of file Interpreter.hh.
openmsx::Interpreter::Interpreter | ( | ) |
Definition at line 81 of file Interpreter.cc.
References openmsx::FileOperations::getSystemDataDir(), openmsx::FileOperations::getUserDataDir(), setVariable(), and TclObject.
|
delete |
|
delete |
openmsx::Interpreter::~Interpreter | ( | ) |
Definition at line 114 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 451 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 456 of file Interpreter.cc.
References execute(), and tmpStrCat().
Referenced by openmsx::MSXCommandController::~MSXCommandController().
TclObject openmsx::Interpreter::execute | ( | zstring_view | command | ) |
Definition at line 220 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 228 of file Interpreter.cc.
References zstring_view::c_str(), and TclObject.
Referenced by openmsx::GlobalCommandController::source().
TclObject openmsx::Interpreter::getCommandNames | ( | ) |
Definition at line 210 of file Interpreter.cc.
References execute().
bool openmsx::Interpreter::hasCommand | ( | zstring_view | name | ) | const |
Definition at line 153 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 | ) | const |
Definition at line 76 of file Interpreter.cc.
Referenced by openmsx::CommandLineParser::parse().
bool openmsx::Interpreter::isComplete | ( | zstring_view | command | ) | const |
Definition at line 215 of file Interpreter.cc.
References zstring_view::c_str().
Referenced by openmsx::GlobalCommandController::isComplete().
|
delete |
|
delete |
TclParser openmsx::Interpreter::parse | ( | std::string_view | command | ) |
Definition at line 467 of file Interpreter.cc.
Referenced by openmsx::GlobalCommandController::tabCompletion().
void openmsx::Interpreter::poll | ( | ) | const |
Definition at line 461 of file Interpreter.cc.
Referenced by openmsx::EventDistributor::deliverEvents().
void openmsx::Interpreter::registerCommand | ( | zstring_view | name, |
Command & | command | ||
) |
Definition at line 160 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 282 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 28 of file Interpreter.hh.
Referenced by openmsx::ImGuiConsole::ImGuiConsole().
void openmsx::Interpreter::setVariable | ( | const TclObject & | arrayName, |
const TclObject & | arrayIndex, | ||
const TclObject & | value | ||
) |
Definition at line 260 of file Interpreter.cc.
References openmsx::TclObject::getTclObjectNonConst().
Definition at line 251 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 168 of file Interpreter.cc.
References openmsx::Command::getToken().
Referenced by openmsx::GlobalCommandController::unregisterCommand().
void openmsx::Interpreter::unregisterSetting | ( | BaseSetting & | variable | ) |
Definition at line 334 of file Interpreter.cc.
References openmsx::BaseSetting::getFullName(), rfind_unguarded(), and unsetVariable().
Referenced by openmsx::GlobalCommandController::unregisterProxySetting(), openmsx::GlobalCommandController::unregisterSetting(), and openmsx::MSXCommandController::unregisterSetting().
void openmsx::Interpreter::unsetVariable | ( | const char * | name | ) |
Definition at line 269 of file Interpreter.cc.
Referenced by unregisterSetting().
bool openmsx::Interpreter::validCommand | ( | std::string_view | command | ) |
Definition at line 472 of file Interpreter.cc.
bool openmsx::Interpreter::validExpression | ( | std::string_view | expression | ) |
Definition at line 480 of file Interpreter.cc.
void openmsx::Interpreter::wrongNumArgs | ( | unsigned | argc, |
std::span< const TclObject > | tokens, | ||
const char * | message | ||
) |
Definition at line 488 of file Interpreter.cc.
Referenced by openmsx::Completer::checkNumArgs(), openmsx::Completer::checkNumArgs(), and openmsx::Completer::checkNumArgs().
|
friend |
Definition at line 75 of file Interpreter.hh.
Referenced by execute(), executeFile(), Interpreter(), and registerSetting().